Skip to content

perf(javascript): query selected source-to-bundle facts - #6128

Merged
gensokyo-dev merged 4 commits into
mainfrom
perf/6112-source-bundle-views
Oct 21, 2026
Merged

gensokyo-dev merged 4 commits into
mainfrom
perf/6112-source-bundle-views

Conversation

@gensokyo-dev

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

Copy link
Copy Markdown
Collaborator

Summary

Fixes #6112. Compare a committed historical graph from a local JSON file and request selected mappings/candidates without sending the full graph or receiving every row. Existing inline requests retain their complete Evidence; file requests preserve the same normalized facts and record the selected file origin.

Change and scope

  • Add exact path/identity/status filters, field selection and stable pages to the existing analysis-view owner. Global classification precedes selection; source coverage and partial/unknown semantics remain separate from pagination. Mandatory identities include mapping/source indices and candidate/node indices with a mapped flag; signals are opt-in.
  • MCP supports an initial summary/page and retains its complete parent before delivery. CLI accepts the same reference-file alternative; saved complete Evidence uses the shared inspect-analysis-view projector.
  • The file owner supplies the absolute selected path; parameters.reference_source preserves it and the exact requested path. POSIX ../symlink semantics remain intact. Distinct chosen files have distinct Evidence IDs, while normalized facts/mapping IDs remain composable.
  • Reuse bounded regular-file reading, commitment validation and one shared live-heap admission owner. File-I/O cancellation reports the comparison operation with its original cause. Compute the comparison/view, dispatch cancellation, then commit session facts. No file cache or new target-execution authority.

Evidence and measured costs

Public Redux Toolkit 2.2.7: 180 source files, 99 embedded source nodes, 210 candidate relations, checked independently with Python JSON/SHA-256/path joins. Every requested fact agrees with its full retained parent: 33 split, 147 unknown. All embedded source strings differ from the published sources; no semantic-equivalence or removal claim.

Three alternating complete-task pairs per output-profile configuration include catalog, arguments, all replies, preparation, extra candidate query and Evidence export. Archived full-output estimates are 152,592 → 54,765 cl100k tokens (64.1% less), with a cold SDK tradeoff: wall median 11.899 → 14.733 s, CPU 11.551 → 14.377 s, process-family peak 666.6 → 950.7 MiB. With the existing explicit output-schema off setting on both sides, estimates are 152,668 → 54,841; wall 11.597 → 10.890 s, CPU 11.244 → 10.569 s, peak 628.7 → 626.0 MiB. Ranges overlap, so no stable speedup claim. Server canonical validation remains enabled; defaults are unchanged.

Final post-provenance verifications estimate 54,896 tokens, retain all oracle facts and the new origin metadata, and preserve legacy inline Evidence exactly. Same-origin CLI and MCP file Evidence agree exactly. Historical paired medians predate later guard/provenance fixes; final source hashes and separate receipts are explicit in experiments/analysis-efficiency/source-to-bundle*.json / .md.

Both cohorts explicitly select the existing semantic cap of one for source/map correspondence. Comparison facts agree with a separately observed default-semantic run; semantic coverage does not. Reference import is separately measured; acquisition/build are excluded. All measured tasks release their processes with no OOM/resource stop. Actual model usage is unmeasured; the verified existing CLI/code-composition control can already select locally, so there is no universal native-client saving claim.

Validation performed

  • npm run build:cached, npm run check, npm run docs:check — passed.
  • Original retained-Evidence/path suites — 66 passed; later guard/path/page run — 65 passed.
  • Shared authentication/Evidence-reader coverage — 7 passed; final provenance/MCP/guard suites — 6 passed; selected CLI/shared JSON ownership suites — 29 passed (37 unrelated cases skipped).
  • Actual SDK cancellation during validation/comparison leaves the entire session unchanged and the server usable. Negative controls without admission/cancellation gates fail all 3 new guard cases; removing provenance/cancellation attribution fails 3 more as expected.
  • Cross-source pages over candidate counts 2/1/2 check original indices, filtered totals and next offsets. Real-file tests distinguish weak candidates (mapped: false), preserve relative caller paths, and give identical graphs at different chosen paths distinct provenance.
  • Public-package CLI inline output exactly equals baseline; file CLI/MCP output and selected rows agree, with provenance retained. Legacy semantic-error JSON is unchanged.

Linux verified. Final-head CI/review remain the merge gate. Windows runtime and actual model/native-client context usage are unmeasured; no GUI/deep provider or cross-provider qualification is claimed.

Contract and boundary impact

Matching/scoring stay in the domain owner; both adapters share file resolution, Evidence construction and view projection. Contracts are additive: reference-file transport, optional MCP view and completed-comparison views; complete output remains the default. File origin is provenance metadata, not a change to mapping semantics. Contribution scope: existing static analysis/Evidence boundaries; maintainer execution/mutation decision not applicable.

Effects: read selected files, existing REA static helper processes and caller-selected Evidence export. No target execution, attachment, instrumentation, configuration changes, network access or protection recovery. Owning docs updated; generated catalogs/skills/build outputs remain untracked.

Author readiness

Declarations entered under the user's explicit direction and authorization in this session.

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.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 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-21T18:38:47.515999Z d3d8ee7 Manual request
ℹ️ 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.

@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The reviewed changes appear safe to merge, with no new blocking issue found.

Summary

Adds file-backed historical graphs and selected source-to-bundle views while keeping the complete comparison available.

  • Source-to-bundle comparisons can return selected mapping and candidate pages.
  • Local source graphs keep their file origin in saved comparisons.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Inline graph or selected JSON file] --> B[Authenticate historical graph]
  C[Application Evidence] --> D[Compute complete comparison]
  B --> D
  D --> E[Prepare full reply or selected view]
  E --> F{Request cancelled?}
  F -->|Yes| G[Return without session writes]
  F -->|No| H[Retain source and complete parent]
  H --> I[Retain and return selected view or full parent]
  H --> J[Later inspect_analysis_view calls]
Loading

Reviews (4) · Last reviewed commit: "fix(javascript): preserve reference file..." · Reviewed by Greptile

@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

@codex review

Final follow-up cbf11f004 restores the CLI legacy error envelope (real wrong-application output now exactly equals main), checks initial summaries and weak candidates with mapped: false, and adds six measured tasks using the existing explicit output-schema off profile. Core MCP matching/view logic is unchanged. npm run check and the focused regressions pass; the new CI run verifies the final head.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: cbf11f0046

ℹ️ 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".

@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 3b66135e2a

ℹ️ 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".

@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: d3d8ee78fd

ℹ️ 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".

@gensokyo-dev
gensokyo-dev merged commit 0583fc6 into main Oct 21, 2026
42 checks passed
@gensokyo-dev
gensokyo-dev deleted the perf/6112-source-bundle-views branch October 21, 2026 18:45
@github-actions github-actions Bot mentioned this pull request Oct 21, 2026
3 tasks done
@morluto morluto added the performance Performance regressions, scaling limits, and bounded-resource work label Nov 23, 2026
@morluto morluto added the area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior performance Performance regressions, scaling limits, and bounded-resource work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Select source-to-bundle facts without full graph/report context

2 participants