[GH-ISSUE #4092] [Feature] Query retained JavaScript module references without full item reads #1616

Closed
opened 2026-10-16 21:08:01 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @N0zoM1z0 on GitHub (Oct 15, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/4092

Before submitting

  • I searched the open and closed issues and pull requests for a related proposal.
  • I understand the contribution scope must be reviewed before integration; open questions are welcome here.
  • This request does not include credentials, private samples, or sensitive target data.

Area

Evidence, artifacts, or reconstruction

Current limitation

At main c9f9b83c6, inspect_analysis_view module pages expose {node_id, kind, path}. Canonical identity and source-range facts require reading each full module item, including all observations/properties. Source-derived from src/domain/analysisView/javascriptApplicationView.ts; the new main has not yet been runtime-measured for this issue.

The real Obsidian 1.14.4 experiment selected package.json and main.js. Several module identities share main.js; a path does not uniquely identify a module. Answering which identities and retained reference counts were recovered required a page and 23 full item replies. A prototype typed query preserved those selected facts and explicit partial coverage in 23,402 versus 338,208 structured bytes. This is an observed representation comparison, not proven token or speed savings on current main.

Use cases

Inspect canonical module identities/references from a shipped JavaScript/Electron package without reanalysis or transferring unrelated observations. Reuse the original full item when exact source locations or properties are needed.

Desired outcome and success criteria

  • Add a typed, filtered, paginated module-reference view to the existing inspect_analysis_view contract, shared by CLI/MCP.
  • Preserve exact canonical node identities and recorded path semantics, including null/empty/duplicate paths. Return retained range counts and distinct supporting authority/state/confidence combinations without promoting mixed observations to one conclusion.
  • Keep parent/query Evidence identity, artifact digest, source selection, source coverage and explicit unknowns inline. Exhausting matching retained rows must not imply complete source or runtime coverage. Complete module items remain available.
  • Scan retained owner facts once and allocate only the requested rows; avoid materializing full items or source-range arrays. Keep existing requests/results compatible.
  • Verify actual CLI/MCP schema conversion and public calls, filtering/page boundaries, partial/unknown cases and full-item parity. Measure equivalent completed tasks on the real Obsidian package, including request/schema/response token estimates, elapsed time, CPU and process-family memory. Label unmeasured model costs and first/warm runs.

Expected interaction with targets

Read existing files or captured data.

Target and scope details (optional)

Existing offline application analysis and authenticated retained/inline Evidence only. No code-mode host/SDK, new target execution, injection, attachment or mutation. Source interpretations remain owned by the existing JavaScript graph producer. This is the first concrete data-interface improvement under #4027 and #4091.

Verification available so far

I have a prototype or observed results.

Verification details (optional)

Preserved experiment and limitations. Current-main integration verification is pending and will be recorded on the implementation PR. Application binaries and regenerable large Evidence are not committed.

Alternatives considered

Existing page + full item calls remain useful for detailed inspection but cause repeated envelopes for this question. Reanalysis repeats unnecessary work. A generic query language, task-specific dependency tool or code-mode runtime is not required for this focused projection.

Possible direction

Extend the existing view union with exact module kind/path filters, offset/limit and a named typed reference projection. Reuse the existing graph facts, view digest, retention and transport admission. Remove directly related duplicated module selection rules while preserving legacy views.

References

#4027, #4091, deferred exploration #4063; closed unmerged research PR #4082.

Implementation and executed validation

Production PR #4097 implements the shared typed view without a code-mode host or SDK. Executed 112 focused tests, full static and documentation checks, and three alternating-order comparisons on real Obsidian. Same 23 selected facts, 24 → 1 reads, 325,201 → 22,158 structured bytes. Serialized cl100k_base task costs with both selected schemas/common bootstrap/all requests/replies: 85,302 → 16,548; complete-catalog projection: 272,771 → 204,017. These are static BPE counts, not hosted-model usage. CLI/MCP view/Evidence identity parity, partial source coverage and cleanup passed. Measurements, executed source hashes, prior attempts and limits. CI/review/merge are tracked on the PR.

Implementation overlap

Production PR #4097 and draft #4106 both implement this request and row schema; do not integrate them independently. The contracts agree on exact paths, canonical identity, observation counts, support states and source/page coverage. #4097 additionally shares module selection with legacy views and retains a real Obsidian CLI/MCP comparison script, measurements and supervised tokenizer cleanup. Its final-head CI/review is in progress.

Originally created by @N0zoM1z0 on GitHub (Oct 15, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4092 ### Before submitting - [x] I searched the open and closed issues and pull requests for a related proposal. - [x] I understand the contribution scope must be reviewed before integration; open questions are welcome here. - [x] This request does not include credentials, private samples, or sensitive target data. ### Area Evidence, artifacts, or reconstruction ### Current limitation At main `c9f9b83c6`, `inspect_analysis_view` module pages expose `{node_id, kind, path}`. Canonical identity and source-range facts require reading each full module item, including all observations/properties. Source-derived from `src/domain/analysisView/javascriptApplicationView.ts`; the new main has not yet been runtime-measured for this issue. The real Obsidian 1.14.4 experiment selected `package.json` and `main.js`. Several module identities share `main.js`; a path does not uniquely identify a module. Answering which identities and retained reference counts were recovered required a page and 23 full item replies. A prototype typed query preserved those selected facts and explicit partial coverage in 23,402 versus 338,208 structured bytes. This is an observed representation comparison, not proven token or speed savings on current main. ### Use cases Inspect canonical module identities/references from a shipped JavaScript/Electron package without reanalysis or transferring unrelated observations. Reuse the original full item when exact source locations or properties are needed. ### Desired outcome and success criteria - Add a typed, filtered, paginated module-reference view to the existing `inspect_analysis_view` contract, shared by CLI/MCP. - Preserve exact canonical node identities and recorded path semantics, including null/empty/duplicate paths. Return retained range counts and distinct supporting authority/state/confidence combinations without promoting mixed observations to one conclusion. - Keep parent/query Evidence identity, artifact digest, source selection, source coverage and explicit unknowns inline. Exhausting matching retained rows must not imply complete source or runtime coverage. Complete module items remain available. - Scan retained owner facts once and allocate only the requested rows; avoid materializing full items or source-range arrays. Keep existing requests/results compatible. - Verify actual CLI/MCP schema conversion and public calls, filtering/page boundaries, partial/unknown cases and full-item parity. Measure equivalent completed tasks on the real Obsidian package, including request/schema/response token estimates, elapsed time, CPU and process-family memory. Label unmeasured model costs and first/warm runs. ### Expected interaction with targets Read existing files or captured data. ### Target and scope details (optional) Existing offline application analysis and authenticated retained/inline Evidence only. No code-mode host/SDK, new target execution, injection, attachment or mutation. Source interpretations remain owned by the existing JavaScript graph producer. This is the first concrete data-interface improvement under #4027 and #4091. ### Verification available so far I have a prototype or observed results. ### Verification details (optional) [Preserved experiment and limitations](https://github.com/morluto/rea/blob/experiment/browser-codemode-tool-design-20261015/experiments/codemode-data-contract/results-2026-10-15.md). Current-main integration verification is pending and will be recorded on the implementation PR. Application binaries and regenerable large Evidence are not committed. ### Alternatives considered Existing page + full item calls remain useful for detailed inspection but cause repeated envelopes for this question. Reanalysis repeats unnecessary work. A generic query language, task-specific dependency tool or code-mode runtime is not required for this focused projection. ### Possible direction Extend the existing view union with exact module kind/path filters, offset/limit and a named typed reference projection. Reuse the existing graph facts, view digest, retention and transport admission. Remove directly related duplicated module selection rules while preserving legacy views. ### References #4027, #4091, deferred exploration #4063; closed unmerged research PR #4082. ### Implementation and executed validation Production PR #4097 implements the shared typed view without a code-mode host or SDK. Executed 112 focused tests, full static and documentation checks, and three alternating-order comparisons on real Obsidian. Same 23 selected facts, 24 → 1 reads, 325,201 → 22,158 structured bytes. Serialized cl100k_base task costs with both selected schemas/common bootstrap/all requests/replies: 85,302 → 16,548; complete-catalog projection: 272,771 → 204,017. These are static BPE counts, not hosted-model usage. CLI/MCP view/Evidence identity parity, partial source coverage and cleanup passed. [Measurements, executed source hashes, prior attempts and limits](https://github.com/morluto/rea/blob/feat/javascript-module-reference-views/docs/verification/javascript-module-references-2026-10-15.md). CI/review/merge are tracked on the PR. ### Implementation overlap Production PR #4097 and draft #4106 both implement this request and row schema; do not integrate them independently. The contracts agree on exact paths, canonical identity, observation counts, support states and source/page coverage. #4097 additionally shares module selection with legacy views and retains a real Obsidian CLI/MCP comparison script, measurements and supervised tokenizer cleanup. Its final-head CI/review is in progress.
Author
Owner

@SoGeRiEn commented on GitHub (Oct 15, 2026):

Implemented in draft #4106.

<!-- gh-comment-id:6192248508 --> @SoGeRiEn commented on GitHub (Oct 15, 2026): Implemented in draft #4106.
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#1616
No description provided.