CedarCopilot wants to merge 13 commits into staging from feat/drafter-system-agent
Live on prod, no production signal yet
Strict CloudWatch fallback found 6 prod failure log lines for [UpdateExternalCrmWorkflow] Driver update failed (No valid values in \) in the last 24h while checking /drafter.md, reviewconversationfanout, reviewconversationtool, runsubagenttool, oneventexecutiondraftemailtool.
Strict CloudWatch fallback found 6 prod failure log lines for [UpdateExternalCrmWorkflow] Driver update failed (No valid values in \) in the last 24h while checking reviewconversationfanout, reviewconversationtool, runsubagenttool, oneventexecutiondraftemailtool.
Verification reached its 130s outer budget before the verifier returned. Libra is keeping this intent verifying until the next check.
Strict CloudWatch fallback found 3 recent prod failure log lines for [UpdateExternalCrmWorkflow] Driver update failed (No valid values in \), but the same failure had 42 log lines in the comparable pre-deploy baseline. Libra is not blaming this PR intent without a post-deploy.
Libra has verdicts on 0 of 18 tracked behaviors on prod; 18 are still being checked. Libra has 2 low-confidence degraded verdicts it is still confirming. Libra checks hourly for 3 days after each deploy.
Introduces drafter, one editable system subagent that owns how Cedar writes a draft, replacing deal-drafter. Everything here is either inert or behind cedar-drafter-subagent (default off), except two deliberate fleet-wide changes called out below.
Design and the measurements behind every decision: docs/design/drafter-system-agent.md.
Drafting was split across four harnesses and two tools, and only two of the four reliably produced a task:
| path | drafts via | creates a task |
|---|---|---|
| event , meeting | draft-email | yes |
| event , email | draft-email or save-draft | only via draft-email |
| scheduled task (largest, 2,494 dispatches/14d) | draft-email | yes |
| review (daily agenda) | save-draft | no |
~450 background drafts a fortnight land in Gmail with no agenda card. 387 of 391 inbound response drafts, and all 66 the review path produced. One cause: the document reached save-draft because that was the only draft tool its harness had. draft-email is registered in exactly one place, as a base tool of the executor agent.
Meanwhile deal-drafter is effectively not deployed , of 56 users whose morning sweep runs, 5 have the document and 1 has a live <ref>.
drafter replaces deal-drafter. Its body is derived line by line from the union of the executor prompt and DEAL_DRAFTER_DEFAULT_BODY, so the seed is behaviour-neutral by construction. Invariants that must not be user-editable (tool contract, taskType, threadId, TISER) are deliberately absent, and a test asserts it.run-subagent('drafter') name interception.draft-email / draft-slack, and made precedence-aware.curated-agenda-migration retired along with its tRPC route and CLI entry.renderTriggerBlockBody walked [all prose, then all refs]; it now walks authored order. This is a parity fix , the legacy renderer already did this , and affects 6 blocks fleet-wide (5 meeting, 1 cron), ordering only, never content.@subagents/ line as additionalContext. That argument has existed and been documented all along and was passed on 0 of 27,595 run-subagent calls in 14 days, because nothing rendered prose adjacent to a ref until this PR.The sibling guard also ships flag-independently. It is conservative, but see the review note below.
Stage 5, once every account is migrated: removing run-post-event-executor from the tool map, renaming it, naming @subagents/drafter in the pipeline order, trimming the executor prompt.
The review-path route was cut during review. It hand-built a RequestContext missing the linked-deal <output_policy> and the conversation context, and re-derived a worse playbook context than the one already in hand. Dormant, and it belongs in Phase C with a proper hand-off.
Merging this changes nothing for existing accounts beyond the two items above. The rollout is per-account and manual:
updateTaskActionData label fix ships in this PR. Do NOT run cleanup-label-rules.ts , see below.backfill-drafter.ts document --all --apply. Document only, no ref, dispatched by nothing.backfill-drafter.ts ref --email X --apply and flip cedar-drafter-subagent for that user. ref --all --apply throws by design , a script cannot flip PoLibra has not measured any production surfaces for this change yet.