Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

refactor(playbook): merge user/org PLAYBOOK.md dispatch in writeDocumentGuarded

merged#2472CedarCopilot

CedarCopilot wants to merge 0 commits into staging from refactor/write-document-guarded-playbook-dispatch

Live on prod, no production signal yetTimeline and evidence
  1. Opened
    Aug 13, 2026, 7:18 PM
  2. Merged
    Aug 13, 2026, 7:35 PM
  3. Live on prod
    Aug 13, 2026, 7:35 PM
  4. Observed 18 hours
    Aug 13, 2026, 7:35 PM
  5. Pipelines steady after this deploy
    Aug 13, 2026, 7:35 PM
  6. Unobserved

    Live on prod, no production signal yet

    Aug 14, 2026, 1:30 PM

Behaviors Libra is checking

Writing a user or organization PLAYBOOK.md consistently rejects append mode and dispatches upsert or patch requests to the appropriate XML playbook writer.Inconclusivelow confidence

OTEL fallback found no prod spans matching writeDocumentGuarded since deploy.

prod, checked Aug 14, 2026, 1:30 PM

Libra has verdicts on 0 of 1 tracked behaviors on prod; 1 is still being checked. Libra checks hourly for 3 days after each deploy.

Merges the user- and org-PLAYBOOK.md branches in writeDocumentGuarded: match both paths up front, reject append once, narrow mode to 'upsert' | 'patch', then dispatch to the respective XML writer. Removes the duplicated append guard and the non-null-assertion drift between the two branches. No behavior change , pure refactor.

šŸ¤– Generated with Claude Code

Greptile Summary

This refactor consolidates user and organization PLAYBOOK.md handling without changing dispatch behavior.

  • Matches both supported playbook path forms before entering one shared branch.
  • Rejects unsupported append operations once and narrows the remaining mode before dispatch.
  • Preserves user and organization XML-writer routing.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The user and organization path patterns are mutually exclusive, the organization match is guaranteed non-null at its use site, and append rejection remains equivalent for both routes.

Important Files Changed

FilenameOverview
apps/server/src/services/playbook/write-document-guarded.tsConsolidates duplicated playbook dispatch and append validation while preserving the existing routing and writer arguments.

Reviews (1): Last reviewed commit: "refactor(playbook): merge user/org PLAYB..." | Re-trigger Greptile

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/services/playbook/write-document-guarded.tsno production surface mapped