Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/heimdall

docs/v2/root-diagnostics.md

Root refusal diagnostics

The node-map command prints a roots section after the shared contextual consumer gate runs. The JSON map carries the same report. It does not change acceptance: Enforce remains refused whenever any required obligation fails.

A root is one distinct refused object, keyed by graph node, ordered graph-edge endpoints, binary instruction address, or thread-start address. Hole call and return positions share the hole-node key. The site-row and required-kernel-IP errors share the call-site key. Repeating an edge obligation in another entry does not create another edge root. Binary addresses are separate from MIR hole nodes because several instructions can implement one node, and some instructions have no graph position at all.

Each sorted required_unproven obligation has exactly one owner in roots.items[].obligations. by_reason groups the primary reason for each object; the full original reasons remain available through those indices. Unknown refusal shapes are counted explicitly in other, never dropped. All classes, including zero counts, appear in the output.

depends_on records structural links to other refused objects: edge endpoints, a binary hole's associated graph positions and incoming edges, same-block sites, and open sites blocking runtime import. explained_obligations is the unique union of an object's own and dependent obligations, aggregated by class. These sets overlap between classes. They describe affected obligations, not a promise that accepting one proof will make its dependents pass: a dependent can have several blockers. independent_roots means no link to another refused object was found; it does not assert that no upstream producer cause exists. propagated counts repeated own obligations beyond one per distinct object.

The cached report is informational. The contextual pass recomputes it; a row-only finish() clears its indices because they no longer refer to that pass's obligation list.

The ignored diagnostic_roots_replay integration test accepts HEIMDALL_ROOT_REPORT_CONFIG, a JSON array with label, map, sites, nodes, edges, binaries, and out file paths. It verifies the frozen map's exec/binary digest and site-table hash, applies the same current consumer to every cell, checks exhaustive obligation ownership, and writes the roots alongside the current refusals. It never rewrites the inputs. Historical cached totals must not be mixed with this common-code comparison.

Incomplete target sets

A machine instruction binding does not prove a hole's candidate target set. The map carries the exact exec.evidence Arrow bytes, and the exact exec.candidates bytes: since schema 9 an evidence row names its candidate list by id (candidate_list), and exec.candidates holds each distinct list once. The consumer hashes those bytes against mimir.exec.evidence_sha256 and mimir.exec.candidates_sha256 from the pinned nodes table, reads each row's list with nornir's one reader (mimir_node_map::candidate_lists, which refuses an evidence table that still holds the names in candidates), then joins evidence by both node identity and site ordinal. Missing, altered, ambiguous or unknown evidence refuses with a target-evidence-* reason.

For an incomplete candidate enumeration, the hole row must explicitly carry the typed target-set-complete premise. It means the pinned image's vtable or escaped-function enumeration is exhaustive for that call type, including the rule's type/ABI compatibility assumption. It is distinct from pointer-call, which concerns the MIR origin of an instruction. An empty candidate set means the call never runs under that premise; an empty set or a hole-to-return pair alone never supplies the premise.

Readiness reports count live hole rows using this premise and count empty candidate sets separately. These counts can be printed even while other binding obligations refuse. The map's signed digest covers the evidence bytes and all premise records; the signed protection record's shape is unchanged.

Uncertain syscall bounds

The importer reads every exec.nodes.uncertain mark, including marks on otherwise known syscall names. Lists must be boolean and align with the syscall-name lists. A marked site gives the typed uncertain-syscall-bound refusal. Diagnostic import retains the graph and records the site as open; section validation rechecks the imported mark even if a map omits that open row. A spawn proof cannot use the marked site as an exact syscall bound.

The saved full ABCDF graphs contain such marks and now refuse; the marker-only graphs remain usable. Synthetic import/topology tests use the marker-only fixture, and a separate test requires both full formats to refuse.

No binary discharge is implemented here. Amendment 3 must specify a pinned inventory of every syscall instruction in the containing function, exact site-table numbers for all of them, and equality with the node's number set. An instruction binding or a matching known syscall name alone is insufficient.

For pinned target evidence, vtable-set.count counts enumerated tables, while candidates contains distinct slot targets: several tables can select one function. The table count must be at least the candidate count. escape-set.count counts distinct candidates and must equal their count. An exact repeated evidence row is one observation and one premise use; all cells, including conditions and missing facts, must agree. Conflicting repeats and inconsistent counts remain target-evidence-invalid.