@massu/core 0.5.0 → 0.6.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/README.md +40 -0
- package/agents/massu-architecture-reviewer.md +104 -0
- package/agents/massu-blast-radius-analyzer.md +84 -0
- package/agents/massu-competitive-scorer.md +126 -0
- package/agents/massu-help-sync.md +73 -0
- package/agents/massu-migration-writer.md +94 -0
- package/agents/massu-output-scorer.md +87 -0
- package/agents/massu-pattern-reviewer.md +84 -0
- package/agents/massu-plan-auditor.md +170 -0
- package/agents/massu-schema-sync-verifier.md +70 -0
- package/agents/massu-security-reviewer.md +98 -0
- package/agents/massu-ux-reviewer.md +106 -0
- package/commands/_shared-preamble.md +53 -23
- package/commands/_shared-references/auto-learning-protocol.md +71 -0
- package/commands/_shared-references/blast-radius-protocol.md +76 -0
- package/commands/_shared-references/security-pre-screen.md +64 -0
- package/commands/_shared-references/test-first-protocol.md +87 -0
- package/commands/_shared-references/verification-table.md +52 -0
- package/commands/massu-article-review.md +343 -0
- package/commands/massu-autoresearch/references/eval-runner.md +84 -0
- package/commands/massu-autoresearch/references/safety-rails.md +125 -0
- package/commands/massu-autoresearch/references/scoring-protocol.md +151 -0
- package/commands/massu-autoresearch.md +258 -0
- package/commands/massu-batch.md +44 -12
- package/commands/massu-bearings.md +42 -8
- package/commands/massu-checkpoint.md +588 -0
- package/commands/massu-ci-fix.md +2 -2
- package/commands/massu-command-health.md +132 -0
- package/commands/massu-command-improve.md +232 -0
- package/commands/massu-commit.md +205 -44
- package/commands/massu-create-plan.md +239 -57
- package/commands/massu-data/references/common-queries.md +79 -0
- package/commands/massu-data/references/table-guide.md +50 -0
- package/commands/massu-data.md +66 -0
- package/commands/massu-dead-code.md +29 -34
- package/commands/massu-debug/references/auto-learning.md +61 -0
- package/commands/massu-debug/references/codegraph-tracing.md +80 -0
- package/commands/massu-debug/references/common-shortcuts.md +98 -0
- package/commands/massu-debug/references/investigation-phases.md +294 -0
- package/commands/massu-debug/references/report-format.md +107 -0
- package/commands/massu-debug.md +105 -386
- package/commands/massu-docs.md +1 -1
- package/commands/massu-full-audit.md +61 -0
- package/commands/massu-gap-enhancement-analyzer.md +276 -16
- package/commands/massu-golden-path/references/approval-points.md +216 -0
- package/commands/massu-golden-path/references/competitive-mode.md +273 -0
- package/commands/massu-golden-path/references/error-handling.md +121 -0
- package/commands/massu-golden-path/references/phase-0-requirements.md +53 -0
- package/commands/massu-golden-path/references/phase-1-plan-creation.md +168 -0
- package/commands/massu-golden-path/references/phase-2-implementation.md +397 -0
- package/commands/massu-golden-path/references/phase-2.5-gap-analyzer.md +156 -0
- package/commands/massu-golden-path/references/phase-3-simplify.md +40 -0
- package/commands/massu-golden-path/references/phase-4-commit.md +94 -0
- package/commands/massu-golden-path/references/phase-5-push.md +116 -0
- package/commands/massu-golden-path/references/phase-5.5-production-verify.md +170 -0
- package/commands/massu-golden-path/references/phase-6-completion.md +113 -0
- package/commands/massu-golden-path/references/qa-evaluator-spec.md +137 -0
- package/commands/massu-golden-path/references/sprint-contract-protocol.md +117 -0
- package/commands/massu-golden-path/references/vr-visual-calibration.md +73 -0
- package/commands/massu-golden-path.md +114 -848
- package/commands/massu-guide.md +72 -69
- package/commands/massu-hooks.md +27 -12
- package/commands/massu-hotfix.md +221 -144
- package/commands/massu-incident.md +49 -20
- package/commands/massu-infra-audit.md +187 -0
- package/commands/massu-learning-audit.md +211 -0
- package/commands/massu-loop/references/auto-learning.md +49 -0
- package/commands/massu-loop/references/checkpoint-audit.md +40 -0
- package/commands/massu-loop/references/guardrails.md +17 -0
- package/commands/massu-loop/references/iteration-structure.md +115 -0
- package/commands/massu-loop/references/loop-controller.md +188 -0
- package/commands/massu-loop/references/plan-extraction.md +78 -0
- package/commands/massu-loop/references/vr-plan-spec.md +140 -0
- package/commands/massu-loop-playwright.md +9 -9
- package/commands/massu-loop.md +115 -670
- package/commands/massu-new-pattern.md +423 -0
- package/commands/massu-perf.md +422 -0
- package/commands/massu-plan-audit.md +1 -1
- package/commands/massu-plan.md +389 -122
- package/commands/massu-production-verify.md +433 -0
- package/commands/massu-push.md +62 -378
- package/commands/massu-recap.md +29 -3
- package/commands/massu-rollback.md +613 -0
- package/commands/massu-scaffold-hook.md +2 -4
- package/commands/massu-scaffold-page.md +2 -3
- package/commands/massu-scaffold-router.md +1 -2
- package/commands/massu-security.md +619 -0
- package/commands/massu-simplify.md +115 -85
- package/commands/massu-squirrels.md +2 -2
- package/commands/massu-tdd.md +38 -22
- package/commands/massu-test.md +3 -3
- package/commands/massu-type-mismatch-audit.md +469 -0
- package/commands/massu-ui-audit.md +587 -0
- package/commands/massu-verify-playwright.md +287 -32
- package/commands/massu-verify.md +150 -46
- package/dist/cli.js +146 -95
- package/package.json +6 -2
- package/patterns/build-patterns.md +302 -0
- package/patterns/component-patterns.md +246 -0
- package/patterns/display-patterns.md +185 -0
- package/patterns/form-patterns.md +890 -0
- package/patterns/integration-testing-checklist.md +445 -0
- package/patterns/security-patterns.md +219 -0
- package/patterns/testing-patterns.md +569 -0
- package/patterns/tool-routing.md +81 -0
- package/patterns/ui-patterns.md +371 -0
- package/protocols/plan-implementation.md +267 -0
- package/protocols/recovery.md +225 -0
- package/protocols/verification.md +404 -0
- package/reference/command-taxonomy.md +178 -0
- package/reference/cr-rules-reference.md +76 -0
- package/reference/hook-execution-order.md +148 -0
- package/reference/lessons-learned.md +175 -0
- package/reference/patterns-quickref.md +208 -0
- package/reference/standards.md +135 -0
- package/reference/subagents-reference.md +17 -0
- package/reference/vr-verification-reference.md +867 -0
- package/src/commands/install-commands.ts +149 -53
package/commands/massu-hotfix.md
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: massu-hotfix
|
|
3
|
-
description:
|
|
3
|
+
description: "When user needs an urgent fix -- 'hotfix', 'emergency fix', 'broken and needs immediate patch'"
|
|
4
4
|
allowed-tools: Bash(*), Read(*), Write(*), Edit(*), Grep(*), Glob(*)
|
|
5
5
|
---
|
|
6
6
|
name: massu-hotfix
|
|
7
7
|
|
|
8
|
-
> **Shared rules apply.** Read `.claude/commands/_shared-preamble.md` before proceeding. CR-
|
|
8
|
+
> **Shared rules apply.** Read `.claude/commands/_shared-preamble.md` before proceeding. CR-5, CR-12 enforced.
|
|
9
9
|
|
|
10
|
-
#
|
|
10
|
+
# Massu Hotfix: Emergency Fix Protocol
|
|
11
11
|
|
|
12
12
|
## Objective
|
|
13
13
|
|
|
14
14
|
Apply **minimal, targeted fixes** for production issues with fast verification and safe deployment. Fix the bug, nothing more.
|
|
15
15
|
|
|
16
|
-
**Usage**: `/massu-hotfix [description of the fix]`
|
|
17
|
-
|
|
18
16
|
---
|
|
19
17
|
|
|
20
18
|
## NON-NEGOTIABLE RULES
|
|
@@ -31,20 +29,21 @@ Apply **minimal, targeted fixes** for production issues with fast verification a
|
|
|
31
29
|
|
|
32
30
|
## ZERO-GAP AUDIT LOOP
|
|
33
31
|
|
|
34
|
-
**Even hotfixes do NOT
|
|
32
|
+
**Even hotfixes do NOT deploy until a SINGLE COMPLETE VERIFICATION finds ZERO issues.**
|
|
35
33
|
|
|
36
34
|
### The Rule
|
|
37
35
|
|
|
38
36
|
```
|
|
39
37
|
HOTFIX VERIFICATION LOOP:
|
|
40
38
|
1. Apply minimal fix
|
|
41
|
-
2. Run verification checks (patterns, types, tests)
|
|
39
|
+
2. Run verification checks (patterns, types, build, tests)
|
|
42
40
|
3. Count issues found
|
|
43
41
|
4. IF issues > 0:
|
|
44
42
|
- Fix ALL issues
|
|
45
43
|
- Re-run ENTIRE verification from Step 2
|
|
46
44
|
5. IF issues == 0:
|
|
47
45
|
- HOTFIX VERIFIED
|
|
46
|
+
- Safe to deploy
|
|
48
47
|
```
|
|
49
48
|
|
|
50
49
|
### Completion Requirement
|
|
@@ -53,9 +52,9 @@ HOTFIX VERIFICATION LOOP:
|
|
|
53
52
|
|----------|--------|
|
|
54
53
|
| Fix introduces type error | Fix it, re-verify ENTIRELY |
|
|
55
54
|
| Re-verify finds pattern violation | Fix it, re-verify ENTIRELY |
|
|
56
|
-
| Re-verify finds 0 issues | **NOW** hotfix
|
|
55
|
+
| Re-verify finds 0 issues | **NOW** hotfix can deploy |
|
|
57
56
|
|
|
58
|
-
**Partial verification is NOT valid. ALL checks must pass in a SINGLE run.**
|
|
57
|
+
**Partial verification is NOT valid. ALL checks must pass in a SINGLE run before deploy.**
|
|
59
58
|
|
|
60
59
|
---
|
|
61
60
|
|
|
@@ -92,15 +91,45 @@ IF scope_check_fails:
|
|
|
92
91
|
|
|
93
92
|
## DOMAIN-SPECIFIC PATTERN LOADING
|
|
94
93
|
|
|
95
|
-
Based on the hotfix area, load relevant
|
|
94
|
+
Based on the hotfix area, load relevant pattern files:
|
|
95
|
+
|
|
96
|
+
| Domain | Pattern File | Load When |
|
|
97
|
+
|--------|--------------|-----------|
|
|
98
|
+
| Tool modules | `.claude/patterns/tool-patterns.md` | Tool handler/registration bugs |
|
|
99
|
+
| Config | `.claude/patterns/config-patterns.md` | Config parsing/access bugs |
|
|
100
|
+
| Hooks | `.claude/patterns/hook-patterns.md` | Hook compilation/runtime bugs |
|
|
101
|
+
| Build issues | `.claude/patterns/build-patterns.md` | Build/deploy issues |
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## MANDATORY VERIFICATION (For Database Hotfixes)
|
|
106
|
+
|
|
107
|
+
### VR-SCHEMA-PRE: Verify Schema BEFORE Applying Database Hotfix
|
|
108
|
+
|
|
109
|
+
**WHEN hotfixing database-related issues, ALWAYS verify schema first.**
|
|
96
110
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
111
|
+
```sql
|
|
112
|
+
-- VR-SCHEMA-PRE: Query ACTUAL columns (even in emergency)
|
|
113
|
+
SELECT column_name, data_type, is_nullable
|
|
114
|
+
FROM information_schema.columns
|
|
115
|
+
WHERE table_name = '[AFFECTED_TABLE]'
|
|
116
|
+
ORDER BY ordinal_position;
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Why This Is Mandatory (Even for Emergencies):**
|
|
120
|
+
- Wrong column name in hotfix = 500 error = makes things WORSE
|
|
121
|
+
- Take 30 seconds to verify schema, save hours of debugging
|
|
122
|
+
- Schema mismatch is a common root cause of bugs
|
|
123
|
+
|
|
124
|
+
### VR-CONFIG: Verify Config for "Not Working" Hotfixes
|
|
125
|
+
|
|
126
|
+
**If hotfixing "tool not found" or config issues, verify config-code alignment FIRST.**
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# VR-CONFIG: Verify config values match code expectations
|
|
130
|
+
cat massu.config.yaml
|
|
131
|
+
grep -rn "getConfig()" packages/core/src/ | head -10
|
|
132
|
+
```
|
|
104
133
|
|
|
105
134
|
---
|
|
106
135
|
|
|
@@ -166,8 +195,8 @@ Before implementing, verify fix follows CLAUDE.md:
|
|
|
166
195
|
- [ ] Uses ESM imports (not require())
|
|
167
196
|
- [ ] Uses getConfig() (not direct YAML parse)
|
|
168
197
|
- [ ] Tool handlers follow 3-function pattern
|
|
169
|
-
- [ ] memDb closed in try/finally
|
|
170
198
|
- [ ] No hardcoded secrets
|
|
199
|
+
- [ ] Error handling present
|
|
171
200
|
|
|
172
201
|
---
|
|
173
202
|
|
|
@@ -178,7 +207,7 @@ Before implementing, verify fix follows CLAUDE.md:
|
|
|
178
207
|
# Ensure clean working tree
|
|
179
208
|
git status --short
|
|
180
209
|
|
|
181
|
-
# From main branch
|
|
210
|
+
# From main/production branch
|
|
182
211
|
git checkout main
|
|
183
212
|
git pull origin main
|
|
184
213
|
git checkout -b hotfix/[issue-name]
|
|
@@ -194,24 +223,34 @@ git checkout -b hotfix/[issue-name]
|
|
|
194
223
|
- Do NOT fix "while we're at it" issues
|
|
195
224
|
- Add comment if fix is non-obvious
|
|
196
225
|
|
|
226
|
+
### 3.3 Verify Fix Locally
|
|
227
|
+
```bash
|
|
228
|
+
# Quick verification
|
|
229
|
+
npx tsc --noEmit
|
|
230
|
+
npm run build
|
|
231
|
+
|
|
232
|
+
# Pattern check
|
|
233
|
+
bash scripts/massu-pattern-scanner.sh
|
|
234
|
+
```
|
|
235
|
+
|
|
197
236
|
---
|
|
198
237
|
|
|
199
238
|
## PHASE 4: FAST VERIFICATION (5 minutes)
|
|
200
239
|
|
|
201
|
-
### 4.1 Essential Checks
|
|
240
|
+
### 4.1 Essential Checks Only
|
|
202
241
|
```bash
|
|
203
242
|
# Type safety
|
|
204
|
-
|
|
243
|
+
npx tsc --noEmit
|
|
244
|
+
|
|
245
|
+
# Build integrity
|
|
246
|
+
npm run build
|
|
205
247
|
|
|
206
248
|
# Pattern scanner
|
|
207
249
|
bash scripts/massu-pattern-scanner.sh
|
|
208
250
|
|
|
209
|
-
#
|
|
251
|
+
# Tests
|
|
210
252
|
npm test
|
|
211
253
|
|
|
212
|
-
# Hook build (if hooks modified)
|
|
213
|
-
cd packages/core && npm run build:hooks
|
|
214
|
-
|
|
215
254
|
# Security check
|
|
216
255
|
git diff --cached --name-only | grep -E '\.(env|pem|key)' && echo "FAIL" || echo "PASS"
|
|
217
256
|
```
|
|
@@ -223,6 +262,7 @@ git diff --cached --name-only | grep -E '\.(env|pem|key)' && echo "FAIL" || echo
|
|
|
223
262
|
| Check | Command | Result | Status |
|
|
224
263
|
|-------|---------|--------|--------|
|
|
225
264
|
| Types | npx tsc --noEmit | 0 errors | PASS |
|
|
265
|
+
| Build | npm run build | Exit 0 | PASS |
|
|
226
266
|
| Patterns | massu-pattern-scanner.sh | Exit 0 | PASS |
|
|
227
267
|
| Tests | npm test | All pass | PASS |
|
|
228
268
|
| Secrets | git diff check | 0 files | PASS |
|
|
@@ -230,19 +270,13 @@ git diff --cached --name-only | grep -E '\.(env|pem|key)' && echo "FAIL" || echo
|
|
|
230
270
|
**ALL CRITICAL CHECKS: PASS/FAIL**
|
|
231
271
|
```
|
|
232
272
|
|
|
233
|
-
**If ANY check fails:**
|
|
234
|
-
1. Fix the issue
|
|
235
|
-
2. Re-run ALL checks (zero-gap loop)
|
|
236
|
-
3. Repeat until clean
|
|
237
|
-
|
|
238
273
|
---
|
|
239
274
|
|
|
240
|
-
## PHASE 5: COMMIT &
|
|
275
|
+
## PHASE 5: COMMIT & DEPLOY
|
|
241
276
|
|
|
242
277
|
### 5.1 Commit with Hotfix Format
|
|
243
278
|
```bash
|
|
244
279
|
git add [specific files only]
|
|
245
|
-
|
|
246
280
|
git commit -m "$(cat <<'EOF'
|
|
247
281
|
hotfix: [brief description]
|
|
248
282
|
|
|
@@ -251,7 +285,7 @@ Root cause: [what was wrong]
|
|
|
251
285
|
Fix: [what was changed]
|
|
252
286
|
|
|
253
287
|
Severity: P0/P1/P2
|
|
254
|
-
Verified: types, patterns, tests
|
|
288
|
+
Verified: types, build, patterns, tests
|
|
255
289
|
|
|
256
290
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
257
291
|
EOF
|
|
@@ -259,9 +293,6 @@ EOF
|
|
|
259
293
|
```
|
|
260
294
|
|
|
261
295
|
### 5.2 Create PR (If Required)
|
|
262
|
-
|
|
263
|
-
Ask user before pushing:
|
|
264
|
-
|
|
265
296
|
```bash
|
|
266
297
|
git push -u origin hotfix/[issue-name]
|
|
267
298
|
|
|
@@ -279,6 +310,7 @@ gh pr create --title "hotfix: [description]" --body "$(cat <<'EOF'
|
|
|
279
310
|
|
|
280
311
|
### Verification
|
|
281
312
|
- [ ] Types pass
|
|
313
|
+
- [ ] Build passes
|
|
282
314
|
- [ ] Pattern scanner passes
|
|
283
315
|
- [ ] All tests pass
|
|
284
316
|
- [ ] Tested fix locally
|
|
@@ -289,6 +321,138 @@ EOF
|
|
|
289
321
|
)"
|
|
290
322
|
```
|
|
291
323
|
|
|
324
|
+
### 5.3 Deploy
|
|
325
|
+
```bash
|
|
326
|
+
# After PR approval (or direct push if P0)
|
|
327
|
+
git checkout main
|
|
328
|
+
git merge hotfix/[issue-name]
|
|
329
|
+
git push origin main
|
|
330
|
+
|
|
331
|
+
# Monitor deployment
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## PHASE 6: POST-DEPLOY VERIFICATION
|
|
337
|
+
|
|
338
|
+
### 6.1 Verify Fix
|
|
339
|
+
```markdown
|
|
340
|
+
### Post-Deploy Verification
|
|
341
|
+
|
|
342
|
+
| Check | Result | Status |
|
|
343
|
+
|-------|--------|--------|
|
|
344
|
+
| Issue reproduced? | NO | PASS |
|
|
345
|
+
| Feature working? | YES | PASS |
|
|
346
|
+
| No new errors? | YES | PASS |
|
|
347
|
+
| Logs clean? | YES | PASS |
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### 6.2 Monitor for Regressions
|
|
351
|
+
```bash
|
|
352
|
+
# Check for new errors in output/logs
|
|
353
|
+
# Run tests again post-deploy
|
|
354
|
+
npm test
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
## HOTFIX REPORT FORMAT
|
|
360
|
+
|
|
361
|
+
```markdown
|
|
362
|
+
## MASSU HOTFIX REPORT
|
|
363
|
+
|
|
364
|
+
### Summary
|
|
365
|
+
- **Date**: [timestamp]
|
|
366
|
+
- **Severity**: P0/P1/P2
|
|
367
|
+
- **Time to Fix**: [duration]
|
|
368
|
+
- **Status**: RESOLVED
|
|
369
|
+
|
|
370
|
+
### Issue
|
|
371
|
+
- **Symptom**: [what was broken]
|
|
372
|
+
- **Impact**: [who was affected]
|
|
373
|
+
- **Root Cause**: [technical cause]
|
|
374
|
+
|
|
375
|
+
### Fix Applied
|
|
376
|
+
- **File(s)**: [paths]
|
|
377
|
+
- **Change**: [description]
|
|
378
|
+
- **Commit**: [hash]
|
|
379
|
+
|
|
380
|
+
### Verification
|
|
381
|
+
| Check | Result |
|
|
382
|
+
|-------|--------|
|
|
383
|
+
| Types | PASS |
|
|
384
|
+
| Build | PASS |
|
|
385
|
+
| Patterns | PASS |
|
|
386
|
+
| Tests | PASS |
|
|
387
|
+
|
|
388
|
+
### Rollback Plan
|
|
389
|
+
```bash
|
|
390
|
+
git revert [commit-hash]
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### Follow-up Required
|
|
394
|
+
- [ ] Add test coverage
|
|
395
|
+
- [ ] Review related code
|
|
396
|
+
- [ ] Root cause analysis
|
|
397
|
+
|
|
398
|
+
**HOTFIX COMPLETE**
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
---
|
|
402
|
+
|
|
403
|
+
## SESSION STATE UPDATE
|
|
404
|
+
|
|
405
|
+
After hotfix, update `session-state/CURRENT.md`:
|
|
406
|
+
|
|
407
|
+
```markdown
|
|
408
|
+
## HOTFIX SESSION
|
|
409
|
+
|
|
410
|
+
### Issue
|
|
411
|
+
- **Severity**: P0/P1/P2
|
|
412
|
+
- **Symptom**: [description]
|
|
413
|
+
|
|
414
|
+
### Fix
|
|
415
|
+
- **File**: [path]
|
|
416
|
+
- **Change**: [description]
|
|
417
|
+
- **Commit**: [hash]
|
|
418
|
+
|
|
419
|
+
### Status
|
|
420
|
+
- Applied: YES
|
|
421
|
+
- Verified: YES
|
|
422
|
+
|
|
423
|
+
### Follow-up
|
|
424
|
+
[Any additional work needed]
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
## MANDATORY PLAN DOCUMENT UPDATE (If Hotfix From Plan)
|
|
430
|
+
|
|
431
|
+
**If hotfix was derived from a plan document, update the plan with completion status.**
|
|
432
|
+
|
|
433
|
+
### Plan Document Update (Add to TOP of plan if applicable)
|
|
434
|
+
|
|
435
|
+
```markdown
|
|
436
|
+
# IMPLEMENTATION STATUS
|
|
437
|
+
|
|
438
|
+
**Plan**: [Plan Name]
|
|
439
|
+
**Status**: HOTFIX APPLIED
|
|
440
|
+
**Last Updated**: [YYYY-MM-DD HH:MM]
|
|
441
|
+
|
|
442
|
+
## Hotfix Applied
|
|
443
|
+
|
|
444
|
+
| # | Fix Description | Status | Verification | Date |
|
|
445
|
+
|---|-----------------|--------|--------------|------|
|
|
446
|
+
| 1 | [Hotfix description] | COMPLETE | VR-TEST: Pass | [date] |
|
|
447
|
+
|
|
448
|
+
## Verification Evidence
|
|
449
|
+
|
|
450
|
+
### Hotfix: [Name]
|
|
451
|
+
- Command: `npm run build && npm test`
|
|
452
|
+
- Result: Exit 0
|
|
453
|
+
- Status: VERIFIED COMPLETE
|
|
454
|
+
```
|
|
455
|
+
|
|
292
456
|
---
|
|
293
457
|
|
|
294
458
|
## ROLLBACK PROCEDURE
|
|
@@ -306,7 +470,7 @@ git push origin main
|
|
|
306
470
|
```bash
|
|
307
471
|
# Confirm no new issues from hotfix revert
|
|
308
472
|
npm test
|
|
309
|
-
|
|
473
|
+
npx tsc --noEmit
|
|
310
474
|
```
|
|
311
475
|
|
|
312
476
|
---
|
|
@@ -338,9 +502,9 @@ echo "Hotfix aborted. Reason: [reason]"
|
|
|
338
502
|
2. [ ] Check recent commits
|
|
339
503
|
3. [ ] Find root cause
|
|
340
504
|
4. [ ] Apply minimal fix
|
|
341
|
-
5. [ ] Type check + tests
|
|
342
|
-
6. [ ]
|
|
343
|
-
7. [ ] Verify
|
|
505
|
+
5. [ ] Type check + build + tests
|
|
506
|
+
6. [ ] Deploy immediately
|
|
507
|
+
7. [ ] Verify
|
|
344
508
|
8. [ ] Document
|
|
345
509
|
|
|
346
510
|
### P1 Checklist (Feature Broken)
|
|
@@ -350,131 +514,44 @@ echo "Hotfix aborted. Reason: [reason]"
|
|
|
350
514
|
4. [ ] Verify patterns
|
|
351
515
|
5. [ ] Full verification
|
|
352
516
|
6. [ ] PR + review
|
|
353
|
-
7. [ ]
|
|
517
|
+
7. [ ] Deploy
|
|
354
518
|
8. [ ] Verify + document
|
|
355
519
|
|
|
356
520
|
---
|
|
357
521
|
|
|
358
522
|
## START NOW
|
|
359
523
|
|
|
360
|
-
**Step 0: Write AUTHORIZED_COMMAND to session state (CR-
|
|
524
|
+
**Step 0: Write AUTHORIZED_COMMAND to session state (CR-12)**
|
|
361
525
|
|
|
362
|
-
|
|
526
|
+
Before any other work, update `session-state/CURRENT.md` to include:
|
|
527
|
+
```
|
|
528
|
+
AUTHORIZED_COMMAND: massu-hotfix
|
|
529
|
+
```
|
|
530
|
+
This ensures that if the session compacts, the recovery protocol knows only `/massu-hotfix` was authorized.
|
|
363
531
|
|
|
364
|
-
Then:
|
|
365
532
|
1. Triage: Assess severity and impact
|
|
366
533
|
2. Investigate: Find root cause quickly
|
|
367
534
|
3. Plan: Design minimal fix with rollback
|
|
368
535
|
4. Implement: Make only the necessary change
|
|
369
536
|
5. Verify: Run essential checks
|
|
370
|
-
6.
|
|
371
|
-
7.
|
|
537
|
+
6. Deploy: Commit and push
|
|
538
|
+
7. Confirm: Verify fix
|
|
539
|
+
8. Document: Update session state and report
|
|
372
540
|
|
|
373
541
|
**Remember: Fix the bug, only the bug, nothing but the bug.**
|
|
374
542
|
|
|
375
543
|
---
|
|
376
544
|
|
|
377
|
-
## MANDATORY PLAN DOCUMENT UPDATE (If Hotfix From Plan)
|
|
378
|
-
|
|
379
|
-
**If hotfix was derived from a plan document, update the plan with completion status.**
|
|
380
|
-
|
|
381
|
-
```markdown
|
|
382
|
-
# IMPLEMENTATION STATUS
|
|
383
|
-
|
|
384
|
-
**Plan**: [Plan Name]
|
|
385
|
-
**Status**: HOTFIX APPLIED
|
|
386
|
-
**Last Updated**: [YYYY-MM-DD HH:MM]
|
|
387
|
-
|
|
388
|
-
## Hotfix Applied
|
|
389
|
-
|
|
390
|
-
| # | Fix Description | Status | Verification | Date |
|
|
391
|
-
|---|-----------------|--------|--------------|------|
|
|
392
|
-
| 1 | [Hotfix description] | COMPLETE | VR-TEST: Pass | [date] |
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
---
|
|
396
|
-
|
|
397
|
-
## SESSION STATE UPDATE
|
|
398
|
-
|
|
399
|
-
After hotfix, update `session-state/CURRENT.md`:
|
|
400
|
-
|
|
401
|
-
```markdown
|
|
402
|
-
## HOTFIX SESSION
|
|
403
|
-
|
|
404
|
-
### Issue
|
|
405
|
-
- **Severity**: P0/P1/P2
|
|
406
|
-
- **Symptom**: [description]
|
|
407
|
-
|
|
408
|
-
### Fix
|
|
409
|
-
- **File**: [path]
|
|
410
|
-
- **Change**: [description]
|
|
411
|
-
- **Commit**: [hash]
|
|
412
|
-
|
|
413
|
-
### Status
|
|
414
|
-
- Applied: YES
|
|
415
|
-
- Verified: YES
|
|
416
|
-
|
|
417
|
-
### Follow-up
|
|
418
|
-
[Any additional work needed]
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
---
|
|
422
|
-
|
|
423
545
|
## AUTO-LEARNING PROTOCOL (MANDATORY after every hotfix)
|
|
424
546
|
|
|
425
547
|
**Every hotfix represents a failure that MUST be recorded so the system learns.**
|
|
426
548
|
|
|
427
|
-
### After Fix is Verified:
|
|
549
|
+
### After Fix is Deployed and Verified:
|
|
428
550
|
|
|
429
|
-
1. **
|
|
430
|
-
2. **
|
|
431
|
-
3. **
|
|
432
|
-
4. **
|
|
433
|
-
|
|
434
|
-
**Hotfixes without learning are wasted crises. Every failure teaches something -- capture it.**
|
|
435
|
-
|
|
436
|
-
---
|
|
551
|
+
1. **Ingest into massu memory**: Use `mcp__massu-codegraph__massu_memory_ingest` with type="bugfix", importance=5 (hotfixes are always high importance), description of root cause + fix
|
|
552
|
+
2. **Record in session state**: Add the wrong pattern and correct pattern to `.claude/session-state/CURRENT.md`
|
|
553
|
+
3. **Add to pattern scanner**: If the bad pattern is grep-able, add detection to `scripts/massu-pattern-scanner.sh`
|
|
554
|
+
4. **Search codebase-wide**: `grep -rn "[bad_pattern]" packages/core/src/` and fix ALL instances (CR-9)
|
|
555
|
+
5. **Consider new CR rule**: If this is a class of bug (not one-off), propose a new CR rule for CLAUDE.md
|
|
437
556
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
```markdown
|
|
441
|
-
## CS HOTFIX COMPLETE
|
|
442
|
-
|
|
443
|
-
### Summary
|
|
444
|
-
- **Date**: [timestamp]
|
|
445
|
-
- **Severity**: P0/P1/P2
|
|
446
|
-
- **Time to Fix**: [duration]
|
|
447
|
-
- **Status**: RESOLVED
|
|
448
|
-
|
|
449
|
-
### Issue
|
|
450
|
-
- **Symptom**: [what was broken]
|
|
451
|
-
- **Impact**: [what was affected]
|
|
452
|
-
- **Root Cause**: [technical cause]
|
|
453
|
-
|
|
454
|
-
### Fix Applied
|
|
455
|
-
- **File(s)**: [paths]
|
|
456
|
-
- **Change**: [description]
|
|
457
|
-
- **Branch**: hotfix/[description]
|
|
458
|
-
- **Commit**: [hash]
|
|
459
|
-
|
|
460
|
-
### Verification
|
|
461
|
-
| Check | Status |
|
|
462
|
-
|-------|--------|
|
|
463
|
-
| Type Safety | PASS |
|
|
464
|
-
| Pattern Scanner | PASS |
|
|
465
|
-
| Tests | PASS ([N] passed) |
|
|
466
|
-
|
|
467
|
-
### Rollback Plan
|
|
468
|
-
git revert [commit-hash]
|
|
469
|
-
|
|
470
|
-
### PR (if created)
|
|
471
|
-
- **URL**: [PR URL]
|
|
472
|
-
- **Status**: Open
|
|
473
|
-
|
|
474
|
-
### Follow-up Required
|
|
475
|
-
- [ ] Add test coverage for the bug
|
|
476
|
-
- [ ] Review related code
|
|
477
|
-
- [ ] Root cause analysis
|
|
478
|
-
|
|
479
|
-
**HOTFIX COMPLETE**
|
|
480
|
-
```
|
|
557
|
+
**Hotfixes without learning are wasted crises. Every outage teaches something -- capture it.**
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: massu-incident
|
|
3
3
|
description: "When a bug is confirmed, a production issue is found, or user reports 'this broke', 'incident', 'production error' — triggers incident documentation protocol"
|
|
4
|
-
allowed-tools: Bash(*), Read(*), Write(*), Edit(*), Grep(*), Glob(*)
|
|
4
|
+
allowed-tools: Bash(*), Read(*), Write(*), Edit(*), Grep(*), Glob(*), mcp__massu-codegraph__massu_memory_ingest
|
|
5
5
|
---
|
|
6
6
|
name: massu-incident
|
|
7
7
|
|
|
8
|
-
# Massu Incident: Automated Post-Mortem & Prevention Pipeline
|
|
9
|
-
|
|
10
8
|
> **Shared rules apply.** Read `.claude/commands/_shared-preamble.md` before proceeding.
|
|
11
9
|
|
|
10
|
+
# Massu Incident: Automated Post-Mortem & Prevention Pipeline
|
|
11
|
+
|
|
12
12
|
## Objective
|
|
13
13
|
|
|
14
14
|
When a bug is discovered that an audit should have caught, execute a
|
|
15
15
|
structured post-mortem that AUTOMATICALLY:
|
|
16
16
|
1. Logs the incident to INCIDENT-LOG.md
|
|
17
|
-
2.
|
|
18
|
-
3. Proposes a
|
|
19
|
-
4.
|
|
17
|
+
2. Ingests it into massu memory (high importance)
|
|
18
|
+
3. Proposes a new CR rule or VR-* check
|
|
19
|
+
4. Proposes a pattern-scanner addition
|
|
20
|
+
5. Updates relevant protocol files with incident reminder
|
|
20
21
|
|
|
21
22
|
## INPUT
|
|
22
23
|
|
|
@@ -64,32 +65,54 @@ Append to `.claude/incidents/INCIDENT-LOG.md`:
|
|
|
64
65
|
**Lesson**: [one-line lesson]
|
|
65
66
|
```
|
|
66
67
|
|
|
67
|
-
## STEP 4:
|
|
68
|
+
## STEP 4: INGEST INTO MASSU MEMORY
|
|
69
|
+
|
|
70
|
+
Use `mcp__massu-codegraph__massu_memory_ingest` to record:
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"type": "failed_attempt",
|
|
74
|
+
"title": "INCIDENT #[N]: [short title]",
|
|
75
|
+
"detail": "[root cause and lesson]",
|
|
76
|
+
"importance": 5,
|
|
77
|
+
"cr_rule": "[relevant CR]",
|
|
78
|
+
"files_involved": "[file list]"
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
This ensures the incident surfaces automatically in future sessions
|
|
83
|
+
via the session-start hook's failed_attempt query.
|
|
84
|
+
|
|
85
|
+
## STEP 5: PROPOSE PREVENTION
|
|
68
86
|
|
|
69
|
-
###
|
|
87
|
+
### 5a: New CR Rule (if pattern is new)
|
|
70
88
|
If the failure mode isn't covered by existing CRs:
|
|
71
89
|
- Propose CR-[N+1] with rule text
|
|
72
90
|
- Add to CLAUDE.md CR table
|
|
91
|
+
- Add to Zero Tolerance table
|
|
73
92
|
|
|
74
|
-
###
|
|
93
|
+
### 5b: New VR-* Check (always)
|
|
75
94
|
Every incident MUST produce a verifiable check:
|
|
76
95
|
- Define the verification command
|
|
77
96
|
- Add to VR table in CLAUDE.md
|
|
78
97
|
- Specify when to run it
|
|
79
98
|
|
|
80
|
-
###
|
|
99
|
+
### 5c: Pattern Scanner Rule (if automatable)
|
|
81
100
|
If the failure can be caught by grep:
|
|
82
101
|
- Add rule to `scripts/pattern-scanner.sh`
|
|
83
102
|
- Test it catches the original failure
|
|
84
103
|
- Verify it doesn't false-positive
|
|
85
104
|
|
|
86
|
-
###
|
|
105
|
+
### 5d: Protocol Update (always)
|
|
87
106
|
Add incident reminder to the protocol that should have caught it:
|
|
88
107
|
- Add `## INCIDENT #[N] REMINDER` section
|
|
89
108
|
- Explain the failure mode
|
|
90
109
|
- Explain what to check for
|
|
91
110
|
|
|
92
|
-
## STEP
|
|
111
|
+
## STEP 6: UPDATE CLAUDE.md INCIDENT SUMMARY
|
|
112
|
+
|
|
113
|
+
Update the incident count and add the new row to the incident table.
|
|
114
|
+
|
|
115
|
+
## STEP 7: VERIFY PREVENTION WORKS
|
|
93
116
|
|
|
94
117
|
```bash
|
|
95
118
|
# If pattern-scanner rule added:
|
|
@@ -97,6 +120,9 @@ Add incident reminder to the protocol that should have caught it:
|
|
|
97
120
|
|
|
98
121
|
# If VR-* check added, run it:
|
|
99
122
|
[verification command]
|
|
123
|
+
|
|
124
|
+
# Confirm incident is in memory:
|
|
125
|
+
# (will surface at next session start automatically)
|
|
100
126
|
```
|
|
101
127
|
|
|
102
128
|
## OUTPUT
|
|
@@ -106,21 +132,23 @@ Add incident reminder to the protocol that should have caught it:
|
|
|
106
132
|
|
|
107
133
|
### Incident #[N]: [Title]
|
|
108
134
|
- Logged to: INCIDENT-LOG.md
|
|
135
|
+
- Ingested to: massu memory (importance: 5)
|
|
109
136
|
- CR rule: [CR-XX added/updated]
|
|
110
137
|
- VR check: [VR-XX added]
|
|
111
138
|
- Pattern scanner: [rule added / not automatable]
|
|
112
139
|
- Protocol updated: [which protocol]
|
|
113
140
|
|
|
114
141
|
### Prevention Chain
|
|
115
|
-
1.
|
|
116
|
-
2.
|
|
117
|
-
3.
|
|
118
|
-
4.
|
|
142
|
+
1. Memory: Will surface at session start in related domains
|
|
143
|
+
2. Pattern scanner: Will catch at pre-push
|
|
144
|
+
3. Protocol: Explicit reminder in [protocol name]
|
|
145
|
+
4. CR rule: Documented in CLAUDE.md
|
|
146
|
+
5. MEMORY.md: Wrong vs correct pattern recorded for all future sessions
|
|
119
147
|
|
|
120
|
-
**This failure mode is now prevented at
|
|
148
|
+
**This failure mode is now prevented at 5 levels.**
|
|
121
149
|
```
|
|
122
150
|
|
|
123
|
-
## STEP
|
|
151
|
+
## STEP 8: UPDATE MEMORY.md (MANDATORY)
|
|
124
152
|
|
|
125
153
|
Every incident MUST be recorded in `memory/MEMORY.md` with the wrong vs correct pattern:
|
|
126
154
|
|
|
@@ -134,7 +162,7 @@ Every incident MUST be recorded in `memory/MEMORY.md` with the wrong vs correct
|
|
|
134
162
|
This ensures that even without accessing the incident log, future sessions
|
|
135
163
|
will have the pattern in their system prompt via MEMORY.md.
|
|
136
164
|
|
|
137
|
-
## STEP
|
|
165
|
+
## STEP 9: CODEBASE-WIDE SEARCH (CR-9)
|
|
138
166
|
|
|
139
167
|
Search the ENTIRE codebase for the same bad pattern that caused the incident:
|
|
140
168
|
```bash
|
|
@@ -143,7 +171,7 @@ grep -rn "[bad_pattern]" src/ --include="*.ts" --include="*.tsx"
|
|
|
143
171
|
Fix ALL instances found. The incident that triggered this post-mortem
|
|
144
172
|
may not be the only occurrence.
|
|
145
173
|
|
|
146
|
-
## STEP
|
|
174
|
+
## STEP 10: VR-COUPLING CHECK
|
|
147
175
|
|
|
148
176
|
If the incident involved a feature that was implemented but not exposed in the UI, run the coupling check to verify all backend procedures have UI exposure:
|
|
149
177
|
|
|
@@ -156,6 +184,7 @@ If the incident involved a feature that was implemented but not exposed in the U
|
|
|
156
184
|
|
|
157
185
|
## Gotchas
|
|
158
186
|
|
|
187
|
+
- **Ingest to memory immediately** — every incident MUST be saved to `.claude/memory/` files BEFORE the session ends. Lost incident knowledge = repeated incidents
|
|
159
188
|
- **Update INCIDENT-LOG.md** — every incident gets a numbered entry in `incidents/INCIDENT-LOG.md` with root cause, prevention, and CR reference
|
|
160
189
|
- **Add CR if pattern emerges** — if the incident reveals a repeatable failure pattern, add a new Canonical Rule to CLAUDE.md
|
|
161
190
|
- **Update pattern scanner** — if the incident could be caught by static analysis, add a check to `scripts/pattern-scanner.sh`
|