Repository navigation
feat(decisions): closing a decision as completed unblocks its task - #14
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ammar Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… "resumed" "resumed" clashes with the usage-limit session resume and the epic Pause/Resume. The two lines become `decision #<d> settled: <answer> — unblocked by decision via foreman@<host>` and `decision #<d> closed; read it before continuing — unblocked by decision via foreman@<host>`. fmt.decisionResumed, DECISION_RESUMED and decisionResumed() are renamed to match; README and the design spec quote the new lines. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s line counts If any decision naming task N was closed as NOT_PLANNED and opened after N was last unblocked, planDecisionResumes no longer unblocks N, even when another decision for N was closed as completed. Held tasks are collected first, then skipped; DUPLICATE and other reasons are still ignored. The Blocks line now tolerates leading and trailing spaces or tabs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s a task
unblockEdits takes an optional { blockedLast } that moves the label removal after the PR
verdicts and Status Ready, so a failed edit on the decision path leaves the task blocked with
the answer recorded. The owner's Unblock keeps the original order. Also drops dead code: the
`note` parameter of applyUnblock (no production caller left) and `host` from unblockEdits.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
runOnce keeps the tasks resumeSettledDecisions returns and reports didWork when any were unblocked outside a dry run, so the idle backoff resets and the claim follows on the next poll instead of up to half an hour later. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…rs unblock order Builder step 1 now reads any `decision #<n> …` comment from the foreman and follows it, running `gh issue view <n> --comments` first when the line says the decision was closed without an answer. Step 2 asks for `Blocks: #<issue>` alone on the last line with no indentation and only notes that the foreman unblocks the issue when the decision is closed. README: a settled decision also lifts the blocked-per-phase build stop, the lookback is about a week (7-8 days, the cutoff is a date), the decision path lifts the block last, and the known gaps name duplicate ledger lines from two foremen and the cross-Mac re-block window. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… window
Rule B only saw not-planned decisions closed in the last week, so one closed earlier no longer
held its task once a later decision was completed. listClosedDecisions takes
{ notPlanned: true }, which searches `reason:"not planned"` with no date; resumeSettledDecisions
makes that second read only when the first yields a candidate, merges the two lists by number
and plans again.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
| * way, e.g. closed by hand on GitHub. | ||
| */ | ||
| export function settledAnswer(comments: Comment[]): string | null { | ||
| for (const c of [...comments].sort((a, b) => a.createdAt.localeCompare(b.createdAt))) { |
There was a problem hiding this comment.
Settled answer is taken from any commenter, earliest wins. settledAnswer ignores c.author, so on this public repo any GitHub user can comment Settled: <text> on an open decision issue. When the owner then closes it as completed, the foreman quotes that stranger's text into the task ledger as decision #D settled: <text>, and roles/builder.md now tells the builder to "Follow that decision's answer". Because the earliest Settled: wins, an outsider who comments first also overrides the owner's real answer posted by the decisions page. Net effect: unauthenticated instructions injected into an unattended claude -p session. Restrict to comments authored by the foreman/owner login (the one the decisions page posts as), or to authors with write access.
There was a problem hiding this comment.
Fixed in a307576: a Settled: comment now counts only when its author has admin, maintain or write permission on the repository (one lookup per author per call); anyone else's is ignored, so the task unblocks with the writer's answer or, failing one, with "closed; read it before continuing".
There was a problem hiding this comment.
Follow-up in 049c77e: a failed access lookup now defers that task to the next tick instead of counting as a no, and with no writer's answer the ledger line names the writers the builder may follow (follow only: @…, or nobody — ask the owner), which roles/builder.md now obeys.
There was a problem hiding this comment.
Follow-up in d85349c: the builder now trusts a decision #<n> line only from the login that posted its own session line and acts only on lines since the latest block (no re-block loop), an unanswered completed close means follow the Recommendation, the plan no longer carries an untrusted answer, the not-planned read is newest-first, and a non-rate-limit 403 counts as no access with a warning.
… counts Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ilder may follow Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…lock loop Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…sume # Conflicts: # src/github.ts
Summary
Closing a
decisionissue as completed now unblocks the task it names: the foreman writes the answer to the task's ledger, then liftsblockedand sets Status Ready on the next tick. Part 1 ofdocs/superpowers/specs/2026-11-17-decisions-artifact-design.md; the claude.ai decisions page (part 2) is not in this PR.roles/builder.md): a builder's decision issue now has Question / Context / Options (A, B, …) / Recommendation and ends withBlocks: #<issue>. A resumed builder reads the foreman'sdecision #<n> …line first.src/decisions.ts, wired intorunOnce): readsdecisionissues closed in the last ~7 days, only on ticks with an openblockedissue. A task is unblocked when a decision naming it was closed as COMPLETED, opened after the task was last unblocked, no open decision still names it, no role session holds its claim, and no NOT_PLANNED decision in the same spell names it (that one is read with no date window).decision #<d> settled: <answer> — unblocked by decision via foreman@<host>ordecision #<d> closed; read it before continuing — …. The answer is the earliestSettled:comment on the decision.blockedremoved last (unblockEdits(…, { blockedLast: true })), so a partial failure leaves the task blocked with the answer recorded for the owner's Unblock. The owner's Unblock button is unchanged (same calls, same order, tests untouched).--dry-run).Owner decisions recorded
Known gaps (README)
blockedlabel removed by hand on GitHub writes no ledger line, so an earlier settled decision can release a later, unrelated block.Blocks:line and still need Unblock.Test plan
pnpm lint && pnpm typecheck && pnpm test && pnpm build(782 tests on this branch; 818 merged together with #target-branch, both green)🤖 Generated with Claude Code