Skip to content

Run the complete suite on every green merge to main - #751

Merged
max-sixty merged 3 commits into
mainfrom
nightly-on-main
Sep 17, 2026
Merged

max-sixty merged 3 commits into
mainfrom
nightly-on-main

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The nightly-marked modules ran only on the daily cron, so a regression in one of them could sit on main for up to a day. nightly now also runs on a push to main, once lint and test are green, and its failure fails the ci run that tend-ci-fix watches.

One automatic complete suite holds a runner at a time. A running suite is never cancelled, and a newer commit replaces the pending entry, so a busy main gets the suite on its tip rather than working through superseded commits. A dispatch keeps a slot per ref, as it had before this job took a group of its own: it is the base-SHA control CLAUDE.md prescribes for judging a red branch, and behind main's queue the next merge would replace it before it started.

Two consequences follow. A push to main no longer cancels the previous push's run, because a red branch is judged against the base SHA's result and with nightly in the run the next merge would end a complete suite partway through. And the job's guard names the results that may proceed rather than excluding failure, because a job killed by its own timeout-minutes concludes cancelled — measured on astral-sh/uv-dev job 103562310904, which ran 6h00m15s and concluded cancelled — and a wedged everyday gate would otherwise send an hour of complete suite after it.

The cost this accepts

#296 shipped this same arrangement when the suite was 22-41 minutes, and named the cost then: GitHub records a superseded pending entry as a cancelled run, and tend-ci-fix acts on a cancellation as it does on a failure. Confirmed here on run 35019690790, where tend-mention's handle job was cancelled after nine seconds with no runner assigned and the run concluded cancelled alongside a successful verify. The suite is 66-86 minutes now, so at the recent push cadence roughly 55-60% of main's pushes would produce one, against a baseline of about 40%.

running-tend gains the field that separates the two cancelled shapes, since a nightly that wedges to its own 135-minute bound also concludes cancelled and is very much something to fix: a replaced entry never started and so carries no runner, while a timed-out one holds one.

Verification
  • pre-commit run --all-files clean, actionlint included.
  • 548 passed across test_interact_layer.py, test_interact_document.py, test_interact_product.py and test_interact_session.py — the modules whose tests read ci.yaml against CLAUDE.md.
  • The if was walked against real runs for each trigger: run 35087200567 confirms lint and test both conclude skipped on the schedule, which is what the success-or-skipped guard admits.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits September 16, 2026 21:05
The nightly-marked modules ran only on the daily cron, so a regression in
one of them could sit on main for up to a day. `nightly` now also runs on a
push to main, once `lint` and `test` are green, and its failure fails the
`ci` run that `tend-ci-fix` watches.

One automatic complete suite holds a runner at a time. A running suite is
never cancelled, and a newer commit replaces the pending entry, so a busy
main gets the suite on its tip rather than working through superseded
commits. #296 shipped this same arrangement when the suite was 22-41
minutes, including its cost: superseded pending entries are recorded as
cancelled runs, and `tend-ci-fix` acts on a cancellation as it does on a
failure. The suite is 66-86 minutes now, so that share is higher.
`running-tend` gains the field that tells a replacement from a regression: a
replaced entry never started and so carries no runner, while a `nightly` that
exceeded its own bound concludes cancelled holding one.

Two consequences follow. A push to main no longer cancels the previous
push's run: the base SHA's result is what a red branch is judged against,
and with `nightly` in the run the next merge would end a complete suite
partway through. And the guard names the results that may proceed rather
than excluding `failure`, because a job killed by its own `timeout-minutes`
concludes `cancelled` and a wedged everyday gate would otherwise send an
hour of complete suite after it.

A dispatch keeps a slot per ref, as it had before this job took a group of
its own: it is the base-SHA control, and behind main's queue the next merge
would replace it before it started.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One correction, on the new running-tend paragraph rather than the workflow.

started_at is stamped when a runner picks a job up, not when the job enters the
queue. tend-review run 35019649866's review job was created at
2026-09-15T20:26:34Z, sat pending behind run 35019297421 in the same concurrency
group, and reports started_at 2026-09-15T20:45:06Z — four seconds after that
run's job completed. Concurrency queueing is exactly the case the paragraph is
about, so the clause is wrong where it is load-bearing.

The instruction it supports still holds, and so does the warning about elapsed
time, but for the opposite reason: a replaced entry's elapsed time measures the
wait it sat through precisely because it never started, which is why its
started_at equals its created_at (9 seconds on run 35019690790, but an hour if
the merge that replaces it is an hour later). Suggestion inline.

The rest reads correctly against the workflow. queue: single is the documented
default, the workflow_dispatch && github.ref || 'automatic' group resolves as the
comment describes, and the success-or-skipped guard is the right shape given a
timeout-minutes kill concludes cancelled.

