Skip to content

fix(review-runs): census the prefixes Step 2 prices, not just tend-* - #889

Merged
max-sixty merged 3 commits into
mainfrom
fix/issue-888
Aug 7, 2026
Merged

fix(review-runs): census the prefixes Step 2 prices, not just tend-*#889
max-sixty merged 3 commits into
mainfrom
fix/issue-888

Conversation

@tend-agent

@tend-agent tend-agent commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Step 1 of review-runs enumerates the fleet with a hard-coded single prefix, while Step 2 documents the opposite — that non-tend-* workflows using the tend action are in scope and their prefixes come from the repo's running-tend skill. The two steps therefore disagree about what the fleet is, and Step 1 wins: a workflow outside the tend- prefix is never classified for duration, never near-timeout-checked, and never reaches Step 3's log analysis. Nothing in the output marks the omission.

Measured on this repo

Over a 24 h window (SINCE=2026-08-06T08:42:07Z), review-reviewers — which runs the tend composite action but is not named tend-*, and which tend's own running-tend overlay already lists as an extra prefix for Step 2 — has 21 completed runs that Step 1 never sees:

$ gh api repos/max-sixty/tend/actions/workflows --jq '.workflows[] | select(.name | startswith("tend-")) | .name' | grep -c '^review-reviewers$'
0
$ gh api "repos/max-sixty/tend/actions/workflows/250009605/runs?created=>=$SINCE&status=completed&per_page=1" --jq '.total_count'
21

Change

Replace the inline startswith("tend-") with a PREFIXES array defaulting to ("tend-"), matched as an anchored alternation. Step 2's sentence now points at the same list rather than describing a parallel one, so a single repo-level source drives both steps.

Behaviour is unchanged for an adopter with no extra prefixes — the default array reproduces the old filter exactly. Running the edited Step 1 block verbatim:

# as written, default PREFIXES=("tend-")
tend-review 30, tend-mention 30, tend-notifications 26, tend-ci-fix 9, tend-triage 6, tend-nightly 1

# with tend's running-tend prefix list, PREFIXES=("tend-" "review-")
tend-review 30, tend-mention 30, tend-notifications 26, review-reviewers 20, tend-ci-fix 9, tend-triage 6, tend-nightly 1

The 30s in that output are #886's separate bug (the unpaginated endpoint capping at a page), still live on main — this change doesn't address it and doesn't depend on it.

Scope and conflict note

This is part 2 of #888. Part 1 of that issue — token-report.sh capping the same window at --limit 100 — is already fixed by #887, so nothing here touches that script.

#886 edits the same two gh api lines in this block to add --paginate. The changes are independent in intent but overlap textually, so whichever lands second needs a trivial rebase; the two edits compose (a PREFIXES-driven filter on a paginated fetch).

Not included: an explicit prefix-list line in tend's own .claude/skills/running-tend/SKILL.md. Its "Usage analysis" section already names review- as the extra prefix, so this repo's Step 1 resolves correctly today; adding a dedicated line there is a separate overlay concern.

Gate assessment

  • Structural. The filter is fixed in the recipe text, so it excludes identically on every run. No decision point.
  • Evidence: High. Exclusion reproduced directly against the API, and the fix verified by executing the edited block verbatim at both prefix lists.
  • Change type: targeted fix — one code block plus one cross-reference sentence, no new sections.

Refs #888

Follow-up commits

3d4fcda — review on this PR found the same disagreement one paragraph later: the near-timeout instruction resolved a workflow's timeout-minutes by globbing .github/workflows/tend-*.yaml, which doesn't match the very workflow the widened census now admits. It now reads the workflow's own file. f823494 reworded the PREFIXES comment from rationale into an instruction.

Step 1 hard-coded `startswith("tend-")` while Step 2 documents extra
prefixes for workflows that use the tend action under another name, so the
two steps disagreed about what the fleet is. Runs under an extra prefix
were never classified for duration, never near-timeout-checked, and never
reached Step 3's log analysis.

Drive both from one repo-level list in `running-tend`.

Refs #888

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Step 1 now admits non-tend-* workflows, but the near-timeout check two paragraphs down still resolves the cap by globbing a tend-* filename — the sentence beginning "To determine the timeout cap for a workflow, read timeout-minutes from the workflow YAML file". On this repo that glob doesn't match review-reviewers.yaml, the exact workflow this change exists to admit, so such a run now enters the census and gets duration-classified but the reader following the recipe finds no file to read a cap from. Same Step-1-disagrees-with-the-next-step shape, on the same axis, one paragraph later. Dropping the glob to the directory would close it — happy to push that here rather than leave it for a follow-up.

Otherwise the mechanism checks out: PREFIX_RE builds ^(tend-) and ^(tend-|review-) correctly, and the two prefix lists return the census the description claims against the live API.

Comment thread plugins/tend-ci-runner/skills/review-runs/SKILL.md Outdated
…nd-* glob

The near-timeout check globbed `.github/workflows/tend-*.yaml`, which does
not match a workflow the widened census now admits — so such a run was
duration-classified with no file to read a cap from.
…ionale

The comment above PREFIXES explained why the census was widened rather than
telling the reader to add their repo's extra prefixes. Lead with the action,
per CLAUDE.md's skill-authoring rule.

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Both findings from the previous review are addressed. 3d4fcda drops the tend-* glob from the near-timeout paragraph, and the instruction now resolves against the workflow's own file — on this repo that reaches .github/workflows/review-reviewers.yaml, the file the earlier glob missed. No workflow here sets timeout-minutes, so the 360-minute-default sentence following it still holds. f823494 applied the inline suggestion verbatim; thread resolved.

Nothing further from me — self-authored, so no approval to give.

@max-sixty
max-sixty merged commit c11ab3c into main Aug 7, 2026
12 checks passed
@max-sixty
max-sixty deleted the fix/issue-888 branch August 7, 2026 23:01
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.

2 participants