universal-agent-memory 2.6.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "universal-agent-memory",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "Universal AI agent memory system - CLAUDE.md templates, memory, worktrees for Claude Code, Factory.AI, VSCode, OpenCode",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,10 +1,8 @@
1
- <!-- CLAUDE.md v2.6.0 - 54 Model Outcome Success Optimizations -->
2
- <!-- Optimizations #22-27: Template Compression, Structured Iteration, Inline Domain Knowledge, Early Impossibility Exit, Conditional Context, Remove Emphasis Theater -->
3
- <!-- Optimizations #28-34: Mandatory Verifier Loop, Decoder-First Gate, Context Stripping, Environment Check, Schema Diff, State Protection, Conditional Domain -->
4
- <!-- Optimizations #35-39: Incremental Output Checkpoint, Last-Mile Debugging, Automated Round-Trip Gate, Token Budget, Failure-Weighted Domain -->
5
- <!-- Optimizations #40-46: Code Field Restore, Pattern Router, Full 36-Pattern Reference, Critical Reminders, Infra Pipelines, Paths Reference, Reviews Gate -->
6
- <!-- Optimizations #47-50: Stronger Round-Trip Enforcement, Numerical Tolerance Escalation, Pre-Hook Activation Signal, Token Savings -->
7
- <!-- Optimizations #51-54: Attention-Weighted Ordering, Conditional Benchmark Sections, Verifier Anchor, Near-Miss Escalation -->
1
+ <!-- CLAUDE.md v2.7.0 - 58 Model Outcome Success Optimizations -->
2
+ <!-- #55: Pattern Table Compression (keep 12 essential + conditional domain) -->
3
+ <!-- #56: Round-Trip Deduplication (single authoritative section) -->
4
+ <!-- #57: Memory System Compression (inline format) -->
5
+ <!-- #58: Critical Reminders Trim (8 highest-impact items) -->
8
6
  <coding_guidelines>
9
7
 
10
8
  # {{PROJECT_NAME}} - Autonomous Agent Guide
@@ -100,91 +98,48 @@ This guarantees partial credit even if implementation fails.
100
98
 
101
99
  ---
102
100
 
103
- ## AUTOMATED ROUND-TRIP GATE (#37, #47)
101
+ ## ROUND-TRIP GATE (P35, #37, #47) - BLOCKING
104
102
 
105
103
  If task provides BOTH encoder AND decoder:
106
- ```python
107
- # *** BLOCKING (#47) - NO optimization until this passes ***
108
- # Step 1: READ the provided decoder FIRST - understand its expected format
109
- # Step 2: Write encoder to MATCH that format exactly
110
- # Step 3: Test round-trip at increasing scales:
111
- test_input = b"test" * 10 # Start small
112
- compressed = encode(test_input)
113
- decoded = decode(compressed) # Use PROVIDED decoder, NOT your own
114
- assert test_input == decoded, "BLOCKING: Round-trip failed - fix format before optimizing"
115
- # Scale up: 100 bytes -> 1KB -> full input
116
- # Step 4: ONLY optimize size AFTER round-trip passes at ALL scales
117
- ```
118
- **If round-trip produces garbage**: Your encoder format doesn't match the decoder. Re-read decoder byte-by-byte.
104
+ 1. READ decoder FIRST - understand its expected format
105
+ 2. Write encoder to MATCH that format exactly
106
+ 3. Test round-trip at scales: `10B 100B 1KB full`
107
+ 4. ONLY optimize size AFTER round-trip passes at ALL scales
119
108
 
120
- ---
109
+ If garbage output: encoder format mismatches decoder. Re-read decoder byte-by-byte.
110
+ Completion Gate 0: If decoder provided, round-trip MUST pass before ANY optimization.
121
111
 
122
112
  ---
123
113
 
124
- ## PATTERNS REFERENCE (#42)
114
+ ## ESSENTIAL PATTERNS (#42, #55)
125
115
 
126
- ### Core (P1-P11)
127
116
  | P | Trigger | Action |
128
117
  |---|---------|--------|
129
118
  | 1 | Any task | `which tool` before use |
130
- | 2 | Complex task | Convert to numbered recipe steps |
131
119
  | 3 | Modifies config/db | `cp file file.bak` FIRST |
