← Back to list
01Issue
FeatureOpenSwamp CLIPublic
AssigneesNone
Relationships
#5259 Promotion: the local record of what was sent, promotions.json
Opened by zack · 11/30/2026
Problem
A promote has to remember what it sent (design/surfaces/workspace-promotion.md, swamp-club#5250). The workspace registry cannot hold that: the schema of workspaces.json drops keys it does not know, so an older swamp that rewrites the file would lose the link.
Change
After swamp-club#5256, which adds ItemDigest.
PromotionRecord: aggregate root for one workspace name and server address. It holds the local repoId, the name on the server, the digest last sent per item, and the pending pauses, each with the server's id of its workflow. One workspace may have a record per server.- A record whose local repoId is not the workspace's is not used, and says so.
- Operations: start a record empty, set and drop a last-sent digest, add, settle and drop a pending pause.
PromotionRecordRepositoryover<config dir>/promotions.json: schema-versioned, written atomically under its own lock, mode 0600, and never rewritten when it cannot be read, asWorkspaceRegistryFileRepositorydoes. A file from a later schema version is unreadable, not empty.
The client command that uses it is separate work. The mode is not in the doc; add it to "The local record" in the same PR.
Tests
- Property test: the record's invariants hold over random commands, and a record used by another repo is refused.
- Integration test of the repository beside an unknown later schema version, an unreadable file and a concurrent writer.
- The record survives an older swamp rewriting
workspaces.json.
Done when
The tests pass and nothing reads the file except the repository.
Where to look
design/surfaces/workspace-promotion.md: "The local record", "Schedules"src/infrastructure/persistence/workspace_registry_file_repository.ts,src/infrastructure/persistence/file_lock.ts,src/infrastructure/persistence/atomic_write.ts
02Bog Flow
Open
No activity in this phase yet.
03Sludge Pulse
Sign in to post a ripple.