fix: validate templates against agent conversations #68

Merged
morten-olsen merged 1 commit from fix/c6a4b291-agent-template-context into main 2026-10-20 20:48:08 +02:00
Owner

Summary

A real Moxie → Head of IT conversation accepted text, then failed before launching its runtime because an ambient template used a human-conversation else branch to read task.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 task guard 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

  • New public-validator regression failed before the patch and passes afterward. Nine focused template/runtime tests pass. Workspace types, ESLint, dependency and format checks pass.
  • Full local run: 861 tests passed; two compiled-output tests initially could not start because Bun was absent from PATH after restart. Both passed with repository-pinned mise exec bun. CI will run the full set with its declared tools.
  • Independent Standards and Spec self-reviews: zero findings. Five files, 34 additions / 6 removals. No queue, runtime permission, migration, authentication or transport changes.
  • Original live failure reproduced with deployed renderer. After the approved organizational guard, every actual selected Moxie/Head of IT template renders; the preserved failed work was retried once under recorded operator recovery. Its real Codex pod completed and reply 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.

## Summary A real Moxie → Head of IT conversation accepted text, then failed before launching its runtime because an ambient template used a human-conversation `else` branch to read `task.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 task` guard 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 - New public-validator regression failed before the patch and passes afterward. Nine focused template/runtime tests pass. Workspace types, ESLint, dependency and format checks pass. - Full local run: 861 tests passed; two compiled-output tests initially could not start because Bun was absent from PATH after restart. Both passed with repository-pinned `mise exec bun`. CI will run the full set with its declared tools. - Independent Standards and Spec self-reviews: zero findings. Five files, 34 additions / 6 removals. No queue, runtime permission, migration, authentication or transport changes. - Original live failure reproduced with deployed renderer. After the approved organizational guard, every actual selected Moxie/Head of IT template renders; the preserved failed work was retried once under recorded operator recovery. Its real Codex pod completed and reply `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.
fix: validate templates against agent conversations
All checks were successful
ci/woodpecker/pr/deploy-tools Pipeline was successful
ci/woodpecker/push/deploy-tools Pipeline was successful
ci/woodpecker/pr/image-agent Pipeline was successful
ci/woodpecker/push/quality Pipeline was successful
ci/woodpecker/pr/quality Pipeline was successful
ci/woodpecker/pr/image Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
ci/woodpecker/pr/docs Pipeline was successful
57301bcba4
morten-olsen left a comment

Self-review of 57301bc against 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.

Self-review of 57301bc against 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.
Author
Owner

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.

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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ai/mission-control!68
No description provided.