| name | interruption-recovery |
| description | 4-layer interruption + recovery mechanism for long dev tasks. Auto-save on any interruption, one-command resume with full context restore. Built on top of dev-task-memory state files. |
| trigger | interrupt / recovery / resume / ไธญๆท / ๆขๅพฉ / ็นผ็บ / ไนๅ / ไธๆฌก / 'where was I' / '้ๅทฅๅง' / 'ๆจ้ๅทฅๅง' |
| version | 1 |
| category | devops |
Interruption Recovery
Solve the #1 pain point of long-running dev tasks: David takes a break (1 hour / 1 day / 1 week),
then comes back, and the agent has no idea where they left off. Without this skill, every
interruption is a fresh start with 30 minutes of context re-explanation.
4-Layer Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Layer 1: TRIGGER (any of these starts the recovery flow) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โข Agent / David calls `recovery.sh <project> [reason]` โ
โ โข Pre-shutdown hook (gateway SIGTERM, system reboot) โ
โ โข Cron-triggered (auto-save every 30 min during long tasks) โ
โ โข Manual: David says "save it" / "ๆๆถๅทฅ" / "ๆๅคฉๅ่ฌ" โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Layer 2: SNAPSHOT (state + session + git) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 1. Locate active Hermes session (state.db + sessions.json) โ
โ 2. Save dev-task-state.md via dev-task-memory/save_state.py โ
โ 3. Sync facts to external memory (sync_external.py) โ
โ 4. Write docs/_meta/interruption_log.md (audit trail) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Layer 3: RESUME COMMAND (3 options for David to pick) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ A. `hermes --resume <session_id>` โ exact context, same line โ
โ B. `hermes --continue "<name>"` โ by session/project name โ
โ C. `hermes --skills dev-task-memory -c "<name>"` โ
โ โ fresh session, auto-load state file as system context โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Layer 4: AGENT RESTART (loads state on first turn) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 1. New turn begins (whichever option David picked) โ
โ 2. If state file exists at expected path, agent reads it โ
โ 3. Agent emits: "๐ Resuming <project> โ last activity <ts>" โ
โ 4. Agent summarizes Goal, Next 3-5 Steps, open Risks โ
โ 5. Agent asks: "Ready to continue from <step 1>?" โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ๅ
ฉๅ User-Facing Commands
recovery.sh (ไธญๆทๅ / ไธญๆทๆ run)
bash ~/.hermes/profiles/developer/skills/interruption-recovery/scripts/recovery.sh \
crm-system "day 9 frontend handoff ๆถๅทฅ"
Output:
โ
State saved. To RESUME, run one of these:
# A. Resume this specific session (preserves session_id, exact context)
hermes --profile developer --resume 20260606_215804_0fb627e3
# B. Resume by project name
hermes --profile developer --continue "crm-system"
# C. Start a FRESH session + auto-inject state
hermes --profile developer --skills dev-task-memory -c "crm-system"
resume.sh (David ้่ฟ / ๆณ resume)
bash resume.sh crm-system
bash resume.sh crm-system --list
bash resume.sh crm-system --peek
Output ็ฏไพ:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ RESUME โ Project: crm-system
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Step 1: Loading dev-task-state.md...
โ
Found: /Users/davidchu/www/crm-system/docs/_meta/dev-task-state.md
Last modified: Jun 6 22:06:11 2026
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ STATE SUMMARY
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโ ## ๐ฏ Goal โโโ
Implement 3 frontend improvements in crm-system in ONE pass
โโโ ## ๐ Decisions โโโ
1. **Use Hono over Express for BFF layer**
- Why: Hono ๆฏ Express ็ดฐ 4x, ๅฑ Cloudflare Workers edge runtime
2. **Use Prisma migrate dev ๅ็จ db push**
- Why: Prisma db push ๆ็ดๆฅๆน DB schema, ๅ migration history
โโโ ## โญ๏ธ Next 3-5 Steps โโโ
1. [ ] ๆด Companies ็ทจ่ผฏ่กจๅฎๅ ่ฏ็นซไบบ sub-row
2. [ ] Man-day role dropdown ้
็พๆ QuotationBuilder
3. [ ] Activity timeline ้
Company + Deal
๐ Step 2: Past sessions for crm-system...
โ
Found 5 session(s)
๐ TO RESUME โ pick one:
# A. Resume most recent session EXACTLY:
hermes --profile developer --resume 20260606_215804_0fb627e3
3 ๅ Resume ๆจกๅผๆฏ่ผ
| ๆจกๅผ | ้ฉ็จๅ ดๆฏ | Pros | Cons |
|---|
A. --resume <id> | < 1 ๅฐๆไธญๆท, ๆณ่ก่ฟๅๆฌๅฐ่ฉฑ | ๅฎๅ
จไฟ็ context, ้ฃ user ๅ
typo ้ฝ keep | ๅฆๆ session ๅทฒ zombie / corrupted ๆ hang ่ฟ |
B. --continue "<name>" | 1-24 ๅฐๆ, session ไปฒๅฅๅฃฏ | Hermes ่ชๅทฑๆต matching session | ้่ฆๆๅฝๅ / ่ญๅฅ |
| C. Fresh + state inject | > 1 ๆฅ, ้ๅ 50 turns, ๆณ clean slate | ๆฐธ้ work, ๅๅ่ session ็ๆ
ๆฑกๆ | ๅ่ๅฐ่ฉฑ history |
David ไธ่ฌๆ่ฉฒ็จ C (1 ๆฅๅพ), ็นๆฎๆ
ๆณ็จ A ๆ Bใ
Trigger ่ชๅ่งธ็ผ้ป (่ท SOUL.md ็ด
็ท 24-30 ้
ๅ)
| Event | Trigger | Action |
|---|
| Task ้ๅง | ็ด
็ท 24 | save_state.py --project X --goal "..." |
| 30 min / 10 calls | ็ด
็ท 25 | re-save + sync_external |
| Session > 50 turns | ็ด
็ท 22 | ๅปบ่ญฐ /new (ไฝๅ
recovery.sh) |
| Session stuck in compaction | ็ด
็ท 29 | kick_stuck_session.sh |
| Agent delegate subagent | ็ด
็ท 30 | emit prefix ้็ฅ |
| ไธญๆท (gateway ้ / ๆถๅทฅ / SIGTERM) | ็ด
็ท 31 (NEW) | recovery.sh ่ชๅ fire |
| David ้่ฟ / ้ๆฐ session | ็ด
็ท 32 (NEW) | resume.sh / ่ชๅ load state |
E2E Test ็ตๆ (2026-06-06 22:05)
1. recovery.sh crm-system "second test 22:05"
โ
Found active session: 20260606_215804_0fb627e3
โ
State file saved: 2783 bytes, 2 files captured, git @ 7dc56d0
โ
Interruption log written
โ
Resume commands printed
2. resume.sh crm-system
โ
State summary extracted (Goal, Decisions, Next Steps)
โ
Past sessions found: 5 sessions
โ
3 resume options printed
โฑ๏ธ Total time: < 1 second
ๅๅ
ถไป skills ๅ
้ไฟ
dev-task-memory (ๆ ธๅฟ) โ 5-layer state persistenceใinterruption-recovery ๅบไฝขไธ้ข build ่ชๅๅใ
context-summarizer (existing) โ ่ชๅๆฏ 30 min ๅฃ contextใ้
ๅ interruption-recovery ๅ
triggerใ
regression-guard (existing) โ ้ฒ่ bug ็ฟป็ผใinterruption_log.md ้
RG-XXX ID ๆนไพฟ auditใ
hang fix v3.1.0 (commit f0d0fb4) โ ้ ้ฒ hangใinterruption-recovery ่็ hang ๅพๅ
ๆขๅพฉใ
๐ ่จญ่จไฟ่ญ
| ็นๆง | ๅฏฆไฝ |
|---|
| Crash-safe | state file ๅบ docs/_meta/ (gitignored) ๆฏๆฌก save ๅฏซๅฎๆด markdown, ๅๆ partial write ่ฎ corrupted |
| Cross-machine | ๅ ~/.hermes/memories/dev-task-facts.jsonl ่ฝ disk, ไปปไฝ machine ่ฆๅฐ |
| Cross-session | hermes --resume ่ทจ session, --continue ่ทจ name, fresh option ่ทจ project |
| Audit trail | docs/_meta/interruption_log.md ่จไฝๆๆ interruption, ๅฏ grep / review |
| ๅ single point of failure | state fileใgit historyใexternal memoryใsessions.jsonใstate.db 5 ๅๅฐๆน้ฝๆ snapshot |
โ ๏ธ Day 21 Lesson (2026-06-16) โ Pre-existing Uncommitted Sprint Detection
ๆ
ๅข: David sendใๅไปฅไธๅฟ
่ฆๆง็ไฟฎๆญฃ: 1. Wiki ไธๅณๅฏไปฅๆฏๆดๅฐ doc, xls, txt ...ใ(5 ๅ item,ๅฎๅ
จ match Sprint 21 scope)ใAgent ไธ้ๅง survey ๅ source code ่ฆๅฐ
Sprint 21 US-21.4 / US-21.1 / US-21.3 / US-21.5 ๅ
comment ๆฃ่ฝๅบ chat.ts /
documents.ts / wikis.ts,ไปฒๆ 1 ไปฝ 51-line retro doc ๅฏซๅๅบ
docs/retros/2026-06-16-sprint-21-wiki-improvements.mdใๅณๆๅๆไปฅ็บ
ใๅฟซๅๆ,ๆทจไฟ commit + pushใโ ไฝ git status ้กฏ็คบ 7 modified + 3 untracked,
0 commits ahead of masterใWorking tree ๅ
ฅ้ข 5 ๅ US ๅ
จ้จ implementation ๅทฒ็ถ
ๅบๅบฆ,ๅชไฟ uncommitted WIPใ
ๆ นๅ :ใworktree ๆ changesใโ ใwork ไฟ WIP ๅๅฅฝ้ใใไธๅ sprint ๅ
work
ๅฏไปฅไฟๅฎๅ
จ functional (710 tests pass) ไฝๅพๆช commit ้ใๅไธๅ session ๅ
agent
ๅฏ่ฝๅๅ implementation + draft retro doc + verify ้ bun test,็ถๅพๅฐฑๆทๅ/session
zombie ๅ/่ขซ /new cut ๅ,ๅ commit ้ไปปไฝๅขใ
Anti-pattern: Agent ่ฆๅฐ git status non-zero changes ไนๅพ default ๅๆไฟ
ใๅพ้ถ implement ๅ user ๅ
requestใ,ๆๆ (a) duplicate work,(b) confused by
interleaved hunks,(c) blow ่ตฐ existing logicใๆญฃ็ขบๅๆไฟใverify + commit + pushใใ
Detection recipe (Recipe D,5 ๆญฅ,20 ็ง):
git status --short | wc -l
git diff --stat | tail -1
git diff | grep -E "^\+.*Sprint [0-9]+ US-|^\+.*US-[0-9]+\.[0-9]+"
ls docs/retros/$(date +%Y-%m-%d)-*.md 2>/dev/null
cd backend && bun test 2>&1 | tail -3
git branch -a | grep -iE "sprint|feat"
Decision matrix:
| Detection | Action |
|---|
| Changes + US comments in +lines + retro doc + tests pass | Verify each file โ split per-US commits โ push (ๅไฟๅพ้ถๅฏซ) |
| Changes + tests fail | Diagnose failures ๅ
,ๅๅฅฝ push |
Clean working tree + feat/sprint-NN-* branch ๆ commits | Merge feature branch |
| Clean + ๅ matching branch + ๅ WIP | ๅพ้ถ implement(ๆญฃๅธธ flow) |
Fix pattern (PM-System Sprint 21 worked example,2026-06-16):
git checkout -b feat/sprint-21-wiki-improvements
cd backend && bun test
git add backend/Dockerfile backend/src/routes/documents.ts ...
git commit -m "feat(docs): ..."
git add backend/src/utils/wiki-dedup.ts backend/src/routes/wikis.ts
git commit -m "feat(wiki): ..."
git add backend/src/routes/chat.ts frontend/src/pages/ChatPage.tsx
git commit -m "feat(chat): ..."
git add docs/retros/<date>-sprint-NN-*.md
git commit -m "docs(retro): Sprint NN closure ..."
git log --oneline -5
git push -u origin feat/sprint-NN-...
git checkout master
git merge --no-ff feat/sprint-NN-... -m "merge: Sprint NN โ <one-line summary>"
git push origin master
ๅฎๆด detection recipe + decision matrix + fix pattern + anti-pattern list:
references/post-recovery-verification.md ยง Recipe D
David ๅ
ใๅ Xใcue ่งฃ่ฎ:
- ใๅ Xใ+ working tree ๆๅคง้ changes = re-prompt of uncommitted sprint
- ใๅ Xใ+ clean working tree = implement from scratch (ๆญฃๅธธ flow)
- ใไฟฎ Xใใship Xใๅๆจฃ rule
- ๆฐธ้ ๅ
git status + git diff 30 ็ง verify,ๅๅฅฝ assume clean start
โ ๏ธ Day 16 Lesson (2026-06-08) โ git status --short Panic-Decision Pitfall
ๆ
ๅข: David sendใๅฎๆ๏ผใ(post-session check-in cue), ๆ้ ญๅ
git status --short ็ฌฌไธๆฌก่ท
return 22 lines ๅ
M + A + A (modified + 2 ๅ untracked) + ๅคง้ filesใๅณๅป panic,
่ทณๅ
ฅใ็ด
็ท 33 ่งธ็ผ, ahead commits / un-pushed WIP / ๅฏ่ฝ revertใ้่ผฏ, ๆตช่ฒป 5 ๅ
follow-up tool calls (git status no-shortใgit diff --statใgit diff --name-onlyใ
git diff -w ๅๅ modeใls -la new foldersใgit ls-files --error-unmatch)ใๅ
จ้จ 0 line diff
0 file modified โ ๆ็ต git status (no args) ๅฐ "On branch main / Your branch is up to date /
nothing to commit, working tree clean"ใ
ๆ นๅ : git status --short ๅ
output ๅ็ญๆผ reality:
- Stale terminal buffer / ไธญๆทๅ
state-cache: ็นๅฅไฟ session ้ๅค / context ้ๅๅพ็ฌฌไธๆฌก่ท
git status --short, ๆๆ return ไนๅ session ๅ
partial outputใ่งฃๆฑบ: ่ท git status (no
args) ๅ
"On branch / working tree" ๅ
ฉ่ก็บ single source of truthใ
- Porcelain v1 ๅ
X vs ?:
A (staged add) + A (intend-to-add) + M (modified) ๆททๅ,
็ญ porcelain ๅๅ MM (staged + modified), ็ฌฌไธ็ผไปฅ็บ่ฆ่็ไฝๅ
ถๅฏฆๅทฒ็ถ trackedใ
- David ่ชๅทฑ untracked ๅ
file ๅ
git add: worktree ๅบ็พ untracked ๆ, panic-react ๅ่
ๆ introduce "agent ้ๅ
ฅ David WIP" ๅ
ๅ้ก, ่ฉณ่ฆ dev-task-memory/references/working-tree-wip-detection.mdใ
Pitfall checklist(้ๅฐ git status --short ้กฏ็คบ modified/untracked ๅ
ๆๅ):
[ ] 1. ่ท `git status` (no args) โ "On branch X / Your branch is up to date with 'origin/X'"
/ "nothing to commit, working tree clean" = SINGLE SOURCE OF TRUTH
[ ] 2. ่ท `git status --branch --porcelain` โ empty = 100% clean
[ ] 3. ่ท `git log --oneline origin/main..HEAD` โ empty = 0 ahead
[ ] 4. ่ท `git log --oneline main..origin/main` โ empty = 0 behind
[ ] 5. ่ท `git diff --stat` + `git diff --cached --stat` โ ๅ
ฉๅ้ฝ 0 = ็ clean
[ ] 6. ๅฆๆ step 1 ๅฐ clean ไฝ step 2/3/4/5 ๆ output, ๆๆ panic
Rule: git status --short ๅ
modified/untracked ๅๅฏไปฅ็ดๆฅ jump ็ต่ซใAlways
git status (no args) ๅ
, ๅ
ฉๅ source ๅฐ้ฝๅ
decideใ
David ๅ
ๅคฑๆ็ๆ
cue ๆจกๅผ:
- ใๅฎๆ๏ผใ/ใOk?ใ/ใShipped?ใ = post-session check-in cue,standard verify ๆต็จ
(็ด
็ท 33 4-check), ๅไฟ panic-trigger
- ใ?ใ= ้ๅธธไฟใไปฒๆช ship / ๆๅขๆทๅใ, ไฝ้ฝไฟ verify cue ๅไฟ debug cue
- ใAใใBใใCใใXใ= ๆ option / execute
- ใZombie?ใ/ใๅใ= ็ซๅณ ship ๅข, ๅๅฅฝๅๅพ
- ใๅฅฝใ/ใBๅงใ= approve ไธๆฌก option, execute
- ใๆจ้ๅทฅๅงใ/ใ้ๅทฅๅงใ= sprint planning gate (Day 15 lesson ๅทฒ capture)
ไปๆฌก session ๅ
ใๅฎๆ๏ผใโ ๆจๆบ red-line 33 verify, 4 ๅ check ๅ
จ้จ pass, worktree clean,
HEAD ๅๆญฅ origin, 0 aheadใAnswer = "ไธๅ session ๅ
task ๅทฒ ship โ
, ็ญไฝ ๆไธไธๆ"ใ
่จ: David ๅ
failure-state cue pattern ไปฒๅบ user.md (่จๆถ), Skill ๅ้่ฆ,
ๅชๆๅขๅบฆไฟ้
ๅใๅฎๆ๏ผใๅ
standard response templateใ
โ ๏ธ Day 15 Lesson (2026-06-07) โ Reconstruction recipe when state file is generic template
resume.sh / recovery.sh ๅ
save_state.py stub detect_decisions_from_session() ไปฒๆช implement,
replace() ๅ
placeholder ๅฝไธญ็ไฝ โ ๅฏซๅบๅๅ
dev-task-state.md Goal/Decisions/Next Steps ๅ
จ้จไฟ
<placeholder>ใResume agent ไปฅ็บๅ context,ๅฏฆ้ไฟ่ฆ look harderใ4-source ้ๅปบ sequence(็ฌฌ 3 ๆฌกๆ็,2026-06-07 Day 14.7 ่ฝๅฏฆ):
git log --oneline -20 + git status + git log origin/main..HEAD (red-line 33 revert check) โ ็ฅ้ๅๅๅฉ
session_search(query="<project> Day <N> <key-term>") (FTS5 multi-keyword + quote) โ ๆ bookend_start / bookend_end (5 sessions max, ยฑ5 messages per match)
cat docs/_meta/interruption_log.md โ audit trail of save events
- David ๅ
last message โ single-letter (
A/B/C/X)ใๅฅฝใBๅงใship cue (recovery / Zombie? / ๅ) โ ็ดๆฅ execute,ๅๅฅฝๅๅ
่ผธๅบ:๐ Resuming ๆฎต + Goal (1 ๅฅ) + Current state (HEAD + branch + working tree) + Decisions (max 5) + Open question (ๅฆๆๆ) + Next 3-5 steps (concrete, file path) + Risksใ
5 tool calls ๅฎๆ reconstruction vs 30+ ๅ David ้่ฟฐใ่ฉณ็ดฐ recipe + worked example (2026-06-07 crm-system Day 14.7):
references/reconstruct-context-from-git-and-sessions.md
ไฝๆ recipe ๅคฑๆ:1 ๅ็ฆฎๆๅพใๅค task ไธฆ่กใlast message ๆจก็ณ โ ๅ 1 ๆข clarifying question,3-4 options ้จไฝๆ likely ๅ
next actionใๅๅฅฝ้ๆฐๅไธไธๅ session ๅทฒ็ถๅ้ๅ
Q โ ็ญๆกๅทฒ็ถๅบๅบฆใ
4 ๅ Known limitations (TODO)
sync_external.py ่ๅฎถๅชๅฏซ local jsonl fallback โ mem0 / honcho API integration ไปฒๆช implement
- Agent ็ฌฌไธๆฌกๅ
ฅๆฐ session ๅๆ่ชๅ load state โ David ่ฆไธปๅ run
resume.sh (ๆ --skills dev-task-memory flag)
recovery.sh ๅ pre-shutdown hook ่ชๅ fire (่ฆๆๅ run)
- 3 ๅ resume option ้ฝไฟ CLI, ๅ Discord
/resume slash command
โ ๏ธ Day 14.7 Lesson (2026-06-07) โ Post-Recovery Verification
resume.sh ๆ่ฟ state + verify git log ไนๅพ,ไปฒๆๅ
ฉๅ prod-deploy-killer
ๅ surface ๅบ git / state / standard smoke output ๅ
ฅ้ข:
- Untracked providers โ HEAD ๅทฒ commit
import { X } ไฝ X ๅ
file ไปฒ
untrackedใDev build OK (Vite ๆ working tree),prod git pull ๅฟ
BUILD FAIL
(tracked tree ๅ X)ใ
- Stale Docker image bundle โ
docker ps ้กฏ็คบ Up (healthy) ๅ็ญๆผ
bundle ๅ
ๅซๆๆฐ sourceใSettingsLayout / Tax UI / Deal Autocomplete ๅ
source ๅทฒ็ถ commit ๅ,ไฝ running image bake ๅบ 8 ๅ้ๅใ
ๅ
ฉๅๅ
detection recipe + fix command:references/post-recovery-verification.md
(ยงA untracked providers, ยงB stale bundle, ยงC stale stash detection โ added
2026-06-07 Day 15 crm-system when pre-review stash 100% subsumed by Day 14.7
merge, pop ๆๅบ duplicate toIdArray definitions + 3 untracked file conflict
bail-out)ใ่ทๅฎ resume.sh ไนๅพใclaim "ready to ship / merge / PR" ไนๅ่ท,
Recipe C ๅฟ
้ ๅบ git stash pop ไนๅ่ท โ 30 ็ง save ไธๆฌก prod build fail
โ ๏ธ Day 14.7 Final Lesson (2026-06-07) โ Smoke-before-Merge Flow
Recipe A + B ่งฃๆฑบๅ "verify ๅ surface ๅ
problem" ไนๅพ,PR ready ๅ
standard answer ็ฑ "I smoke ้ dev" ๅ็ดๅ trunk-based 4-phase flowใ
2026-06-07 crm-system Day 14.7 ็ฌฌไธๆฌก full ่ทๅฎ:
Phase 1: Pre-merge โโ dev host
1a. 1-click commit untracked providers (`templates/commit-untracked-files.sh`)
1b. 1-click push to origin (`templates/push-after-commit.sh`)
Phase 2: Staging smoke โโ staging host
2a. checkout branch + pull + rebuild
2b. apply prisma migrate deploy + status (้ฒ Day 9 P3009 drift)
2c. run 14-step E2E smoke (`templates/smoke-before-merge.sh`)
2d. if smoke FAIL โ DO NOT MERGE,ๅๅฐ Phase 1 fix
Phase 3: Merge โโ dev host
3a. `git checkout main && git merge --no-ff <branch> && git push`
Phase 4: Prod deploy โโ prod host (็ด
็ท 4,ๅฎๅ
จ็ David)
4a. `git pull origin main`
4b. `docker compose ... run --rm api bunx prisma migrate deploy`
4c. `docker compose ... run --rm api bun run db:seed` (RBAC re-seed)
4d. `docker compose ... up -d --build web` (rebuild image with new source)
4e. post-deploy smoke: 7 tabs 200 / tax 13โ17 round-trip / bundle ๅซ new feature string
3 ๅ script ไบ็ธ chain(ๆฏๅ print ไธไธๅ command),David ๅ้่ฆ
่จไฝ้ ๅบ:commit โ push โ smoke,ๅ
จ้จ smoke-passed ๅ
ๅฏไปฅ mergeใ
Hermes-redact pitfall (class-level,ๆๆ E2E smoke script ้ฝๆ): ๅฏซ
Authorization: Bearer $JWT ๅบ shell ๅฐ้ฃ Hermes ๅ
secret-detection
ๆ replace ๅ $JWT literal ่ฎ ***(ๅฐฑ็ฎ $JWT ไฟ shell variable ้ฝ้ฃ),
result = curl call ๅ
จ้จ็จ็ฉบ token โ smoke 100% failใFix pattern:
"B" + "earer " string concat + /tmp/jwt.txt file-based tokenใ่ฉณ็ดฐ
template ๅ pitfall ่งฃ้:references/e2e-smoke-script-authoring.mdใ
ๅฎๆด 4-phase ๆต็จ + 3 script ่จญ่จ + ้ป่งฃ smoke-before-merge ้่ฆ:
references/smoke-before-merge-flow.mdใ
Reusable shell templates(็ฑไปๆฌก session ๅ
/tmp/*.sh sanitized):
templates/commit-untracked-files.sh โ 1-click commit + 3 safety checks
templates/push-after-commit.sh โ 1-click push to origin
templates/smoke-before-merge.sh โ 14-step E2E smoke(redact-safe)
๐งช E2E Validation (2026-06-07 crm-system Day 14.7)
1. recovery.sh crm-system "Smoke-before-merge ready"
โ
State saved, 3 resume options printed
2. resume.sh crm-system
โ
State + git log reconstructed
3. post-recovery-verification recipes A + B
โ
Recipe A: 0 untracked-provider lines (3 multi-*.tsx ๅทฒ untracked ็ฑ PR
resolution script ่็,่ท Recipe A ็ขบ่ช "โ ๏ธ UNTRACKED-PROVIDER" ๅฐๅบ)
โ
Recipe B: bundle ๅซ "ๆๅฐๅ
ฌๅธ" / "ๆๅฐ้ทๅฎๅก" (dev rebuild ๅพ)
4. 3 /tmp script ๅฏซๅฅฝ
โ
/tmp/commit-untracked-files.sh (4.5KB) โ 3 safety checks + git add 3 files + commit
โ
/tmp/push-after-commit.sh (1.2KB)
โ
/tmp/smoke-before-merge.sh (12.5KB) โ 14 ๆญฅ,full Hermes-redact-safe
5. PR description patched
โ
ๅ Smoke-before-Merge section + 3 script refs + ๅป้ Known Minor Issues
โ
Resolution of 4 untracked files ๆน manual + 1-click ๅ
ฉ็
6. 14-step smoke ็ไฟ่ท dev host โ 14/14 PASS (login + 7 tabs + tax round-trip + audit + deals + bundle)
โ ๏ธ Day 11 Lesson (2026-06-09) โ Generic Template Limitation
recovery.sh ๅ
Step 2 ่ท save_state.py,ไฝๅ script ๅ
detect_decisions_from_session()
ไฟ stub(ๆฐธ้ return []),็ตๅคง้จๅ template replace() call ๅ miss ๅ placeholder
(ๅช hit branch / commit / uncommitted changes ๅฐ 3 ๅ)ใ็ตๆ:ๅฏซๅบๅๅ
dev-task-state.md ไฟ generic template,Decisions / Files / Next Steps / Risks
section ๅ
จ้จไฟ <placeholder> ๆ **ๅพ
ๅกซๅฏซ**ใ
ๅฝฑ้ฟ:
- Resume ๅๆฐ session agent ่ฎๅ state file,ๅฎๅ
จๅคฑๆถ(2026-06-09 hit ้ 2 ๆฌก)
load_state.py ๅ
output ็ไผผๆญฃๅธธไฝๅ
งๅฎนไฟ็ฉบ
Mitigation(ๅทฒๅบ recovery.sh ๅ warning):
recovery.sh Step 2 ไนๅพๅฐ "โ ๏ธ Day 11 lesson" block
- ๅฐๆ file:
dev-task-memory/references/recovery-template-limitation.md ๅ
workaround recipe
่ฉณ็ดฐๅๆๅ future fix blueprint(Patch D)็:
~/.hermes/profiles/developer/skills/dev-task-memory/references/recovery-template-limitation.md
โ ๏ธ Day 15 Lesson (2026-06-07) โ State-File-Generic 4-Step Reconstruction Recipe
็ถ resume.sh ๅฐๅบๅๅ
state file ๅ
จ้จไฟ <placeholder> / **ๅพ
ๅกซๅฏซ**
(generic template),ๅๅฅฝ trust state file โ ็ดๆฅ่ทไปฅไธ 4 ๆญฅๅพๅค้จ source
reconstruct contextใๅทฒ้ฉ่ญๆๆ(2026-06-07 crm-system Day 14.7 โ Day 15
handoff, ็จๅขๅ recipe 100% ้ๅปบ context):
cd ~/www/<project>
git status
git log --oneline -20
git log --oneline origin/main..HEAD
git log --oneline main..origin/main
session_search query="<project> <scope keywords>" limit=5
้้ต insight:session_search ๅ
FTS5 bookend ๆฉๅถ + git log ๅ
commit
narrative,ๅทฒ็ถๆถต่ state file ๆ่ฉฒ่จไฝๅ
95% ๅ
งๅฎนใState file ๅ
value
ๅไฟๅฎไธ source of truth, ่ไฟ user/agent ไธไธๅ turn ๅ
ใๆๅๅพๅฐ้ใ
shortcutใ็ถ shortcut ๅคฑๆ, git + session_search = ๅ็ญ็่ณๆดๅฅฝๅ
sourceใ
ๅฐ feature-plan-alignment skill ๅ
signal: ็ถ David ่ฌใ้ๅทฅๅงใ/
ใๆจ้ๅทฅๅงใ/ใstart workใ, scope ๅฑฌ 1+ sprint / >5 files / 4+ commits /
็ด
็ท 16 ๅๅฝฑ้ฟ, ่งฃ่ฎๅใapprove to start sprint planningใ, ๅไฟ
ใapprove to start codingใโ ๅฟ
้ ๅ
plan doc ๅฏซๅฅฝ scope options ไฟพ David ๆใ
2026-06-07 ๆ้, ็ด
็ท 22 (plan stage ไธๅ source code) ๅฎไฝใ
4-step recipe ๅ
edge cases:
- ๅ session_search hit:FTS5 query ๅคช narrow, ็จ
session_search() browse shape ๆๆ่ฟ 5 ๅ session
- ๅ git log:- ๅฏ่ฝๆฐ project ไปฒๆช init, fallback ๅฐ
ls docs/ + cat docs/retros/INDEX.md(ๅฆๆๅญๅจ)
- git log ๆ ahead commits:ๅฏ่ฝไธไธๅ agent ็ไฝ un-pushed work,่ฆ surface ๅบๅๅ user ้ป่็
- ๅ
จ้จ source ้ฝๅคฑๆ:่ช ๅฏฆ่ฌ "I cannot reconstruct state, please summarise what we did last",ๅๅฅฝ fabricate
๐งช ้ฉ่ญ
bash recovery.sh crm-system "test 1"
bash resume.sh crm-system
ls -la ~/www/crm-system/docs/_meta/
cat ~/www/crm-system/docs/_meta/interruption_log.md