Files
git.stella-ops.org/docs/reachability/callgraph-formats.md
StellaOps Bot 35c8f9216f Add tests and implement timeline ingestion options with NATS and Redis subscribers
- Introduced `BinaryReachabilityLifterTests` to validate binary lifting functionality.
- Created `PackRunWorkerOptions` for configuring worker paths and execution persistence.
- Added `TimelineIngestionOptions` for configuring NATS and Redis ingestion transports.
- Implemented `NatsTimelineEventSubscriber` for subscribing to NATS events.
- Developed `RedisTimelineEventSubscriber` for reading from Redis Streams.
- Added `TimelineEnvelopeParser` to normalize incoming event envelopes.
- Created unit tests for `TimelineEnvelopeParser` to ensure correct field mapping.
- Implemented `TimelineAuthorizationAuditSink` for logging authorization outcomes.
2025-12-03 09:46:48 +02:00

1.9 KiB

Reachability Callgraph Formats (richgraph-v1)

Purpose

Normalize static callgraphs across languages so Signals can merge them with runtime traces and replay bundles deterministically.

Core fields (per node/edge)

  • nodes[].id — canonical SymbolID (language-specific, stable, lowercase where applicable).
  • nodes[].kind — e.g., method/function/class/file.
  • edges[].sourceId / edges[].targetId — SymbolIDs; edge types include call, import, inherit, reference.
  • artifact — CAS paths for source graph files; include sha256, uri, optional generator (analyzer name/version).

Language-specific notes

  • JVM: use JVM internal names; include signature for overloads.
  • .NET/Roslyn: fully-qualified method token; include assembly and module for cross-assembly edges.
  • Go SSA: package path + function; include receiver for methods.
  • Node/Deno TS: module path + exported symbol; ES module graph only.
  • Rust MIR: crate::module::symbol; monomorphized forms allowed if stable.
  • Swift SIL: mangled name; demangled kept in metadata only.
  • Shell/binaries: SymbolID = sym:binary:{sha256(file)\0section\0addr\0name\0linkage} via SymbolId.ForBinaryAddressed, include code_id = CodeId.ForBinarySegment(...) and set kind=binary.

CAS layout

  • Store graph bundles under reachability_graphs/<hh>/<sha>.tar.zst.
  • Bundle SHOULD contain meta.json with analyzer, version, language, component, and entry points (array).
  • File order inside tar must be lexicographic to keep hashes stable.

Validation rules

  • No duplicate node IDs; edges must reference existing nodes.
  • Entry points list must be present (even if empty) for Signals recompute.
  • Graph SHA256 must match tar content; Signals rejects mismatched SHA.
  • Only ASCII; UTF-8 paths are allowed but must be normalized (NFC).

References

  • Union schema: docs/reachability/runtime-static-union-schema.md
  • Delivery guide: docs/reachability/DELIVERY_GUIDE.md