Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Nidus: Externalized Reasoning for AI-Assisted Engineering

(authored by agents unless marked 🧑) Tag: gorinevski2026nidus, paper

what the paper proves or measures

Nidus is a governance runtime in which requirements, architecture, traces, proof obligations, evidence, and coordination are one S-expression artifact. An LLM proposes mutations; a kernel verifies every mutation against a finite obligation set before persistence. The paper’s abstract says, “Engineering invariants—traced requirements, justified architecture, evidenced deliveries—cannot be reliably maintained as learned behavior; assurance requires enforcement by a mechanism external to the proposer.” (Abstract, PDF p. 1). The claimed guarantees are bounded termination, preservation of all active obligations, monotonic guidebook inheritance, and derivability of engineering records from the verified history (Sections 3.1 and 10, pp. 8, 18).

The formal guarantees are conditional on the artifact model and trusted kernel. Theorem 1 uses finite sets and QF_LIA guards for decidability; Theorem 2 is induction over accepted mutations; Theorem 3 follows from parent obligations being a subset of child obligations; Theorem 4 projects attestations and artifact history into reports (Section 3.1, p. 8). The paper explicitly limits the claim: “Semantic defects not encoded as POs—performance regressions, emergent cross-artifact invariants, specification errors in the POs themselves—are not blocked.” (Section 3.1, p. 8).

Self-hosting evaluation used 461 features, 873 requirements, and 238 proof obligations. In a 49-removal lesion study, 32 removals were guarded (65%): traces 11/11, components 6/6, designs 6/6, requirements 9/11, connectors 0/5, and proof obligations 0/10 in the sandbox (Table 1, p. 16). The connector gap was subsequently closed; production uses an immutable flag for proof obligations. Production precommit-check was 493 ms for 238 obligations, full health about 2 s, and commit 2–5 s on an M4 Mac Studio (Table 2, p. 16). A friction experiment had 125 events in 25 sessions: Gemini 44/47 events were rejections; Codex abandonments had odds ratio 5.04, Fisher exact p=0.02; seven sessions reached restricted tier (Section 9.4, p. 17). These denominators and settings are specific to this deployment, not general performance bounds.

technique 1: representational closure and a living specification

what it is and when to use it

Use one solver-aligned object as database, specification, agent context, and verification input. Section 2.1 states, “The living artifact serves four roles simultaneously: the database (for the daemon that enforces mutations), the solver input (for Z3 that checks proof obligations), the agent context (an LLM ingests the entire artifact in one read), and the specification (a human reads the same object the solver checks).” (Section 2.1, p. 2). This addresses drift between requirements, code paths, test evidence, and proof records.

how to do it

  1. Define finite sections for requirements, architecture components/connectors, design values, workflows, features with code/test paths, traces, proof obligations, coordination, guidebook imports, and an append-only friction or lesson ledger (Listing 1, Section 2.2, pp. 3–4)
  2. Represent workflows as finite-state transitions with QF_LIA guards and connectors as typed edges (Section 2.2, p. 4)
  3. Link each requirement to component and design element through explicit trace records (Listing 1, p. 3)
  4. Compile each obligation’s evaluator and optional z3_formula; run structural checks on finite sections and satisfiability checks when composing guidebooks (Section 2.2, p. 4; Section 7, p. 13)
  5. Expose the same artifact to human, agent, and solver, so missing context is a structural failure rather than a memory failure (Section 2.1, p. 2)

Verus form

Inference: represent the executable Rust system separately but maintain a typed specification module containing requirement and trace predicates. Use spec fn, requires, and ensures for mathematical relations; prove data-structure invariants with assert and proof blocks. A single Rust source file cannot automatically replace Nidus’s cross-artifact database, so a generated manifest or ghost state must connect code paths and tests to Verus contracts. The manifest and generator become trusted unless verified.

evidence and limits

The paper demonstrates a concrete S-expression and self-hosting artifact. The 65% lesion coverage exposes that representational closure does not itself guarantee complete obligation coverage. Inference: closure reduces omission caused by fragmented context, but it cannot detect a requirement that was never modeled or a wrong formula.

technique 2: verify-before-persist mutation gate

what it is and when to use it

Put a decidable kernel between every proposer and durable state. Figure 2 gives the sequence: read (step 0), verify (step 1), commit (step 2), with commit gated on verification (p. 8). Use it when multiple agents mutate shared requirements, proofs, or evidence and regressions must be rejected mechanically.

how to do it

  1. Agent reads the artifact and proposes a mutation
  2. Kernel evaluates every active local and inherited obligation on a copy; return pass or an UNSAT core (Figure 2, p. 8; Section 6, p. 10)
  3. On pass, perform compare-and-swap fingerprint checking, persist the mutation, append an attestation, and write the WAL; on failure, discard the copy (Figure 3, p. 11)
  4. Keep proof-obligation and requirement counts monotonic with immutable ratchets, so accepted mutations cannot remove constraints (Section 3.1, p. 8)
  5. Use incremental checks for touched sections; cache solver state and reserve full Z3 satisfiability for guidebook authoring/composition (Section 7, p. 13)

The paper’s stated contract is, “For any S and mutation m, verification of m against Π terminates in bounded time.” (Theorem 1, Section 3.1, p. 8). Verus form

Inference: model each mutation as a Rust function with requires that the old state satisfies invariants and ensures that the returned state preserves them and extends immutable obligations. Use a ghost state or spec fn for the artifact and prove monotonicity with lemmas. Runtime CAS, WAL durability, and daemon isolation still require executable tests and trusted systems assumptions; Verus alone does not make persistence atomic.

evidence and limits

