Repository navigation
feat(javascript): add filtered retained module reference views - #4097
Conversation
Expose canonical module identities, retained range counts and mixed observation support through the shared analysis-view contract. Preserve source selection, partial coverage, parent provenance and full-item access while paging only the requested matching rows. Verify public CLI/MCP parity on the shipped Obsidian ASAR and retain bounded reproduction scripts, completed-query costs and measurement limitations. Co-authored-by: Kaoru0822 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The reviewed changes appear safe to merge; no new blocking issue was found. SummaryAdds filtered JavaScript module-reference pages to
No new actionable issues were found in the changes since the previous review. Both supplied threads are unnumbered and fully addressed: the test asserts two repeated ranges and item-view agreement, and token counting now has a deadline with shared cleanup. Review used source inspection; no tests were run. Whether another PR supersedes this one could not be checked because GitHub authentication was unavailable. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Retained or inline Evidence] --> B[Validated application graph]
B --> C[Exact kind and path filters]
C --> D[Page in retained order]
D --> E[Identity, range count, support states]
B --> F[Source coverage and unknown counts]
E --> G[Typed reference view]
F --> G
Reviews (3) · Last reviewed commit: "fix(verification): supervise tokenizer d..." · Reviewed by Greptile |
…counts Guard token accounting with a caller-selected wall-time deadline and preserve spawn errors so stalled children cannot indefinitely delay Evidence cleanup. Verify timeout cleanup against the real Obsidian workflow and retain updated measurement records without pooling earlier samples. Add a deterministic positive-count regression for repeated source ranges and unavailable locations, cross-checked against the full item projection. Co-authored-by: Kaoru0822 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 83199b99d5
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…s ownership Reuse owned-command supervision, private runtime files and shared verifier cleanup. Preserve recovery ownership on incomplete cleanup. Record a real Obsidian verification with a detached SIGTERM-ignoring tokenizer helper. Co-authored-by: Kaoru0822 <[email protected]>
Summary
Retrieve canonical JavaScript module identities, retained source-range counts and mixed observation support in one filtered, typed
inspect_analysis_viewpage. A real Obsidianmain.jsquestion previously needed a page plus 23 full item reads; the new view returns the same selected facts in one call.Fixes #4092. Part of #4027 and the decision in #4091 to prioritize shared data contracts while deferring code mode. Overlapping draft #4106 implements the same request/row schema for #4092; integrate only one implementation. This PR also shares legacy module selection and includes the saved real-application verifier/measurements.
Problem and expected behavior
Paths can identify several module nodes. Callers need exact canonical identities and supporting facts without repeatedly receiving unrelated observations. Filters preserve null, empty and duplicate paths; page exhaustion remains separate from partial/unknown source coverage. Existing module items provide full observations and exact locations.
Change and scope
Add
view: {kind: "javascript", collection: "modules", projection: "references", where: {path, kind}, offset, limit}to the existing tool. Share module kind/path/paging ownership with legacy views, scan retained order once and retain only the requested page. No source reparsing, query cache, SDK or code host.Contract and boundary impact
Expected effects:
Evidence and regression coverage
Executed against official Obsidian 1.14.4 ASAR with
package.json/main.jsselected. Three alternating-order pairs returned identical 23-row facts; public CLI inline input and MCP retained input produced identical view/Evidence IDs. Existing 36 unselected files and partial/unknown coverage remained explicit.Completed query: 24 → 1 calls, 325,201 → 22,158 structured bytes. Serialized
cl100k_basecosts including both selected schemas, common bootstrap and all requests/replies: 85,302 → 16,548; with the complete catalog: 272,771 → 204,017. These are static BPE counts, not model billing. No hosted-agent latency/success claim. The measured legacy item reads are serial; concurrent legacy requests and model-turn savings were not measured. The context/call-count comparison does not establish a speedup over an optimized parallel baseline. Initial analysis is shared preparation; CPU/memory were measured for the complete verifier, not isolated by arm. Shared-host latency variation and prior attempts are preserved.Reproduction, exact samples, resource measurements and limits.
Validation performed
npm run test:focusedwith the view domain/service, analysis-detail/example contracts, public CLI/MCP and SDK-converted schema-validity files: 112 passed on the initial implementation; after review, the expanded domain suite passed 32/32, including repeated positive ranges, unavailable locations and full-item parity.npm run build:cached: passed.npm run check: passed, including typecheck, lint, format, knip and architecture guards.npm run docs:check: passed, including 5 consistency tests.node scripts/verify/javascript/module-references.mjswith the real ASAR, selected sources, three rounds, CLI parity and tiktoken 0.12.0: passed. Final complete verifier: 35.797 s wall / 35.197 s CPU / 1,938,313,216 B peak cgroup memory; cleanup verified, no OOM. All local heavy work bounded to one CPU and 8 GiB; cgroup memory includes file cache.Review follow-up: tokenizer commands now use shared owned-process supervision and private runtime files. After real Obsidian reads/CLI parity, a committed POSIX fixture forked a detached SIGTERM-ignoring helper. A 2,000 ms deadline produced the expected
OwnedCommandFailure(timeout), no cleanup failure, an empty owned scope and no temporary verifier files. Cleanup failures preserve the primary error, command owner and recovery files. The normal tokenizer and three paired real queries passed again. Linux family cleanup was exercised; Windows/macOS family behavior is unverified here. Prior cohorts are retained separately.Initial CI failed in unchanged service-worker restore (
protocol_error) and an existing Windows CLI subprocess 15-second deadline. The final6fb4a8abhead passed the browser and Windows lanes without changing those paths. Codex and Greptile completed final-head review with no new actionable findings; all three earlier findings were fixed, validated and resolved.Compatibility, safety, and release
Additive contract; no migration or dependency changes. Verified on Linux x64 using static shipped-artifact analysis and actual CLI/MCP clients. The new view was verified using static shipped-artifact data; this does not establish live Electron/browser behavior or Windows/macOS live analysis.
Author readiness
Human owner: @N0zoM1z0
The session explicitly authorized continued implementation, validation, ready PRs and merging, including waiving manual declarations. The agent reviewed this diff and its evidence. A human final-diff review is not asserted; the human-review declarations below remain unchecked.
Before merge