Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

fix(strategist): stop writing an overview document, project reasoning into fields only

merged#2716CedarCopilot

CedarCopilot wants to merge 3 commits into staging from fix/strategist-remove-document-writing

Live on prod, no production signal yetTimeline and evidence
  1. Opened
    Sep 7, 2026, 9:27 AM
  2. Sep 7, 2026, 10:01 AM
  3. Merged
    Sep 7, 2026, 10:21 AM
  4. Live on prod
    Sep 7, 2026, 10:21 AM
  5. Observed 3 days
    Sep 7, 2026, 10:21 AM
  6. Pipelines steady after this deploy
    Sep 7, 2026, 10:21 AM
  7. Unobserved

    Live on prod, no production signal yet

    Sep 10, 2026, 10:21 AM

Behaviors Libra is checking

Legacy strategist prompts that lack the relevance gate are upgraded during the backfill so clearly routine or non-actionable events stop without fetching additional deal context or calling tools.Degradedlow confidence

Only 17 prod OTEL spans matching strategist agent run reached Libra since the deploy, below the 20-span floor for calling a change verified. Nothing is failing; there is not yet enough traffic to confirm it.

prod, checked Sep 10, 2026, 10:20 AM
Operators can dry-run or execute the strategist document migration for explicit users or the full active-user cohort with bounded concurrency and a per-item summary.Inconclusivelow confidence

Unable to verify the migration from the initial log search: no CloudWatch records matched `strategistDocumentRemovalMigration` in the 71-hour post-deploy window. Further telemetry correlation is required before assigning a verdict.

prod, checked Sep 10, 2026, 9:21 AM
Existing unmodified strategist.md files can be backfilled from the old document-writing workflow to the canonical document-free workflow while preserving content outside the Each run block.Inconclusivehigh confidence

No production executions of runStrategistDocumentRemovalMigration were observable since 2026-09-07T17:21:14Z: CloudWatch returned 0 occurrences of the required [strategistDocumentRemovalMigration] applied log and 0 migration-specific runner/error logs. OTEL returned only.

prod, checked Sep 10, 2026, 10:21 AM
Accounts with customized strategist instructions can still maintain an assessment document because document tools, prior-document context hydration, and a conditional output path remain available.Not checked
prod
By default, strategist reasons through the deal deeply but persists only concise one-to-two-line conclusions and signals in its owned strategic-overview fields instead of writing an assessment document.Not checked
prod
When strategist replaces a weaker recommendation, it records which recommendation was dropped and why in the new task's notes rather than requiring an assessment-document update.Not checked
prod

Libra has verdicts on 0 of 7 tracked behaviors on prod; 7 are still being checked. Libra has 1 low-confidence degraded verdict it is still confirming. Libra checks hourly for 3 days after each deploy.

Summary

The strategist system subagent used to maintain a long-form per-deal assessment document (via write-document/move-file) alongside the short "strategic overview" fields it owns (on_track, the_play, how_we_win, risks, and the eight meddpicc_* fields). This PR changes the default behavior to stop writing that document , the strategist still reasons at the same depth every run (the prompt's new "Reason deep, distill concise" step, was "Write deep" / "Distill concise" as two steps, explicitly keeps the full think-through of the play, risks, MEDDPICC read, and competitive picture), it just no longer persists that reasoning as its own document by default. Only the 1-2 line field projections get written.

Tools stay available for customization. write-document and move-file remain on STRATEGIST_TOOLS (apps/server/src/mastra/tools/subagent-tool-allowlists.ts) , a user (or the playbook-authoring skill) can still customize their own strategist.md to reinstate a maintained document, and the tool has to actually be available for that to work. The supporting plumbing in apps/server/src/mastra/utils/strategist-updates.ts (the bounded prior-assessment-document hydration, and the <agent_output_path> hint) stays wired up too, both reworded to be conditional ("if your instructions have you maintain one") rather than assuming every account writes a document by default.

  • Prompt: apps/server/src/services/playbook/agent-defaults/strategist.ts collapses the old two-step "Write deep to your agent overview document" / "Distill concise into fields" into one step, "Reason deep, distill concise" (exported separately as STRATEGIST_EACH_RUN_STEPS so the backfill migration can import the exact same prose rather than risk a hand-copied drift).
  • Tool allowlist / dispatch: unchanged from before this PR , write-document/move-file were never removed from the runtime capability, only from the default prompt's instructions.

Backfill migration

services/playbook/backfill/strategist-document-removal-migration.ts patches already-seeded strategist.md documents that still carry the OLD default instruction text ("update your in-depth strategic assessment at your agent overview document") , seedPlaybookFiles is idempotent and skips existing files, so the new default prompt only reaches brand-new accounts without this backfill.

It locates the "Each run" block by two heading anchors, verifies the existing text matches one of two known old shapes (with or without the earlier relevance-gate step, since that migration only reached about half the fleet), using a whitespace- and ordered-list-number-normalized comparison to survive the Y.js/ProseMirror editor round-trip , then splices in the new canonical block at the same offsets. A body that doesn't normalize-match either old shape is reported as customized and left alone for manual review rather than guessed at. The "already migrated" marker check is scoped to the Each run block itself (not the whole document body), so a customization appended elsewhere can't mask a still-stale block. Every write goes through authorSubagentDoc (frontmatter preserved, verify + revert on failure). Covered by 18 unit tests exercising both old shapes, the whitespace-reflow and list-renumbering artifacts actually seen in production, marker-scope correctness, and idempotency.

This migration HAS been run against production, across the full fleet (113 accounts, including several shapes the automated cohort resolver doesn't reach , hand-authored prompts predating the heading convention, and AOPs without a sibling PLAYBOOK.md) via a mix of the migration itself and small, individually-verified one-off patches for shapes it correctly declined to touch automatically. Verified via direct DB sweep: 0 accounts remaining with the old document-writing instruction language, 113/113 carrying the new default prompt.

Review

Ran this repo's thermo-review skill agains

Show production surfaces and changed-file mapping

Production surfaces

Libra has not measured any production surfaces for this change yet.

Changed files → surfaces

  • apps/server/src/mastra/tools/subagent-tool-allowlists.tsno production surface mapped
  • apps/server/src/mastra/utils/strategist-updates.tsno production surface mapped
  • apps/server/src/services/playbook/__tests__/strategist-document-removal-migration.test.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/index.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/strategist.tsno production surface mapped
  • apps/server/src/services/playbook/backfill/strategist-document-removal-migration.tsno production surface mapped