CedarCopilot wants to merge 2 commits into staging from feat/subagent-write-verification
Live on prod, no production signal yet
Verification reached its 130s outer budget before the verifier returned. Libra is keeping this intent verifying until the next check.
Production telemetry since 2026-09-04T01:55:42Z contains no writeResourceGuarded, writeDocumentGuarded, or SUBAGENT_VERIFY_FAILED log events. OTEL shows 3 successful execute_tool write-document calls, but all were ordinary conversation/overview paths, not non-subagent resource.
Since deploy 2026-09-04T01:55:42Z, telemetry contains no admin.subagent.author route/span, authorSubagentDoc operation, or tied guarded-write verification signal. There are 0 matching admin/author route spans and 0 matching subagent-path writes. Only 1 successful execute_tool.
No production telemetry matching admin.subagent.author, authorSubagentDoc, or the exact validation message was found since 2026-09-04T01:55:42Z. Exact and broadened OTEL searches returned 0 matching spans, and CloudWatch returned 0 exact admin.subagent.author executions, 0.
Verification reached its 120s wall-clock budget before a tied verdict. Libra is keeping this intent verifying until the next check.
Verification reached its 130s outer budget before the verifier returned. Libra is keeping this intent verifying until the next check.
Libra has verdicts on 0 of 18 tracked behaviors on prod; 18 are still being checked. Libra checks hourly for 3 days after each deploy.
Phase 1 and Phase 4 of docs/design/unified-subagent-authoring-surface.md. Phase 2 (run a subagent on demand) is not here.
writeDocumentGuarded is the single write path for every document, from the CLI, the in-app chat agent and the external MCP. It routes by path, and the two branches did very different amounts of work:
PLAYBOOK.md | subagents | |
|---|---|---|
| read the saved doc back | yes | no |
| verify it | yes | no |
| revert on failure | yes | no |
A playbook write that produced an invalid file was reverted. A subagent write that produced an invalid file was kept. verifySubagentDoc has existed the whole time , the only thing that ever ran it was cedar-cli subagent author, which is cedarAdminProcedure. A customer writing a subagent through chat or MCP got none of it, and a document no <ref> resolves reads to them as "Cedar stopped doing the thing".
1. Verify and revert on the resource path (services/playbook/guarded-write.ts). Every subagent write is now read back from Postgres, run through verifySubagentDoc, and on failure the pre-write state is restored before a SUBAGENT_VERIFY_FAILED is thrown. Mirrors writePlaybookXml, including always syncing Yjs on the revert regardless of skipYjsSync , nobody gets a success callback for an autonomous corrective write. A write that MINTED the row soft-deletes it instead of restoring it to empty, since an empty subagent row still lists as an agent with no instructions; an existing-but-empty row is restored, because a <ref id> may already point at it. Scoped to isSubagentDocPath , verifySubagentDoc asks subagent-specific questions an email-style.md cannot answer.
2. Compose the frontmatter, on upsert only (services/playbook/subagent-frontmatter.ts, new). A first write re-emits the block through composeFrontmatter , or subagentFrontmatter(slug) for a registry agent , carrying agent_id across. This is what keeps grants in the INLINE form: written as a YAML block list, parseFrontmatter ends the list at the first non-- item line, a blank line qualifies, and the key parses as an empty grant with every entry silently dropped. Never on patch or append: a body edit must not produce a header diff, and it would fight the deliberate surgical frontmatter repair.
The re-emit refuses to run whenever it would drop a key the original declared. composeFrontmatter knows the keys the system writes, not the keys a document may carry , the fleet has permissions on 21 docs (deliberately left in place), deprecated on 6, enabled on 5, default_file on 1. It is a ratchet, not a list to maintain: a key added tomorrow and not taught to the composer disables normalization for those documents instead of erasing it from them.
3. RESOURCE_EXISTS_REQUIRES_PATCH now says how to do what it refuses. The message names the safe full-replacement pattern , patch with the ENTIRE current content as old_string, which can only succeed if the writer read the current state first. Guard behaviour is unchanged: first write upsert, every write after that patch or append.
4. subagent author updates description and when_to_use on an existing agent. Both were silently ignored on an edit; only the body was replaced. Since frontmatter is what the orchestrator renders on the ref line, an agent mis-triggering because of its when_to_use could not be repaired with the tool built to repair agents. Applied one field at a time, so grants and agent_id stay byte-identical.
authorSubagentDoc's private read-back / verify / revert is removed, not left with a comment. It is the same check the write path now runs for every surface, and its create-failure branch was the only place a subagent row was hard-deleted , which change 1 now does. What is left is what the name says: composing frontmatter around a body.
Read-only scan of every live subag
Libra has not measured any production surfaces for this change yet.