Repository navigation
feat(gate): carry each run's CPU and end time in the gate record - #770
Conversation
Quest-Claim: 17818385a9cc39bc
…D line Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou'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. View limit details
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. |
kixelated
left a comment
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
✅ 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 takesendedonce, aftergated()settles, and the wait log'senduses the same value.cpureusesobserved.cpu, whichgated()sets in itsfinallyfrom thebackgroundowner'smeasuredRunreading. 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 --helptext insrc/cli/main.tsnow say where the wait, wall time, and CPU come from, and thatunitstill points to the journal for peak memory. - Tests: The record test checks that
endedcomes in order after the other timestamps. It also checkscpu > 0for a busy loop under a scope, andnullwhen there is no scope. The queued-cancel test checks for anendedstring andcpu: null.
claude-opus-5-5 | 𝕏

Finishes quest/m0/benchmark/gate-record-cpu.md (file deleted).
Summary
Each
QUEST_GATE_RECORDline gains two fields:ended(ISO timestamp, set however the run ends, a run cancelled in the queue included) andcpu(milliseconds from the scope'scpu.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).endedis taken once and shared with the wait log'send.unitstays for peak memory. README's "Record each run" section andquest gate --helpsay where CPU and wall time come from.Public API
The record line's JSON gains
endedandcpu; existing fields are unchanged, so no!. No wire impact.Validation
just checkandjust testpass (1491 tests; the record tests now assertendedordering,cpu > 0for a busy loop under a scope, and nullcpufor a run cancelled in the queue).QUEST_GATE_RECORD=... quest gate sh -c '<busy loop>'recorded"ended"0.4 s after"admitted"and"cpu":376;quest gate truerecorded"cpu":2.Models
Size: XS
Implementer: claude-sonnet-5-5, high effort (arm A)
Review
Rewritten by
quest reviewafter 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-b07742755225Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1e8fa-d929-7720-8d44-a8aa481300c2, round 1Score: 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 1Score: 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