Skip to content

Batch-pass order derived from declarations and checked (practice c) - #367

Merged
jesshaley merged 2 commits into
V2from
claude/batch-pass-order
Nov 2, 2026
Merged

jesshaley merged 2 commits into
V2from
claude/batch-pass-order

Conversation

@jesshaley

Copy link
Copy Markdown
Collaborator

Builds practice (c) of [migration reliability practices] (Decided by Jess Haley, 2026-10-26, did-schema docs/plans/did_v2_go_forward_class_audit.md): "whole-dataset passes (DID-matlab resolve* post-passes, NDI-matlab's second pass) declare what they read and write, and their order is derived and checked, not kept in comments."

What changes

  • The 10 batch post-passes each declare BATCH-PASS-READS / ADDS / CHANGES / REMOVES in their header (beside the existing CONSUMES/EMITS, which keep crediting the completion ladder and parse unchanged: batch_pass_declarations.py --json gives the same result for all 10 before and after). Comment-only changes to the .m files; no code path changes.
  • tools/batch_pass_order.py derives the order from the declarations and checks every composition: the two report-writing call sites (runCorpusDiscovery, testCorpusPRED), and with --ndi ROOT NDI-matlab's second pass (steps between pass 1 and the final v1 stamp in ndi.migrate.local). It fails on R1 (a pass reads what a later pass adds or changes), R2 (a pass reads what an earlier pass removed), an undeclared member, or a cycle. Denominator first.
  • tools/test_batch_pass_order.py: the order notes the pass headers state in prose come out of the declarations; a wrong order, a missing declaration, a half-written one and a cycle each fail; NDI is checked when $NDI_MATLAB is set, else NOT CHECKED.
  • test-migrators-quick.yml runs both.

Local evidence (python3 tools/batch_pass_order.py): DENOMINATOR: 10 pass(es) read ..., 10 with a valid declaration; 2 composition(s) checked; 90 ordered pair(s) compared ... OK. With --ndi against NDI-matlab V2 plus the companion NDI-matlab PR: 27 second-pass steps of 34 marked, derived order equals the composed order, OK.

Part (d) (carries counted by register row, with the denominator) is already in migrationReport (#347); part (b) is held.


Generated by Claude Code

…hecked

[migration reliability practices] practice (c) (Jess Haley, 2026-10-26,
did-schema docs/plans/did_v2_go_forward_class_audit.md): whole-dataset passes
declare what they read and write, and their order is derived and checked, not
kept in comments.

- Each of the 10 batch post-passes now declares BATCH-PASS-READS / ADDS /
  CHANGES / REMOVES in its header, read from its code.
- tools/batch_pass_order.py derives the order (topological, ties kept in the
  composed order) and checks every composition: the two report-writing call
  sites, and with --ndi NDI-matlab's second pass in ndi.migrate.local. A pass
  that reads what a later pass writes (R1), or reads what an earlier pass
  removed (R2), an undeclared member, or a cycle fails. Denominator first.
- The order notes in the pass headers (openminds before dataset entities,
  epochMint and resolveSessionAnchors before resolveEpochProbemap, epochMint
  before resolveValidIntervals, the bath anchors handed to epochMint) are
  derived; tools/test_batch_pass_order.py asserts that, and that a wrong order,
  a missing declaration and a cycle each fail.
- test-migrators-quick runs both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
NDI-matlab #1140 added ndi.migrate.internal.v1FileReader, which local.m passes
to did2.convert.v1_to_v2; testCrossRepoDivergenceIsExactlyTheCheckedInTable has
failed on V2 since (Test code run 41369447993, the one failure) because the
table had no row saying why it is NDI-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
@jesshaley
jesshaley marked this pull request as ready for review November 2, 2026 03:11
@jesshaley
jesshaley merged commit f1135c9 into V2 Nov 2, 2026
16 checks passed
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.

2 participants