Skip to content

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

Merged
don-petry merged 16 commits into
mainfrom
adapters/record-start-from-job-724
Nov 11, 2026
Merged

don-petry merged 16 commits into
mainfrom
adapters/record-start-from-job-724

Conversation

@don-petry

@don-petry don-petry commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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.

Reviewer Head Unread parts Blocking Major Minor Info
agy d0ef97f none 0 10 4 0
muse e63649f none 0 0 2 0
astra d0ef97f none 0 2 0 0
claude-review e63649f none 1 1 2 0
claude-security e63649f none 0 0 4 3
Finding Severity Criterion Where What Disposition
agy#1 major PR-3 adapters/records.py:226 _began returns whole=True for a completed run with uncompleted jobs when starts is non-empty fixed in 338f7c4: a job not yet completed of a completed run is no read, begun or not
agy#2 major PR-3 adapters/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#3 major none docs/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:10 Partial re-run uses an earlier attempt's job start (< started_at), backdating began_at before intervening item Runs and caching it before Attempt 2 runs declined: 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 (cb01adb)
agy#4 major PR-5 docs/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:18 The 'No stamp' pass-record rule is neither marked as waiting on the follow-up pass PR nor held by any test in Boundaries fixed in a630661: the row is gone from the record's Decision; the body says the read is not stamped
agy#5 major PR-3 tests/test_adapters.py:1369 No test checks an unreadable job status or GitHub's waiting and requested job statuses fixed in 338f7c4: a job in a status GitHub gives none is no read, with its test and mutant
agy#6 major PR-3 tests/test_adapters.py:1453 A completed Run with a job still pending records began_at once another job started fixed in 338f7c4, as agy#1
agy#7 major PR-3 tests/test_adapters.py:1462 JOBS cap test places cached runs before uncached ones, leaving post-cap cache preservation unheld fixed in a630661: a kept Run listed after one the cap left unasked still says when it began, with a mutant
agy#8 major PR-3 tools/mutants.py:4346 Runner-type mutant is subsumed by empty-runner-name mutant, leaving runner_name=None unheld fixed in a630661: the mutant now drops the type test alone
agy#9 major PR-3 tools/mutants.py:4374 Missing mutants for /jobs body, jobs-list, total_count type, and job-dict guards fixed in a630661 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#10 major PR-3 tools/mutants.py:4409 Kept-began branches and del record["began_at"] lack individual mutants fixed in a630661: a mutant for the del and one for the kept time of a Run in progress
agy#11 minor none adapters/records.py:222 _began treats missing/non-string job status or redacted runner_name on a succeeded job as whole fixed in 338f7c4 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#12 minor none docs/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 follows fixed in a630661: the row says no caller asks yet, and which pull request brings each
agy#13 minor PR-3 tests/test_adapters.py:1424 Kept began_at against a queued or waiting workflow run row is untested, and untimed/twice omit record checks fixed in a630661 for a queued row; declined for the two cases that assert the asking alone, which is what they hold
agy#14 minor PR-3 tools/mutants.py:4418 Cap mutant replaces asked == JOBS with False instead of holding the JOBS boundary declined: the test asserts exactly which two Runs are asked at a cap of 2, so one more or one fewer fails it
muse#1 minor PR-3 adapters/records.py:201 Dropping TIME.fullmatch from _time survives every named test fixed in cb01adb: a time in another form is fed, with a mutant for the pattern
muse#2 minor PR-3 adapters/records.py:220 A job whose run_attempt is true or 1.0 is read as attempt 1's job fixed in cb01adb: a job's own attempt must be a number
astra#1 major PR-3 adapters/records.py:226 A valid start bypasses the completed-Run consistency check fixed in 338f7c4
astra#2 major PR-3 adapters/records.py:228 An unreadable job status is accepted as a whole read fixed in 338f7c4
claude-review#1 blocking none adapters/records.py:368 The jobs read is built in records.runs, which tests/test_token_needs.py does not class: two of its tests fail on this head fixed in cb01adb: the jobs read is its own function, _began, classed actions: read in tests/test_token_needs.py
claude-review#2 major PR-3 adapters/records.py:227 After a re-run of failed jobs, began_at is an earlier attempt's start, before the attempt's own started_at declined: 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 (cb01adb)
claude-review#3 minor PR-3 adapters/records.py:201 No test holds the TIME pattern in _time: a start strptime accepts but the schema refuses would survive fixed in cb01adb, as muse#1
claude-review#4 minor PR-3 adapters/records.py:346 No test holds that jobs are asked for the second read's rows when the list is read again fixed in cb01adb: a list read twice is asked by the second read's rows, with a mutant
claude-security#1 minor PR-3 adapters/records.py:201 No test holds the form of a time: _time without TIME.fullmatch passes every test at this head fixed in cb01adb, as muse#1
claude-security#2 minor PR-3 adapters/records.py:223 No test holds that a job with a runner named must be completed before its start is trusted fixed in cb01adb: a runner named on a job that still waits is no start, with a mutant
claude-security#3 minor PR-3 adapters/records.py:227 On a re-run of failed jobs, began_at is the first attempt's job start, before the attempt's own started_at declined: 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 (cb01adb)
claude-security#4 minor PR-3 adapters/records.py:248 A key listed twice is not held to be kept from neither listing: one mutant survives, and an earlier record's word stands moved: 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#5 info PR-3 adapters/records.py:220 A job whose run_attempt is true or 1.0 is read as a job of attempt 1 fixed in cb01adb, as muse#2
claude-security#6 info none adapters/records.py:230 A completed Run whose jobs answer lists no job is read as never begun and kept for good, whatever its conclusion declined: 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#7 info none adapters/records.py:368 A read of a run's jobs leaves no date or age in the pass record 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

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