Comment thread .claude/skills/running-tend/SKILL.md Resolved
A job that never started reports `started_at` equal to its `created_at`,
so a replaced entry's span is the wait rather than work; a job that did
start is stamped at pickup. Verified on runs 35019649866 and 35019690790.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit c20ecd1 into main Sep 17, 2026
6 checks passed
@max-sixty
max-sixty deleted the nightly-on-main branch September 17, 2026 04:50
max-sixty added a commit that referenced this pull request Oct 12, 2026
…slot (#2443)

The suite's `nightly` mark meant "a pull request can land without it",
yet those tests ran on every push to main. This renames that tier
`main`, adds a real `nightly` tier that only the daily run reaches, and
gives the daily run a concurrency slot of its own so it stops being
replaced before it starts.

## Three tiers, named for when they run

`TIERS` in `tests/conftest.py` owns the selection:

| Tier | Runs on | Flag |
|---|---|---|
| unmarked | every run, both landing gates and broad discovery included
| (none) |
| `main` (formerly `nightly`, same meaning) | each push to main |
`--run-main` |
| `nightly` | only the daily schedule and a manual dispatch |
`--run-nightly` (every tier) |

A test with both marks, such as a `nightly` test in a `main` module,
belongs to the later tier. `--changed-since REF` (formerly
`--nightly-changed-since`) adds the marked tests of either tier whose
own lines a change edits; a pull request and `wt merge`'s pre-merge both
pass it.

The `ci` test job's selection per event:

- pull request: `--changed-since HEAD^1`, so unmarked tests plus the
`main` and `nightly` tests it edits;
- push to main: `--run-main`, so unmarked plus `main`;
- schedule and dispatch: `--run-nightly`, so every test.

Collected locally on this branch (of 6,030): broad discovery 3,070,
`--run-main` 5,976, `--run-nightly` 6,030, and `--changed-since
origin/main` 3,131. This PR edits the two sweeps' decorators, so its own
CI runs them.

`tests/AGENTS.md` ("Run what the change needs") describes the tiers once
and says when a test belongs in each. `developing-leaf`, `running-tend`,
`pyproject.toml`'s marker list and `.config/wt.toml` now use the new
names.

## The scheduled run gets its own slot

Since #751 the schedule shared the push queue (`ci-nightly-automatic`),
so the next merge replaced it while it waited for a runner. The
scheduled runs of Oct 9, 10 and 11 all ended cancelled without ever
getting a runner (`runner_id` 0). The job's concurrency group is now
`ci-test-<event>`, with `pr-<n>` for a pull request and `dispatch-<ref>`
for a dispatch, so pushes keep their one-at-a-time queue and the
schedule queues alone. `tend-ci-fix` still triggers on failed or
cancelled `ci` runs on `main`, and a scheduled run reports on `main`, so
a red nightly run still reaches it.

## Corpus sweeps move to `nightly`

`test_page_fixture_renders` and
`test_a_still_page_comes_back_from_every_journey_as_it_was` in
`tests/test_render_gate.py` each sweep the whole example corpus (27
cases each). Together they take about 47 worker-minutes, 8% of a
complete run. A push to main no longer runs them; the daily run does.

> _This was written by Claude Code on behalf of max-sixty_

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 12, 2026
Corrects a false reason in `ci.yaml`'s workflow-level concurrency
comment. It said a push to main keeps its run partly because "a
cancellation reaches tend-ci-fix as something to fix". `tend-ci-fix`
runs only when `workflow_run.conclusion == 'failure'`, and tend's ci-fix
template has no option to widen that, so a cancelled run is never
answered. The comment now says a cancellation goes unreported. #2443's
description repeated the same claim.

## Issue #74: scheduled `ci` runs cancelled

Investigated; the cause was already fixed by #2443 (merged 2026-10-12
00:19 UTC):

- Between #751 and #2443, 10 of the 25 daily scheduled runs ended
cancelled with no runner (`runner_name` empty): Sep 18, 27, 29 and Oct
2, 3, 5, 6, 9, 10, 11. The scheduled job shared the push queue's
concurrency group, and under `queue: single` the next merge replaced the
pending scheduled entry. Because `tend-ci-fix` ignores cancelled runs,
none of these reached anyone.
- #2443 gave the schedule a group of its own (`ci-test-schedule`). The
first scheduled run since then,
[38239628776](https://github.com/max-sixty/leaf/actions/runs/38239628776),
got a runner 4 seconds after it was created.
- The account-wide pool is not the cause: when the scheduled runs did
reach a runner (Oct 1, 4, 7 and 8), they waited between 18 minutes and
2¼ hours and then ran for 2 to 3 hours. That is well inside the 6-hour
job limit.

Behaviour changed: none. The change is to a comment only.
Hand-written source line delta: +4 −3 (YAML comment). Test line delta:
0.

> _This was written by Claude Code on behalf of max-sixty_

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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