You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add atomic repository-scoped create-if-absent state operation #1947
Squad state MCP exposes unconditional writes but no atomic key creation. Workflows requiring one canonical artifact can race, allowing one creator to overwrite another.
Required behavior
Add a create-if-absent operation that:
Atomically creates a repository-scoped state key only when absent.
Supports local, orphan, notes, and two-layer backends.
Returns success to exactly one concurrent creator and a typed conflict to all others.
Fails closed when existence, repository identity, or backend outcome is uncertain.
Never overwrites existing content.
Preserves current unconditional write behavior for backward compatibility.
Is exposed through StorageProvider, ToolRegistry, and state-mcp.
Internal Git-ref CAS is insufficient by itself: it protects ref advancement, not conditional creation of a repository state key.
Tests
For every backend, run two concurrent creators against the same absent key and prove:
Exactly one succeeds.
Exactly one reports conflict.
The winning content is preserved.
No partial or duplicate state remains.
Also test existing keys, repository isolation, backend uncertainty, and two-layer disagreement or failure.
Documentation and release
Document semantics, conflict and error contracts, repository scoping, backend guarantees, MCP tool registration, migration guidance, and the first released CLI version containing the operation.
Related context: issue #1211 and commit 8f7e7f7 added ref CAS; PR #1200 connected backends to MCP; proposal #1829 states atomic read-modify-write still needs implementation.
Andreja integration acceptance
After release:
Update the exact @bradygaster/squad-cli version pin from 0.12.0.
Add the create-if-absent tool to the allowlist.
Restart the MCP server.
Verify the operation appears in tools/list.
Verify exclusive Scribe can atomically create the canonical retrospective.
Activity
fix(state): harden atomic create semantics
test(state): align atomic create integration
test(state): sync workflow compatibility
fix: refresh gh-aw integrity digest
fix: preserve append-only state policy
Merge pull request #1948 from cyrusjamula/u/cyrusjamula/squad/1947-at…
feat(state): atomic repository-scoped createIfAbsent for all backends