universal-agent-memory 1.0.3 → 1.0.5

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.3",
3
+ "version": "1.0.5",
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,15 +1,27 @@
1
1
  <!--
2
- CLAUDE.md Universal Template - v10.3
2
+ CLAUDE.md Universal Template - v10.5
3
3
 
4
4
  CHANGES IN THIS VERSION:
5
+ - STRENGTHENED Pattern Router: Now requires explicit analysis block output
6
+ - STRENGTHENED Constraint Extraction: Mandatory checklist with verification
7
+ - STRENGTHENED Adversarial Thinking: Explicit attack vector enumeration
8
+ - All pattern activations now require printed confirmation blocks
9
+ - Pattern Router, Constraint Checklist, and Adversarial Analysis are MANDATORY outputs
10
+
11
+ PREVIOUS (v10.4):
12
+ - Added MANDATORY COMPLETION GATES section (3 gates must pass before "done")
13
+ - Gate 1: Output Existence Check (enforces P12)
14
+ - Gate 2: Constraint Compliance Check (enforces P17)
15
+ - Gate 3: Test Verification (enforces P13)
16
+ - Added PATTERN ROUTER as Critical Reminder #0 (auto-selects patterns)
17
+
18
+ PREVIOUS (v10.3):
5
19
  - Added 5 new generic patterns (16-20) from deep failure analysis
6
20
  - Pattern 16: Task-First Execution (TFE) - prevents analysis without output
7
21
  - Pattern 17: Constraint Extraction (CE) - catches format/structure requirements
8
22
  - Pattern 18: Multi-Tool Pipeline (MTP) - chains tools for complex tasks
9
23
  - Pattern 19: Enhanced Impossible Task Refusal (ITR+) - refuses impossible immediately
10
24
  - Pattern 20: Adversarial Thinking (AT) - attack mindset for bypass tasks
11
- - Enhanced CRITICAL REMINDERS with 5 new items (12-16)
12
- - Total patterns now: 20 (up from 15)
13
25
 
14
26
  PREVIOUS (v10.2):
15
27
  - Added 4 new generic patterns (12-15) from Terminal-Bench 2.0 analysis
@@ -1020,10 +1032,72 @@ gh run view <run-id>
1020
1032
 
1021
1033
  ---
1022
1034
 
1035
+ ## 🚦 COMPLETION GATES - MANDATORY
1036
+
1037
+ **CANNOT say "done" or "complete" until ALL gates pass. This is NOT optional.**
1038
+
1039
+ ### GATE 1: Output Existence Check
1040
+ ```bash
1041
+ # List ALL expected outputs from task description
1042
+ # Verify EACH file exists
1043
+ echo "=== GATE 1: OUTPUT EXISTENCE ==="
1044
+ for f in /app/expected_output.* /app/result.* /app/*.json; do
1045
+ [ -f "$f" ] && echo "✓ $f exists" || echo "✗ MISSING: $f"
1046
+ done
1047
+ # If ANY missing: CREATE IT NOW, then re-check
1048
+ ```
1049
+
1050
+ ### GATE 2: Constraint Compliance Check
1051
+ ```
1052
+ Extract ALL constraints from task description:
1053
+ ☐ File count constraint (e.g., "single file")
1054
+ ☐ Line count constraint (e.g., "exactly one line")
1055
+ ☐ Format constraint (e.g., "valid JSON")
1056
+ ☐ Size constraint (e.g., "under 5KB")
1057
+
1058
+ Verify EACH constraint is satisfied before proceeding.
1059
+ ```
1060
+
1061
+ ### GATE 3: Test Verification
1062
+ ```bash
1063
+ echo "=== GATE 3: TEST VERIFICATION ==="
1064
+ # Run available tests
1065
+ pytest /tests/ -v 2>&1 | tail -30
1066
+ # If < 100% pass: iterate (fix specific failure, re-run)
1067
+ # Reserve 20% of time for iteration
1068
+ ```
1069
+
1070
+ **HARD STOP RULE:**
1071
+ - If Gate 1 fails → CREATE missing files immediately
1072
+ - If Gate 2 fails → FIX constraint violations immediately
1073
+ - If Gate 3 fails → ITERATE until 100% or timeout
1074
+ - NEVER report "complete" with failing gates
1075
+
1076
+ ---
1077
+
1023
1078
  ## ⚠️ CRITICAL REMINDERS (READ LAST)
1024
1079
 
