Skip to content

feat(browser): add retained scenario summaries and paged views - #7120

Merged
gensokyo-dev merged 2 commits into
mainfrom
feat/6167-browser-scenario-summary
Oct 25, 2026
Merged

gensokyo-dev merged 2 commits into
mainfrom
feat/6167-browser-scenario-summary

Conversation

@gensokyo-dev

@gensokyo-dev gensokyo-dev commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #6167. A ten-action TodoMVC capture returned about 628 KB / 395k estimated tokens even when the analyst needed only the final screen and selected records. capture_browser_scenario now accepts detail: "summary", retains the complete parent Evidence, and returns step outcomes, the focus accessibility tree and retained event/network counts. Complete delivery remains the default.

CLI uses --detail summary --evidence_output FILE. inspect_analysis_view adds browser-scenario steps, events, transactions and UTF-16 text pages. Filters and artifact/content selection preserve original record identities and source omissions; exhausting a page never upgrades capture completeness.

Change and scope

  • Domain projection owns the summary and selections. CLI/MCP reuse existing Evidence delivery and publication. Delivery detail never enters scenario parameters or its digest.
  • Immutable parent validation and a metadata-only transaction index are reused for the retained parent's lifetime. Pages materialize only selected rows. Unrequested/legacy-unknown network observation remains distinct from an observed empty result, and transactions without retained requests remain visible.
  • CLI finalization reuses the shared owner, retaining completed Evidence during late cancellation and typed cleanup failure. Its explicit initial-failure projection preserves browser CLI diagnostics across cleanup retries.
  • Existing capture authority and producer behavior are preserved. This adds historical projection and caller-selected Evidence publication; a separate new-provider/runtime scope decision is not applicable. Follow the contribution scope.
  • Reuses Kaoru0822's ab3893d48 prototype with attribution retained. feat(analysis-view): page retained browser scenario steps and text #4163 overlaps record views and proposes broader producer/state contracts; this PR uses current producers.

Contract and boundary impact

The named CLI/MCP contracts share canonical scenario semantics and projections. The SDK's structural admission stays separate from canonical semantic diagnostics so full/compact clients retain precise field paths. Browser views explicitly have no file artifact (artifact: null). Transaction identity is parent Evidence + transaction ID; text pages retain the complete artifact digest. Authored guidance/docs are updated; generated catalogs and packaged skills remain build outputs.

Validation performed

  • npm run check — passed, including typecheck, lint, format, Knip, architecture/module boundaries and typed lint of 5,402 files. An earlier run hit the 8 GiB family-RSS guard; returning to the checker's existing 1 GiB Go soft target completed the full check without changing its configuration or coverage.
  • npm run docs:check — passed, including nine README consistency tests.
  • Focused source/CLI/MCP route checks — 44 passed; final schema/projection/CLI lifecycle checks — 30 passed, including every canonical SDK-converted schema, opt-in content, orphan transactions, unknown selection, Unicode/text truncation, late-cleanup cancellation and typed cleanup failure.
  • Review fixes: inherited limitations count has a failing-original/passing-fixed regression; 27 projection/finalizer/CLI/provider-cleanup tests passed, including the four cleanup regressions caught by CI. Relative paths failed with the original verifier and passed after resolving at entry. An empty transaction-page control falsely passed the original verifier and is rejected by the corrected exact-ID oracle. npm run check:fast passed after these changes.
  • Real Chromium 156.0.8078.47 / TodoMVC JavaScript ES5 pinned at ff43b02e59dfa604386bb382034b2cd07c2bcd8a: two alternating sessions per revision, each with cold/warm captures, all checked 11 completed steps, 36 events, 12 transactions and the final five todo labels. Separate real-browser checks passed failed-step focus, CLI summary/bundle publication and MCP evidence-file text readback, including a fresh post-review run with the stronger limitation/transaction checks. Reproducer: experiments/analysis-efficiency/browser-scenario-summary.mjs and its adjacent guide.

Baseline 160d821ac; performance feature 247897c72 (before the small review/cleanup fixes), based on bc143125e. Linux x64, Node 24.22.1/npm 11.16.0, two CPUs. Each session includes discovery, two captures, complete-parent export and verification; summary sessions additionally perform five retained queries per capture.

Measured cost Complete baseline Summary + selected reads
Capture reply, cl100k_base estimate ~395,270 tokens 2,800–2,834 tokens
Cold task including raw discovery/arguments/replies ~1,295,042 tokens ~920,306 tokens
Whole-session elapsed, median 8.92 s 13.34 s
Whole-family CPU, median 8.95 s 14.38 s
Sampled family RSS peak, median 1.61 GiB 1.87 GiB

These are serialization estimates, not actual model usage; protocol framing, prompts and client rendering are unmeasured. RSS sums the process family every 100 ms, may count shared pages more than once and can miss short peaks. The first generic-view call also pays ~3.4 s of client schema compilation; three warmed step reads totalled 27–44 ms. No latency or memory improvement is claimed. OS file caches were not cold. Windows/macOS and other browsers were not verified.

Author readiness

Human owner: @gensokyo-dev

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Add shared CLI/MCP summary delivery with complete parent Evidence retained.
Page exact steps, events, transaction metadata/content and UTF-16 text without
replaying the browser. Preserve omissions and unknown network selection, and
reuse immutable source validation within the retained parent's lifetime.

Reuse the scenario prototype from ab3893d, adapting it to current delivery
and cleanup owners, bounded page allocation and real-browser verification.

Refs #6167

Co-authored-by: Kaoru0822 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T10:50:27.584610Z 4238265 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 247897c723

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@greptile-apps

greptile-apps Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge, with both previous findings addressed.

Summary

Adds browser scenario summaries while keeping complete Evidence available for later reads.

  • Browser captures can return a short summary while keeping complete Evidence.
  • Callers can page selected browser steps, events, transactions, and text.

No new actionable issues were found. Checks used source review; no tests were run. Checking for a replacement PR was blocked by unavailable GitHub authentication.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Capture[Browser scenario capture] --> Parent[Complete Evidence]
  Parent --> MCP[MCP session]
  Parent --> File[CLI Evidence bundle]
  Parent --> Summary[Summary reply]
  MCP --> Views[Selected steps, events, transactions or text]
  File --> Views
Loading

Reviews (2) · Last reviewed commit: "fix(browser): preserve cleanup diagnosti..." · Reviewed by Greptile

@gensokyo-dev
gensokyo-dev merged commit fc43e28 into main Oct 25, 2026
40 of 43 checks passed
@gensokyo-dev
gensokyo-dev deleted the feat/6167-browser-scenario-summary branch October 25, 2026 11:03
@github-actions github-actions Bot mentioned this pull request Oct 25, 2026
3 tasks done
morluto pushed a commit that referenced this pull request Oct 25, 2026
This reverts commit 7336a56 (#7119).

After #7120 and the other merges of 2026-10-25 grew inspect_analysis_view's
complete input schema (71,762 bytes plus 3,003 bytes of examples), the 64 KiB
fitting from #7119 could no longer keep instance level 3 and fell back to
level 2. That summarized the inline Evidence source and the view selector
collections, so main CI failed in toolInputReferences, toolSchemaValidity,
analysisViewMcp, absoluteLocalPathSchema, javascriptFactsViewMcp and
godotPckMcp. #7119's own CI ran against bc14312, before that growth.

Reverting restores the complete full-profile advertisement while the size
limit is redesigned against these contracts (#4081 stays open).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs: #7135
kaoru0822-kitauji added a commit that referenced this pull request Oct 26, 2026
This reverts commit 7336a56 (#7119).

After #7120 and the other merges of 2026-10-25 grew inspect_analysis_view's
complete input schema (71,762 bytes plus 3,003 bytes of examples), the 64 KiB
fitting from #7119 could no longer keep instance level 3 and fell back to
level 2. That summarized the inline Evidence source and the view selector
collections, so main CI failed in toolInputReferences, toolSchemaValidity,
analysisViewMcp, absoluteLocalPathSchema, javascriptFactsViewMcp and
godotPckMcp. #7119's own CI ran against bc14312, before that growth.

Reverting restores the complete full-profile advertisement while the size
limit is redesigned against these contracts (#4081 stays open).

Co-authored-by: Claude Opus 5.5 <[email protected]>
@morluto morluto added the enhancement New feature or request label Nov 23, 2026
@morluto morluto added the area: runtime Process capture and runtime observation label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Process capture and runtime observation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Summary detail and retained Evidence for capture_browser_scenario results

2 participants