Skip to content

feat: task approve records reapproved_at (spec 069) - #385

Merged
bborbe merged 6 commits into
masterfrom
feat/task-approve-reapproved-at
Nov 18, 2026
Merged

bborbe merged 6 commits into
masterfrom
feat/task-approve-reapproved-at

Conversation

@bborbe

@bborbe bborbe commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

What

vault-cli task approve advances a re-approved row to phase: planning while preserving approved_by and approved_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 preserved approved_at predates 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.
  • The spec's own behavioural probe passes, with the file showing the intended shape:
    approved_at:   2026-11-18T21:42:18.810345+01:00   (preserved from the first approval)
    reapproved_at: 2026-11-18T21:42:20.987058+01:00   (the re-approval)
    phase: planning
    
    It asserts all eight acceptance criteria: no key on a first approval, the key on a re-approval, approved_at unchanged, a second re-approval refreshing it, a terminal row refused with a byte-identical file, and the help naming the key.
  • make precommit ran green as the daemon's preflight baseline before the code was written.

Scope

  • docs/task-writing.md is 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.
  • The consuming change in claude-supervisor is 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). Commit 92dcb85 restores both to their 955a2aa content. It was fixed forward rather than amended, so the intermediate commit 8c467a6 also carries a misleading message ("Scope ORPHAN_GOAL detection…") while its content is this spec's approved → verifying transition.

Task: b0a5c3a2-944c-4ace-8272-d11400e74fa8

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.
@bborbe
bborbe marked this pull request as ready for review November 18, 2026 21:20

@ben-s-pull-request-reviewer ben-s-pull-request-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Chunk 3/3

@bborbe
bborbe merged commit b46d4a2 into master Nov 18, 2026
9 checks passed
@bborbe
bborbe deleted the feat/task-approve-reapproved-at branch November 18, 2026 22:00
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.

1 participant