Skip to content

Order readiness check runs by timestamp instants - #1508

Merged
mergify[bot] merged 5 commits into
mainfrom
lean178/1462-readiness-run-order
Nov 26, 2026
Merged

mergify[bot] merged 5 commits into
mainfrom
lean178/1462-readiness-run-order

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Order readiness check runs by timestamp instants

Context and goal

  • Goal: Readiness uses the intended check verdict when GitHub returns duplicate or undated run IDs.
  • Problem: Raw timestamp order can select an older successful check and can miss an active retry.
  • Context: Required checks must pass for readiness. This uses the shared timestamp parser that landed in Compare readiness using GitHub timestamps #1841.

Closes #1462

Acceptance

  • Numeric check-run IDs retain precedence. Duplicate or missing IDs compare parsed UTC instants. Parseable timestamps outrank missing or invalid timestamps, and equal instants or two unusable timestamps keep API order.
  • A retry of the same run requires a valid start strictly after the failed check completed. A different active run from the same workflow compares valid creation instants with the run ID breaking an equal-instant tie.
  • The issue's fractional-second replays reproduce the old verdict and wait decision. Offset, invalid timestamp, and precedence cases pass after repair. The existing readiness tests and Compare readiness using GitHub timestamps #1453's freshness matrix pass with the change.

Notes

The timestamp parser landed in #1841. The changes share the same strict, offset-aware timestamp parser. Treat GitHub's timestamp strings as untrusted values and retain the existing identity checks before waiting on a replacement.

The issue replays failed on the base. The updated head passes 64 focused readiness cases. A clean combined tree with #1453 retains one parser and passes the same 64 readiness cases and all 66 freshness cases. The test diff adds zero net lines.

Base

Base: a68ef3b

Validation

Recorded for 455cfc8df18f

  • uv run --group dev ruff check src tests: exit 0
  • uv run --group dev tach check: exit 0
  • uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0
  • scripts/size_budget.sh: exit 0
  • uv run --group dev pytest -q: exit 0

Review

  • primary, claude, 1e768fe, approve

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

eowca and others added 3 commits November 26, 2026 04:18
Keep numeric check-run IDs primary and preserve API order when instants tie. Compare workflow retry and replacement timestamps with the same strict parser used by the freshness change.

Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
@eowca
eowca marked this pull request as draft November 26, 2026 03:25

@loopzero-feder-positronics loopzero-feder-positronics 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.

loopzero primary review by claude on 1e768fe7464ca0ab40c0996152ab4d948e56bd8f, 30.5s: approve (0 critical, 0 important, 1 suggestion)

Settings per native call (launch configuration and CLI claims, not backend attestation):

  • Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)

Native Claude output is retained in the restricted local review receipt.

Comment thread src/loopzero/github.py Outdated
)


def readiness_timestamp(value: object) -> datetime | None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: New parser is public, but the module's other readiness helpers are private

readiness_timestamp has no leading underscore, while its neighbours (_check_run_order, _has_active_replacement, _check_signals) all do. Nothing outside github.py calls it in this diff. The task says #1453 will share this parser. If #1453 also lives in github.py, renaming it to _readiness_timestamp keeps the module's API surface unchanged. If #1453 imports it from another module, keep the public name and add a one-line docstring saying it is strict and offset-aware and returns None for untrusted or invalid input. Either way, choose one name before merging so the two PRs don't produce two parsers.

Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; comparison order still uses the same producer identity and retry gates.

@loopzero-feder-positronics loopzero-feder-positronics 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.

loopzero delta review by claude on 96d7ca0b176069deeffb7d8a9d1384f83750fd7e, 22.1s: approve (0 critical, 0 important, 0 suggestion)

Settings per native call (launch configuration and CLI claims, not backend attestation):

  • Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)

Native Claude output is retained in the restricted local review receipt.

@eowca
eowca marked this pull request as ready for review November 26, 2026 12:31
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

🚫 Left the queue · queue conditions no longer match

1 min in the queue, with no time running CI.

So far

Reason

Pull request #1508 has been dequeued

Queue conditions are not satisfied:

  • -draft [📌 queue requirement]
  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue rule main]
      • -draft

To get back in the queue

  • Push a change if one is needed: the pull request is queued again once its queue conditions match.
  • If no change is needed, comment @mergifyio queue to queue it again as it is.

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot added the queued label Nov 26, 2026
@eowca
eowca marked this pull request as draft November 26, 2026 12:32
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

No description provided.

@mergify mergify Bot removed the dequeued label Nov 26, 2026
@eowca
eowca marked this pull request as ready for review November 26, 2026 13:57
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Merged into main as c21528b at 14:05 UTC

6 min in the queue, 5 min of it CI.

So far

  • ✅ Entered the queue Thu 26 Nov, 13:59 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1919
  • ✅ Merged 14:05 · c21528b · squash
3 merge conditions met
  • github-review-approved · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = checks
    • check-neutral = checks
    • check-skipped = checks
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = Loop-zero Eligibility
    • check-neutral = Loop-zero Eligibility
    • check-skipped = Loop-zero Eligibility

Times in UTC · dashboard · how the merge queue works

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

No description provided.

@mergify
mergify Bot merged commit c21528b into main Nov 26, 2026
15 checks passed
@mergify mergify Bot removed the queued label Nov 26, 2026
@eowca
eowca deleted the lean178/1462-readiness-run-order branch November 26, 2026 14:05
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.

Compare readiness run selection and workflow replacement timestamps as instants

1 participant