Skip to content

docs(migration): three v1 shapes the migration docs called silent fail loudly - #11828

Merged
mike-thompson-day8 merged 2 commits into
mainfrom
worker/migration-loud-failures-fix
Oct 30, 2026
Merged

mike-thompson-day8 merged 2 commits into
mainfrom
worker/migration-loud-failures-fix

Conversation

@mike-thompson-day8

Copy link
Copy Markdown
Contributor

The re-frame-migration skill and the v1 migration guide said that three v1 shapes fail silently or emit the wrong error. At trunk, all three fail loudly. This PR changes only the sentence or table cell that was wrong in each place.

Beads: rf2-lgzco.48 (F1, F2) and rf2-jrwzy (the [:dispatch nil] row, added to scope by the coordinator).

Dispositions

F1 (fixed). skills/re-frame-migration/references/auto-call-site-rewrites.md, the test-double row. It said a reg-fx of :dispatch / :dispatch-later "registers without complaint and never runs, and an absence assertion passes vacuously". In fact that registration is refused with :rf.error/fx-registration-invalid (refuse-reserved-body-id! in implementation/core/src/re_frame/fx.cljc), so a v1 capture-by-reg-fx double makes the test or fixture that registers it error. The row's remedy, :fx-overrides, was already right and is unchanged.

F2 (fixed, five places). A :dispatch-later map keyed :dispatch (the v1 key) instead of :event is refused at the fx walk with an always-on :rf.error/invalid-event, raised by child-dispatch! → validate-event-vector! before any timer is armed. The event's :db still commits, and the deferred event never fires.

  • auto-call-site-rewrites.md, M-16: "silently ignored and nothing fires" is corrected.
  • inventory-and-plan.md, M-8 row: "silent" becomes "loud at first execution", which matches the same cell's custom-fx sentence.
  • breaking-changes.md: the wrong-key half moves out of the M-16a row of the compile-clean register and into the Loud at runtime, silent at compile list, as an "M-16a's wrong key" bullet. The bullet keeps the note that the same key can hide inside an existing :fx, which MIGRATION.md rules under M-8. The census instruction is unchanged.
  • migration/from-re-frame-v1/README.md, M-8 step 3: "the fx silently ignores it" is corrected.
  • migration/from-re-frame-v1/README.md, the pass over entries already inside :fx: "a silent failure … the only trace is an :rf.error/no-such-handler record with :event-id nil when the timer fires" is replaced. It now says the entry fails at first execution with :rf.error/invalid-event, with :failing-id :dispatch-later, before any timer is armed.

rf2-jrwzy (fixed). migration/from-re-frame-v1/README.md, M-8 step 4. It said a folded [:dispatch nil] row "runs :dispatch with no event and emits :rf.error/no-such-handler". It is refused at the fx walk with an always-on :rf.error/invalid-event. The rest of that bullet is unchanged and still holds: move the condition onto the row, and :fx skips a nil row with no trace.

Out of scope and left alone: the same F1 sentence in skills/re-frame2/references/cross-cutting/testing.md, which a sibling PR already on trunk has fixed.

Witness probes

No gate grades this prose, so each claim is witnessed by a JVM probe beside its control. The probe is a scratch deps project outside the tree, with :local/root on this branch's implementation/core, a plain-atom frame with an :observability :errors sink, and an always-on error listener. It was run with clojure -M -m probe-mlff.

Attempt 3 is the final run. Exit 0. Output:

A1 reg-fx :dispatch       => {:threw :rf.error/fx-registration-invalid, :rf.fx/id :dispatch} | registered? false | always-on errors []
A2 reg-fx :dispatch-later => {:threw :rf.error/fx-registration-invalid, :rf.fx/id :dispatch-later} | registered? false | always-on errors []
A3 control reg-fx :app/capture => {:returned :app/capture} | registered? true | captured [:hello] | always-on errors []
A4 control :fx-overrides {:dispatch f} => captured [[:p/tick]] | :p/tick fired 0 | always-on errors []
B1 :dispatch-later {:ms 20 :dispatch [:p/tick]} => dispatch-sync {:returned nil} | :db committed? true | always-on errors during dispatch-sync [{:rf.error/id :rf.error/invalid-event, :failing-id :dispatch-later}] | :errors sink during dispatch-sync [{:rf.error/id :rf.error/invalid-event, :failing-id :dispatch-later, :frame :p/app}] | :p/tick fired after 150ms 0
B1p same, debug-enabled? false => dispatch-sync {:returned nil} | :db committed? true | always-on errors [{:rf.error/id :rf.error/invalid-event, :failing-id :dispatch-later}] | :errors sink [{:rf.error/id :rf.error/invalid-event, :failing-id :dispatch-later, :frame :p/app}] | :p/tick fired after 150ms 0
B2 control :dispatch-later {:ms 20 :event [:p/tick]} => dispatch-sync {:returned nil} | :db committed? true | always-on errors [] | :errors sink [] | :p/tick fired after 150ms 1
C1 :fx [[:dispatch nil]] => dispatch-sync {:returned nil} | :db committed? true | always-on errors [{:rf.error/id :rf.error/invalid-event, :failing-id :dispatch}]

