0.8.1: end the maintenance.lock CI flake; document how an adopted JSON file is rewritten - #21
Merged
Merged
Conversation
…lake git's background maintenance creates and deletes lock files under .git/ while snapshot() reads them, failing CI on Linux at random (twice on 2026-10-03, once skipping a release). The Forge-untouched assertions are about Forge files; git internals are excluded and auto-maintenance is off in test repos.
Ruled by design on 2026-10-03: an adopted .mcp.json takes the emitter's layout on the first sync, keeping its BOM and line endings. These tests make that a contract.
Ruled by design on 2026-10-03.
The JSON-adopt rule is now precise: same keys in same order, whitespace-only differences. Separate behaviors for claude-code (BOM, EOL preserved) and Kiro (CRLF, no BOM) are documented. A different key order is a collision.
Adds maintenance.auto=false and gc.auto=0 config to git init calls in: - golden-param.test.ts - golden-sections.test.ts - golden-take-section.test.ts - golden-unify.test.ts This closes the flake window where git background maintenance could race snapshot reads and cleanup operations.
The snapshot() function already excludes .git/ entries after the earlier fix. The redundant filter in the unify plan comparison was a leftover.
craftar-cli 0.8.1: test-only CI fix and the adopted-JSON README note.
f6f3299 covered the golden suites only; unify.test.ts creates two more repositories.
Review round 2: a JSON file already in craftar.lock is compared by hash, so a hand reformat is drift; integer-like keys are reordered by JSON.parse.
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.
Summary
Version bumped to 0.8.1 (patch). Merging publishes
craftar@0.8.1to npm after approval in thenpmenvironment.CI flake fixed (tests only). Git's background maintenance created and deleted lock files under
.git/(.git/objects/maintenance.lock) while the test suite read its Forge snapshots. That failed Linux CI at random, twice on 2026-10-03, and once skipped a release.snapshot()intest/cli.test.tsno longer reads.git/. Every test repository (cli,unifyand the golden suites) turnsmaintenance.autoandgc.autooff. No "Forge untouched" guarantee depended on.git/: nothing insrc/commits.Adopted JSON, ruled by design. A
.jsonfile not yet incraftar.lockthat parses to the planned value with its keys in the same order isadopt, and the firstsyncrewrites it with the planned bytes:claude-code's.mcp.jsonbecomes two-space JSON and keeps its BOM and line endings;collision, except for integer-like keys;drift.Two new tests in
test/status.test.tspin those bytes (LF, and BOM + CRLF). The README states it, in thestatusrow and Upgrading → to 0.8.1.No
src/change other than the version literal, so no generated byte moves.Some commit bodies and subjects describe the state of the whole range rather than their own commit:
2d8e6e8says auto-maintenance is off "in test repos"; at that commit it is only off incli.test.ts.f6f3299's subject says "every test repository"; it covers the golden suites, and656b32baddsunify.test.ts.d532ab9's body says "whitespace-only differences"; its diff also documents escapes, number spelling and duplicate keys.The final range does what each one says.
Test plan
npm run typecheck: exit 0npm run build: exit 0npx vitest run --exclude test/ci.test.tson Linux: 762 passed / 5 skippedgit diff origin/main -- src/is the version literal only..git/COMMIT_EDITMSGand 25 more files). The pin tests fail when the emitter's indentation is mutated from 2 to 4.node-cli-revieweranddocs-author: round 2 clean; the last README commit was confirmed bydocs-author.test/ci.test.tsand Windows were not run locally)