Commit fc1bd86
committed
feat: SPO stack hardening — bitmap widening, sparse fingerprints, integrity verification
Core fixes from PR #167/#168 review, rewritten from spec:
- sparse.rs: Widen bitmap [u64;2] → [u64;BITMAP_WORDS=4] to cover all 256 positions
- builder.rs: Fix invalid hex literal (0xCHA1_D15C → 0xC4A1_D15C), rewrite label_fp()
to produce ~11% density sparse fingerprints via xorshift64 PRNG
- store.rs: Add TruthGate epistemic filter (OPEN/STRONG/CERTAIN), fix scent/Hamming
scale mismatch with separate scent_radius parameter, add gated query methods
- geometry.rs: Add ContainerGeometry::Spo = 6 variant
- mod.rs: Wire pub mod spo (was missing — ~2000 lines of dead code)
- bind_space.rs: Add clam_merkle field to BindNode, stamp ClamPath + MerkleRoot
on write_dn_node()/write_dn_path(), add verify_lineage() + Epoch snapshot
All 61 tests pass (24 SPO + 32 ClamPath + 5 bind_space integrity).
https://claude.ai/code/session_013JU8MRtxRRTtuc5217r6s51 parent a53d440 commit fc1bd86
7 files changed
Lines changed: 641 additions & 147 deletions
File tree
- crates/ladybug-contract/src
- src
- graph
- spo
- storage
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| |||
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
| 55 | + | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| |||
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
| 68 | + | |
61 | 69 | | |
62 | 70 | | |
63 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
| 121 | + | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
191 | 199 | | |
192 | | - | |
| 200 | + | |
193 | 201 | | |
194 | 202 | | |
195 | 203 | | |
196 | 204 | | |
197 | 205 | | |
198 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
199 | 224 | | |
200 | 225 | | |
201 | 226 | | |
| |||
254 | 279 | | |
255 | 280 | | |
256 | 281 | | |
257 | | - | |
258 | | - | |
259 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
260 | 285 | | |
261 | 286 | | |
262 | 287 | | |
| |||
283 | 308 | | |
284 | 309 | | |
285 | 310 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
291 | 316 | | |
292 | 317 | | |
293 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
0 commit comments