Skip to content

gbrg-napi: wire blast_radius/graph_status/containment_query to real gbrg-core reads (replace stubs) #591

Description

@mdheller

Gap

crates/gbrg-napi/src/lib.rs returns hardcoded ProofArtifact stub JSON — blast_radius yields "derivation":"stub: gbrg-napi not yet wired to a frozen index", generated:false, zeros; graph_status returns "skeleton". So the consumable (N-API) surface of GBRG is a skeleton even though gbrg-core is real.

Impact (downstream, blocked on this)

The fix (gbrg-core already exposes what's needed)

Wire the napi bodies to the real reads:

  • resolve the IRI: gbrg_core::cell_iri_to_node_id(&cell_id) -> NodeId
  • query a frozen GraphIndex: dependents_count, reverse_dependents, transitive_dependents, code_dependents_count, test_coverage_reach, reachable_set (containment), and build the result with build_proof_artifact / blast_radius_score.
  • Missing piece: a process-held frozen GraphIndex. build_index(cells, edges) exists (whatif.rs) but is private; expose a public freeze/build_index_from_source(root) (parse via gbrg-parser → SemanticCells+edges → build_index) and a napi freeze_index(root) that stores it in a global (OnceCell/Mutex), which blast_radius(cell_id) then queries.

Acceptance

  • blast_radius returns a real ProofArtifact (generated:true, real dependents_count/blast_radius) when an index is frozen, and an honest INCONCLUSIVE (not a fake 0) when none is.
  • cargo build -p gbrg-napi green; a round-trip test (freeze a small source tree → blast_radius(known cell) → non-zero dependents).

A partial wiring PR (real IRI resolution + honest-INCONCLUSIVE-vs-real-query branch) is going up now; this issue tracks the frozen-index plumbing.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions