[GH-ISSUE #6112] [Feature] Select source-to-bundle facts without full graph/report context #3743

Closed
opened 2026-10-31 00:43:35 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @gensokyo-dev on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/6112

Before submitting

  • I searched open and closed issues and PRs (including #734, #2768 and #3191).
  • I reviewed the contribution scope; verification remains required before integration.
  • No credentials, private samples or sensitive target data are included.

Area

MCP or agent integration

Current limitation

An analyst asking for mapping status and candidate relationships for three exact historical source paths still supplies the complete HistoricalSourceGraph to compare_source_to_bundle and receives every comparison item. Retained application references already avoid resending the application graph; a candidate index already avoids all-pairs matching.

Observed in one completed exploratory SDK task during #5975 (Linux, Node 24.18.0; pre-merge runtime based on main 6d356b843). Public Redux Toolkit 2.2.7, unchanged source/bundle bytes: 180 source files, 99 source-map nodes, 210 candidate relations. Independent Python JSON/SHA-256/path joins agree. The task asked about src/createSlice.ts, src/createReducer.ts and src/query/core/buildThunks.ts.

  • Comparison: 232 ms; complete MCP reply 427,799 bytes, including duplicated text/structured content.
  • Completed SDK task: 27.861 s wall, 27.454 s CPU, 1,139,318,784-byte kernel process-family peak including page cache; cleanup verified. Source import was measured separately; acquisition/extraction excluded.
  • Whole-task estimate: 152,515 cl100k_base tokens (catalog 47,868 + arguments 37,254 + text replies 67,393). Actual model usage and repeated/latest-main costs: NOT_ENOUGH_INFO, not yet measured.

These are one-run observations, not a speedup claim. Source/map bytes differ; split describes multiple static location projections, and unknown rows do not establish removal or semantic equivalence.

Use cases

Inspect a small batch of historical files and follow candidate node IDs without reading the other mappings. Revisit the completed comparison without repeating application analysis or losing the complete Evidence.

Desired outcome and success criteria

Reuse the shared analysis/view layer for selected facts and relationships: exact path filters, useful field selection and paging, stable mapping/node identity, source digests, original coverage/limitations, and access to complete parent Evidence. Investigate a validated file reference for historical graph input so MCP callers need not copy the full graph into arguments. Preserve existing complete requests and explicit caller choices.

Measure equivalent completed tasks, including catalog and extra calls; compare native CLI/code composition as a control. Keep global classification before selection so merged/duplicated semantics do not change. Report small-input regressions and unmeasured model costs.

Expected interaction with targets

Read existing files or captured data. Existing REA analysis helpers may run; Evidence export writes caller-selected local output. The target application is not executed.

Target and scope details

Static historical-source and shipped-bundle comparison using existing capabilities. No new provider or target-execution authority. Keep CLI/MCP interpretation shared and use existing file admission, cancellation and cleanup owners.

Verification available so far

I have observed results.

Verification details

Published package: https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.2.7.tgz
SHA-256: f2517c466b50424b661a27e48039f15db7783e5822f46b5c7d39f20104ac67a9.
Selected src/ and dist/ subtrees retain package-relative paths and original bytes. Three maps each declare 33 sources. Full comparison retains 33 split and 147 unknown rows. A first setup with misaligned roots yielded no candidates and is excluded from the verified baseline. Fresh main baseline and repeated bounded trials will precede implementation/integration.

Alternatives considered

CLI JSON-file input and ordinary external filtering can already bound native-agent output; this is a control, not a claim that all clients benefit. Existing retained application references and the candidate index should remain. A generic cache or new broad orchestration API is not justified by the observed comparison time.

Possible direction

Extend existing selected Evidence views and input resolution only where the completed workflow demonstrates a benefit. Full Evidence remains available; response selection must not narrow the inputs used for classification.

References

#734 (retained application references), #2768 (historical-source CLI summaries), #5167 (durable CLI Evidence), #5975 (catalog context costs).

Originally created by @gensokyo-dev on GitHub (Oct 21, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/6112 ### Before submitting - [x] I searched open and closed issues and PRs (including #734, #2768 and #3191). - [x] I reviewed the contribution scope; verification remains required before integration. - [x] No credentials, private samples or sensitive target data are included. ### Area MCP or agent integration ### Current limitation An analyst asking for mapping status and candidate relationships for three exact historical source paths still supplies the complete HistoricalSourceGraph to `compare_source_to_bundle` and receives every comparison item. Retained application references already avoid resending the application graph; a candidate index already avoids all-pairs matching. Observed in one completed exploratory SDK task during #5975 (Linux, Node 24.18.0; pre-merge runtime based on main `6d356b843`). Public Redux Toolkit 2.2.7, unchanged source/bundle bytes: 180 source files, 99 source-map nodes, 210 candidate relations. Independent Python JSON/SHA-256/path joins agree. The task asked about `src/createSlice.ts`, `src/createReducer.ts` and `src/query/core/buildThunks.ts`. - Comparison: 232 ms; complete MCP reply 427,799 bytes, including duplicated text/structured content. - Completed SDK task: 27.861 s wall, 27.454 s CPU, 1,139,318,784-byte kernel process-family peak including page cache; cleanup verified. Source import was measured separately; acquisition/extraction excluded. - Whole-task estimate: 152,515 cl100k_base tokens (catalog 47,868 + arguments 37,254 + text replies 67,393). Actual model usage and repeated/latest-main costs: NOT_ENOUGH_INFO, not yet measured. These are one-run observations, not a speedup claim. Source/map bytes differ; split describes multiple static location projections, and unknown rows do not establish removal or semantic equivalence. ### Use cases Inspect a small batch of historical files and follow candidate node IDs without reading the other mappings. Revisit the completed comparison without repeating application analysis or losing the complete Evidence. ### Desired outcome and success criteria Reuse the shared analysis/view layer for selected facts and relationships: exact path filters, useful field selection and paging, stable mapping/node identity, source digests, original coverage/limitations, and access to complete parent Evidence. Investigate a validated file reference for historical graph input so MCP callers need not copy the full graph into arguments. Preserve existing complete requests and explicit caller choices. Measure equivalent completed tasks, including catalog and extra calls; compare native CLI/code composition as a control. Keep global classification before selection so merged/duplicated semantics do not change. Report small-input regressions and unmeasured model costs. ### Expected interaction with targets Read existing files or captured data. Existing REA analysis helpers may run; Evidence export writes caller-selected local output. The target application is not executed. ### Target and scope details Static historical-source and shipped-bundle comparison using existing capabilities. No new provider or target-execution authority. Keep CLI/MCP interpretation shared and use existing file admission, cancellation and cleanup owners. ### Verification available so far I have observed results. ### Verification details Published package: https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.2.7.tgz SHA-256: `f2517c466b50424b661a27e48039f15db7783e5822f46b5c7d39f20104ac67a9`. Selected `src/` and `dist/` subtrees retain package-relative paths and original bytes. Three maps each declare 33 sources. Full comparison retains 33 split and 147 unknown rows. A first setup with misaligned roots yielded no candidates and is excluded from the verified baseline. Fresh main baseline and repeated bounded trials will precede implementation/integration. ### Alternatives considered CLI JSON-file input and ordinary external filtering can already bound native-agent output; this is a control, not a claim that all clients benefit. Existing retained application references and the candidate index should remain. A generic cache or new broad orchestration API is not justified by the observed comparison time. ### Possible direction Extend existing selected Evidence views and input resolution only where the completed workflow demonstrates a benefit. Full Evidence remains available; response selection must not narrow the inputs used for classification. ### References #734 (retained application references), #2768 (historical-source CLI summaries), #5167 (durable CLI Evidence), #5975 (catalog context costs).
bsakaguchi 2026-10-31 00:43:35 +00:00
Author
Owner

@gensokyo-dev commented on GitHub (Oct 21, 2026):

Implemented in ready PR #6128. Fresh main@aa51e4343 control and three alternating task pairs verify all 180 source files / 99 embedded nodes / 210 candidate relations independently. Full comparison remains 33 split + 147 unknown, and every selected identity/signal/coverage fact agrees with the retained parent.

Whole-task cl100k estimates (catalog + arguments + replies + extra candidate call): 152,592 → 54,765. This saves context, with a cold-client tradeoff: wall median 11.899 → 14.733 s; CPU 11.551 → 14.377 s; process-family peak 666.6 → 950.7 MiB. Actual model usage is unmeasured; existing native CLI/code composition is a verified control, so this does not establish universal native-client savings. No OOM/resource stop, cleanup verified. Repeated identical candidate continuation: 2,071 ms initially, 72 ms subsequently.

The PR is rebased onto newer main 01788bac8; measured implementation hashes remain identical. Reproduction, independent oracle, raw cost summary and verification limitations are committed with the PR. CI/review are running before merge.

<!-- gh-comment-id:6322195723 --> @gensokyo-dev commented on GitHub (Oct 21, 2026): Implemented in ready PR #6128. Fresh `main@aa51e4343` control and three alternating task pairs verify all 180 source files / 99 embedded nodes / 210 candidate relations independently. Full comparison remains 33 split + 147 unknown, and every selected identity/signal/coverage fact agrees with the retained parent. Whole-task cl100k estimates (catalog + arguments + replies + extra candidate call): 152,592 → 54,765. This saves context, with a cold-client tradeoff: wall median 11.899 → 14.733 s; CPU 11.551 → 14.377 s; process-family peak 666.6 → 950.7 MiB. Actual model usage is unmeasured; existing native CLI/code composition is a verified control, so this does not establish universal native-client savings. No OOM/resource stop, cleanup verified. Repeated identical candidate continuation: 2,071 ms initially, 72 ms subsequently. The PR is rebased onto newer main `01788bac8`; measured implementation hashes remain identical. Reproduction, independent oracle, raw cost summary and verification limitations are committed with the PR. CI/review are running before merge.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#3743
No description provided.