HL โ TFW-24: Researcher Role & RES State Machine¶
Date: 2026-04-04 Author: Coordinator Status: ๐ HL_DRAFT โ Awaiting review
1. Goal & Value¶
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."
2. Current State (As-Is)¶
| 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 |
Historical pattern¶
[TFW-8](../TFW-8__reviewer_role_and_workflow/HL-TFW-8__reviewer_role_and_workflow.md): Executor + Reviewer merged โ self-review โ Reviewer role extracted
[TFW-24](HL-TFW-24__res_state_machine.md): Coordinator + Researcher merged โ role confusion + crash fragility โ Researcher role extracted
3. Target State (To-Be)¶
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.
3.1 Result Visualization¶
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 โโ
4. Phases¶
Phase A: Researcher Role + Subfolder State Machine ๐ด¶
- Researcher role in conventions.md ยง15, ยง8, glossary.md
research/base.mdRole Lock โRESEARCHER- Step 0 (Resume Protocol) in base.md
- Research subfolder convention in conventions.md ยง4
- Stage file structure (lightweight: Goal ref + Findings + Checkpoint)
- Step 7 โ Synthesis step (write final RES from stage files)
plan.mdStep 6 โ explicit handoff to Researcher with Hard Stoptemplates/RES.mdโ synthesis format (Decisions, Hypotheses, HL Recommendations, FC, Conclusion)- HL template ยง1 โ Goal & Value structured fields
- HL template ยง2, ยง5 โ domain-agnostic language
- PROJECT_CONFIG.yaml RES status role โ researcher
- Adapter sync
5. Definition of Done (DoD)¶
- โ
1. Researcher role defined in
conventions.mdยง15 (Role Lock table) and ยง8 (Workflows table) - โ
2. Researcher role defined in
glossary.mdwith Permitted/Forbidden artifacts - โ
3.
research/base.mdRole Lock =๐ ROLE LOCK: RESEARCHER - โ
4.
research/base.mdhas Step 0: Resume Protocol (~30 words) - โ
5.
research/base.mdStep 3 โ createsresearch/subfolder with stage files - โ
6.
research/base.mdStep 7 โ Synthesis step (consolidate stage files โ final RES) - โ
7.
conventions.mdยง4 โ research subfolder convention documented - โ 8. Stage file structure defined: Goal ref + Findings + Checkpoint
- โ
9.
plan.mdStep 6 โ handoff to Researcher role (not self-switch), Hard Stop - โ
10.
templates/RES.mdโ synthesis format (no stage sections, different structure from stage files) - โ
11.
templates/HL.mdยง1 โ Goal & Value structured fields - โ
12.
templates/HL.mdยง2, ยง5 โ domain-agnostic language - โ
13.
PROJECT_CONFIG.yamlRES status role =researcher - โ
14. No references to "Coordinator (Research Mode)" remain in
.tfw/ - โ
15. Adapters synced (
.agent/,.claude/) - โ 16. Word count: base.md โค 600 words
6. Definition of Failure (DoF)¶
- โ 1. base.md exceeds 600 words โ compress Step 0 or move subfolder logic to conventions ref
- โ 2. Final RES structure too similar to stage files โ copy-paste risk, synthesis fails
- โ 3. Role separation creates pipeline ambiguity at handoff โ clarify in plan.md
On failure: Compress. Ref-inside-step for subfolder details. Reduce stage file structure to bare minimum.
7. Principles¶
- One role, one artifact type โ Researcher writes RES + stage files. Coordinator writes HL/TS. No mode switching
- Filesystem = state machine โ File existence is enforcement. No parsing, no format compliance, no update discipline. Missing file = stage not done
- Synthesis, not aggregation โ Final RES has different structure from stage files. Impossible to copy-paste. Forces integrated thinking
- Resume from anywhere โ Step 0: read subfolder โ know exact state โ continue. Zero dependency on chat history
8. Dependencies¶
| Dependency | Status |
|---|---|
| TFW-22 (modular research architecture) | โ Done |
| TFW-23 (English templates) | โ Done |
| TFW-8 (Reviewer role split precedent) | โ Done |
9. Risks¶
| 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) |
10. RESEARCH Case¶
Blind Spots¶
- ~~How should Step 0 work?~~ โ Answered (D1: filesystem check)
- ~~What format for state tracking?~~ โ Answered (D1: file existence, not table)
Hypotheses¶
| # | 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 |
Risks of Not Researching¶
N/A โ research completed.
Proposed RESEARCH Focus¶
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