A run record says when its Run began, read from its jobs under P-64's rule (#724, record 0193)

Merged
DO
6d ago
+472-9

Part 1 of 4 for #724. It does not close the issue.

What changes

A run record can now say when its Run began, read from its jobs under the rule trials/P-64.json showed. No caller asks for it yet, so nothing changes in a pass or a Run until the parts that follow.

  • The field: began_at, optional on a run record. started_at keeps its meaning, the run's run_started_at.
  • What it says: the earliest started_at among the latest attempt's jobs that are in_progress, or completed with a runner named. Null for a completed Run none of whose jobs began. Absent where it has not begun, or was not read.
  • What is asked: GET /repos/{repo}/actions/runs/{id}/jobs, as P-64 asked it but a hundred to a page, uncached, for each Run in progress or completed, and only for a caller that hands began.
  • What a caller kept: a Run whose beginning the caller hands in is not asked again. A re-run is asked afresh.
  • The cap: 50 Runs are asked in one read (JOBS). A Run past the cap, or whose jobs cannot be read, has no began_at and leaves the list not whole.

Why not started_at itself

The issue asks that a record's started_at become its job's start, with a Run that has not begun read as starting now. Two readers of started_at rule that out, and the Factory Builder ruled for a field of its own on 2026-11-11:

  • controller/pass_.py's _streak reads a completed record's started_at inside a window. A Run that never began would be recent at every pass, and an automatic pause it held would never lapse.
  • adapters/records.py's known keys a kept outcome by (run, started_at). A start that moves at every pass is never kept.

The four parts, and their order

The whole change measured 63,442 characters as the Kernel counts a diff, over the review budget of 60,000, so it is split. This part is 58,432.

  1. This one: the field and the port's read.
  2. The pass keeps: begun reads the pass records before, and the Controller's read hands the port what they kept.
  3. The Harness asks (harness/read.py, harness/reread.py) for its own item's Runs. A model Lens's input, so a person's to approve.
  4. The Kernel reads: approval_anchor's browser fallback takes a record as old as the approval by began_at. That closes the residual decision 0168 names.

The order matters: a Run reads its item as the pass does, so both must hand the Kernel the field before the Kernel reads it.

Said plainly

  • A re-run's carried-over jobs: after a re-run of some jobs GitHub lists the others with the starts an earlier attempt gave them, so began_at can be earlier than started_at. Seen on runs of this repo, in no trial. It is kept: a real start of the same run.
  • No stamp: a jobs read leaves no date and no age in the pass record, as an outcome's read does. Nothing acts on a read's age.
  • A job outside the lane: one that began before its item's lane job would give a start that is too early. The Run P-55 recorded has none; the record names it as a residual.
  • The record's number is provisional until enqueue.

Checks

  • make checks: OK at 6286861f, which holds main merged at 05177d55.
  • Every test module but the simulators, the hooks' and the tools': OK at e7a1a563; the adapters', the Controller's and the token needs' again at 6286861f. tests.test_tools: OK at cb01adbe. A later run of it at the desk failed one test, test_every_check_has_a_test_in_which_it_fails, while I was editing the worktree under it; that test passes alone at 6286861f, and CI's verify is the answer.
  • Mutants of adapters/records.py, filtered: 117 of 117 killed at 6286861f. Every mutant's text was checked against its file: none stale.
  • gitleaks: no leaks.

Reviews

Carbon, Muse, Astra, the Claude review and the security pass. Muse and the two Claude reads read e63649f0, before the split, when this part still held parts 2 and 3; Carbon and Astra read d0ef97f3, after it. Every finding below is fixed or answered.

