Repository navigation
fix: tolerate CRLF casting manifests - #2269
Conversation
🟡 Impact Analysis — PR #2269Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affectedroot (2 files)
squad-cli (1 file)
squad-sdk (3 files)
tests (6 files)
|
🛫 PR Readiness Check
PR Scope: 📦🔧 Mixed (product + infrastructure)
|
| Status | Check | Details |
|---|---|---|
| ❌ | Single commit | 3 commits — consider squashing before review |
| ✅ | Not in draft | Ready for review |
| ✅ | Branch up to date | Up to date with dev |
| ❌ | Copilot review | No Copilot review yet — it may still be processing |
| ✅ | Changeset present | Changeset file found |
| ✅ | Scope clean | No .squad/ or docs/proposals/ files |
| ✅ | No merge conflicts | No merge conflicts |
| ✅ | Copilot threads resolved | 0 active Copilot thread(s) resolved (2 outdated skipped) |
| ❌ | CI passing | 15 check(s) still running |
Files Changed (12 files, +199 −19)
| File | +/− |
|---|---|
.changeset/casting-crlf-manifest-tolerance.md |
+6 −0 |
.gitattributes |
+3 −0 |
packages/squad-cli/src/cli/core/upgrade.ts |
+14 −1 |
packages/squad-sdk/src/casting/durable-registry.ts |
+54 −11 |
packages/squad-sdk/src/casting/index.ts |
+1 −0 |
packages/squad-sdk/src/config/init.ts |
+6 −6 |
test/casting-durable-registry.test.ts |
+73 −0 |
test/cli/doctor.test.ts |
+18 −1 |
test/cli/init-upgrade-parity.test.ts |
+1 −0 |
test/cli/init.test.ts |
+1 −0 |
test/cli/upgrade.test.ts |
+21 −0 |
test/init.test.ts |
+1 −0 |
Total: +199 −19
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
🏗️ Architectural Review
Automated architectural review — informational only. |
There was a problem hiding this comment.
🟡 Changes recommended
Normalization bypasses shared writer locking and atomic replacement, risking lost updates and unrecoverable casting files.
2 open issues
What changed in this PR
Addresses #2266 by tolerating CRLF casting files in manifest validation and adding LF normalization during upgrade.
Changes:
- Accept exact or LF-normalized hashes during validation and recovery.
- Pin casting JSON to LF during initialization and upgrade.
- Add SDK and CLI regression coverage.
| File | Description |
|---|---|
| test/init.test.ts | Checks SDK initialization’s LF rule. |
| test/cli/upgrade.test.ts | Covers CRLF normalization during upgrade. |
| test/cli/init.test.ts | Checks CLI initialization’s LF rule. |
| test/cli/init-upgrade-parity.test.ts | Includes LF rule in parity checks. |
| test/cli/doctor.test.ts | Covers CRLF manifest validation. |
| test/casting-durable-registry.test.ts | Covers CRLF validation, preflight, and reads. |
| packages/squad-sdk/src/config/init.ts | Adds casting LF attributes. |
| packages/squad-sdk/src/casting/durable-registry.ts | Accepts CRLF-normalized hashes. |
| packages/squad-cli/src/cli/core/upgrade.ts | Adds LF attributes and normalization. |
| .gitattributes | Pins repository casting JSON to LF. |
| .changeset/casting-crlf-manifest-tolerance.md | Declares SDK and CLI patch releases. |
Review effort: Balanced
46f6ea0 to
4a5bcfb
Compare
|
Rebased and manually folded onto Conflict resolution kept #2303's upgrade contract intact: plan → verified backup → overwrite, byte-preserved The two Copilot findings are fixed separately in
Validation:
Force-push used an exact lease on prior remote tip |
Normalize CRLF worktree content when verifying casting hashes and pin casting JSON files to LF during init and upgrade. Closes github#2266 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 58833b4b-f8e7-42b8-bf04-9121f362f68c
Hold the shared casting writer lock across recovery, validation, reread, and LF normalization. Replace each JSON file through a flushed sibling temporary file and atomic rename. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 995eea17-c356-4912-90ea-5e5b144e7ba9
41d842d to
3ac4484
Compare
|
Rebased the previously reviewed The two commits replayed cleanly. The earlier #2303-compatible resolution remains intact: upgrade still follows the current plan / verified-backup / overwrite flow, preserves user-owned Validation:
Force-push used an exact lease on the live prior remote tip |

Summary
.squad/casting/*.jsonto LF during init and upgrade, and normalize existing casting JSON during upgradesquad doctor, andsquad upgradeValidation
SKIP_BUILD_BUMP=1 npm run buildnpx vitest run --no-file-parallelism --testTimeout=30000 --hookTimeout=30000 test/casting-durable-registry.test.ts test/casting-legacy-migration.test.ts test/cli/doctor.test.ts test/cli/upgrade.test.ts test/cli/init-upgrade-parity.test.ts test/cli/init.test.ts test/init.test.ts(300 passed)node --test test/*.test.cjs(134 passed)Fixes #2266