Repository navigation
feat: task approve records reapproved_at (spec 069) - #385
Conversation
A re-approval preserves approved_at by contract, so the only trace of the act was the phase string, which carries no time. Add reapproved_at, written only on the re-approval branch, so a consumer can tell a re-approval that just happened from one that never happened at all. Spec only; the code lands via the dark-factory pipeline.
The dark-factory run's half-state recovery committed another prompt's record (prompts/completed/283-lint-orphan-goal-block-scope.md) and another spec's status edit (specs/in-progress/067-bug-parked-exit-requires-registered-watch.md) into this worktree. Neither belongs in this PR; both are restored to their 955a2aa content.
There was a problem hiding this comment.
Chunk 1/3
The change is small, correct, and well-tested: reapproved_at is written only on the presence-based re-approval branch, using the instant captured before the guards, while approved_by/approved_at stay untouched; the zero-clock and terminal-row refusals both return before the key is set. Two non-blocking documentation/test-precision nits remain, and the five mechanical-funnel findings were verified as false positives (method calls and a help-string const, not package functions or enum values).
Chunk 2/3
The reapproved_at change is correct and the prompt artifact accurately describes it; stated intent was unavailable (gh not accessible in this pod), so the review used spec 069. One durable-test gap: the unit test the prompt prescribes as the AC5 'refresh' proof never seeds a prior reapproved_at, so it cannot distinguish an overwrite from a write-if-absent.
What
vault-cli task approveadvances a re-approved row tophase: planningwhile preservingapproved_byandapproved_at— a deliberate, documented contract. The only trace of the act of re-approval was therefore the phase string, which carries no time.This adds
reapproved_at, written only on the re-approval branch, with the current instant, refreshed by each re-approval.Why
A consumer that must react to a re-approval cannot distinguish "re-approved a minute ago" from "never re-approved". The concrete consumer is
claude-supervisor's decision-park resume leg, which resumes a closed worker only when the approval postdates the worker's last transcript turn — a re-approved row's preservedapproved_atpredates it by construction, so the leg never fires.The consuming half is bborbe/claude-supervisor#965.
Verification
go test ./pkg/ops/... ./pkg/cli/... ./integration/...— all three packages pass.approved_atunchanged, a second re-approval refreshing it, a terminal row refused with a byte-identical file, and the help naming the key.make precommitran green as the daemon's preflight baseline before the code was written.Scope
docs/task-writing.mdis deliberately untouched: its claim that the branch "never overwrites either key, never fabricates a missing one" stays true. The key's discovery surface is the command help.claude-supervisoris tracked separately.Deviation worth recording
The dark-factory run's half-state recovery committed two unrelated paths into this worktree — another prompt's record (
prompts/completed/283-lint-orphan-goal-block-scope.md) and another spec's status edit (specs/in-progress/067-bug-parked-exit-requires-registered-watch.md). Commit92dcb85restores both to their955a2aacontent. It was fixed forward rather than amended, so the intermediate commit8c467a6also carries a misleading message ("Scope ORPHAN_GOAL detection…") while its content is this spec'sapproved → verifyingtransition.Task: b0a5c3a2-944c-4ace-8272-d11400e74fa8