S1: Drop retain-window model from internal/keys #11
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
posta/server#11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
posta/server#10 — Absorb spec §4.1/§4.2 canonicalization and §9 key-management simplification
What to build
Simplify the server's
internal/keyspackage so it matches SPEC §9 as editedin
posta/speccommit7dbbf57: a key is either listed inkeys.jsonor itisn't. There is no "retiring" state, no retain window, no rotation ceremony.
Removing a key from the file stops it being honored by verifiers within the
timestamp window (5 min) via the actor-doc cache cap.
End-to-end behaviour after this slice:
keys.json(which may carry a strayretiringSincefield from earlier server versions) still loads cleanly on daemon start —
the field is silently ignored by JSON unmarshalling of the simplified struct.
keys.jsonis a flat array of{id, publicKey, privateKey, createdAt}.PublishedKeysdoc comment no longer references the retain window.runner error path see one consistent model.
Acceptance criteria
Keystruct ininternal/keys/keys.gono longer has aRetiringSincefield.Current()returns the most-recently-created entry without filtering on any retiring/retired state. Tie-breaking whencreatedAtstrings are equal is deterministic (slice position is acceptable, matching the convention used inposta/spec'skey-management-via-actor-docbranch).PublishedEntries()returns every key in the file. Its doc comment is rewritten to drop "current plus retiring keys still in the file" wording.internal/keys/keys.gono longer references "rotation" as a separate workflow.internal/daemon/runner.gothat today readskeys.json has no current (non-retiring) keyis updated to no longer leak the dropped concept.inbox.Options.PublishedKeysno longer references "retiring keys still inside their retain window."internal/keys/keys_test.go(or extension of existing tests) locks in:keys.jsoncontaining aretiringSincefield unmarshals successfully and the field is ignored.Current()on a multi-key file returns the most-recently-created entry.PublishedEntries()returns every key in the file regardless of any extra JSON fields.go build ./...andgo test ./...pass.Blocked by
None — can start immediately. Independent of the spec library's §4.1 work.
The spec repo's
key-management-via-actor-docbranch already lands ananalogous simplification on its own (TUI-side)
internal/keys; that diff isuseful prior art but the server's copy is independent.
Acceptance criteria above already function as an agent brief. This slice is independent of the spec library's §4.1 work — it can be picked up immediately.
Prior art: the
posta/speckey-management-via-actor-docbranch (now merged tomainas commit77d4b8b) lands an analogous simplification on the spec repo's own (TUI-side)internal/keys. The diff is useful reference but the server's copy is independent.Category: enhancement
State: ready-for-agent