Commit 227a93f
committed
fix(review): apply 8-angle code-review findings from #13
An adversarial multi-angle review of #13 (line-by-line, removed-behavior,
cross-file tracing, reuse, simplification, efficiency, altitude,
conventions; each finding independently verified) surfaced defects that
merged before the fix sweep landed. This applies every confirmed finding.
Correctness (fail-closed integrity):
- boj client: a 200 whose body carries an estate error shape (`error` key
or `success:false`) is now a FAILURE, not a verdict. The boj router
unwraps cartridge failure envelopes into 200 bodies, so transport success
alone was recording hard misses (e.g. echidna without ANTHROPIC_API_KEY)
as "ok" — a direct fail-closed violation. [cross-file]
- App: an absent `repo_root` no longer silently defaults to the daemon's
own working directory (which grafted whatever tree the server was
launched from onto a fight for an unrelated slug). New
`plan_ungrounded()` probes no filesystem at all, and every plan whose
ground-truth is absent now says so with an explicit blocker. [A/B/C]
- boj client: repo_root is canonicalized before being sent to experts —
they run in their own working directories and panic-attack's contract
requires an absolute path; if canonicalization fails, the call is
refused and recorded fail-closed instead of sending a relative path
that would scan the wrong tree. [line-by-line]
- boj routing is now group-primary: the planner's chosen specialist is
never rerouted by the obligation (previously a HypatiaFleet+Scan
escalation would silently summon panic-attack instead of hypatia).
[line-by-line]
- App: SQUABBLE_PORT that is malformed OR zero refuses to boot (exit 69)
instead of silently binding the default/an ephemeral port the cartridge
cannot target; startup prints the actually-bound address. [A + altitude]
- Justfile: `just test` now also compiles/tests the `boj` feature — the
golden path previously never built the summon subsystem, so a break in
it would ship silently. [cross-file]
Evidence fidelity (no truncation loss):
- Report gains typed `expert_verdicts: Vec<ExpertVerdict>` (serde default,
back-compat): every expert call is recorded verbatim — check, cartridge,
tool, ok (transport AND body), honest meaning, and the full untruncated
verdict. The escalation's evidence string now carries only the short
human narration; previously verdicts were spliced into prose and cut at
400 chars, silently losing scan findings. [altitude]
API/robustness:
- App /api/v1/diagnose accepts both the bare Gate and a {gate: ...}
wrapper, so callers generalising from /api/v1/fight's shape by analogy
don't get an opaque 422. [altitude]
Docs/honesty (doctrine #10):
- context.rs no longer claims to live in squabble-cli (it moved to
squabble-fight); cli main.rs doc now names fight/--summon and the
client's network surface; app doc no longer claims a non-loopback
"refusal" guard that never existed (the interface is hardcoded, and the
doc now says exactly that); README.adoc no longer calls squabble-app a
stub. [removed-behavior + cross-file]
- boj.rs documents the deliberate, feature-contained reversal of
fetch.rs's shell-out-over-HTTP-client stance and why. [reuse]
Simplifications:
- structural_scan is a pure producer returning its findings (drops the
clippy too_many_arguments allow); the summon cfg-pair collapsed to
inline cfg at the call site; fight's USAGE is shared with the top-level
help so the two cannot drift; FightRequest.repo_root is Option<PathBuf>.
Refuted in verification (not applied): the cartridge `domain:"ci"` claim
(laminar-mcp uses the identical value; siblings are already heterogeneous)
and all efficiency candidates (honest scale analysis: n≈5 escalations,
loopback, freshness-by-design).
Verified: 43 default + 11 boj tests green; fmt + clippy clean in both
configs; live re-check — ungrounded fight emits the honesty blocker, both
diagnose shapes accepted, SQUABBLE_PORT=0 exits 69.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SUURnQUnzTXYftzWFs5pfZ1 parent 4bd7aaa commit 227a93f
9 files changed
Lines changed: 382 additions & 173 deletions
File tree
- crates
- squabble-app/src
- squabble-cli/src
- squabble-core/src
- squabble-fight/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
| 138 | + | |
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
39 | | - | |
40 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
| |||
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
46 | | - | |
47 | | - | |
48 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
49 | 66 | | |
50 | 67 | | |
51 | 68 | | |
| |||
57 | 74 | | |
58 | 75 | | |
59 | 76 | | |
60 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
61 | 81 | | |
62 | 82 | | |
63 | 83 | | |
64 | 84 | | |
65 | | - | |
66 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
67 | 91 | | |
68 | 92 | | |
69 | 93 | | |
70 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
71 | 98 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
77 | 108 | | |
78 | 109 | | |
79 | 110 | | |
80 | 111 | | |
81 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
82 | 121 | | |
83 | 122 | | |
84 | 123 | | |
85 | 124 | | |
86 | 125 | | |
87 | | - | |
88 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
89 | 129 | | |
90 | 130 | | |
91 | 131 | | |
92 | 132 | | |
93 | 133 | | |
94 | 134 | | |
95 | 135 | | |
| 136 | + | |
96 | 137 | | |
97 | | - | |
| 138 | + | |
98 | 139 | | |
99 | 140 | | |
100 | 141 | | |
| |||
0 commit comments