1025
1080
  **These reminders exploit recency bias - place at END for maximum compliance.**
1026
1081
 
1082
+ 0. **PATTERN ROUTER (MANDATORY FIRST STEP)**:
1083
+ BEFORE ANY work, you MUST print this analysis block:
1084
+ ```
1085
+ === PATTERN ROUTER ===
1086
+ Task: [one-line task summary]
1087
+ Classification: [file-creation | constraint-validation | adversarial | pipeline | impossible]
1088
+
1089
+ SELECTED PATTERNS:
1090
+ - P12 (OEV): [YES/NO] - Does task require creating files?
1091
+ - P17 (CE): [YES/NO] - Does task have "exactly/only/single/must be" constraints?
1092
+ - P20 (AT): [YES/NO] - Does task involve "bypass/break/exploit/filter"?
1093
+ - P11 (Pre-computed): [YES/NO] - Is this a known algorithm (crypto/chess/ML)?
1094
+ - P18 (MTP): [YES/NO] - Does task need multiple tools chained?
1095
+
1096
+ ACTIVE PATTERNS: [list only YES patterns]
1097
+ === END ROUTER ===
1098
+ ```
1099
+ DO NOT proceed without printing this block first.
1100
+
1027
1101
  1. **BACKUP FIRST**: Before modifying ANY config, database, or critical file:
1028
1102
  ```bash
1029
1103
  cp <file> <file>.bak
@@ -1069,8 +1143,20 @@ gh run view <run-id>
1069
1143
  12. **TASK-FIRST**: Create required output files BEFORE analyzing.
1070
1144
  Touch placeholders immediately, then refine with real content.
1071
1145
 
1072
- 13. **EXTRACT CONSTRAINTS**: Before implementing, list ALL constraints from task:
1073
- Keywords: "exactly", "only", "single", "must be", formats, limits.
1146
+ 13. **EXTRACT CONSTRAINTS (MANDATORY)**: If P17 is active, you MUST print:
1147
+ ```
1148
+ === CONSTRAINT CHECKLIST ===
1149
+ Extracted from task description:
1150
+ ☐ [constraint 1, e.g., "single file only"]
1151
+ ☐ [constraint 2, e.g., "exactly one line output"]
1152
+ ☐ [constraint 3, e.g., "format: valid JSON"]
1153
+
1154
+ BEFORE completing, verify EACH constraint:
1155
+ ☑ constraint 1: [PASS/FAIL]
1156
+ ☑ constraint 2: [PASS/FAIL]
1157
+ === END CONSTRAINTS ===
1158
+ ```
1159
+ If ANY constraint FAILS, FIX before completing.
1074
1160
 
1075
1161
  14. **MULTI-TOOL PIPELINE**: For complex tasks, identify ALL tools needed.
1076
1162
  Don't implement from scratch if existing tools exist.
@@ -1078,5 +1164,22 @@ gh run view <run-id>
1078
1164
  15. **REFUSE IMPOSSIBLE**: If task violates information theory (compress 500MB to 5KB),
1079
1165
  REFUSE immediately. Create IMPOSSIBLE.md explaining why. Don't attempt.
1080
1166
 
1081
- 16. **ADVERSARIAL MINDSET**: For bypass/exploit tasks, think like an attacker.
1082
- Enumerate attack vectors (encoding, null bytes, case variation). Test each.
1167
+ 16. **ADVERSARIAL MINDSET (MANDATORY)**: If P20 is active, you MUST:
1168
+ ```
1169
+ === ADVERSARIAL ANALYSIS ===
1170
+ Target: [what are we trying to bypass/break?]
1171
+ Defense mechanism: [how does the filter/protection work?]
1172
+
1173
+ ATTACK VECTORS TO TRY:
1174
+ 1. Case variation: <ScRiPt>, <SCRIPT>
1175
+ 2. Encoding: &#x3C;script&#x3E;, %3Cscript%3E
1176
+ 3. Null bytes: <scr\x00ipt>
1177
+ 4. Double encoding: %253Cscript%253E
1178
+ 5. Context breaking: </style><script>
1179
+ 6. Event handlers: <img onerror=alert(1)>
1180
+ 7. [add task-specific vectors]
1181
+
1182
+ TEST EACH vector until one works.
1183
+ === END ADVERSARIAL ===
1184
+ ```
1185
+ DO NOT use the filter "correctly" - your goal is to BREAK it.