code wiki / _hdl_build / nx_capgraph_edges.nx
nx_capgraph_edges.nx
buildroot/runtime/_hdl_build/nx_capgraph_edges.nx
about
nx_capgraph_edges.nx -- DERIVES the capability graph's prerequisite edges FROM THE IMPORT CLOSURE.
WHY (debt 1785518444, filed by me 2026-07-31): nx_capgraph_derive shipped reading a HAND-DECLARED
edge file. Declared edges are a seed, not a measurement, and a MISSING edge is the dangerous case --
it lets a dependent read healthier than the layer it stands on. This organ replaces the declaration
with a measurement.
THE MEASUREMENT, end to end, no taste anywhere in it:
1. OWNERSHIP comes from knowledge/compare/<domain>.matrix, which already maps every domain to the
real organ SOURCE PATHS backing each of its capabilities (field2), with field3 = the symbol.
Rows whose symbol is _ABSENT_ are declared GAPS -- skipped, they own nothing.
2. DEPENDENCY comes from the source itself: every `import "<module>.nx"` in an owned source.
3. EDGE: if a source owned by domain A imports a module owned by domain B (B != A), then B is a
PREREQUISITE of A. That is a fact about the build, not an opinion about the architecture.
⚠THE MEASURED GRAPH IS NOT ACYCLIC. Probed 2026-07-31: search>webscraping, browser>webscraping AND
webscraping>browser, search>deepresearch AND deepresearch>search, comms>videoops AND videoops>comms.
Mutually-importing domains are REAL. This is not a defect in the measurement and must not be
"cleaned up" by dropping edges: a cycle is a genuine finding -- it names a CO-DEPENDENT CLUSTER that
can only be raised together. The consumer's min-relaxation is a fixpoint iteration bounded by node
count, so it converges on a general digraph; the cycle members simply share a floor.
HONEST ENVELOPE, emitted into the file itself so no reader has to trust this comment:
- coverage is bounded by the matrices, not by this organ: a domain with few matrix rows yields few
edges. That is a matrix-completeness gap, and it is REPORTED, never silently treated as "no deps".
- matrix rows pointing at sources that do not exist on disk are COUNTED and reported (missing=N).
- first-wins ownership when two domains claim the same module; ambiguity is COUNTED and reported.
nx_capgraph_edges [outfile] exit 0 ok | 4 capture-fail | 5 write-fail
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_capgraph_edges_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 33 | func main(argc: i64, argv: *i64) -> i64 |