Agents Builders

Grade test scope runs

Archived
grade-test-scope-runs

Created

Jul 06, 06:18

Started

Jul 06, 06:20

Completed

Jul 06, 07:27

DevOps handoff

Type

Feature

Shape

ui+db

Worktree Slug

grade-test-scope-runs

Repositories

mcritchie-studio

Release Slug

Branch

feat/grade-test-scope-runs

QA URL

Production URL

observability

Acceptance Criteria

  • Verdict actions tagged kind test_scope with scope key
  • Pipeline shows a gradeable test-runs band above grid
  • Banked test-run grades confirm into the confirmations column

Expected Test Plan

  • [unit] run_test_scope emits tagged action; kind/event_slug/result_slug
  • [integration] pipeline test-runs band renders + confirm-of-action reaches column 3

Checks Run

  • [unit] release_cli_test: run_test_scope tags verdict kind=test_scope/event_slug/result_slug/duration_ms; START stays plain
  • [unit] heartbeat_helper_test: release_scope_meta derivation, test_scope_counts parse, duration formatter
  • [unit] agent_actions_controller_test: event_slug/result_slug now permitted; cost/seq still derived
  • [component] pipeline_test_runs_band_test: band partial renders row, pass/fail pill, derived phase-tier-host, counts, grade link, not-rail, empty state
  • [integration] alex_pipeline_test: test-runs band renders + confirm-of-action bank->Column 3 + idempotent
  • [e2e] alex_pipeline.spec.js: seeded band renders derived meta + Column-2 action Confirm button (2 passed)
  • [full-suite@34465b2bc4faa428de0a8f22e36b9187f1b56842] bin/rails db:test:prepare test test:system green
  • [rubocop@34465b2bc4faa428de0a8f22e36b9187f1b56842] bin/rubocop clean

Agent Context

Observability epic A2 (A1 test-scope telemetry + #417 SOP both on main). GOAL: make each test-scope RUN a first-class GRADEABLE unit in /alex/pipeline, gradeable like an activity. DESIGN = Option B, gradeable-in-place, NO new model, NO migration (Carl's design pass). KEY FACT: ActionGrade grades exactly one of AgentAction OR AgentActivity (dual-FK XOR, action_grade.rb:52-78,224-229) and ALREADY grades a raw AgentAction (for_action :83; #feedback/#grade path). A1's COMPLETED/FAILED telemetry IS an AgentAction → zero grading-core change. 3 slices, all fields already columns on agent_actions: (1) TAG the verdict action at emit — kind='test_scope' (kind is presence-only, agent_action.rb:93/109, no enum change), event_slug=<scope key>, result_slug=pass|fail, duration_ms=elapsed*1000. Wire: bin/release.rb run_test_scope/scope_action/agent_action helper (:390-394,:460-503) forward these; bin/atomic-event action verb (:224-252) add --event-slug/--result-slug/--duration-ms into POST body (--kind already forwarded); api/v1/agent_actions_controller.rb capture_params (:49-73) permit :event_slug,:result_slug (duration_ms/kind already permitted; capture already maps event_slug/result_slug agent_action.rb:166-167). Tag ONLY the verdict (COMPLETED/FAILED), leave START plain (excluded by result_slug presence). (2) PIPELINE BAND: a new 'Test runs' band ABOVE the 3-col grid mirroring the Candidates band (.pl-cands, pipeline.html.erb:85-114) — NOT a 4th column (a test run FEEDS the loop like a candidate). heartbeat_controller#pipeline (:97-130): @test_runs = AgentAction.where(kind:'test_scope').where.not(result_slug:nil).order(occurred_at: :desc).limit(N). Row: event_slug headline chip + host/phase/tier DERIVED at render from the scope registry config/devops_test_suites.yml release_scopes (single source; do NOT store phase/tier/host — they'd drift on re-tier) + pass/fail pill (reuse .pl-disp good/not) + counts+duration parsed from summary + a 'grade' link to heartbeat_feedback_path(action.id) (the existing action drawer). is-not left-rail for alex 'not' grades. (3) CONFIRM-OF-ACTION: extend #confirm (heartbeat_controller.rb:137-147, currently AgentActivity.find only) + the Column-2 Confirm affordance (pipeline.html.erb:176-181, currently elsif activity_id) to accept an agent_action_id target (ActionGrade.for_action + by_grader(MCR)) so a banked test-run grade reaches Column 3, parity with activities. OUT OF SCOPE (A3+): cross-release aggregation / pass-rate trends (THAT is when a TestRun PROJECTION table via AgentAction after_create earns its keep, as analytics not grading target) — document as follow-up, do not build. Forward-only (pre-tag actions not in the lane; no backfill). Tests follow existing pipeline/heartbeat test patterns + test/lib/release_cli_test.rb for the emit side.

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
    L Lugia
    Lugia
    Model
    Duration
    Tokens
    Cost
    Completed Jul 06, 06:18 · 2 days ago
    api
  2. Designed Building
    L Lugia
    Lugia
    Model
    claude-opus-4-8
    Duration
    1 minute
    Tokens
    1,573,048
    Cost
    ~$0.95
    Started Jul 06, 06:18
    Completed Jul 06, 06:20 · 2 days ago
    cli
  3. Building Submitted
    L Lugia
    Lugia
    Model
    Duration
    43 minutes
    Tokens
    Cost
    Started Jul 06, 06:20
    Completed Jul 06, 07:02 · 2 days ago
    cli
  4. Submitted Reviewed Review Activity
    S Shannon
    Shannon primary
    C Carl
    Carl light
    Model
    claude-opus-4-8
    Duration
    8 minutes
    Tokens
    22,645,957
    Cost
    ~$27.01
    Started Jul 06, 07:02
    Completed Jul 06, 07:10 · 2 days ago
    cli
  5. Reviewed Assembled
    S Steffon
    Steffon
    Model
    claude-opus-4-8
    Duration
    7 minutes
    Tokens
    5,242,523
    Cost
    ~$3.19
    Started Jul 06, 07:10
    Completed Jul 06, 07:18 · 2 days ago
  6. Assembled Shipped
    A Avi
    Avi
    Model
    claude-opus-4-8
    Duration
    10 minutes
    Tokens
    3,509,900
    Cost
    ~$1.87
    Started Jul 06, 07:18
    Completed Jul 06, 07:27 · 2 days ago
  7. Shipped Archived
    Model
    Duration
    about 8 hours
    Tokens
    Cost
    Started Jul 06, 07:27
    Completed Jul 06, 15:43 · 2 days ago

Conversation

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

Handoff avi 2 days ago

Avi review approved: Option B verified — verdict emits tagged kind=test_scope/event_slug/result_slug/duration_ms (blank-dropped so START stays plain), all 4 fields are existing agent_actions columns (NO migration), band query scoped+limited with meta derived at render (no N+1), confirm rides ActionGrade for_action XOR (no new FK). CI green (4 checks). Ready for qa-release.

Sealed-bid sizing

Edit →

Alex (PM)

Avi (PO)

MEDIUM

Dev

MEDIUM

Actual

XL