fix(agentworker): build the guardrail engine in the worker composition and set TaskContext.Guardrails #1394

Closed
opened 2026-10-27 13:40:13 +00:00 by sam · 0 comments
Owner

Mechanism: workflow.TaskContext.Guardrails was never assigned on any production run, so AgentStage.recordGuardrails returned immediately and the guardrail engine recorded nothing for any task. The engine was constructed once in archied's composition root and handed to Daemon.Guardrails, but no code read Daemon.Guardrails after workflow execution moved to the full-task worker handoff; archie-agent is a separate process, so a live engine cannot cross the handoff. Fix shape: build the engine at the agentworker composition root (the process that runs agent stages), thread it through the task dependencies, and set it on TaskContext.Guardrails; remove the unused archied-side construction. Evidence shape: a task run whose TaskContext carries the engine reaches AgentStage.handleResult and the engine reports a recorded outcome/decision for that run.

Close reason

Fixed in 67b0b8e0


Imported from beads archie-core-jd5v · GitHub #1455 · type bug · priority P2 · created 2026-10-02 · closed 2026-10-02

Mechanism: workflow.TaskContext.Guardrails was never assigned on any production run, so AgentStage.recordGuardrails returned immediately and the guardrail engine recorded nothing for any task. The engine was constructed once in archied's composition root and handed to Daemon.Guardrails, but no code read Daemon.Guardrails after workflow execution moved to the full-task worker handoff; archie-agent is a separate process, so a live engine cannot cross the handoff. Fix shape: build the engine at the agentworker composition root (the process that runs agent stages), thread it through the task dependencies, and set it on TaskContext.Guardrails; remove the unused archied-side construction. Evidence shape: a task run whose TaskContext carries the engine reaches AgentStage.handleResult and the engine reports a recorded outcome/decision for that run. ### Close reason Fixed in 67b0b8e0 --- _Imported from beads `archie-core-jd5v` · GitHub #1455 · type bug · priority P2 · created 2026-10-02 · closed 2026-10-02_
sam added the mediumbug labels 2026-10-27 13:40:13 +00:00
sam self-assigned this 2026-10-27 13:40:13 +00:00
sam closed this issue 2026-10-27 13:40:13 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1394