Repository navigation
feat(yyvg.7): compact active-card, DOM/action budget, and mockup visual convergence - #3126
Conversation
…n budget Ref polylogue-yyvg.7 AC1/AC6. The "Current page" active-card carried five always-visible per-conversation rows (Fidelity, Captured/visible, Cost/ tokens, Assets, Assets-failures) even in the healthy case -- the fidelity row duplicated the already-visible fidelity-flag chip next to "page", and asset acquisition detail is diagnostic-level information, not something AC1's "compact... capture confidence" summary needs by default. Moved Fidelity and Assets/asset-failures into a new "Capture detail" section inside the existing <details id="diagnostics"> (element ids unchanged, so popup.js and existing tests needed no changes); the always-visible card is now the state chip, captured/visible count, and cost/tokens -- three rows down from five. Adds AC6's "executable" DOM/action budget as a real test rather than a documentation claim: keeps the always-visible surface (everything outside #diagnostics) at <= 8 interactive controls and <= 90 DOM nodes. Ceilings carry headroom above the current measured counts (6 controls / 67 nodes) rather than pinning exact numbers, so ordinary additions to the compact surface don't require touching this test -- a large jump signals something meant for progressive disclosure landed outside it instead. Ref polylogue-yyvg.7 Verification: - npx vitest run tests/popup.test.js -> 30 passed - npx vitest run (full extension suite) -> 339 passed, 1 pre-existing unrelated failure - npm run lint / npm run validate -> clean / manifest ok - devtools verify --quick -> exit 0 Co-Authored-By: Claude <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 37 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Ref polylogue-yyvg.7 -- pixel-level mockup convergence. The popup was functionally aligned with docs/design/browser-capture-redesign/mockup.dc.html (status vocabulary, timeline, progressive-disclosure diagnostics all already matched) but its visual language was still the generic light/dark blue theme from before the redesign, not the mockup's dark-first violet system. Converges purely at the CSS layer (no DOM/JS changes, so popup.js and the existing test suite needed no changes): - Palette: dark-mode custom properties now use the mockup's exact hex values (surface #0b0e13, panel #12161d/#171c25, ok/warn/bad #4ec98f/#e6b552/#f06a6a, violet accent #8b7bf2/#6d5ae0). Light mode shifts to the same violet/hue family, tuned for contrast on white rather than copied verbatim. Provider logo colors (ChatGPT teal-green, Claude terracotta) now match the mockup's brand-accurate hex values exactly. - Badges/pills: converted from solid-fill chips to the mockup's tinted-pill + colored-dot pattern (rendered via a `::before` pseudo-element driven by a per-tone `--dot` custom property) -- matches the masthead status-language legend and tab-item pills in F1. Pure CSS; no new DOM nodes, so the DOM/action budget test from the prior commit is unaffected. - Radius rhythm: cards/tab-items/buttons bumped from the old 7-9px to the mockup's rounder 9-13px system. - Primary buttons: solid fill -> the mockup's top-to-bottom violet gradient with a matching glow shadow. - Typography: "IBM Plex Sans"/"IBM Plex Mono" added as the first choice in the relevant font stacks (body text, provider-logo initials, a new shared `.mono` utility applied to numeric/data values -- cost, tokens, counts, timestamps, request ids). No remote font loading (README's "no remote assets" constraint) -- these degrade to the existing system-font stacks when the Plex fonts aren't locally installed, which is the common case; this is forward-compatible with a future bundled-font pass, not a no-op today for users who do have them installed. Verification: - npx vitest run tests/popup.test.js -> 30 passed - npx vitest run (full extension suite) -> 339 passed, 1 pre-existing unrelated failure (packaged-worker fixture, same as prior commit) - npm run lint / npm run validate -> clean / manifest ok - devtools verify --quick -> exit 0 Ref polylogue-yyvg.7 Co-Authored-By: Claude <[email protected]>
…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).
…estructive submits (#3329) ## Summary Implements the "explicit-approval attention categories" scope item named in polylogue-yyvg.7's notes: a submit_once `conversation.reply` browser action now requires an explicit operator approve/decline decision before the receiver will ever hand it out for dispatch, and the popup surfaces this as a new, distinctly-rendered attention category. ## Problem polylogue-yyvg.7 AC3 names five popup attention categories ("typed auth/pairing mismatch, action outcome_unknown, explicit submit/destructive approval, provider capability mismatch, or destructive conflict"). Prior work (PR #3126) implemented the first, second, fourth, and a fifth stand-in (`archive_failed`), but explicitly left "explicit submit/destructive approval" unimplemented because no backing data model existed: `dispatchBrowserAction` in `background.js` would lease and execute a `submit_once` action the instant the poll loop claimed it, with zero operator gate — even though such an action posts one real, provider-visible turn into an EXISTING conversation the operator may not currently be watching, with no automatic undo. ## Solution - **`polylogue/browser_capture/models.py`**: `BrowserActionStatus` gains `"awaiting_approval"`. `BrowserActionIntent` gains `requires_operator_approval`, `approval_reason` (`BrowserActionApprovalReason = Literal["destructive_submit"]`), `approval_requested_at`, `approved_at`, `approved_by`, `declined_at`. New `BrowserActionApprovalDecisionRequest`. - **`polylogue/browser_capture/actions.py`**: `enqueue_action` holds a `submit_once` + `conversation.reply` request at `status="awaiting_approval"` instead of `"queued"` — `claim_action` only ever looks at `"queued"`, so it is never leased until decided. New `decide_action_approval`: approve transitions to `"queued"` (claimable for the first time); decline is terminal (`"cancelled"`); deciding twice, or deciding on an action that was never held, is a `BrowserActionConflictError`, not a silent no-op. - **`polylogue/browser_capture/server.py` + `route_contracts.py`**: new `POST /v1/browser-actions/{action_id}/approval` route, wired through the same auth/error-mapping pattern as the existing `/reconcile` route. - **`browser-extension/src/operator_status.js`**: `computeAttention` gets a new `explicit_approval_required` branch, ranked between `action_outcome_unknown` and `capability_mismatch` per AC3's stated order. Exports `providerLabel` for reuse in the popup preview. - **`browser-extension/src/popup.html` + `popup.js`**: a "Browser action approval" panel inside the existing progressive-disclosure `<details id="diagnostics">` (no AC4 duplication), with Approve/Decline buttons and a text preview (provider, target conversation, first 160 chars of the reply). The attention item's single primary action is "Review request" — it opens diagnostics and focuses the panel; it never auto-approves or auto-declines. Decline requires an extra `confirm()`. - **`browser-extension/src/background.js`**: `decideBrowserActionApproval` posts the decision to the new route and, only on approve, wakes the existing poll loop so the now-queued action is picked up without waiting for the next alarm. ### Deliberately not modeled: `destructive_conflict` AC3 also names "destructive conflict" as a category. I looked for a real trigger and didn't find one: `claim_action` already serializes to exactly one in-flight action at a time (`if any(status in {leased, preparing, submit_intent})`: return None`), so there is no genuine two-actions-racing-for-the-same-resource scenario in the current architecture to attach a "conflict" decision to. Adding an enum value with no real firing condition would be an unbacked, unfireable category — left as an explicit, documented gap in `models.py` for a future bead once a genuine collision scenario exists (e.g. multi-instance orchestration). ### Out of scope (per task assignment) The sibling yyvg.7 item "live offline-recovery proof" needs a live browser fixture and was explicitly excluded from this task's scope — untouched here. ## Verification - `devtools test tests/unit/browser_capture/` → **153 passed** (was 143 before this change; 10 new/modified tests cover: awaiting_approval gating on enqueue, `conversation.create` and `stage_only` remaining unaffected, approve/decline transitions, conflict on re-deciding an already-decided or never-held action, and a full HTTP round trip through the new route). - `devtools test tests/unit/daemon/test_route_contracts.py` → 1 pre-existing unrelated failure (`test_rebuild_index_handler_forwards_resumable_pass_options_through_writer_bridge`), reproduced identically on `origin/master` before this change (confirmed via `git stash`). - `mypy polylogue/browser_capture/{models,actions,server,route_contracts}.py` → `Success: no issues found in 4 source files`. - `devtools verify --quick` → exit 0 (format, lint, mypy, render-all-check, topology/layering/closure-matrix, schema roundtrip, manifests, docs) — ran clean both pre-commit and pre-push. - `cd browser-extension && npx vitest run` → 354/355 passed (added 8 new tests across `operator_status.test.js`, `popup.test.js`, `background.test.js`); the 1 failure (`build.mjs` packaged-service-worker backfill fixture) reproduces identically on `origin/master` before this change (confirmed via `git stash`) and is unrelated to browser actions. - `cd browser-extension && npm run lint && npm run validate` → clean. ### Not verified (needs a live browser; explicitly out of scope for this task) Visual rendering of the new diagnostics panel in a real popup, and an actual end-to-end trigger→popup-display proof against a real ChatGPT session with a genuine `submit_once` reply. The data model, state-transition logic, HTTP contract, and DOM-wiring logic are all covered by the automated tests above; the live-browser proof is a separate, already-tracked yyvg.7 item. Ref polylogue-yyvg.7 Co-authored-by: Claude <[email protected]>
Summary
Two commits advancing polylogue-yyvg.7 (exception-driven extension UX):
an executable DOM/interactive-control budget test.
docs/design/browser-capture-redesign/mockup.dc.html's dark-first violetdesign system (palette, badge/pill treatment, radius rhythm, typography).
Problem
The active-card showed five always-visible per-conversation rows even in
the healthy case, duplicating information and mixing diagnostic detail into
the default view. AC6 required an executable DOM/action budget, and none
existed. Separately: the popup's functional/content layer (status
vocabulary, timeline, progressive-disclosure diagnostics) already matched
the redesign mockup, but its visual language was still the pre-redesign
generic light/dark blue theme, not the mockup's dark-first violet system —
the actual "pixel-level mockup convergence" gap the bead's notes called out.
Solution
Commit 1 (active-card + budget):
<details id="diagnostics">progressive disclosure. Element idsunchanged;
popup.jsuntouched. Always-visible card: state chip +captured/visible count + cost/tokens (3 rows, down from 5).
tests/popup.test.js) asserting the always-visiblesurface (outside
#diagnostics) stays ≤ 8 interactive controls and ≤ 90DOM nodes (measured: 6/67, headroom built in).
Commit 2 (visual convergence, CSS-only, no DOM/JS changes):
values (surface
#0b0e13, panels#12161d/#171c25, ok/warn/bad#4ec98f/#e6b552/#f06a6a, violet accent#8b7bf2/#6d5ae0). Lightmode shifts to the same hue family, tuned for contrast on white. Provider
logo colors (ChatGPT teal-green, Claude terracotta) now match the
mockup's brand hex values exactly.
pattern (
::beforepseudo-element, per-tone--dotcustom property). Nonew DOM nodes, so the DOM/action budget test is unaffected.
primary buttons switched from solid fill to the mockup's violet gradient
stacks, plus a new shared
.monoutility on numeric/data values (cost,tokens, counts, timestamps, request ids) — matches the mockup's
consistent mono treatment for data. No remote font loading (README's "no
remote assets" constraint); degrades to the existing system-font stacks.
Verification
npx vitest run tests/popup.test.js→ 30 passed (both commits)npx vitest run(full extension suite) → 339 passed, 1 pre-existingunrelated failure (packaged-worker fixture, unchanged by either commit)
npm run lint/npm run validate→ clean / manifest okdevtools verify --quick→ exit 0 (both commits)Ref polylogue-yyvg.7 — AC1 (compact "Now" summary) and AC6 (DOM/action
budget) satisfied; visual-language mockup convergence advances from open to
substantially satisfied for the popup (F1/F6 scope). Remaining yyvg.7 scope
(explicit-approval/destructive-conflict attention categories — blocked on a
ptx data model that doesn't exist yet — and the live installed proof) is
unchanged and tracked on the bead.
🤖 Generated with Claude Code