Commit ee67b85
committed
ArghDA M3: Flying-Logic reasoning graph — demote-only verdict propagation
The headline capability of the epic. A new `src/reason/` layer that *wraps*
(does not replace) the DAG: the `DagDocument` is embedded verbatim, and on
top go a per-node `Verdict`, `And`/`Or` edge juncts, and a memoised,
cycle-safe, DEMOTE-ONLY propagation fold.
The honesty invariant, enforced end-to-end: a node's effective verdict can
only be LOWERED by its dependencies, never manufactured. Lint-clean + no
typecheck = `Unknown`, never green. Only `Proven` is green;
`Admitted`/`Postulated` are amber. And because the fold is demote-only over
`And` import edges, structural amber INFECTS downstream — anything that
transitively imports a `postulate` (or `missing-safe`/escape-hatch) module
is itself capped, visible before any prover runs. `Or` groups are forgiving
(one green route keeps a goal up). Import cycles degrade to `Error` and
terminate. Staleness (closure-hash-changed proven → `Unknown`) is applied
pre-fold so it propagates. `wired` marks the CRT-root-reachable cone.
- `src/reason/mod.rs`: `Junct`, `ReasonNode` (self_verdict/effective/
verdict_evidence/soundness/wired), `ReasonEdge`, `ReasonDocument`
(version "0.1", embedded `dag`, `crt_roots`); rank/demote/promote lattice;
lint→verdict caps; the propagation fold.
- `arghda reason <path> [--check]`: `--check` runs the backend per node for
REAL exit-code verdicts (honest); default is structure+lint derived.
- Tests: 9 unit (demote, downstream amber infection, Or forgiveness, cycle
termination, wiring, clean-but-unchecked→Unknown) + 6 integration. Total
suite 81 green; clippy -D warnings, fmt, SPDX clean.
- Dogfood caught + fixed a real wiring bug: the CLI's `discover_roots`
yields include-root-relative paths, which a stray `include_root.join`
double-prefixed, leaving every node unwired. Fixed (match the
orphan-module rule's convention) + regression-tested; the earlier tests
missed it because they passed absolute paths.
- STATE.a2ml records M3 = 100%.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012MpYSh6Wy8YMBH2E3qVyT71 parent 75eac52 commit ee67b85
5 files changed
Lines changed: 809 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
63 | 80 | | |
64 | 81 | | |
65 | 82 | | |
| |||
87 | 104 | | |
88 | 105 | | |
89 | 106 | | |
90 | | - | |
91 | | - | |
| 107 | + | |
92 | 108 | | |
93 | 109 | | |
94 | 110 | | |
| 111 | + | |
95 | 112 | | |
96 | 113 | | |
97 | 114 | | |
| |||
102 | 119 | | |
103 | 120 | | |
104 | 121 | | |
105 | | - | |
106 | | - | |
107 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
108 | 126 | | |
109 | 127 | | |
110 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
33 | 35 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
86 | 111 | | |
87 | 112 | | |
88 | 113 | | |
| |||
144 | 169 | | |
145 | 170 | | |
146 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
147 | 185 | | |
148 | 186 | | |
149 | 187 | | |
| |||
354 | 392 | | |
355 | 393 | | |
356 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
357 | 434 | | |
358 | 435 | | |
359 | 436 | | |
| |||
0 commit comments