Repository navigation
feat(browser): add capture mission control (#2780) - #2780
Conversation
|
Warning Review limit reached
Next review available in: 28 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 (11)
✨ 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c17526d244
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Adversarial review iteration 1 Findings: two real runtime gaps from hostile diff/PR review.
Verification: npm test -- tests/background.test.js (24 passed); npm test -- tests/popup.test.js (20 passed); npm run lint. What survived scrutiny: the auto-capture and held-with-reason routes remain covered by real activation-path tests. CodeRabbit was rate-limited; its two substantive inline findings were fixed and replied to. |
|
Adversarial review iteration 2 Findings: six real closure gaps.
Verification: npm test -- tests/background.test.js (26 passed); npm test -- tests/popup.test.js --reporter=verbose (21 passed); npm run lint. What survived scrutiny: direct/manual, auto, throttled, and retry capture routes now all produce timeline evidence; no new substantive PR comments arrived. CodeRabbit remains rate-limited. |
|
Adversarial review iteration 3 Finding: a real manual-capture wiring gap remained. The content-script archive-state callback updated global state but not the multi-tab ledger, leaving its chip stale after manual capture; stale lifecycle also used the generic badge. Fixed in 8257015: archive-state callback now writes the serialized ledger, including tab identity when available, and stale maps to the catching-up badge. Verification: npm test -- tests/background.test.js (27 passed); npm run lint. What survived scrutiny: lifecycle ordering, status refresh identity, capture retry evidence, captured/visible provenance, timeline single-writer behavior, and concurrent storage mutation coverage remain in place. |
|
Adversarial review iteration 4 Findings: four real active-context/product gaps.
Verification: npm test -- tests/background.test.js (29 passed); npm test -- tests/popup.test.js --reporter=verbose (22 passed); npm run lint. What survived scrutiny: inactive-tab guard, lifecycle ordering, manual archive refresh preservation, direct/auto/retry timeline routes, serialized storage mutations, and multi-tab ledger behavior. No new PR-review comments arrived. |
|
Adversarial review iteration 5 Findings: two real state-isolation gaps.
Verification: What survived scrutiny: timeline/ledger serialized storage writes and the active-card state guard cover inactive tabs, same-tab conversation navigation, and no-session navigation. |
|
Adversarial review iteration 6 Findings: three real closure gaps.
Verification: What survived scrutiny: the held-with-reason branch, runtime capture POST, lifecycle vocabulary, cost/unavailable display, per-conversation timeline persistence, and active-tab guard all remain exercised by production-route tests. |
|
Adversarial review iteration 7 Findings: three real closure gaps.
Verification: What survived scrutiny: automatic POST and held branches, canonical vocabulary, per-conversation persistence, and active-card identity are all backed by production-path tests. |
|
Adversarial review iteration 8 Findings: two real runtime gaps and one PR-body accuracy issue.
Verification: What survived scrutiny: automatic capture only happens for the identity whose archive state was missing, held decisions are durable, query-route Grok ledgers/timelines render, and the shared status presentation remains in use. |
|
Adversarial review iteration 9 Finding: one real rejection-path gap. A non-retryable receiver response could reach a content handler as an inner Fixed in e486e3f: successful runtime receipts are explicitly Verification: What survived scrutiny: automatic content-to-runtime POST, rejection/no-action visibility, pending lifecycle status, active tab isolation, Grok identity, and shared popup presentation all remain covered. |
|
Adversarial review iteration 10 Findings: three real reliability gaps.
Verification: What survived scrutiny: active-card isolation, automatic/retry/manual decision trails, terminal receiver outcomes, and provider identity routing are all covered by production-route regressions. |
|
Adversarial review iteration 11 Findings: three real operator-trust gaps.
Verification: What survived scrutiny: no-op events, strict provider identity, queue durability, receiver rejection semantics, active-card isolation, and central status presentation remain backed by production routes. |
|
Adversarial review iteration 12 Findings: two real popup integrity gaps.
Verification: What survived scrutiny: active-card identity, conversation-list eligibility, automatic/no-op decisions, queue outcomes, and provider routing remain aligned. |
|
Adversarial review iteration 13 No legitimate gaps found across all four Beads after the final branch-diff, runtime-path, Bead-AC, PR-body, and review-thread pass. No new substantive review comments arrived; CodeRabbit remains rate-limited. Final verification: focused production-route suite |
|
Final acceptance-criteria matrix
No Beads were closed or merged. |
Problem: Automatic archive-state polling could identify a missing conversation without starting capture, leaving no POST and no operator-visible decision trail. What changed: Record bounded per-conversation decisions in extension storage, dispatch the existing capture route for newly missing conversations, and expose a mission-control popup with shared operator vocabulary, open conversations, and the active conversation timeline. Compatibility/migration: Timeline data is local extension storage and starts empty for existing installs. The receiver-side queryable event mirror remains outside this extension-only slice. Ref polylogue-r4no Ref polylogue-bkff Ref polylogue-r2kb Ref polylogue-4g3n Co-Authored-By: Claude <[email protected]>
Verify every archive pipeline state and partial-fidelity flag through the production shared browser status mapper. Ref polylogue-r2kb Co-Authored-By: Claude <[email protected]>
Persist the first archive-state observation once per conversation so the operator timeline explains every decision path from its beginning. Ref polylogue-4g3n Co-Authored-By: Claude <[email protected]>
Real r4no regression test for the automatic held-with-reason path in the background worker. Verified: npm test -- tests/background.test.js — 23/23 passed. Co-Authored-By: Claude <[email protected]>
Problem: Optimistic capture state could hide a pending archive lifecycle, and the direct manual capture route bypassed the operator timeline. What changed: Make lifecycle state authoritative over optimistic capture success across the status chip, badge, and popup detail; persist direct runtime captures in the conversation timeline. Ref polylogue-r2kb Ref polylogue-4g3n Co-Authored-By: Claude <[email protected]>
Problem: Queued captures bypassed both timeline evidence and returned lifecycle state, allowing a recovered pending capture to look safe. What changed: Record held and captured retry outcomes in the conversation timeline and carry the receiver lifecycle into extension state. Ref polylogue-r4no Ref polylogue-4g3n Co-Authored-By: Claude <[email protected]> # Conflicts: # browser-extension/src/background.js
Problem: Popup refreshes discarded active conversation identity, lifecycle ordering could lie, capture events duplicated, and concurrent tab writes could lose evidence. What changed: Refresh the active archive state, serialize extension storage mutations, make lifecycle state authoritative, assign captured/visible counts correctly, and make runtime capture the sole successful-capture timeline writer. Ref polylogue-r4no Ref polylogue-bkff Ref polylogue-r2kb Ref polylogue-4g3n Co-Authored-By: Claude <[email protected]>
Keep content-script archive-state responses in the tab ledger so mission-control chips reflect manual capture convergence; render stale lifecycle as catching up. Ref polylogue-bkff Ref polylogue-r2kb Co-Authored-By: Claude <[email protected]>
Problem: Capture metadata and global card state could drift across archive refreshes or inactive-tab work, while the mission-control card omitted cost/token context. What changed: Guard global state by the actual active tab, preserve same-session capture metadata, keep retries conservative, and render truthful cost/token data. Ref polylogue-bkff Ref polylogue-r2kb Ref polylogue-4g3n Co-Authored-By: Claude <[email protected]>
Problem: delayed tab work and background retry drains could overwrite the\nactive conversation card. Receiver capture results may use temporary IDs that\ndo not identify the browser page.\n\nWhat changed: associate retry work with its originating tab, restrict active\ncard writes to the currently active matching conversation, and retain a retry\nresult in that conversation ledger. Use stable page identity for capture UI\nstate while preserving receiver identity in the ledger.\n\nRef polylogue-r2kb\nRef polylogue-4g3n\n\nCo-Authored-By: Codex <[email protected]>
Problem: a same-tab navigation from a conversation to a no-session page\ncould still accept a delayed archive-state response for the former page.\n\nWhat changed: active-card state writes now require both the active tab ID and\nthe source URL captured before asynchronous work. Per-conversation ledger\nwrites remain intact.\n\nRef polylogue-bkff\nRef polylogue-r2kb\nRef polylogue-4g3n\n\nCo-Authored-By: Codex <[email protected]>
Problem: auto-capture coverage stopped before the runtime POST, and an\ninactive direct capture could omit its pending lifecycle from the ledger. The\npopup could also pair the current tab with a stale global card and timeline.\n\nWhat changed: the activation test composes capturePage with the production\nruntime POST handler; direct captures persist conservative archive state before\nledger updates; popup cards derive nonmatching active-tab state from the\nper-conversation ledger and timeline.\n\nRef polylogue-r4no\nRef polylogue-bkff\nRef polylogue-r2kb\nRef polylogue-4g3n\n\nCo-Authored-By: Codex <[email protected]>
Problem: automatic capture lost its triggering reason in the content-script\nhandoff, failed archive-state checks left no visible decision, and popup copy\nwas independently mapped outside the shared operator vocabulary.\n\nWhat changed: propagate capture reasons through every provider handler, record a\nheld decision for known conversations when archive-state checks fail, and make\nthe shared operator module own popup state presentation copy.\n\nRef polylogue-r4no\nRef polylogue-r2kb\nRef polylogue-4g3n\n\nCo-Authored-By: Codex <[email protected]>
Problem: a delayed missing-state response could capture a different\nconversation after same-tab navigation, and Grok query conversations did not\nshare capture, polling, and popup identity.\n\nWhat changed: automatic capture revalidates the original tab URL and\nconversation before its side effect, logging a held decision when navigation\nchanged. Background and popup now mirror Grok query and DOM fallback identity.\n\nRef polylogue-r4no\nRef polylogue-bkff\nRef polylogue-4g3n\n\nCo-Authored-By: Codex <[email protected]>
Problem: non-retryable receiver rejections could be wrapped as successful\ncontent captures, leaving automatic and manual timelines without a truthful\ndecision outcome.\n\nWhat changed: successful runtime receipts are explicit, content handlers stop\non rejected receipts, and the runtime logs rejected captures as held decisions\nwith preserved ledger error context.\n\nRef polylogue-r4no\nRef polylogue-4g3n\n\nCo-Authored-By: Codex <[email protected]>
Problem: inactive rejection handling could overwrite the active card, concurrent\nretry enqueues could lose capture work, terminal retry failures looped forever,\nand popup provider detection accepted lookalike hosts.\n\nWhat changed: rejection state is tab-scoped, queue mutations are serialized,\nterminal retry failures become held decisions, and popup hostname matching uses\nstrict domain boundaries.\n\nRef polylogue-r4no\nRef polylogue-bkff\nRef polylogue-r2kb\nRef polylogue-4g3n\n\nCo-Authored-By: Codex <[email protected]>
Problem: non-conversation X pages acquired synthetic identities, bounded retry\ndrops were reported as queued, and popup-local capture failures were shown as\nreceiver outages without a decision event.\n\nWhat changed: restrict synthetic Grok identity to conversation routes, report\nqueue drops and evictions honestly, and route local popup capture failures into\nthe background timeline and tab-scoped status.\n\nRef polylogue-r4no\nRef polylogue-r2kb\nRef polylogue-bkff\nRef polylogue-4g3n\n\nCo-Authored-By: Codex <[email protected]>
Problem: non-conversation X/Twitter pages appeared as conversations, and\nquick actions could target stale global state instead of the displayed card.\n\nWhat changed: list entries require a concrete conversation identity and quick\nactions resolve the same active-tab ledger state as the card.\n\nRef polylogue-bkff\nRef polylogue-r4no\nRef polylogue-4g3n\n\nCo-Authored-By: Codex <[email protected]>
02ee7f3 to
edbe76d
Compare
…807,2780,2790,2791,2795,2802,2806,2809 uwk3, jph5 (rigor-contracts #2783), bby.17 (web-cockpit #2793), dmp (terminal-note #2801), ra3w (basetemp-fix #2807), r4no/bkff/r2kb (extension-redesign #2780) fully satisfied — closed. nhjs (#2793), peo (daemon-forensics #2802), 4g3n (#2780), 67ac/212.11 (demo-corpus #2795), rsad (mcp-ergonomics #2790, real gaps remain per 5-iteration adversarial cap), 9e5.8.4/jnj.7 (provider-origin #2806), mrxt/37t.12/p5g/rxdo.4 (annotation-judgment #2791), s7ae.8/20d.2 (live-performance-2 #2809) partially satisfied — noted with disposition, left open. Also discovered and documented the actual root cause of this session's recurring bead-revert incidents: bd reimports the live database from .beads/issues.jsonl on every CLI invocation, so a write not immediately exported is lost the moment the next bd command runs. Every mutation in this commit was individually export-verified against that behavior. Co-Authored-By: Claude <[email protected]>
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Adds the browser-extension mission-control slice: automatic capture when a conversation is newly reported missing, a bounded per-conversation decision timeline, a multi-tab popup, and a shared operator status vocabulary.
Problem
Archive-state polling could repeatedly identify a missing conversation without dispatching the existing capture route. The operator then saw no POST, no explanation of the non-action, and only a single-tab fact table.
Solution
polylogue.capturePagefor newly missing conversations, and retains decisions for receiver-check failures.Acceptance matrix
Verification
cd browser-extension && npm test -- tests/content/grok.test.js tests/background.test.js tests/popup.test.js— 57 tests passed.cd browser-extension && npm run lint— ESLint passed.cd browser-extension && npm test— 173 tests passed; two unrelated package-build tests failed because the local ignored.venvexposes a pre-1980 symlink timestamp that Python ZIP rejects.Anti-vacuity: the activation regression drives the production activation → capturePage → runtime
polylogue.capture→ receiver POST route; removing the missing-state dispatch, runtime post handoff, or timeline append fails it. The Grok handler test evaluates the actual common and provider scripts; removing automatic reason propagation fails it. Popup tests import the actual renderer and shared operator module with tab/ledger/timeline inputs; removing the mapper, presentation consumer, timeline renderer, or tab-list rendering fails their visible assertions.Ref polylogue-r4no
Ref polylogue-bkff
Ref polylogue-r2kb
Ref polylogue-4g3n