feat(pr): check the roadmap before opening a PR (phase 1, part 3) #11

Merged
neerdoc merged 25 commits from feat/phase-1-pr-roadmap-check into main 2026-11-17 11:49:01 +00:00
Owner

Part 3 of Phase 1: roadmap check in pr.sh

scripts/pr.sh now checks the roadmap of the phase before it opens a PR, as
AGENTS.md requires ("Roadmap checklist before the PR"): completed checklist
items are ticked [x] in docs/roadmap/phase-N-*.md on the part's branch, in
the PR itself. The outdated "After this PR is merged" reminder is removed. This
completes Phase 1 (parts 1 and 2 are merged); roadmap items P1-10 to P1-13 are
ticked in their own commit. The project works at effort level tool.

The check

  • A head branch named <type>/phase-N-<part> (review and fix sub-branches
    included) gives the phase N. The roadmap file is the first
    docs/roadmap/phase-N-*.md on the head branch. Any other head, or a phase
    with no roadmap file, has no check and no message.
  • The check reads the committed state with git, not the working tree: whether
    the roadmap file is changed on the head relative to the base, and which items
    of the phase are still unticked (- [ ] P<N>-<n> ).
  • Roadmap changed, items unticked: the items are listed for information and
    the PR goes on. All ticked: no message.
  • Roadmap not changed, items unticked: the items are listed and, in an
    interactive run, the script asks whether to open the PR anyway. Without a
    terminal it opens no PR and exits 1.
  • New flag --no-roadmap skips the check silently. A head or base that
    resolves to no branch (local, or origin/<name>) stops the script with a
    message. Names, files and listed lines are escaped as in the issue scripts.
  • After the PR is created only PR created: <url> is printed.
  • Also fixed in pr.sh: a missing value after an option gives the usage, a
    failed request prints Error: and exits 1 (it used curl's status), and the
    default head is read from the repository root.

Design, tests and documents

  • docs/design/pr-roadmap-check.md (DE-R1 to DE-R5, 129 lines).
  • tests/pr.bats: 131 tests, run in scratch git repositories against a closed
    local port, with no network and no stand-in for the git system. A passing
    check ends in the failed request; a refusal ends before it. Two tests are
    verified by inspection (the success line, and a response with content); the
    acceptance criteria are in tests/acceptance-criteria.md.
  • Last run: 1,205 tests, 0 failed, 4 skipped (the part 1 rollback branches and
    the success line of pr.sh).
  • README row for pr.sh.

Issues, audit and review

  • Closed: 0002 (this part) and 0003 (parts 1 and 2).
  • Audit: no issues (reports/audit-pr-roadmap-check.md).
  • Review 001 (Opus): one Medium (the tests passed when the script never made
    the request), resolved by requiring the failed-request line in the tests,
    and one Low, deferred as 0065 (the check reads local branches). A deferred
    issue 0066 records the token on curl's command line, unchanged from main.
  • Review 002: one Medium deferred as 0067 (the pass-side tests accept extra
    text on silent paths) and one Low resolved. The records are in
    docs/reviews/phase-1-pr-roadmap-check/review-001 and
    docs/reviews/phase-1-pr-roadmap-check/review-002.

Not covered

A real git system (the success line and a response with content); Linux; the
CI milestone sync.

🤖 Generated with Claude Code

## Part 3 of Phase 1: roadmap check in pr.sh `scripts/pr.sh` now checks the roadmap of the phase before it opens a PR, as `AGENTS.md` requires ("Roadmap checklist before the PR"): completed checklist items are ticked `[x]` in `docs/roadmap/phase-N-*.md` on the part's branch, in the PR itself. The outdated "After this PR is merged" reminder is removed. This completes Phase 1 (parts 1 and 2 are merged); roadmap items P1-10 to P1-13 are ticked in their own commit. The project works at effort level `tool`. ### The check - A head branch named `<type>/phase-N-<part>` (review and fix sub-branches included) gives the phase N. The roadmap file is the first `docs/roadmap/phase-N-*.md` on the head branch. Any other head, or a phase with no roadmap file, has no check and no message. - The check reads the committed state with git, not the working tree: whether the roadmap file is changed on the head relative to the base, and which items of the phase are still unticked (`- [ ] P<N>-<n> `). - Roadmap changed, items unticked: the items are listed for information and the PR goes on. All ticked: no message. - Roadmap not changed, items unticked: the items are listed and, in an interactive run, the script asks whether to open the PR anyway. Without a terminal it opens no PR and exits 1. - New flag `--no-roadmap` skips the check silently. A head or base that resolves to no branch (local, or `origin/<name>`) stops the script with a message. Names, files and listed lines are escaped as in the issue scripts. - After the PR is created only `PR created: <url>` is printed. - Also fixed in `pr.sh`: a missing value after an option gives the usage, a failed request prints `Error: ` and exits 1 (it used curl's status), and the default head is read from the repository root. ### Design, tests and documents - `docs/design/pr-roadmap-check.md` (DE-R1 to DE-R5, 129 lines). - `tests/pr.bats`: 131 tests, run in scratch git repositories against a closed local port, with no network and no stand-in for the git system. A passing check ends in the failed request; a refusal ends before it. Two tests are verified by inspection (the success line, and a response with content); the acceptance criteria are in `tests/acceptance-criteria.md`. - Last run: 1,205 tests, 0 failed, 4 skipped (the part 1 rollback branches and the success line of `pr.sh`). - README row for `pr.sh`. ### Issues, audit and review - Closed: 0002 (this part) and 0003 (parts 1 and 2). - Audit: no issues (`reports/audit-pr-roadmap-check.md`). - Review 001 (Opus): one Medium (the tests passed when the script never made the request), resolved by requiring the failed-request line in the tests, and one Low, deferred as 0065 (the check reads local branches). A deferred issue 0066 records the token on curl's command line, unchanged from `main`. - Review 002: one Medium deferred as 0067 (the pass-side tests accept extra text on silent paths) and one Low resolved. The records are in `docs/reviews/phase-1-pr-roadmap-check/review-001` and `docs/reviews/phase-1-pr-roadmap-check/review-002`. ### Not covered A real git system (the success line and a response with content); Linux; the CI milestone sync. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Resolves 002 of review 001 of phase-1-pr-roadmap-check.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Resolves 001 of review 001 of phase-1-pr-roadmap-check.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Resolves 001 of review 002 of phase-1-pr-roadmap-check.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Resolves 002 of review 002 of phase-1-pr-roadmap-check.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
WulfScience-FOSS/wulf-dev!11
No description provided.