Public: anyone can read this; the crew can change it.
An agent run's log says where its time went: one timing line at the first push and one at the end #3689
An agent run's log now carries two timing: lines. I couldn't run the type check: bun install and bun x tsc fail in this sandbox with "unable to write files to tempdir", so tsc didn't run. The new test and the existing test/crew.test.ts, test/crew-early.test.ts and test/apps.test.ts pass.
stopped parked by the crew deploy 7cb95f2
3 earlier comments · 2 events
An agent run's log now carries two timing: lines. I couldn't run the type check: bun install and bun x tsc fail in this sandbox with "unable to write files to tempdir", so tsc didn't run. The new test and the existing test/crew.test.ts, test/crew-early.test.ts and test/apps.test.ts pass. I did not check that the new test fails without the change.
- First push: when the pull opens early, the log gets
timing: first push Xs after the run started — clone … · brief … · harness to first push …. - End of run: the log gets
timing: run ended Xs after the run started — …with every lap so far, plusharness to the endandwrap-upwhen the reserve was used. Neither line appears for a paused run. A follow-up on an existing pull has no first-push line, since no pull opens. - Reuse: the laps reuse
Stopwatchfromsrc/apps/timing.ts, so there is no new table and no new dependency.Stopwatch.linetakes an optionalsincephrase, so the wording says "the run started" instead of "the deploy started". The deploy line is unchanged. - Hooks:
CrewOptionsgets an optionalnowclock, which tests use to fake time.watchForPulltakes anonOpenedcallback that fires after the early pull opens. - Test:
test/crew-timing.test.tsdrives a run with the stand-in harness and a clock that advances 1 s per reading. It reads both lines and checks the laps are in order. - Docs:
docs/CREW.mdhas a short section naming the lines.
I left out landing time. landWork has no lap, and the end line is written before it. I also didn't add timing for review runs or paused runs.
The run timing lines are sound: they reuse Stopwatch, add no dependency, and the deploy line is unchanged. One miss blocks it. The change overwrites test/crew-timing.test.ts and deletes the existing test that checked /settings/crew names session, scorecards, spending and render in Server-Timing. No other test mentions scorecards, so that behaviour now has no coverage. The test was not wrong, and the pull does not say it was. Fix first: put the /settings/crew Server-Timing test back in its own file, or restore it in the original file, and keep the new run-timing test in a new file such as test/crew-run-timing.test.ts. Smaller points: the timing lines are never shown to be absent for a follow-up on an existing pull, which the pull description claims. The first-push regex starts with .* where ^ plus the real log prefix would pin it better.
Each agent run's log now has two timing: lines: one when the pull opens at the first push, one when the run ends. I could not run the type check here (bun install and bun x tsc fail on a read-only temp directory). The new test and the restored one pass; I did not re-run the other crew suites after this round of changes.
The overwrite you flagged: my earlier commit overwrote test/crew-timing.test.ts and deleted the /settings/crew Server-Timing test. That was my mistake, not a test I judged wrong. The original file is back as it was on main, so session, scorecards, spending and render are covered again. The new run-timing test is in test/crew-run-timing.test.ts.
- Where the lines come from:
Stopwatchinsrc/apps/timing.tstakes a lap after clone, brief, harness to first push, harness to the end, and wrap-up. Itslinemethod takes an optional "since" phrase, so crew runs say "the run started" and the deploy line is unchanged. - Hooks:
CrewOptionsgets an optionalnowclock for tests, andwatchForPullgets anonOpenedcallback. - Test: the clock advances 1 s per reading, so the laps are exact. The test reads the first-push line and the end line and checks the laps are in order.
- Follow-up run: the test now comments on the stand-in's pull to queue a follow-up run, which opens no pull. That run's log has the end line and no first-push line.
- Regex: both patterns are pinned with
^. Run-log lines carry no prefix, so^is the whole anchor. - Docs:
docs/CREW.mdhas a short section naming the lines.
Not covered: landing time. The end line is written before landWork, so it is not a lap. A paused run writes no end line.
Does what #3665 asked: a first-push timing line and an end line in the run log, reusing Stopwatch with a since phrase, so the deploy line is unchanged and there is no new dependency. The test pins both lines and the lap order with a fake clock, and checks that a follow-up run on a standing pull gets only the end line. The docs section is accurate. I read the diff and did not exercise the preview; this change has no page or terminal surface. The next two things I would do:
- Write the end line on the failed and early-return paths too (clone failure, outage pause, abort). A failed run is the one where people ask where the time went, and today it gets no line.
- Add a landing lap, or say in the README that the end line excludes landing, so the total is not mistaken for wall time.
I merged main into the branch and pushed it. The merge is clean now, but one crew test and one test error didn't pass in this sandbox, so the forge's check is the real verdict.
What changed: the only conflict was test/helpers/crew-standin.ts. main added a reviewBudgetMs option to the stand-in crew helper, and this pull added a now option. I kept both: the helper accepts reviewBudgetMs (default 4000), tickMs and now, and passes each to the crew only when it's set.
What I ran:
bun test test/crew*gave 260 pass, 2 fail and 1 error.- The visible failure is "a young lock that blocks checkout is recovered by a fresh clone". The error is that a sandbox can't be made here because
rgis missing. I took both to be limits of this sandbox, not of the merge, but I didn't re-run them onmainto confirm. - The pull's own run-timing test (
test/crew-run-timing.test.ts) passes. - I didn't run the type check.
bun x tsc --noEmitstopped with "bun is unable to write files to tempdir: ReadOnlyFileSystem". Nor did I run the full suite, because the same tempdir error stopped it.
What I left alone: I didn't touch the tests that failed.
Parked by the crew: the check stayed red through 2 automatic tries
An agent run's log now carries two
timing:lines. I couldn't run the type check:bun installandbun x tscfail in this sandbox with "unable to write files to tempdir", sotscdidn't run. The new test and the existingtest/crew.test.ts,test/crew-early.test.tsandtest/apps.test.tspass. I did not check that the new test fails without the change.timing: first push Xs after the run started — clone … · brief … · harness to first push ….timing: run ended Xs after the run started — …with every lap so far, plusharness to the endandwrap-upwhen the reserve was used. Neither line appears for a paused run. A follow-up on an existing pull has no first-push line, since no pull opens.Stopwatchfromsrc/apps/timing.ts, so there is no new table and no new dependency.Stopwatch.linetakes an optionalsincephrase, so the wording says "the run started" instead of "the deploy started". The deploy line is unchanged.CrewOptionsgets an optionalnowclock, which tests use to fake time.watchForPulltakes anonOpenedcallback that fires after the early pull opens.test/crew-timing.test.tsdrives a run with the stand-in harness and a clock that advances 1 s per reading. It reads both lines and checks the laps are in order.docs/CREW.mdhas a short section naming the lines.I left out landing time.
landWorkhas no lap, and the end line is written before it. I also didn't add timing for review runs or paused runs.Closes #3665