Repository navigation
Description
Goal
A hub scaffolded by init has no workflow; its first task is chartered, implemented, reviewed and approved before task finish --dry-run refuses NO_CHECKS (radiusred/trading-hub#4, 2026-10-09). Close the gap without scaffolding anything: (1) init's next: lines say that task finish requires at least one check reporting on every PR and that a repository without a workflow adds one before its first task; (2) task new and task start emit a note: when the target repository has no workflow triggered on pull_request; (3) CLI.md cross-references NO_CHECKS from the init and task finish entries. The scaffolded always-reporting workflow (#391 option 2) is deferred to protocol 2.2 — record that as a Decision and re-file it as a capture. Tests for the note on a workflow-less repository.
Requirements
M21-R5
Adopts
- A hub scaffolded by init cannot finish its first task (NO_CHECKS): say so at init, or scaffold a reporting workflow #391 — A hub scaffolded by init cannot finish its first task (NO_CHECKS): say so at init, or scaffold a reporting workflow
Plan
Covers M21-R5 (adopts #391; option 1 + option 3, option 2 deferred to 2.2). A CLI patch: additive note: and next: lines only — no verb argument, refusal code, exit status or SPEC section changes.
init'snext:lines (internal/cli/init.go), hub and spoke mode alike: one morenext:paragraph saying thattask finishrequires at least one check reporting on every pull request —NO_CHECKS, SPEC §8, the deterministic gate cannot be satisfied by absence — and that a repository without a workflow onpull_requestadds one before its first task. Unconditional: init reads no workflows.- A tracker read for workflows (
internal/tracker):Workflows(repo)overGET /repos/{o}/{r}/actions/workflows(paginated), returning each workflow's path and state; the fake venue gains it. That listing answers 200 with zero workflows for a repository that has none (the contents listing of.github/workflowsanswers 404 there, indistinguishable from a repository the token cannot see), so a read failure can stay silent without swallowing the case the note is for. - Trigger detection (
internal/cli): eachactiveworkflow under.github/workflows/is read from the default branch (FileContent) and its top-levelon:parsed with yaml.v3 nodes — scalar (on: pull_request), sequence (on: [push, pull_request]) and mapping (on:\n pull_request:) forms.pull_requestcounts;pull_request_targetdoes not. Disabled workflows do not run and do not count; GitHub-managed dynamic workflows (Pages, Dependabot — no file in the repository) are not read. - The note in
task new(target =--repo, or the current repository) andtask start(the task's repository, on the branch-creating path 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): when no workflow triggers onpull_request— none at all, or none whoseon:includes it — onenote:sayingtask finishwill refuseNO_CHECKSuntil a check reports on the task's pull request, and the capture's remedy: add a workflow that runs onpull_request(on the task's own branch or before it) and let it report. Any read failure — the listing (403/404) or a workflow file — says nothing. No refusal, no exit change. - CLI.md: the
initentry's printed lines and a cross-reference toNO_CHECKSundertask finish;task finish'sNO_CHECKSrefusal points back atinit,task newandtask start; thetask new/task startentries list the new reads and the note. - Tests: the
next:lines pinned for hub and spoke; the note intask newandtask startfor a repository with no workflows and with one lackingpull_request, silence when one has it and when the read fails (listing 403/404, a file unreadable); the trigger detection table (the three forms,pull_request_targetalone not counting, a disabled workflow not counting). Existing fakes default to a reporting workflow so their output pins stand. - CHANGELOG under
[Unreleased], ending (Say before the first task that task finish needs a reporting check #398). - Option 2 deferred: a Decision attributed to the coordination layer on Say before the first task that task finish needs a reporting check #398, and a new unlabeled backlog capture for the scaffolded always-reporting workflow, linked from it.
Ask-the-human points
None identified yet — the implementer adds any before starting.
Activity
radiusred-cody commentedon Oct 10, 2026
Decision: (the coordination layer's, settled on #391 and in M21-R5 — recorded here, not re-opened) #391's options 1 and 3 ship in this task:
init'snext:lines state the reporting-check requirement,task newandtask startprint anote:when the target repository has no workflow onpull_request, and CLI.md cross-referencesNO_CHECKSfrominitandtask finish. Option 2 —initscaffolding an always-reporting workflow (a conventional-commit lint onpull_request, opt-out flag) — is deferred to protocol 2.2 and re-filed as the backlog capture #409.Trade-off: a fresh repository still cannot finish its first task without adding a workflow by hand; it is now told so before the task is chartered and again when it is started, instead of after review.
Rejected: scaffolding the workflow in v2.1.1 — it writes files every adopter inherits and adds an argument to
init, a protocol-level choice that the 2.1 bedding-in rule keeps out of a CLI patch.radiusred-cody commentedon Oct 10, 2026
Decision: the note reads
GET /repos/{o}/{r}/actions/workflows(paginated), keeps the workflows whose state isactiveand whose path is under.github/workflows/, reads each from the default branch and parses its top-levelon:(scalar, sequence or mapping);pull_requestcounts,pull_request_targetdoes not. The note fires when that leaves no workflow triggered onpull_request— including a listing of zero. Any read that fails — the listing (403/404) or one workflow file — says nothing at all.Trade-off: a workflow the listing names whose file is not on the default branch (one that has only run from a pull request so far) cannot be read, so the note stays silent there rather than guess. GitHub-managed dynamic workflows (Pages, Dependabot, CodeQL default setup) have no file to read and are not counted, so a repository whose only reporting check is CodeQL default setup would see the note; its wording is about workflow files in
.github/workflowsand saystask finishrefuses until a check reports, which stays true there.Rejected: the contents listing of
.github/workflows— it answers 404 both for a repository with no workflow directory (the case the note exists for) and for one the token cannot see, so "read failures say nothing" would have swallowed the case. Counting any listed workflow without reading itson:— a push-only workflow reports nothing on a pull request, which is exactly #391's situation in a repository that has CI for releases only.radiusred-cody commentedon Oct 10, 2026
Started by @radiusred-cody[bot].
feat(tracker): the venue lists a repository's actions workflows (#398)
fix(cli): init's next lines say task finish needs a check reporting o…
fix(cli): task new and task start note a repository with no pull_requ…
docs: the cli reference cross-references no_checks from init and task…
docs: changelog entry for the reporting-check note before the first t…
feat(tracker): the venue lists a repository's actions workflows (#398)
fix(cli): init's next lines say task finish needs a check reporting o…
fix(cli): task new and task start note a repository with no pull_requ…
docs: the cli reference cross-references no_checks from init and task…
docs: changelog entry for the reporting-check note before the first t…