Skip to content

feat(gate): carry each run's CPU and end time in the gate record - #770

Merged
kixelated merged 2 commits into
mainfrom
quest/m0/benchmark/gate-record-cpu
Nov 17, 2026
Merged

kixelated merged 2 commits into
mainfrom
quest/m0/benchmark/gate-record-cpu

Conversation

@kixelated

@kixelated kixelated commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m0/benchmark/gate-record-cpu.md (file deleted).

Summary

Each QUEST_GATE_RECORD line gains two fields: ended (ISO timestamp, set however the run ends, a run cancelled in the queue included) and cpu (milliseconds from the scope's cpu.stat, the same value as the wait log's; null without a systemd scope, such as on macOS, and for a run that never ran). ended is taken once and shared with the wait log's end. unit stays for peak memory. README's "Record each run" section and quest gate --help say where CPU and wall time come from.

Public API

The record line's JSON gains ended and cpu; existing fields are unchanged, so no !. No wire impact.

Validation

  • just check and just test pass (1491 tests; the record tests now assert ended ordering, cpu > 0 for a busy loop under a scope, and null cpu for a run cancelled in the queue).
  • Ran the built CLI: QUEST_GATE_RECORD=... quest gate sh -c '<busy loop>' recorded "ended" 0.4 s after "admitted" and "cpu":376; quest gate true recorded "cpu":2.

Models

Size: XS
Implementer: claude-sonnet-5-5, high effort (arm A)

Review

Rewritten by quest review after each round.

  • Head: d89c18e

  • Base: origin/main at 662806d

  • Risk: high, Adding ended and cpu changes the gate’s machine-readable record schema, which downstream consumers may parse strictly; reverting restores future output but cannot remove records already written.

  • Classified: high by Codex, gpt-6.1-sol, low effort, session 01a1e8fa-b304-7063-9dd9-b07742755225

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1e8fa-d929-7720-8d44-a8aa481300c2, round 1

  • Score: 9/10, The record correctly reuses existing CPU accounting and consistently captures the end timestamp, including cancellation paths; no actionable defects were found by inspection, though builds and tests were not run as instructed.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

  • Reviewer: Codex, gpt-6.1-sol, low effort, shadow

  • Session: 01a1e8fa-d929-7363-9ecd-8f684e6b1152, round 1

  • Score: 9/10, The change reuses existing CPU accounting and consistently records the end timestamp, including cancellation paths, with no actionable defects found by inspection; builds and tests were not run as instructed.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

kixelated and others added 2 commits November 17, 2026 02:06
…D line

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title The gate record carries each run's CPU and end time feat(gate): carry each run's CPU and end time in the gate record Nov 17, 2026
@kixelated
kixelated marked this pull request as ready for review November 17, 2026 10:09
@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 14 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f7eb309c-9efb-4f50-bca0-f01454317f18
Commits

Reviewing files that changed from the base of the PR and between 662806d and d89c18e.

Files selected for processing: 5

  • README.md
  • quest/m0/benchmark/gate-record-cpu.md
  • src/cli/gate.ts
  • src/cli/main.ts
  • test/gate.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@kixelated
kixelated enabled auto-merge November 17, 2026 10:10

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Automated review by review (OpenAI)

Reviewed head d89c18eefacdc9d3c7732d5100fe85ffe5d68427.

Go for the gate record change. Both logs use the same end timestamp; the new CPU value comes from the existing accounting and stays null before admission or without a measurable scope. Exit and cancellation handling are unchanged. Since the file is append-only, a file across an upgrade can contain both old and new rows. I'd mention to downstream JSONL readers that missing ended/cpu denotes an older row, not an invalid one. Static review; I did not rerun the gate fixtures.

@pullfrog pullfrog 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 new issues found.

Reviewed changes

I reviewed the whole diff, which adds ended and cpu to each QUEST_GATE_RECORD line.

  • Record fields: gate() now takes ended once, after gated() settles, and the wait log's end uses the same value. cpu reuses observed.cpu, which gated() sets in its finally from the background owner's measuredRun reading. The record therefore gets CPU under a systemd scope whether or not the wait log is on, and gets null for process-group owners and for runs cancelled in the queue.
  • Docs: The README's "Record each run" section and the quest gate --help text in src/cli/main.ts now say where the wait, wall time, and CPU come from, and that unit still points to the journal for peak memory.
  • Tests: The record test checks that ended comes in order after the other timestamps. It also checks cpu > 0 for a busy loop under a scope, and null when there is no scope. The queued-cancel test checks for an ended string and cpu: null.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 25bf2f8 Nov 17, 2026
27 checks passed
@kixelated
kixelated deleted the quest/m0/benchmark/gate-record-cpu branch November 17, 2026 10:15
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.

1 participant