fix: validate templates against agent conversations #68
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/c6a4b291-agent-template-context"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
A real Moxie → Head of IT conversation accepted text, then failed before launching its runtime because an ambient template used a human-conversation
elsebranch to readtask.requester. Agent conversations have neither a task nor a human conversation. Save validation and the generated reference still assumed only those older two contexts.Validate templates against the existing both-null agent context and correct the reference/example and field descriptions. Unsafe fallbacks are now refused on save with the failing context named; an explicit
else if taskguard passes. Existing customized instructions remain untouched by this patch. Morten separately approved the precise live Home IT guard correction, applied/read-back verified in task baa90163.Evidence
mise exec bun. CI will run the full set with its declared tools.f2a1f132…is accepted once on each side. Parent task c6a4b291 retains exact evidence and approval.Merge danger
Door: two-way for this patch. Existing schema 037 and durable records remain; only save validation/reference change. Previously accepted incompatible templates will now be rejected if edited until their owner guards the task context.
Blast radius: app template edits. Do not revert the separately approved live organizational guard. A compatible 0.49.0 image can recover from a regression in this patch; pre-037 images remain incompatible.
Rollout
Wait for green PR/main CI, publish the patch release through the existing paired-image/deploy pipeline, verify mirror/Argo and actual images, then run the public validator on unsafe/guarded templates and recheck the real-role run/message identities. No new migration, credential or exposure change is proposed.
Self-review of
57301bcagainst base972bb75a, with separate read-only Standards and Spec reviewers. Standards: zero blocking/nonblocking findings; new sample and regression follow the existing template module contract and conventions, and customized live instructions are untouched. Spec: zero findings; agent runtime already supplies task=null and conversation=null, the new sample catches the real requester-fallback failure before save, and reference/example/schema descriptions now agree. Regression failed before fix and nine focused template/runtime tests passed after. Types/ESLint/dependency/format checks pass; local861 tests plus two pinned-Bun compiled-output cases pass. Real live recovery after Morten-approved organizational guard produced one Head of IT reply accepted by Moxie; details in parent. Verify green CI, deployed public validator and retained real-role message/run state after patch rollout. Rollback can use compatible0.49.0 while retaining approved live guard/schema037/records. Standards:0 findings, worst none. Spec:0 findings, worst none.Coordinating with corrective PR #68 as requested: Markdown PR #67 is green at
30f0372, and Morten explicitly approved merging and cutting its release for device testing. I am merging #67 and reserving v0.50.0 for its release. If #68 merges before the release tag, the release will use the current main head including the fix; I will recheck main/CI immediately before publication. Please avoid reusing v0.50.0. Neither branch will overwrite the other.