universal-agent-memory 1.0.7 → 1.0.8

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": "1.0.7",
3
+ "version": "1.0.8",
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,7 +1,17 @@
1
1
  <!--
2
- CLAUDE.md Universal Template - v10.6
2
+ CLAUDE.md Universal Template - v10.7
3
3
 
4
4
  CHANGES IN THIS VERSION:
5
+ - Added Verification Patterns (P27-P31) from Terminal-Bench failure analysis
6
+ - Pattern 27: Output Directory Cleanup (ODC) - remove non-required files
7
+ - Pattern 28: Service Smoke Test (SST) - test services before completing
8
+ - Pattern 29: Multi-Solution Discovery (MSD) - find ALL valid solutions
9
+ - Pattern 30: Performance Threshold Tuning (PTT) - iterate to meet thresholds
10
+ - Pattern 31: Round-Trip Verification (RTV) - verify compress/decompress works
11
+ - Updated Pattern Router to include verification patterns
12
+ - Added 5 completion gates (output, tests, constraints, cleanup, services)
13
+
14
+ PREVIOUS (v10.6):
5
15
  - Added Domain-Specific Patterns (P21-P26)
6
16
  - Pattern 21: Chess Engine Integration (CEI) - use Stockfish, not reasoning
7
17
  - Pattern 22: Git Recovery Forensics (GRF) - backup first, forensic approach
@@ -568,6 +578,126 @@ done
568
578
 
569
579
  **Reserve 30% of time budget for near-miss iteration.**
570
580
 
581
+ ### Pattern 27: Output Directory Cleanup (ODC)
582
+ Tests often check for ONLY specific files in output directories.
583
+
584
+ **Detection**: Tasks mentioning "single file", "only", constraints on output directory contents
585
+
586
+ **Protocol**:
587
+ 1. **Before completing**, list output directory: `ls /app/output/`
588
+ 2. **Remove non-required files**: compiled binaries, temp files, backups
589
+ 3. **Keep ONLY the required outputs** as specified in task
590
+
591
+ ```bash
592
+ # Clean output directory - keep only required file
593
+ cd /app/polyglot
594
+ ls -la # Check what's there
595
+ rm -f *.o *.out main cmain # Remove compiled artifacts
596
+ ls -la # Verify only main.rs remains
597
+ ```
598
+
599
+ **Common mistakes**: Leaving compiled binaries, test files, or backup files in output directories.
600
+
601
+ ### Pattern 28: Service Smoke Test (SST)
602
+ Services must be tested BEFORE claiming completion.
603
+
604
+ **Detection**: Tasks involving servers, daemons, APIs, web services
605
+
606
+ **Protocol**:
607
+ 1. Start the service
608
+ 2. **Immediately test it** with curl/wget/client
609
+ 3. If test fails: debug, fix, restart, re-test
610
+ 4. Only complete when test PASSES
611
+
612
+ ```bash
613
+ # Service verification pattern
614
+ # 1. Start service
615
+ systemctl start nginx
616
+
617
+ # 2. IMMEDIATELY test it
618
+ curl -v http://localhost:80/ 2>&1 | grep -q "200 OK" || echo "FAIL: nginx not serving"
619
+
620
+ # 3. For PyPI server
621
+ python -m http.server 8080 &
622
+ curl -s http://localhost:8080/simple/ | grep -q "href" || echo "FAIL: PyPI not serving"
623
+
624
+ # 4. For git server
625
+ git ls-remote git@localhost:/repo.git 2>&1 | grep -q "refs" || echo "FAIL: git not serving"
626
+ ```
627
+
628
+ **NEVER complete without a successful smoke test.**
629
+
630
+ ### Pattern 29: Multi-Solution Discovery (MSD)
631
+ Some tasks require finding ALL valid solutions, not just one.
632
+
633
+ **Detection**: Keywords "all moves", "both solutions", "list all", "find every"
634
+
635
+ **Protocol**:
636
+ 1. **Parse task for multi-solution requirement**
637
+ 2. For chess: Find ALL checkmate moves, not just the first one
638
+ 3. For puzzles: Enumerate all valid answers
639
+ 4. **Output ALL solutions** in required format
640
+
641
+ ```bash
642
+ # Chess: Find ALL checkmate-in-one moves
643
+ # Don't stop at first bestmove, analyze ALL legal moves
644
+ echo -e "position fen $FEN\ngo depth 20" | stockfish | grep "bestmove"
645
+ # Then check if there are MULTIPLE winning moves
646
+ echo -e "position fen $FEN\ngo movetime 5000 multipv 5" | stockfish
647
+ # Extract ALL moves that lead to checkmate
648
+ ```
649
+
650
+ ### Pattern 30: Performance Threshold Tuning (PTT)
651
+ Tasks with numeric thresholds require iterative tuning.
652
+
653
+ **Detection**: Keywords "win rate", "accuracy", "percentage", "threshold", "at least X%"
654
+
655
+ **Protocol**:
656
+ 1. Run initial implementation
657
+ 2. Check if thresholds are met
658
+ 3. If not: analyze what's missing, tune parameters
659
+ 4. Re-run until thresholds pass
660
+
661
+ ```bash
662
+ # Performance tuning loop for Core Wars
663
+ while true; do
664
+ # Run tests
665
+ pytest -v 2>&1 | tee results.txt
666
+
667
+ # Check for threshold failures
668
+ if grep -q "need.*%+" results.txt; then
669
+ echo "Threshold not met - tuning..."
670
+ # Analyze which opponent needs better strategy
671
+ # Modify warrior code
672
+ # Re-run
673
+ else
674
+ break
675
+ fi
676
+ done
677
+ ```
678
+
679
+ **For compression tasks**: If decompression fails, verify round-trip: `compress | decompress == original`
680
+
681
+ ### Pattern 31: Round-Trip Verification (RTV)
682
+ For transform/encode/compress tasks, verify the reverse operation.
683
+
684
+ **Detection**: Keywords "compress", "encode", "serialize", "encrypt", and task mentions "decompress", "decode", etc.
685
+
686
+ **Protocol**:
687
+ 1. Create test data
688
+ 2. Apply forward transform (compress)
689
+ 3. **Immediately apply reverse** (decompress)
690
+ 4. **Verify original == result**
691
+ 5. Fix if not matching
692
+
693
+ ```bash
694
+ # Round-trip verification for compression
695
+ echo "original data" > /tmp/original.txt
696
+ python compress.py /tmp/original.txt /tmp/compressed.bin
697
+ python decompress.py /tmp/compressed.bin /tmp/recovered.txt
698
+ diff /tmp/original.txt /tmp/recovered.txt && echo "PASS" || echo "FAIL: round-trip broken"
699
+ ```
700
+
571
701
  ---
572
702
 
573
703
  ## ⚡ SESSION START PROTOCOL