Skip to content

Observe: count the run leader's rest phases and expose the instance id (#271 A+B) - #295

Merged
pjerra merged 3 commits into
devfrom
fix/ta271-observe-rest-instance
Oct 22, 2026
Merged

pjerra merged 3 commits into
devfrom
fix/ta271-observe-rest-instance

Conversation

@pjerra

@pjerra pjerra commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Part of #271 (parts A and B).

  • Rest in observe runs: observe runs now count the run leader's rest phases (TBM:RUN phase rest) as rest gates (result run_leader), with rest trace events ("source": "run_leader"), rest_seconds, rest_share and per-leg totals. A rest still open at the end of the run is closed and counted. Paused time is not counted as rest: a rest is open only while the run is running.
  • Instance id: the lead bot's instance id is exposed as report.instance, an instance trace event and the summary's instance.

Tests: six observe/trace tests, each failing before the change (rest seconds 0, rest gates empty, instance 0, paused time counted as rest); mutations of each rule turn a test red. go test ./... and go vet ./... pass.

Reviews: Opus cold review (one fix found: paused time counted as rest, fixed in d3c8081), Codex review of the fix clean.

Known limits: a rest before the first leg status adds to rest_seconds but to no per-leg total; group/leader-mode drivers do not expose the instance id yet.

Still open on #271: part C, the botwatch sampler that exits silently (wow-play-harness).

A paused TBM:RUN line still carries the phase it paused in, so a run
paused in the rest phase kept its rest open and the whole pause
(PausedWait, 10 min) went into rest_seconds and rest_share. The rest is
now open only while the run is running in phase rest; any other state
closes it, and a resume in the same phase opens a new one.

The new test fails at 290 s rest without the state check and passes at
10 s with it.
@pjerra
pjerra merged commit ab1aa4a into dev Oct 22, 2026
1 check passed
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