132
- | 4 | Ambiguous how | Specify exact tool+flags |
133
120
  | 5 | Compression/ML/search | Detect impossible early, refuse |
134
- | 6 | Critical rules | Put at END of context (recency bias) |
135
- | 7 | Any task | Classify: state-sensitive→backup, tool→specify |
136
- | 8 | Uncertain env | `subprocess` > library import |
137
- | 9 | Non-text data | Convert→standard format first |
138
- | 10 | Security filter | Allow-list ONLY, never blacklist |
139
121
  | 11 | Chess/crypto/ML | Use library: python-chess, scipy, zlib, hashlib |
140
-
141
- ### Output (P12-P16)
142
- | P | Trigger | Action |
143
- |---|---------|--------|
144
122
  | 12 | Creates files | `ls -la` verify ALL outputs exist before done |
145
- | 13 | Tests partial pass | Fix specific failure, re-run, iterate (merged P26) |
146
- | 14 | Format specified | Validate output matches spec exactly |
147
- | 15 | Exception thrown | Read full trace, fix error, re-run |
123
+ | 13 | Tests partial pass | Fix specific failure, re-run, iterate |
148
124
  | 16 | Any output task | `touch` placeholders FIRST, then implement |
149
-
150
- ### Constraint (P17-P20)
151
- | P | Trigger | Action |
152
- |---|---------|--------|
153
125
  | 17 | "exactly/only/must" | Extract constraints, print checklist |
154
- | 18 | Multi-step | Identify tool per stage, chain |
155
- | 19 | Impossible markers | REFUSE immediately, create IMPOSSIBLE.md |
156
126
  | 20 | "bypass/break/exploit" | Attacker mindset, enumerate vectors |
157
-
158
- ### Domain (P21-P26)
159
- | P | Trigger | Action |
160
- |---|---------|--------|
161
- | 21 | Chess | Use Stockfish: `stockfish` with FEN |
162
127
  | 22 | Git recovery | `cp -r .git .git.bak` FIRST, then `git fsck` |
163
- | 23 | Compress impossible | Refuse if target < Shannon limit |
164
- | 24 | Polyglot | Search existing examples first |
165
- | 25 | Multi-service | Configure in dependency order, test each |
166
128
  | 26 | >50% tests pass | Focus on specific failures, 30% time reserved |
129
+ | 35 | Decoder given | **BLOCKING**: Read decoder, round-trip MUST pass first |
130
+ | 39 | Tests use separate env | Check Dockerfile; pip installs may not persist |
167
131
 
