Repository navigation
Description
Problem
Text search cannot reliably connect strings, protocol calls, duplicated modules, chunks, closures, and state fields in large minified bundles.
Outcome
Build a provider-neutral JavaScript bundle index and bounded semantic query engine as a native REA capability. The public contract, normalized index model, query semantics, evidence output, and persistence format belong to REA; optional parsers may be replaceable implementation details.
Capabilities
- Index scripts, chunks, source maps, and extracted ASAR content.
- Recover module and function boundaries where supported.
- Build function and call graphs.
- Link strings, constants, selectors, and properties to owning code.
- Find protocol consumers and state-field reads and writes.
- Detect duplicated or transformed bundled modules.
- Correlate historical-source candidates using strings, constants, call shape, and structural similarity.
- Record artifact hashes, index schema version, parser versions, confidence, limitations, and source locations.
- Expose bounded literal, structural, and relationship queries through the same CLI/MCP schemas.
Safety
Never execute indexed JavaScript. Treat parse failures and unsupported syntax as partial evidence rather than absence. Bound patterns, queries, results, snippets, memory, disk usage, and indexing time. Redact declared secrets from snippets and exported evidence.
Acceptance criteria
- Multi-chunk fixtures support string ownership, calls, duplicates, protocol consumers, and state-flow queries.
- Source maps are tracked as a distinct authority rather than silently treated as shipped source.
- Every query is bounded and returns pagination, total or truncation metadata, confidence, and limitations.
- Indexes invalidate when artifact hashes, schema versions, or parser versions change.
- Unsupported syntax and partial parses are typed and cannot be mistaken for exhaustive results.
- Historical candidates are classified as unchanged, modified, removed, added, or unknown without claiming recovery of destroyed names or comments.
- The implementation has no public dependency on, or terminology from, an external indexing product.
Dependencies
Parents #39 and #42. Requires artifact decomposition, provider SDK, and evidence bundles.
Non-goals
Runtime debugging, executing target code, guaranteed recovery of original boundaries without source maps, or coupling the public API to one parser or indexing backend.
Activity
[-]Add bundle-aware CodeDB indexing[/-][+]Add native JavaScript bundle indexing and semantic queries[/+]morluto commentedon Jul 20, 2026
Closing as completed. JavaScript bundle indexing and bounded semantic queries are now shipped:
src/domain/javascriptApplicationGraph*.ts) indexes scripts, chunks, modules, source maps, ASAR entries, Electron main/preload/renderer processes, IPC channels, native addons, and managed-assembly handoffs.analyze_javascript_application(MCP/CLI) produces the graph and a bounded summary with paginatedrea://evidence/resources.trace_application_featuretraverses the graph from a literal seed (node, route, string, API, IPC channel, module, native export) with bounded direction/depth/nodes/edges/paths.compare_application_versionscompares two authenticated graphs using digest, module-source, source-map, structural-fingerprint, and semantic-key tiers.reconcile_javascript_runtimecorrelates static graphs with passive CDP/Electron runtime evidence.tests/javascriptApplicationGraph.test.ts,tests/javascriptApplicationWorkflows.test.ts,tests/javascriptSemanticAnalysis.test.ts,tests/javascriptBundlerAdapters.test.ts,tests/javascriptRuntimeReconciliation.test.ts) cover indexing, traversal, comparison, and reconciliation.Merge PR morluto#68: vendor report rules Kaspersky APT + Huorong malw…