Agents Builders

Event outcomes and session end

Archived
event-outcomes-and-session-end

Created

Jul 01, 06:02

Started

Jul 01, 06:07

Completed

Jul 01, 12:10

DevOps handoff

Type

Feature

Shape

backend

Worktree Slug

event-outcomes-and-session-end

Repositories

mcritchie-studio

Release Slug

Branch

feat/event-outcomes-and-session-end

Local URL

QA URL

Production URL

tooling

Acceptance Criteria

  • One boundary call closes prior opens next
  • Session end closes any open span
  • Actions stamp session model when available
  • Outcomes resolve for most narrated spans

Expected Test Plan

  • [unit] boundary transition and session-end close
  • [integration] close-with-outcome then open flow

Checks Run

  • [unit] ruby -Itest test/lib/atomic_event_cli_test.rb (next/start --outcome/close-open boundary + stdin session)
  • [unit] ruby -Itest test/lib/atomic_capture_hook_test.rb (model derivation from transcript tail + direct field)
  • [unit] bin/rails test test/models/atomic_event_test.rb (open_event! prior_outcome + close_all_open!)
  • [integration] bin/rails test test/controllers/api/v1/atomic_events_controller_test.rb (create+prior_outcome closes prior with outcome; close_all endpoint)
  • [integration] bin/rails test test/controllers/api/v1/atomic_actions_controller_test.rb (model permitted + persisted)
  • [full-suite] bin/full-suite-check: 2305 runs, 0 failures; rubocop 612 files clean
  • [full-suite@a6fa04c82c8de767a33ca55618c063ddb20f09fc] bin/rails test green
  • [rubocop@a6fa04c82c8de767a33ca55618c063ddb20f09fc] bin/rubocop clean

Agent Context

Patch the narrated-events system (all shipped, in release). THREE fixes: (1) OUTCOMES resolve: most spans stay 'in progress' because the agent OPENS the next span (auto-closing the prior with a NULL outcome) instead of ending it. Add a single BOUNDARY call to bin/atomic-event so the agent closes-prior-with-outcome AND opens-next-with-reason in one step — e.g. 'bin/atomic-event next --outcome \"what happened\" --category X --reason \"what next\"'; also accept --outcome on 'start' to stamp the auto-closed prior span's outcome. Extend POST /api/v1/atomic_events (open) to accept a prior-outcome, or the close endpoint. (2) HANGING SPAN: a session that ends leaves its last span open forever + trailing actions unlabeled. Add 'bin/atomic-event close-open' (closes any still-open span for the session, generic outcome like 'session ended') + wire a Claude Code SessionEnd hook (provide the settings.json snippet + install-agent-docs wiring, like the PostToolUse hook; the orchestrator installs it after review). (3) MODEL: bin/atomic-capture-hook should stamp the session model on each action if it's available in the PostToolUse payload/env (AtomicAction.model column already exists) — investigate what's actually available; if not, leave null and REPORT what you found (don't fabricate). Keep everything best-effort/non-fatal. AtomicEvent + endpoints are in release.

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
    C Caterpie
    Caterpie
    Model
    Duration
    Tokens
    Cost
    Completed Jul 01, 06:02 · 7 days ago
    api
  2. Designed Building
    C Caterpie
    Caterpie
    Model
    claude-opus-4-8
    Duration
    5 minutes
    Tokens
    10,097,347
    Cost
    ~$7.51
    Started Jul 01, 06:02
    Completed Jul 01, 06:07 · 7 days ago
    cli
  3. Building Submitted
    C Caterpie
    Caterpie
    Model
    claude-opus-4-8
    Duration
    18 minutes
    Tokens
    3,557,140
    Cost
    ~$5.07
    Started Jul 01, 06:07
    Completed Jul 01, 06:25 · 7 days ago
    cli
  4. Submitted Reviewed Review Activity
    C Carl
    Carl primary
    J Jasper
    Jasper light
    Model
    claude-opus-4-8
    Duration
    3 minutes
    Tokens
    1,591,998
    Cost
    ~$1.72
    Started Jul 01, 06:25
    Completed Jul 01, 06:28 · 7 days ago
    cli
  5. Reviewed Assembled
    S Steffon
    Steffon
    Model
    claude-opus-4-8
    Duration
    under a minute
    Tokens
    344,253
    Cost
    ~$0.32
    Started Jul 01, 06:28
    Completed Jul 01, 06:29 · 7 days ago
  6. Assembled Shipped
    A Avi
    Avi
    Model
    claude-opus-4-8
    Duration
    about 6 hours
    Tokens
    11,741,437
    Cost
    ~$8.69
    Started Jul 01, 06:29
    Completed Jul 01, 12:10 · 7 days ago
  7. Shipped Archived
    Model
    Duration
    3 days
    Tokens
    Cost
    Started Jul 01, 12:10
    Completed Jul 04, 03:23 · 4 days ago

Conversation

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

No task feedback has been recorded yet.

Sealed-bid sizing

Edit →

Alex (PM)

Avi (PO)

MEDIUM

Dev

MEDIUM

Actual

XL