Skip to content

The pass keeps when its Runs began, and asks a Run's jobs once (#724, record 0193) - #759

Merged
don-petry merged 26 commits into
mainfrom
controller/pass-keeps-when-runs-began-724
Nov 11, 2026
Merged

don-petry merged 26 commits into
mainfrom
controller/pass-keeps-when-runs-began-724

Conversation

@don-petry

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

Copy link
Copy Markdown
Contributor

User description

Part 2 of 4 for #724. It does not close the issue. Part 1 merged as #751.

What changes

The pass now asks when its Runs began, and keeps what it read, so a Run's jobs are asked once.

  • records.begun: reads the last two pass records. A time is kept for any Run, null for a completed one alone, by Run id and when the attempt started. The earlier record's word stands only for a Run the later does not list. A key listed twice is kept from neither listing.
  • The entry: controller/__main__.py hands the records port began=records.begun(earlier), from pass/1 records each from before the pass. With none, or one that is neither, the port is still asked, with nothing kept.
  • Record 0193: two rows added to its Boundaries, as its Status foretold. Nothing decided changes.

No rule of the Kernel reads began_at yet. That is part 4.

The cold start

Record 0193 says the Factory's repo held 27 Runs on 2026-11-11. That count was mine and it was wrong.

  • The count: GitHub lists 94 dispatched Runs on main now (run.yml 78, approve.yml 16), since 2026-11-09, about 40 more a day, kept 90 days.
  • The effect: one read asks 50 Runs' jobs at most, and a Run past the cap leaves the list not whole, which defers every item. With nothing kept, N Runs take ceil(N/50) passes to read, so every item is deferred for ceil(N/50)-1 passes: 1 today, about 7 in a week, about 19 at 1,000 Runs, at 20 minutes a pass.
  • When: the first pass of the Release that carries this part, and after any two pass records in a row that list no Run, as after an outage. Steady state asks only new Runs.
  • It fails closed: a deferral, never an action.
  • The ruling: the Factory Builder ruled on 2026-11-11 that this part lands as built and the bound follows as its own pull request, with a record amending 0193 that corrects the count: the pass asks the jobs only of Runs for open pull requests. No Release is cut carrying this part while its cold start would defer more than 2 passes.

Checks

  • make checks: OK at 32c5bfcf, which holds main at 07410345.
  • tests.test_adapters, tests.test_controller, tests.test_token_needs, tests.test_steps, tests.test_reconcile: OK at b7093cbd (268 tests); the Controller's again at 32c5bfcf, whose one change is a docstring. Eleven quick modules ran OK at 6e4adf5a (428 tests). The simulators, the hooks' and the tools' modules were not run at the desk: CI's verify is the answer.
  • Mutants of adapters/records.py and of the entry's hand-over, filtered: 133 of 133 killed at b7093cbd. No mutant is stale at 32c5bfcf.
  • gitleaks: no leaks.
  • Size as the Kernel counts a diff: 26,647 characters, 248 lines.

Reviews

Carbon, Muse, Astra, the Claude review and the security pass, each of this part alone against main. Every finding is fixed or answered. Carbon's first run, on 6e4adf5a, ended with no read at its 15-minute limit; it read 32c5bfcf whole.

