Date: 2026-04-04 Author: Coordinator Status: 📝 HL_DRAFT — Awaiting review
Goal: Split Researcher into a standalone role with dedicated workflow, and enforce research stage completion through filesystem-level state machine (subfolder with stage files).
Value: Research becomes crash-resilient, multi-chat resumable, and structurally impossible to skip stages. Role confusion between Coordinator and Researcher is eliminated.
“File existence = state machine. Agent can’t skip stages — no file = not done.”
| Problem | Evidence | Impact |
|---|---|---|
| Research = “Coordinator in Research Mode” | base.md L7: ROLE LOCK: COORDINATOR (Research Mode) |
User confused Plan vs Research in TFW-24 inception |
| Gates are decorative | → User decision: ___ — 6/6 unfilled in TFW-23 |
No enforcement, no state persistence |
| No resume inside research | /tfw-resume at pipeline level only |
Crash mid-stage = chaos |
| Gate responses lost with chat | Approvals exist only in chat | New chat = no record |
| 3 roles cover 4 functions | Coordinator = planning + research | Same problem TFW-8 solved for Reviewer |
TFW-8: Executor + Reviewer merged → self-review → Reviewer role extracted
TFW-24: Coordinator + Researcher merged → role confusion + crash fragility → Researcher role extracted
4 roles: Coordinator (HL, TS), Researcher (RES, stage files), Executor (ONB, RF, code), Reviewer (REVIEW). Research uses subfolder with stage files as filesystem-level state machine.
Role separation:
BEFORE (3 roles): AFTER (4 roles):
Coordinator ─┬─ HL, TS Coordinator ── HL, TS
└─ RES (mode switch) Researcher ─── RES, stage files ← NEW
Executor ──── ONB, RF, code Executor ───── ONB, RF, code
Reviewer ──── REVIEW Reviewer ───── REVIEW
Research subfolder (filesystem = state machine):
tasks/TFW-24__res_state_machine/
HL-TFW-24__res_state_machine.md
research/ ← state machine
briefing.md ← exists = briefing done
gather.md ← exists = gather done
extract.md ← exists = extract done
challenge.md ← exists = challenge done
RES__TFW-24__res_state_machine.md ← exists = synthesis done
Resume algorithm (Step 0 in base.md):
1. research/ exists? → NO: start fresh
2. Which files exist? → resume from first missing
3. RES exists? → research complete, proceed to Closure
Pipeline handoff:
Coordinator (plan.md) Researcher (base.md) Coordinator (plan.md)
HL approved reads HL reads RES Closure
"Start /tfw-research" runs stages updates HL
── STOP ── writes RES writes TS
── STOP ──
research/base.md Role Lock → RESEARCHERplan.md Step 6 → explicit handoff to Researcher with Hard Stoptemplates/RES.md → synthesis format (Decisions, Hypotheses, HL Recommendations, FC, Conclusion)conventions.md §15 (Role Lock table) and §8 (Workflows table)glossary.md with Permitted/Forbidden artifactsresearch/base.md Role Lock = 🔒 ROLE LOCK: RESEARCHERresearch/base.md has Step 0: Resume Protocol (~30 words)research/base.md Step 3 → creates research/ subfolder with stage filesresearch/base.md Step 7 → Synthesis step (consolidate stage files → final RES)conventions.md §4 → research subfolder convention documentedplan.md Step 6 → handoff to Researcher role (not self-switch), Hard Stoptemplates/RES.md → synthesis format (no stage sections, different structure from stage files)templates/HL.md §1 → Goal & Value structured fieldstemplates/HL.md §2, §5 → domain-agnostic languagePROJECT_CONFIG.yaml RES status role = researcher.tfw/.agent/, .claude/)On failure: Compress. Ref-inside-step for subfolder details. Reduce stage file structure to bare minimum.
| Dependency | Status |
|---|---|
| TFW-22 (modular research architecture) | ✅ Done |
| TFW-23 (English templates) | ✅ Done |
| TFW-8 (Reviewer role split precedent) | ✅ Done |
| Risk | Probability | Impact | Mitigation |
|---|---|---|---|
| base.md exceeds 600 words | Medium | Medium | Step 0 = ~30 words. Synthesis instruction = ~20. Total ~70 new |
| Consolidation = copy-paste not synthesis | Medium | High | RES template structure ≠ stage file structure (D2) |
| Role split adds pipeline friction | Low | Medium | Same pattern as TFW-8. Clean handoff/handback |
| Crash mid-stage-file write | Low | Low | Accept partial file. Agent reads content, assesses completeness (C1) |
| # | Hypothesis | Status |
|---|---|---|
| H1 | State in RES file sufficient for crash recovery | ✅ confirmed → evolved to D1: subfolder = state machine |
| H2 | Researcher = pure relabeling of Coordinator Research Mode | 🟡 partial — relabeling yes, but subfolder architecture = new workflow logic |
| H3 | State Table format within 10 lines | ⚫ superseded — file existence replaces table |
| H4 | Word budget ≤600 achievable | ✅ confirmed — 518 + ~70 = ~588 |
N/A — research completed.
N/A — research completed. Key findings: D1 (subfolder = state machine), D2 (synthesis ≠ aggregation), D3 (absolute role split), D4 (Goal & Value in HL), D5 (stage file naming).
| *HL — TFW-24: Researcher Role & RES State Machine | 2026-04-04* |