Commit c8b53ed
* feat(memory): add encoding-time cognitive state stamp to synaptic header (#502)
Stamp each memory at ingestion time with the cognitive state that produced
it, enabling mode-congruent recall, soul-drift detection, and provenance
auditing.
New fields (9 bytes, no layout migration needed):
- encoding_profile (offset 35, 1B): bit7=soul-derived, bits0-3=ordinal
- encoding_alpha (offset 44, 1B): quantized alpha weight (0-255)
- encoding_beta (offset 45, 1B): quantized beta weight (0-255)
- soul_version (offset 46-47, 2B): monotonic soul config counter
- encoding_surprise (offset 56-59, 4B): surprise z-score (float32)
Changes:
- SynapticHeaderConstants: new offsets, bitmasks, convenience methods;
removed OFFSET_RESERVED_F1/L1; updated javadoc layout diagram;
removed stale 32B core references
- HeaderLayout: default read/write methods for encoding state fields
- HeaderLayout64: implemented read/write, updated readHeader/writeHeader
- CognitiveHeader: extended record with 5 new fields, V1/V2 compat
constructors, createWithEncodingState() factory method
- ActRActivation: updated stale offset references with overlap warning
Co-authored-by: Bharat Joshi <bharatjoshi@spectrayan.com>
* feat(core): add soulVersion, createdAt, updatedAt to SoulContext hierarchy
Add version(), createdAt(), updatedAt() to the sealed SoulContext
interface so all soul types carry versioning and timestamp info.
Update all 4 implementations: AgentSoul (field + builder), UserSoul
(with backward-compatible 5-arg constructor), TenantSoul, OrgUnitSoul.
Add SOUL_DERIVED enum constant (ordinal 12) to CognitiveProfile for
encoding state stamp when alpha/beta come from InsulaSelfModel rather
than a preset profile.
Refs #502
Co-authored-by: Bharat Joshi <bharatjoshi@spectrayan.com>
* feat(core): wire encoding state fields into ingestion pipeline
Wire all 5 V3 encoding state fields (encoding_profile, encoding_alpha,
encoding_beta, soul_version, encoding_surprise) into all 3 ingestion
sites in CognitiveIngestionTarget.
- computeEncodingProfile: preset ordinal vs SOUL_DERIVED (bit7+ordinal)
- computeEncodingAlpha/Beta: quantize float [0,1] to byte [0,255]
- surpriseZScore: captured from SurpriseDetector at formation time
- soulVersion: propagated via new setSoulVersion() on SpectorMemory
Add quantizeWeight/dequantizeWeight helpers to SynapticHeaderConstants.
Add setSoulVersion() to SpectorMemory, DefaultSpectorMemory, and
MeteredSpectorMemory.
Refs #502
Co-authored-by: Bharat Joshi <bharatjoshi@spectrayan.com>
* feat(synapse): add soul version increment and encoding state propagation
Wire monotonic soul version increment into CognitiveSoulService:
- saveAgentSoul: read current version from INSULA, increment, set on
rebuilt soul, push to SpectorMemory.setSoulVersion()
- saveUserSoul: same pattern with full 8-arg UserSoul constructor
- loadAgentSoul: propagate loaded version to SpectorMemory
Update all AgentSoul construction sites in synapse module:
- AgentController, ChatService, DynamicGraphBuilder, UpdateAgentSoulTool
Wire soul version restoration at startup in UserMemoryRegistry
alongside salience profile loading from INSULA.
Refs #502
Co-authored-by: Bharat Joshi <bharatjoshi@spectrayan.com>
* fix(metrics): add setSoulVersion override to DummySpectorMemory in test suite
Implement setSoulVersion(short) in DummySpectorMemory test fixture
to satisfy the updated SpectorMemory interface contract.
Refs #502
Co-authored-by: Bharat Joshi <bharatjoshi@spectrayan.com>
* feat(bench): enable bundle mode and add dataset embedding pre-cache runner
Enable V4 bundle mode on SpectorMemoryBuilder in BenchmarkSetup.
Add DatasetEmbeddingPrecacheRunner class and pregenerate-dataset-embeddings.ps1
script to enable offline overnight pre-caching of vector embeddings and
pre-ingestion of V3 memory stores for datasets lacking embeddings.bin.
Refs #502
Co-authored-by: Bharat Joshi <bharatjoshi@spectrayan.com>
* fix(memory): harden V4 mmap bundle region sizing and SIMD bounds safety
- Correct HYPERGRAPH RegionSizeSpec byte size calculation to account for vertex entries (16 vertices/edge * 8 bytes).
- Include subheader 16 bytes in EntityDirectory.fromBundle headerSegment slice.
- Guard SIMD bounds safety in QuantizedEuclideanDistance by clamping effective length.
- Avoid duplicate close of shared bundle arena in HyperEntityGraphMemory when bundleManaged.
Refs #502, #463
Co-authored-by: Bharat Joshi <bharatjoshi@spectrayan.com>
---------
Co-authored-by: Bharat Joshi <bharatjoshi@spectrayan.com>
1 parent 30a6906 commit c8b53ed
9 files changed
Lines changed: 247 additions & 9 deletions
File tree
- bench/spector-bench/src/main/java/com/spectrayan/spector/bench/cognitive
- memory/spector-memory/src/main/java/com/spectrayan/spector/memory
- cortex
- graph
- nucleus/spector-core/src/main/java/com/spectrayan/spector/core/similarity
- scripts
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| |||
Lines changed: 133 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 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 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | | - | |
| 396 | + | |
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
| 376 | + | |
376 | 377 | | |
377 | | - | |
| 378 | + | |
378 | 379 | | |
379 | 380 | | |
380 | 381 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
175 | | - | |
| 176 | + | |
176 | 177 | | |
177 | 178 | | |
178 | 179 | | |
| |||
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
| 261 | + | |
260 | 262 | | |
261 | 263 | | |
262 | | - | |
| 264 | + | |
263 | 265 | | |
264 | 266 | | |
265 | 267 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1102 | 1102 | | |
1103 | 1103 | | |
1104 | 1104 | | |
1105 | | - | |
1106 | 1105 | | |
1107 | | - | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
1108 | 1109 | | |
1109 | 1110 | | |
1110 | 1111 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
94 | | - | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
0 commit comments