Skip to content

v4.3.0

Choose a tag to compare

@github-actions github-actions released this 25 Jul 04:34

What's Changed

Observability Data Layer

  • Live run monitoring: New amicus watch <id> command renders any fan-out wave, council run, or session from any terminal — displays as an in-place table on TTY, milestone lines with --plain, or NDJSON with --json. Polling-based architecture (no push/IPC) reads from three new file surfaces that every consumer shares.
  • Event streaming: --follow flag on fanout and council run streams milestone events to stderr as they happen, while keeping stdout byte-identical. On council runs, tracks the run's own lifecycle and stage boundaries without exposing internal per-leg events.
  • Completion hooks: New --on-complete flag runs a shell command or triggers an MCP notification when a wave or council run reaches a terminal state. Payload carries only identifiers and paths (never model-generated text), runs exit-isolated from the underlying task, and includes 8 environment variables for scripting.
  • Schemas and validation: Published event.schema.json, progress.schema.json, and new live variants (wave-live, run-live, council-run-live) document the data layer contract; all changes are additive within existing v2 envelope versions.

Failed-Leg Resilience

  • Retry-failed waves: fanout --retry-failed <waveId> relaunches only a wave's terminal, non-complete legs as a new linked wave, preserving each leg's saved context. Original wave is never touched; retry is byte-identical to the original attempt.
  • Cheaper-model fallback chains: New --fallback / --no-fallback flags enable optional per-leg substitution to a cheaper model from the same vendor tier, triggered only by classified rate-limit or overload failures (never timeout or auth). Fallback events, attempt tracking, and final substitution details are recorded loudly in the output.
  • Error classification: New classifyLegError() utility distinguishes retryable capacity signals from permanent failures, enabling smarter recovery strategies across providers and gateways.

Spend Visibility and Attribution

  • Complete ledger attribution: continue, resume, and council rows now recorded in the spend ledger with full context (op, status, waveId, councilRunId, councilName, project, gateway, fallback/retry linkage). Pre-v4.3 rows lacking status are never counted as failures.
  • Rich spend query surface: amicus spend now supports --wave, --council, --project, --model, --op, --failed filters and --group-by bucketing (model, wave, council, project, op, day). New --rows flag shows individual ledger rows; wasted rollup counts failed attempts and incomplete runs.
  • MCP spend tool: New 16th MCP tool amicus_spend mirrors the CLI query surface for headless/automation consumers, read-only with no side effects.

Council Run Improvements

  • Stage-level spend attribution: Council legs and chair solos are now attributed with their parent councilRunId, stage op, and council name, enabling cost-per-stage analysis and per-reviewer seat accounting.
  • Wave linkage for retries: Council fan-out stages can now retry failed legs via the new wave linkage, inheriting the same fallback and partial-spend tracking as fanout waves.

Infrastructure and Testing

  • Schema coverage: Added comprehensive test suites for observability schemas, spend ledger fields, error classification, and fallback chain derivation. Event emission and tail reading verified end-to-end in council and fanout contexts.
  • File size discipline: New pure-logic modules (src/observe/, src/sidecar/fallback-chains.js, src/sidecar/fanout-retry.js) extracted to keep fanout.js, run.js, and core sidecar files under 300-line gates.
  • No new dependencies: All observability, retry, and spend query logic implemented with existing Node.js and devDependencies (no new runtime deps; ajv reused from v4.0).

Full Changelog: v4.2.1...v4.3.0