How each line witnesses a claim:

  • F1: A1 and A2 against control A3. A4 shows the :fx-overrides remedy works.
  • F2: B1 against control B2. B1p repeats B1 with debug-enabled? false, so the refusal also reaches the frame's production :errors sink.
  • rf2-jrwzy: C1.

Attempts 1 and 2 also exited 0. Each was a subset of attempt 3: attempt 1 ran A1–B2, and attempt 2 added C1.

Quality gates

Each exit code below was captured from the runner itself, not read through a pipe.

  • scripts/check_doc_slugs.py: 0 on both commits. A planted broken anchor in an edited line of inventory-and-plan.md turned it red (1, BROKEN ANCHOR … inventory-and-plan.md:99), so the run read this tree. The restore was verified by blob hash against HEAD.
  • scripts/check_skill_migration_cites.py: 0 on both commits. A planted M-998 cite in the same edited line turned it red (1, PHANTOM-CITE … inventory-and-plan.md:99 cites M-998).
  • scripts/check_skill_migration_contract_drift.py: 0 on both commits. scripts/check_skill_migration_o1617_router_drift.py: 0 on both commits. Neither inspects anything this diff touches, so these greens are not evidence about the change.
  • mkdocs build --strict: 0, on the first commit. This diff adds no links, so the build cannot fail on it.
  • scripts/test-fast-pr.sh: 0 (PASS fast PR spine, gate root this worktree), on the first commit. Its documentation tier covered the classifier-armed ratchets for these paths.
  • The second commit (rf2-jrwzy) changes one phrase and adds no links or cites. The four Python gates above were re-run on it, all 0.
  • Final-base gate: this PR's CI. The branch was rebased onto trunk after the local runs, and those runs were not repeated.
  • Tables and prose were verified by hand: the column count of the edited breaking-changes.md register row is unchanged, and each edited sentence was re-read in context. No gate grades this prose.

…-later fail loudly (rf2-lgzco.48)

The re-frame-migration skill and the v1 migration guide described two v1
shapes as silent. Both are refused loudly at the current trunk:

- a reg-fx of :dispatch or :dispatch-later is refused at registration
  with :rf.error/fx-registration-invalid, so a v1 capture-by-reg-fx test
  double errors its test (auto-call-site-rewrites.md, test-double row);
- a :dispatch-later map keyed :dispatch (the v1 key) is refused at the fx
  walk with an always-on :rf.error/invalid-event; the event's :db still
  commits and the deferred event never fires (auto-call-site-rewrites.md
  M-16, inventory-and-plan.md M-8 row, breaking-changes.md, where the
  wrong-key half of the M-16a register row moves to the loud-at-runtime
  list, and the guide's M-8 step 3 and :fx-entries pass, which also named
  the wrong trace).
…or/invalid-event (rf2-jrwzy)

M-8 step 4 of the v1 migration guide said a nil :dispatch value folded as
the row [:dispatch nil] runs :dispatch with no event and emits
:rf.error/no-such-handler. The :dispatch body validates its event before
dispatching, so the row is refused at the fx walk with an always-on
:rf.error/invalid-event (:failing-id :dispatch), and the event's :db
still commits.
@mike-thompson-day8
mike-thompson-day8 marked this pull request as ready for review October 30, 2026 01:15
@mike-thompson-day8
mike-thompson-day8 merged commit 23e90d0 into main Oct 30, 2026
59 checks passed
@mike-thompson-day8
mike-thompson-day8 deleted the worker/migration-loud-failures-fix branch October 30, 2026 01:18
mike-thompson-day8 added a commit that referenced this pull request Oct 30, 2026
Merge: 23e90d0 at 2026-10-30T01:18:54Z.
Completeness: The three outdated failure descriptions and all identified migration copies are corrected. Full patch and both complete source beads read; the core-skill copy was fixed by the preceding reviewed PR.
Correctness: Reserved fx registration refusal and pre-timer event validation match the code. The docs preserve commit-versus-deferred-effect behavior and the nil-row remedy. Reported witness probes cover positive controls and production diagnostics; no finding.
Implementation quality: Small prose and table corrections preserve the useful migration census and existing API remedies without extra machinery.
Findings: none.
Source forward pointers: none.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant