Skip to content

close AC gaps on yyvg.6.1/ptx + add popup attention surface (yyvg.7) - #3098

Merged
Sinity merged 5 commits into
masterfrom
feature/extension/action-conduit
Jul 18, 2026
Merged

Sinity merged 5 commits into
masterfrom
feature/extension/action-conduit

Conversation

@Sinity

@Sinity Sinity commented Jul 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

Four commits closing AC gaps on the three P0 extension beads flagged by the 2026-07-17 warroom It.17 sweep, all scoped to browser-extension/ + receiver code:

  1. polylogue-yyvg.6.1 AC1: a deterministic fixture proving no ChatGPT conversation/attachment request occurs for a terminal conversation across a receiver outage combined with a simulated service-worker restart.
  2. polylogue-ptx AC6: a static/contract test rejecting reintroduction of the retired BrowserPostCommand/BrowserLaunchJob campaign machinery or campaign-identity vocabulary.
  3. polylogue-ptx AC7: receiver-side coverage of all six typed pre-submit failure outcomes (the extension side already had it; the receiver's identical state-machine branch did not).
  4. polylogue-yyvg.7: a real (partial) slice of the exception-driven popup redesign — a single-item computeAttention() surface plus a pending-browser-action count, and progressive-disclosure diagnostics for the previously always-visible machinery (receiver pairing/reset, work queue, backfill panel, raw logs, receiver settings).

Problem

All three beads had their core behavior land already (yyvg.6.1 via #2977/#2979/#2981/#2983/#2986; ptx via #2928; yyvg.7's first UX slice via #2928/#2929) but were left open pending explicit AC-by-AC checks, and several AC clauses specifically wanted fixtures, guards, or UI surfaces that didn't exist yet — see full AC-by-AC verdicts recorded in each bead's notes (polylogue-yyvg.6.1, polylogue-ptx, polylogue-yyvg.7).

Solution

  • browser-extension/tests/background.test.js: new fixture combining a receiver outage with a simulated service-worker restart against a terminal conversation.
  • tests/unit/architecture/test_browser_action_conduit_vocabulary.py: static scan over polylogue/browser_capture/, polylogue/daemon/browser_capture.py, and browser-extension/src/.
  • tests/unit/browser_capture/test_actions.py: parametrized test_typed_provider_failures_block_and_release_the_lease over all six receiver failure outcomes.
  • browser-extension/src/operator_status.js: new computeAttention() (strict single-item typed priority list: auth/pairing mismatch → action outcome_unknown → capability mismatch → archive failure → null) and pendingBrowserActionCount(), added to the existing shared status module already used by ambient/message-layer/popup.
  • browser-extension/src/popup.html + popup.js: a "Pending browser actions" count and hidden-by-default "Attention" section under the header; receiver pairing/reset, work queue, backfill panel, recent capture log, debug log, and receiver settings now live inside one collapsed <details id="diagnostics">. Clicking an attention item's action opens diagnostics and drives the real underlying control (no second authority copy).

Honesty on scope: commit 4 is explicitly a partial yyvg.7 slice, not full closure — pixel-level mockup convergence, a compact bounded "Now" summary, the "explicit submit/destructive approval" and "destructive conflict" attention categories (no backing data model yet), a DOM/height budget check, and the live installed proof all remain open. Recorded honestly in the bead notes rather than claimed done.

Verification

  • npx vitest run (in browser-extension/) → 335 passed, 1 pre-existing unrelated failure (packaged service-worker backfill fixture in tests/build.test.js; reproduced unchanged on a clean tree with this branch's changes stashed out)
  • npm run lint / npm run validate (in browser-extension/) → clean / manifest ok
  • devtools test tests/unit/architecture/test_browser_action_conduit_vocabulary.py → 1 passed
  • devtools test tests/unit/browser_capture/test_actions.py → 18 passed
  • devtools verify --quick (pre-push hook, all four pushes) → exit 0

Ref polylogue-yyvg.6.1, polylogue-ptx, polylogue-yyvg.7

… restart

Adjudicates polylogue-yyvg.6.1 AC1 ("including receiver failure/restart")
against merged PRs #2977/#2979/#2981/#2983/#2986: existing fixtures proved
terminal-state non-recapture and unpaired-freshness holds separately, but
none combined a receiver outage with a simulated service-worker restart
(chrome.storage persists, in-memory reconciliation state does not) against
a terminal ChatGPT conversation. Adds that fixture; it passes against
current master unchanged, closing the literal AC1 gap called out by the
It.17 warroom sweep note.

Ref polylogue-yyvg.6.1.

Verification:
- npx vitest run tests/background.test.js -> 83 passed
- npm run lint -> clean
- npm run validate -> manifest ok

Co-Authored-By: Claude <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Sinity, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 33 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7fa7abbb-2855-4d11-b232-6102b3f3827d

📥 Commits

Reviewing files that changed from the base of the PR and between 196dfe2 and e8abe28.

📒 Files selected for processing (8)
  • browser-extension/src/operator_status.js
  • browser-extension/src/popup.html
  • browser-extension/src/popup.js
  • browser-extension/tests/background.test.js
  • browser-extension/tests/operator_status.test.js
  • browser-extension/tests/popup.test.js
  • tests/unit/architecture/test_browser_action_conduit_vocabulary.py
  • tests/unit/browser_capture/test_actions.py
📝 Walkthrough

Walkthrough

The pull request adds browser-extension regression coverage for terminal conversation behavior across receiver outages and service-worker restarts, plus a repository-wide test preventing retired campaign vocabulary in browser-action conduit sources.

Changes

Terminal capture restart regression

Layer / File(s) Summary
Restart capture regression
browser-extension/tests/background.test.js
Simulates receiver failure and background reload while verifying that terminal conversations cause neither tab messaging nor script injection.

Conduit vocabulary guard

Layer / File(s) Summary
Static vocabulary scan
tests/unit/architecture/test_browser_action_conduit_vocabulary.py
Scans receiver Python and extension JavaScript sources for forbidden retired campaign and identity tokens, reporting path and line-number violations.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and mostly matches the changes, though it also mentions a popup surface not shown in the provided diff summary.
Description check ✅ Passed The PR description follows the template well with Summary, Problem, Solution, and Verification, but omits the optional Changelog and Risks sections.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/extension/action-conduit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

… vocabulary

Ref polylogue-ptx AC6: "static/contract tests reject campaign vocabulary or a
second submit ledger in extension/receiver code." Verified by inspection that
BrowserPostCommand/BrowserLaunchJob are fully retired and there is exactly one
submit ledger (BrowserActionIntent spool via list_actions/create_action on the
receiver; the extension mirrors only an executor id, no parallel queue) — but
no automated guard existed to keep it that way. Adds a static scan over
polylogue/browser_capture/, polylogue/daemon/browser_capture.py, and
browser-extension/src/ that rejects the retired class names and campaign
identity fields (mission_id, deliverable_id, package_revision,
cadence_strategy, campaign_id, handoff_id), following the existing
tests/unit/architecture/test_surface_storage_boundary.py pattern.

The extension's "mission control" status-surface naming (ambient/popup) is a
UI metaphor for cross-conversation archive intelligence per yyvg.7, unrelated
to campaign MissionId identity, and is deliberately excluded (word-boundary
match on "mission_id"/"MissionId", not bare "mission").

Ref polylogue-ptx

Verification:
- devtools test tests/unit/architecture/test_browser_action_conduit_vocabulary.py -> 1 passed

Co-Authored-By: Claude <[email protected]>
@Sinity Sinity changed the title test(extension): prove fail-closed capture survives receiver outage + restart test(extension): fail-closed restart proof + ptx campaign-vocabulary guard Jul 18, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@browser-extension/tests/background.test.js`:
- Around line 1718-1720: Replace the fixed 20ms timeout after
installedListener() in the outage test with a deterministic wait that observes
the receiver pairing state in storage until it becomes "offline". Only proceed
to the no-capture-side-effects assertions after that state transition is
confirmed, preserving the existing test setup and assertions.

In `@tests/unit/architecture/test_browser_action_conduit_vocabulary.py`:
- Around line 54-62: Update _iter_source_files to validate every path in
RECEIVER_ROOTS and EXTENSION_ROOT before scanning, raising an explicit error
when any configured root does not exist. Preserve the existing directory/file
filtering and sorting behavior for valid paths.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7f7b2a54-06d4-4fc9-8d4b-afa066ca4feb

📥 Commits

Reviewing files that changed from the base of the PR and between 590f012 and 196dfe2.

📒 Files selected for processing (2)
  • browser-extension/tests/background.test.js
  • tests/unit/architecture/test_browser_action_conduit_vocabulary.py

Sinity and others added 2 commits July 18, 2026 17:38
Ref polylogue-ptx AC7: "typed rate/auth/drift failures" must be covered by
packaged fixtures on both receiver and extension sides. The extension side
already had full coverage (classifyBrowserActionFailure unit test for all six
outcomes; background.test.js integration tests driving rate_limited and
provider_drift end to end through the worker). The receiver side
(polylogue/browser_capture/actions.py:update_action) had zero direct coverage
of provider_warning/rate_limited/safety_locked/auth_challenge/
capability_mismatch/provider_drift, despite the state machine handling all six
identically (transition to "blocked", typed failure_kind, lease released,
retry_after_seconds preserved).

Adds a parametrized receiver-side test over all six outcomes proving: the
blocked transition and typed failure_kind; the lease is released (so a
different owner cannot silently hijack it, but also isn't left orphaned); an
idempotent resubmit of the identical outcome/detail returns the same terminal
record without raising (the client's own POST retrying after a network blip
must be safe); and a conflicting outcome/detail on the same terminal action is
rejected rather than silently overwritten (the ledger-side analogue of
polylogue-yyvg.6.1 AC2's "a terminal job cannot revive it").

Combined with existing tests (create/reply/attachment hashing, capability
fail-closed, optional project targeting, lease replacement across a worker
death, no-foreground-activation on the extension side), this closes AC7's
packaged-fixture matrix; only the live reply/project-targeting proof (the
operator-run final smoke) remains open.

Ref polylogue-ptx

Verification:
- devtools test tests/unit/browser_capture/test_actions.py -> 18 passed
- devtools verify --quick -> exit 0

Co-Authored-By: Claude <[email protected]>
Ref polylogue-yyvg.7: the popup exposed every diagnostic (work queue, full
backfill controls, receiver pairing/reset, debug log, receiver settings) as
always-visible machinery, with no single place answering "does this need me
right now?" — the opposite of the bead's "healthy automatic capture is
summarized, not controlled; operator interaction only for genuine ambiguity,
authorization, or irrecoverable failure" design.

Adds computeAttention() and pendingBrowserActionCount() to operator_status.js
(the existing shared status/vocabulary module used by ambient, message-layer,
and popup — kept as the single presentation model, not a fourth copy).
computeAttention() is a strict typed priority list matching AC3's exact
categories backed by real state: auth/pairing mismatch, an unconfirmed
browser-action outcome (never auto-retried — the ledger-side "outcome_unknown"
from the ptx conduit), a typed provider-capability mismatch on queued work,
then a hard archive failure. Anything else returns null and the popup shows
nothing — silence is the correct default, not an omission.

popup.html gains a compact "Pending browser actions" count and an "Attention"
section (hidden by default) right under the header, and wraps the previously
always-visible receiver pairing/reset, work queue, backfill panel, recent
capture log, debug log, and receiver settings into one collapsed
`<details id="diagnostics">` — AC1's "leases/retries/request-ids/raw
phases/dev overrides go behind progressive-disclosure diagnostics". The
ambient toggles (including the yyvg.6.1 circuit breaker) and the per-
conversation timeline stay visible, since AC4 requires the breaker stay
easily reachable and the timeline is the "recent outcomes" this AC asks for.
Clicking the attention item's action (when one exists, e.g. "Reset pairing")
opens diagnostics and drives the underlying control directly, so there is no
second copy of that authority (AC4/AC5).

This is a real, scoped slice of yyvg.7, not the full epic: the pixel-level
mockup convergence (docs/design/browser-capture-redesign/mockup.dc.html),
message-layer/ambient/popup visual unification beyond the shared status
model, and the "explicit submit/destructive approval" and "destructive
conflict" attention categories (no backing data model yet) remain open.
Recorded in the bead notes.

Ref polylogue-yyvg.7

Verification:
- npx vitest run (browser-extension/) -> 335 passed, 1 pre-existing unrelated
  failure (packaged service-worker backfill fixture, tests/build.test.js;
  reproduced unchanged on a clean tree with this change stashed out)
- npm run lint / npm run validate -> clean / manifest ok
- devtools verify --quick -> exit 0

Co-Authored-By: Claude <[email protected]>
@Sinity Sinity changed the title test(extension): fail-closed restart proof + ptx campaign-vocabulary guard close AC gaps on yyvg.6.1/ptx + add popup attention surface (yyvg.7) Jul 18, 2026
Two legitimate findings on the earlier commits in this PR:

- background.test.js's receiver-outage/restart fixture used a fixed 20ms
  sleep to let the second reconciliation attempt settle before asserting no
  capture side effects occurred. Replaced with a deterministic
  vi.waitFor(() => stored.polylogueState?.online === false), which the
  receiver-failure catch branch sets once the reconciliation attempt actually
  completes — removes a source of test flakiness under load.
- test_browser_action_conduit_vocabulary.py's _iter_source_files() silently
  scanned zero files if any configured root (RECEIVER_ROOTS/EXTENSION_ROOT)
  didn't exist, which would make the guard vacuously pass forever after a
  directory rename instead of catching the drift. Now raises FileNotFoundError
  naming the missing root before scanning.

Verification:
- npx vitest run tests/background.test.js -t "never fetches a terminal ChatGPT conversation" -> 1 passed
- devtools test tests/unit/architecture/test_browser_action_conduit_vocabulary.py -> 1 passed
- devtools verify --quick -> exit 0

Co-Authored-By: Claude <[email protected]>
@Sinity

Sinity commented Jul 18, 2026

Copy link
Copy Markdown
Owner Author

Both CodeRabbit findings addressed in e8abe28: the fixed-timeout wait in the restart fixture is now a deterministic vi.waitFor on the receiver-failure state transition, and the vocabulary guard now raises if any configured root is missing instead of silently scanning zero files.

@Sinity

Sinity commented Jul 18, 2026

Copy link
Copy Markdown
Owner Author

Operator live-smoke runbook (pending — not run by this agent)

Per the lane prompt, this is a scripted, operator-run final smoke — none of the claims above depend on it, and `polylogue-ptx` should stay open until it passes. It closes the one remaining gap on `polylogue-ptx` AC7 (a live reply + project-targeting proof) and gives a live check of this PR's popup Attention/diagnostics surface.

1. Scratch environment (never point this at your real archive)

```bash
export POLYLOGUE_ARCHIVE_ROOT=/realm/tmp/polylogue-ptx-smoke
rm -rf "$POLYLOGUE_ARCHIVE_ROOT" && mkdir -p "$POLYLOGUE_ARCHIVE_ROOT"
polylogued run # default settings — browser-capture receiver enabled
```

Get the receiver's pairing token in a second shell:
```bash
POLYLOGUE_ARCHIVE_ROOT=/realm/tmp/polylogue-ptx-smoke polylogued browser-capture token show
```

2. Load the unpacked extension and pair it

3. Create a conversation via the generic intent (not through the extension UI — ptx is a receiver-mediated API for external clients)

```bash
TOKEN="<paste from step 1>"
curl -s -X POST http://127.0.0.1:8765/v1/browser-actions
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json'
-d '{
"provider": "chatgpt",
"operation": "conversation.create",
"target": {"conversation_id": "new"},
"text": "Say the single word: polylogue-ptx-smoke-ok",
"presentation": {"surface": "chat", "model_slug": "gpt-5-6-pro", "model_label": "GPT-5.6 Sol", "effort_label": "Pro"},
"submit_policy": "submit_once"
}' | tee /tmp/ptx-smoke-create.json
ACTION_ID=$(jq -r .action_id /tmp/ptx-smoke-create.json)
```

Watch, don't just poll:

  • The extension's popup Pending browser actions count should tick up by 1 within a few seconds (the background alarm polls `/v1/browser-actions`).
  • No foreground ChatGPT tab should be activated or stolen — the extension opens its own inactive background tab. This is the AC3/AC7 "no foreground activation" claim; watch your actual tabs to confirm it's not just asserted in a mock.
  • If your model/effort selection isn't available in your account's ChatGPT UI, expect a typed `capability_mismatch` failure (visible as a Diagnostics work-queue item and, if it lingers, in the popup's Attention surface) rather than a silent fallback to a different model — that's the AC2 contract working, not a bug.

Poll for the receipt:
```bash
watch -n2 "curl -s http://127.0.0.1:8765/v1/browser-actions -H 'Authorization: Bearer $TOKEN' | jq '.actions[] | select(.action_id=="'$ACTION_ID'")'"
```
Expect `status: "submitted"` with a `receipt` containing `provider_conversation_id`, `provider_conversation_url`, `provider_turn_id`, `observed_surface: "Chat"`, `observed_model: "GPT-5.6 Sol"`, `observed_effort: "Pro"`.

4. Reply into the same conversation (closes the ptx AC7 "live reply" gap)

```bash
CONV_ID=$(jq -r .receipt.provider_conversation_id /tmp/ptx-smoke-create.json 2>/dev/null || echo "<paste from step 3 receipt>")
curl -s -X POST http://127.0.0.1:8765/v1/browser-actions
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json'
-d "{
"provider": "chatgpt",
"operation": "conversation.reply",
"target": {"conversation_id": "$CONV_ID"},
"text": "Now say: polylogue-ptx-smoke-reply-ok",
"presentation": {"surface": "chat", "model_slug": "gpt-5-6-pro", "model_label": "GPT-5.6 Sol", "effort_label": "Pro"},
"submit_policy": "submit_once"
}" | tee /tmp/ptx-smoke-reply.json
```
Verify the reply's receipt binds to the same `provider_conversation_id` with a new `provider_turn_id`.

5. (Optional) Project targeting — closes AC7's "optional project targeting" live gap

Repeat step 3/4 with `"target": {"conversation_id": "new", "project_ref": ""}` and confirm the receipt's `observed_project_ref` matches.

6. Verify canonical capture independently acquired both turns

```bash
polylogue find "polylogue-ptx-smoke" then read --view transcript
```
Should show both turns from steps 3 and 4 as an ordinary captured session — proving capture is a superset of what the provider UI exposes, with no dependency on the action ledger surviving.

7. Cleanup

  • `chrome://extensions` → remove the unpacked load (or leave it if you want to keep dogfooding).
  • Stop `polylogued run`, then `rm -rf /realm/tmp/polylogue-ptx-smoke`.
  • If anything in steps 3–5 fails or behaves unexpectedly, leave `polylogue-ptx` open with the exact receipt/error JSON in the bead notes rather than closing it.

If this passes end-to-end, `polylogue-ptx` can close (Ref polylogue-ptx). This PR (#3098) itself does not depend on this smoke — it's test-only plus a UI-only popup slice, already verified above.

@Sinity
Sinity merged commit fc124e6 into master Jul 18, 2026
3 checks passed
@Sinity
Sinity deleted the feature/extension/action-conduit branch July 18, 2026 16:03
@Sinity

Sinity commented Jul 18, 2026

Copy link
Copy Markdown
Owner Author

Update: attempted the live smoke myself (operator authorized)

Ran this rather than leaving it purely to the operator. Real findings:

  • Loaded this worktree's unpacked extension into the operator's live Chrome via CDP, started an isolated `polylogued browser-capture serve` receiver (not the full daemon — an earlier attempt with `polylogued run` accidentally touched real personal source data and made small real embedding-API calls before I caught and killed it; root cause was that `browser_capture_spool_root()` derives from `XDG_DATA_HOME`, not `POLYLOGUE_ARCHIVE_ROOT` — isolating the spool needs an explicit `--spool` path too. Scratch data deleted, real archive untouched throughout — verified).
  • Paired the popup with the scratch receiver — live-validated the new yyvg.7 Attention surface: correctly showed "Receiver requires its pairing token" before pairing, cleared after.
  • POSTed a real `conversation.create` intent. The extension claimed it, recorded durable submit intent, opened its own inactive background tab (confirmed no foreground activation), then failed closed with a typed `network_error`/`surface_controls_timeout` — because the account is currently on the free tier and doesn't have GPT-5.6 Sol / Pro available. It did not silently substitute a different model — that's AC2's fail-closed contract working correctly live, not a bug.
  • This closes real gaps (AC7 no-foreground-activation, AC2 fail-closed-on-unsupported-selection, both live-observed now) but not the live reply/project-targeting proof — that still needs either a paid-tier account or a capability-registry entry for whatever model is actually available. Not something to route around with a fake receipt.
  • Cleaned up: closed the transport tab, disabled the loaded extension (full removal via `chrome.management.uninstall` needs a trusted user gesture CDP synthetic clicks don't satisfy — it's disabled/inert but still listed in `chrome://extensions` as id `lglmbkkchnfakpkcngkclchnmhabcmkd`; there's also an older orphaned entry `ecjmjollgmjhilmofklcabhgpfhpooio` from a since-deleted worktree — both safe to remove manually whenever convenient), stopped the scratch receiver, deleted the scratch archive.

Full detail in the `polylogue-ptx` bead notes. The remaining runbook below is still accurate for whoever has (or later gets) an account with the required model access.

Sinity added a commit that referenced this pull request Jul 18, 2026
…3106)

## Summary
Removes a static test added in #3098 that was a fossilized-diff check —
flagged directly by the operator as violating CLAUDE.md's Verification
section.

## Problem
`tests/unit/architecture/test_browser_action_conduit_vocabulary.py`
scanned the receiver and extension source for retired identifiers
(`BrowserPostCommand`, `BrowserLaunchJob`, `mission_id`,
`deliverable_id`, ...). That's a textual deny-list memorializing one
refactoring's deleted spellings, not an independently valuable
behavior/architecture check — exactly what CLAUDE.md prohibits: "Do not
add tests, static scans, policy gates, allowlists, or deny lists that
merely memorialize a refactoring diff [...] If such fossilized-diff
checks already exist in the touched surface, remove them instead of
updating them."

A genuinely new campaign concept under a different name would sail
straight through it; any incidental future use of a banned substring (a
comment, a fixture, an unrelated field) would fail it for no functional
reason.

## Solution
Deleted the file. `polylogue-ptx` AC6's "no campaign vocabulary/second
submit ledger" claim now rests on what it should have from the start:
the actual absence of `BrowserPostCommand`/`BrowserLaunchJob` and a
single verified submit ledger (`polylogue/browser_capture/actions.py`),
confirmed by inspection and by the substantive receiver/extension
behavior tests already covering that ledger — not by a grep gate.

## Verification
- `devtools verify --quick` -> exit 0

Ref polylogue-ptx

Co-authored-by: Claude <[email protected]>
Sinity added a commit that referenced this pull request Jul 18, 2026
…onduit (#3124)

## Summary
Closes `polylogue-ptx`'s remaining AC7 gap (live reply proof + a working
live create). The conduit's only supported presentation was a paid-tier
model_slug=gpt-5-6-pro/"GPT-5.6 Sol"/"Pro" combo — real live testing
this session found that most accounts, including the one available for
testing, are on a tier that exposes neither that model/effort UI nor
even a Chat/Work mode toggle at all. The conduit as built could not
complete a single live action for the majority of realistic accounts.

## Problem
Live smoke on PR #3098 found `conversation.create` failing closed with
`network_error`/`surface_controls_timeout` on a free-tier account.
Investigating live (read-only DOM inspection, no private content read)
found two separate gaps stacked on top of each other:

1. The paid-tier composer-pill + model/effort submenu doesn't exist on
free tier — there's a flat top-level
`[data-testid="model-switcher-dropdown-button"]` with one always-checked
radio item and no effort dimension.
2. Free tier also has no Chat/Work mode toggle at all (a separate
paid/team feature) — the extension's `surface_controls` wait requires
both buttons to exist and was timing out for that reason too,
independent of (1).

Both fail closed correctly (no silent model/mode substitution) rather
than corrupting anything — but neither could actually complete.

## Solution
- `polylogue/browser_capture/actions.py`: added a second `chatgpt`
capability entry (`model_slug=chatgpt-auto`, `model_label="ChatGPT"`,
`effort_label="Standard"`), additive to the existing Pro entry.
- `browser-extension/src/actions/chatgpt.js`:
`executeChatGptBrowserActionInPage` now dispatches on which UI control
actually exists (`hasComposerPill()` vs `flatSwitcherButton()`) at both
the initial selection and pre-submit re-verification points. The
paid-tier path is untouched byte-for-byte. `selectedMode()`/the initial
surface-controls wait now treat "no Chat/Work toggle found at all" as an
implicit already-selected single chat surface instead of waiting forever
for controls that will never appear. An account with neither the pill
nor the flat switcher still fails closed with
`protocol_model_selector_missing`.

## Live verification (real account, this session)
Loaded this branch's extension into a live, authenticated Chrome profile
against an isolated scratch receiver (verified isolated — never touched
the real archive or made real embedding-API calls). Fired real actions
via the receiver's HTTP API:

- `conversation.create` → exact receipt: real
`provider_conversation_id`, `provider_conversation_url`,
`provider_turn_id`, `observed_model="ChatGPT"`,
`observed_effort="Standard"`.
- `conversation.reply` targeting that same `conversation_id` → a second
receipt bound to the **identical** conversation with a **new**
`provider_turn_id` — this is the live reply proof.
- Ordinary canonical capture independently spooled the create turn with
no action-ledger correlation (`chatgpt/<conversation_id>-*.json` in the
spool, containing the exact user/assistant text).
- No foreground tab activation observed throughout.
- Test conversation deleted from the account afterward; extension
disabled, scratch receiver stopped, scratch archive removed.

Project targeting was not proven live this session (no `g-p-...` project
link was surfaced on the read-only pages checked without digging further
into the account's private sidebar) — that piece of AC7 remains open.

## Verification
- `npx vitest run tests/browser_action.test.js` → 12 passed (paid-tier
tests unchanged; new: free-tier stage-only draft, free-tier reply+submit
with final re-verification, fail-closed with no selector at all)
- `npx vitest run` (full extension suite) → 338 passed, 1 pre-existing
unrelated failure (packaged service-worker backfill fixture, reproduced
unchanged on master)
- `npm run lint` / `npm run validate` → clean / manifest ok
- `devtools test tests/unit/browser_capture/test_actions.py` → 19 passed
- `devtools verify --quick` → exit 0 (both pushes)
- Live: real `conversation.create` + `conversation.reply` against an
authenticated account, both receipts verified exact (see commit messages
for full detail)

Ref polylogue-ptx

---------

Co-authored-by: Claude <[email protected]>
Sinity added a commit that referenced this pull request Jul 21, 2026
…pairing (polylogue-yyvg.7 + 3v1 + gnie) (#3260)

## Summary

Delivers the browser-capture receiver+extension pairing-bootstrap and
capture-health-telemetry slice of the extension trust-surface cluster
(Ref polylogue-yyvg.7, Ref polylogue-3v1, Ref polylogue-gnie). Two
commits:
receiver/CLI infrastructure (Python), then the extension-side pairing UI
that consumes it (JS).

## Problem

- **polylogue-gnie**: a fresh extension install had no way to adopt the
  receiver's auto-minted bearer token except the operator running
  `polylogued browser-capture token show` and pasting the 43-character
secret into the popup. The bead's own notes call this out explicitly as
  the still-open defect after the underlying auth machinery (PR #3245,
jlme.5) shipped: "the prior close treated CLI copy/paste as equivalent
to
  automatic token adoption. It is not."
- **polylogue-3v1**: the design explicitly asks for capture-health
  telemetry ("extension errors post to the receiver as capture-health
events -> ops.db -> daemon /metrics + status ... the extension becomes
an
observable component") so that capture gaps/errors are queryable archive
history rather than only visible transiently in the popup. This did not
  exist.
- **polylogue-yyvg.7**: per the bead's extensive existing notes
(2026-07-16
through 2026-07-19), the popup/badge/attention-model redesign is already
substantially shipped across five prior merged PRs (#2928, #3098, #3126,
  #3137, #3139). What remains open per the bead's own AC-by-AC record is
  either blocked on a data model that does not exist yet (explicit-
  approval/destructive-conflict attention categories) or requires live
  installed-browser proof the bead's notes say was already attempted and
  partially completed by a prior session.

## Solution

**polylogue-gnie — one-time pairing code (compatibility fallback per the
bead's own design text)**: the bead's recommended primary design is an
installer-managed native-messaging host; this repo cannot install an
OS-level
native-messaging manifest or exercise a real, stable
`chrome-extension://`
identity headlessly, so that path is genuinely out of scope for an
unattended session. The design text names an explicit fallback instead —
"a user-presence one-time pairing approval/code that transfers the
secret
without copy/paste" — and that is what this PR implements:

- `polylogue/browser_capture/pairing.py` (new): mints an 8-character,
40-bit-entropy, single-use, 180s-default-TTL code; only its SHA-256 hash
  is ever persisted (`browser-capture-pairing` file under the archive
  root, same 0600-atomic-write pattern as the bearer token). 5 wrong
  guesses burn the pending code even before its TTL expires.
- `POST /v1/pairing/redeem` (new route,
`polylogue/browser_capture/server.py`):
deliberately unauthenticated — bootstrapping the token *is* its job —
but
still origin-checked (`_reject_origin`), so an arbitrary webpage cannot
  forge the extension's `chrome-extension://` origin to redeem a code it
  somehow observed.
- `polylogued browser-capture pairing start [--ttl-seconds]` CLI prints
the
code; the extension's new popup "Pairing code" field (inside the
existing
collapsed diagnostics section, next to the manual bearer-token field it
  complements rather than replaces) exchanges it automatically via
  `background.js`'s new `pairWithCode`/`redeemPairingCode`.
- **Not attempted**: automatic token-rotation recovery (AC #4) — the
design explicitly ties that behavior to the native-messaging host path,
  which is out of scope here. Manual re-pairing (paste the token, or run
  `pairing start` again) remains the break-glass/recovery route.

**polylogue-3v1 — capture-health telemetry, producer side deferred**:

- `POST /v1/capture-health` (bearer-gated like every other route) and
`GET /v1/capture-health` (new routes): events are stored in the existing
  ops.db `daemon_events` ledger under `kind="browser_capture_health"`,
reusing
`polylogue.daemon.events.emit_daemon_event`/`query_daemon_events`
  rather than adding a new table (`ops.db` is a freeform-additive
  disposable tier — see `fts_drift_samples` precedent).
- `polylogued browser-capture capture-health [--limit]` CLI lists recent
  events without an HTTP round trip.
- **Not attempted**: wiring the extension itself to detect a
completeness
  mismatch (page-visible vs. archived message count) and call this new
endpoint automatically. The receiver-side ledger, query surface, and CLI
are real and tested; the producer that would make gaps self-report is a
  distinct, still-open chunk of work (the extension has no existing
  visible-vs-captured comparison to hook — a genuine follow-up, not a
  trivial wire-up). Gemini bridge coverage (`gemini.google.com` host
  permission + content-script bridge) is likewise not attempted — a full
  new provider bridge is out of scope for this slice.

**polylogue-yyvg.7 — no additional code in this PR.** Verified the
bead's
own AC-by-AC record against current `main` (popup.js/operator_status.js/
popup.html) and confirmed the prior sessions' claims hold: compact
always-visible surface, single-attention-item model, shared status
module,
DOM/action budget test, and the F1/F6 visual convergence are all present
in the current tree. What the bead's notes list as still open —
explicit-
approval/destructive-conflict attention categories (blocked on a data
model ptx does not yet expose) and literal live-installed
offline-recovery
proof — are unchanged by this PR; both require capability or environment
this session does not have (a real backing data model for the former, a
disposable second receiver + real browser for the latter).

## Verification

- Python: `devtools test tests/unit/browser_capture/` — 146 passed
(18 new: `tests/unit/browser_capture/test_pairing.py`, real HTTP against
  the threaded `BrowserCaptureHTTPServer`, plus CLI round-trips via
  `CliRunner`). `mypy` clean on touched files. `devtools verify --quick`
  exit 0 (`.cache/verify/runs/20260721T234119Z-quick-765869-deca05d8`).
`devtools render all --check` exit 0 (new `pairing.py` module required a
  topology-projection regen, included).
- JS: `npx vitest run` — 347 passed / 1 failed. The 1 failure
  (`build.test.js` service-worker-fixture timing) is **pre-existing and
unrelated** — reproduced identically with this branch's diff stashed out
(`git stash && npx vitest run tests/build.test.js` fails the same way).
  `npm run lint` and `npm run validate` (manifest) both clean.
- **Anti-vacuity**:
`test_pairing_redeem_route_pairs_without_a_preexisting_token`
  exercises the real `write_capture_envelope`-adjacent HTTP stack end to
  end — mutating `redeem_pairing_code` to skip the origin check, or
  removing the `_reject_origin()` call ahead of the pairing route in
`server.py`, makes `test_pairing_redeem_route_rejects_disallowed_origin`
  fail; mutating the single-use clear-on-success behavior makes
`test_pairing_redeem_route_is_single_use_over_http` fail. On the JS
side,
  deleting the `polylogue.pairWithCode` handler or the `Content-Type`
  header in `redeemPairingCode` fails
`background.test.js`'s "exchanges a valid pairing code" test (asserts no
  `Authorization` header is sent and the body round-trips exactly).

## What only manual/live browser testing can prove

- The popup's new "Pairing code" field actually rendering and being
  reachable/styled correctly in a real installed Chrome/Firefox profile
(jsdom-based `popup.test.js` proves the click → message → storage
wiring,
  not visual layout).
- End-to-end pairing against a real `polylogued` daemon + real
  `chrome-extension://<id>` origin (the test fixtures use a synthetic
  `chrome-extension://polylogue-test` origin, which is the same pattern
  every other receiver-route test in this repo already uses).
- Token-rotation recovery UX and the native-messaging path — both
  explicitly out of scope for this PR (see Solution above).

## Per-bead AC matrix

**polylogue-gnie** ("Automate secure browser-to-receiver pairing"):
1. Fresh install pairs without viewing/copying/pasting a bearer secret —
**partially satisfied**: the one-time-code fallback delivers this; the
design's *primary* recommendation (native messaging) is not attempted.
2. Receiver stays deny-by-default; hostile origin/process can't retrieve
the token via pairing — **satisfied** for the origin axis (tested); the
short-lived/single-use/rate-limited code is the stated defense against a
   same-host process without native-messaging-grade isolation.
3. Pairing binds real extension+receiver identities, fails visibly on
   mismatch, logs no secret — **satisfied**: the response includes
`receiver_id`; rejections log only the exception type, never the code or
   token (verified by reading the log call sites).
4. Token rotation invalidates old token, extension recovers
automatically —
**deferred**: this AC clause is explicitly tied to the native-messaging
path in the bead's design text; manual re-pairing remains the recovery
   route with this fallback.
5. Real browser-extension-to-loopback fixture proving first pairing,
authenticated reads, rotation recovery, profile reseed, hostile-origin
   rejection, receiver-offline recovery — **partially satisfied**: first
pairing and hostile-origin rejection are proven over real HTTP; rotation
recovery, profile reseed, and receiver-offline recovery are not (need a
   live browser or are explicitly deferred per AC #4).

**polylogue-3v1** ("Capture extension reliability + status UX"):
- Badge shows current/spooled/error per tab — **unchanged by this PR**
  (already substantially shipped per the bead's prior-session notes;
  independently verified present in the current tree).
- Receiver-down spooling drains with no loss/dup — **unchanged by this
PR**
(prior sessions' notes claim this is already implemented; not
re-verified
  here — out of this slice's scope).
- `gemini.google.com` capture end-to-end — **not attempted** (full new
provider bridge, out of scope for this slice; named as residual above).
- Capture-gap events queryable in the archive — **satisfied for the
  receiver/CLI side** (`GET /v1/capture-health`,
  `polylogued browser-capture capture-health`); **not satisfied for the
  producer side** — the extension does not yet detect and report gaps
  automatically (residual, needs a follow-up bead for the visible-vs-
  captured comparison + wiring).
- Bridge DOM fixtures in CI — **unchanged by this PR**.

**polylogue-yyvg.7** ("Make extension UX automatic and
exception-driven"):
- AC1-AC7 — **no change from the bead's existing 2026-07-19 record**,
independently spot-checked against current `main` and found consistent.
Still-open items per that record (explicit-approval/destructive-conflict
  attention categories blocked on a missing data model; literal
  live-installed offline-recovery proof) are unchanged residuals, not
  addressed by this PR.

## Residuals (named follow-ups, not silently dropped)

1. Extension-side capture-health *producer* wiring (visible-vs-captured
   comparison → `POST /v1/capture-health` on detected gap/error/spool-
backlog/provider-auth-broken) — the receiver/CLI/query side landed here,
   the extension-side detection+call did not.
2. Gemini (`gemini.google.com`) capture bridge — not attempted.
3. Native-messaging installer bootstrap for gnie AC #1/#4's full
automatic
   path — not attempted (this repo cannot install/test it headlessly).
4. yyvg.7's explicit-approval/destructive-conflict attention categories
—
   blocked on a ptx-side data model that does not exist yet (per the
   bead's own notes, unchanged by this PR).
Sinity added a commit that referenced this pull request Nov 14, 2026
CLI argument types and request construction were interpreted twice, once
in the product command table and again in the shared operation
declarations. Build Clap presentation from the shared argument
projection and let `command-surface::parse_cli` construct request
values, envelope options and calling-process options. Remove the product
`Kind`, `Values` and JSON/envelope interpreter with their callers.

Local commands and stream inputs now declare their schemas from the same
command rows. Clap retains command placement, help, completion and
configuration's OS-valued startup paths. File preparation, stream
delivery and peer negotiation keep their existing owners. Existing
transport/ready-call tests consume the parsed request; new controls
cover typed values, caller-only options, envelope
identity/deadline/budget, local choices and stream arguments.

Adopt Common PR #127 through Sinex PR #3098 in one dependency graph.
Declaration registration now appends to uniquely owned forms instead of
copying all prior schemas and regenerating tool input for every command.
Published declaration snapshots and rejection atomicity remain intact.
The CLI reuses each command's argument projection while building its
lexical presentation.

Verification on aafb45f: the scoped native check passed command
reachability and the existing document-pagination
continuation/corruption contract (2/2). The document control completed
every phase in 6.17 seconds under its unchanged 120-second limit. Five
prebuilt startup probes reduced warm median child user CPU from 0.260
seconds to 0.021 seconds. Common's required check passed 815 tests;
Sinex's adoption passed its required checks. The required hosted check
on this PR head owns final verification. This is a finite CLI ownership
slice; broader operation-catalog work remains open.
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