Skip to content

profiles bind: show the vendor's profile label beside each candidate - #27

Merged
SSFSKIM merged 4 commits into
mainfrom
feat/bind-labels
Oct 5, 2026
Merged

SSFSKIM merged 4 commits into
mainfrom
feat/bind-labels

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

What

cua profiles bind <key> now shows, beside each live Google Chrome candidate, the profile label OpenAI's browser service attaches (profileName, present since #20 sends the sandbox state), or unlabelled when there is none, in both the interactive picker and --json.

personal was not bound: several live backends carry this profile's name
live backends:
  1) extension instance inst-a  2 tab(s)  labelled "Work" (another profile's name)
  2) extension instance inst-b  5 tab(s)  labelled "Personal" (this profile's name)
  3) extension instance inst-c  ? tab(s)  unlabelled
  4) extension instance inst-d  1 tab(s)  labelled "Personal" (this profile's name)
rerun with the instance of this Chrome profile: cua profiles bind personal --extension-instance-id <id>

--json entries gain profileName (null when unlabelled); the existing label classification (this-profile / other-profile / unlabelled / comparison-unknown) is kept. Printed labels are JSON-quoted with C1 controls and bidi overrides escaped, so a label cannot drive the terminal or reorder the rows.

Binding rule (owner's decision on this PR)

M11's automatic branch is kept now that labels exist. When the registered profile's Local State display name is unique among Chrome profiles and exactly one live Chrome backend carries it, bind binds that backend (how: "automatic"). It then prints the candidates with that backend marked <- likely match (likelyMatch: true in --json), so the user sees which label decided it.

Every other case is outcome: "pick_required" with the reason, and needs the user's pick: no labels, an unknown or unreadable name, a name shared by another profile, two backends carrying the name, or no backend carrying it. undetermined remains only for no_live_backends. --extension-instance-id and the interactive picker are unchanged, and a pick is still refused when the runtime labels that backend as another profile.

Privacy: vendor labels on bind candidates are shown to the user, which supersedes M11's "display names never leave" rule for them; they are still never stored. The registered profile's own Local State name is not reported, and a non-Chrome backend still leaves only its family. The spec Decision Log entry records this.

Not in this PR (step 2 of #21)

cua's own instance-id → profile-directory mapping (reading copies of each profile's extension settings store) is out of scope. It is what disambiguates profiles that share a display name; until then those cases need the user's pick.

Verification

  • npm test: 416/416. Tests cover:
    • the automatic case (unique name + one labelled backend → bound, registry written, likely match marked);
    • the ambiguity cases (shared name, or two backends with the name → pick_required, nothing written);
    • unlabelled, unreadable-Local-State and non-Chrome (Edge, family-less) backends;
    • a CLI end-to-end run of cua profiles bind text and --json against the fake runtime in a scratch home.
  • Live, read-only, default CUA_HOME (first revision; bind was never run against the real registry):
    • profiles list --json was unchanged in shape.
    • The only unbound key (work) is refused before any launch (extension not installed).
    • The tab-free listing returned two live Chrome backends labelled "ssfs.org" and "Minhyeok".
    • The registry checksum was identical before and after.
  • Reviews: reviewer-medium on the first revision found one real issue (C1 controls in printed labels), fixed in 399ccb3. A reviewer-low pass on the restoration commit follows.

Part of #21

…bind without a pick

profiles bind now lists each live Chrome backend with its profileName (the label
the vendor's enrichment attaches since #20), or unlabelled, interactively and in
--json. M11's automatic branch is removed: its rule only marks the likely match
for the user to confirm, and an unpicked bind returns pick_required.

Part of #21 (step 1; the directory mapping is step 2).
JSON quoting leaves U+0080-U+009F raw, and U+009B is a CSI in C1-aware
terminals, so a vendor label could erase the candidates the user picks from.

Part of #21
@SSFSKIM

SSFSKIM commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

Independent review (reviewer-medium): verdict was incorrect on one P2 finding. The no-pick path, the likely-match rule, family filtering and the acceptance test-name claims all matched the intent, and tests passed 415/415. The finding: JSON quoting leaves C1 controls raw (U+009B is a CSI), so a vendor label could erase the printed candidates in a C1-aware terminal. Fixed in the head commit: the text renderer now also escapes U+0080–U+009F and bidi overrides, and the CLI end-to-end test checks this. npm test 415/415. --json output keeps the raw string; it is machine output and parses to the same value.

…on on #27)

When the registered profile's Local State display name is unique and exactly one
live Chrome backend carries it, bind binds it as M11 designed and lists the
candidates with that backend marked as the likely match. Every other case stays
pick_required with labelled candidates. The Decision Log entry is replaced and
M11's superseded note dropped.

Part of #21
@SSFSKIM SSFSKIM changed the title profiles bind: show the vendor's profile label beside each candidate; never bind without a pick profiles bind: show the vendor's profile label beside each candidate Oct 5, 2026
@SSFSKIM

SSFSKIM commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

Reviewer-low pass on the restoration commit 52f4088 (399ccb3..52f4088): verdict correct, no material findings. npm test passed 416/416, and every acceptance suite claim matched an exact passing test name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant