Skip to content

fix(browser): report semantic limits reached by captured scripts - #11755

Merged
morluto merged 1 commit into
morluto:mainfrom
ShuaixinHuang:fix/browser-semantic-budget-evidence
Nov 16, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
ShuaixinHuang:fix/browser-semantic-budget-evidence

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Captured scripts can exhaust getter or alias expansion under semantic_precision while analyze_web_bundle drops that fact during result assembly. For example, a router path read through a getter with getter_expansions: 1 produces no budget recovery control and the bundle can report complete analysis.

Fixes #11565. Qualified against main 3676ec632bfbe4fde2f5303daa0d9261072ce04a.

Change

Collect the evaluator-owned value/getter exhaustion facts after route recovery finishes, retaining their effective precision. Carry these typed facts through the strict per-script worker result and emit script-attributed unknowns[] with the existing parameter-limit schema and next-call recovery. A reached budget makes the bundle partial while preserving established findings and independent capture gaps.

The existing CLI control projector can then name --semantic-precision in --full-output metadata; shared/MCP Evidence keeps contract field names. Unreached low budgets produce no invented limitation, sufficient precision clears the limitation on the next call, and a failed parse cannot carry evaluator-budget facts. No target script is executed and no new authority or provider capability is introduced.

Executed validation

Linux, Node 24.22.1 / npm 11.9.0, locked dependencies:

  • The five budget regressions fail on an isolated, unchanged main checkout. Those regressions pass after the fix; the final six-case domain selection also covers the failed-parse transport invariant.
  • 114 distinct tests across five files passed: existing web-bundle analysis and coordinator regressions, budget provenance/precision recovery, real worker framing/byte and SHA-256 receipts/reuse, and public CLI plus SDK MCP capture/analysis.
  • The public boundary uses controlled HTTP/WebSocket CDP responses with the real capture provider and isolated analysis workers. It verifies retained endpoint findings, unaffected capture gaps, parameter-only MCP limits and the CLI's meta.cli_controls mapping.
  • Required runtime build, npm run check:fast, normal commit/pre-push hooks, git diff --check, and discovery of all 3734 test/spec files passed.
  • npm run docs:check: six tasks and eight README consistency tests passed. Scoped typed lint: seven files, zero errors, eleven advisory warnings.

Focused commands executed:

npm run test:focused -- src/domain/webBundleSemanticLimits.test.ts src/domain/webBundleAnalyzer.test.ts src/browser/IsolatedWebBundleAnalyzer.test.ts
npm run test:focused -- src/domain/webBundleSemanticLimits.test.ts
npm run test:focused -- src/browser/WebBundleAnalysisWorkerServer.test.ts tests/boundary/browser/webBundleSemanticLimits.test.ts

Native Chrome, Windows/macOS and the complete monolithic suite were not run. Getter and alias exhaustion were reproduced; the unused expression-depth case verifies that a selected control is not mistaken for an exhausted one. Hosted CI remains pending for the published revision.

Author readiness

Human owner: @ShuaixinHuang

  • 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.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T17:00:08.090484Z
We couldn’t complete this review. Comment @codex review to try again.
532c72c PR opened
ℹ️ 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

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

The PR carries reached evaluator budgets from captured-script analysis into the bundle report.

  • Reached script budgets make web-bundle analysis partial.

No actionable issues were found. Review checks were source-based; tests were not rerun. Whether another PR supersedes this one could not be checked because GitHub authentication was unavailable.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Captured script] --> B[Static analysis and route recovery]
  B --> C[Snapshot reached evaluator limits]
  C --> D[Validated per-script worker result]
  D --> E[Bundle report]
  E --> F[Script-attributed unknowns]
  E --> G[Partial completeness]
  E --> H[Retained findings and capture gaps]
Loading

Reviews (1) · Last reviewed commit: "fix(browser): retain captured-script sem..." · Reviewed by Greptile

@morluto
morluto merged commit 1aad5c4 into morluto:main Nov 16, 2026
37 checks passed
@morluto morluto added area: runtime Process capture and runtime observation bug Something isn't working labels Nov 22, 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 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

analyze_web_bundle does not record the semantic_precision budgets that limit its scripts

2 participants