Repository navigation
Floor and pin files merge structurally (git merge driver dragon-floor) - #183
Merged
Merged
Conversation
…loor-merge.ts, merge=dragon-floor) takes the larger count and the union of names, refusing anything else; pnpm setup:git and the landing driver register it
Commands: pnpm regen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed: floor and pin files now merge structurally, so two PRs that both raise a floor no longer conflict. #136, #140 and #142 bounced on this today.
scripts/floor-merge.ts,merge=dragon-floor. It is a git merge driver that does a three-way merge of the JSON.DRAGON_FLOOR_WRITEwrites sorted, come out sorted. Ordered lists keep each side's order: each side's additions stay together after the item they followed.glyph-clearance-pins.jsonpins are compared exactly bypixel-reference.test.ts. So a pin that both sides changed differently is a conflict, never a max.floorRegressionscannot judge.floorRegressions(the landing driver's own floors check) against both sides, and is refused if it would fall below either. That also catches a side that lowered a count.JSON.stringify(v, null, 2); pins one compact line per case), byte for byte. Merging a file with itself gives the file back..gitattributesgetspackages/*/test/*-floor.jsonandpackages/*/test/glyph-clearance-pins.jsonwithmerge=dragon-floor. That is exactly the set the landing driver's floors check judges (isFloorFile).pnpm setup:gitregisters the driver next todragon-generated.MERGE_DRIVERS), so its worktree merges the same way./tmpis a symlink, and a guard that missed would exit 0 and leave git with ours unmerged. A first draft did exactly that, and a by-hand test caught it.Outside the spec:
scripts/land.tssets the merge drivers.packages/parity/test/regen.test.ts: its.gitattributespolicy test read every non-comment line as adragon-generatedline. It now skips thedragon-floorlines. Its intent (the generated lines equal the regen outputs, sorted) is kept, and the floor lines are checked in the new test file.For the lane contract (the PM applies it; lanes do not write docs/goals). Under "Scope", after the floor-files bullet, add: "Floor and pin files merge structurally (merge=dragon-floor, run
pnpm setup:gitonce per clone): a catch-up merge takes the larger count and the union of names. If it still leaves a conflict, a name was removed, two orders disagree or a pin was changed on both sides, so resolve it by hand, never lower a floor, and give a written reason."What passed:
pnpm typecheckpassed.vitest run packages/parity/test/floor-merge.test.ts packages/parity/test/regen.test.ts packages/parity/test/land.test.tspassed: 139 tests, 2 of them skipped (regen's opt-in full-chain check).floor-merge.test.ts:{order, counts}, css-escapes counts, and pins (different cases merged, one pin changed twice refused).DRAGON_FLOOR_WRITEmakes them. Every merged result is no lower than the base and either side byfloorRegressions, and a lowering side is refused.pnpm setup:gitsets exactlyMERGE_DRIVERS, the marked files are exactlyisFloorFile's, and every real floor and pin file formats back byte for byte.🤖 Generated with Claude Code