Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

[2026-09-07] merging staging to main

merged#2724CedarCopilot

CedarCopilot wants to merge 2 commits into main from staging

Not deployedTimeline and evidence
  1. Opened
    Sep 7, 2026, 4:41 PM
  2. Sep 7, 2026, 5:42 PM
  3. Merged
    Sep 7, 2026, 5:48 PM
  4. Live on staging, live on prod, observed
    Pending
  5. Not deployed

    Not deployed

    Pending

Libra has no production signal for this change yet because it has not deployed. Libra checks hourly for 3 days after each deploy.

Greptile Summary

This change improves synchronization of subagent descriptions, but removing a description can leave stale metadata in generic document listings. It also introduces a test assertion that conflicts with an explicit repository requirement and must be corrected before merging.

Confidence Score: 4/5

Do not merge until the repository-required TypeScript narrowing is applied. The stale listing metadata issue is a non-blocking data-consistency concern.

The final findings are limited to data consistency and an explicit repository requirement.

Files Needing Attention: apps/server/src/db/migrations/scripts/backfill-agent-description-column.ts; apps/server/src/db/migrations/scripts/tests/backfill-agent-description-column.test.ts

T-Rex T-Rex Logs

What T-Rex did

  • Generated a finding-comment-proof for a posted P2 finding and attached reproduction artifacts showing the source, command, and output.
  • Produced a second finding-comment-proof for another posted P2 finding.
  • Validated contract behavior with a focused Vitest reproduction that tests description removal and asserts the stored description remains stale and planDescriptionSync cannot clear.

View all artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix All With AI
### Issue 1
apps/server/src/db/migrations/scripts/backfill-agent-description-column.ts:129-137
**Clear removed descriptions**

When a custom subagent is saved after its frontmatter `description` is removed, the document write retains the previous generic description value. This branch then reports `cannot-clear` and skips the update, so generic document listings can continue showing metadata that the author removed. Define an explicit clearing policy for a missing frontmatter description, either when saving the subagent or in this migration. This is non-blocking, but it leaves misleading listing metadata behind.

### Issue 2
apps/server/src/db/migrations/scripts/__tests__/backfill-agent-description-column.test.ts:39
**Narrow the result first**

This assertion uses `as { truncated: string }` instead of narrowing the `DescriptionSyncPlan` union through `result.action`. This violates the repository directive against TypeScript assertions used to silence the type system. The repository requirement must be satisfied before merging.

```suggestion
    expect(result.action).toBe('sync');
    if (result.action === 'sync') expect(result.truncated).toHaveLength(200);
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "Merge pull request #2721 from CedarCopil..." | Re-trigger Greptile

Greptile also left 2 inline comments on this PR.

Context used:

  • Context used - CLAUDE.md (source)
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/.claude/skills/cedar-configuration/fields-and-values.mdno production surface mapped
  • apps/server/docs/design/field-propagation-primitive.mdno production surface mapped
  • apps/server/src/db/migrations/scripts/__tests__/backfill-agent-description-column.test.tsno production surface mapped
  • apps/server/src/db/migrations/scripts/backfill-agent-description-column.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/__tests__/mutating-actions-are-administrable.test.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/scope-map.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/server.tsno production surface mapped
  • apps/server/src/mastra/skills/account-config/tools/__tests__/applyConfigChangeTool.reconciliation.test.tsno production surface mapped
  • apps/server/src/mastra/skills/account-config/tools/applyConfigChangeTool.tsno production surface mapped
  • apps/server/src/mastra/tools/config/__tests__/config-propagate-tool.test.tsno production surface mapped
  • apps/server/src/mastra/tools/config/__tests__/configTool.test.tsno production surface mapped
  • apps/server/src/mastra/tools/config/config-propagate-tool.tsno production surface mapped
  • apps/server/src/mastra/tools/config/config-read-tool.tsno production surface mapped
  • apps/server/src/mastra/tools/config/config-tool-shared.tsno production surface mapped
  • apps/server/src/mastra/tools/config/config-write-tool.tsno production surface mapped
  • apps/server/src/mastra/tools/config/connection-write-tool.tsno production surface mapped
  • apps/server/src/mastra/tools/subagent-tool-allowlists.tsno production surface mapped
  • apps/server/src/mastra/utils/approval-policy.tsno production surface mapped
  • apps/server/src/mastra/utils/strategist-updates.tsno production surface mapped
  • apps/server/src/services/agent-workspace/__tests__/agent-create.test.tsno production surface mapped
  • apps/server/src/services/aop/__tests__/field-diff.test.tsno production surface mapped
  • apps/server/src/services/aop/__tests__/link-mapping.test.tsno production surface mapped
  • apps/server/src/services/aop/__tests__/list-fields.test.tsno production surface mapped
  • apps/server/src/services/aop/__tests__/propagate-field.test.tsno production surface mapped
  • apps/server/src/services/aop/__tests__/propagate-mapping.test.tsno production surface mapped
  • apps/server/src/services/aop/field-diff.tsno production surface mapped
  • apps/server/src/services/aop/link-mapping.tsno production surface mapped
  • apps/server/src/services/aop/list-fields.tsno production surface mapped
  • apps/server/src/services/aop/propagate-field.tsno production surface mapped
  • apps/server/src/services/aop/propagate-mapping.tsno production surface mapped
  • apps/server/src/services/integrations/__tests__/connection-config.test.tsno production surface mapped
  • apps/server/src/services/integrations/connection-config.tsno production surface mapped
  • apps/server/src/services/integrations/crm/__tests__/field-mapping-diff.test.tsno production surface mapped
  • apps/server/src/services/integrations/crm/__tests__/field-mapping-writer.test.tsno production surface mapped
  • apps/server/src/services/integrations/crm/external-crm-field-mapping.tsno production surface mapped
  • apps/server/src/services/integrations/crm/field-mapping-diff.tsno production surface mapped
  • apps/server/src/services/integrations/crm/field-mapping-writer.tsno production surface mapped
  • apps/server/src/services/playbook/__tests__/author-subagent.test.tsno production surface mapped
  • apps/server/src/services/playbook/__tests__/guarded-write.test.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/author-subagent.tsno production surface mapped
  • apps/server/src/services/playbook/backfill/strategist-document-removal-migration.tsno production surface mapped
  • apps/server/src/services/playbook/guarded-write.tsno production surface mapped
  • apps/server/src/services/playbook/seed-playbook.tsno production surface mapped
  • apps/server/src/services/shared/config-change.tsno production surface mapped
  • docs/changelogs/2026-W37.mdno production surface mapped