Skip to content

0.8.1: end the maintenance.lock CI flake; document how an adopted JSON file is rewritten - #21

Merged
llima merged 9 commits into
mainfrom
fix/cli-0-8-1
Oct 4, 2026
Merged

llima merged 9 commits into
mainfrom
fix/cli-0-8-1

Conversation

@llima

@llima llima commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Version bumped to 0.8.1 (patch). Merging publishes craftar@0.8.1 to npm after approval in the npm environment.

  • 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() in test/cli.test.ts no longer reads .git/. Every test repository (cli, unify and the golden suites) turns maintenance.auto and gc.auto off. No "Forge untouched" guarantee depended on .git/: nothing in src/ commits.

  • Adopted JSON, ruled by design. A .json file not yet in craftar.lock that parses to the planned value with its keys in the same order is adopt, and the first sync rewrites it with the planned bytes:

    • claude-code's .mcp.json becomes two-space JSON and keeps its BOM and line endings;
    • Kiro's JSON files become CRLF without a BOM;
    • a different key order is a collision, except for integer-like keys;
    • a locked JSON reformatted by hand is drift.

    Two new tests in test/status.test.ts pin those bytes (LF, and BOM + CRLF). The README states it, in the status row 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:

    • 2d8e6e8 says auto-maintenance is off "in test repos"; at that commit it is only off in cli.test.ts.
    • f6f3299's subject says "every test repository"; it covers the golden suites, and 656b32b adds unify.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 0
  • npm run build: exit 0
  • npx vitest run --exclude test/ci.test.ts on Linux: 762 passed / 5 skipped
  • Oracle: skipped (no fixture available). No emitted byte changes; git diff origin/main -- src/ is the version literal only.
  • The new snapshot test failed before the fix (it listed .git/COMMIT_EDITMSG and 25 more files). The pin tests fail when the emitter's indentation is mutated from 2 to 4.
  • node-cli-reviewer and docs-author: round 2 clean; the last README commit was confirmed by docs-author.
  • CI on Linux and Windows (test/ci.test.ts and Windows were not run locally)

llima added 9 commits October 3, 2026 20:36
…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.
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.
@llima
llima merged commit 0228d69 into main Oct 4, 2026
8 checks passed
@llima
llima deleted the fix/cli-0-8-1 branch October 4, 2026 19:54
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