Agents Builders

Deploy spans self-report actions

Archived
deploy-spans-self-report-actions

Created

Jul 05, 22:33

Started

Jul 05, 22:52

Completed

Jul 06, 00:49

DevOps handoff

Type

Feature

Shape

backend

Worktree Slug

deploy-spans-self-report-actions

Repositories

mcritchie-studio

Release Slug

Branch

feat/deploy-spans-self-report-actions

Local URL

QA URL

Production URL

telemetry release-pipeline

Acceptance Criteria

  • bin/release posts each deploy step as AgentAction
  • REMOTE sweep span shows real action rows
  • capture failure never aborts a release
  • unit and integration cover the POST helper

Expected Test Plan

  • unit
  • integration

Checks Run

  • [unit] read_open_activity round-trips the marker; step self-reports only inside a role span; agent_action no-op under dry-run
  • [integration] action verb POSTs agent_action pinned to open activity (kind/summary/mascot/stage), no-op without open span; prepare self-reports step actions end-to-end
  • [full-suite@021e885a8ef577a72c2a55c281c1ce4f9a71ae9c] bin/rails test green
  • [rubocop@021e885a8ef577a72c2a55c281c1ce4f9a71ae9c] bin/rubocop clean

Agent Context

Root cause: bin/release (release.rb) does its real work as subprocesses (git, gh, bin/qa-server, heroku run conductor snippets) inside ONE Claude Bash tool call, and opens/closes its own agent-activity span (open_role_span REMOTE 'sweep -> deploy RC to QA', line ~1066/1404). The PostToolUse capture hook (bin/atomic-capture-hook) only fires on Claude tool calls, so the REMOTE span brackets a period with zero capturable actions -> 'No raw actions attributed'. Also the session's parent WORKFLOW span gets auto-closed when bin/release writes the marker. Fix (operator chose Real rows / self-report): make bin/release's step() best-effort POST an AgentAction to /api/v1/agent_actions attributed to the currently-open activity (agent_activity_id from the local marker read_open_activity), mirroring atomic-capture-hook auth (POST /api/v1/auth {secret} to mint the agent token). Each step (sweep! xN, per-app QA deploy, boot-wait, record qa_url, qa_green! flip) becomes a real row. MUST be best-effort/non-fatal like the existing narration + record_deploy_intent helpers: any error (down endpoint, no token, PG outage) is swallowed and the release continues. Member-flip token usage still rides each member's assembled TaskEvent via qa_green! usage_by_slug (unchanged). Applies to ship's Avi span too. Deploy-side subprocess actions have no LLM token cost, so cost stays 0 on those rows by design.

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.

Sizing Avi · PO MEDIUM Dev MEDIUM Actual XL ≠ forecast
  1. Created Designed
    T Togepi
    Togepi
    Model
    Duration
    Tokens
    Cost
    Completed Jul 05, 22:33 · 3 days ago
    api
  2. Designed Building
    T Togepi
    Togepi
    Model
    claude-opus-4-8
    Duration
    18 minutes
    Tokens
    21,117,013
    Cost
    ~$16.28
    Started Jul 05, 22:33
    Completed Jul 05, 22:52 · 3 days ago
    cli
  3. Building Submitted
    T Togepi
    Togepi
    Model
    claude-opus-4-8
    Duration
    17 minutes
    Tokens
    27,376,661
    Cost
    ~$17.66
    Started Jul 05, 22:52
    Completed Jul 05, 23:09 · 3 days ago
    cli
  4. Submitted Reviewed Review Activity
    C Carl
    Carl primary
    J Jasper
    Jasper light
    Model
    claude-opus-4-8
    Duration
    about 1 hour
    Tokens
    1,138,862
    Cost
    ~$2.24
    Started Jul 05, 23:09
    Completed Jul 06, 00:17 · 3 days ago
    cli
  5. Evolve
    T Togepi
    Togepi
    T Togetic
    Togetic
    triggered by
    C Carl
    Carl
    Model
    Duration
    about 1 hour
    Tokens
    Cost
    Started Jul 05, 23:09
    Completed Jul 06, 00:17 · 3 days ago
  6. Reviewed Assembled
    S Steffon
    Steffon
    Model
    claude-opus-4-8
    Duration
    17 minutes
    Tokens
    3,718,947
    Cost
    ~$4.18
    Started Jul 06, 00:17
    Completed Jul 06, 00:34 · 2 days ago
  7. Assembled Shipped
    A Avi
    Avi
    Model
    claude-opus-4-8
    Duration
    15 minutes
    Tokens
    5,605,411
    Cost
    ~$5.04
    Started Jul 06, 00:34
    Completed Jul 06, 00:49 · 2 days ago
  8. Shipped Archived
    Model
    Duration
    about 15 hours
    Tokens
    Cost
    Started Jul 06, 00:49
    Completed Jul 06, 15:43 · 2 days ago

Conversation

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

Handoff carl 3 days ago

Avi review approved (carl primary + jasper light); ready for Steffon's qa-release sweep. Non-fatal guarantee verified at both layers (release.rb agent_activity swallows + system never raises + bounded 2s/5s AgentApi timeouts; CLI run/post rescue StandardError + exit 0). action verb is read-only on the open-activity marker so it cannot clobber/auto-close the parent span; role-span gated; dry-run + no-span no-ops. DoR full-suite STALE is a false-positive: cert tree 021e885a == PR head e0fdcc5724^{tree} (identical), GitHub CI test green at head.

Sealed-bid sizing

Edit →

Alex (PM)

Avi (PO)

MEDIUM

Dev

MEDIUM

Actual

XL