@@ -14,6 +14,36 @@ Your job: wire the SPO distance harvest, stripe shift detector, CLAM path encodi
1414
1515---
1616
17+ ## DIRECTORY STRUCTURE
18+
19+ ```
20+ src/
21+ core/
22+ simd.rs ← 348-line duplicate SIMD (DELETE after rustynum port lands)
23+ rustynum_accel.rs ← rustynum SIMD dispatch interface
24+ fingerprint.rs ← content-addressable fingerprint
25+ scent.rs ← scent/similarity operations
26+ vsa.rs ← VSA bind/bundle/permute
27+ search/
28+ hdr_cascade.rs ← adaptive cascade + SigmaGate (already wired)
29+ extensions/spo/
30+ gestalt.rs ← 965 lines, committed (DO NOT rewrite)
31+ spo.rs ← existing SPO encoding (53KB)
32+ mod.rs ← module declarations
33+ jina_api.rs ← Jina embedding API
34+ jina_cache.rs ← Jina cache layer
35+ graph/
36+ avx_engine.rs ← fingerprint graph engine (SIMD cleaned up)
37+ nars/ ← NARS truth value types
38+ cypher_bridge.rs ← Cypher → BindSpace bridge
39+
40+ NEW FILES TO CREATE (all under src/extensions/spo/):
41+ spo_harvest.rs ← Phase 2: SPO distance + harvest + NARS + inference
42+ shift_detector.rs ← Phase 3: stripe shift detector
43+ clam_path.rs ← Phase 5: CLAM path encoding
44+ causal_trajectory.rs ← Phase 6: resonator instrumentation
45+ ```
46+
1747## WHAT'S ALREADY COMMITTED
1848
1949Branch ` claude/review-rustynum-pr-80-2zNy5 ` in ladybug-rs — 2 commits, +1,131 / -421 lines:
@@ -85,7 +115,7 @@ Each document is self-contained with implementation-grade code examples. This me
85115
86116## PHASE 2: SPO Distance Harvest
87117
88- ** File: ` ladybug-rs/src/spo_harvest.rs ` (NEW)**
118+ ** File: ` ladybug-rs/src/extensions/spo/ spo_harvest.rs ` (NEW)**
89119
90120This is the cosine replacement. 238× fewer cycles, 7.3× more information per computation. The detailed spec is in ` spo_distance_harvest_cosine_replacement_prompt.md ` . Key deliverables:
91121
@@ -126,7 +156,7 @@ The XOR bitmasks (`x_xor`, `y_xor`, `z_xor`) computed for distance are the SAME
126156
127157## PHASE 3: Distance Granularity + Stripe Shift Detector
128158
129- ** Extends: ` spo_harvest.rs ` + new ` shift_detector.rs ` **
159+ ** Extends: ` src/extensions/spo/ spo_harvest.rs` + new ` src/extensions/spo/ shift_detector.rs` **
130160
131161Detailed specs in ` spo_distance_granularity_investigation.md ` and ` sigma_stripe_shift_detector_addendum.md ` .
132162
@@ -168,7 +198,7 @@ impl ShiftDetector {
168198}
169199```
170200
171- ** Wire into CollapseGate** (already exists in gestalt.rs):
201+ ** Wire into CollapseGate (already exists in src/extensions/spo/ gestalt.rs):
172202- Shift toward noise → bias HOLD
173203- Shift toward foveal → bias FLOW
174204- Bimodal → speciation event
@@ -177,7 +207,7 @@ impl ShiftDetector {
177207
178208## PHASE 5: B-tree Channel = CLAM Path
179209
180- ** File: ` ladybug-rs/src/clam_path.rs ` (NEW)**
210+ ** File: ` ladybug-rs/src/extensions/spo/ clam_path.rs ` (NEW)**
181211
182212Detailed spec in ` btree_clam_path_lineage_addendum.md ` .
183213
@@ -222,7 +252,7 @@ One u16. Three query types. O(log n + k):
222252
223253## PHASE 6: Causal Trajectory Recorder
224254
225- ** File: ` ladybug-rs/src/causal_trajectory.rs ` (NEW)**
255+ ** File: ` ladybug-rs/src/extensions/spo/ causal_trajectory.rs ` (NEW)**
226256
227257Detailed spec in ` nars_causal_trajectory_hydration_prompt.md ` . This is the biggest new module.
228258
@@ -274,7 +304,7 @@ FullSimultaneous — all three at once → Gestalt snap (rare)
274304
275305## PHASE 7: Gestalt Integration
276306
277- ** Extends existing: ` ladybug-rs/src/gestalt.rs ` (DO NOT rewrite — add to it)**
307+ ** Extends existing: ` ladybug-rs/src/extensions/spo/ gestalt.rs ` (DO NOT rewrite — add to it)**
278308
279309### 7.1 Wire detect_bundling() Into CLAM Harvest Loop
280310
@@ -341,7 +371,7 @@ Phase 2 → Core value (SPO distance harvest — the cosine replacement)
341371Phase 3 → Near-free upgrades on Phase 2 (raw popcount, histogram, stripe shift)
342372Phase 5 → ClamPath encoding (type definitions, CogRecord wire)
343373Phase 6 → Causal trajectory recorder (biggest module, uses Phase 2 types)
344- Phase 7 → Wires Phase 2-6 into existing gestalt.rs + neo4j-rs + Redis
374+ Phase 7 → Wires Phase 2-6 into existing src/extensions/spo/ gestalt.rs + neo4j-rs + Redis
345375```
346376
347377### Minimum Viable
@@ -361,7 +391,7 @@ Everything else builds on that foundation.
361391
362392```
363393DO NOT modify rustynum (separate session owns it)
364- DO NOT rewrite gestalt.rs (add to it, don't replace it)
394+ DO NOT rewrite src/extensions/spo/ gestalt.rs (add to it, don't replace it)
365395DO NOT touch the SIMD dispatch in avx_engine.rs (already cleaned up)
366396
367397KEEP: AVX-512 VPOPCNTDQ path (more specialized than CLAM's distances crate)
0 commit comments