Expand description
Trigger family implementations: AgentDispatch, Notification, YubabaAction.
Each family implements TriggerHandler (from dispatch.rs). Wire them
together via CompoundTriggerHandler for production use; test each
individually with the provided stub implementations.
Prompt-template injection safety: event payloads are wrapped in explicit delimiters before insertion into the rendered prompt so that hostile log lines cannot masquerade as instructions to the agent.
Architecture: .yah/docs/architecture/A052-yah-tower.md
@yah:ticket(R380-T5, “Migrate tower triggers + rule validate to the new tower-rules TaskPlacement”)
@yah:assignee(agent:claude)
@yah:at(2026-06-01T21:06:17Z)
@yah:status(review)
@yah:parent(R380)
@yah:next(“ForgeSpec in tower/src/triggers.rs becomes AgentDispatchSpec carrying the new TaskPlacement.”)
@yah:next(“Trigger::AgentDispatch.forge_where field renames to placement.”)
@yah:next(“Update validate.rs round-trip tests + tower-rules tests/round_trip.rs to use TaskPlacement.”)
@yah:next(“Update tower/tests/{dispatch,simulate,triggers}.rs ForgeWhere references.”)
@yah:handoff(“Migrated Trigger::AgentDispatch.forge_where: ForgeWhere → placement: TaskPlacement and renamed tower::triggers::ForgeSpec → AgentDispatchSpec. Updated all callsites in tower (triggers.rs, simulate.rs, rules/validate.rs, rules/parse.rs YAML), tower-rules (round_trip tests + library/yubaba-restart-on-error.yaml), tower tests (dispatch/simulate/triggers), and the cli display in app/yah/cli/src/tower.rs. Added a Fromdocker run (or configured container runtime). Today task::local always builds a subprocess regardless of runtime; this needs a fork in spawn() that routes to a docker-run shim when runtime=Container. See W148 for the yah_qed::build-image consumer that motivates this path.”)
@yah:next(“R380-T7 (independent of T6): decide remote+native policy at the YubabaClient seam — refuse with a clear error in v1 OR implement yubaba-agent-exec without containerd. The relay’s open question.”)
@yah:next(“Eventually (T8) drop ForgeWhere from tower-rules + task crate entirely, delete the From impls, drop ForgeWhere.ts. After T6 + T7 settle, the on-wire form is TaskPlacement everywhere.”)
@yah:verify(“cargo test -p tower -p tower-rules”)
@yah:verify(“cargo build -p yah –bin yah”)
@yah:verify(“cd packages/yah/ui && bun run typecheck”)
Structs§
- Agent
Dispatch Handler - Renders an
AgentDispatchSpecfrom anAgentDispatchtrigger and hands it toforge.run. - Agent
Dispatch Spec - Minimal description of an agent run to be handed to forge.run.
- Compound
Trigger Handler - Routes dispatch calls to the correct family handler by trigger kind.
- Notification
Handler - Fans a
Notificationtrigger out to all configured channels. - Notification
Payload - Payload delivered to each notification channel when a rule fires.
- Yubaba
Action Handler - Translates a
YubabaActiontrigger into a yubaba RPC call.
Enums§
- Forge
RunError - Error returned when the forge client rejects or fails a run.
- Notify
Error - Error returned when a notification channel fails.
- Yubaba
Command - Command issued to the yubaba RPC surface.
- Yubaba
RpcError - Error returned when a yubaba RPC call fails.
Traits§
- Forge
Client - Submits an
AgentDispatchSpecto the forge runtime (R094-F3). - Notification
Sink - Delivers a notification to a single channel.
- Yubaba
Client - Issues bounded cluster commands to the yubaba RPC (R091).
Functions§
- render_
prompt - Render a
PromptTemplatewith the event payload fromctx.