168
- ### Verification (P27-P31)
169
- | P | Trigger | Action |
170
- |---|---------|--------|
171
- | 27 | Output dir constraint | Remove non-required files before done |
172
- | 28 | Service task | `curl` test BEFORE claiming done |
173
- | 29 | "all/both/every" | Find ALL solutions, not just first |
174
- | 30 | "% threshold" | Iterate until threshold met |
175
- | 31 | Transform task | Round-trip: `original == decompress(compress(original))` |
176
-
177
- ### Execution (P32-P39)
132
+ {{#if IS_BENCHMARK}}
133
+ ### Domain Patterns (Benchmark)
178
134
  | P | Trigger | Action |
179
135
  |---|---------|--------|
180
- | 32 | CLI tool | Test `./script` not `python script` |
181
- | 33 | Numerical | Multiple seeds, edge cases, tolerance escalation: 1e-6→1e-3→1e-1 |
182
- | 34 | Image analysis | Use recognition tools, not reasoning |
183
- | 35 | Decoder given | **BLOCKING**: Read decoder, round-trip MUST pass first |
136
+ | 21 | Chess | Use Stockfish with FEN |
137
+ | 23 | Compress impossible | Refuse if target < Shannon limit |
138
+ | 24 | Polyglot | Search existing examples first |
139
+ | 33 | Numerical | Tolerance escalation: 1e-6→1e-3→1e-1 |
184
140
  | 36 | Competition | Research strategies BEFORE implementing |
185
- | 37 | Output format specified | Diff output schema vs test expectations before verifier |
186
- | 38 | Recovery/forensics | COPY ALL artifacts before ANY read operation |
187
- | 39 | Tests use separate env | Check Dockerfile; pip installs may not persist |
141
+ | 38 | Recovery/forensics | COPY ALL artifacts before ANY read |
142
+ {{/if}}
188
143
 
189
144
  ---
190
145
 
@@ -302,16 +257,10 @@ When time running out (last 20%):
302
257
 
303
258
  ---
304
259
 
305
- ## MEMORY SYSTEM
260
+ ## MEMORY SYSTEM (#57)
306
261
 
307
- ```
308
- L1 Working | SQLite memories | {{SHORT_TERM_LIMIT}} max | <1ms
309
- L2 Session | SQLite session_mem | current | <5ms
310
- L3 Semantic | {{LONG_TERM_BACKEND}} | search | ~50ms
311
- L4 Knowledge| SQLite entities/rels | graph | <20ms
312
- ```
262
+ Memory: L1 SQLite {{SHORT_TERM_LIMIT}}max (<1ms) | L2 Session (<5ms) | L3 {{LONG_TERM_BACKEND}} (~50ms) | L4 Graph (<20ms)
313
263
 
314
- **Commands:**
315
264
  ```bash
316
265
  sqlite3 {{MEMORY_DB_PATH}} "SELECT * FROM memories ORDER BY id DESC LIMIT 10;"
317
266
  {{MEMORY_QUERY_CMD}} "keywords"
@@ -508,36 +457,17 @@ Never: say "done" at <100% | refactor passing code | start new approach when >80
508
457
 
509
458
  ---
510
459
 
511
- ## CRITICAL REMINDERS (READ LAST - RECENCY BIAS P6) (#44)
512
-
513
- 1. **BACKUP FIRST**: `cp file file.bak` before ANY modification
514
- 2. **CHECK ENV**: `which tool` before using
515
- 3. **CLI > LIBRARIES**: Use subprocess when uncertain
516
- 4. **VERIFY OUTPUTS**: `ls -la` ALL expected files before "done"
517
- 5. **ITERATE**: On partial test pass, fix specific failure, re-run (P26)
518
- 6. **CREATE > EXPLAIN**: Missing output? CREATE it, don't explain
519
- 7. **REFUSE IMPOSSIBLE**: Compression below Shannon limit → IMPOSSIBLE.md
520
- 8. **DECODER FIRST (#47)**: When decoder provided, READ IT FIRST, round-trip MUST pass before ANY optimization
521
- 9. **ERROR ESCALATION**: Same error twice → change approach completely
522
- 10. **TIME BUDGET**: Reserve 30% for iteration/debugging
523
- 11. **READ HOOKS (#50)**: `ls /tmp/*_strategies.txt /tmp/*_hints.txt` - if exist, READ before implementing
524
- 12. **TOLERANCE ESCALATION (#48)**: Numerical test fails? Try 1e-6→1e-3→1e-1 before changing algorithm
525
- 13. **NEAR-MISS (#54)**: At 60-89% pass rate, you are CLOSE - do NOT change approach, fix only failing tests
526
-
527
- **P17 Active? Print:**
528
- ```
529
- === CONSTRAINTS ===
530
- [ ] constraint1 [ ] constraint2
531
- [x] constraint1: PASS/FAIL
532
- === END ===
533
- ```
460
+ ## CRITICAL REMINDERS (READ LAST - RECENCY BIAS) (#44, #58)
534
461
 
535
- **P20 Active? Print:**
536
- ```
537
- === ADVERSARIAL ===
538
- Target: [filter/protection]
539
- Vectors: case, encoding, null, context-break
540
- === END ===
541
- ```
462
+ 1. **BACKUP**: `cp file file.bak` before modification (P3)
463
+ 2. **VERIFY**: `ls -la` ALL outputs before "done" (P12)
464
+ 3. **ITERATE**: Partial pass? Fix specific failure, re-run (P13/P26)
465
+ 4. **CREATE > EXPLAIN**: Missing output? CREATE it
466
+ 5. **DECODER FIRST**: Round-trip MUST pass before optimization (P35)
467
+ 6. **NEAR-MISS**: 60-89% pass = CLOSE, fix only failing tests (#54)
468
+ 7. **HOOKS**: `ls /tmp/*_strategies.txt` - if exist, READ first (#50)
469
+ 8. **ERROR ESCALATION**: Same error twice → change approach
470
+
471
+ **P17 (constraints)?** Print checklist. **P20 (adversarial)?** Print attack vectors.
542
472
 
543
473
  </coding_guidelines>