mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
Switch the agent-support-channel prototype from the speculative agent-job kinds (43001-43006, reserved with no upstream builder) to Buzz's real, source-confirmed workflow primitive: 30620 def / 46020 trigger / 46001-46007 lifecycle / 46010 approval gate / 46030-46031 grant-deny (pinned against buzz-relay's command_executor.rs). This bakes the human-approval gate into the protocol — anyone in the channel can drive a run, but a human grants before anything is pushed. - commons WorkflowRunAggregator folds trigger + lifecycle + grant/deny into per-run state (TRIGGERED/RUNNING/AWAITING_APPROVAL/APPROVED/COMPLETED/ FAILED/DENIED), correlating by run id (= trigger event id = approval token); 8-case test. - cli `amy buzz workflow` — trigger/list/show/approve/deny plus the `run` runner: per new trigger it does the agent work in a fresh worktree+branch, posts the 46010 gate, and on a later poll runs --on-approve (push + PR) and emits 46005 completed; a deny discards the worktree (run is DENIED). On a real Buzz relay the relay executes the workflow YAML; self-hosted on geode there is no engine, so amy is the runner and emits the lifecycle events itself (documented divergence). Two store realities, both verified against geode: decisions are fetched by author (quartz's store serves #d only for addressable kinds, and 46030/46031 are regular), and the runner is restart-safe (runs at the gate are rebuilt from the deterministic run id). Also hardens the exec helper against a broken pipe when --exec doesn't read stdin, and fixes worktree teardown to run git against the owning repo. End-to-end headless harness (cli/tests/buzz/workflow-loop.sh) covers the grant and deny paths through an embedded geode relay: 14/14 green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011mApqAbr8vkLC7gUDjavu6