Skip to content

Record host Suspended time and show it in thirdshift show #2032

Closed

Description

@JacobStephens2

This was generated by AI during triage.

Parent

#2026 (decisions: docs/grill-with-docs/2026-host-suspension.md, glossary: Suspended time)

What to build

A Command whose host is suspended (a laptop asleep, a VM paused while its own host sleeps) records the Suspended time itself, and thirdshift show explains a long stage.

  • The running Command compares wall-clock time with a monotonic clock that stops in suspension. When the wall clock has run at least one minute ahead since the previous reading, the difference is a suspension. Smaller gaps, such as NTP steps, are ignored. The threshold is fixed. (Q2.3)
  • The Command checks at least every 30 seconds while it is live. The current stage's Suspended time reaches the Command record within about a minute of wake, without waiting for a stage transition. (Q1.3)
  • Each suspension writes one Command log line, e.g. host was suspended 1 h 38 m.
  • Each stage in the Command record carries an optional Suspended time. An absent field reads as zero, so older records parse unchanged. A stage's own time stays wall-clock time. (Q1.2)
  • thirdshift show, text and --json, shows a stage's Suspended time beside its time, e.g. "10 h 6 m · 9 h 40 m suspended", and nothing extra when it is zero. (Q2.4)
  • Every Command measures it: Passes, Ticket runs, Spec runs, Fix runs, Security runs, Triage runs, Experiments and Process evals. (Q1.4)

Prefactor first: the logs module's effects interface (Outside), which already supplies the wall clock, gains a monotonic reading beside it. Tests can then script a suspension without sleeping.

Acceptance criteria

  • A scripted suspension of 2 minutes during a live stage records 120 s of Suspended time on that stage, and one Command log line, before the stage ends.
  • A scripted 30-second wall-clock step records nothing.
  • Two suspensions in one stage add up, with one log line each. A suspension in a later stage is recorded on that stage.
  • A Command record without the field parses, and reads as zero Suspended time.
  • thirdshift show shows "· suspended" next to a suspended stage's time, in text and --json, and shows nothing extra for other stages.
  • No test sleeps for real to produce a suspension.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions