haiku:revisit design refresh generated unnecessary artifacts and made FSM recovery difficult
Summary
I hit a rough workflow while using Haiku for what was meant to be a small designer-provided refresh.
The core issue: haiku:revisit design with the Designer-Provided Complete Designs (Refresh) archetype and fidelity 1.0 behaved like a full design-stage regeneration. It produced brand-new high-fidelity artifacts for unchanged units, which then created downstream review noise and required manual FSM/state recovery from Git history.
Setup
The intent gforce-worker-availability was already at active_stage: product. Design had completed and product hadn't picked it up yet. As the designer, I needed to refresh 14 PNGs in the requester-app "Worker Availability" feature and update the descriptive text in unit-04-requester-staff-availability-views.md to match. I used haiku:revisit design to reopen the design stage with the "Designer-Provided Complete Designs (Refresh)" archetype + fidelity 1.0, which I read as "the designs are done, just re-validate the doc against them."
What haiku actually did
When haiku_run_next advanced into the execute phase, the design hat ran for all 7 units (later 4, after a structural cleanup), regardless of whether their screens had changed. For each unit it generated a brand-new high-fidelity HTML mockup file plus a new spec markdown, roughly 1,600 lines of net-new artifact across 4 units, in a session where only 1 unit (unit-04) had any actual scope change. The execute-phase contract (MUST produce high-fidelity mockups) seems to override the archetype's intent. The "Refresh" / fidelity 1.0 archetype reads, to a designer, like a no-op-on-already-correct-units flag, but the design stage doesn't honor it that way.
What that produced downstream
The adversarial review agents (accessibility, consistency) then compared 4 newly-generated specs against each other and surfaced 30 findings: roughly 9 actually inside unit-04 (the unit that needed work), ~14 cross-unit drift between specs that didn't exist before this run, and ~7 inside other units that had nothing to do with the refresh. So a 14-PNG change ballooned into 30 review items where 21 of them are about content the FSM created in this session.
What I had to do to recover
Hard-reset the branch back to the pre-revisit commit, force-push (nuking the design hat output and the FB feedback files), re-commit just the 14 PNGs and a hand-written unit-04 doc update. To make haiku re-recognize the stage as completed I couldn't use any tool: haiku_unit_set blocks status: completed with fsm_completion_protected, and haiku_unit_advance_hat would re-trigger the design hat. I ended up doing:
git checkout <pre-revisit-commit> -- state.json intent.md unit-0{1,2,3,5,6,7}*.md
to restore the FSM frontmatter from history, then layered the new unit-04 body on top of the restored "completed" frontmatter via a Python script (since the guard-workflow-fields hook also blocks generic Read/Edit on those files). Net: I had to reverse-engineer the FSM state from git history because there's no agent-callable path to say "this stage is done, move on" without going back through the hats.
Other rough edges that surfaced
haiku_run_next crash from designer-written YAML
The designer hat occasionally wrote inputs: and refs: as a JSON-stringified YAML block scalar (>- form) instead of a YAML list. From that point, every haiku_run_next for that intent threw MCP error -32603: p.map is not a function, since inputs.map(...) was being called on a string. haiku_unit_get / _list / repair all read the same field fine; only run_next choked. No recovery path other than hand-editing the frontmatter back to a list.
Worktree gitlinks leaking
A few times during the design-hat run, gitlinks for .haiku/worktrees/... (mode 160000) ended up tracked in commits and then "deleted" by a subsequent haiku:repair, which caused later merges to surface phantom D lines in git status for paths the user never touched.
One thing that is pretty clean recovery-wise
haiku:repair --apply is solid. It caught a stack of legacy type: fields, the created → created_at rename, and a missing started_at, all in one pass.
The framing change that would have made this trivial
A "doc-only revisit" archetype (or a validate-only / fidelity: documented-only mode) where the design hat reads the existing artifacts and any new source material, and is allowed to edit unit doc bodies but is forbidden from generating new artifacts. The mental model "designs are done, just refresh the docs" is common for designer-provided updates, and right now the FSM has no way to express that. The execute-phase MUST clauses always fire.
Triaged. Here's where each concern lands:
1) Doc-only revisit archetype (the headline) — covered by #265.
The framing inverts: instead of a "no-regen" archetype flag, the open out-of-band-human-file-modifications intent (#265) detects user-dropped artifacts via per-stage SHA baselines + a pre-tick gate, then fires a new manual_change_assessment workflow action where the agent reads the diff and decides ignore / inline-fix / surface-as-FB / trigger revisit. Designer drops 14 PNGs → next haiku_run_next tick sees the drift → assessor classifies "designer-provided refresh, these are canonical" → no regeneration. Better mental model than asking the user to remember an archetype name.
2) haiku_run_next crash on string-encoded inputs: / refs: — already fixed.
Defensive Array.isArray(...) checks guard the .map(...) call sites now (e.g. state-tools.ts:6302-6304, build-studio-config.ts:217, elaborate.ts:198). haiku_repair also handles the field. The crash you hit doesn't reproduce on current code.
3) Worktree gitlinks leaking — fix in #264.
Two-layer guard on gitCommitState / gitCommitStateBackgroundPush:
- Pathspec exclude on the
git addblocks NEW gitlinks under.haiku/worktrees/from being staged. git rm --cached -r --ignore-unmatch -- .haiku/worktrees/untracks LEGACY gitlinks already in history on the branch —--cachedkeeps the working-tree worktree intact, so fix-chain / unit worktrees keep functioning, but the next commit cleans the index. That kills the phantom-D-on-merge behavior.- Real-repo regression suite covers fresh, legacy, and background-push variants.
4) No agent-callable "stage is done, move on" — covered by #265, intentionally not as an agent escape hatch.
The recovery dance you went through (git-checkout, Python script around the guard hook, hand-restored frontmatter) becomes unnecessary once #265 lands: after any out-of-band file edit, the pre-tick gate observes drift on state.json / unit doc, manual_change_assessment fires, the agent reconciles. No "I'm done" knob exposed to agents — that would defeat the FSM's whole point. Reconciliation lives at haiku_run_next ticks, FSM stays canonical.
5) guard-workflow-fields blocking Read/Edit — already addressed by design.
The hook still blocks generic Read/Write/Edit on workflow-managed files, but haiku_unit_read and haiku_feedback_read (state-tools.ts:5074, 5788) are the canonical readers and the hook's redirect messages name them explicitly. The Python-script workaround you used wasn't needed — those tools return body + title without exposing FSM fields. Discoverability gap, not a missing capability.
Net: #264 closes the load-bearing infra gap (3), #265 closes the model-level gaps (1, 4). 2 and 5 are already in.