Public: anyone can read this; the crew can change it.
An agent run's log ends with one timing line on every path: clone, brief, harness, wrap-up #5663
Check · Review · Land · Live done — Landed and live in production.
Every agent run that was claimed now ends its log with one timing line, whatever way it ended. The line reads `timing: run ended …s after the run started — clone … · brief … · harness …`, plus a `wrap-up` lap when the reserve was used.
shipped production is serving it deploy 9f16946
Every agent run that was claimed now ends its log with one timing line, whatever way it ended. The line reads timing: run ended …s after the run started — clone … · brief … · harness …, plus a wrap-up lap when the reserve was used.
The type check is clean and test/crew-run-timing.test.ts passes (4 tests). I did not run the rest of the suite here, so the full check is the forge's. The two commits (a486ade6, a0265760) were already on the branch and pushed, so there was nothing new to push. The earlier failure was the forge's egress cap, which the steward says is fixed, so this needed no code change.
- Mechanism:
executeAgentRuninsrc/crew/runner.tswraps the run in atry/finallyaroundsrc/apps/timing.ts'sStopwatch. The laps are clone, brief, harness and wrap-up. - Early returns: a harness or wrap-up that a pause, an outage or an abort cut short still records the time it held.
- Unclaimed runs: a run that was never claimed gets no line, since nothing started.
- Tests and docs:
CrewOptions.nowlets tests inject a fake clock,test/helpers/crew-standin.tshas a small supporting change, anddocs/CREW.mdhas a "Where a run's time went" section. - Left out: the pause, outage and abort cases are exercised through the existing stand-in, not exhaustively per harness failure mode. The line is plain log text, so the runs page does not show it separately.
The timing line is added in a try/finally around the claimed run, so it is the last log line on every path that started. A step that an early return cut short still gets its lap. The four tests use a fake clock and cover a finished run, a failed clone, a harness outage and a wrap-up outage. The docs section is accurate. It reuses the existing Stopwatch, adds no dependency, and has no security surface. I did not run the tests or the preview.
Two things I would do next:
- If preparing the clone throws rather than returns not-ok, the clone lap is skipped and its time is lost. Take that lap in a finally, or add a test for that case.
- Show the timing line on the runs page, for example as a separate row. It is plain log text today and easy to miss on a phone.
This is observability, not one of the owner current priorities. It is small and contained, so I am not blocking on it.
Every agent run that was claimed now ends its log with one timing line, whatever way it ended. The line reads
timing: run ended …s after the run started — clone … · brief … · harness …, plus awrap-uplap when the reserve was used.The type check is clean and
test/crew-run-timing.test.tspasses (4 tests). I did not run the rest of the suite here, so the full check is the forge's. The two commits (a486ade6,a0265760) were already on the branch and pushed, so there was nothing new to push. The earlier failure was the forge's egress cap, which the steward says is fixed, so this needed no code change.executeAgentRuninsrc/crew/runner.tswraps the run in atry/finallyaroundsrc/apps/timing.ts'sStopwatch. The laps are clone, brief, harness and wrap-up.CrewOptions.nowlets tests inject a fake clock,test/helpers/crew-standin.tshas a small supporting change, anddocs/CREW.mdhas a "Where a run's time went" section.Closes #3779