antigravity-atomic-swarms 2.1.0 → 2.1.2

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.
Files changed (210) hide show
  1. package/.agent/checklists/00-solicitation/phase-0-ancestral-audit-checklist.md +128 -128
  2. package/.agent/checklists/00-solicitation/phase-1-vision-statement-checklist.md +89 -89
  3. package/.agent/checklists/00-solicitation/phase-1.5-vision-canvas-checklist.md +88 -88
  4. package/.agent/checklists/00-solicitation/phase-10-final-contract-checklist.md +76 -76
  5. package/.agent/checklists/00-solicitation/phase-10.5-definition-of-done-checklist.md +71 -71
  6. package/.agent/checklists/00-solicitation/phase-11-mirror-test-checklist.md +71 -71
  7. package/.agent/checklists/00-solicitation/phase-11.8-reflexion-checklist.md +69 -69
  8. package/.agent/checklists/00-solicitation/phase-12-handoff-checklist.md +92 -92
  9. package/.agent/checklists/00-solicitation/phase-2-hindsight-visioning-checklist.md +84 -84
  10. package/.agent/checklists/00-solicitation/phase-3-yagni-boundaries-checklist.md +77 -77
  11. package/.agent/checklists/00-solicitation/phase-4-system-architecture-checklist.md +83 -83
  12. package/.agent/checklists/00-solicitation/phase-5-day-in-life-checklist.md +71 -71
  13. package/.agent/checklists/00-solicitation/phase-6-knowledge-gap-checklist.md +62 -62
  14. package/.agent/checklists/00-solicitation/phase-7-pre-mortem-checklist.md +64 -64
  15. package/.agent/checklists/00-solicitation/phase-8-red-team-stack-checklist.md +67 -67
  16. package/.agent/checklists/00-solicitation/phase-9-ambiguity-hunter-checklist.md +63 -63
  17. package/.agent/checklists/00-solicitation/phase-9.5-consensus-jury-checklist.md +73 -73
  18. package/.agent/checklists/01-multi-arc-research/phase-0-ancestral-audit-checklist.md +69 -69
  19. package/.agent/checklists/01-multi-arc-research/phase-1-ultra-deep-research-checklist.md +83 -83
  20. package/.agent/checklists/01-multi-arc-research/phase-1.5-slopsquatting-checklist.md +78 -78
  21. package/.agent/checklists/01-multi-arc-research/phase-2-grand-unification-checklist.md +71 -71
  22. package/.agent/checklists/01-multi-arc-research/phase-3-mirror-test-checklist.md +72 -72
  23. package/.agent/checklists/01-multi-arc-research/phase-3.5-reflection-checklist.md +71 -71
  24. package/.agent/checklists/01-multi-arc-research/phase-3.7-context-compaction-checklist.md +63 -63
  25. package/.agent/checklists/01-multi-arc-research/phase-3.8-reflexion-checklist.md +65 -65
  26. package/.agent/checklists/01-multi-arc-research/phase-4-atomic-exit-checklist.md +89 -89
  27. package/.agent/checklists/02-sparc-specification/phase-0-ancestral-audit-checklist.md +69 -69
  28. package/.agent/checklists/02-sparc-specification/phase-1-job-hunt-checklist.md +70 -70
  29. package/.agent/checklists/02-sparc-specification/phase-2-user-stories-checklist.md +71 -71
  30. package/.agent/checklists/02-sparc-specification/phase-3-devils-advocate-checklist.md +68 -68
  31. package/.agent/checklists/02-sparc-specification/phase-3.5-reflection-checklist.md +72 -72
  32. package/.agent/checklists/02-sparc-specification/phase-4-adversarial-scot-checklist.md +70 -70
  33. package/.agent/checklists/02-sparc-specification/phase-4.5-security-threat-model-checklist.md +75 -75
  34. package/.agent/checklists/02-sparc-specification/phase-4.7-consensus-jury-checklist.md +68 -68
  35. package/.agent/checklists/02-sparc-specification/phase-5-functional-spec-checklist.md +68 -68
  36. package/.agent/checklists/02-sparc-specification/phase-5.5-producer-reviewer-checklist.md +73 -73
  37. package/.agent/checklists/02-sparc-specification/phase-5.5-spec-review-checklist.md +70 -70
  38. package/.agent/checklists/02-sparc-specification/phase-5.8-reflexion-checklist.md +61 -61
  39. package/.agent/checklists/02-sparc-specification/phase-6-pseudocode-checklist.md +65 -65
  40. package/.agent/checklists/02-sparc-specification/phase-7-gatekeeper-checklist.md +66 -66
  41. package/.agent/checklists/02-sparc-specification/phase-8-mirror-test-checklist.md +65 -65
  42. package/.agent/checklists/02-sparc-specification/phase-9-atomic-exit-checklist.md +86 -86
  43. package/.agent/checklists/03-london-tdd-builder/phase-0-ancestral-audit-checklist.md +67 -67
  44. package/.agent/checklists/03-london-tdd-builder/phase-0.6-package-audit-checklist.md +70 -70
  45. package/.agent/checklists/03-london-tdd-builder/phase-1-test-scaffolding-checklist.md +75 -75
  46. package/.agent/checklists/03-london-tdd-builder/phase-1.5-property-tests-checklist.md +65 -65
  47. package/.agent/checklists/03-london-tdd-builder/phase-2-implementation-checklist.md +67 -67
  48. package/.agent/checklists/03-london-tdd-builder/phase-2.5-code-review-checklist.md +67 -67
  49. package/.agent/checklists/03-london-tdd-builder/phase-3-tote-loop-checklist.md +73 -73
  50. package/.agent/checklists/03-london-tdd-builder/phase-3.5-visual-snapshot-checklist.md +66 -66
  51. package/.agent/checklists/03-london-tdd-builder/phase-4-recursive-tdd-checklist.md +69 -69
  52. package/.agent/checklists/03-london-tdd-builder/phase-5-mirror-test-checklist.md +65 -65
  53. package/.agent/checklists/03-london-tdd-builder/phase-5.5-slop-detector-checklist.md +73 -73
  54. package/.agent/checklists/03-london-tdd-builder/phase-5.7-context-compaction-checklist.md +56 -56
  55. package/.agent/checklists/03-london-tdd-builder/phase-5.8-reflexion-checklist.md +60 -60
  56. package/.agent/checklists/03-london-tdd-builder/phase-6-atomic-exit-checklist.md +86 -86
  57. package/.agent/checklists/04-bmo-triangulation/phase-0-ancestral-audit-checklist.md +66 -66
  58. package/.agent/checklists/04-bmo-triangulation/phase-1-behavior-verification-checklist.md +69 -69
  59. package/.agent/checklists/04-bmo-triangulation/phase-2-reverse-modeling-checklist.md +72 -72
  60. package/.agent/checklists/04-bmo-triangulation/phase-3-chaos-engineering-checklist.md +69 -69
  61. package/.agent/checklists/04-bmo-triangulation/phase-4-triangulation-checklist.md +73 -73
  62. package/.agent/checklists/04-bmo-triangulation/phase-4.5-librarian-checklist.md +62 -62
  63. package/.agent/checklists/04-bmo-triangulation/phase-4.7-mirror-test-checklist.md +67 -67
  64. package/.agent/checklists/04-bmo-triangulation/phase-4.8-reflexion-checklist.md +60 -60
  65. package/.agent/checklists/04-bmo-triangulation/phase-5-self-evolution-checklist.md +70 -70
  66. package/.agent/checklists/04-bmo-triangulation/phase-6-atomic-exit-checklist.md +81 -81
  67. package/.agent/checklists/05-refinement/phase-0-ancestral-audit-checklist.md +61 -61
  68. package/.agent/checklists/05-refinement/phase-1-failure-analysis-checklist.md +72 -72
  69. package/.agent/checklists/05-refinement/phase-2-code-surgery-checklist.md +64 -64
  70. package/.agent/checklists/05-refinement/phase-3-reverification-checklist.md +63 -63
  71. package/.agent/checklists/05-refinement/phase-4-mirror-test-checklist.md +61 -61
  72. package/.agent/checklists/05-refinement/phase-4.5-anti-pattern-checklist.md +63 -63
  73. package/.agent/checklists/05-refinement/phase-5-sentinel-loop-checklist.md +57 -57
  74. package/.agent/checklists/05-refinement/phase-5.8-reflexion-checklist.md +60 -60
  75. package/.agent/checklists/05-refinement/phase-6-exit-checklist.md +81 -81
  76. package/.agent/rules/00-solicitation/global-laws.md +93 -93
  77. package/.agent/rules/00-solicitation/phase--0.6-constitutional-compliance.md +50 -50
  78. package/.agent/rules/00-solicitation/phase--1-session-entry.md +89 -89
  79. package/.agent/rules/00-solicitation/phase-0-ancestral-audit.md +96 -91
  80. package/.agent/rules/00-solicitation/phase-0.5-meta-strategy.md +54 -54
  81. package/.agent/rules/00-solicitation/phase-1-vision-statement.md +43 -43
  82. package/.agent/rules/00-solicitation/phase-1.5-vision-canvas.md +70 -70
  83. package/.agent/rules/00-solicitation/phase-10-final-contract.md +53 -53
  84. package/.agent/rules/00-solicitation/phase-10.5-definition-of-done.md +59 -59
  85. package/.agent/rules/00-solicitation/phase-11-mirror-test.md +46 -46
  86. package/.agent/rules/00-solicitation/phase-11.8-reflexion.md +48 -48
  87. package/.agent/rules/00-solicitation/phase-12-handoff.md +70 -70
  88. package/.agent/rules/00-solicitation/phase-2-hindsight-visioning.md +46 -46
  89. package/.agent/rules/00-solicitation/phase-3-yagni-boundaries.md +43 -43
  90. package/.agent/rules/00-solicitation/phase-4-system-architecture.md +51 -51
  91. package/.agent/rules/00-solicitation/phase-4.5-persona-roundtable.md +51 -51
  92. package/.agent/rules/00-solicitation/phase-5-day-in-life.md +40 -40
  93. package/.agent/rules/00-solicitation/phase-6-knowledge-gap.md +38 -38
  94. package/.agent/rules/00-solicitation/phase-7-pre-mortem.md +37 -37
  95. package/.agent/rules/00-solicitation/phase-8-red-team-stack.md +40 -40
  96. package/.agent/rules/00-solicitation/phase-9-ambiguity-hunter.md +39 -39
  97. package/.agent/rules/00-solicitation/phase-9.5-consensus-jury.md +49 -49
  98. package/.agent/rules/01-multi-arc-research/global-laws.md +89 -89
  99. package/.agent/rules/01-multi-arc-research/phase--0.6-constitutional-compliance.md +50 -50
  100. package/.agent/rules/01-multi-arc-research/phase--1-session-entry.md +89 -89
  101. package/.agent/rules/01-multi-arc-research/phase-0-ancestral-audit.md +44 -44
  102. package/.agent/rules/01-multi-arc-research/phase-0.5-meta-strategy.md +56 -56
  103. package/.agent/rules/01-multi-arc-research/phase-1-ultra-deep-research.md +118 -118
  104. package/.agent/rules/01-multi-arc-research/phase-1.5-slopsquatting.md +68 -68
  105. package/.agent/rules/01-multi-arc-research/phase-2-grand-unification.md +47 -47
  106. package/.agent/rules/01-multi-arc-research/phase-3-mirror-test.md +49 -49
  107. package/.agent/rules/01-multi-arc-research/phase-3.5-reflection.md +57 -57
  108. package/.agent/rules/01-multi-arc-research/phase-3.7-context-compaction.md +40 -40
  109. package/.agent/rules/01-multi-arc-research/phase-3.8-reflexion.md +48 -48
  110. package/.agent/rules/01-multi-arc-research/phase-4-atomic-exit.md +71 -71
  111. package/.agent/rules/02-sparc-specification/global-laws.md +92 -92
  112. package/.agent/rules/02-sparc-specification/phase--0.6-constitutional-compliance.md +50 -50
  113. package/.agent/rules/02-sparc-specification/phase--1-session-entry.md +89 -89
  114. package/.agent/rules/02-sparc-specification/phase-0-ancestral-audit.md +44 -44
  115. package/.agent/rules/02-sparc-specification/phase-0.5-meta-strategy.md +54 -54
  116. package/.agent/rules/02-sparc-specification/phase-1-job-hunt.md +46 -46
  117. package/.agent/rules/02-sparc-specification/phase-2-user-stories.md +48 -48
  118. package/.agent/rules/02-sparc-specification/phase-3-devils-advocate.md +46 -46
  119. package/.agent/rules/02-sparc-specification/phase-3.5-reflection.md +57 -57
  120. package/.agent/rules/02-sparc-specification/phase-4-adversarial-scot.md +45 -45
  121. package/.agent/rules/02-sparc-specification/phase-4.5-security-threat-model.md +69 -69
  122. package/.agent/rules/02-sparc-specification/phase-4.7-consensus-jury.md +49 -49
  123. package/.agent/rules/02-sparc-specification/phase-5-functional-spec.md +44 -44
  124. package/.agent/rules/02-sparc-specification/phase-5.5-producer-reviewer.md +55 -55
  125. package/.agent/rules/02-sparc-specification/phase-5.5-spec-review.md +64 -64
  126. package/.agent/rules/02-sparc-specification/phase-5.8-reflexion.md +48 -48
  127. package/.agent/rules/02-sparc-specification/phase-6-pseudocode.md +44 -44
  128. package/.agent/rules/02-sparc-specification/phase-7-gatekeeper.md +48 -48
  129. package/.agent/rules/02-sparc-specification/phase-8-mirror-test.md +45 -45
  130. package/.agent/rules/02-sparc-specification/phase-9-atomic-exit.md +71 -71
  131. package/.agent/rules/03-london-tdd-builder/global-laws.md +120 -120
  132. package/.agent/rules/03-london-tdd-builder/phase--0.6-constitutional-compliance.md +50 -50
  133. package/.agent/rules/03-london-tdd-builder/phase--1-session-entry.md +89 -89
  134. package/.agent/rules/03-london-tdd-builder/phase-0-ancestral-audit.md +45 -45
  135. package/.agent/rules/03-london-tdd-builder/phase-0.5-meta-strategy.md +56 -56
  136. package/.agent/rules/03-london-tdd-builder/phase-0.6-package-audit.md +43 -43
  137. package/.agent/rules/03-london-tdd-builder/phase-1-test-scaffolding.md +66 -66
  138. package/.agent/rules/03-london-tdd-builder/phase-1.5-property-tests.md +60 -60
  139. package/.agent/rules/03-london-tdd-builder/phase-2-implementation.md +49 -49
  140. package/.agent/rules/03-london-tdd-builder/phase-2.5-code-review.md +46 -46
  141. package/.agent/rules/03-london-tdd-builder/phase-3-tote-loop.md +47 -47
  142. package/.agent/rules/03-london-tdd-builder/phase-3.5-visual-snapshot.md +47 -47
  143. package/.agent/rules/03-london-tdd-builder/phase-4-recursive-tdd.md +43 -43
  144. package/.agent/rules/03-london-tdd-builder/phase-5-mirror-test.md +46 -46
  145. package/.agent/rules/03-london-tdd-builder/phase-5.5-slop-detector.md +57 -57
  146. package/.agent/rules/03-london-tdd-builder/phase-5.7-context-compaction.md +37 -37
  147. package/.agent/rules/03-london-tdd-builder/phase-5.8-reflexion.md +48 -48
  148. package/.agent/rules/03-london-tdd-builder/phase-6-atomic-exit.md +71 -71
  149. package/.agent/rules/04-bmo-triangulation/global-laws.md +89 -89
  150. package/.agent/rules/04-bmo-triangulation/phase--0.6-constitutional-compliance.md +50 -50
  151. package/.agent/rules/04-bmo-triangulation/phase--1-session-entry.md +89 -89
  152. package/.agent/rules/04-bmo-triangulation/phase-0-ancestral-audit.md +43 -43
  153. package/.agent/rules/04-bmo-triangulation/phase-0.5-meta-strategy.md +54 -54
  154. package/.agent/rules/04-bmo-triangulation/phase-1-behavior-verification.md +42 -42
  155. package/.agent/rules/04-bmo-triangulation/phase-2-reverse-modeling.md +50 -50
  156. package/.agent/rules/04-bmo-triangulation/phase-3-chaos-engineering.md +47 -47
  157. package/.agent/rules/04-bmo-triangulation/phase-4-triangulation.md +46 -46
  158. package/.agent/rules/04-bmo-triangulation/phase-4.5-librarian.md +40 -40
  159. package/.agent/rules/04-bmo-triangulation/phase-4.7-mirror-test.md +45 -45
  160. package/.agent/rules/04-bmo-triangulation/phase-4.8-reflexion.md +48 -48
  161. package/.agent/rules/04-bmo-triangulation/phase-5-self-evolution.md +57 -57
  162. package/.agent/rules/04-bmo-triangulation/phase-6-atomic-exit.md +78 -78
  163. package/.agent/rules/05-refinement/global-laws.md +126 -126
  164. package/.agent/rules/05-refinement/phase--0.6-constitutional-compliance.md +50 -50
  165. package/.agent/rules/05-refinement/phase--1-session-entry.md +89 -89
  166. package/.agent/rules/05-refinement/phase-0-ancestral-audit.md +39 -39
  167. package/.agent/rules/05-refinement/phase-0.5-meta-strategy.md +54 -54
  168. package/.agent/rules/05-refinement/phase-1-failure-analysis.md +53 -53
  169. package/.agent/rules/05-refinement/phase-2-code-surgery.md +41 -41
  170. package/.agent/rules/05-refinement/phase-3-reverification.md +41 -41
  171. package/.agent/rules/05-refinement/phase-4-mirror-test.md +41 -41
  172. package/.agent/rules/05-refinement/phase-4.5-anti-pattern.md +57 -57
  173. package/.agent/rules/05-refinement/phase-5-sentinel-loop.md +38 -38
  174. package/.agent/rules/05-refinement/phase-5.8-reflexion.md +48 -48
  175. package/.agent/rules/05-refinement/phase-6-exit.md +71 -71
  176. package/.agent/rules/EVOLUTION_PROTOCOL.md +67 -67
  177. package/.agent/rules/step1-solicitation.md +124 -133
  178. package/.agent/rules/step2-multi-arc-research.md +88 -88
  179. package/.agent/rules/step3-sparc-specification.md +118 -118
  180. package/.agent/rules/step4-london-tdd-builder.md +109 -109
  181. package/.agent/rules/step5-bmo-triangulation.md +98 -98
  182. package/.agent/rules/step6-refinement.md +89 -89
  183. package/.github/workflows/npm-publish.yml +40 -19
  184. package/README.md +244 -244
  185. package/archived/00_solicitation_rules.md +25 -25
  186. package/archived/01_research_rules.md +32 -32
  187. package/archived/02_spec_rules.md +38 -38
  188. package/archived/03_builder_rules.md +40 -40
  189. package/archived/04_bmo_rules.md +29 -29
  190. package/archived/05_refinement_rules.md +27 -27
  191. package/archived/global_laws.md +60 -60
  192. package/bin/cli.js +50 -50
  193. package/memory/APPROVAL_LOG.md +14 -14
  194. package/memory/CONSTITUTION.md +15 -15
  195. package/memory/CONTEXT_BUDGET.md +8 -8
  196. package/memory/CONTEXT_INDEX.md +18 -18
  197. package/memory/EPISODIC_MEMORY.md +18 -18
  198. package/memory/EVOLUTION_LOG.md +8 -8
  199. package/memory/HEALTH_DASHBOARD.md +24 -24
  200. package/memory/KNOWLEDGE_BASE.md +19 -19
  201. package/memory/MEMORY_STREAM.md +24 -24
  202. package/memory/PERFORMANCE_LOG.md +18 -18
  203. package/memory/PROJECT_STATE.md +67 -67
  204. package/memory/SESSION_HANDOFF.md +12 -12
  205. package/memory/TELEMETRY_CONFIG.md +31 -31
  206. package/memory/failure_log.md +8 -8
  207. package/memory/openspec/project.md +15 -15
  208. package/memory/schemas/handoff_schema.json +28 -28
  209. package/memory/schemas/tool_registry.md +45 -45
  210. package/package.json +24 -20
