Repository navigation
feat(web): add bounded cockpit aggregate routes - #2793
Conversation
Expose privacy-safe archive overview and per-session structural evidence summaries for the web cockpit. Load session metadata plus a capped message page so long transcripts no longer cross the reader boundary as one unbounded response. Keep rich path-bearing diagnostics on CLI and operator models while projecting configured archive paths out of normal provider-usage and archive-debt HTTP responses. Ref polylogue-bby.17 Ref polylogue-nhjs Co-Authored-By: Claude <[email protected]>
Regenerate the daemon OpenAPI route catalog for the bounded cockpit overview and per-session evidence-summary endpoints. Ref polylogue-bby.17 Ref polylogue-nhjs Co-Authored-By: Claude <[email protected]>
Preserve isolated visual-renderer compatibility while the live cockpit continues to fetch only the bounded overview and evidence-summary contracts. Ref polylogue-bby.17 Ref polylogue-nhjs Co-Authored-By: Claude <[email protected]>
|
Warning Review limit reached
Next review available in: 32 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 (7)
✨ 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: 8634843e79
ℹ️ 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".
|
Additional verification after the interruption checkpoint: |
Keep long transcripts reachable through bounded message pages, preserve the original session id for detail retries, and classify contradictory structural outcomes once with failed precedence. Ref polylogue-bby.17 Ref polylogue-nhjs Co-Authored-By: Claude <[email protected]>
Adversarial review — iteration 1Findings and fixes:
Verification: focused daemon route tests (3 passed), production-shell JS smoke (10 passed), and |
Problem: the cockpit could render stale overview readiness as current, while failed bounded evidence aggregates disappeared from the session header with no recovery path. What changed: render non-fresh overview snapshot state, age, and refresh errors; render evidence aggregate route failures with retry that evicts and reloads the per-session cache. Production-shell smoke tests exercise stale metadata and 401, 409, and 503 retry cases. Ref polylogue-bby.17 Ref polylogue-nhjs Co-Authored-By: Claude <[email protected]>
Adversarial review — iteration 2Findings and fixes:
What survived scrutiny: full nhjs server-side non-hydrating/keyset windows and client virtualization remain explicitly deferred; this PR does not claim them. Verification: visual production-shell suite 14 passed; focused aggregate/detail routes 3 passed; devtools verify --quick and pre-push quick gate passed. |
Problem: overview snapshot errors could reveal configured or resolved archive paths, and the evidence header ignored the aggregate's bounded lineage refs. What changed: apply the web privacy projection to overview diagnostics across both archive-root representations, and render a capped lineage-ref count from the evidence summary. Route and production-shell regressions cover both paths. Ref polylogue-bby.17 Ref polylogue-nhjs Co-Authored-By: Claude <[email protected]>
Adversarial review — iteration 3Findings and fixes:
What survived scrutiny: full nhjs keyset/non-hydrating/virtualization work remains an explicit deferred scope outside these owned files. Verification: overview/privacy/evidence HTTP selection 3 passed; production-shell visual suite 15 passed; devtools verify --quick and pre-push quick gate passed. |
Problem: evidence-summary counts treated an error flag as stronger than a present zero exit code, diverging from the shared action parser. What changed: classify present exit codes first, then use is_error only when no exit code is available. Parameterized live-route tests cover both conflicting pairs through the production actions view. Ref polylogue-bby.17 Co-Authored-By: Claude <[email protected]>
Adversarial review — iteration 4Finding and fix:
Verification: focused aggregate/privacy selection 5 passed in 148.07s with basetemp under /realm/tmp; the pre-push devtools verify --quick gate passed. The independent reviewer found no further actionable defects after the correction. Full nhjs keyset/non-hydrating/virtualization remains explicitly deferred. |
Problem: prefix-sharing session summaries retain divergent-tail counts while the message route recomposes the transcript, leaving reader header counts inconsistent with displayed messages. What changed: use the bounded message page total for the reader-facing message count. A production-shell regression exercises the summary/page pair and fails if the reconciliation is removed. Ref polylogue-nhjs Co-Authored-By: Claude <[email protected]>
Adversarial review — iteration 5Finding and fix:
Verification: devtools test tests/visual/test_evidence_cockpit_ia_smoke.py — 16 passed in 11.52s, with basetemp under /realm/tmp; pre-push devtools verify --quick succeeded. |
Problem: prefix-sharing readers rendered inherited tool activity while the evidence aggregate counted only the child session tail; route coverage also lacked a browser journey for the new cockpit contracts. What changed: query canonical blocks and actions over composed message ids, add a prefix-sharing route regression, and exercise overview/evidence through the real Playwright reader journey. Ref polylogue-bby.17 Co-Authored-By: Claude <[email protected]>
Remove unsupported parser fixture fields; the regression sets structured outcome columns through the production index before exercising the route. Ref polylogue-bby.17 Co-Authored-By: Claude <[email protected]>
Adversarial review — iteration 6Findings and fixes:
The first pre-push quick gate caught unsupported test-fixture keywords; the follow-up typed-fixture commit fixed them. The subsequent pre-push devtools verify --quick gate passed and the branch is pushed. |
Final acceptance-criteria matrixpolylogue-bby.17
polylogue-nhjs
Final adversarial post-fix review: zero new actionable findings. Known GitHub Actions initialization-only failures remain external. |
## Summary Moves `ops doctor` source filters to the public Origin vocabulary while keeping the provider-named spellings as one-release deprecated aliases. Regenerates the CLI reference and teaches the vocabulary census that explicitly deprecated Click aliases are compatibility, not active contract surface. ## Problem Doctor advertised `--schema-provider` and `--artifact-provider` even though user-facing archive filters are origin-based. The needed compatibility aliases would otherwise prevent the provider-vocabulary census from showing the active CLI contract moving toward Origin. ## Solution - Add repeatable `--schema-origin` and `--artifact-origin` flags; canonical validation errors and verbose help now say origin. - Keep `--schema-provider` and `--artifact-provider` as visible deprecated aliases. Their warnings name the actual legacy flag and merge into the existing workflow filters. - Preserve raw-argv command extraction for both names. - Exclude only explicit `click.option(..., deprecated=...)` aliases from the census literal category; its new regression fixture proves non-deprecated provider flags remain visible. The `daemon/http.py` scope-key portion of `polylogue-9e5.8.4` is intentionally deferred until PR #2793 merges, per the shared-file gate. ## Verification - Direct CLI behavior: canonical help lists both origin flags; legacy schema filtering warns with `--schema-provider`; both canonical and legacy invalid invocations report the canonical `--schema-origin requires --schemas` contract. - `devtools render cli-reference` regenerated `docs/cli-reference.md`. - `devtools lab census provider-vocabulary --json`: literal sites 15 -> 13; unallowlisted literal candidates 12 -> 10; no doctor compatibility alias remains in the active literal set. - `devtools verify --quick`: completed green once before the isolated census follow-up (15 steps). Subsequent runs passed format/lint and then stalled in host I/O `D` state during pytest and mypy; the aborted lane-owned pytest basetemps were removed. The mandatory pre-push quick gate subsequently completed and accepted the push. - Focused pytest selection was attempted single-process with `POLYLOGUE_PYTEST_BASETEMP_ROOT=/realm/tmp/polylogue-pytest` but stalled in the same host I/O condition before completion. ## Acceptance matrix - `polylogue-9e5.8.4` CLI flags: satisfied. - `polylogue-9e5.8.4` HTTP scope key: deferred until PR #2793 is merged. - `polylogue-jnj.7` doctor help and validation wording: satisfied in this scope; its wider CLI-help sweep remains open. Ref polylogue-9e5.8.4. Ref polylogue-jnj.7. Co-authored-by: Claude <[email protected]>
…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. |
|
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. |
|
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
Add privacy-safe, bounded web-cockpit read contracts and switch the live reader to consume them. The landing now loads one overview aggregate; the transcript evidence strip loads one structural evidence summary; session opening fetches metadata plus a capped message page instead of a full transcript response.
Ref polylogue-bby.17
Ref polylogue-nhjs
Problem
The cockpit landing stitched broad status and session-list payloads client-side, provider-usage and archive-debt HTTP responses inherited absolute archive paths from operator DTOs, and the evidence strip downloaded the full work-event insight timeline to compute three chips. Opening a session also crossed the HTTP boundary with every message, making response size grow without a declared cap.
Solution
GET /api/overviewwith SQL-backed session/message/origin totals, whitelisted readiness, explicit snapshot freshness, and at most six recent summaries.GET /api/sessions/:id/evidence-summarywith tool-use-block counts, action-view ok/failed/unknown outcomes, cost projection, and at most twenty lineage refs./api/provider-usageand/api/archive-debtthrough an HTTP privacy boundary that removesarchive_rootand redacts configured and symlink-resolved archive paths in nested caveats/errors.?shape=summaryfor session metadata and make the live reader pair it with a server-clamped/messages?limit=100&offset=0page.Acceptance criteria
polylogue-bby.17
polylogue-nhjs
polylogue-nhjscompletion.Verification
devtools test tests/unit/daemon/test_web_reader.py -k 'overview or evidence_summary or operational_web_payloads or session_detail'8 passeddevtools test tests/visual/test_evidence_cockpit_ia_smoke.py9 passed in 6.46sdevtools lab smoke run reader-visual-smoke --json --report-dir .local/visual/reader-smoke38 passed in 114.84snpm run test:e2e -- --reporter=lineclearCookies()npm run test:e2e -- --reporter=line -g 'missing, expired, revoked'1 passed (11.0s)devtools verify --quickokAnti-vacuity
/api/overview. Removing the route, aggregate query, or fixed recent cap fails the HTTP/shape assertions.tool_result_is_errorand exit-code columns, and reads through the productionactionsview over HTTP. Removing the structural action query or changing failed/unknown classification makes it fail.