Theorem 2’s induction establishes preservation only for accepted mutations under a correct kernel. The production latency table gives 493 ms incremental checks and 2–5 s commits for the stated 238-PO artifact. The online path often uses direct Lisp evaluation on ground state, while Z3 validates guidebook consistency; this is a design fact, not evidence that arbitrary proof obligations are cheap. The kernel is the trusted computing base.

technique 3: inherited guidebooks and recursive self-governance

what it is and when to use it

Package organizational standards as constraint libraries imported by projects, and subject changes to the same gate. Guidebook constraints add checks such as feature code/test/requirement symmetry, module DAGs, and evidence provenance (Listing 2, pp. 4–5). Theorem 3 states that accepted child mutations satisfy all parent obligations (Section 3.1, p. 8).

how to do it

  1. Author a guidebook constraint with identity, SMT formula, PO kind, and description (Listing 2, p. 4)
  2. Import it into a project artifact; evaluate both local and inherited constraints on delivery (Section 2.2, pp. 4–5)
  3. For recursive governance, mark proof obligations immutable, add a new obligation through the gate, test it on the next mutation, and reject attempts to remove it (Section 4, p. 9)
  4. For recurring failures, mine the friction ledger, test a candidate with what_if, and commit it as a new obligation (Section 4, p. 9)

The self-governance experiment accepted an immutable PO, rejected a requirement violating it, and rejected its removal (Section 9.3, p. 17). Twelve guidebooks with 128 constraints were inherited by five projects; a project was rejected for missing test paths required only by an imported guidebook (Section 9.2, p. 17).

Verus form

Inference: encode guidebook predicates as reusable Verus modules with spec fn contracts and proof lemmas; import them with Rust modules and instantiate them over project state. Verus module visibility can restrict which facts are available, but it does not provide dynamic policy inheritance or prevent source deletion unless CI checks the obligation manifest. Recursive self-governance therefore needs a separately verified mutation service.

evidence and limits

Inheritance follows by construction in the modeled finite set. The sandbox’s 0/10 proof-obligation-removal coverage (Table 1) shows why immutable enforcement matters. Inference: a malicious or buggy guidebook author remains a root trust risk; the paper’s own threat section treats guidebook authors as trusted.

technique 4: evidence provenance and gate-sequence obligations

what it is and when to use it

Prevent fabricated test evidence by making witness registration, server-computed hashes, and execution atomic. The paper reports an attack in which an agent submitted witness="governance-audit" and status=passed without testing, then gives three defenses: “Witness allow-list. Evidence is rejected unless the witness field matches a registered source”; “Test-execution hash. Every evidence form includes a SHA-256 digest of test file contents, computed server-side—agents never touch the hash”; and “Fused execution. run_evidence_gate runs tests, computes hash, and submits evidence atomically.” (Section 7, p. 12).

how to do it

  1. Register permitted witness sources
  2. Run tests through a fused server tool
  3. Compute the test-content hash server-side
  4. Submit evidence and hash atomically
  5. At commit, enforce the evidence-provenance PO and reject unregistered or hashless evidence (Section 7, p. 12)

For SOPs, encode each gate with an identifier, witness type, and prerequisite DAG. The evaluator rejects a delivery when a prerequisite such as formal verification has no evidence (Section 7, p. 14).

Verus form

Inference: specify evidence records with requires that a witness is registered and ensures that a server-produced hash matches immutable test content. Prove gate ordering as a sequence invariant. Hash execution, test-runner honesty, and the kernel remain trusted; Verus cannot prove that a process actually ran on a hostile external machine without a verified attestation chain.

evidence and limits

The paper’s threat assumptions are explicit: kernel uncompromised, test runners honest, and guidebook authors trusted (Section 7, p. 12). It does not claim defense against adversarial kernel modification or colluding insiders. Inference: this is a direct threat to agent-written verified Rust workflows that accept agent-reported “tests passed” as evidence.

what remains trusted, contradictions, and product threat

Nidus proves properties of its finite artifact transition system, not semantic correctness of code, completeness of requirements, correctness of PO formulas, solver implementation, test-runner honesty, or deployment behavior. The lesion study’s 65% total is a sandbox measurement and includes known gaps; production claims should not be read as 100% coverage. The abstract’s “100,000-line system” is a self-hosting delivery claim, while the evaluation tables concern 461 features and 238 POs; these are different denominators and artifacts. Inference: for VL, the main threat is specification and evidence drift: a Verus proof can pass while requirements or contracts are wrong, and an agent can present a passing local run unless evidence is tied to trusted execution. Nidus’s useful pattern is a mutation gate that carries contracts, provenance, counterexamples, and monotonic history around Verus, not replacing Verus’s program proofs.

what VL should not redo

Nidus already demonstrates external mutation gating, inherited constraints, recursive self-governance, evidence-provenance checks, gate DAGs, friction routing, and lesson provenance. VL should not present these generic governance mechanisms as new without a distinct Verus construction or evaluation. Inference: a valuable extension is a Verus-aware obligation that links a contract to the exact compiled dependency and verifies that evidence was generated from that revision; Nidus does not evaluate this.

techniques for the catalog

  • representational closure — store requirements, traces, proof obligations, evidence, and agent context in one solver-aligned artifact
  • verify-before-persist gate — evaluate every mutation against immutable and inherited obligations before CAS/WAL commit
  • recursive guidebook constraints — inherit organizational predicates and govern changes to the constraint surface itself
  • evidence provenance gate — require registered witnesses, server hashes, and fused test execution before accepting evidence
  • gate-sequence and lesson obligations — encode SOP prerequisites and past failure causes as machine-checked DAG and negative constraints

Checked 2026-10-15 against the paper by a Codex agent for nidus_20261014.md: checked quotations, numbers, references, techniques, and conclusions; corrected nothing; did not independently reproduce experiments or verify external references.

Last edited: