diff --git a/.gitleaks.toml b/.gitleaks.toml new file mode 100644 index 0000000..86c44e0 --- /dev/null +++ b/.gitleaks.toml @@ -0,0 +1,15 @@ +title = "forgekit gitleaks config" + +[extend] +useDefault = true + +# generic-api-key false-positives: these are bibliography datasets where every entry has a +# "key" field holding a BibTeX-style citation key (e.g. "wang2023voyager", "ebbinghaus1885"). +# The literal field name "key" next to a quoted alphanumeric value trips the default +# generic-api-key rule even though there is no secret here — just citation metadata. +[allowlist] +description = "Bibliography citation-key fields, not secrets" +paths = [ + '''^research/formal-synthesis/graded_reference_set\.json$''', + '''^research/formal-synthesis/merged_references\.json$''', +] diff --git a/ROADMAP.md b/ROADMAP.md index 8cc4028..e7fdccf 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -7,7 +7,7 @@ every tool. This is where that brain is headed. Direction, not promises — shaped by the two field reports this project is grounded in (the SDLC pain-point map and the ecosystem landscape). Open a Discussion to weigh in. -## Now (`master`, v0.12.0) +## Now (`master`, v0.12.1) The substrate is fully graded — decision math replaces every keyword heuristic: exemplar k-NN routing, entropy secret detection, noisy-OR goal-drift over paths **and** the identifiers a file diff --git a/research/formal-synthesis/README.md b/research/formal-synthesis/README.md new file mode 100644 index 0000000..ee5d6da --- /dev/null +++ b/research/formal-synthesis/README.md @@ -0,0 +1,83 @@ +# Formal Synthesis — A Theory of the Cognitive Substrate for Coding Agents + +This directory contains a formal, mathematical unification of three independently +developed bodies of work that all describe the **same architecture** for making a +frozen language model reliable at coding: + +1. **The Cognitive Substrate** — five faculties a frozen model structurally lacks + (memory, learning, imagination, self-correction, impact-awareness) and six + operating mechanisms M1–M6, with two runnable prototypes. +2. **The End-to-End Agent Reliability Framework** (`FRAMEWORK.md`) — failure modes + F1 (partial work) and F2 (session amnesia), the change-closure fixpoint Δ*, + invariants I1–I4, algorithms A1–A7, and correctness theorems T1–T6. +3. **forgekit / claude-e2e-kit** — the deployed implementation: committed-file + memory, deterministic lifecycle hooks, and auto-invoked skills. + +The synthesis proves these are **one object in three vocabularies**. + +## The central result + +> **Reliability = a probabilistic instruction layer × a deterministic interception +> layer. Neither layer alone suffices.** + +Instructions (`CLAUDE.md`, rules, skills) *raise* the probability `p < 1` that the +model behaves correctly, but can never reach `p = 1` — so the residual silent-miss +rate over `n` tasks is `1 − pⁿ → 1`. A deterministic layer (hooks that execute +regardless of the model's choice) multiplies that residual down by a factor +`(1 − cⱼ)` per check — but cannot catch the *semantic* class (undecidable, by Rice's +theorem), so it needs the soft layer to shrink what reaches it. The paper states this +as **Theorem D** and proves it. It is the formal content of the practitioner's rule: +*never trust the output of a probability engine; earn trust with an external check.* + +## Three anchor identities (not analogies — the same mathematics) + +| Substrate | Framework | Relationship | +|---|---|---| +| Impact-Oracle blast-radius | change-closure `Δ*` (least fixpoint of `X ↦ X ∪ N(X)`) | **identical** — reverse reachability, run to fixpoint ⇒ perfect recall | +| M2 assumption gate | amnesia equation `assumption ≈ argmax P(convention \| training)` | **identical** — the gate supplies missing context or halts, never guesses | +| substrate's two layers | design law "Π₃ probabilistic, Π₂ deterministic" | **identical** — Theorem D | + +## Contents + +| File | What it is | +|---|---| +| `substrate_synthesis.pdf` | The formal synthesis paper (42 pp): definitions, Theorem D + proof, the unified A1–A7 TASK loop, invariants I1–I4, theorems T1–T6 with proofs, the 16-row crosswalk, the full 14-mapping Qur'anic epistemology, both prototypes with honest metrics. | +| `substrate_synthesis.html` | Same paper, self-contained HTML. | +| `crosswalk.json` / `crosswalk.md` | The three-way term-by-term correspondence (substrate ↔ framework ↔ forgekit), with the P1/P2/P3 → Π₁/Π₂/Π₃ notation reconciliation. | +| `graded_reference_set.json` / `.md` | The 15 new sources independently verified and graded (9 confirmed, 6 traceable, 0 unverifiable), including the disambiguation of the two future-dated arXiv IDs. | +| `merged_references.json` | Full 47-entry bibliography (32 original + 15 new, deduped). | +| `figures/schematic_duality.png` | The two-layer duality architecture. | +| `figures/schematic_taskloop.png` | The unified 7-stage TASK loop (each stage bound to faculty · algorithm · Qur'anic anchor). | + +The **two runnable prototypes** referenced throughout the paper already live in this +repo and are not duplicated here: + +- `../python-prototypes/impact_oracle/` — Prototype I, the impact oracle (A1 / Δ*). + Runnable, 36 tests. Perfect recall on impacted files. +- `../python-prototypes/router_gate/` — Prototype II, complexity-router + + assumption-gate (A7 + A6 / M1 + M2). Runnable, 19 tests. 62.1% real cost saved, + live-measured. + +## Honesty commitments (carried from the source work) + +- **The prototypes are demonstrations, not benchmarks.** The router/gate's perfect + accuracy is on a 30-task hand-labelled set whose thresholds were tuned against it — + it shows the rubric *can separate* the cases. The cost figures, by contrast, are + exact arithmetic on **real measured token counts** from live model calls, and the + correctness sub-experiment actually executed the cheaper models' code against tests. +- **The impact oracle does not win on F1** (0.75 vs grep's 0.79). Its property is + **perfect recall** — the safety guarantee for "what will my edit break?". +- **Every future-dated / recent citation was verified by direct fetch, not inferred.** + Both 2026 arXiv IDs resolve to real preprints; one (`2601.05111`) is a *different* + paper from the founding Agent-as-a-Judge work (`2410.10934`), and both are recorded. +- **The Qur'anic lens is framing, never technical authority.** It supplies the + vocabulary of epistemic obligation — *lā taqfu*, *tabayyun*, *al-amāna* — that names + *why* each safeguard is mandatory; the engineering stands on its own merits. + +## Relationship to forgekit + +`forgekit` is one binding of this theory (and `claude-e2e-kit` is its Claude-specific +reference realization). The paper's §11 gives the exact object-by-object mapping: +`Π₁` = the committed `docs/*.md` store, `Π₂` = the `session-context` / `docs-guard` / +`intent-router` hooks, `Π₃` = `CLAUDE.md` + `.claude/rules/`. The two prototypes here +are the mechanical cores of the `/impact` skill and the effort-router. diff --git a/research/formal-synthesis/crosswalk.json b/research/formal-synthesis/crosswalk.json new file mode 100644 index 0000000..b38506d --- /dev/null +++ b/research/formal-synthesis/crosswalk.json @@ -0,0 +1,130 @@ +{ + "meta": { + "title": "Three-way crosswalk: Cognitive Substrate theory <-> End-to-End Reliability Framework <-> forgekit / claude-e2e-kit", + "sources": { + "S": "Cognitive Substrate for Coding Agents (v2 whitepaper) \u2014 faculties F_i, mechanisms M1-M6", + "E": "End-to-End Agent Reliability Framework (FRAMEWORK.md) \u2014 F1/F2, I1-I4, A1-A7, T1-T6, Delta*", + "K": "forgekit / claude-e2e-kit implementation \u2014 hooks, skills, agents, committed files" + }, + "notation_reconciliation": { + "collision": "Both frameworks independently use the labels P1/P2/P3.", + "substrate_P": "In the substrate paper, P1/P2/P3 are PROPERTIES of the frozen model: P1 statelessness, P2 frozen weights, P3 bounded/undifferentiated context.", + "framework_P": "In the e2e framework, P1/P2/P3 are the three required PRIMITIVES: P1 persistent store, P2 lifecycle interception, P3 instruction channel.", + "resolution": "In the synthesis, the substrate model-properties keep P1/P2/P3; the framework primitives are RENAMED Pi1 (persistent store), Pi2 (lifecycle interception), Pi3 (instruction channel). Every use of the primitives in the synthesis is written Pi-n to remove the collision." + } + }, + "rows": [ + { + "concept": "The frozen core", + "substrate": "y = f_theta(x): stateless map, fixed weights, bounded context (properties P1,P2,P3)", + "framework": "the agent/model whose behavior instructions can only raise the PROBABILITY of (p<1)", + "forgekit": "Claude / Codex / Cursor / Gemini / Aider \u2014 the model the kit wraps, never modifies", + "relation": "identical object: all three treat the model as a fixed probabilistic map to be wrapped, not retrained" + }, + { + "concept": "Impact-awareness / partial-work failure", + "substrate": "Faculty: impact-awareness gap; the developer silently simulates 'what will this edit break'. Prototype I = Impact Oracle (reverse-dependency blast radius with confidence decay)", + "framework": "F1 partial work; dependents operator N(X); required change closure Delta* = least fixpoint of X |-> X \u222a N(X); Done predicate; Algorithm A1 IMPACT-CLOSURE", + "forgekit": "/impact skill; documentation-map.md (R_declared); grep identifier sweep (R_discovered)", + "relation": "IDENTICAL MATHEMATICS. The Impact Oracle computes N(X) by reverse reachability on the dependency graph; Delta* is exactly the oracle's transitive blast-radius set. The oracle adds a confidence-decay weight the framework's set-theoretic N(X) leaves boolean." + }, + { + "concept": "Memory / session-amnesia failure", + "substrate": "Faculty: persistent memory gap; each context window is ephemeral. Validity-anchored memory (facts carry confirmed/discredited state updated by verified outcomes)", + "framework": "F2 session amnesia; continuity invariant I2 (essential(K_i) \u2286 P and loader L must load it); handoff operator H; K_{i+1}(0)=L(P)", + "forgekit": "docs/STATE.md (bounded snapshot) + docs/DECISIONS.md (append-only log); /handoff writes it; SessionStart hook injects it", + "relation": "Same failure, same fix (external bounded-compression checkpoint). Substrate adds validity-anchoring (prune by whether a past prediction was externally confirmed); framework adds the snapshot+WAL split (STATE mutable vs DECISIONS append-only)." + }, + { + "concept": "Why assumptions happen (the root the user named)", + "substrate": "M2 assumption/uncertainty gate: under-specified input -> the model confabulates a convention", + "framework": "amnesia equation: when f \u2208 essential(K) is missing from L(P), assumption \u2248 argmax P(convention | training data) \u2014 the mathematically EXPECTED result of missing context, not misbehavior. Invariant I3 (no fabrication)", + "forgekit": "CLAUDE.md No-assumptions rule; intent-router SPEC card ('state assumptions explicitly')", + "relation": "The framework gives the substrate's M2 gate its formal justification: assumption is argmax over the prior, so the fix is to supply context (raise what L loads) OR gate on missing context (halt), never to hope." + }, + { + "concept": "Self-correction / verification", + "substrate": "M6 inline verification; Prototype-II verify step; self-correction faculty", + "framework": "Algorithm A6 COMPLETION-GATE (deterministic Stop-hook floor); Hoare postcondition Done(t); the verification operator in A3 (verified-unaffected requires an actual grep, not an assumption)", + "forgekit": "docs-guard.sh Stop hook (blocks finish if code changed but no doc/state artifact did); reviewer agent verdict", + "relation": "Same verify-gate. Substrate framed it as a mechanism; framework proves it terminates (T1) and is sound (T3) and makes it the deterministic layer of the duality." + }, + { + "concept": "Complexity routing", + "substrate": "M1 complexity-aware router (transparent additive rubric); Prototype-II router", + "framework": "Algorithm A7 KNOWLEDGE-ROUTER (where every fact lives, keeps always-loaded context bounded); System 1/System 2 effort routing; intent DFA", + "forgekit": "intent-router.sh (UserPromptSubmit hook, keyword DFA, <10ms, zero-token); effort-routing rule in CLAUDE.md; per-agent model: fields", + "relation": "Two facets of one routing principle. Substrate M1 routes by TASK COMPLEXITY -> model tier (cost). Framework A7 routes by KNOWLEDGE TYPE -> storage home (context budget). Both are transparent/deterministic, both reject an opaque-LLM classifier for the same reason." + }, + { + "concept": "Task decomposition", + "substrate": "M3 task/session decomposition", + "framework": "HTN closure -> ordered task list (A1 output is the worklist); the meta-algorithm TASK(t)", + "forgekit": "sdlc-pilot 7-phase skill; subagents; git worktrees", + "relation": "Same: decompose the goal into the closure's ordered worklist before building." + }, + { + "concept": "Goal-anchoring", + "substrate": "M4 goal-anchoring (goal drift: to a text model a long story and long code are the same object)", + "framework": "BDI Desires = written goal + acceptance criteria in STATE.md; I2 keeps them across sessions; acceptance criteria written at SPEC, consumed at VERIFY", + "forgekit": "docs/STATE.md 'Current goal' + 'Acceptance criteria'; sdlc-pilot SPEC->VERIFY gate", + "relation": "Substrate names the drift; framework anchors it in a persisted, re-injected Desire so every session optimizes the same target." + }, + { + "concept": "Anti-over-engineering", + "substrate": "M5 anti-over-engineering (scope minimality; the residual whitespace)", + "framework": "amana / scope-boundedness (agent may not exceed asked scope); I3 (no invented structure)", + "forgekit": "CLAUDE.md effort routing 'trivial -> do it directly, no ceremony'; least-privilege defaults", + "relation": "Weakest-covered in all three; substrate marks it residual-gap, framework encodes it as a stewardship bound, kit as an effort-routing default." + }, + { + "concept": "World-model of the codebase", + "substrate": "Faculty: world-model; Prototype-I codebase world-model (AST -> persistent dependency graph)", + "framework": "the typed artifact graph (A, tau, R = R_declared \u222a R_discovered)", + "forgekit": "documentation-map.md + the repo itself + ARCHITECTURE.md", + "relation": "Same graph. Substrate builds it from AST for code; framework generalizes the node type to {code,test,doc,config,diagram} so DOCS become first-class dependents \u2014 the key generalization that turns 'impact on code' into 'impact on all artifacts'." + }, + { + "concept": "Continual learning from outcomes", + "substrate": "Faculty: learning without touching theta (non-parametric always-on + parametric LoRA/EWC)", + "framework": "Reflexion loop made cross-session (I3/I4); DECISIONS.md as precedent DB; A4 mirrors durable lessons", + "forgekit": "Reflexion rule in CLAUDE.md; STATE gotchas; agents' memory: project", + "relation": "Same 'learn without retraining' stance. Both store verbal lessons externally and re-inject; substrate adds the parametric option, framework keeps it purely non-parametric (committed files)." + }, + { + "concept": "Rehydration (session start)", + "substrate": "closed-loop write-back/read-back band in the substrate architecture", + "framework": "Algorithm A5 CONTEXT-REHYDRATE; loader L; records git baseline for the gate", + "forgekit": "session-context.sh SessionStart hook; /catchup skill (deep variant)", + "relation": "The read side of the substrate's memory loop, made deterministic (inject, don't hope the agent reads)." + }, + { + "concept": "Independent verification / judge", + "substrate": "self-correction faculty; the honest-negative-result caution (models correct poorly alone)", + "framework": "LLM-as-Judge applied: reviewer agent (fresh context, explicit criteria, adversarial); self-consistency for critical changes (majority of N)", + "forgekit": "reviewer.md agent; DoD item 7", + "relation": "Substrate cited the finding that self-correction alone is weak; framework operationalizes the fix (an EXTERNAL judge), which is the same 'trust only an external check' principle as the gate." + }, + { + "concept": "The two-layer duality (THE central new insight)", + "substrate": "implicit: the substrate wraps a probabilistic core with deterministic external structure, but v2 never states it as a law", + "framework": "DESIGN LAW: instructions (Pi3) are PROBABILISTIC (raise p); interception (Pi2) is DETERMINISTIC (guarantee a floor c->1). P(silent miss) = (1-p)\u00b7prod_j(1-c_j). Since p<1 always, neither layer alone suffices.", + "forgekit": "the split itself: CLAUDE.md/rules/skills = soft layer; hooks (docs-guard, session-context, intent-router) = hard layer", + "relation": "THIS is what the kit gives the substrate theory: the reason the substrate must be TWO layers, stated as a theorem. The user's own discipline ('never trust AI output \u2014 it is calculated probability') is exactly (1-p)>0, which forces the deterministic layer." + }, + { + "concept": "The probabilistic failure model", + "substrate": "eval honesty: perfect accuracy shows separation not a benchmark; p<1", + "framework": "P(>=1 miss) = 1 - p^n over n tasks (0.9 -> 65% at 10, 96% at 30); layered: P(silent miss)=(1-p)\u00b7prod(1-c_j)", + "forgekit": "the lattice of gates: turn-level (hook) \u2282 commit-level (pre-commit) \u2282 PR-level (CI)", + "relation": "The math that makes 'it works sometimes then forgets' a geometric certainty rather than bad luck \u2014 and quantifies why each added deterministic gate multiplies down the residual." + }, + { + "concept": "Stewardship / governance boundary", + "substrate": "STEWARDSHIP/amana wrapper (33:72) around the whole architecture", + "framework": "amana in I3/I4 as no-fabrication + verified-currency; least privilege, reversibility, logged rationale, scope-boundedness", + "forgekit": "committed-files-only (auditable), block-at-most-once (no nagging), fail-open safety (T2), DOCS_GUARD_DISABLE auditable escape hatch", + "relation": "The ethical frame the substrate draws from the lens is realized as concrete safety properties in the framework (fail-open, reversibility) and kit (auditable hooks)." + } + ] +} \ No newline at end of file diff --git a/research/formal-synthesis/crosswalk.md b/research/formal-synthesis/crosswalk.md new file mode 100644 index 0000000..12ddb3f --- /dev/null +++ b/research/formal-synthesis/crosswalk.md @@ -0,0 +1,42 @@ +# Three-Way Crosswalk + +**Cognitive Substrate theory ↔ End-to-End Reliability Framework ↔ forgekit / claude-e2e-kit** + +This map is the spine of the formal synthesis: every unified concept, shown in all three vocabularies, plus the relationship that justifies treating them as one object. + +## Notation reconciliation (the P1/P2/P3 collision) + +> Both frameworks independently use the labels P1/P2/P3. + +- **Substrate P1/P2/P3** — P1 statelessness, P2 frozen weights, P3 bounded/undifferentiated context. +- **Framework P1/P2/P3** — P1 persistent store, P2 lifecycle interception, P3 instruction channel. +- **Resolution** — In the synthesis, the substrate model-properties keep P1/P2/P3; the framework primitives are RENAMED Pi1 (persistent store), Pi2 (lifecycle interception), Pi3 (instruction channel). Every use of the primitives in the synthesis is written Pi-n to remove the collision. + +## The map + +| # | Unified concept | Substrate (S) | E2E Framework (E) | forgekit / kit (K) | Why they are one object | +| --- | --- | --- | --- | --- | --- | +| 1 | **The frozen core** | y = f_theta(x): stateless map, fixed weights, bounded context (properties P1,P2,P3) | the agent/model whose behavior instructions can only raise the PROBABILITY of (p<1) | Claude / Codex / Cursor / Gemini / Aider — the model the kit wraps, never modifies | identical object: all three treat the model as a fixed probabilistic map to be wrapped, not retrained | +| 2 | **Impact-awareness / partial-work failure** | Faculty: impact-awareness gap; the developer silently simulates 'what will this edit break'. Prototype I = Impact Oracle (reverse-dependency blast radius with confidence decay) | F1 partial work; dependents operator N(X); required change closure Delta* = least fixpoint of X \|-> X ∪ N(X); Done predicate; Algorithm A1 IMPACT-CLOSURE | /impact skill; documentation-map.md (R_declared); grep identifier sweep (R_discovered) | IDENTICAL MATHEMATICS. The Impact Oracle computes N(X) by reverse reachability on the dependency graph; Delta* is exactly the oracle's transitive blast-radius set. The oracle adds a confidence-decay weight the framework's set-theoretic N(X) leaves boolean. | +| 3 | **Memory / session-amnesia failure** | Faculty: persistent memory gap; each context window is ephemeral. Validity-anchored memory (facts carry confirmed/discredited state updated by verified outcomes) | F2 session amnesia; continuity invariant I2 (essential(K_i) ⊆ P and loader L must load it); handoff operator H; K_{i+1}(0)=L(P) | docs/STATE.md (bounded snapshot) + docs/DECISIONS.md (append-only log); /handoff writes it; SessionStart hook injects it | Same failure, same fix (external bounded-compression checkpoint). Substrate adds validity-anchoring (prune by whether a past prediction was externally confirmed); framework adds the snapshot+WAL split (STATE mutable vs DECISIONS append-only). | +| 4 | **Why assumptions happen (the root the user named)** | M2 assumption/uncertainty gate: under-specified input -> the model confabulates a convention | amnesia equation: when f ∈ essential(K) is missing from L(P), assumption ≈ argmax P(convention \| training data) — the mathematically EXPECTED result of missing context, not misbehavior. Invariant I3 (no fabrication) | CLAUDE.md No-assumptions rule; intent-router SPEC card ('state assumptions explicitly') | The framework gives the substrate's M2 gate its formal justification: assumption is argmax over the prior, so the fix is to supply context (raise what L loads) OR gate on missing context (halt), never to hope. | +| 5 | **Self-correction / verification** | M6 inline verification; Prototype-II verify step; self-correction faculty | Algorithm A6 COMPLETION-GATE (deterministic Stop-hook floor); Hoare postcondition Done(t); the verification operator in A3 (verified-unaffected requires an actual grep, not an assumption) | docs-guard.sh Stop hook (blocks finish if code changed but no doc/state artifact did); reviewer agent verdict | Same verify-gate. Substrate framed it as a mechanism; framework proves it terminates (T1) and is sound (T3) and makes it the deterministic layer of the duality. | +| 6 | **Complexity routing** | M1 complexity-aware router (transparent additive rubric); Prototype-II router | Algorithm A7 KNOWLEDGE-ROUTER (where every fact lives, keeps always-loaded context bounded); System 1/System 2 effort routing; intent DFA | intent-router.sh (UserPromptSubmit hook, keyword DFA, <10ms, zero-token); effort-routing rule in CLAUDE.md; per-agent model: fields | Two facets of one routing principle. Substrate M1 routes by TASK COMPLEXITY -> model tier (cost). Framework A7 routes by KNOWLEDGE TYPE -> storage home (context budget). Both are transparent/deterministic, both reject an opaque-LLM classifier for the same reason. | +| 7 | **Task decomposition** | M3 task/session decomposition | HTN closure -> ordered task list (A1 output is the worklist); the meta-algorithm TASK(t) | sdlc-pilot 7-phase skill; subagents; git worktrees | Same: decompose the goal into the closure's ordered worklist before building. | +| 8 | **Goal-anchoring** | M4 goal-anchoring (goal drift: to a text model a long story and long code are the same object) | BDI Desires = written goal + acceptance criteria in STATE.md; I2 keeps them across sessions; acceptance criteria written at SPEC, consumed at VERIFY | docs/STATE.md 'Current goal' + 'Acceptance criteria'; sdlc-pilot SPEC->VERIFY gate | Substrate names the drift; framework anchors it in a persisted, re-injected Desire so every session optimizes the same target. | +| 9 | **Anti-over-engineering** | M5 anti-over-engineering (scope minimality; the residual whitespace) | amana / scope-boundedness (agent may not exceed asked scope); I3 (no invented structure) | CLAUDE.md effort routing 'trivial -> do it directly, no ceremony'; least-privilege defaults | Weakest-covered in all three; substrate marks it residual-gap, framework encodes it as a stewardship bound, kit as an effort-routing default. | +| 10 | **World-model of the codebase** | Faculty: world-model; Prototype-I codebase world-model (AST -> persistent dependency graph) | the typed artifact graph (A, tau, R = R_declared ∪ R_discovered) | documentation-map.md + the repo itself + ARCHITECTURE.md | Same graph. Substrate builds it from AST for code; framework generalizes the node type to {code,test,doc,config,diagram} so DOCS become first-class dependents — the key generalization that turns 'impact on code' into 'impact on all artifacts'. | +| 11 | **Continual learning from outcomes** | Faculty: learning without touching theta (non-parametric always-on + parametric LoRA/EWC) | Reflexion loop made cross-session (I3/I4); DECISIONS.md as precedent DB; A4 mirrors durable lessons | Reflexion rule in CLAUDE.md; STATE gotchas; agents' memory: project | Same 'learn without retraining' stance. Both store verbal lessons externally and re-inject; substrate adds the parametric option, framework keeps it purely non-parametric (committed files). | +| 12 | **Rehydration (session start)** | closed-loop write-back/read-back band in the substrate architecture | Algorithm A5 CONTEXT-REHYDRATE; loader L; records git baseline for the gate | session-context.sh SessionStart hook; /catchup skill (deep variant) | The read side of the substrate's memory loop, made deterministic (inject, don't hope the agent reads). | +| 13 | **Independent verification / judge** | self-correction faculty; the honest-negative-result caution (models correct poorly alone) | LLM-as-Judge applied: reviewer agent (fresh context, explicit criteria, adversarial); self-consistency for critical changes (majority of N) | reviewer.md agent; DoD item 7 | Substrate cited the finding that self-correction alone is weak; framework operationalizes the fix (an EXTERNAL judge), which is the same 'trust only an external check' principle as the gate. | +| 14 | **The two-layer duality (THE central new insight)** | implicit: the substrate wraps a probabilistic core with deterministic external structure, but v2 never states it as a law | DESIGN LAW: instructions (Pi3) are PROBABILISTIC (raise p); interception (Pi2) is DETERMINISTIC (guarantee a floor c->1). P(silent miss) = (1-p)·prod_j(1-c_j). Since p<1 always, neither layer alone suffices. | the split itself: CLAUDE.md/rules/skills = soft layer; hooks (docs-guard, session-context, intent-router) = hard layer | THIS is what the kit gives the substrate theory: the reason the substrate must be TWO layers, stated as a theorem. The user's own discipline ('never trust AI output — it is calculated probability') is exactly (1-p)>0, which forces the deterministic layer. | +| 15 | **The probabilistic failure model** | eval honesty: perfect accuracy shows separation not a benchmark; p<1 | P(>=1 miss) = 1 - p^n over n tasks (0.9 -> 65% at 10, 96% at 30); layered: P(silent miss)=(1-p)·prod(1-c_j) | the lattice of gates: turn-level (hook) ⊂ commit-level (pre-commit) ⊂ PR-level (CI) | The math that makes 'it works sometimes then forgets' a geometric certainty rather than bad luck — and quantifies why each added deterministic gate multiplies down the residual. | +| 16 | **Stewardship / governance boundary** | STEWARDSHIP/amana wrapper (33:72) around the whole architecture | amana in I3/I4 as no-fabrication + verified-currency; least privilege, reversibility, logged rationale, scope-boundedness | committed-files-only (auditable), block-at-most-once (no nagging), fail-open safety (T2), DOCS_GUARD_DISABLE auditable escape hatch | The ethical frame the substrate draws from the lens is realized as concrete safety properties in the framework (fail-open, reversibility) and kit (auditable hooks). | + +## The three anchor identities + +Three rows are not analogies but *the same mathematics under two names*: + +1. **Impact Oracle blast-radius ≡ change-closure fixpoint Δ\*.** Reverse reachability on the dependency graph is the least fixpoint of `X ↦ X ∪ N(X)`. The oracle computes `N(X)` with a confidence-decay weight; the framework's `N(X)` is its boolean core. +2. **M2 assumption gate ≡ the amnesia equation.** `assumption ≈ argmax P(convention | training)` is *why* an under-specified prompt is answered with a confabulated convention — so the gate either supplies the missing context or halts; it never hopes. +3. **The substrate's two layers ≡ the design law.** Instructions raise `p<1`; interception guarantees a floor `c→1`. `P(silent miss) = (1−p)·∏(1−cⱼ)`. This is the theorem that says the substrate *must* be two layers — and it is the formal statement of the governing discipline, *never trust AI output*. diff --git a/research/formal-synthesis/figures/schematic_duality.png b/research/formal-synthesis/figures/schematic_duality.png new file mode 100644 index 0000000..f1450cc Binary files /dev/null and b/research/formal-synthesis/figures/schematic_duality.png differ diff --git a/research/formal-synthesis/figures/schematic_taskloop.png b/research/formal-synthesis/figures/schematic_taskloop.png new file mode 100644 index 0000000..d8e7db4 Binary files /dev/null and b/research/formal-synthesis/figures/schematic_taskloop.png differ diff --git a/research/formal-synthesis/graded_reference_set.json b/research/formal-synthesis/graded_reference_set.json new file mode 100644 index 0000000..cbc8ec1 --- /dev/null +++ b/research/formal-synthesis/graded_reference_set.json @@ -0,0 +1,167 @@ +{ + "title": "Graded reference set \u2014 new sources for the formal synthesis", + "method": "Independent verification: modern arXiv sources by direct metadata API fetch (title/authors/date pulled live, not from memory); classical works (HTN, BDI) by live web_search against primary hosts; Kahneman/Ebbinghaus/OODA/PDCA graded 'traceable' on established secondary knowledge per the rubric. Verified by the Citations sub-agent track.", + "rubric": { + "confirmed": "record retrieved from a primary source; title and attribution match the claim", + "traceable": "the work clearly exists and is correctly attributed, but rests on established secondary/historical knowledge rather than a single retrievable record", + "unverifiable": "could not confirm existence or attribution" + }, + "tally": { + "confirmed": 9, + "traceable": 6, + "unverifiable": 0 + }, + "future_dated_note": "Two source IDs are dated 2026. Both resolve to real arXiv preprints matching their claims (confirmed by direct fetch). arXiv:2604.26275 (Agentic SDLC) is a single-author, non-peer-reviewed preprint. arXiv:2601.05111 (Agent-as-a-Judge, Jan 2026 survey) is a DIFFERENT paper from the founding work that coined the term (Zhuge et al. 2024, arXiv:2410.10934, added here on the verifier's recommendation).", + "sources": [ + { + "key": "coala2023", + "title": "Cognitive Architectures for Language Agents", + "authors": "Theodore R. Sumers, Shunyu Yao, Karthik Narasimhan et al.", + "year": 2023, + "id": "2309.02427", + "url": "http://arxiv.org/abs/2309.02427v3", + "grade": "confirmed", + "note": "Retrieved via arXiv metadata API; title/authors match claim exactly. Unifies memory, planning/reasoning, action, and learning modules into a single CoALA framework for language agents, giving the cognitive-substrate work's memory/imagination/self-correction taxonomy a directly citable architectural analogue." + }, + { + "key": "yao2022react", + "title": "ReAct: Synergizing Reasoning and Acting in Language Models", + "authors": "Shunyu Yao, Jeffrey Zhao, Dian Yu et al.", + "year": 2022, + "id": "2210.03629", + "url": "http://arxiv.org/abs/2210.03629v3", + "grade": "confirmed", + "note": "Retrieved via arXiv metadata API; title/authors match claim exactly. Interleaves reasoning traces with actions in a single LLM prompt loop, the foundational pattern the cognitive-substrate and reliability-framework agent loops build on." + }, + { + "key": "gu2024llmjudge", + "title": "A Survey on LLM-as-a-Judge", + "authors": "Jiawei Gu, Xuhui Jiang, Zhichao Shi et al.", + "year": 2024, + "id": "2411.15594", + "url": "http://arxiv.org/abs/2411.15594v6", + "grade": "confirmed", + "note": "Retrieved via arXiv metadata API; title/authors match claim exactly. Surveys the emerging practice of using LLMs themselves as evaluators/judges, directly relevant to any impact-awareness or self-correction mechanism that relies on an LLM-based verifier." + }, + { + "key": "ridnik2024alphacodium", + "title": "Code Generation with AlphaCodium: From Prompt Engineering to Flow Engineering", + "authors": "Tal Ridnik, Dedy Kredo, Itamar Friedman", + "year": 2024, + "id": "2401.08500", + "url": "http://arxiv.org/abs/2401.08500v1", + "grade": "confirmed", + "note": "Retrieved via arXiv metadata API; title/authors match claim exactly. Replaces single-shot prompting with an iterative 'flow engineering' test-generate-fix loop for code generation, an applied precedent for the reliability framework's change-closure fixpoint over code edits." + }, + { + "key": "yang2024sweagent", + "title": "SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering", + "authors": "John Yang, Carlos E. Jimenez, Alexander Wettig et al.", + "year": 2024, + "id": "2405.15793", + "url": "http://arxiv.org/abs/2405.15793v3", + "grade": "confirmed", + "note": "Retrieved via arXiv metadata API; title/authors match claim exactly. Introduces an agent-computer interface (a constrained action/observation space) purpose-built for LM agents doing software engineering, directly relevant to forgekit's agent-tool interaction design." + }, + { + "key": "wang2023voyager", + "title": "Voyager: An Open-Ended Embodied Agent with Large Language Models", + "authors": "Guanzhi Wang, Yuqi Xie, Yunfan Jiang et al.", + "year": 2023, + "id": "2305.16291", + "url": "http://arxiv.org/abs/2305.16291v2", + "grade": "confirmed", + "note": "Retrieved via arXiv metadata API; title/authors match claim exactly. Demonstrates a lifelong-learning embodied agent that maintains and grows a skill library over time, the clearest existing analogue to persistent, growing external memory across sessions." + }, + { + "key": "erol1994htn", + "title": "HTN Planning: Complexity and Expressivity", + "authors": "Erol, Hendler, Nau", + "year": 1994, + "id": null, + "url": "https://aaai.org/papers/01123-htn-planning-complexity-and-expressivity/", + "grade": "traceable", + "note": "Classical AI-planning paper, no arXiv/OpenAlex record. Verified via live web_search (this turn) against AAAI's own paper page, Semantic Scholar, and a downstream paper's reference list (arXiv:1403.7426, 'An Overview of Hierarchical Task Network Planning'), all of which corroborate: title 'HTN Planning: Complexity and Expressivity', authors Erol/Hendler/Nau, AAAI-94 Vol.2 pp.1123-1128. A distinct but related journal version, 'Complexity results for HTN planning' (Annals of Mathematics and Artificial Intelligence, vol. 18, no. 1, pp. 69-93, 1996), was also corroborated in the same search (arXiv:1403.7426 reference list) but its DOI was not independently confirmed in this pass -- do not assert a DOI for either version without a direct publisher lookup." + }, + { + "key": "rao1995bdi", + "title": "BDI Agents: From Theory to Practice", + "authors": "Rao, Georgeff", + "year": 1995, + "id": null, + "url": "https://cdn.aaai.org/ICMAS/1995/ICMAS95-042.pdf", + "grade": "traceable", + "note": "Classical agent-architecture paper, no DOI/arXiv record. Verified via live web_search (this turn) against the AAAI-hosted PDF (cdn.aaai.org/ICMAS/1995/ICMAS95-042.pdf), gabormelli.com/RKB, and multiple independent downstream reference lists (e.g. arXiv:1310.2431, arXiv:2506.10192), all corroborating: title 'BDI Agents: From Theory to Practice', authors Rao & Georgeff, ICMAS-95, pp. 312-319." + }, + { + "key": "kahneman2011", + "title": "Thinking, Fast and Slow", + "authors": "Kahneman, D.", + "year": 2011, + "id": null, + "url": null, + "grade": "traceable", + "note": "Classical trade/academic book, not indexed on arXiv or as a journal article with a DOI in the usual sense; existence and content (System 1 / System 2 dual-process framing) are well-established general knowledge, not independently re-verified against a bibliographic API in this pass." + }, + { + "key": "ebbinghaus1885", + "title": "\u00dcber das Ged\u00e4chtnis: Untersuchungen zur experimentellen Psychologie (Memory: A Contribution to Experimental Psychology)", + "authors": "Ebbinghaus, H.", + "year": 1885, + "id": null, + "url": null, + "grade": "traceable", + "note": "Foundational 1885 monograph establishing the forgetting curve; predates modern indexing entirely, existence is well-established historical/secondary knowledge, not independently re-verified against a bibliographic API in this pass." + }, + { + "key": "boyd_ooda", + "title": "OODA Loop (Observe-Orient-Decide-Act)", + "authors": "Boyd, J.R.", + "year": null, + "id": null, + "url": null, + "grade": "traceable", + "note": "No formal published paper exists \u2014 Boyd never formally published the OODA loop in a journal; it survives via briefing-slide decks and secondary military-strategy literature. Rubric correctly flags this as having 'no formal paper.' Cite as a named concept/doctrine, not a specific retrievable publication." + }, + { + "key": "deming_pdca", + "title": "PDCA / Plan-Do-Check-Act cycle (the 'Shewhart Cycle', popularized by Deming)", + "authors": "Shewhart, W.A. (originator); Deming, W.E. (popularizer)", + "year": null, + "id": null, + "url": null, + "grade": "traceable", + "note": "Management/quality-control doctrine spanning multiple books across decades, not a single citable paper. Existence and attribution (Shewhart origin, Deming popularization) are well-established secondary knowledge, not independently re-verified against a bibliographic API in this pass." + }, + { + "key": "bhati2026agenticsdlc", + "title": "Agentic AI in the Software Development Lifecycle: Architecture, Empirical Evidence, and the Reshaping of Software Engineering", + "authors": "Happy Bhati", + "year": 2026, + "id": "2604.26275", + "url": "http://arxiv.org/abs/2604.26275v1", + "grade": "confirmed", + "note": "Retrieved via arXiv metadata API; the ID resolves to a REAL paper dated 2026-04-29 (April 2026, which is in the past relative to today, 2026-07-11 \u2014 so 'future-dated' only relative to the cited work's original claim date, not to now). Single author (Happy Bhati), self-archived cs.SE preprint, no journal/DOI yet \u2014 proposes a six-layer reference architecture and explicitly names an 'Agentic SDLC (A-SDLC)', matching the claimed topic closely. Confirmed to exist and match; flag for the synthesis authors that this is an unreviewed single-author preprint, not a peer-reviewed or highly-cited source, and should be cited with that caveat." + }, + { + "key": "you2026agentasjudge", + "title": "Agent-as-a-Judge", + "authors": "Runyang You, Hongru Cai, Caiqi Zhang et al.", + "year": 2026, + "id": "2601.05111", + "url": "http://arxiv.org/abs/2601.05111v1", + "grade": "confirmed", + "note": "Retrieved via arXiv metadata API; ID resolves to a REAL paper dated 2026-01-08. Title is exactly 'Agent-as-a-Judge' and abstract frames it as 'the first comprehensive survey' of the Agent-as-a-Judge paradigm, matching the claimed 'Agent-as-a-Judge survey' framing. DISAMBIGUATION verified via live web_search (this turn) against arxiv.org/abs/2410.10934 directly: this 2601.05111 survey is NOT the original Agent-as-a-Judge paper. The founding paper is Zhuge, Zhao, Ashley, Wang, Khizbullin, Xiong, Liu, Chang, Krishnamoorthi, Tian, Shi, Chandra, Schmidhuber (2024), 'Agent-as-a-Judge: Evaluate Agents with Agents', arXiv:2410.10934, submitted 14 Oct 2024 -- a distinct, earlier, independently well-known paper that coined the term. If the synthesis intends to cite the founding paper rather than a survey of it, cite 2410.10934 instead or in addition." + }, + { + "key": "zhuge2024agentjudge", + "title": "Agent-as-a-Judge: Evaluate Agents with Agents", + "authors": "Zhuge, Zhao, Ashley, Wang, Khizbullin, Xiong, Liu, Chang, Krishnamoorthi, Tian, Shi, Chandra, Schmidhuber", + "year": 2024, + "id": "2410.10934", + "url": "https://arxiv.org/abs/2410.10934", + "grade": "confirmed", + "note": "The founding Agent-as-a-Judge paper that coined the term; added on the verification track's explicit recommendation to disambiguate from the 2026 survey (2601.05111)." + } + ] +} \ No newline at end of file diff --git a/research/formal-synthesis/graded_reference_set.md b/research/formal-synthesis/graded_reference_set.md new file mode 100644 index 0000000..94752d6 --- /dev/null +++ b/research/formal-synthesis/graded_reference_set.md @@ -0,0 +1,29 @@ +# Graded Reference Set — New Sources for the Formal Synthesis + +Independent verification: modern arXiv sources by direct metadata API fetch (title/authors/date pulled live, not from memory); classical works (HTN, BDI) by live web_search against primary hosts; Kahneman/Ebbinghaus/OODA/PDCA graded 'traceable' on established secondary knowledge per the rubric. Verified by the Citations sub-agent track. + +**Rubric.** `confirmed` = primary record retrieved, attribution matches · `traceable` = clearly exists and correctly attributed, on established secondary knowledge · `unverifiable` = could not confirm. + +**Tally: 9 confirmed · 6 traceable · 0 unverifiable** (of 15 new sources). + +| Source | ID | Grade | Note | +|---|---|---|---| +| **Cognitive Architectures for Language Agents** (Theodore R. Sumers, Shunyu Yao, Karthik Narasimhan et al., 2023) | `2309.02427` | confirmed | Retrieved via arXiv metadata API; title/authors match claim exactly. Unifies memory, planning/reasoning, action, and learning modules into a single CoALA framework for language agents, giving the c… | +| **ReAct: Synergizing Reasoning and Acting in Language Models** (Shunyu Yao, Jeffrey Zhao, Dian Yu et al., 2022) | `2210.03629` | confirmed | Retrieved via arXiv metadata API; title/authors match claim exactly. Interleaves reasoning traces with actions in a single LLM prompt loop, the foundational pattern the cognitive-substrate and reli… | +| **A Survey on LLM-as-a-Judge** (Jiawei Gu, Xuhui Jiang, Zhichao Shi et al., 2024) | `2411.15594` | confirmed | Retrieved via arXiv metadata API; title/authors match claim exactly. Surveys the emerging practice of using LLMs themselves as evaluators/judges, directly relevant to any impact-awareness or self-c… | +| **Code Generation with AlphaCodium: From Prompt Engineering to Flow Engineering** (Tal Ridnik, Dedy Kredo, Itamar Friedman, 2024) | `2401.08500` | confirmed | Retrieved via arXiv metadata API; title/authors match claim exactly. Replaces single-shot prompting with an iterative 'flow engineering' test-generate-fix loop for code generation, an applied prece… | +| **SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering** (John Yang, Carlos E. Jimenez, Alexander Wettig et al., 2024) | `2405.15793` | confirmed | Retrieved via arXiv metadata API; title/authors match claim exactly. Introduces an agent-computer interface (a constrained action/observation space) purpose-built for LM agents doing software engin… | +| **Voyager: An Open-Ended Embodied Agent with Large Language Models** (Guanzhi Wang, Yuqi Xie, Yunfan Jiang et al., 2023) | `2305.16291` | confirmed | Retrieved via arXiv metadata API; title/authors match claim exactly. Demonstrates a lifelong-learning embodied agent that maintains and grows a skill library over time, the clearest existing analog… | +| **HTN Planning: Complexity and Expressivity** (Erol, Hendler, Nau, 1994) | `—` | traceable | Classical AI-planning paper, no arXiv/OpenAlex record. Verified via live web_search (this turn) against AAAI's own paper page, Semantic Scholar, and a downstream paper's reference list (arXiv:1403.… | +| **BDI Agents: From Theory to Practice** (Rao, Georgeff, 1995) | `—` | traceable | Classical agent-architecture paper, no DOI/arXiv record. Verified via live web_search (this turn) against the AAAI-hosted PDF (cdn.aaai.org/ICMAS/1995/ICMAS95-042.pdf), gabormelli.com/RKB, and mult… | +| **Thinking, Fast and Slow** (Kahneman, D., 2011) | `—` | traceable | Classical trade/academic book, not indexed on arXiv or as a journal article with a DOI in the usual sense; existence and content (System 1 / System 2 dual-process framing) are well-established gene… | +| **Über das Gedächtnis: Untersuchungen zur experimentellen Psychologie (Memory: A Contribution to Experimental Psychology)** (Ebbinghaus, H., 1885) | `—` | traceable | Foundational 1885 monograph establishing the forgetting curve; predates modern indexing entirely, existence is well-established historical/secondary knowledge, not independently re-verified against… | +| **OODA Loop (Observe-Orient-Decide-Act)** (Boyd, J.R., None) | `—` | traceable | No formal published paper exists — Boyd never formally published the OODA loop in a journal; it survives via briefing-slide decks and secondary military-strategy literature. Rubric correctly flags … | +| **PDCA / Plan-Do-Check-Act cycle (the 'Shewhart Cycle', popularized by Deming)** (Shewhart, W.A. (originator); Deming, W.E. (popularizer), None) | `—` | traceable | Management/quality-control doctrine spanning multiple books across decades, not a single citable paper. Existence and attribution (Shewhart origin, Deming popularization) are well-established secon… | +| **Agentic AI in the Software Development Lifecycle: Architecture, Empirical Evidence, and the Reshaping of Software Engineering** (Happy Bhati, 2026) | `2604.26275` | confirmed | Retrieved via arXiv metadata API; the ID resolves to a REAL paper dated 2026-04-29 (April 2026, which is in the past relative to today, 2026-07-11 — so 'future-dated' only relative to the cited wor… | +| **Agent-as-a-Judge** (Runyang You, Hongru Cai, Caiqi Zhang et al., 2026) | `2601.05111` | confirmed | Retrieved via arXiv metadata API; ID resolves to a REAL paper dated 2026-01-08. Title is exactly 'Agent-as-a-Judge' and abstract frames it as 'the first comprehensive survey' of the Agent-as-a-Judg… | +| **Agent-as-a-Judge: Evaluate Agents with Agents** (Zhuge, Zhao, Ashley, Wang, Khizbullin, Xiong, Liu, Chang, Krishnamoorthi, Tian, Shi, Chandra, Schmidhuber, 2024) | `2410.10934` | confirmed | The founding Agent-as-a-Judge paper that coined the term; added on the verification track's explicit recommendation to disambiguate from the 2026 survey (2601.05111). | + +## The two future-dated identifiers + +Two source IDs are dated 2026. Both resolve to real arXiv preprints matching their claims (confirmed by direct fetch). arXiv:2604.26275 (Agentic SDLC) is a single-author, non-peer-reviewed preprint. arXiv:2601.05111 (Agent-as-a-Judge, Jan 2026 survey) is a DIFFERENT paper from the founding work that coined the term (Zhuge et al. 2024, arXiv:2410.10934, added here on the verifier's recommendation). diff --git a/research/formal-synthesis/merged_references.json b/research/formal-synthesis/merged_references.json new file mode 100644 index 0000000..a17df3e --- /dev/null +++ b/research/formal-synthesis/merged_references.json @@ -0,0 +1,519 @@ +[ + { + "key": "weston2014", + "title": "Memory Networks", + "authors": "Weston, Chopra, Bordes", + "year": 2014, + "venue": "arXiv:1410.3916", + "arxiv_or_doi": "1410.3916", + "url": "https://arxiv.org/abs/1410.3916", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Proposes an explicit, addressable long-term memory component read/written by a neural controller, separate from model parameters." + }, + { + "key": "sukhbaatar2015", + "title": "End-To-End Memory Networks", + "authors": "Sukhbaatar, Szlam, Weston, Fergus", + "year": 2015, + "venue": "arXiv:1503.08895", + "arxiv_or_doi": "1503.08895", + "url": "https://arxiv.org/abs/1503.08895", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Makes memory-network read/write fully differentiable and trainable end-to-end with weaker supervision than the original Memory Networks." + }, + { + "key": "graves2014ntm", + "title": "Neural Turing Machines", + "authors": "Graves, Wayne, Danihelka", + "year": 2014, + "venue": "arXiv:1410.5401", + "arxiv_or_doi": "1410.5401", + "url": "https://arxiv.org/abs/1410.5401", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Couples a neural controller to an external memory matrix via differentiable attention, enabling learned algorithms like copy and sort." + }, + { + "key": "graves2016dnc", + "title": "Hybrid computing using a neural network with dynamic external memory", + "authors": "Graves et al.", + "year": 2016, + "venue": "Nature", + "arxiv_or_doi": "10.1038/nature20101", + "url": "https://doi.org/10.1038/nature20101", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. The Differentiable Neural Computer adds dynamic memory allocation and temporal link tracking, letting a network solve graph traversal and reasoning tasks that require variable-sized structured memory." + }, + { + "key": "lewis2020rag", + "title": "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks", + "authors": "Lewis et al.", + "year": 2020, + "venue": "arXiv:2005.11401 / NeurIPS", + "arxiv_or_doi": "2005.11401", + "url": "https://arxiv.org/abs/2005.11401", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Combines a parametric seq2seq model with a non-parametric retriever over an external corpus so generation is grounded in retrieved documents rather than frozen weights alone." + }, + { + "key": "packer2023memgpt", + "title": "MemGPT: Towards LLMs as Operating Systems", + "authors": "Packer et al.", + "year": 2023, + "venue": "arXiv:2310.08560", + "arxiv_or_doi": "2310.08560", + "url": "https://arxiv.org/abs/2310.08560", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Treats the LLM context window like virtual memory, using an OS-style paging scheme (self-directed function calls) to move information between a bounded context and external storage to give the illusion of unbounded memory." + }, + { + "key": "park2023genagents", + "title": "Generative Agents: Interactive Simulacra of Human Behavior", + "authors": "Park et al.", + "year": 2023, + "venue": "arXiv:2304.03442", + "arxiv_or_doi": "2304.03442", + "url": "https://arxiv.org/abs/2304.03442", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Introduces a memory stream of observations plus a reflection mechanism that periodically synthesizes higher-level memories, retrieved and used to condition believable agent behavior." + }, + { + "key": "mcclelland1995cls", + "title": "Why there are complementary learning systems in the hippocampus and neocortex", + "authors": "McClelland, McNaughton, O'Reilly", + "year": 1995, + "venue": "Psychological Review", + "arxiv_or_doi": null, + "url": "search: OpenAlex (title match)", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Argues the brain needs two learning systems \u2014 a fast hippocampal one for episodic recall and a slow neocortical one for structured, interleaved consolidation \u2014 to avoid catastrophic interference." + }, + { + "key": "kumaran2016cls", + "title": "What Learning Systems do Intelligent Agents Need? Complementary Learning Systems Theory Updated", + "authors": "Kumaran, Hassabis, McClelland", + "year": 2016, + "venue": "Trends in Cognitive Sciences, 10.1016/j.tics.2016.05.004", + "arxiv_or_doi": "10.1016/j.tics.2016.05.004", + "url": "https://doi.org/10.1016/j.tics.2016.05.004", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Updates complementary learning systems theory in light of deep RL and episodic-memory findings, motivating fast/slow-learning-system architectures as a computational analogue of hippocampal-neocortical interaction." + }, + { + "key": "kirkpatrick2017ewc", + "title": "Overcoming catastrophic forgetting in neural networks", + "authors": "Kirkpatrick et al.", + "year": 2017, + "venue": "PNAS / arXiv:1612.00796", + "arxiv_or_doi": "1612.00796", + "url": "https://arxiv.org/abs/1612.00796", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Elastic Weight Consolidation penalizes changes to parameters important for earlier tasks (via a Fisher-information-weighted quadratic penalty) to mitigate catastrophic forgetting during sequential training." + }, + { + "key": "sun2020ttt", + "title": "Test-Time Training with Self-Supervision for Generalization under Distribution Shifts", + "authors": "Sun et al.", + "year": 2020, + "venue": "arXiv:1909.13231 / ICML 2020", + "arxiv_or_doi": "1909.13231", + "url": "https://arxiv.org/abs/1909.13231", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Updates model parameters at test time via a self-supervised auxiliary task on each new input, adapting to distribution shift without labeled data." + }, + { + "key": "ba2016fastweights", + "title": "Using Fast Weights to Attend to the Recent Past", + "authors": "Ba, Hinton, Mnih, Leibo, Ionescu", + "year": 2016, + "venue": "arXiv:1610.06258", + "arxiv_or_doi": "1610.06258", + "url": "https://arxiv.org/abs/1610.06258", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Introduces a fast-changing weight matrix, updated by a Hebbian-like rule from recent activity, that lets a network attend to its own recent history at a timescale between slow weights and short-term activity." + }, + { + "key": "hu2021lora", + "title": "LoRA: Low-Rank Adaptation of Large Language Models", + "authors": "Hu et al.", + "year": 2021, + "venue": "arXiv:2106.09685", + "arxiv_or_doi": "2106.09685", + "url": "https://arxiv.org/abs/2106.09685", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Freezes pretrained weights and injects trainable low-rank update matrices per layer, making targeted, cheap fine-tuning/adaptation of large models feasible without touching the full parameter set." + }, + { + "key": "vonoswald2022icl", + "title": "Transformers Learn In-Context by Gradient Descent", + "authors": "von Oswald et al.", + "year": 2022, + "venue": "arXiv:2212.07677", + "arxiv_or_doi": "2212.07677", + "url": "https://arxiv.org/abs/2212.07677", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Shows constructively that a transformer's forward pass over a prompt can implement steps of gradient descent on an implicit in-context loss, giving a mechanistic account of in-context learning." + }, + { + "key": "dai2022icl", + "title": "Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizers", + "authors": "Dai et al.", + "year": 2022, + "venue": "arXiv:2212.10559", + "arxiv_or_doi": "2212.10559", + "url": "https://arxiv.org/abs/2212.10559", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Draws a formal duality between attention and gradient-descent-based finetuning, framing in-context learning as an implicit, weight-unchanging optimization process." + }, + { + "key": "shinn2023reflexion", + "title": "Reflexion: Language Agents with Verbal Reinforcement Learning", + "authors": "Shinn et al.", + "year": 2023, + "venue": "arXiv:2303.11366", + "arxiv_or_doi": "2303.11366", + "url": "https://arxiv.org/abs/2303.11366", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Has an agent verbally reflect on task feedback/failures and stores that reflection in an episodic memory buffer used to condition subsequent attempts, substituting for gradient-based RL updates." + }, + { + "key": "madaan2023selfrefine", + "title": "Self-Refine: Iterative Refinement with Self-Feedback", + "authors": "Madaan et al.", + "year": 2023, + "venue": "arXiv:2303.17651", + "arxiv_or_doi": "2303.17651", + "url": "https://arxiv.org/abs/2303.17651", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Uses the same frozen LLM to generate output, critique it, and refine it iteratively in a feedback loop, with no parameter updates or external training signal." + }, + { + "key": "wang2022selfconsistency", + "title": "Self-Consistency Improves Chain of Thought Reasoning in Language Models", + "authors": "Wang et al.", + "year": 2022, + "venue": "arXiv:2203.11171", + "arxiv_or_doi": "2203.11171", + "url": "https://arxiv.org/abs/2203.11171", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Samples multiple diverse reasoning chains and marginalizes over them by majority vote on the final answer, improving reasoning accuracy without any self-correction step per se." + }, + { + "key": "cobbe2021verifiers", + "title": "Training Verifiers to Solve Math Word Problems", + "authors": "Cobbe et al.", + "year": 2021, + "venue": "arXiv:2110.14168", + "arxiv_or_doi": "2110.14168", + "url": "https://arxiv.org/abs/2110.14168", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Trains a separate verifier model to score candidate solutions and select among generator samples, offloading correctness-checking to a distinct learned model rather than the generator itself." + }, + { + "key": "lightman2023verify", + "title": "Let's Verify Step by Step", + "authors": "Lightman et al.", + "year": 2023, + "venue": "arXiv:2305.20050", + "arxiv_or_doi": "2305.20050", + "url": "https://arxiv.org/abs/2305.20050", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Shows a process-level reward model, trained on human step-by-step correctness labels, outperforms outcome-level supervision for catching reasoning errors." + }, + { + "key": "huang2023cannot", + "title": "Large Language Models Cannot Self-Correct Reasoning Yet", + "authors": "Huang et al.", + "year": 2023, + "venue": "arXiv:2310.01798", + "arxiv_or_doi": "2310.01798", + "url": "https://arxiv.org/abs/2310.01798", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Finds that without external, ground-truth feedback, LLMs prompted to self-critique and revise their own reasoning frequently make correct answers worse, undercutting claims of intrinsic self-correction." + }, + { + "key": "ha2018worldmodels", + "title": "World Models", + "authors": "Ha, Schmidhuber", + "year": 2018, + "venue": "arXiv:1803.10122", + "arxiv_or_doi": "1803.10122", + "url": "https://arxiv.org/abs/1803.10122", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Trains a compressed generative model of an environment (VAE + RNN) and evolves a small controller entirely inside that learned latent 'dream' simulation before transferring to the real environment." + }, + { + "key": "schrittwieser2020muzero", + "title": "Mastering Atari, Go, Chess and Shogi by Planning with a Learned Model", + "authors": "Schrittwieser et al.", + "year": 2020, + "venue": "arXiv:1911.08265 / Nature", + "arxiv_or_doi": "1911.08265", + "url": "https://arxiv.org/abs/1911.08265", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. MuZero learns a model of only the quantities relevant to planning (reward, value, policy) without reconstructing observations, and plans with MCTS purely in that learned latent model." + }, + { + "key": "hafner2023dreamerv3", + "title": "Mastering Diverse Domains through World Models", + "authors": "Hafner et al.", + "year": 2023, + "venue": "arXiv:2301.04104", + "arxiv_or_doi": "2301.04104", + "url": "https://arxiv.org/abs/2301.04104", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. DreamerV3 learns a world model from experience and trains a policy purely from imagined rollouts inside it, achieving strong performance across many domains with one fixed set of hyperparameters." + }, + { + "key": "hafner2019dreamer", + "title": "Dream to Control: Learning Behaviors by Latent Imagination", + "authors": "Hafner et al.", + "year": 2019, + "venue": "arXiv:1912.01603", + "arxiv_or_doi": "1912.01603", + "url": "https://arxiv.org/abs/1912.01603", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Backpropagates value gradients directly through imagined multi-step latent trajectories of a learned world model to learn behaviors efficiently, without interacting with the real environment." + }, + { + "key": "friston2010freeenergy", + "title": "The free-energy principle: a unified brain theory?", + "authors": "Friston", + "year": 2010, + "venue": "Nature Reviews Neuroscience", + "arxiv_or_doi": "10.1038/nrn2787", + "url": "https://doi.org/10.1038/nrn2787", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Proposes that brains (and action) minimize variational free energy, unifying perception, learning, and action under a single generative-model / predictive-coding framework \u2014 active inference." + }, + { + "key": "allamanis2018graphs", + "title": "Learning to Represent Programs with Graphs", + "authors": "Allamanis, Brockschmidt, Khademi", + "year": 2018, + "venue": "arXiv:1711.00740 / ICLR 2018", + "arxiv_or_doi": "1711.00740", + "url": "https://arxiv.org/abs/1711.00740", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Represents source code as a graph capturing syntax, control flow, and data flow, and applies gated graph neural networks to tasks like variable-misuse detection, giving a structural rather than purely textual code representation." + }, + { + "key": "yamaguchi2014cpg", + "title": "Modeling and Discovering Vulnerabilities with Code Property Graphs", + "authors": "Yamaguchi, Golde, Arp, Rieck", + "year": 2014, + "venue": "IEEE S&P 2014", + "arxiv_or_doi": "10.1109/sp.2014.44", + "url": "https://doi.org/10.1109/sp.2014.44", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Introduces the code property graph, merging AST, control-flow graph, and program-dependence graph into one joint representation, queryable to discover vulnerability patterns across a codebase." + }, + { + "key": "alon2019code2vec", + "title": "code2vec: Learning Distributed Representations of Code", + "authors": "Alon, Zilberstein, Levy, Yahav", + "year": 2019, + "venue": "POPL 2019 / PACMPL", + "arxiv_or_doi": "10.1145/3290353", + "url": "https://doi.org/10.1145/3290353", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Represents a code snippet as a bag of AST paths and learns a distributed embedding that predicts semantic properties such as method names, giving a learned structural fingerprint of code." + }, + { + "key": "horwitz1990dependence", + "title": "Interprocedural Slicing Using Dependence Graphs", + "authors": "Horwitz, Reps, Binkley", + "year": 1990, + "venue": "ACM TOPLAS", + "arxiv_or_doi": "10.1145/77606.77608", + "url": "https://doi.org/10.1145/77606.77608", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Extends program dependence graphs across procedure boundaries to compute interprocedural slices, the structural basis for determining what code is affected by / affects a given statement." + }, + { + "key": "tip1994survey", + "title": "A Survey of Program Slicing Techniques", + "authors": "Tip", + "year": 1994, + "venue": "Journal of Programming Languages", + "arxiv_or_doi": null, + "url": "search: OpenAlex", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Surveys the family of static and dynamic program-slicing techniques used to identify the subset of a program that can influence (or is influenced by) a given point \u2014 a core building block of change-impact analysis." + }, + { + "key": "ferrante1987pdg", + "title": "The Program Dependence Graph and Its Use in Optimization", + "authors": "Ferrante, Ottenstein, Warren", + "year": 1987, + "venue": "ACM TOPLAS", + "arxiv_or_doi": "10.1145/24039.24041", + "url": "https://doi.org/10.1145/24039.24041", + "grade": "confirmed", + "note": "existing entry, previously verified; carried through unchanged. Introduces the program dependence graph combining control and data dependence in one structure, the ancestor representation behind most modern static change-impact and slicing tools." + }, + { + "key": "coala2023", + "title": "Cognitive Architectures for Language Agents", + "authors": "Theodore R. Sumers, Shunyu Yao, Karthik Narasimhan et al.", + "year": 2023, + "venue": "arXiv:2309.02427", + "arxiv_or_doi": "2309.02427", + "url": "http://arxiv.org/abs/2309.02427v3", + "grade": "confirmed", + "note": "Retrieved via arXiv metadata API; title/authors match claim exactly. Unifies memory, planning/reasoning, action, and learning modules into a single CoALA framework for language agents, giving the cognitive-substrate work's memory/imagination/self-correction taxonomy a directly citable architectural analogue." + }, + { + "key": "yao2022react", + "title": "ReAct: Synergizing Reasoning and Acting in Language Models", + "authors": "Shunyu Yao, Jeffrey Zhao, Dian Yu et al.", + "year": 2022, + "venue": "arXiv:2210.03629", + "arxiv_or_doi": "2210.03629", + "url": "http://arxiv.org/abs/2210.03629v3", + "grade": "confirmed", + "note": "Retrieved via arXiv metadata API; title/authors match claim exactly. Interleaves reasoning traces with actions in a single LLM prompt loop, the foundational pattern the cognitive-substrate and reliability-framework agent loops build on." + }, + { + "key": "gu2024llmjudge", + "title": "A Survey on LLM-as-a-Judge", + "authors": "Jiawei Gu, Xuhui Jiang, Zhichao Shi et al.", + "year": 2024, + "venue": "arXiv:2411.15594", + "arxiv_or_doi": "2411.15594", + "url": "http://arxiv.org/abs/2411.15594v6", + "grade": "confirmed", + "note": "Retrieved via arXiv metadata API; title/authors match claim exactly. Surveys the emerging practice of using LLMs themselves as evaluators/judges, directly relevant to any impact-awareness or self-correction mechanism that relies on an LLM-based verifier." + }, + { + "key": "ridnik2024alphacodium", + "title": "Code Generation with AlphaCodium: From Prompt Engineering to Flow Engineering", + "authors": "Tal Ridnik, Dedy Kredo, Itamar Friedman", + "year": 2024, + "venue": "arXiv:2401.08500", + "arxiv_or_doi": "2401.08500", + "url": "http://arxiv.org/abs/2401.08500v1", + "grade": "confirmed", + "note": "Retrieved via arXiv metadata API; title/authors match claim exactly. Replaces single-shot prompting with an iterative 'flow engineering' test-generate-fix loop for code generation, an applied precedent for the reliability framework's change-closure fixpoint over code edits." + }, + { + "key": "yang2024sweagent", + "title": "SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering", + "authors": "John Yang, Carlos E. Jimenez, Alexander Wettig et al.", + "year": 2024, + "venue": "arXiv:2405.15793", + "arxiv_or_doi": "2405.15793", + "url": "http://arxiv.org/abs/2405.15793v3", + "grade": "confirmed", + "note": "Retrieved via arXiv metadata API; title/authors match claim exactly. Introduces an agent-computer interface (a constrained action/observation space) purpose-built for LM agents doing software engineering, directly relevant to forgekit's agent-tool interaction design." + }, + { + "key": "wang2023voyager", + "title": "Voyager: An Open-Ended Embodied Agent with Large Language Models", + "authors": "Guanzhi Wang, Yuqi Xie, Yunfan Jiang et al.", + "year": 2023, + "venue": "arXiv:2305.16291", + "arxiv_or_doi": "2305.16291", + "url": "http://arxiv.org/abs/2305.16291v2", + "grade": "confirmed", + "note": "Retrieved via arXiv metadata API; title/authors match claim exactly. Demonstrates a lifelong-learning embodied agent that maintains and grows a skill library over time, the clearest existing analogue to persistent, growing external memory across sessions." + }, + { + "key": "bhati2026agenticsdlc", + "title": "Agentic AI in the Software Development Lifecycle: Architecture, Empirical Evidence, and the Reshaping of Software Engineering", + "authors": "Happy Bhati", + "year": 2026, + "venue": "arXiv:2604.26275", + "arxiv_or_doi": "2604.26275", + "url": "http://arxiv.org/abs/2604.26275v1", + "grade": "confirmed", + "note": "Retrieved via arXiv metadata API; the ID resolves to a REAL paper dated 2026-04-29 (April 2026, which is in the past relative to today, 2026-07-11 \u2014 so 'future-dated' only relative to the cited work's original claim date, not to now). Single author (Happy Bhati), self-archived cs.SE preprint, no journal/DOI yet \u2014 proposes a six-layer reference architecture and explicitly names an 'Agentic SDLC (A-SDLC)', matching the claimed topic closely. Confirmed to exist and match; flag for the synthesis authors that this is an unreviewed single-author preprint, not a peer-reviewed or highly-cited source, and should be cited with that caveat." + }, + { + "key": "you2026agentasjudge", + "title": "Agent-as-a-Judge", + "authors": "Runyang You, Hongru Cai, Caiqi Zhang et al.", + "year": 2026, + "venue": "arXiv:2601.05111", + "arxiv_or_doi": "2601.05111", + "url": "http://arxiv.org/abs/2601.05111v1", + "grade": "confirmed", + "note": "Retrieved via arXiv metadata API; ID resolves to a REAL paper dated 2026-01-08. Title is exactly 'Agent-as-a-Judge' and abstract frames it as 'the first comprehensive survey' of the Agent-as-a-Judge paradigm, matching the claimed 'Agent-as-a-Judge survey' framing. DISAMBIGUATION verified via live web_search (this turn) against arxiv.org/abs/2410.10934 directly: this 2601.05111 survey is NOT the original Agent-as-a-Judge paper. The founding paper is Zhuge, Zhao, Ashley, Wang, Khizbullin, Xiong, Liu, Chang, Krishnamoorthi, Tian, Shi, Chandra, Schmidhuber (2024), 'Agent-as-a-Judge: Evaluate Agents with Agents', arXiv:2410.10934, submitted 14 Oct 2024 -- a distinct, earlier, independently well-known paper that coined the term. If the synthesis intends to cite the founding paper rather than a survey of it, cite 2410.10934 instead or in addition." + }, + { + "key": "erol1994htn", + "title": "HTN Planning: Complexity and Expressivity", + "authors": "Erol, Hendler, Nau", + "year": 1994, + "venue": "Proceedings of the 12th National Conference on Artificial Intelligence (AAAI-94), Vol. 2, pp. 1123-1128", + "arxiv_or_doi": null, + "url": "https://aaai.org/papers/01123-htn-planning-complexity-and-expressivity/", + "grade": "traceable", + "note": "Classical AI-planning paper, no arXiv/OpenAlex record. Verified via live web_search (this turn) against AAAI's own paper page, Semantic Scholar, and a downstream paper's reference list (arXiv:1403.7426, 'An Overview of Hierarchical Task Network Planning'), all of which corroborate: title 'HTN Planning: Complexity and Expressivity', authors Erol/Hendler/Nau, AAAI-94 Vol.2 pp.1123-1128. A distinct but related journal version, 'Complexity results for HTN planning' (Annals of Mathematics and Artificial Intelligence, vol. 18, no. 1, pp. 69-93, 1996), was also corroborated in the same search (arXiv:1403.7426 reference list) but its DOI was not independently confirmed in this pass -- do not assert a DOI for either version without a direct publisher lookup." + }, + { + "key": "rao1995bdi", + "title": "BDI Agents: From Theory to Practice", + "authors": "Rao, Georgeff", + "year": 1995, + "venue": "Proceedings of the First International Conference on Multiagent Systems (ICMAS-95), pp. 312-319", + "arxiv_or_doi": null, + "url": "https://cdn.aaai.org/ICMAS/1995/ICMAS95-042.pdf", + "grade": "traceable", + "note": "Classical agent-architecture paper, no DOI/arXiv record. Verified via live web_search (this turn) against the AAAI-hosted PDF (cdn.aaai.org/ICMAS/1995/ICMAS95-042.pdf), gabormelli.com/RKB, and multiple independent downstream reference lists (e.g. arXiv:1310.2431, arXiv:2506.10192), all corroborating: title 'BDI Agents: From Theory to Practice', authors Rao & Georgeff, ICMAS-95, pp. 312-319." + }, + { + "key": "kahneman2011", + "title": "Thinking, Fast and Slow", + "authors": "Kahneman, D.", + "year": 2011, + "venue": "Farrar, Straus and Giroux (book)", + "arxiv_or_doi": null, + "url": null, + "grade": "traceable", + "note": "Classical trade/academic book, not indexed on arXiv or as a journal article with a DOI in the usual sense; existence and content (System 1 / System 2 dual-process framing) are well-established general knowledge, not independently re-verified against a bibliographic API in this pass." + }, + { + "key": "ebbinghaus1885", + "title": "\u00dcber das Ged\u00e4chtnis: Untersuchungen zur experimentellen Psychologie (Memory: A Contribution to Experimental Psychology)", + "authors": "Ebbinghaus, H.", + "year": 1885, + "venue": "Leipzig: Duncker & Humblot (book/monograph)", + "arxiv_or_doi": null, + "url": null, + "grade": "traceable", + "note": "Foundational 1885 monograph establishing the forgetting curve; predates modern indexing entirely, existence is well-established historical/secondary knowledge, not independently re-verified against a bibliographic API in this pass." + }, + { + "key": "boyd_ooda", + "title": "OODA Loop (Observe-Orient-Decide-Act)", + "authors": "Boyd, J.R.", + "year": null, + "venue": "Unpublished briefings/lectures (e.g. 'A Discourse on Winning and Losing', unpublished collection of briefing slides, c. 1976-1996); no single peer-reviewed paper", + "arxiv_or_doi": null, + "url": null, + "grade": "traceable", + "note": "No formal published paper exists \u2014 Boyd never formally published the OODA loop in a journal; it survives via briefing-slide decks and secondary military-strategy literature. Rubric correctly flags this as having 'no formal paper.' Cite as a named concept/doctrine, not a specific retrievable publication." + }, + { + "key": "deming_pdca", + "title": "PDCA / Plan-Do-Check-Act cycle (the 'Shewhart Cycle', popularized by Deming)", + "authors": "Shewhart, W.A. (originator); Deming, W.E. (popularizer)", + "year": null, + "venue": "Originates in Shewhart, Statistical Method from the Viewpoint of Quality Control (1939); popularized in Deming, Out of the Crisis (1982) and later works", + "arxiv_or_doi": null, + "url": null, + "grade": "traceable", + "note": "Management/quality-control doctrine spanning multiple books across decades, not a single citable paper. Existence and attribution (Shewhart origin, Deming popularization) are well-established secondary knowledge, not independently re-verified against a bibliographic API in this pass." + }, + { + "key": "zhuge2024agentjudge", + "title": "Agent-as-a-Judge: Evaluate Agents with Agents", + "authors": "Zhuge, Zhao, Ashley, Wang, Khizbullin, Xiong, Liu, Chang, Krishnamoorthi, Tian, Shi, Chandra, Schmidhuber", + "year": 2024, + "venue": "arXiv:2410.10934", + "arxiv_or_doi": "2410.10934", + "url": "https://arxiv.org/abs/2410.10934", + "grade": "confirmed", + "note": "The founding Agent-as-a-Judge paper that coined the term; added on the verification track's explicit recommendation to disambiguate from the 2026 survey (2601.05111)." + } +] \ No newline at end of file diff --git a/research/formal-synthesis/substrate_synthesis.html b/research/formal-synthesis/substrate_synthesis.html new file mode 100644 index 0000000..b2ceb4a --- /dev/null +++ b/research/formal-synthesis/substrate_synthesis.html @@ -0,0 +1,687 @@ + + +
+ + +Unifying the substrate faculties, the end-to-end reliability framework, and the forgekit implementation — with a two-layer duality theorem, a unified algorithm set, and a Qur'anic epistemology.
+ + +A large language model used for coding is a fixed probabilistic map, y = fθ(x): stateless, frozen, and bounded in context. Three research efforts converged, independently, on the same conclusion — that the remedy is not a better prompt or a bigger model but an external, stateful architecture wrapped around the frozen core. This paper proves they are describing one object. We show that the substrate's impact-awareness faculty and the framework's change-closure fixpoint Δ* are the same mathematics; that the assumption gate and the amnesia equation assumption ≈ argmax P(convention | training) are the same phenomenon; and that both reduce to a single two-layer duality: a probabilistic instruction layer that raises the probability p<1 of correct behaviour, and a deterministic interception layer that guarantees a floor. The central theorem states that neither layer alone can make an agent reliable — a direct formalization of the discipline never trust the output of a probabilistic engine; earn trust with an external check. We give definitions, the duality theorem with proof, a unified seven-algorithm task loop, the probabilistic failure model P(≥1 miss)=1−pn, and carry through the six correctness theorems of the reliability framework. Two prototypes — an impact oracle and a complexity-router/assumption-gate — instantiate the deterministic layer and are evaluated honestly. The forgekit / claude-e2e-kit codebase is the deployed binding. The Qur'anic lens supplies the vocabulary of epistemic obligation (tabayyun, amāna, lā taqfu) that names why each safeguard is mandatory rather than optional.
+Three efforts set out from different starting points and arrived at the same building.
+ +The first began with a question about human cognition: when a developer opens a file, they carry memory of what already exists, imagine what an edit will break, and verify their reasoning as they type. A frozen language model does none of this. The Cognitive Substrate workS named five faculties the model structurally lacks — memory, learning, imagination, self-correction, and impact-awareness — and argued the remedy is an external architecture that supplies them, together with six operating mechanisms (M1–M6: complexity-routing, an assumption gate, decomposition, goal-anchoring, scope-minimality, and inline verification).
+ +The second began with two concrete failures observed in production coding agents. F1, partial work: the agent changes code but not the artifacts that depend on it — docs, tests, changelog, examples. F2, session amnesia: a later session lacks the project's goals and conventions, so it fills the gaps with assumptions and the developer burns iterations re-explaining. The End-to-End Reliability FrameworkE gave these a formal model: a typed artifact graph, a change-closure fixpoint, four invariants, seven algorithms, and six correctness theorems.
+ +The third is a deployed codebase. forgekitK (and its Claude-specific precursor claude-e2e-kit) implements the same discipline as committed files, deterministic lifecycle hooks, and auto-invoked skills — one configuration that binds the architecture onto Claude Code, Codex, Cursor, Gemini, and Aider alike.
+ +These are not three similar ideas. They are one architecture described in three vocabularies. The impact-awareness faculty is the change-closure fixpoint. The assumption gate is the amnesia equation. The substrate's external structure is a two-layer duality — and that duality, which the reliability framework states as a design law, is the theorem the whole thing turns on. What each road saw partially, the union sees whole.
+The synthesis also inherits a governing discipline, stated plainly by the practitioner who commissioned this work: AI output is a mathematically calculated probability; it must never be trusted blindly; for the same prompt it can give a different answer, so use only the capability it is genuinely best at, and earn trust with an external check. We will see that this sentence is not a slogan but the informal statement of the central theorem — the quantity (1−p)>0 that forces a deterministic layer to exist.
+ +Fix the model. Let the coding agent's core be a function
+Three properties of this map generate every problem the architecture must solve. To avoid a notation collision with the reliability framework's primitives (§3), we label these model properties P1–P3:
+ +The five faculties are not wishes; each is the direct consequence of one or more of these properties, and each has an external remedy:
+ +| Faculty the model lacks | Forced by | External remedy (this architecture) |
|---|---|---|
| Persistent memory | P1 | A committed store re-injected each session (§6, A4/A5) |
| Learning from outcomes | P2 | Non-parametric experience store; optional parametric adapters (§6) |
| Imagination / world-model | P1, P3 | A typed artifact graph the agent queries before acting (§3.2) |
| Self-correction | P3 | An external verifier and a deterministic completion gate (§4, A6) |
| Impact-awareness | P1, P3 | The change-closure Δ* computed on the graph (§3.2, A1) |
The critical word is external. Because θ is frozen (P2) and context is bounded (P3), none of these can be fixed by prompting harder or by fine-tuning alone. The architecture must live around the model, hold state outside it, and enforce behaviour the model cannot be relied upon to produce on its own. The rest of this paper makes "cannot be relied upon" precise and shows what "enforce" must therefore mean.
+ + +The architecture turns the stateless map (1) into a stateful operator by threading an external memory M through it.
+ +A cognitive substrate over a frozen model fθ is an operator
+where Mt is a persistent store that survives between calls, xt is the request at step t, and yt is the output. The store carries what P1–P3 deny the model: prior state, learned priors, the world-model, and the reflection log. F is required to read Mt into the model's context before sampling and to write back Mt+1 after — the closed loop the bare model (1) does not have.
+Three environmental capabilities are needed to realize M and the read/write loop. The reliability framework calls these its primitives. It labels them P1/P2/P3, which collides with the model properties of §2; we therefore rename them Π1, Π2, Π3 and use that notation for the remainder of the paper.
+ +| Primitive | Definition | forgekit binding | Generic binding |
|---|---|---|---|
| Π1 — persistent store | Files the agent can read/write that survive sessions and travel with the project | git repo: CLAUDE.md, docs/*.md, .claude/** | any VCS; any repo-reading agent |
| Π2 — lifecycle interception | Deterministic code executed at fixed points of the agent loop (start, end-of-turn) | hooks: SessionStart, Stop, UserPromptSubmit | pre-commit hooks; CI jobs; IDE tasks |
| Π3 — instruction channel | Standing instructions loaded into the model's context | CLAUDE.md, .claude/rules/, skills | AGENTS.md, .cursorrules, system prompts |
Π3 is probabilistic; Π2 is deterministic. Instructions (Π3) raise the probability that the model behaves correctly; interception (Π2) executes regardless of what the model decides. A reliable substrate needs both, and §4 proves it cannot be built from either alone.
+The imagination/world-model faculty is realized concretely as a graph over the project's artifacts — the generalization that lets "impact on code" become "impact on everything that describes or depends on the code".
+ +Let the project be a finite set of artifacts A = {a1, …, an} with a type function τ : A → {code, test, doc, config, diagram} and a dependency relation R ⊆ A × A, where (a,b) ∈ R means "a describes, verifies, exercises, or references b". R = Rdeclared ∪ Rdiscovered: declared edges come from a curated documentation map (high precision, small); discovered edges are found mechanically — a mentions an identifier defined in b — by text search.
+The substrate's Prototype I builds this graph from source: an AST parser extracts the code nodes and their edges, so Rdiscovered over {code, test} is computed exactly rather than by grep. The reliability framework's contribution is to widen τ beyond code, making documentation a first-class dependent so that a code change can be seen to obligate a doc change.
+ +For a set X ⊆ A, the dependents operator is
+— everything that describes, verifies, or references anything in X. A task seeds a change set Δ0 ⊆ A (the files the request names or obviously touches). The required change closure is the least fixpoint
+Since A is finite and the sequence is monotone (Δ0 ⊆ Δ1 ⊆ … ⊆ A), the fixpoint exists and is reached in at most |A| steps (Kleene's theorem on a finite lattice). In practice depth 2–3 suffices.
+The substrate's Impact Oracle computes a file's blast radius by reverse reachability on the dependency graph — which is exactly the closure (4). The oracle adds a real-valued confidence that decays with graph distance, where the framework's N(·) is boolean; thresholding the oracle's confidence recovers N. They are the same computation. This is why the prototype achieves perfect recall on impacted files (§10): reverse reachability, run to fixpoint, cannot miss a reachable dependent.
+Each faculty is a well-typed operation on M, and each will be realized by one of the algorithms A1–A7 (§6):
+ +With the object (Def. 1), the world-model (Defs. 2–3), and the faculties (Def. 4) in hand, we can state the result the architecture rests on.
+ + +Everything so far has assumed that "the architecture must enforce behaviour the model cannot be relied upon to produce." We now make "cannot be relied upon" precise and derive what "enforce" must mean.
+ +A substrate's behaviour-shaping is partitioned into two layers over the frozen model:
+Let a task require a behaviour whose omission is a silent miss. Under the instruction layer alone the per-task silent-miss probability is 1−p; under a deterministic layer of k checks the residual silent-miss probability is
+Then, for any model whose instruction-following is imperfect (p<1) and any deterministic layer that is not omniscient (cj<1 for every j):
+□
+The practitioner's rule — never trust the probability engine's output; verify it — is the statement (1−p)>0. Theorem D turns that intuition into a design mandate: because the soft layer can never drive (1−p) to zero, a deterministic layer must exist to multiply it down; and because the hard layer can never catch the semantic class, the soft layer must exist to shrink what reaches it. The substrate is two-layered not by taste but by theorem.
+Theorem D's equation (5) is worth reading as an engineering instrument, because it explains a lived experience and prices every design choice.
+ +With the instruction layer alone, the chance of at least one partial-work incident over n tasks is 1−pn. Even an excellent p=0.9 gives 65% after 10 tasks and 96% after 30. The agent that "usually remembers the docs" is, over a project's lifetime, near-certain to forget them at least once. The failure is geometric, so no degree of prompt-polishing escapes it — only a factor (1−cj) below 1 can bend the curve.
+ +Add one gate whose target is the decidable signal "code changed and no doc/state artifact changed." That signal is checkable in microseconds and c1≈0.95. With p=0.7, the per-task silent-miss rate falls from 30% to (1−0.7)·(1−0.95)=1.5% — a twentyfold reduction from a twenty-line hook. Crucially the class of surviving misses changes from "forgot the docs entirely" (structural, now caught) to "updated the docs imperfectly" (semantic, handed to review). The gate does not make the model think; it removes an entire failure mode from the model's shoulders.
+ +The same classifier can run at three lifecycle points, and (5) shows their catches multiply: a turn-level Stop hook ⊂ a commit-level pre-commit hook ⊂ a PR-level CI job. Each later gate catches what earlier ones missed — the product (5) with k=3. This is also the answer to portability: where hooks are unavailable, the same deterministic check re-binds as a pre-commit hook or a CI step, moving the enforcement point without changing the mathematics.
+ +The model also prices the developer's real pain. Each silent miss costs a rework loop of expected size (1−p)·(1+r), where r is the re-explaining overhead that session-amnesia (F2) inflates. The architecture attacks both factors: gates convert silent misses into same-session fixes (r→0, caught before the developer sees the result), and persistence makes any residual loop cheap because the context is already standing. This is where the theory meets the user's stated grievance — wasted tokens, time, and quality — and answers it with a quantity, not a promise.
+The faculties of Def. 4 are realized by seven algorithms. They are the reliability framework's A1–A7, recast here as the operations of the substrate: each is a faculty made mechanical, each binds to one lifecycle point, and together they form a single loop whose progress is guaranteed by an explicit worklist and whose floor is guaranteed by a deterministic gate.
+ +function IMPACT_CLOSURE(request):
+ Δ ← seeds(request) # named files + search hits
+ W ← Δ ; frontier ← Δ
+ while frontier ≠ ∅: # BFS to the fixpoint Δ* (Def. 3)
+ E ← grep_edges(I(frontier)) # R_discovered
+ ∪ map_edges(frontier) # R_declared
+ ∪ interface_edges(frontier) # callers, overrides, migrations, DI wiring
+ new ← E \ W ; W ← W ∪ new ; frontier ← new
+ check_constraints(W, DECISIONS) # flag conflicts, never override (I3)
+ return { (a, τ(a), action(a), risk(a)) : a ∈ W } # the impact table
+Terminates in ≤|A| rounds (Thm. T5); on termination W ⊇ Δ* over discoverable+declared edges. This is simulate and impact of Def. 4, and it is exactly what the Impact Oracle prototype computes (§10).
+implement every row of the impact table (code AND tests), + following conventions drawn from the store M (I3); +partial implementation of the table = definitionally incomplete (Def. Done).+
function SYNC_VERIFY(changed):
+ I ← identifiers(diff(changed))
+ for a in DocSet ∪ map_artifacts:
+ hits ← grep(a, I)
+ if hits ≠ ∅: read(a); update stale content to match code
+ else: record verified-unaffected(a, "no mention of I") # checked, not assumed
+ if structure_changed: update ARCHITECTURE + diagrams + the map itself
+ if user_facing: append CHANGELOG
+ update STATE ; return {updated[], verified_unaffected[], doubts[]}
+The verify operator: no artifact is ever declared unaffected without the check running — invariant I1's "∨ verified-unaffected" made mechanical. The doubts[] channel enforces I3 (surface ambiguity, do not guess).
+function HANDOFF(K): + ensure SYNC_VERIFY ran + σ ← select(K, priority=[goal, next, decisions, gotchas, in_progress, done+why]) + write STATE ← σ, |σ| ≤ B lines # REWRITE (bounded), not append + mirror durable decisions → DECISIONS # append-only log + if a convention was corrected → update CLAUDE.md / rules (self-maintenance) + propose commit # committing = portable memory+
The bounded-compression checkpoint (|σ|≤B≈150) keeps the loader's cost O(B) forever — the snapshot+WAL pattern: STATE is the mutable snapshot, DECISIONS the durable log.
+on SessionStart(startup | resume | clear): + record baseline b ← git HEAD # enables the gate's session diff (A6) + inject: STATE (≤8KB) + last 10 commits + uncommitted files + DoD reminder+
The retrieve operator, made deterministic: continuity moves from "the agent may read the file" to "the context always contains it" — the same Π3→Π2 upgrade as the gate.
+on Stop(session s): + C ← (diff base(s)..HEAD) ∪ worktree changes − internal bookkeeping paths + code ← C ∩ CodeClass \ DocClass \ .claude/ # regex-classified + docs ← C ∩ DocClass + if code ≠ ∅ ∧ docs = ∅: exit 2 + repair checklist + set marker # BLOCK once + else: exit 0 # ALLOW+
The hard factor c1 of Theorem D. STATE counts as a doc artifact, so the weakest way to satisfy the gate is to update session state — which is exactly the continuity invariant I2. One check enforces a floor for both F1 and F2. Full decision table and safety proofs in §7.
+route(f): # first match wins (total function, Thm. T6) + needed every session, stable → CLAUDE.md (always loaded, ≤200 lines) + relevant only to paths g → .claude/rules/x (paths: g; loads on match) + a procedure / workflow → skill (loads on invocation) + specialist's accumulated patterns → subagent memory + current work status → STATE.md (rewritten, injected) + decision + rationale → DECISIONS.md (append-only)+
Keeps always-loaded context O(bounded) while total persisted knowledge grows without limit — the mathematical reason the substrate scales. This is the second face of routing: M1's complexity-router chooses a model tier by task difficulty; A7 chooses a storage home by knowledge type. Both are transparent and deterministic, and both reject an opaque-LLM classifier for the same reason — it would reintroduce the very (1−p) the hard layer exists to remove.
+The seven compose into one meta-algorithm that fits every task, from a one-line fix to a multi-file feature:
+Formally, iterate until the unsynced set U = { a ∈ Δ* : ¬updated(a) ∧ ¬verified(a) } = ∅ — a fixpoint loop whose progress is guaranteed by A1's explicit worklist and whose floor is guaranteed by A6. The soft stages (A1–A5, driven by instructions) raise p; the gate (A6, deterministic) guarantees the floor; persistence (A4/A5 over Π1) carries essential(K) across the session boundary.
+ +The TASK loop serves four invariants. Stated as logic, they port to any environment that supplies Π1–Π3.
+ +| Invariant | Statement | Kills |
|---|---|---|
| I1 — Consistency | ∀(a,b)∈R: changed(b) in task t ⇒ updated(a) ∨ verified-unaffected(a) in the same t. "No artifact lies about the code." | F1 |
| I2 — Continuity | At every session boundary: essential(K) ⊆ P, and the loader injects it. Corollary: everything essential lives in committed files — the only channel that crosses machines, terminals, web, and teammates. | F2 |
| I3 — No fabrication | Every convention the agent acts on is derived from repo evidence, or documented in P, or asked — never sampled from priors. Unattended: assumptions are stated explicitly, never silent. | the amnesia root (§5) |
| I4 — Verified currency | Facts about the outside world (library versions, APIs) are checked against current sources at use time; the outcome is recorded. Training memory is a stale cache. | stale-knowledge drift |
In Hoare-triple form, every task must satisfy
+where the gate (A6) checks a decidable necessary condition of the postcondition and the algorithms construct it. I3 is the invariant the user named as the deepest problem — "the biggest problem is assumption." It is the direct architectural answer to the amnesia equation of §5: an under-specified input must be met with supplied context, a stated assumption, or a halt — never a silent guess drawn from the prior.
+ +Six properties are proved of the deterministic layer. They are what make the hard factor of Theorem D trustworthy — a gate that could loop, brick a session, or miss its target signal would not earn its place.
+ +Theorem D says reliability needs a deterministic factor with cj→1 on its target signal. T3 is precisely that guarantee (the block fires exactly on the target signal); T1 and T2 ensure the factor is safe to add (it never loops, never bricks); T5 and T6 ensure the soft-layer machinery it composes with is well-defined (the closure terminates, the router is total); T4 extends the guarantee across the session boundary that F2 attacks. The six local proofs are what make the one global theorem deployable rather than merely true.
+The table below is the operational proof of the paper's claim: every concept appears in all three vocabularies, and the final column states the relationship that makes them one object. Three rows (marked ●) are not analogies but identities — the same mathematics under two names. The full machine-readable crosswalk is a companion artifact.
+Both source frameworks independently use the labels P1/P2/P3. In the substrate paper they are model properties (P1 statelessness, P2 frozen weights, P3 bounded context, §2); in the reliability framework they are the three primitives (persistent store, lifecycle interception, instruction channel). This paper keeps P1–P3 for the model properties and renames the primitives Π1/Π2/Π3 throughout (§3.1). Every reference to a primitive in this paper is written Πn.
| # | Unified concept | Substrate (S) | E2E Framework (E) | forgekit (K) | Relationship |
|---|---|---|---|---|---|
| 1 | The frozen core | y = f_theta(x): stateless map, fixed weights, bounded context (properties P1,P2,P3) | the agent/model whose behavior instructions can only raise the PROBABILITY of (p<1) | Claude / Codex / Cursor / Gemini / Aider — the model the kit wraps, never modifies | identical object: all three treat the model as a fixed probabilistic map to be wrapped, not retrained |
| 2 | Impact-awareness / partial-work failure ● | Faculty: impact-awareness gap; the developer silently simulates 'what will this edit break'. Prototype I = Impact Oracle (reverse-dependency blast radius with confidence decay) | F1 partial work; dependents operator N(X); required change closure Delta* = least fixpoint of X |-> X ∪ N(X); Done predicate; Algorithm A1 IMPACT-CLOSURE | /impact skill; documentation-map.md (R_declared); grep identifier sweep (R_discovered) | IDENTICAL MATHEMATICS. The Impact Oracle computes N(X) by reverse reachability on the dependency graph; Delta* is exactly the oracle's transitive blast-radius set. The oracle adds a confidence-decay weight the framework's set-theoretic N(X) leaves boolean. |
| 3 | Memory / session-amnesia failure | Faculty: persistent memory gap; each context window is ephemeral. Validity-anchored memory (facts carry confirmed/discredited state updated by verified outcomes) | F2 session amnesia; continuity invariant I2 (essential(K_i) ⊆ P and loader L must load it); handoff operator H; K_{i+1}(0)=L(P) | docs/STATE.md (bounded snapshot) + docs/DECISIONS.md (append-only log); /handoff writes it; SessionStart hook injects it | Same failure, same fix (external bounded-compression checkpoint). Substrate adds validity-anchoring (prune by whether a past prediction was externally confirmed); framework adds the snapshot+WAL split (STATE mutable vs DECISIONS append-only). |
| 4 | Why assumptions happen (the root the user named) ● | M2 assumption/uncertainty gate: under-specified input -> the model confabulates a convention | amnesia equation: when f ∈ essential(K) is missing from L(P), assumption ≈ argmax P(convention | training data) — the mathematically EXPECTED result of missing context, not misbehavior. Invariant I3 (no fabrication) | CLAUDE.md No-assumptions rule; intent-router SPEC card ('state assumptions explicitly') | The framework gives the substrate's M2 gate its formal justification: assumption is argmax over the prior, so the fix is to supply context (raise what L loads) OR gate on missing context (halt), never to hope. |
| 5 | Self-correction / verification | M6 inline verification; Prototype-II verify step; self-correction faculty | Algorithm A6 COMPLETION-GATE (deterministic Stop-hook floor); Hoare postcondition Done(t); the verification operator in A3 (verified-unaffected requires an actual grep, not an assumption) | docs-guard.sh Stop hook (blocks finish if code changed but no doc/state artifact did); reviewer agent verdict | Same verify-gate. Substrate framed it as a mechanism; framework proves it terminates (T1) and is sound (T3) and makes it the deterministic layer of the duality. |
| 6 | Complexity routing | M1 complexity-aware router (transparent additive rubric); Prototype-II router | Algorithm A7 KNOWLEDGE-ROUTER (where every fact lives, keeps always-loaded context bounded); System 1/System 2 effort routing; intent DFA | intent-router.sh (UserPromptSubmit hook, keyword DFA, <10ms, zero-token); effort-routing rule in CLAUDE.md; per-agent model: fields | Two facets of one routing principle. Substrate M1 routes by TASK COMPLEXITY -> model tier (cost). Framework A7 routes by KNOWLEDGE TYPE -> storage home (context budget). Both are transparent/deterministic, both reject an opaque-LLM classifier for the same reason. |
| 7 | Task decomposition | M3 task/session decomposition | HTN closure -> ordered task list (A1 output is the worklist); the meta-algorithm TASK(t) | sdlc-pilot 7-phase skill; subagents; git worktrees | Same: decompose the goal into the closure's ordered worklist before building. |
| 8 | Goal-anchoring | M4 goal-anchoring (goal drift: to a text model a long story and long code are the same object) | BDI Desires = written goal + acceptance criteria in STATE.md; I2 keeps them across sessions; acceptance criteria written at SPEC, consumed at VERIFY | docs/STATE.md 'Current goal' + 'Acceptance criteria'; sdlc-pilot SPEC->VERIFY gate | Substrate names the drift; framework anchors it in a persisted, re-injected Desire so every session optimizes the same target. |
| 9 | Anti-over-engineering | M5 anti-over-engineering (scope minimality; the residual whitespace) | amana / scope-boundedness (agent may not exceed asked scope); I3 (no invented structure) | CLAUDE.md effort routing 'trivial -> do it directly, no ceremony'; least-privilege defaults | Weakest-covered in all three; substrate marks it residual-gap, framework encodes it as a stewardship bound, kit as an effort-routing default. |
| 10 | World-model of the codebase | Faculty: world-model; Prototype-I codebase world-model (AST -> persistent dependency graph) | the typed artifact graph (A, tau, R = R_declared ∪ R_discovered) | documentation-map.md + the repo itself + ARCHITECTURE.md | Same graph. Substrate builds it from AST for code; framework generalizes the node type to {code,test,doc,config,diagram} so DOCS become first-class dependents — the key generalization that turns 'impact on code' into 'impact on all artifacts'. |
| 11 | Continual learning from outcomes | Faculty: learning without touching theta (non-parametric always-on + parametric LoRA/EWC) | Reflexion loop made cross-session (I3/I4); DECISIONS.md as precedent DB; A4 mirrors durable lessons | Reflexion rule in CLAUDE.md; STATE gotchas; agents' memory: project | Same 'learn without retraining' stance. Both store verbal lessons externally and re-inject; substrate adds the parametric option, framework keeps it purely non-parametric (committed files). |
| 12 | Rehydration (session start) | closed-loop write-back/read-back band in the substrate architecture | Algorithm A5 CONTEXT-REHYDRATE; loader L; records git baseline for the gate | session-context.sh SessionStart hook; /catchup skill (deep variant) | The read side of the substrate's memory loop, made deterministic (inject, don't hope the agent reads). |
| 13 | Independent verification / judge | self-correction faculty; the honest-negative-result caution (models correct poorly alone) | LLM-as-Judge applied: reviewer agent (fresh context, explicit criteria, adversarial); self-consistency for critical changes (majority of N) | reviewer.md agent; DoD item 7 | Substrate cited the finding that self-correction alone is weak; framework operationalizes the fix (an EXTERNAL judge), which is the same 'trust only an external check' principle as the gate. |
| 14 | The two-layer duality (THE central new insight) ● | implicit: the substrate wraps a probabilistic core with deterministic external structure, but v2 never states it as a law | DESIGN LAW: instructions (Pi3) are PROBABILISTIC (raise p); interception (Pi2) is DETERMINISTIC (guarantee a floor c->1). P(silent miss) = (1-p)·prod_j(1-c_j). Since p<1 always, neither layer alone suffices. | the split itself: CLAUDE.md/rules/skills = soft layer; hooks (docs-guard, session-context, intent-router) = hard layer | THIS is what the kit gives the substrate theory: the reason the substrate must be TWO layers, stated as a theorem. The user's own discipline ('never trust AI output — it is calculated probability') is exactly (1-p)>0, which forces the deterministic layer. |
| 15 | The probabilistic failure model | eval honesty: perfect accuracy shows separation not a benchmark; p<1 | P(>=1 miss) = 1 - p^n over n tasks (0.9 -> 65% at 10, 96% at 30); layered: P(silent miss)=(1-p)·prod(1-c_j) | the lattice of gates: turn-level (hook) ⊂ commit-level (pre-commit) ⊂ PR-level (CI) | The math that makes 'it works sometimes then forgets' a geometric certainty rather than bad luck — and quantifies why each added deterministic gate multiplies down the residual. |
| 16 | Stewardship / governance boundary | STEWARDSHIP/amana wrapper (33:72) around the whole architecture | amana in I3/I4 as no-fabrication + verified-currency; least privilege, reversibility, logged rationale, scope-boundedness | committed-files-only (auditable), block-at-most-once (no nagging), fail-open safety (T2), DOCS_GUARD_DISABLE auditable escape hatch | The ethical frame the substrate draws from the lens is realized as concrete safety properties in the framework (fail-open, reversibility) and kit (auditable hooks). |
The Qur’an is used here as a framing lens and ethics source, never as technical authority for an engineering claim. No verse proves that an algorithm works or a data structure is correct — those stand or fall on their engineering merits alone (§4–§7). What the lens supplies is (1) a vocabulary for the agent’s epistemic obligations — what it owes to truthfulness, verification, and stewardship; (2) a hierarchy of knowledge (‘ilm → fahm → ḥikma) that motivates a layered memory rather than a flat store; and (3) ethical constraints on autonomy (amāna, tabayyun) that translate into concrete safeguards. A mapping marked load-bearing directly motivates a specific architectural decision — e.g. a mandatory gate, not an optional one; a mapping marked metaphor is illustrative. Even load-bearing mappings must be independently defensible: the verse explains why we insist, not that it works.
+All Arabic is the clean Uthmani-script edition and all translations are Abdel Haleem, retrieved verbatim via the quran.ai connector; tafsir references are Ibn Kathir. No Qur’anic text is reproduced from model memory.
+The fourteen mappings are the epistemology behind the architecture: each names an obligation that a probabilistic engine, left alone, will not honour, and which the deterministic layer therefore exists to enforce. Twelve are load-bearing; two are metaphor. They are grouped by the faculty they govern.
+Beyond the verses, four Qur’anic concepts structure the whole architecture, each load-bearing:
+Every faculty the model lacks corresponds to an obligation the tradition names: lā taqfu (do not act without knowledge) → impact-closure; tabayyun (verify the report) → the gate; ta‘līm al-asmā’ (know the names) → the world-model; al-qalam (the pen) → persistent memory; rabbi zidnī ‘ilmā (increase me in knowledge) → continual learning; al-amāna (the trust) → the stewardship boundary. The engineering says how; the lens says why it is owed.
+Theory earns its keep when it runs. Two prototypes instantiate the deterministic layer's two hard functions — the impact closure (A1) and the routing/gate pair (A7 + A6) — and both are evaluated with the honesty the governing discipline demands: a perfect score on a self-built set demonstrates that a rubric can separate cases, never that it is a field benchmark.
+ +An AST parser builds the typed artifact graph over a Python codebase; reverse reachability with confidence decay computes a file's blast radius — the closure Δ* of Def. 3. Evaluated by mutation against two baselines:
+| Method | Precision | Recall | F1 | Reading |
|---|---|---|---|---|
| edited-file only | 1.00 | 0.53 | 0.65 | never over-warns, misses half the blast radius |
| grep baseline | 0.73 | 0.94 | 0.79 | strong, but can still miss |
| graph oracle | 0.63 | 1.00 | 0.75 | perfect recall — never misses an impacted file |
The oracle does not win on F1 — and the paper says so. Its distinguishing property is perfect recall, which is the safety property for the question "what will my edit break?": a reverse-reachability closure run to fixpoint cannot miss a reachable dependent (Thm. T5). It trades precision for that guarantee, tunable by the confidence threshold (best F1 = 0.79 at threshold 0.4). It scales: 303-node stdlib module in 18 ms, 1903-node module in 91 ms. This is anchor identity #1 confirmed on real code.
+ +A transparent, feature-based rubric routes each task to a model tier (cheap/mid/premium) and gates under-specified requests before they reach a model at all — the assumption gate that answers the user's "biggest problem is assumption." The routing decision explains itself; it does not ask another opaque model, because that would reintroduce the (1−p) the deterministic layer exists to remove. Evaluated live on real models (haiku/sonnet/opus):
+| Metric | Result |
|---|---|
| Gate accuracy (should-ask, 30 tasks) | 30/30, precision = recall = 1.00 |
| Routing (well-specified tasks) | 21/21 exact tier |
| Real cost saved vs always-premium | 62.1% on measured tokens |
| Execution-verified routed-down outputs | 3/3 passed real test cases |
The 30-task set is hand-labelled and the thresholds were tuned against it, so these numbers show the rubric can separate the cases — they are not a field benchmark. The cost figures, by contrast, are exact arithmetic on real measured token counts from live calls, and the correctness sub-experiment actually executed the cheaper models' code against test cases (the honesty core: routing down is only a saving if the cheap output is correct). Both prototypes ship as runnable packages with passing test suites.
+The theory is implementation-independent; forgekit is one binding of it, and its precursor claude-e2e-kit is the reference realization on Claude Code. The mapping is exact:
+| Framework object | forgekit / claude-e2e-kit | Faculty / algorithm |
|---|---|---|
| Π1 persistent store | CLAUDE.md, docs/STATE.md, docs/DECISIONS.md, docs/ARCHITECTURE.md | memory |
| Π2 interception | session-context.sh (SessionStart), docs-guard.sh (Stop), intent-router.sh (UserPromptSubmit) | A5, A6, routing |
| Π3 instructions | CLAUDE.md DoD + No-assumptions + Reflexion + effort-routing; .claude/rules/ | I1–I4, M1–M6 |
| Δ* construction (A1) | /impact skill + documentation-map.md | impact-awareness |
| Verify operator (A3) | /sync-docs + doc-sync agent (project memory) | self-correction |
| Handoff (A4) / rehydrate (A5) | /handoff → STATE; SessionStart injection + /catchup | memory |
| Independent judge | reviewer agent (fresh context, adversarial, criteria-based) | self-correction |
| Phase gates | sdlc-pilot 7-phase skill (SPEC…MAINTAIN) | decomposition, goal-anchoring |
The kit grounds its mechanisms in the same literature the substrate's faculties cite — CoALA's four memories, MemGPT's paging, Generative Agents' recency×importance scoring, Reflexion's verbal reinforcement, ReAct's reason–act interleaving, LLM-as-Judge's independent evaluator, AlphaCodium's phase-gated flow, Voyager's growing skill library, and the classical decision loops (BDI, OODA/PDCA, HTN). It is the same architecture, cited from the same shelf, and shipped. The two prototypes of §10 slot in as the mechanical cores of /impact and the effort-router.
+ +That an independent team, starting from production failures rather than from cognitive faculties, built the same seven algorithms and stated the same design law is the strongest available evidence that the architecture is discovered, not invented — a convergent solution to a structural problem, the way distributed systems converge on snapshot+WAL. The synthesis does not merge two guesses; it records a convergence.
+A language model that writes code is a fixed probabilistic map, and three independent efforts — one from cognition, one from production failures, one from a shipped codebase — converged on the same remedy: wrap it in an external, stateful architecture that supplies the faculties it structurally lacks. This paper showed they describe one object. The impact-awareness faculty is the change-closure fixpoint; the assumption gate is the amnesia equation; and both rest on a single theorem — reliability is the product of a probabilistic instruction layer that raises p<1 and a deterministic interception layer that guarantees a floor, with neither alone sufficient.
+That theorem is the formal content of a plain discipline: the output of a probability engine is never to be trusted on its own; trust is earned by an external check. The Qur'anic lens gives that discipline its oldest names — lā taqfu, do not pursue what you do not know; tabayyun, verify the report before you act; al-amāna, the weight of a trust accepted by one who may err. The mathematics says how to build the check. The tradition says why it is owed. The codebase shows it runs.
+Companion artifacts: the three-way crosswalk (JSON + markdown), the graded reference set (Appendix A), and two runnable prototype packages (impact-oracle, router-gate). This synthesis consolidates and does not supersede the v2 Theory → Evidence → Build-Map edition, which carries the empirical evidence layer and the full ecosystem map.
+ +The synthesis draws in a body of cognitive-architecture and process literature beyond the substrate paper's original 32 references. Each new source was independently verified this pass — modern arXiv sources by direct metadata fetch, classical works by primary-host search or established secondary knowledge — and graded: confirmed (record retrieved, attribution matches), traceable (the work clearly exists and is correctly attributed, but rests on established secondary knowledge rather than a single retrievable record), unverifiable (could not confirm). The tally: 8 confirmed, 6 traceable, 0 unverifiable.
+| Source | ID | Grade | Note |
|---|---|---|---|
| Cognitive Architectures for Language Agents Theodore R. Sumers, Shunyu Yao, Karthik Narasi, 2023 | 2309.02427 | confirmed | Retrieved via arXiv metadata API; title/authors match claim exactly. Unifies memory, planning/reasoning, action, and learning modules into a single CoALA framework for language agents, giving the cognitive-substrate work's memory/im… |
| ReAct: Synergizing Reasoning and Acting in Language Shunyu Yao, Jeffrey Zhao, Dian Yu et al., 2022 | 2210.03629 | confirmed | Retrieved via arXiv metadata API; title/authors match claim exactly. Interleaves reasoning traces with actions in a single LLM prompt loop, the foundational pattern the cognitive-substrate and reliability-framework agent loops build on. |
| A Survey on LLM-as-a-Judge Jiawei Gu, Xuhui Jiang, Zhichao Shi et al., 2024 | 2411.15594 | confirmed | Retrieved via arXiv metadata API; title/authors match claim exactly. Surveys the emerging practice of using LLMs themselves as evaluators/judges, directly relevant to any impact-awareness or self-correction mechanism that relies on an LL… |
| Code Generation with AlphaCodium: From Prompt Engine Tal Ridnik, Dedy Kredo, Itamar Friedman, 2024 | 2401.08500 | confirmed | Retrieved via arXiv metadata API; title/authors match claim exactly. Replaces single-shot prompting with an iterative 'flow engineering' test-generate-fix loop for code generation, an applied precedent for the reliability frame… |
| SWE-agent: Agent-Computer Interfaces Enable Automate John Yang, Carlos E. Jimenez, Alexander Wettig, 2024 | 2405.15793 | confirmed | Retrieved via arXiv metadata API; title/authors match claim exactly. Introduces an agent-computer interface (a constrained action/observation space) purpose-built for LM agents doing software engineering, directly relevant to forgekit… |
| Voyager: An Open-Ended Embodied Agent with Large Lan Guanzhi Wang, Yuqi Xie, Yunfan Jiang et al., 2023 | 2305.16291 | confirmed | Retrieved via arXiv metadata API; title/authors match claim exactly. Demonstrates a lifelong-learning embodied agent that maintains and grows a skill library over time, the clearest existing analogue to persistent, growing external memor… |
| Agentic AI in the Software Development Lifecycle: Ar Happy Bhati, 2026 | 2604.26275 | confirmed | Retrieved via arXiv metadata API; the ID resolves to a REAL paper dated 2026-04-29 (April 2026, which is in the past relative to today, 2026-07-11 — so 'future-dated' only relative to the cited work's original claim date, … |
| Agent-as-a-Judge Runyang You, Hongru Cai, Caiqi Zhang et al., 2026 | 2601.05111 | confirmed | Retrieved via arXiv metadata API; ID resolves to a REAL paper dated 2026-01-08. Title is exactly 'Agent-as-a-Judge' and abstract frames it as 'the first comprehensive survey' of the Agent-as-a-Judge paradigm, matching… |
| Agent-as-a-Judge: Evaluate Agents with Agents Zhuge, Zhao, Ashley, Wang, Khizbullin, Xiong, , 2024 | 2410.10934 | confirmed | The founding Agent-as-a-Judge paper that coined the term; added on the verification track's explicit recommendation to disambiguate from the 2026 survey (2601.05111). |
| HTN Planning: Complexity and Expressivity Erol, Hendler, Nau, 1994 | — | traceable | Classical AI-planning paper, no arXiv/OpenAlex record. Verified via live web_search (this turn) against AAAI's own paper page, Semantic Scholar, and a downstream paper's reference list (arXiv:1403.7426, 'An Overview of Hie… |
| BDI Agents: From Theory to Practice Rao, Georgeff, 1995 | — | traceable | Classical agent-architecture paper, no DOI/arXiv record. Verified via live web_search (this turn) against the AAAI-hosted PDF (cdn.aaai.org/ICMAS/1995/ICMAS95-042.pdf), gabormelli.com/RKB, and multiple independent downstream reference li… |
| Thinking, Fast and Slow Kahneman, D., 2011 | — | traceable | Classical trade/academic book, not indexed on arXiv or as a journal article with a DOI in the usual sense; existence and content (System 1 / System 2 dual-process framing) are well-established general knowledge, not independently re-veri… |
| Über das Gedächtnis: Untersuchungen zur experimentel Ebbinghaus, H., 1885 | — | traceable | Foundational 1885 monograph establishing the forgetting curve; predates modern indexing entirely, existence is well-established historical/secondary knowledge, not independently re-verified against a bibliographic API in this pass. |
| OODA Loop (Observe-Orient-Decide-Act) Boyd, J.R., None | — | traceable | No formal published paper exists — Boyd never formally published the OODA loop in a journal; it survives via briefing-slide decks and secondary military-strategy literature. Rubric correctly flags this as having 'no formal paper.… |
| PDCA / Plan-Do-Check-Act cycle (the 'Shewhart Cycle' Shewhart, W.A. (originator); Deming, W.E. (pop, None | — | traceable | Management/quality-control doctrine spanning multiple books across decades, not a single citable paper. Existence and attribution (Shewhart origin, Deming popularization) are well-established secondary knowledge, not independently re-ver… |
Two IDs in the source material are dated 2026. Both resolve to real preprints whose content matches the claim, confirmed by direct arXiv fetch rather than by topic plausibility. arXiv:2604.26275 ("Agentic SDLC", Apr 2026) is a genuine but single-author, non-peer-reviewed preprint — cited as a recent preprint claim, not an established result. arXiv:2601.05111 ("Agent-as-a-Judge", Jan 2026) is a real survey, but is a different paper from the founding work that coined the term — Zhuge et al. 2024 (arXiv:2410.10934), which is the reference this paper uses for the independent-judge concept in §11. Both are recorded here so the distinction is not lost.
+The full three-way crosswalk (§8) is provided as a machine-readable companion in two forms: crosswalk.json (structured, with the notation reconciliation and the three anchor identities) and crosswalk.md (readable table). Together with this paper, the two graded map files from the v2 edition (evidence map, ecosystem map), and the two runnable prototype packages (impact-oracle, router-gate), they form the complete synthesis deliverable set.
+
+A Formal Theory of the Cognitive Substrate for Coding Agents — synthesis edition.
+Unifying the substrate faculties, the end-to-end reliability framework, and the forgekit implementation.
+The mathematics says how the check is built; the tradition says why it is owed; the codebase shows it runs.
+