Show start, finish and duration in os-sdlc implementation runs #804

Closed
opened 2026-09-28 19:15:56 +00:00 by jared · 2 comments
Owner

Problem

An implementation run does not show when it started or finished. Implementation::OpenPayload#to_h returns created_at as a raw Time#to_s string, and the implement skill does not tell the orchestrator to show it. Implementation::Summary#totals returns elapsed_s as raw seconds. The user cannot see how long a run took, or how long ago a run in an old terminal window happened.

Reproduce

n/a: feature ticket.

Approach

Timestamp.new(time).to_s  # => "Mon 2026-09-28 15:01 EDT"
Duration.new(2292).to_s   # => "38 min 12 s"
Duration.new(3605).to_s   # => "1 h 0 min 5 s"
Duration.new(42).to_s     # => "42 s"

Timestamp formats time.localtime with "%a %Y-%m-%d %H:%M %Z". It uses the system zone, which is America/New_York on the user's machines. Duration rounds to whole seconds and drops leading zero units only. Both are presenters in lib/os_sdlc/presenter/, one constant per file, like presenter/failure_directive.rb.

OpenPayload#to_h adds started:. Summary#totals adds started:, finished: (from terminal_at) and duration:. Keep created_at and elapsed_s as they are.

Tests must not depend on the machine zone. Build times with Time.local and compare the zone part against the same value.

Required work:

  1. Add OsSdlc::Timestamp in lib/os_sdlc/presenter/timestamp.rb.
  2. Add OsSdlc::Duration in lib/os_sdlc/presenter/duration.rb.
  3. Add started to Implementation::OpenPayload#to_h.
  4. Add started, finished and duration to Implementation::Summary#totals.
  5. In skills/implement/SKILL.md, after implementation-open, tell the orchestrator to print Implementation <implementation_id> started <started> to the user. In the report step, tell it to print Started, Finished and Duration lines under the dispatch table — check: grep -n "started" plugins/os-sdlc/skills/implement/SKILL.md

Rejected: ActionView distance_of_time_in_words — it gives "about 1 hour", which is not precise, and it adds actionview, activesupport and nokogiri for one method.
Rejected: a relative "3 days ago" phrase — it is correct only when printed and becomes wrong in a terminal window that stays open.
Rejected: ENV or tzinfo zone configuration — Ruby already uses the system zone.

Acceptance criteria

  1. Given a local time of 2026-09-28 15:01, when Timestamp renders it, then the text is the weekday, 2026-09-28 15:01 and the zone abbreviation.
  2. Given 2292 seconds, when Duration renders it, then the text is 38 min 12 s.
  3. Given 3605 seconds, when Duration renders it, then the text is 1 h 0 min 5 s.
  4. Given 42 seconds, when Duration renders it, then the text is 42 s.
  5. Given an opened implementation, when implementation-open returns, then the payload has started rendered by Timestamp from created_at.
  6. Given a completed implementation, when implementation-report runs, then totals has started, finished from the terminal stamp, and duration rendered by Duration.

Owner sketch

module OsSdlc
  class Timestamp
    def initialize(time)
    def to_s
  end

  class Duration
    def initialize(seconds)
    def to_s
  end
end

Non-goals

The payload presenter move is #805. The failure block is #806.

Origin

  • Trigger: user request for start, finish and duration in the implementation lifecycle
  • Improvised this session: none
  • Chain: no time shown ← OpenPayload returns raw created_at, Summary returns raw elapsed_s ← DESIGN (presenter/implementation/open_payload.rb:15, presenter/implementation/summary.rb:22)
  • Root candidate: this ticket
  • Where: plugins/os-sdlc/lib/os_sdlc/presenter/implementation/open_payload.rb, plugins/os-sdlc/lib/os_sdlc/presenter/implementation/summary.rb
  • Session: b505a812-db25-4f85-8d52-ae7cda49eaab
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/b505a812-db25-4f85-8d52-ae7cda49eaab.jsonl
## Problem An implementation run does not show when it started or finished. `Implementation::OpenPayload#to_h` returns `created_at` as a raw `Time#to_s` string, and the implement skill does not tell the orchestrator to show it. `Implementation::Summary#totals` returns `elapsed_s` as raw seconds. The user cannot see how long a run took, or how long ago a run in an old terminal window happened. ## Reproduce n/a: feature ticket. ## Approach ```ruby Timestamp.new(time).to_s # => "Mon 2026-09-28 15:01 EDT" Duration.new(2292).to_s # => "38 min 12 s" Duration.new(3605).to_s # => "1 h 0 min 5 s" Duration.new(42).to_s # => "42 s" ``` `Timestamp` formats `time.localtime` with `"%a %Y-%m-%d %H:%M %Z"`. It uses the system zone, which is America/New_York on the user's machines. `Duration` rounds to whole seconds and drops leading zero units only. Both are presenters in `lib/os_sdlc/presenter/`, one constant per file, like `presenter/failure_directive.rb`. `OpenPayload#to_h` adds `started:`. `Summary#totals` adds `started:`, `finished:` (from `terminal_at`) and `duration:`. Keep `created_at` and `elapsed_s` as they are. Tests must not depend on the machine zone. Build times with `Time.local` and compare the zone part against the same value. Required work: 1. Add `OsSdlc::Timestamp` in `lib/os_sdlc/presenter/timestamp.rb`. 2. Add `OsSdlc::Duration` in `lib/os_sdlc/presenter/duration.rb`. 3. Add `started` to `Implementation::OpenPayload#to_h`. 4. Add `started`, `finished` and `duration` to `Implementation::Summary#totals`. 5. In `skills/implement/SKILL.md`, after `implementation-open`, tell the orchestrator to print `Implementation <implementation_id> started <started>` to the user. In the report step, tell it to print `Started`, `Finished` and `Duration` lines under the dispatch table — check: `grep -n "started" plugins/os-sdlc/skills/implement/SKILL.md` Rejected: ActionView `distance_of_time_in_words` — it gives "about 1 hour", which is not precise, and it adds actionview, activesupport and nokogiri for one method. Rejected: a relative "3 days ago" phrase — it is correct only when printed and becomes wrong in a terminal window that stays open. Rejected: ENV or tzinfo zone configuration — Ruby already uses the system zone. ## Acceptance criteria 1. Given a local time of 2026-09-28 15:01, when `Timestamp` renders it, then the text is the weekday, `2026-09-28 15:01` and the zone abbreviation. 2. Given 2292 seconds, when `Duration` renders it, then the text is `38 min 12 s`. 3. Given 3605 seconds, when `Duration` renders it, then the text is `1 h 0 min 5 s`. 4. Given 42 seconds, when `Duration` renders it, then the text is `42 s`. 5. Given an opened implementation, when `implementation-open` returns, then the payload has `started` rendered by `Timestamp` from `created_at`. 6. Given a completed implementation, when `implementation-report` runs, then `totals` has `started`, `finished` from the terminal stamp, and `duration` rendered by `Duration`. ## Owner sketch ```ruby module OsSdlc class Timestamp def initialize(time) def to_s end class Duration def initialize(seconds) def to_s end end ``` ## Non-goals The payload presenter move is #805. The failure block is #806. ## Origin - Trigger: user request for start, finish and duration in the implementation lifecycle - Improvised this session: none - Chain: no time shown ← `OpenPayload` returns raw `created_at`, `Summary` returns raw `elapsed_s` ← DESIGN (`presenter/implementation/open_payload.rb:15`, `presenter/implementation/summary.rb:22`) - Root candidate: this ticket - Where: `plugins/os-sdlc/lib/os_sdlc/presenter/implementation/open_payload.rb`, `plugins/os-sdlc/lib/os_sdlc/presenter/implementation/summary.rb` - Session: b505a812-db25-4f85-8d52-ae7cda49eaab - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/b505a812-db25-4f85-8d52-ae7cda49eaab.jsonl
Author
Owner

Work started on branch ticket-804 via /os-sdlc:implement.

Work started on branch ticket-804 via /os-sdlc:implement.
Author
Owner

Resolution

Done: Timestamp and Duration presenters added; implementation-open payload carries started; report totals carry started, finished and duration; implement skill prints them.

Evidence: Commit 18cc07e3 on ticket-804. os-sdlc implementation 62 reached implementation_complete: 11 dispatches, suite-check dispatch 648 green, contract-auditor dispatch 649 pass.

Follow-ups: Existing: #803 (worktree guard blocked the contract-auditor heredoc; orchestrator submitted it by hand), #665 (stale stdout fixture has no repair route; fixture updated by hand). Dropped: optional double rounding in summary.rb; implementation-report refusing after implementation_complete (terminal payload already carries the summary, raised with the user).

## Resolution **Done:** Timestamp and Duration presenters added; implementation-open payload carries started; report totals carry started, finished and duration; implement skill prints them. **Evidence:** Commit 18cc07e3 on ticket-804. os-sdlc implementation 62 reached implementation_complete: 11 dispatches, suite-check dispatch 648 green, contract-auditor dispatch 649 pass. **Follow-ups:** Existing: #803 (worktree guard blocked the contract-auditor heredoc; orchestrator submitted it by hand), #665 (stale stdout fixture has no repair route; fixture updated by hand). Dropped: optional double rounding in summary.rb; implementation-report refusing after implementation_complete (terminal payload already carries the summary, raised with the user).
jared closed this issue 2026-09-28 19:32:56 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#804
No description provided.