Skip to content

Manifest graph walking

State: open/verified · Kind: module · Audience: system

  • Walks a directory tree of package.json/Cargo.toml manifests into a typed dependency graph plus a derived containment tree.
  • TypeScript peer of the manifest-graph Rust crate; both are held to one shared fixture tree and must agree byte-for-byte on the flattened output.

Given a project root, the library discovers and parses every package.json and Cargo.toml into a typed ManifestInfo, builds the dependency graph the manifests declare (graph.edges, a mesh), and separately derives the containment tree the directory layout implies (GraphNode.parent): one synthetic repo root, group nodes for directories that hold manifests but declare none, single-child groups collapsed away, externals held outside the tree. Malformed manifests degrade to an error-carrying entry rather than aborting the walk. buildSystemGraph runs all three passes and flattens the result into the snake_case SystemGraph wire payload the system-graph viewer and its CLI dump read.

  • walkManifests — recursive, error-tolerant discovery/parsing of manifests into ManifestInfo
  • buildDependencyGraph — typed dependency graph from declared deps, with optional external-package inclusion
  • applyContainment — the containment tree (repo root + collapsed group nodes) as a separate structure from the dependency mesh
  • buildSystemGraph — flattens all three passes into the SystemGraph wire payload
  • CLI (bin/manifest-graph, src/cli.ts) to dump the payload as JSON, used to regenerate the system-graph lab’s fixtures
  • packages/ts/manifest-graph/src/walk.ts, graph.ts, containment.ts, system-graph.ts, aspects.ts
  • peer implementation: solutions/ontological/crates/manifest-graph (Rust), which is what SDF’s system-graph service actually calls
  • packages/ts/manifest-graph/src/

← Back to Capabilities