Head read Finding Disposition
a630661 major: a job's status that is no word raised in the port fixed in b73c482: it is no read of the jobs
a630661 major: no test held that one Run's unread jobs leave the list not whole whatever follows fixed in b73c482, with a mutant
a630661 major: only a list shorter than its count was fed fixed in b73c482: more jobs than the count, with a mutant
b73c482 major: a job listed twice could stand where another was left out fixed in e7a1a56: each job is counted once
b73c482 major: no test held the cap at 50 fixed in e7a1a56, with a mutant
b73c482 major: no test held that a run record may say null fixed in e7a1a56: the port's null record is held to the schema, with a mutant
e7a1a56 major: a job's id that is no number raised in the port fixed in 35f22ea: it is no read of the jobs
e7a1a56 major: only the first start was held to be a time fixed in 35f22ea, with a mutant
66ff40b major: a runner that is neither a name nor none was read as no runner fixed in c37e2f8: it is no read of the jobs, with a mutant
66ff40b major: no test held that a list read short stays not whole once its Runs' jobs are read fixed in c37e2f8

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:

Finding Where What Disposition
P2 adapters/records.py:217 GitHub pages a run's jobs thirty at a time, so a run with more would never be read whole fixed in 6286861: asked a hundred to a page, with a mutant
P2 schemas/run-record.schema.json:75 The pattern admits a day no month has declined: it is the one pattern every time in the schema carries; the port's _time and the Kernel's is_time hold the calendar
P3 the record, line 3 The Status cites the issue's number before its title fixed in 6286861

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

don-petry and others added 14 commits November 11, 2026 07:12
… progress or ran, and kept by the pass records (#724, record 0193)

The records port gains began_at, read from the jobs API under P-64's rule, kept by the pass records and capped at 50 Runs a read. started_at keeps its meaning. No rule of the Kernel reads the field yet.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…d the readers' findings are held (#724)

Muse, the Claude review and the security pass on e63649f: the form of a time, a job's own attempt, a runner named on a job that waits, a key the later record lists, the second read's rows, and a re-run's carried-over jobs, said as they are.

Co-Authored-By: Claude <noreply@anthropic.com>
…thing to work it off (#724)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…running still (#724)

Co-Authored-By: Claude <noreply@anthropic.com>
…t, and the prose is cut to the review budget (#724)

Co-Authored-By: Claude <noreply@anthropic.com>
…724)

Split for the review budget: this part holds the field and the port's read; begun and the Controller's hand-over follow.

Co-Authored-By: Claude <noreply@anthropic.com>
…ted run, is no read of its jobs (#724)

Astra on d0ef97f.

Co-Authored-By: Claude <noreply@anthropic.com>
…o queued Run, and the record says who asks when (#724)

Co-Authored-By: Claude <noreply@anthropic.com>
…than their count, and a list that stays not whole (#724)

Co-Authored-By: Claude <noreply@anthropic.com>
…and a null beginning are held (#724)

Co-Authored-By: Claude <noreply@anthropic.com>
…art is held to be a time (#724)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@don-petry
don-petry requested a review from a team as a code owner November 11, 2026 17:15
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@codeant-ai

codeant-ai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  #b3ddb Reviewed your PR 66ff40b Nov 11, 2026 · 17:15 17:26

@codeant-ai

codeant-ai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T17:26:11.085090Z 6286861 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Nov 11, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request implements decision 0193, which introduces the tracking of when a Run actually began (began_at) by reading its jobs from the GitHub API. It adds the _began helper function in adapters/records.py to fetch and parse job start times, ensuring that only jobs in progress or completed with a runner are considered. The runs function is updated to support this tracking with a cap of 50 runs per read to avoid exceeding limits. Additionally, the run record schema is updated to include the optional began_at field, a new decision document is added, and comprehensive unit tests are introduced to validate the new behavior. I have no feedback to provide as there are no review comments.

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 8 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread schemas/run-record.schema.json Resolved
Comment thread adapters/records.py Resolved
don-petry and others added 2 commits November 11, 2026 11:21
…one is no read, and a short list stays not whole (#724)

Co-Authored-By: Claude <noreply@anthropic.com>
…issue by title first (#724)

cubic on #751: thirty to a page, a run with more jobs would never be read whole.

Co-Authored-By: Claude <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

Comment thread adapters/records.py Resolved
@codeant-ai

codeant-ai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; transport failures abort the whole records read, consistent with the existing list and artifact reads.

Assessed commit: 6286861f3391

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 4 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread adapters/records.py Resolved
@don-petry
don-petry added this pull request to the merge queue Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants