Skip to content

Commit 21eafb8

Browse files
author
Jan Hübener
committed
fix: sync updated module placement to main
1 parent b901502 commit 21eafb8

1 file changed

Lines changed: 32 additions & 49 deletions

File tree

.claude/prompts/00_SESSION_A_META.md

Lines changed: 32 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -14,45 +14,34 @@ Your job: wire the SPO distance harvest, stripe shift detector, CLAM path encodi
1414

1515
---
1616

17-
## MODULE PLACEMENT
18-
19-
SPO and BNN are default-on, first-class dependencies (not experimental). New modules integrate with existing top-level modules — don't duplicate types that already exist.
17+
## DIRECTORY STRUCTURE
2018

2119
```
22-
EXISTING (use these, extend them, DO NOT duplicate):
23-
src/nars/
24-
truth.rs ← TruthValue with revision, from_evidence() — USE THIS
25-
inference.rs ← InferenceRule trait (Deduction, Abduction, Induction)
26-
evidence.rs ← Evidence tracking
27-
src/search/
28-
hdr_cascade.rs ← SigmaGate already wired (PR 158)
29-
causal.rs ← Pearl's causal ladder Rung 1/2/3 (37KB)
30-
src/qualia/
31-
gestalt.rs ← Buber I/Thou/It role binding (19KB) — different from SPO gestalt
32-
resonance.rs ← Qualia resonance (34KB)
33-
src/extensions/spo/
34-
gestalt.rs ← BundlingProposal, TiltReport, PlaneCalibration (PR 158, 34KB)
35-
spo.rs ← SPO encoding (53KB)
36-
mod.rs ← module declarations
37-
jina_api.rs / jina_cache.rs
38-
src/core/
39-
simd.rs ← 173-line thin delegator (DELETE after rustynum SIMD port)
20+
src/
21+
core/
22+
simd.rs ← 348-line duplicate SIMD (DELETE after rustynum port lands)
4023
rustynum_accel.rs ← rustynum SIMD dispatch interface
41-
fingerprint.rs / scent.rs / vsa.rs
42-
src/graph/
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/
4336
avx_engine.rs ← fingerprint graph engine (SIMD cleaned up)
44-
45-
NEW FILES — placed where they naturally belong:
46-
src/search/spo_harvest.rs ← Phase 2: SPO distance (next to hdr_cascade.rs)
47-
src/search/shift_detector.rs ← Phase 3: stripe shift (next to distribution.rs)
48-
src/extensions/spo/clam_path.rs ← Phase 5: CLAM path encoding (SPO-specific)
49-
src/extensions/spo/causal_trajectory.rs ← Phase 6: resonator instrumentation
50-
51-
CRITICAL TYPE REUSE:
52-
harvest_to_nars() → MUST return crate::nars::TruthValue (already has revision rule)
53-
TypedInference → should use/extend crate::nars::InferenceRule trait
54-
CausalTrajectory → edges must be compatible with src/search/causal.rs Pearl ladder
55-
ShiftDetector → next to src/search/distribution.rs (same domain)
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
5645
```
5746

5847
## WHAT'S ALREADY COMMITTED
@@ -126,7 +115,7 @@ Each document is self-contained with implementation-grade code examples. This me
126115

127116
## PHASE 2: SPO Distance Harvest
128117

129-
**File: `ladybug-rs/src/search/spo_harvest.rs` (NEW — next to hdr_cascade.rs)**
118+
**File: `ladybug-rs/src/extensions/spo/spo_harvest.rs` (NEW)**
130119

131120
This 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:
132121

