Skip to content

Add native JavaScript bundle indexing and semantic queries #68

Closed

Description

@morluto

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

  1. added
    enhancement
    P1: high
    area: domain
    area: server
    roadmap
    on Jul 12, 2026
  2. changed the title [-]Add bundle-aware CodeDB indexing[/-] [+]Add native JavaScript bundle indexing and semantic queries[/+] on Jul 12, 2026
  3. morluto commented on Jul 20, 2026

    @morluto
    OwnerAuthor

    Closing as completed. JavaScript bundle indexing and bounded semantic queries are now shipped:

    • The JavaScript Application Graph (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 paginated rea://evidence/ resources.
    • trace_application_feature traverses the graph from a literal seed (node, route, string, API, IPC channel, module, native export) with bounded direction/depth/nodes/edges/paths.
    • compare_application_versions compares two authenticated graphs using digest, module-source, source-map, structural-fingerprint, and semantic-key tiers.
    • reconcile_javascript_runtime correlates static graphs with passive CDP/Electron runtime evidence.
    • Tests (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.
  4. added a commit that references this issue on Oct 26, 2026
  5. added
    area: native
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1: higharea: domainarea: nativearea: serverenhancementroadmap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions