Agents Builders

Task stage change log

Archived
task-stage-change-log

Created

Jun 23, 03:30

Started

Jun 23, 03:31

Completed

Jun 23, 06:08

DevOps handoff

Type

Feature

Shape

ui+db

Worktree Slug

task-stage-change-log

Repositories

mcritchie-studio

Release Train

Branch

feat/task-stage-change-log

QA URL

Production URL

db-migration

Acceptance Criteria

  • Every stage change writes an append-only TaskEvent row
  • Event stores from, to, occurred_at, duration server-side
  • Agent attaches model, tokens, cost per transition via CLI
  • Task show page renders a stage-change timeline section
  • Existing tasks backfilled from current stage timestamp columns
  • Non-agent transitions recorded with null cost fields

Expected Test Plan

  • [unit] TaskEvent row created on every stage_changed save
  • [unit] from, to, occurred_at, duration computed correctly
  • [integration] timeline section renders on task show page

Checks Run

  • [unit] bin/rails test test/models/task_event_test.rb
  • [component] integration test renders Stage Timeline section on show page
  • [integration] API stage move records annotated TaskEvent, surfaced on timeline
  • [e2e] npx playwright test e2e/task_timeline.spec.js (timeline-demo task)

Agent Context

Stage-change event log. DECISION (owner-confirmed 2026-06-22): deterministic structured spine, NOT agentic prose. New append-only task_events table written from Task#set_stage_timestamp chokepoint (after_save, if stage_changed?, has stage_was). Columns: task_slug, from_stage, to_stage, occurred_at (server time), seconds_in_from (computed at write, immutable), source (cli|api|web|conductor), actor (agent_slug/session_id), model, tokens_in, tokens_out, cost (all nullable, agent-supplied). Cost attribution = best-effort PER-TRANSITION: bin/task move gains usage flags carrying the delta since last move; non-agent transitions leave cost null. Backfill existing tasks from started_at/submitted_at/reviewed_at/assembled_at/completed_at/blocked_at(+blocked_from)/archived_at into synthetic events. UI: Stage Timeline section in app/views/tasks/show.html.erb between devops (~L182) and conversation (~L184), reusing _badge + stage_scheme + space-y-2 card pattern; measured duration vs reported cost visually distinguished. Phase 2: interleave with Activity feed. Keep existing timestamp columns (other code reads them); table is additive.

Stage Timeline

Who handled each stage, the time it took (measured), and the model / tokens / cost reported (best-effort) — plus who's on it right now. means the agent didn't report that metric.

  1. Assembled Shipped
    E
    e4a5f625-957f-443f-8052-325270715c9b
    Model
    Duration
    Tokens
    Cost
    Completed Jun 23, 06:08 · 4 days ago
  2. Shipped Archived
    Model
    Duration
    about 11 hours
    Tokens
    Cost
    Started Jun 23, 06:08
    Completed Jun 23, 17:13 · 4 days ago

Conversation

QA review feedback, agent handoffs, and follow-up notes for this task.

QA Feedback 4 days ago

2-senior review (new flow): Shannon (light)=APPROVE (clean timeline, avatar-ready). Carl (heavy)=BLOCK on 2 small fixes: (1) host current.rb shadows engine Current's attribute :user (test-invisible regression); (2) CLI/conductor actor mis-attributes to the build claimant (breaks per-stage avatars). Fixing forward on-branch + adding logged-in + backfill tests.

Sealed-bid sizing

Edit →

Alex (PM)

Avi (PO)

Dev

Actual