Skip to content

squad files: prune and migration go through the shared-destination check (#52) - #84

Merged
AlexMKX merged 1 commit into
masterfrom
fix/prune-migrate-dest-52
Nov 19, 2026
Merged

AlexMKX merged 1 commit into
masterfrom
fix/prune-migrate-dest-52

Conversation

@AlexMKX

@AlexMKX AlexMKX commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Closes #52.

What remained after #83. The destination check covered only the files an apply writes. Pruning a removed agent, deleting a duplicate and migrating a legacy worker-* file all unlink paths outside that set. A mode/review.md link onto a managed file was therefore left dangling in two cases:

  • an empty roster applied with allow_remove: true pruned the file;
  • a plain apply migrated worker-a-b.md to grunt-a-b.md.

Change (src/squad-apply.js, applySquad). The files to prune, the duplicates and the migrations are now worked out before anything changes. All of them go through sharedDestinations together with the planned writes. If any of those paths is reached by another loadable agent name, or a directory cannot be listed, the apply is refused as collision with the paths named, and nothing is written or deleted. allow_remove still authorizes dropping a roster entry, not breaking another agent.

Documentation. The README gains a short section on the one-file-one-agent rule. It also records the accepted conservative limitation from the issue: a plain agents -> agent directory link loads each file twice under the same id, which would be harmless, but Squad still refuses it.

Tests (tests/regress-squad-files.test.js). Both fail on master:

  • pruning a file another loadable agent links to is refused, allow_remove or not;
  • migrating a legacy worker- file another loadable agent links to is refused: the link keeps its content, and no grunt- file is written.

🤖 Generated with Claude Code

…eck (#52)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AlexMKX
AlexMKX merged commit 8a98384 into master Nov 19, 2026
7 checks passed
@AlexMKX
AlexMKX deleted the fix/prune-migrate-dest-52 branch November 19, 2026 15:30
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.

Roster mutations can address the same file through different agent paths

1 participant