Skip to content

feat(javascript): compare static endpoints with HAR captures - #9090

Merged
gensokyo-dev merged 3 commits into
mainfrom
feat/3591-static-har-reconciliation
Nov 6, 2026
Merged

gensokyo-dev merged 3 commits into
mainfrom
feat/3591-static-har-reconciliation

Conversation

@gensokyo-dev

@gensokyo-dev gensokyo-dev commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #3591. compare_static_and_observed_endpoints compares existing JavaScript Application Graph and HAR Evidence, reporting matched, not observed in this capture, observed without a confirmed static match, and unknown facts. Static observations, observed groups and matching relationships have stable identities and source links; each match names an exact or template-compatible basis and a concrete HAR ordinal.

MCP defaults to a retained summary. Optional view returns filtered/field-selected pages in this call, using the same projector as later inspect_analysis_view queries. CLI adds compare-static-and-observed-endpoints; standard summary/--view delivery saves the complete source closure with --evidence_output.

Ownership and scope

The shared application service authenticates immutable source records. The existing HAR accumulator owns URL parsing, grouping, template rules, exclusions and the 96 MiB representation allowance; comparison-only whole-path witnesses are budgeted there. Indexed method/route lookup avoids a static × observed join. Source uncertainty, candidate/partial values, missing origin and ambiguous methods remain explicit. Not-observed requires every capture record retained, no exclusions and an exercised origin. It does not mean hidden, unused or inaccessible. Queries, fragments, headers and bodies are not projected; complete source Evidence remains accessible.

Read-only composition within existing authority; no new provider, target execution or endpoint requests. CLI file reads and optional bundle publication use the existing resource owners. Existing API-surface output is unchanged. No dependency, configuration, persisted-format migration or generated output is committed. New capability scope approval for execution/injection/protection recovery is not applicable.

Executed validation

Linux x64, Node 24.22.1 / npm 11.16.0; runtime head a7af4a150 plus fixture-only follow-up 903a939c7 includes latest main fc4c381dd:

  • 41 source tests / 5 files passed: comparison, admission/cancellation, inherited accumulator, unchanged import-cycle guard and tool effects. A valid explicitly unknown source observation incorrectly matched in the pre-fix implementation; its regression failed before the owning eligibility fix and passes after.
  • Public CLI/MCP acceptance passed with the committed original Playwright 1.64.1 / Chromium 153.0.8010.12 HAR and source fixture. Actual SDK full-profile schemas, retained references, both inline/retained views, field/filter/empty selection, source-closure publication, tampering, sensitivity refusal, partial capture and unchanged source bytes are covered.
  • 3 whole-CLI help/alias tests passed after adding --view.
  • Full source typecheck (one checker, 1536M target), focused syntax/typed lint, module/architecture guards, Knip, test discovery, full-repository formatting and git diff --check passed. npm run docs:check passed, including 9 README tests. Focused lint retains six warnings in existing large modules; no checks were waived or tests removed.

A fresh compact-profile SDK run over the same recorded inputs independently verified 7 static observations: 3 matched / 1 not observed / 3 unknown, 5 observed groups, exact ordinal witnesses, complete page reconstruction, CLI/MCP equality and three-record source-closure export. A listener at the recorded origin received zero requests. The HAR digest and source bytes stayed unchanged; fixture provenance and digest are in its README.

Efficiency and limits

With parents imported, the first selected-answer SDK call took 198 ms and returned 9,967 JSON bytes with a 1,106-byte input schema; repeated complete comparisons took 16.5–29 ms. The older two input projections returned 51,940 reply JSON bytes and still required analyst joining. Their generic 640,961-byte output schema incurred about 4.1 s of first-client preparation, motivating the optional inline selector; this tool's output schema is 21,179 bytes. Fetching all pages costs more than complete delivery. Model tokens and analyst reasoning time were not measured; these observations do not establish a general speedup or token saving.

The entire verification process (setup, alternating/repeated projections and four CLI controls; recording created earlier, warm OS caches) took 13.227 s, 13.887/1.589 s task user/system CPU delta, and 1.21 GiB sampled process-family RSS. Samples every 200 ms sum each process's RSS, including shared pages, and can miss short peaks; profiler overhead is excluded. Local checks used two-CPU affinity and a 4-GiB family guard; no check hit it or OOMed. Full local lint was not rerun after earlier repository-wide guard stops; focused checks and final-head CI are separate. Local hooks were disabled for this explicitly checked commit/push. The initial CI format check found that the original HAR fixture was treated as reformattable JSON. The fixture now uses a .har.txt suffix and is copied to .har by the test, preserving its original digest. Public CLI/MCP acceptance and full-repository formatting passed again after this fixture-only change; Final-head CI passed, including all eight portable shards, full static/build/docs checks, the source suite (24,161 passed / 16 skipped), and triggered real browser/HAR checks. All three CodeQL checks passed. Automated Codex code review was unavailable because the repository review quota was exhausted; no review was requested or human-review attestation made. This small owned app does not qualify complex applications, other capture formats or real Windows behavior.

Author readiness

Human owner: @gensokyo-dev

The author is exempt from the declaration under CONTRIBUTING.md. Implementation, diff review and checks reported above were performed by the coding agent under the owner's explicit task authorization; no human-review attestation is made here.

  • 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

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

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-06T04:40:04.612411Z
We couldn’t complete this review. Comment @codex review to try again.
a7af4a1 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.

@gensokyo-dev
gensokyo-dev merged commit 3708538 into main Nov 6, 2026
52 of 54 checks passed
@gensokyo-dev
gensokyo-dev deleted the feat/3591-static-har-reconciliation branch November 6, 2026 05:34
@morluto morluto mentioned this pull request Nov 11, 2026
3 tasks done
@morluto morluto added area: runtime Process capture and runtime observation enhancement New feature or request 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 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Compare static JavaScript endpoints with observed HAR API-surface groups

2 participants