@@ -1,92 +1,92 @@
1
- # Global Laws: 02-SPARC-Specification
2
-
3
- > **Applies To**: ALL phases in 02-SPARC-Specification workflow
4
- > **Enforcement**: MANDATORY - violations are critical failures
5
-
6
- ## 🛑 SYSTEM OVERRIDE: CRITICAL GLOBAL LAWS
7
-
8
- ### Law 1: The "No Silent Failures" Law
9
- **Rule**: NEVER write empty catch blocks. If a tool fails, STOP.
10
- **Enforcement**: Check every `try/catch`. If `catch(e) {}` exists -> REJECT.
11
-
12
- ### Law 2: The "Clean Floor" Law
13
- **Rule**: Delete all temp files (`debug.json`, etc) before exiting.
14
- **Enforcement**: Use `Remove-Item` or `fs.unlink` on any temp artifact.
15
-
16
- ### Law 3: The "Double-Tap" Law
17
- **Rule**: Verify EVERY file write by reading it back. Do not assume success.
18
- **Enforcement**: Call `view_file` immediately after `write_to_file`.
19
-
20
- ### Law 4: The "Think-Tree" Law
21
- **Rule**: Before complex actions, visualize 3 paths. Choose the best.
22
- **Enforcement**: Use SCoT blocks (Law 5) for this visualization.
23
-
24
- ### Law 5: The "SCoT Protocol" Law
25
- **Rule**: Before ANY decision with >1 viable path, you MUST output a `<scot>` block. Decisions without documented reasoning are invalid.
26
- **Enforcement**:
27
- ```markdown
28
- <scot>
29
- **📍 SITUATION**: ...
30
- **🎯 GOAL**: ...
31
- **🔀 OPTIONS**: ...
32
- **🧪 ANALYSIS**: ...
33
- **✅ DECISION**: ...
34
- </scot>
35
- ```
36
-
37
- ### Law 6: The "Confidence Declaration" Law
38
- **Rule**: Every major decision MUST include a Confidence Score (0-100%) and Basis.
39
- **Enforcement**: Output CONFIDENCE: [Score]% and BASIS: [Reasoning] with every decision.
40
-
41
- ### Law 7: The "Tool Validation" Law
42
- **Rule**: Before ANY tool invocation, verify schema in `memory/schemas/tool_registry.md`.
43
- **Enforcement**: Log intent and schema validation status.
44
-
45
- ### Law 8: The "Escalation Protocol" Law
46
- **Rule**: If a decision triggers a T1, T2, or T3 event (see KNOWLEDGE_BASE/Escalation), you **MUST** pause and request human approval.
47
- **Enforcement**: Check `APPROVAL_LOG.md` before proceeding. If blocked, use `notify_user`.
48
-
49
- ### Law 12: The "Autonomy Protocol" Law
50
- **Rule**: Adhere to `PROJECT_STATE.Config.Autonomy`.
51
- - **Manual**: Stop & Ask before EVERY file write/command. (User acts as Human-in-the-Loop).
52
- - **Semi-Guided**: Stop & Ask for Architectural Decisions (SCoT) or Critical Law warnings. Auto-proceed for routine.
53
- - **Fully Auto**: Auto-proceed unless AGI-level danger. Auto-Push.
54
- **Enforcement**: Check `PROJECT_STATE.md` at start of session.
55
-
56
- ### Law 13: The "Evolution Imperative" Law
57
- **Rule**: If a tool fails 3+ times OR you identify a recurring anti-pattern, you **MUST** trigger the Evolution Protocol.
58
- **Enforcement**:
59
- 1. Log to `memory/failure_log.md`.
60
- 2. Check `PROJECT_STATE.EvolutionMode`.
61
- - **Off**: Do nothing.
62
- - **Semi/Full**: Consult `.agent/rules/EVOLUTION_PROTOCOL.md` to propose/execute a rule update.
63
-
64
- ---
65
-
66
- ## System Constraints (Specific to Specification)
67
-
68
- ### 1. The "Failure First" Ratio
69
- Happy Paths are easy. For every **1 Success Scenario**, you MUST define at least **3 Failure Scenarios** (e.g., "Card Declined", "Network Timeout"). Specs with only Happy Paths are **rejected**.
70
-
71
- ### 2. The "Type Truth" Protocol
72
- Data structures must be defined in **TypeScript Interfaces**, not English. Don't say "list of users". Say: `Promise<Array<{id: string}>>`.
73
-
74
- ### 3. The "Ambiguity Assassin"
75
- Bounds must be numeric. Define **Limits** for every input: Min/Max Length, Allowed Characters (Regex), Max File Size, Timeout Duration.
76
-
77
- ### 4. The "Zombie State" Check
78
- Every state transition must have a defined **Reset/Exit** or **Error** state. If "Loading", define how to exit if the network dies.
79
-
80
- ### 5. The "Security Mirror"
81
- Every Endpoint/Function spec must have a "Security Implications" section: "Auth Required?", "Input Sanitized?", "Rate Limited?", "PII Leaked?".
82
-
83
- ---
84
-
85
- ## Violations & Consequences
86
- | Violation | Severity | Action |
87
- |-----------|----------|--------|
88
- | Missing Failures | HIGH | Reject Spec, Restart Phase 2 |
89
- | English Types | MEDIUM | Refactor to TS |
90
- | Missing SCoT | HIGH | Re-evaluate decision |
91
- | Tool Misuse | CRITICAL | Stop execution, Check Schema |
92
- | Unauthorized Escalation | CRITICAL | Rollback, Request Approval |
1
+ # Global Laws: 02-SPARC-Specification
2
+
3
+ > **Applies To**: ALL phases in 02-SPARC-Specification workflow
4
+ > **Enforcement**: MANDATORY - violations are critical failures
5
+
6
+ ## 🛑 SYSTEM OVERRIDE: CRITICAL GLOBAL LAWS
7
+
8
+ ### Law 1: The "No Silent Failures" Law
9
+ **Rule**: NEVER write empty catch blocks. If a tool fails, STOP.
10
+ **Enforcement**: Check every `try/catch`. If `catch(e) {}` exists -> REJECT.
11
+
12
+ ### Law 2: The "Clean Floor" Law
13
+ **Rule**: Delete all temp files (`debug.json`, etc) before exiting.
14
+ **Enforcement**: Use `Remove-Item` or `fs.unlink` on any temp artifact.
15
+
16
+ ### Law 3: The "Double-Tap" Law
17
+ **Rule**: Verify EVERY file write by reading it back. Do not assume success.
18
+ **Enforcement**: Call `view_file` immediately after `write_to_file`.
19
+
20
+ ### Law 4: The "Think-Tree" Law
21
+ **Rule**: Before complex actions, visualize 3 paths. Choose the best.
22
+ **Enforcement**: Use SCoT blocks (Law 5) for this visualization.
23
+
24
+ ### Law 5: The "SCoT Protocol" Law
25
+ **Rule**: Before ANY decision with >1 viable path, you MUST output a `<scot>` block. Decisions without documented reasoning are invalid.
26
+ **Enforcement**:
27
+ ```markdown
28
+ <scot>
29
+ **📍 SITUATION**: ...
30
+ **🎯 GOAL**: ...
31
+ **🔀 OPTIONS**: ...
32
+ **🧪 ANALYSIS**: ...
33
+ **✅ DECISION**: ...
34
+ </scot>
35
+ ```
36
+
37
+ ### Law 6: The "Confidence Declaration" Law
38
+ **Rule**: Every major decision MUST include a Confidence Score (0-100%) and Basis.
39
+ **Enforcement**: Output CONFIDENCE: [Score]% and BASIS: [Reasoning] with every decision.
40
+
41
+ ### Law 7: The "Tool Validation" Law
42
+ **Rule**: Before ANY tool invocation, verify schema in `memory/schemas/tool_registry.md`.
43
+ **Enforcement**: Log intent and schema validation status.
44
+
45
+ ### Law 8: The "Escalation Protocol" Law
46
+ **Rule**: If a decision triggers a T1, T2, or T3 event (see KNOWLEDGE_BASE/Escalation), you **MUST** pause and request human approval.
47
+ **Enforcement**: Check `APPROVAL_LOG.md` before proceeding. If blocked, use `notify_user`.
48
+
49
+ ### Law 12: The "Autonomy Protocol" Law
50
+ **Rule**: Adhere to `PROJECT_STATE.Config.Autonomy`.
51
+ - **Manual**: Stop & Ask before EVERY file write/command. (User acts as Human-in-the-Loop).
52
+ - **Semi-Guided**: Stop & Ask for Architectural Decisions (SCoT) or Critical Law warnings. Auto-proceed for routine.
53
+ - **Fully Auto**: Auto-proceed unless AGI-level danger. Auto-Push.
54
+ **Enforcement**: Check `PROJECT_STATE.md` at start of session.
55
+
56
+ ### Law 13: The "Evolution Imperative" Law
57
+ **Rule**: If a tool fails 3+ times OR you identify a recurring anti-pattern, you **MUST** trigger the Evolution Protocol.
58
+ **Enforcement**:
59
+ 1. Log to `memory/failure_log.md`.
60
+ 2. Check `PROJECT_STATE.EvolutionMode`.
61
+ - **Off**: Do nothing.
62
+ - **Semi/Full**: Consult `.agent/rules/EVOLUTION_PROTOCOL.md` to propose/execute a rule update.
63
+
64
+ ---
65
+
66
+ ## System Constraints (Specific to Specification)
67
+
68
+ ### 1. The "Failure First" Ratio
69
+ Happy Paths are easy. For every **1 Success Scenario**, you MUST define at least **3 Failure Scenarios** (e.g., "Card Declined", "Network Timeout"). Specs with only Happy Paths are **rejected**.
70
+
71
+ ### 2. The "Type Truth" Protocol
72
+ Data structures must be defined in **TypeScript Interfaces**, not English. Don't say "list of users". Say: `Promise<Array<{id: string}>>`.
73
+
74
+ ### 3. The "Ambiguity Assassin"
75
+ Bounds must be numeric. Define **Limits** for every input: Min/Max Length, Allowed Characters (Regex), Max File Size, Timeout Duration.
76
+
77
+ ### 4. The "Zombie State" Check
78
+ Every state transition must have a defined **Reset/Exit** or **Error** state. If "Loading", define how to exit if the network dies.
79
+
80
+ ### 5. The "Security Mirror"
81
+ Every Endpoint/Function spec must have a "Security Implications" section: "Auth Required?", "Input Sanitized?", "Rate Limited?", "PII Leaked?".
82
+
83
+ ---
84
+
85
+ ## Violations & Consequences
86
+ | Violation | Severity | Action |
87
+ |-----------|----------|--------|
88
+ | Missing Failures | HIGH | Reject Spec, Restart Phase 2 |
89
+ | English Types | MEDIUM | Refactor to TS |
90
+ | Missing SCoT | HIGH | Re-evaluate decision |
91
+ | Tool Misuse | CRITICAL | Stop execution, Check Schema |
92
+ | Unauthorized Escalation | CRITICAL | Rollback, Request Approval |
@@ -1,50 +1,50 @@
1
- # Phase -0.6: Constitutional Compliance Check
2
-
3
- > **Parent Workflow**: 02-SPARC-Specification
4
- > **Phase Number**: -0.6
5
- > **Objective**: Ensure alignment with supreme laws before execution.
6
-
7
- ---
8
-
9
- ## Prerequisites
10
- **MUST be completed before this phase**:
11
- - ✅ None (First Phase)
12
-
13
- **MUST have access to**:
14
- - `memory/CONSTITUTION.md`
15
-
16
- ---
17
-
18
- ## Instructions
19
-
20
- ### Step 1: Read Constitution
21
- **Action**: Load the Constitution file.
22
- **Exact Prompt**:
23
- ```
24
- > 📖 READ AND EXECUTE: `memory/CONSTITUTION.md`
25
- ```
26
-
27
- ### Step 2: Self-Audit
28
- **Action**: Ask yourself:
29
- 1. "Does my intended next action violate any Article?"
30
- 2. "Am I currently in a loop state (Breaker 2.1)?"
31
-
32
- ### Step 3: Circuit Breaker Logic
33
- **Action**: Evaluate safety.
34
- - **If Violation**:
35
- - STOP immediately.
36
- - Log to `failure_log.md`: "COMBAT BREAKER TRIPPED: [Article]"
37
- - Emergency Exit to Notify User.
38
- - **If Safe**: Proceed to Phase -0.5 (or next available phase).
39
-
40
- ---
41
-
42
- ## Exit Criteria
43
- **This phase is complete when ALL of the following are true**:
44
- - ✅ Constitution has been read.
45
- - ✅ Self-Audit confirmed no violations.
46
-
47
- ---
48
-
49
- ## Related Phases
50
- **Next Phase**: Phase 0: The Ancestral Audit
1
+ # Phase -0.6: Constitutional Compliance Check
2
+
3
+ > **Parent Workflow**: 02-SPARC-Specification
4
+ > **Phase Number**: -0.6
5
+ > **Objective**: Ensure alignment with supreme laws before execution.
6
+
7
+ ---
8
+
9
+ ## Prerequisites
10
+ **MUST be completed before this phase**:
11
+ - ✅ None (First Phase)
12
+
13
+ **MUST have access to**:
14
+ - `memory/CONSTITUTION.md`
15
+
16
+ ---
17
+
18
+ ## Instructions
19
+
20
+ ### Step 1: Read Constitution
21
+ **Action**: Load the Constitution file.
22
+ **Exact Prompt**:
23
+ ```
24
+ > 📖 READ AND EXECUTE: `memory/CONSTITUTION.md`
25
+ ```
26
+
27
+ ### Step 2: Self-Audit
28
+ **Action**: Ask yourself:
29
+ 1. "Does my intended next action violate any Article?"
30
+ 2. "Am I currently in a loop state (Breaker 2.1)?"
31
+
32
+ ### Step 3: Circuit Breaker Logic
33
+ **Action**: Evaluate safety.
34
+ - **If Violation**:
35
+ - STOP immediately.
36
+ - Log to `failure_log.md`: "COMBAT BREAKER TRIPPED: [Article]"
37
+ - Emergency Exit to Notify User.
38
+ - **If Safe**: Proceed to Phase -0.5 (or next available phase).
39
+
40
+ ---
41
+
42
+ ## Exit Criteria
43
+ **This phase is complete when ALL of the following are true**:
44
+ - ✅ Constitution has been read.
45
+ - ✅ Self-Audit confirmed no violations.
46
+
47
+ ---
48
+
49
+ ## Related Phases
50
+ **Next Phase**: Phase 0: The Ancestral Audit
@@ -1,89 +1,89 @@
1
- # Phase -1: Session Entry Protocol (MANDATORY - CANNOT BE SKIPPED)
2
-
3
- > **Parent Workflow**: 02-SPARC-Specification
4
- > **Phase Number**: -1
5
- > **Objective**: Establish perfect situational awareness and apply lessons learned.
6
-
7
- ---
8
-
9
- ## Prerequisites
10
- **MUST be completed before this phase**:
11
- - [x] None (First Phase)
12
-
13
- **MUST have access to**:
14
- - `memory/PROJECT_STATE.md`
15
- - `memory/SESSION_HANDOFF.md`
16
- - `memory/EPISODIC_MEMORY.md`
17
- - `memory/failure_log.md`
18
- - `memory/KNOWLEDGE_BASE.md`
19
-
20
- ---
21
-
22
- ## Instructions
23
-
24
- ### Step 1: Full Context Absorption (State Awareness)
25
- **Action**: Read ALL of the following files in order:
26
- 1. `memory/PROJECT_STATE.md` (canonical truth)
27
- 2. `memory/SESSION_HANDOFF.md` (previous session's exit state)
28
- 3. `memory/failure_log.md` (historical lessons)
29
- 4. `memory/KNOWLEDGE_BASE.md` (patterns and anti-patterns)
30
- 5. `memory/MEMORY_STREAM.md` (volatile context)
31
-
32
- ### Step 2: State Awareness Report
33
- **Action**: Output the following report to the User (ALWAYS visible, cannot be suppressed):
34
-
35
- ```
36
- +----------------------------------- STATE AWARENESS REPORT -----------------------------------+
37
- | PROJECT: [Name from PROJECT_STATE] |
38
- | LAST WORKFLOW: [Workflow that last touched PROJECT_STATE] |
39
- | CURRENT PHASE: [Exact status e.g., "(R) Researching"] |
40
- | FEATURE IN FOCUS: [Which feature is currently being worked] |
41
- | |
42
- | COMPLETED PHASES: |
43
- | [x] 00-Solicitation: [Date] - [Summary] |
44
- | [x] 01-Research: [Date] - [Summary] |
45
- | [.] 02-Specification: IN PROGRESS |
46
- | |
47
- | PENDING ACTIONS: |
48
- | 1. [Exact next action from last workflow exit] |
49
- | |
50
- | LEARNED CONSTRAINTS (from failure_log): |
51
- | (!) [Rule 1 from ancestral lessons] |
52
- | (!) [Rule 2 from ancestral lessons] |
53
- +----------------------------------------------------------------------------------------------+
54
- ```
55
-
56
- ### Step 3: Episodic Memory Injection (Reflexion Pattern)
57
- **Action**:
58
- 1. **Episode Search**: Scan `memory/EPISODIC_MEMORY.md` for matching episodes.
59
- 2. **Pattern Match**:
60
- - If match found: Load `Lesson Learned` and increment `Reference Count`. Log: "(Ref) Applying lesson from [EPI-XXX]: [Lesson]".
61
- - If no match: Proceed.
62
- 3. **Session Episode Creation**: Create draft episode for this session.
63
-
64
- ### Step 4: User Verification Gate
65
- **Action**: Ask: "I have absorbed all context. Does this summary match your understanding?"
66
- - **Fully Auto**: Proceed after 2s pause.
67
- - **Semi/Manual**: Wait for explicit "Yes".
68
-
69
- ### Step 5: Memory Decay Check
70
- **Action**: Once per session, scan for episodes > 30 days old with Reference Count < 3. Move to `memory/archive/`.
71
-
72
- ---
73
-
74
-
75
-
76
- ### Step 0.5: Health Check
77
- **Action**: Read memory/HEALTH_DASHBOARD.md.
78
- **Action**: Note any CRITICAL issues before proceeding.
79
-
80
- ## Exit Criteria
81
- **This phase is complete when ALL of the following are true**:
82
- - [x] State Awareness Report displayed.
83
- - [x] Relevant episodic memory loaded.
84
- - [x] User (or timer) approved proceeds.
85
-
86
- ---
87
-
88
- ## Related Phases
89
- **Next Phase**: Phase -0.6: Constitutional Compliance Check
1
+ # Phase -1: Session Entry Protocol (MANDATORY - CANNOT BE SKIPPED)
2
+
3
+ > **Parent Workflow**: 02-SPARC-Specification
4
+ > **Phase Number**: -1
5
+ > **Objective**: Establish perfect situational awareness and apply lessons learned.
6
+
7
+ ---
8
+
9
+ ## Prerequisites
10
+ **MUST be completed before this phase**:
11
+ - [x] None (First Phase)
12
+
13
+ **MUST have access to**:
14
+ - `memory/PROJECT_STATE.md`
15
+ - `memory/SESSION_HANDOFF.md`
16
+ - `memory/EPISODIC_MEMORY.md`
17
+ - `memory/failure_log.md`
18
+ - `memory/KNOWLEDGE_BASE.md`
19
+
20
+ ---
21
+
22
+ ## Instructions
23
+
24
+ ### Step 1: Full Context Absorption (State Awareness)
25
+ **Action**: Read ALL of the following files in order:
26
+ 1. `memory/PROJECT_STATE.md` (canonical truth)
27
+ 2. `memory/SESSION_HANDOFF.md` (previous session's exit state)
28
+ 3. `memory/failure_log.md` (historical lessons)
29
+ 4. `memory/KNOWLEDGE_BASE.md` (patterns and anti-patterns)
30
+ 5. `memory/MEMORY_STREAM.md` (volatile context)
31
+
32
+ ### Step 2: State Awareness Report
33
+ **Action**: Output the following report to the User (ALWAYS visible, cannot be suppressed):
34
+
35
+ ```
36
+ +----------------------------------- STATE AWARENESS REPORT -----------------------------------+
37
+ | PROJECT: [Name from PROJECT_STATE] |
38
+ | LAST WORKFLOW: [Workflow that last touched PROJECT_STATE] |
39
+ | CURRENT PHASE: [Exact status e.g., "(R) Researching"] |
40
+ | FEATURE IN FOCUS: [Which feature is currently being worked] |
41
+ | |
42
+ | COMPLETED PHASES: |
43
+ | [x] 00-Solicitation: [Date] - [Summary] |
44
+ | [x] 01-Research: [Date] - [Summary] |
45
+ | [.] 02-Specification: IN PROGRESS |
46
+ | |
47
+ | PENDING ACTIONS: |
48
+ | 1. [Exact next action from last workflow exit] |
49
+ | |
50
+ | LEARNED CONSTRAINTS (from failure_log): |
51
+ | (!) [Rule 1 from ancestral lessons] |
52
+ | (!) [Rule 2 from ancestral lessons] |
53
+ +----------------------------------------------------------------------------------------------+
54
+ ```
55
+
56
+ ### Step 3: Episodic Memory Injection (Reflexion Pattern)
57
+ **Action**:
58
+ 1. **Episode Search**: Scan `memory/EPISODIC_MEMORY.md` for matching episodes.
59
+ 2. **Pattern Match**:
60
+ - If match found: Load `Lesson Learned` and increment `Reference Count`. Log: "(Ref) Applying lesson from [EPI-XXX]: [Lesson]".
61
+ - If no match: Proceed.
62
+ 3. **Session Episode Creation**: Create draft episode for this session.
63
+
64
+ ### Step 4: User Verification Gate
65
+ **Action**: Ask: "I have absorbed all context. Does this summary match your understanding?"
66
+ - **Fully Auto**: Proceed after 2s pause.
67
+ - **Semi/Manual**: Wait for explicit "Yes".
68
+
69
+ ### Step 5: Memory Decay Check
70
+ **Action**: Once per session, scan for episodes > 30 days old with Reference Count < 3. Move to `memory/archive/`.
71
+
72
+ ---
73
+
74
+
75
+
76
+ ### Step 0.5: Health Check
77
+ **Action**: Read memory/HEALTH_DASHBOARD.md.
78
+ **Action**: Note any CRITICAL issues before proceeding.
79
+
80
+ ## Exit Criteria
81
+ **This phase is complete when ALL of the following are true**:
82
+ - [x] State Awareness Report displayed.
83
+ - [x] Relevant episodic memory loaded.
84
+ - [x] User (or timer) approved proceeds.
85
+
86
+ ---
87
+
88
+ ## Related Phases
89
+ **Next Phase**: Phase -0.6: Constitutional Compliance Check
@@ -1,44 +1,44 @@
1
- # Phase 0: The Ancestral Audit (Wisdom Access)
2
-
3
- > **Parent Workflow**: 02-SPARC-Specification
4
- > **Phase Number**: 0
5
- > **Objective**: Avoid repeating the "Lazy Spec" mistakes of the past.
6
-
7
- ---
8
-
9
- ## Prerequisites
10
- **MUST be completed before this phase**:
11
- - ✅ Phase -0.6: Constitutional Compliance Check
12
-
13
- **MUST have access to**:
14
- - `memory/failure_log.md`
15
- - `memory/PROJECT_STATE.md`
16
-
17
- ---
18
-
19
- ## Instructions
20
-
21
- ### Step 1: Wisdom Retrieval
22
- **Action**: Read `memory/failure_log.md` (if exists) and `memory/PROJECT_STATE.md` (history).
23
- **Prompt**: "Review the `failure_log.md`. Did previous features fail due to bad specs (e.g., 'Undefined Types', 'Missed Edge Cases')? List 3 constrained rules to prevent recurrence."
24
-
25
- ### Step 2: Mode Check
26
- - **If 'HOTFIX_REQUEST' in `MEMORY_STREAM`**: Enter **Hotfix Mode** (Spec ONLY the fix -> `03-london-tdd-builder`).
27
- - **Else**: Proceed to Phase 1 (Normal Mode).
28
-
29
- ### Step 3: Phase Checklist
30
- **Action**: Open `.agent/checklists/02-sparc-specification/phase-0-ancestral-audit-checklist.md`.
31
- **Instruction**: Verify every item is checked.
32
-
33
- ---
34
-
35
- ## Exit Criteria
36
- **This phase is complete when ALL of the following are true**:
37
- - ✅ Previous failures reviewed.
38
- - ✅ Mode selected.
39
- - ✅ Checklist verified.
40
-
41
- ---
42
-
43
- ## Related Phases
44
- **Next Phase**: Phase 1: Job Hunt & Context Absorption
1
+ # Phase 0: The Ancestral Audit (Wisdom Access)
2
+
3
+ > **Parent Workflow**: 02-SPARC-Specification
4
+ > **Phase Number**: 0
5
+ > **Objective**: Avoid repeating the "Lazy Spec" mistakes of the past.
6
+
7
+ ---
8
+
9
+ ## Prerequisites
10
+ **MUST be completed before this phase**:
11
+ - ✅ Phase -0.6: Constitutional Compliance Check
12
+
13
+ **MUST have access to**:
14
+ - `memory/failure_log.md`
15
+ - `memory/PROJECT_STATE.md`
16
+
17
+ ---
18
+
19
+ ## Instructions
20
+
21
+ ### Step 1: Wisdom Retrieval
22
+ **Action**: Read `memory/failure_log.md` (if exists) and `memory/PROJECT_STATE.md` (history).
23
+ **Prompt**: "Review the `failure_log.md`. Did previous features fail due to bad specs (e.g., 'Undefined Types', 'Missed Edge Cases')? List 3 constrained rules to prevent recurrence."
24
+
25
+ ### Step 2: Mode Check
26
+ - **If 'HOTFIX_REQUEST' in `MEMORY_STREAM`**: Enter **Hotfix Mode** (Spec ONLY the fix -> `03-london-tdd-builder`).
27
+ - **Else**: Proceed to Phase 1 (Normal Mode).
28
+
29
+ ### Step 3: Phase Checklist
30
+ **Action**: Open `.agent/checklists/02-sparc-specification/phase-0-ancestral-audit-checklist.md`.
31
+ **Instruction**: Verify every item is checked.
32
+
33
+ ---
34
+
35
+ ## Exit Criteria
36
+ **This phase is complete when ALL of the following are true**:
37
+ - ✅ Previous failures reviewed.
38
+ - ✅ Mode selected.
39
+ - ✅ Checklist verified.
40
+
41
+ ---
42
+
43
+ ## Related Phases
44
+ **Next Phase**: Phase 1: Job Hunt & Context Absorption
@@ -1,54 +1,54 @@
1
- # Phase 0.5: Meta-Cognitive Strategy Selection
2
- > **Parent Workflow**: 02-SPARC-Specification
3
- > **Phase Number**: 0.5
4
- > **Objective**: Adapt workflow behavior based on past performance.
5
-
6
- ---
7
-
8
- ## Prerequisites
9
- **MUST be completed before this phase**:
10
- - ✅ Phase 0: Ancestral Audit
11
-
12
- ---
13
-
14
- ## Instructions
15
-
16
- ### Step 1: Read Performance Metrics
17
- **Action**: Read `memory/PERFORMANCE_LOG.md`.
18
-
19
- ### Step 2: Pattern Analysis
20
- **Action**: Calculate the following from the last 3 entries:
21
- 1. **Avg Loops**: (Sum of loops) / 3
22
- 2. **Avg Mirror Score**: (Sum of scores) / 3
23
-
24
- ### Step 3: Strategy Selection
25
- **Action**: Select one strategy strategy based on the data:
26
-
27
- | Condition | Strategy | Behavior |
28
- |-----------|----------|----------|
29
- | Avg loops > 5 | **VERBOSE** | Extra logging, more checkpoints |
30
- | Mirror Score < 8 | **CAUTIOUS** | Self-critique after every action |
31
- | BMO/Test Failures > 1 | **PARANOID** | Double-verify all assertions |
32
- | All metrics good | **STREAMLINED** | Skip optional checkpoints |
33
- | No Data | **STANDARD** | Default behavior |
34
-
35
- ### Step 4: Apply Strategy
36
- **Action**: Write selected strategy to `memory/MEMORY_STREAM.md`:
37
- ```
38
- META_STRATEGY: [Selected Strategy]
39
- REASON: [Justification]
40
- ```
41
-
42
- ### Step 5: Output
43
- **Action**: Display to user: "🚀 Strategy Selected: **[Strategy]** (based on [Reason])"
44
-
45
- ---
46
-
47
- ## Exit Criteria
48
- **This phase is complete when ALL of the following are true**:
49
- - ✅ Strategy selected and logged.
50
-
51
- ---
52
-
53
- ## Related Phases
54
- **Next Phase**: Phase 1
1
+ # Phase 0.5: Meta-Cognitive Strategy Selection
2
+ > **Parent Workflow**: 02-SPARC-Specification
3
+ > **Phase Number**: 0.5
4
+ > **Objective**: Adapt workflow behavior based on past performance.
5
+
6
+ ---
7
+
8
+ ## Prerequisites
9
+ **MUST be completed before this phase**:
10
+ - ✅ Phase 0: Ancestral Audit
11
+
12
+ ---
13
+
14
+ ## Instructions
15
+
16
+ ### Step 1: Read Performance Metrics
17
+ **Action**: Read `memory/PERFORMANCE_LOG.md`.
18
+
19
+ ### Step 2: Pattern Analysis
20
+ **Action**: Calculate the following from the last 3 entries:
21
+ 1. **Avg Loops**: (Sum of loops) / 3
22
+ 2. **Avg Mirror Score**: (Sum of scores) / 3
23
+
24
+ ### Step 3: Strategy Selection
25
+ **Action**: Select one strategy strategy based on the data:
26
+
27
+ | Condition | Strategy | Behavior |
28
+ |-----------|----------|----------|
29
+ | Avg loops > 5 | **VERBOSE** | Extra logging, more checkpoints |
30
+ | Mirror Score < 8 | **CAUTIOUS** | Self-critique after every action |
31
+ | BMO/Test Failures > 1 | **PARANOID** | Double-verify all assertions |
32
+ | All metrics good | **STREAMLINED** | Skip optional checkpoints |
33
+ | No Data | **STANDARD** | Default behavior |
34
+
35
+ ### Step 4: Apply Strategy
36
+ **Action**: Write selected strategy to `memory/MEMORY_STREAM.md`:
37
+ ```
38
+ META_STRATEGY: [Selected Strategy]
39
+ REASON: [Justification]
40
+ ```
41
+
42
+ ### Step 5: Output
43
+ **Action**: Display to user: "🚀 Strategy Selected: **[Strategy]** (based on [Reason])"
44
+
45
+ ---
46
+
47
+ ## Exit Criteria
48
+ **This phase is complete when ALL of the following are true**:
49
+ - ✅ Strategy selected and logged.
50
+
51
+ ---
52
+
53
+ ## Related Phases
54
+ **Next Phase**: Phase 1