CedarCopilot wants to merge 2 commits into main from staging
Live on prod, no production signal yet
unknown
unknown
unknown
unknown
unknown
unknown
unknown
single_user
customer_facing
Libra has verdicts on 0 of 8 tracked behaviors on prod; 8 are still being checked. Libra attributed 9 failures to this change at medium confidence and is still confirming them. Libra checks hourly for 3 days after each deploy.
This change adds persisted draft-session fingerprints to decide whether Cedar should update an existing provider draft or create a separate one. Executed drafting checks reproduced two cases where a user’s content is lost: editing the draft with the same normalized word count, and clearing the draft body. In both cases, the rewrite path retains the existing provider draft ID and replaces the user’s content.
Not safe to merge until the draft comparison preserves same-length edits and intentionally emptied drafts.
The executed integration reproduction exercised the provider rewrite path and directly observed both user-edit cases updating the existing draft in place.
Files Needing Attention: apps/server/src/services/drafting/draft-session-store.ts, especially the fallback comparison at lines 94 and 98.
What T-Rex did
General comment
Same-word-count edits are silently overwritten by implicit draft rewrite
matchesRecordedAgentBody returns true despite different SHA-256 hashes. createDraftInProvider consequently retains the draft as an implicit rewrite candidate and invokes createDraft with that existing draftId, replacing the rep's body.matchesRecordedAgentBody uses current.wordCount === record.agentWordCount as a positive match after a hash mismatch at apps/server/src/services/drafting/draft-session-store.ts:98. Word count is not an identity comparison and cannot distinguish semantic substitutions with the same number of tokens.<a href="https://www.greptile.
Libra has not measured any production surfaces for this change yet.