This repository was archived by the owner on Sep 2, 2026. It is now read-only.
fix(tasks): keep draft PRs from proving the review stage - #168
Open
64ix wants to merge 2 commits into
Open
Conversation
An open PR used to hold its task in Review as soon as it referenced the Spec (or was assigned), even while still a GitHub draft. A draft is not ready for review, so it now proves nothing about the stage: - PrWorkflowFact carries isDraft; derivePrStage only accepts review from a ready (non-draft) open PR, so the stage waits for the ready-for-review flip. - An assigned open draft derives nothing, and the same Spec-derived fallback syncProject already performs decides instead. - The holding PR picked for display satisfies the exact predicate the stage was proven with — never a draft. - getStageAuthority always loads PR facts + the Spec link so the Task Detail Panel predicts syncProject exactly, including the draft fallback. Merged/closed drafts still prove shipped/triage as before, and a task already in Review is not downgraded when its PR is converted back to draft (the sync never regresses without a stronger fact).
Extend the draft rule: a draft PR no longer merely stays out of Review — it actively proves Implementing, so opening a draft moves the task there and marking it ready advances it to Review. - derivePrStage precedence is now ready > draft > merged > closed: a ready open PR proves `review`, an open draft (no ready PR present) proves `implementing`, then merged/closed as before. - Stage authority gains a `draft-pr` fact: it governs like `open-pr` (the next sync pass reasserts `implementing`), and its explanation tells the user to mark the PR ready for review instead of claiming the task is held in Review. - applyProvisionedStage lets any derived PR fact win — including the draft-derived `implementing` — keeping the provision hook aligned with what syncProject would write over the same facts. - CONTEXT.md's Workflow Stage / Assigned PR entries document that GitHub now proves `implementing` through an open draft. A task already in Review is pulled back to Implementing when its PR is converted back to draft — the same fact, asserted in the other direction.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
An open PR used to hold its task in Review as soon as it referenced the Spec (or was assigned to the task), even while it was still a GitHub draft. A draft is not ready for review, so the board now waits for the ready-for-review flip before deriving the stage:
PrWorkflowFactcarriesisDraft(loaded frompull_requests.is_draft), andderivePrStageonly acceptsreviewfrom a ready (non-draft) open PR.syncProjectalready performs decides instead, so the Task Detail Panel and the periodic pass can never diverge on a draft assignment.getStageAuthoritynow always loads PR facts + the Spec link (instead of short-circuiting on an assignment) — that early return was safe while an assignment always derived a stage; the draft rule makes the fallback reachable, so the panel must see the same facts.Unchanged by design:
shipped/triage(a merged PR is no longer a draft anyway; closing one unmerged still triages the task).Related issues
None on the tracker yet — captured from maintainer feedback ("quand la PR est en draft, ne la passe pas en review").
Testing
Local merge gate, all green on this branch's base:
pnpm run format,pnpm exec oxlint .,pnpm typecheckvitest run --project node --project main-db --project migrations --project scripts: 387 files / 3459 tests passedpr-workflow-derivation.test.ts: draft alone proves nothing; draft + merged →shipped; draft + ready → ready picked as holding PR; assigned draft falls back to Spec-derived / proves nothing link-less.board-sync-service.db.test.ts: the sync pass leaves a task inimplementing(and emits no stage event) while its Spec-referencing PR is an open draft; moves it toreviewonce marked ready; an assigned draft leaves the task untouched.Checklist