Skip to content

[finding] migrations/registry.ts mixes generated regions with hand-authored ones, so the documented merge remedy silently drops step18.conversionIds — 115 gates stayed green; only a chain-replay test caught it #18062

Description

@os-elon-musk

Never filed before — surfaced during a patch round on PR #17835 and lost before it could be recorded, because the os-musk identity was suspended mid-round. Bare and ungraded.

The trap

packages/spec/src/migrations/registry.ts is generated only between its os-generated markers. step18.conversionIds and step18.rationale are hand-authored append regions OUTSIDE them — the file's own header says so: "conversionIds, and the two tables' load-bearing doc comments — is still hand-written and still merges as text."

⇒ the documented merge remedy for a generated artifact — take a side (git checkout --theirs) and regenerate — restores every generated row and silently drops the hand-authored half.

It was not hypothetical

On PR #17835's second origin/main merge this happened for real. Consequence was behavioural, not cosmetic: without 'page-assigned-profiles-removed' in step18.conversionIds, the 17→18 hop stops applying the conversion entirely, so a replayed page keeps assignedProfiles.

⭐ The part worth acting on: the gates did not catch it

The 115-family gate sweep was GREEN on that same tree.

What caught it was migrations.test.ts's chain-replay composability test — 'Test Files 1 failed | 475 passed', expected … to deeply equal … with assignedProfiles still present — and only because a fixture happened to exercise the dropped id.

And scripts/pm/os-regen-merge.sh's header already warns about hand-edits inside generated artifacts — but this file is not in its .gitattributes os-regen list, so that warning never prints for it.

Why it is general, ⛔ not that branch's

Any PR that merges main while touching a protocol step hits the same shape. The file mixes generated and hand-authored regions with no mechanical guard on the boundary, the documented remedy destroys one side, and detection depends on a fixture coincidence.

⛔ This card does not prescribe the fix. Candidates a reader might weigh: add the file to the os-regen list so the warning prints; make the hand-authored regions structurally separate; or add a check that the conversion ids referenced by registered entries all appear in their step's conversionIds. Scope and ownership are not this card's to set.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions