Skip to content

fix(cli): say before the first task that task finish needs a reporting check (#398) - #410

Merged
radiusred-cody[bot] merged 5 commits into
mainfrom
task/398-say-before-the-first-task-that-task-fini
Oct 10, 2026
Merged

radiusred-cody[bot] merged 5 commits into
mainfrom
task/398-say-before-the-first-task-that-task-fini

Conversation

@radiusred-cody

Copy link
Copy Markdown
Contributor

Closes #398

Task #398 — started at #398 (comment). Covers M21-R5 (adopts capture #391, which task finish handles after the merge).

A fresh repository now learns before its first task that task finish needs a reporting check, instead of meeting refused[NO_CHECKS] after the task was chartered, built and approved (radiusred/trading-hub#4). A CLI patch: additive next: and note: lines only — no verb argument, refusal code, exit status or SPEC section changes.

What changed

  • init's next: lines (hub and spoke mode alike) say that task finish requires at least one check reporting on every pull request and refuses NO_CHECKS without one (SPEC §8), and that a repository without a workflow on pull_request adds one before its first task, pointing at the ten-line workflow in docs/first-milestone.md. Unconditional: init reads no workflow. The printing moved into initNext so both modes are pinned exactly.
  • A venue read: Tracker.Workflows(repo) over GET /repos/{o}/{r}/actions/workflows (paginated) — path and state per workflow; the fake venue gains it.
  • The note in task new (the --repo spoke, or the current repository) and task start (the task's repository, beside the task finish is refused by gh pr merge's client-side BLOCKED check even when the caller holds the ruleset bypass GitHub would honour #392 policy notes on the branch-creating path): when no active workflow under .github/workflows/ has an on: naming pull_request — as one event, in a list, or as a map key; pull_request_target does not count, nor a disabled or GitHub-managed workflow — one note: says task finish will refuse NO_CHECKS until a check reports on the task's pull request, and to add a workflow on pull_request (on the task's branch or before it) and let it report. Any failed read (listing 403/404, an unreadable or unparseable workflow file) says nothing. No refusal, no exit change.
  • CLI.md: init gains a "Before the first task" paragraph cross-referencing NO_CHECKS; task finish's NO_CHECKS refusal points back at init, task new and task start; the task new and task start entries list the new reads and the note.
  • CHANGELOG under [Unreleased].

Tests

  • TestOnPullRequest: the scalar, flow-list, block-list, map and flow-map forms of on:, a quoted key; push-only, pull_request_target alone (in every form) and a job named pull_request do not count; non-YAML is an error.
  • TestTaskStartNotesARepositoryWithNoPullRequestWorkflow / TestTaskNewNotesARepositoryWithNoPullRequestWorkflow: the note for no workflow at all, a workflow lacking pull_request, only pull_request_target, a disabled workflow, and only a GitHub-managed one; silence for one workflow on pull_request among others, listing 404 and 403, an unreadable file, and a file that is not YAML; the read is asked about the task's repository.
  • TestInitNextSaysTaskFinishNeedsAReportingCheck pins the next: lines for both modes; TestInitPrintsTheReportingCheckRequirement checks initCmd prints them before the action-needed block.
  • TestWorkflows / TestWorkflowsNone: the listing call's shape and its parse.
  • The existing task new/start fakes default to a repository with a pull_request workflow, so their output pins stand unchanged.
  • Removing the two wiring lines in task.go fails all ten note-expecting cases.

Decisions

No deviations.

🤖 Generated with Claude Code

radiusred-cody Bot and others added 5 commits October 10, 2026 23:46
Workflows reads GET /repos/{o}/{r}/actions/workflows, every page, and
returns each workflow's path and state. A repository with no workflow
answers an empty listing rather than an error, which is what lets the
note task new and task start will print stay silent on a failed read
without swallowing the case it exists for. The fake venue gains it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n every pr (#398)

A fresh repository has no workflow, and task finish refuses NO_CHECKS on
a pull request that reports no check (SPEC §8). init now says so in its
next: lines, hub and spoke mode alike: at least one check must report on
every pull request, and a repository without a workflow on pull_request
adds one before its first task.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…est workflow (#398)

When the task's repository has no active workflow whose on: names
pull_request (as one event, in a list, or as a map key; never
pull_request_target), both verbs print one note: that task finish will
refuse NO_CHECKS until a check reports on the task's pull request, and
to add a workflow that runs on pull_request and let it report. Any read
that fails, the listing or a workflow file, says nothing. No refusal
and no exit status change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… finish (#398)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ask (#398)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@radiusred-cody radiusred-cody Bot linked an issue Oct 10, 2026 that may be closed by this pull request

@radiusred-checky radiusred-checky Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved — M21-R5 stays within the stated v2.1 CLI-patch scope and satisfies
#398's plan, the M21-R5 requirement on #393, and adopted capture #391.

Reviewed the diff before the PR narrative, then #398 (including its Plan and
two Decisions), #393, and #391. The plan and Decisions precede the first
commit; the start record and task branch are present. #409 is open and
unlabelled, has the required option-2 proposal, reason for its 2.2 deferral,
and links to both #391 and #398; the Decision links it too.

Checked the workflow read and trigger parser: scalar, sequence, block-map and
flow-map on: forms are covered; pull_request_target is excluded. yaml.v3
node parsing retains the literal on key, so the YAML 1.1 boolean-key trap is
not present. Disabled and GitHub-managed workflows deliberately do not count,
and a listing/file/parse failure is silent exactly as the recorded Decision
specifies. Both verbs exercise all ten repository cases, emit one advisory
note with NO_CHECKS and its remedy, and retain their existing exits/refusals.
The existing fakes now default to a pull-request workflow, preserving older
output assertions.

The exact hub and spoke init lines are pinned. They match SPEC §8 and the
CLI.md NO_CHECKS text; docs/first-milestone.md has the linked no-path-filter
pull_request workflow. I built the binary and ran init in an isolated scratch
repository; it printed those lines. task new and task start have no dry-run
surface, so I did not invoke their writing paths.

Record and hygiene checks: the PR closes #398 alone, its body links the start
record, CHANGELOG is at the top of Unreleased and ends (#398), all five commit
subjects are conventional/lowercase, reference (#398), and are within 100
characters. feat(tracker) is acceptable here: it is the internal additive
read supporting the additive CLI notice, not a semver or protocol claim.

Verified: go test ./..., go vet ./..., tracked-source gofmt -l, build,
and git diff --check; the PR's two CI checks are green.

@radiusred-cody
radiusred-cody Bot merged commit 8d9c907 into main Oct 10, 2026
2 checks passed
@radiusred-cody
radiusred-cody Bot deleted the task/398-say-before-the-first-task-that-task-fini branch October 10, 2026 22:55
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.

Say before the first task that task finish needs a reporting check

0 participants