ReviewerHeadUnread partsBlockingMajorMinorInfo
agyd0ef97fnone01040
musee63649fnone0020
astrad0ef97fnone0200
claude-reviewe63649fnone1120
claude-securitye63649fnone0043
FindingSeverityCriterionWhereWhatDisposition
agy#1majorPR-3adapters/records.py:226_began returns whole=True for a completed run with uncompleted jobs when starts is non-emptyfixed in 338f7c45: a job not yet completed of a completed run is no read, begun or not
agy#2majorPR-3adapters/records.py:342_began HTTP reads are not recorded in runs()['reads']declined: nothing acts on a read's age, and the stamp needs pass/1's enum and the Controller's check of it. An answer older than the list now reads as unread or not begun, never as a wrong time; offered to the Builder as a follow-up
agy#3majornonedocs/decisions/0193-when-a-run-began-is-read-from-its-jobs-trusted-only-once-a-job-is-in-progress-or-ran-and-kept-by-the-pass-records.md:10Partial re-run uses an earlier attempt's job start (< started_at), backdating began_at before intervening item Runs and caching it before Attempt 2 runsdeclined: kept, and said so. It is a real start of the same run, and no job of a Run made while another of its item ran began before that one ended, at any attempt, so the anchor's use of it is sound. The schema, the record and a test now say that it may be earlier than started_at (cb01adbe)
agy#4majorPR-5docs/decisions/0193-when-a-run-began-is-read-from-its-jobs-trusted-only-once-a-job-is-in-progress-or-ran-and-kept-by-the-pass-records.md:18The 'No stamp' pass-record rule is neither marked as waiting on the follow-up pass PR nor held by any test in Boundariesfixed in a6306613: the row is gone from the record's Decision; the body says the read is not stamped
agy#5majorPR-3tests/test_adapters.py:1369No test checks an unreadable job status or GitHub's waiting and requested job statusesfixed in 338f7c45: a job in a status GitHub gives none is no read, with its test and mutant
agy#6majorPR-3tests/test_adapters.py:1453A completed Run with a job still pending records began_at once another job startedfixed in 338f7c45, as agy#1
agy#7majorPR-3tests/test_adapters.py:1462JOBS cap test places cached runs before uncached ones, leaving post-cap cache preservation unheldfixed in a6306613: a kept Run listed after one the cap left unasked still says when it began, with a mutant
agy#8majorPR-3tools/mutants.py:4346Runner-type mutant is subsumed by empty-runner-name mutant, leaving runner_name=None unheldfixed in a6306613: the mutant now drops the type test alone
agy#9majorPR-3tools/mutants.py:4374Missing mutants for /jobs body, jobs-list, total_count type, and job-dict guardsfixed in a6306613 for the count's type; declined for the rest: the tests feed a body, a list and a job that are none, and a mutant of each guard dies by a raised error, which holds nothing more
agy#10majorPR-3tools/mutants.py:4409Kept-began branches and del record["began_at"] lack individual mutantsfixed in a6306613: a mutant for the del and one for the kept time of a Run in progress
agy#11minornoneadapters/records.py:222_began treats missing/non-string job status or redacted runner_name on a succeeded job as wholefixed in 338f7c45 for the status; declined for the runner: a completed job with no runner named never ran, which is the issue's rule (P-44)
agy#12minornonedocs/decisions/0193-when-a-run-began-is-read-from-its-jobs-trusted-only-once-a-job-is-in-progress-or-ran-and-kept-by-the-pass-records.md:15'What does not read it yet' still claims the pass already has began_at and contradicts Line 3 on which pull request followsfixed in a6306613: the row says no caller asks yet, and which pull request brings each
agy#13minorPR-3tests/test_adapters.py:1424Kept began_at against a queued or waiting workflow run row is untested, and untimed/twice omit record checksfixed in a6306613 for a queued row; declined for the two cases that assert the asking alone, which is what they hold
agy#14minorPR-3tools/mutants.py:4418Cap mutant replaces asked == JOBS with False instead of holding the JOBS boundarydeclined: the test asserts exactly which two Runs are asked at a cap of 2, so one more or one fewer fails it
muse#1minorPR-3adapters/records.py:201Dropping TIME.fullmatch from _time survives every named testfixed in cb01adbe: a time in another form is fed, with a mutant for the pattern
muse#2minorPR-3adapters/records.py:220A job whose run_attempt is true or 1.0 is read as attempt 1's jobfixed in cb01adbe: a job's own attempt must be a number
astra#1majorPR-3adapters/records.py:226A valid start bypasses the completed-Run consistency checkfixed in 338f7c45
astra#2majorPR-3adapters/records.py:228An unreadable job status is accepted as a whole readfixed in 338f7c45
claude-review#1blockingnoneadapters/records.py:368The jobs read is built in records.runs, which tests/test_token_needs.py does not class: two of its tests fail on this headfixed in cb01adbe: the jobs read is its own function, _began, classed actions: read in tests/test_token_needs.py
claude-review#2majorPR-3adapters/records.py:227After a re-run of failed jobs, began_at is an earlier attempt's start, before the attempt's own started_atdeclined: kept, and said so. It is a real start of the same run, and no job of a Run made while another of its item ran began before that one ended, at any attempt, so the anchor's use of it is sound. The schema, the record and a test now say that it may be earlier than started_at (cb01adbe)
claude-review#3minorPR-3adapters/records.py:201No test holds the TIME pattern in _time: a start strptime accepts but the schema refuses would survivefixed in cb01adbe, as muse#1
claude-review#4minorPR-3adapters/records.py:346No test holds that jobs are asked for the second read's rows when the list is read againfixed in cb01adbe: a list read twice is asked by the second read's rows, with a mutant
claude-security#1minorPR-3adapters/records.py:201No test holds the form of a time: _time without TIME.fullmatch passes every test at this headfixed in cb01adbe, as muse#1
claude-security#2minorPR-3adapters/records.py:223No test holds that a job with a runner named must be completed before its start is trustedfixed in cb01adbe: a runner named on a job that still waits is no start, with a mutant
claude-security#3minorPR-3adapters/records.py:227On a re-run of failed jobs, began_at is the first attempt's job start, before the attempt's own started_atdeclined: kept, and said so. It is a real start of the same run, and no job of a Run made while another of its item ran began before that one ended, at any attempt, so the anchor's use of it is sound. The schema, the record and a test now say that it may be earlier than started_at (cb01adbe)
claude-security#4minorPR-3adapters/records.py:248A key listed twice is not held to be kept from neither listing: one mutant survives, and an earlier record's word standsmoved: begun is in the pull request that follows; fixed there, the earlier record's word standing only for a Run the later does not list
claude-security#5infoPR-3adapters/records.py:220A job whose run_attempt is true or 1.0 is read as a job of attempt 1fixed in cb01adbe, as muse#2
claude-security#6infononeadapters/records.py:230A completed Run whose jobs answer lists no job is read as never begun and kept for good, whatever its conclusiondeclined: read as unreadable, a Run GitHub never lists a job for would leave the list not whole at every pass. Null admits nothing; the record says so
claude-security#7infononeadapters/records.py:368A read of a run's jobs leaves no date or age in the pass recorddeclined: nothing acts on a read's age, and the stamp needs pass/1's enum and the Controller's check of it. An answer older than the list now reads as unread or not begun, never as a wrong time; offered to the Builder as a follow-up

Astra read four more times, each on the head its last findings were fixed in. Its findings after the first read:

Head readFindingDisposition
a630661major: a job's status that is no word raised in the portfixed in b73c482d: it is no read of the jobs
a630661major: no test held that one Run's unread jobs leave the list not whole whatever followsfixed in b73c482d, with a mutant
a630661major: only a list shorter than its count was fedfixed in b73c482d: more jobs than the count, with a mutant
b73c482major: a job listed twice could stand where another was left outfixed in e7a1a563: each job is counted once
b73c482major: no test held the cap at 50fixed in e7a1a563, with a mutant
b73c482major: no test held that a run record may say nullfixed in e7a1a563: the port's null record is held to the schema, with a mutant
e7a1a56major: a job's id that is no number raised in the portfixed in 35f22ea3: it is no read of the jobs
e7a1a56major: only the first start was held to be a timefixed in 35f22ea3, with a mutant
66ff40bmajor: a runner that is neither a name nor none was read as no runnerfixed in c37e2f8a: it is no read of the jobs, with a mutant
66ff40bmajor: no test held that a list read short stays not whole once its Runs' jobs are readfixed in c37e2f8a

Astra has not read c37e2f8a, which holds its last two fixes. Five reads each found two or three test gaps or malformed answers; I stopped there, near the budget's 60,000. Carbon's first run, on e63649f0, timed out on two of ten parts and was stopped; its run on d0ef97f3 read all nine parts.

cubic, on 66ff40be:

FindingWhereWhatDisposition
P2adapters/records.py:217GitHub pages a run's jobs thirty at a time, so a run with more would never be read wholefixed in 6286861f: asked a hundred to a page, with a mutant
P2schemas/run-record.schema.json:75The pattern admits a day no month hasdeclined: it is the one pattern every time in the schema carries; the port's _time and the Kernel's is_time hold the calendar
P3the record, line 3The Status cites the issue's number before its titlefixed in 6286861f

CodeAnt, on 6286861f, one finding, major: a jobs request that raises Unanswered escapes the read. Declined: a request GitHub does not answer refuses the whole read in this port already, for the list and for an outcome alike, and the pass then reads the records as unread and defers.

cubic again, on 6286861f, two findings, both declined: P1, the same as CodeAnt's, for the same reason; P2, that the record's Decision rows were edited, which holds for a record on main, and this pull request adds 0193.

Codex found nothing on 66ff40be. CodeRabbit: skipped, auto reviews are off on this repo.

šŸ¤– Generated with Claude Code