@@ -152,15 +141,13 @@ impl SpoDistanceResult {
152141
### 2.2 Functions to Build
153142

154143
```
155-
spo_distance(a, b) → SpoDistanceResult — the core 13-cycle computation
156-
harvest_to_nars(result) → crate::nars::TruthValue — USE EXISTING TYPE (has revision rule)
157-
harvest_to_inference(result) → TypedInference — dominant halo type → typed query action
158-
AccumulatedHarvest::accumulate(result) — EMA + nars::TruthValue revision across searches
159-
feed_sigma_graph(result) → Vec<SigmaEdge> — emit typed edges from harvest
144+
spo_distance(a, b) → SpoDistanceResult — the core 13-cycle computation
145+
harvest_to_nars(result) → NarsTruth — frequency from core ratio, confidence from entropy
146+
harvest_to_inference(result) → TypedInference — dominant halo type → typed query action
147+
AccumulatedHarvest::accumulate(result) — EMA + NARS revision across searches
148+
feed_sigma_graph(result) → Vec<SigmaEdge> — emit typed edges from harvest
160149
```
161150

162-
**CRITICAL**: `harvest_to_nars()` returns `crate::nars::TruthValue`, NOT a new NarsTruth type. The existing type already has `revision()`, `from_evidence()`, `deduction()`, etc. — use them.
163-
164151
### 2.3 Key Constraint
165152

166153
The XOR bitmasks (`x_xor`, `y_xor`, `z_xor`) computed for distance are the SAME bitmasks used for `cross_plane_vote()`. The halo extraction is FREE — no extra compute. Do not compute XOR twice.
@@ -169,7 +156,7 @@ The XOR bitmasks (`x_xor`, `y_xor`, `z_xor`) computed for distance are the SAME
169156

170157
## PHASE 3: Distance Granularity + Stripe Shift Detector
171158

172-
**Extends: `src/search/spo_harvest.rs` + new `src/search/shift_detector.rs`**
159+
**Extends: `src/extensions/spo/spo_harvest.rs` + new `src/extensions/spo/shift_detector.rs`**
173160

174161
Detailed specs in `spo_distance_granularity_investigation.md` and `sigma_stripe_shift_detector_addendum.md`.
175162

@@ -211,7 +198,7 @@ impl ShiftDetector {
211198
}
212199
```
213200

214-
**Wire into CollapseGate** (already exists in `src/extensions/spo/gestalt.rs`, also connects to `src/search/distribution.rs`):
201+
**Wire into CollapseGate (already exists in src/extensions/spo/gestalt.rs):
215202
- Shift toward noise → bias HOLD
216203
- Shift toward foveal → bias FLOW
217204
- Bimodal → speciation event
@@ -269,8 +256,6 @@ One u16. Three query types. O(log n + k):
269256

270257
Detailed spec in `nars_causal_trajectory_hydration_prompt.md`. This is the biggest new module.
271258

272-
**NOTE**: `src/search/causal.rs` (37KB) already implements Pearl's 3-rung causal ladder (Correlate/Intervene/Counterfact). The causal trajectory recorder should produce edges compatible with that system — Rung 1 from halo correlations, Rung 2 from BPReLU intervention asymmetry, Rung 3 from ClamPath sibling (counterfactual) queries.
273-
274259
### 6.1 Core Structures
275260

276261
```rust
@@ -321,8 +306,6 @@ FullSimultaneous — all three at once → Gestalt snap (rare)
321306

322307
**Extends existing: `ladybug-rs/src/extensions/spo/gestalt.rs` (DO NOT rewrite — add to it)**
323308

324-
**NOTE**: There are TWO gestalt modules — `src/qualia/gestalt.rs` (Buber I/Thou/It, 19KB) and `src/extensions/spo/gestalt.rs` (BundlingProposal, 34KB). Phase 7 extends the SPO one. The qualia one maps Buber roles to Xyz geometry — it's complementary, not redundant.
325-
326309
### 7.1 Wire detect_bundling() Into CLAM Harvest Loop
327310

328311
When `AccumulatedHarvest` SO/SP/PO evidence crosses `CollapseMode` threshold → auto-create `BundlingProposal`.

0 commit comments

Comments
 (0)