refactor: migrate the 3 wizards to the effect map and Primary (RD-08)

The three wizards paired a dispatch with a hand-written effect call
(onPrimary/onRetry + runIfSubmitting/runIfIndienen). A missed call failed
silently. RD-05 added the effect map and RD-07 added the Primary message;
this ticket moves each wizard onto both.

Each wizard now registers its submit effect on createStore, keyed by its
own submitting tag (Submitting for herregistratie and intake, Indienen for
registratie — the type catches a wrong key at compile time). The optimistic
begin/confirm/rollback calls stay inside the effect body, unchanged. The
template dispatches Primary and Retry directly, matching how Back already
worked. onPrimary, onRetry, and runIfSubmitting/runIfIndienen are deleted
from all three components.

herregistratie-wizard drops under the 250-rule-line budget, so its
eslint-disable max-lines header is removed in this same commit (RD-02's
self-cleaning mechanism). intake-wizard and registratie-wizard stay over
budget and keep theirs, both already flagged for RD-22/RD-23.

Three doc comments (in the three machine files, plus one in store.ts) named
the deleted onPrimary()/runIfSubmitting() identifiers in prose. Reworded
them so the "idiom is gone from the repo" grep check is not defeated by its
own explanatory comments.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
eho
2026-09-04 17:20:52 +02:00
co-authored by Claude Sonnet 5
parent d0d6a3764b
commit b8aced75e3
9 changed files with 238 additions and 103 deletions
+14 -1
View File
@@ -102,7 +102,7 @@ two. Note that RD-15 exists because 22 abandoned agent worktrees are still on di
| RD-05 | `createStore` gains the effect map + specs | 02 | | done |
| RD-06 | **Bug fix:** 2 single-step forms to the effect map + retry affordance | 05 | yes | done |
| RD-07 | Add `Primary` to the 3 wizard machines + specs | 05 | | done |
| RD-08 | Migrate the 3 wizards to the effect map + `Primary` | 07 | yes | todo |
| RD-08 | Migrate the 3 wizards to the effect map + `Primary` | 07 | yes | done |
| RD-09 | **Docs + generator:** `form-machine.hbs`, ARCHITECTURE, fp-tea, skill | 08 | | todo |
| RD-10 | `WizardStatus` to a payload-carrying `WizardPhase` | 08 | yes | todo |
| RD-11 | Fold the lifecycle projection into `remote-data.ts`; PascalCase 3 machines | 01 | | todo |
@@ -178,3 +178,16 @@ Three rules when you write a ticket file, because the agent reads its ticket and
Risks section is a trap that fires.
3. **State acceptance as a command, not a sentence.** "Lands about 230 lines" is a design
estimate and nothing can check it. `npm run lint` has an exit code.
4. **Run every acceptance command against the tree before you hand the ticket over.** A
command that cannot pass is worse than no command: the agent either wastes a cycle or,
worse, "fixes" correct code to satisfy it. Three real misses so far, all in tickets written
by the supervisor:
- RD-06 grepped only `runIfSubmitting`, missing that one wizard spells it `runIfIndienen`.
- RD-08 grepped bare `onPrimary\|onRetry`, which can never return nothing — an unrelated
`uploadCtl.onRetry` exists in `upload-controller.ts`.
- RD-08 said "no machine changes" while also requiring a repo-wide grep to come back
clean, which forced comment edits in three machines. The two instructions contradicted
each other.
Anchor greps on a declaration (`^ onRetry\(\)`) rather than a name, and make the Files
list agree with the Acceptance commands.