prizmkit 1.0.104 → 1.0.106
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/bundled/VERSION.json +3 -3
- package/bundled/dev-pipeline/run.sh +12 -0
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +31 -0
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +31 -0
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +31 -0
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +1 -1
- package/bundled/skills/prizmkit-prizm-docs/assets/PRIZM-SPEC.md +56 -7
- package/bundled/skills/prizmkit-retrospective/SKILL.md +28 -1
- package/package.json +1 -1
package/bundled/VERSION.json
CHANGED
|
@@ -288,6 +288,18 @@ sys.exit(1)
|
|
|
288
288
|
fi
|
|
289
289
|
fi
|
|
290
290
|
|
|
291
|
+
# Check if session produced a failure-log for future retries
|
|
292
|
+
if [[ "$session_status" != "success" && -n "$feature_slug" ]]; then
|
|
293
|
+
local project_root_for_failure
|
|
294
|
+
project_root_for_failure="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
295
|
+
local failure_log="$project_root_for_failure/.prizmkit/specs/${feature_slug}/failure-log.md"
|
|
296
|
+
if [[ -f "$failure_log" ]]; then
|
|
297
|
+
log_info "FAILURE_LOG: Session wrote failure-log.md — will be available to next retry"
|
|
298
|
+
else
|
|
299
|
+
log_info "FAILURE_LOG: No failure-log.md written by session"
|
|
300
|
+
fi
|
|
301
|
+
fi
|
|
302
|
+
|
|
291
303
|
# Update feature status
|
|
292
304
|
local update_output
|
|
293
305
|
update_output=$(python3 "$SCRIPTS_DIR/update-feature-status.py" \
|
|
@@ -73,6 +73,15 @@ Check `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — if it exists, s
|
|
|
73
73
|
|
|
74
74
|
### Phase 1: Build Context Snapshot
|
|
75
75
|
|
|
76
|
+
**Check for previous failure log:**
|
|
77
|
+
```bash
|
|
78
|
+
cat .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md 2>/dev/null || echo "NO_PREVIOUS_FAILURE"
|
|
79
|
+
```
|
|
80
|
+
If failure-log.md exists:
|
|
81
|
+
- Read ROOT_CAUSE and SUGGESTION — adjust your approach accordingly
|
|
82
|
+
- Read DISCOVERED_TRAPS — if any are genuine, inject into .prizm-docs/ during Phase 4 retrospective
|
|
83
|
+
- Do NOT delete failure-log.md until this session completes all phases and commits successfully
|
|
84
|
+
|
|
76
85
|
```bash
|
|
77
86
|
ls .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md 2>/dev/null && echo "EXISTS" || echo "MISSING"
|
|
78
87
|
```
|
|
@@ -167,6 +176,28 @@ git commit -m "chore({{FEATURE_ID}}): include session artifacts"
|
|
|
167
176
|
| Context Snapshot | `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` |
|
|
168
177
|
| Project Root | {{PROJECT_ROOT}} |
|
|
169
178
|
|
|
179
|
+
## Failure Capture Protocol
|
|
180
|
+
|
|
181
|
+
If you encounter an unrecoverable error, context overflow, or are about to exit without completing all phases:
|
|
182
|
+
|
|
183
|
+
1. Write `.prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md` BEFORE exiting:
|
|
184
|
+
```
|
|
185
|
+
FAILURE_TYPE: timeout | test_failure | review_rejected | context_overflow | unknown
|
|
186
|
+
PHASE: <which phase failed>
|
|
187
|
+
ROOT_CAUSE: <1-2 sentence explanation>
|
|
188
|
+
ATTEMPTED: <approaches already tried>
|
|
189
|
+
SUGGESTION: <what the next session should try differently>
|
|
190
|
+
DISCOVERED_TRAPS:
|
|
191
|
+
- [CRITICAL|HIGH|LOW] <gotcha discovered during this failed session> | FIX: <approach>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
2. This file is intentionally lightweight — write it BEFORE context runs out.
|
|
195
|
+
|
|
196
|
+
**Lifecycle**: failure-log.md is a temporary cross-session artifact. Do NOT commit it to git. After a successful session (all phases complete + commit done), delete it:
|
|
197
|
+
```bash
|
|
198
|
+
rm -f .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md
|
|
199
|
+
```
|
|
200
|
+
|
|
170
201
|
## Reminders
|
|
171
202
|
|
|
172
203
|
- Tier 1: you handle everything directly — no subagents needed
|
|
@@ -84,6 +84,15 @@ Check `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — if exists, skip
|
|
|
84
84
|
|
|
85
85
|
### Phase 1: Build Context Snapshot (you, the orchestrator)
|
|
86
86
|
|
|
87
|
+
**Check for previous failure log:**
|
|
88
|
+
```bash
|
|
89
|
+
cat .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md 2>/dev/null || echo "NO_PREVIOUS_FAILURE"
|
|
90
|
+
```
|
|
91
|
+
If failure-log.md exists:
|
|
92
|
+
- Read ROOT_CAUSE and SUGGESTION — adjust your approach accordingly
|
|
93
|
+
- Read DISCOVERED_TRAPS — if any are genuine, inject into .prizm-docs/ during Phase 5 retrospective
|
|
94
|
+
- Do NOT delete failure-log.md until this session completes all phases and commits successfully
|
|
95
|
+
|
|
87
96
|
```bash
|
|
88
97
|
ls .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md 2>/dev/null && echo "EXISTS" || echo "MISSING"
|
|
89
98
|
```
|
|
@@ -216,6 +225,28 @@ git commit -m "chore({{FEATURE_ID}}): include session artifacts"
|
|
|
216
225
|
| Reviewer Agent Def | {{REVIEWER_SUBAGENT_PATH}} |
|
|
217
226
|
| Project Root | {{PROJECT_ROOT}} |
|
|
218
227
|
|
|
228
|
+
## Failure Capture Protocol
|
|
229
|
+
|
|
230
|
+
If you encounter an unrecoverable error, context overflow, or are about to exit without completing all phases:
|
|
231
|
+
|
|
232
|
+
1. Write `.prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md` BEFORE exiting:
|
|
233
|
+
```
|
|
234
|
+
FAILURE_TYPE: timeout | test_failure | review_rejected | context_overflow | unknown
|
|
235
|
+
PHASE: <which phase failed>
|
|
236
|
+
ROOT_CAUSE: <1-2 sentence explanation>
|
|
237
|
+
ATTEMPTED: <approaches already tried>
|
|
238
|
+
SUGGESTION: <what the next session should try differently>
|
|
239
|
+
DISCOVERED_TRAPS:
|
|
240
|
+
- [CRITICAL|HIGH|LOW] <gotcha discovered during this failed session> | FIX: <approach>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
2. This file is intentionally lightweight — write it BEFORE context runs out.
|
|
244
|
+
|
|
245
|
+
**Lifecycle**: failure-log.md is a temporary cross-session artifact. Do NOT commit it to git. After a successful session (all phases complete + commit done), delete it:
|
|
246
|
+
```bash
|
|
247
|
+
rm -f .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md
|
|
248
|
+
```
|
|
249
|
+
|
|
219
250
|
## Reminders
|
|
220
251
|
|
|
221
252
|
- Tier 2: orchestrator builds context+plan, Dev implements, Reviewer reviews+tests — use direct Agent spawn for agents
|
|
@@ -147,6 +147,15 @@ After team setup: check `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`
|
|
|
147
147
|
|
|
148
148
|
### Phase 1-2: Specify + Plan — Orchestrator (you)
|
|
149
149
|
|
|
150
|
+
**Check for previous failure log:**
|
|
151
|
+
```bash
|
|
152
|
+
cat .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md 2>/dev/null || echo "NO_PREVIOUS_FAILURE"
|
|
153
|
+
```
|
|
154
|
+
If failure-log.md exists:
|
|
155
|
+
- Read ROOT_CAUSE and SUGGESTION — adjust your approach accordingly
|
|
156
|
+
- Read DISCOVERED_TRAPS — if any are genuine, inject into .prizm-docs/ during Phase 6 retrospective
|
|
157
|
+
- Do NOT delete failure-log.md until this session completes all phases and commits successfully
|
|
158
|
+
|
|
150
159
|
Check existing artifacts first:
|
|
151
160
|
```bash
|
|
152
161
|
ls .prizmkit/specs/{{FEATURE_SLUG}}/ 2>/dev/null
|
|
@@ -396,6 +405,28 @@ git commit -m "chore({{FEATURE_ID}}): include session artifacts"
|
|
|
396
405
|
| Project Root | {{PROJECT_ROOT}} |
|
|
397
406
|
| Feature List Path | {{FEATURE_LIST_PATH}} |
|
|
398
407
|
|
|
408
|
+
## Failure Capture Protocol
|
|
409
|
+
|
|
410
|
+
If you encounter an unrecoverable error, context overflow, or are about to exit without completing all phases:
|
|
411
|
+
|
|
412
|
+
1. Write `.prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md` BEFORE exiting:
|
|
413
|
+
```
|
|
414
|
+
FAILURE_TYPE: timeout | test_failure | review_rejected | context_overflow | unknown
|
|
415
|
+
PHASE: <which phase failed>
|
|
416
|
+
ROOT_CAUSE: <1-2 sentence explanation>
|
|
417
|
+
ATTEMPTED: <approaches already tried>
|
|
418
|
+
SUGGESTION: <what the next session should try differently>
|
|
419
|
+
DISCOVERED_TRAPS:
|
|
420
|
+
- [CRITICAL|HIGH|LOW] <gotcha discovered during this failed session> | FIX: <approach>
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
2. This file is intentionally lightweight — write it BEFORE context runs out.
|
|
424
|
+
|
|
425
|
+
**Lifecycle**: failure-log.md is a temporary cross-session artifact. Do NOT commit it to git. After a successful session (all phases complete + commit done), delete it:
|
|
426
|
+
```bash
|
|
427
|
+
rm -f .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md
|
|
428
|
+
```
|
|
429
|
+
|
|
399
430
|
## Reminders
|
|
400
431
|
|
|
401
432
|
- Tier 3: full team — Dev (implementation) → Reviewer (review + test) — spawn agents directly via Agent tool
|
|
@@ -121,7 +121,7 @@ Check format compliance and consistency of all .prizm docs.
|
|
|
121
121
|
PRECONDITION: .prizm-docs/ exists.
|
|
122
122
|
|
|
123
123
|
STEPS:
|
|
124
|
-
1. FORMAT CHECK: Verify all .prizm files use KEY: value format. Flag any prose paragraphs, code blocks (```), markdown headers (##), emoji, ASCII art, or horizontal rules.
|
|
124
|
+
1. FORMAT CHECK: Verify all .prizm files use KEY: value format. Flag any prose paragraphs, code blocks (```), markdown headers (##), emoji, ASCII art, or horizontal rules. Flag TRAPS entries missing severity prefix ([CRITICAL], [HIGH], or [LOW]). Note: [REVIEW] preceding severity (e.g., `[REVIEW][HIGH]`) is a valid temporary staleness marker, not a format violation.
|
|
125
125
|
2. SIZE CHECK: Verify size limits: L0 <= 4KB, L1 <= 3KB, L2 <= 5KB. Report files exceeding limits with current size.
|
|
126
126
|
3. POINTER CHECK: Verify all arrow (->) references resolve to existing .prizm files. Report broken pointers.
|
|
127
127
|
4. TIMESTAMP CHECK: Verify all docs have UPDATED field. Flag docs with UPDATED older than 30 days as potentially stale.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
PRIZM_SPEC_VERSION:
|
|
1
|
+
PRIZM_SPEC_VERSION: 3
|
|
2
2
|
PURPOSE: AI-only documentation framework for vibe coding projects
|
|
3
3
|
AUDIENCE: AI agents (not humans)
|
|
4
4
|
FORMAT: KEY: value pairs, ALL CAPS section headers, arrow pointers
|
|
@@ -180,7 +180,7 @@ TEMPLATE:
|
|
|
180
180
|
- PREFER: <module-specific preference>
|
|
181
181
|
|
|
182
182
|
TRAPS:
|
|
183
|
-
- <what looks safe but is dangerous> | FIX: <correct approach>
|
|
183
|
+
- [CRITICAL|HIGH|LOW] <what looks safe but is dangerous> | FIX: <correct approach>
|
|
184
184
|
|
|
185
185
|
DECISIONS:
|
|
186
186
|
- <what was decided> — <rationale>
|
|
@@ -195,6 +195,16 @@ CONSTRAINTS:
|
|
|
195
195
|
- SUBDIRS entries must have arrow pointer (->) if L2 doc exists
|
|
196
196
|
- KEY_FILES lists only the most important files (max 10-15)
|
|
197
197
|
- RULES may only SUPPLEMENT root.prizm RULES with module-specific exceptions, never contradict them
|
|
198
|
+
- TRAPS entries MUST have severity prefix ([CRITICAL], [HIGH], or [LOW]). [REVIEW] may precede severity as a temporary staleness marker.
|
|
199
|
+
- TRAPS optional fields: append `| REF: <7-char-hash>` for traceability, `| STALE_IF: <glob>` for auto-expiry detection
|
|
200
|
+
|
|
201
|
+
TRAPS_FORMAT_REFERENCE (spec-only — do NOT include this block in generated .prizm files):
|
|
202
|
+
- Severity levels: CRITICAL = data loss/security/financial/crash, HIGH = functional failure/silent error, LOW = naming/minor quality
|
|
203
|
+
- Temporary prefix: [REVIEW] may precede severity (e.g., `[REVIEW][HIGH]`) — signals the TRAP needs re-validation. Consumed by the next retrospective: verify and either remove [REVIEW] or delete the TRAP.
|
|
204
|
+
- REF: first 7 chars of the commit where the trap was discovered (optional, for traceability)
|
|
205
|
+
- STALE_IF: glob pattern — when matched files are deleted or heavily rewritten, this trap needs re-validation (optional)
|
|
206
|
+
- Minimal valid format: `- [SEVERITY] <description> | FIX: <approach>`
|
|
207
|
+
- Full format: `- [SEVERITY] <description> | FIX: <approach> | REF: <hash> | STALE_IF: <glob>`
|
|
198
208
|
|
|
199
209
|
## 3.3 L2: detail.prizm
|
|
200
210
|
|
|
@@ -220,8 +230,8 @@ TEMPLATE:
|
|
|
220
230
|
- REJECTED: <approach that was tried/considered and abandoned + why>
|
|
221
231
|
|
|
222
232
|
TRAPS:
|
|
223
|
-
- <gotcha: something that looks correct but is wrong or dangerous>
|
|
224
|
-
- <non-obvious coupling, race condition, or side effect>
|
|
233
|
+
- [CRITICAL|HIGH|LOW] <gotcha: something that looks correct but is wrong or dangerous> | FIX: <correct approach>
|
|
234
|
+
- [CRITICAL|HIGH|LOW] <non-obvious coupling, race condition, or side effect> | FIX: <approach>
|
|
225
235
|
|
|
226
236
|
CHANGELOG:
|
|
227
237
|
- YYYY-MM-DD | <verb>: <description of recent change to this module>
|
|
@@ -238,6 +248,9 @@ CONSTRAINTS:
|
|
|
238
248
|
- DOMAIN-SPECIFIC SECTIONS are flexible, not prescribed
|
|
239
249
|
- DECISIONS is append-only (never delete, archive if >20 entries)
|
|
240
250
|
- TRAPS section is CRITICAL for preventing AI from making known mistakes
|
|
251
|
+
- TRAPS entries MUST have severity prefix ([CRITICAL], [HIGH], or [LOW]). [REVIEW] may precede severity as a temporary staleness marker.
|
|
252
|
+
- TRAPS optional fields: append `| REF: <7-char-hash>` for traceability, `| STALE_IF: <glob>` for auto-expiry detection
|
|
253
|
+
- TRAPS severity: CRITICAL = data loss/security/financial/crash, HIGH = functional failure/silent error, LOW = naming/minor quality (see TRAPS_FORMAT_REFERENCE in Section 3.2)
|
|
241
254
|
- REJECTED entries prevent AI from re-proposing failed approaches
|
|
242
255
|
- FILES lists all files, not just key ones
|
|
243
256
|
- RULES may only SUPPLEMENT root.prizm RULES with module-specific exceptions, never contradict them
|
|
@@ -440,6 +453,7 @@ NEVER: Session-specific context or conversation history (docs are session-indepe
|
|
|
440
453
|
NEVER: Flowcharts, diagrams, mermaid blocks, or ASCII art (wastes tokens, AI cannot parse visually)
|
|
441
454
|
NEVER: Markdown headers (## / ###) inside .prizm files (use ALL CAPS KEY: format instead)
|
|
442
455
|
NEVER: Rewrite entire .prizm files on update (modify only affected sections)
|
|
456
|
+
NEVER: TRAPS entries without severity prefix ([CRITICAL], [HIGH], or [LOW])
|
|
443
457
|
|
|
444
458
|
---
|
|
445
459
|
|
|
@@ -821,6 +835,16 @@ V2 (2026-03-02): Enhanced specification
|
|
|
821
835
|
- Enhanced Section 9.1 with ON_DEEP_READ trigger alongside ON_MODIFY
|
|
822
836
|
- Updated PRIZM_SPEC_VERSION to 2
|
|
823
837
|
|
|
838
|
+
V3 (2026-03-25): Knowledge quality and resilience
|
|
839
|
+
- TRAPS entries now MUST have severity prefix: [CRITICAL], [HIGH], or [LOW]
|
|
840
|
+
- TRAPS optional fields: REF (commit hash for traceability), STALE_IF (glob for auto-expiry detection)
|
|
841
|
+
- Added TRAPS staleness check in retrospective (step 1g): auto-archive stale TRAPS when count > 10
|
|
842
|
+
- Added Failure Capture Protocol: bootstrap templates write failure-log.md on session failure for cross-session learning
|
|
843
|
+
- Added retrospective data source: failure-log.md DISCOVERED_TRAPS are prioritized for .prizm-docs/ injection
|
|
844
|
+
- Added TRAPS_FORMAT_REFERENCE as spec-only block (must NOT appear in generated .prizm files)
|
|
845
|
+
- Added V2→V3 migration: auto-tag legacy TRAPS with [LOW] default severity
|
|
846
|
+
- Updated PRIZM_SPEC_VERSION to 3
|
|
847
|
+
|
|
824
848
|
---
|
|
825
849
|
|
|
826
850
|
# SECTION 15: CONFLICT RESOLUTION
|
|
@@ -884,8 +908,8 @@ BEST_PRACTICE: Coordinate on MODULE_INDEX changes (adding/removing modules) to a
|
|
|
884
908
|
|
|
885
909
|
## 16.1 Migration Principles
|
|
886
910
|
|
|
887
|
-
BACKWARD_COMPATIBLE:
|
|
888
|
-
FORWARD_COMPATIBLE:
|
|
911
|
+
BACKWARD_COMPATIBLE: V3 can parse V2 docs without errors, but Validate will flag TRAPS entries missing severity prefixes and auto-migration (Section 16.3) will add [LOW] defaults
|
|
912
|
+
FORWARD_COMPATIBLE: V2 tools will ignore V3-only fields they do not recognize
|
|
889
913
|
MIGRATION_TRIGGER: AI detects PRIZM_VERSION in root.prizm and applies migration if needed
|
|
890
914
|
|
|
891
915
|
## 16.2 V1 to V2 Migration
|
|
@@ -911,7 +935,32 @@ ALGORITHM: prizm_migrate_v1_to_v2
|
|
|
911
935
|
4. UPDATE_CHANGELOG:
|
|
912
936
|
APPEND: - YYYY-MM-DD | root | update: migrated from PRIZM_VERSION 1 to 2
|
|
913
937
|
|
|
914
|
-
## 16.3
|
|
938
|
+
## 16.3 V2 to V3 Migration
|
|
939
|
+
|
|
940
|
+
TRIGGER: Automatic on first prizmkit-prizm-docs Update or Validate operation after spec upgrade
|
|
941
|
+
|
|
942
|
+
ALGORITHM: prizm_migrate_v2_to_v3
|
|
943
|
+
|
|
944
|
+
1. UPDATE_VERSION:
|
|
945
|
+
Change: PRIZM_VERSION: 2 -> PRIZM_VERSION: 3
|
|
946
|
+
In: root.prizm
|
|
947
|
+
|
|
948
|
+
2. MIGRATE_TRAPS_FORMAT:
|
|
949
|
+
SCAN: All L1 and L2 .prizm files for TRAPS entries
|
|
950
|
+
FOR EACH TRAPS entry without severity prefix ([CRITICAL], [HIGH], or [LOW]):
|
|
951
|
+
PREPEND: [LOW] as conservative default severity
|
|
952
|
+
EXAMPLE: `- foo is dangerous | FIX: use bar` becomes `- [LOW] foo is dangerous | FIX: bar`
|
|
953
|
+
RATIONALE: [LOW] is the safest default — it preserves the trap without over-alarming.
|
|
954
|
+
AI or user can manually upgrade severity to [HIGH] or [CRITICAL] during next retrospective.
|
|
955
|
+
|
|
956
|
+
3. VALIDATE:
|
|
957
|
+
Run full Validate operation
|
|
958
|
+
REPORT: Migration results — number of TRAPS entries migrated, files updated
|
|
959
|
+
|
|
960
|
+
4. UPDATE_CHANGELOG:
|
|
961
|
+
APPEND: - YYYY-MM-DD | root | update: migrated from PRIZM_VERSION 2 to 3 (TRAPS severity prefixes added)
|
|
962
|
+
|
|
963
|
+
## 16.4 Future Version Migration Pattern
|
|
915
964
|
|
|
916
965
|
FOR any future version N to N+1:
|
|
917
966
|
|
|
@@ -63,6 +63,9 @@ git diff --name-status
|
|
|
63
63
|
- **L1**: Update FILES count, KEY_FILES (if major files added/removed), INTERFACES (if public API changed), UPDATED timestamp
|
|
64
64
|
- **L0 root.prizm**: Update MODULE_INDEX file counts only if counts changed. Update UPDATED only if structural change (module added/removed).
|
|
65
65
|
|
|
66
|
+
**1d-migrate.** Legacy TRAPS format migration (opportunistic):
|
|
67
|
+
While updating an affected L1/L2 doc, if you encounter TRAPS entries **without** a severity prefix (e.g., `- foo | FIX: bar` instead of `- [LOW] foo | FIX: bar`), prepend `[LOW]` as a conservative default. This clears legacy format debt incrementally — only in files already being touched, never as a bulk operation.
|
|
68
|
+
|
|
66
69
|
**1e.** If new directory with 3+ source files matches no existing module: create L1 doc immediately, add to MODULE_INDEX, defer L2.
|
|
67
70
|
|
|
68
71
|
**1f.** Enforce size limits:
|
|
@@ -72,6 +75,15 @@ git diff --name-status
|
|
|
72
75
|
|
|
73
76
|
**SKIP structural sync if**: only internal implementation changed (no interface/dependency impact), only comments/whitespace, only test files, only .prizm files, bug fixes with no interface change.
|
|
74
77
|
|
|
78
|
+
**1g. TRAPS staleness check** (only when an L2 doc's TRAPS section has > 10 entries):
|
|
79
|
+
|
|
80
|
+
Perform a quick staleness scan on existing TRAPS to prevent unbounded accumulation:
|
|
81
|
+
1. If a TRAP has `STALE_IF:` and the glob-matched files no longer exist (verified via `ls`) → delete the TRAP entry, append CHANGELOG: `remove: archived stale TRAP - <summary>`
|
|
82
|
+
2. If a TRAP has `REF:` → check if the referenced file still exists and the REF commit is less than 180 days old (via `git log --since="180 days ago" <hash> 2>/dev/null`). If the file is deleted OR the REF commit is older than 180 days → prepend `[REVIEW]` to the severity, signaling it needs verification during the next retrospective Job 2
|
|
83
|
+
3. Process at most 5 of the oldest TRAPS per L2 doc per session (to bound context cost)
|
|
84
|
+
|
|
85
|
+
This step is lightweight — it only triggers when TRAPS exceed 10 entries, and processes at most 5 per run.
|
|
86
|
+
|
|
75
87
|
---
|
|
76
88
|
|
|
77
89
|
## Job 2: Architecture Knowledge Injection → `.prizm-docs/`
|
|
@@ -95,14 +107,29 @@ Extract TRAPS, RULES, and DECISIONS from development work and inject into `.priz
|
|
|
95
107
|
- `.prizmkit/specs/###-feature-name/context-snapshot.md` — read the '## Implementation Log' section (Dev's changes, decisions, discoveries) and '## Review Notes' section (Reviewer's findings). These are the **preferred source** for pre-categorized decisions and findings. If these sections exist, prefer them over re-extracting from git diff.
|
|
96
108
|
- `.prizmkit/specs/###-feature-name/plan.md` — if feature work, read planned vs actual
|
|
97
109
|
- `.prizmkit/bugfix/<id>/fix-report.md` — if bugfix, read what was discovered
|
|
110
|
+
- `.prizmkit/specs/###-feature-name/failure-log.md` — if a previous session failed, read DISCOVERED_TRAPS. These are high-value TRAPS because they come from actual failures — prioritize injecting them into `.prizm-docs/`
|
|
98
111
|
- The relevant `.prizm-docs/` L1/L2 docs for affected modules
|
|
99
112
|
|
|
100
113
|
**2b.** Extract knowledge from what was **observed in code**, not invented:
|
|
101
114
|
|
|
102
115
|
**TRAPS** (highest priority) — things that look safe but break:
|
|
103
|
-
-
|
|
116
|
+
- Minimal format: `- [SEVERITY] <description> | FIX: <approach>`
|
|
117
|
+
- Full format: `- [SEVERITY] <description> | FIX: <approach> | REF: <hash> | STALE_IF: <glob>`
|
|
104
118
|
- Source: actual bugs hit, surprising behavior discovered in code, non-obvious coupling
|
|
105
119
|
|
|
120
|
+
**TRAPS severity classification**:
|
|
121
|
+
- `[CRITICAL]`: data loss, security, financial error, system crash
|
|
122
|
+
- `[HIGH]`: functional failure, silent error, interface incompatibility
|
|
123
|
+
- `[LOW]`: misleading naming, non-intuitive API, minor performance issue
|
|
124
|
+
|
|
125
|
+
When writing TRAPS:
|
|
126
|
+
- Severity prefix is MANDATORY (e.g., `[CRITICAL]`, `[HIGH]`, `[LOW]`)
|
|
127
|
+
- OPTIONAL: append `| REF: <7-char-hash>` when you know the relevant commit (for traceability)
|
|
128
|
+
- OPTIONAL: append `| STALE_IF: <glob>` when the TRAP is tightly coupled to specific files (for auto-expiry detection)
|
|
129
|
+
|
|
130
|
+
**Consuming [REVIEW] markers** (from staleness check 1g):
|
|
131
|
+
- If you encounter a TRAP prefixed with `[REVIEW]` (e.g., `[REVIEW][HIGH] ...`), verify whether the trap is still valid by checking the current code. If still valid: remove the `[REVIEW]` prefix, keeping the severity. If no longer relevant: delete the TRAP entry and append CHANGELOG.
|
|
132
|
+
|
|
106
133
|
**RULES** — conventions established or constraints discovered:
|
|
107
134
|
- Format: `- MUST/NEVER/PREFER: <rule>`
|
|
108
135
|
- Source: patterns that proved necessary during implementation
|