Reviewer Head Unread parts Blocking Major Minor Info
agy 32c5bfc none 0 0 0 0
muse 6e4adf5 none 0 0 0 0
astra 6e4adf5 none 0 1 0 0
claude-review 6e4adf5 none 0 0 3 2
claude-security 6e4adf5 none 0 0 1 1
Finding Severity Criterion Where What Disposition
astra#1 major PR-3 tests/test_controller.py:1158 The entry test does not protect the first jobs read fixed in b7093cb: a pass with no record before it is held to hand the port nothing kept and still ask, with the mutant "a pass with nothing kept asks the records port no job"
claude-review#1 minor none controller/__main__.py:158 The pass now asks jobs for 93 listed Runs against a cap of 50, where record 0193 counted 27: the first pass defers every Run, and so does each loss of both records answered: true, and record 0193's 27 was my miscount; 94 are listed now. Said in this body under "The cold start". The Factory Builder ruled on 2026-11-11 that this part lands as built and the bound follows as its own pull request, before any Release carrying this part would defer more than 2 passes
claude-review#2 minor PR-3 tests/test_adapters.py:1526 "Null for a completed Run alone" is held against in_progress only: a null kept for a queued Run survives fixed in b7093cb: a null on a queued Run is tried, with the mutant "null is kept for a Run that waits"
claude-review#3 minor PR-3 tests/test_controller.py:1183 No test holds that begun is handed the records placed before the pass and held to pass/1: began=records.begun(previous) survives fixed in b7093cb: the records before differ, and a record that is no pass record, one not from before the pass, and none each hand on nothing; four mutants of the hand-over
claude-review#4 info none the change Not a defect of the change: this reader overwrote the shared scratch folder copy that another read was using, for about two minutes no defect of the change: three of the four Claude reads shared one scratch folder for about two minutes; each redid its results in a folder of its own, and no worktree was written
claude-review#5 info none controller/__main__.py:10 The entry's docstring lists what the pass reads and does not name the jobs read or records.begun fixed in 32c5bfc for the entry's docstring; the port's sentence on known is main's and is left
claude-security#1 minor PR-5 tests/test_controller.py:1168 The entry's test cannot tell which records begun is handed: the hold to pass/1 and to before now has no test, and three mutants of the hand-over survive fixed in b7093cb, as claude-review#3
claude-security#2 info PR-3 tests/test_adapters.py:1526 "Null for a completed Run alone" is tried against in_progress only: a null kept for a record's queued Run survives fixed in b7093cb, as claude-review#2

Astra has not read the head that holds the fix for its finding. This part's code was also read inside part 1's first reads, before the split.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix


CodeAnt-AI Description

Reuse recorded workflow run start times across passes

What Changed

  • Reuses valid start times from recent pass records to avoid looking up jobs again for the same run attempt.
  • Uses an earlier record only when the later record does not list that run; duplicate or invalid entries are not reused.
  • Looks up jobs again when a run has no reusable start time or starts a new attempt.

Impact

✅ Fewer repeated job lookups for known runs
✅ Fresh start times for rerun attempts
✅ No reuse of ambiguous run records

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

don-petry and others added 26 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>
…724)

begun reads the last two pass records, and the Controller's read hands the port what they kept, so a Run's jobs are asked only until it has begun. The second part of the port's change, split for the review budget; it adds its rows to record 0193's Boundaries.

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>
… other Runs (#724)

Astra on f321d6d.

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>
…ort's (#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>
…d by its own case and mutant (#724)

Astra on 2edf1cb.

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>
…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>
…runs-began-724

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…at a pass with nothing kept still asks

The records before now differ: the last one's word, and the one before's for a Run the last does not list.
A record that is no pass record, one not from before the pass, and none at all each hand the port nothing kept.
A null kept for a queued Run is tried too.

Co-Authored-By: Claude <noreply@anthropic.com>
… kept of a beginning

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

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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)
✅  #2f681 Reviewed your PR 32c5bfc Nov 11, 2026 · 23:10 23:18

@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-11T23:12:54.879107Z 32c5bfc PR opened
ℹ️ 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 the extraction and retention of Run start times ('began_at') from previous pass records, as outlined in decision 0193. It introduces the begun function in adapters/records.py to parse the last two pass records and track when each Run began. The controller is updated to pass these historical start times to the runs adapter, preventing redundant job reads. Corresponding unit tests and decision documentation have been added to verify and document this behavior. There are no review comments, and I have no additional feedback to provide.

@sonarqubecloud

Copy link
Copy Markdown

@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.

No issues found across 6 files

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

@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; no actionable issues were identified in the review.

Assessed commit: 32c5bfcf15d8

@combsmith-sf-pr-review combsmith-sf-pr-review 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.

No findings: begun and its wiring into the entry are correct and tested, with mutants.

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