Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

docs(agent-skills): warn agents off writing user-editable docs to thread/

merged#2788CedarCopilot

CedarCopilot wants to merge 0 commits into staging from docs/thread-scoped-docs-not-user-editable

Live on prod, no production signal yetTimeline and evidence
  1. Opened
    Sep 15, 2026, 7:02 AM
  2. Merged
    Sep 15, 2026, 7:16 AM
  3. Live on prod
    Sep 15, 2026, 7:16 AM
  4. Observed 0 hours
    Sep 15, 2026, 7:16 AM
  5. Unobserved

    Live on prod, no production signal yet

    Sep 15, 2026, 7:16 AM
  6. Pipelines steady after this deploy
    Sep 15, 2026, 7:16 AM

Libra has no production signal for this change on prod yet. Libra checks hourly for 3 days after each deploy.

What was wrong

thread/-scoped documents can never have an edit saved through the document editor , scopeFromPath() in apps/server/src/trpc/routes/files.ts unconditionally refuses every write to a thread/ path via files.applyUpdate (the mutation behind the editor's Save button). Only an agent's own write-document call (a separate code path) can write there.

Nothing in the documents skill said so, and the Brain document viewer renders a thread/-scoped doc exactly like any editable one , full Save/Saving/Saved status badge, Share button, no read-only indicator. So a subagent that hands the user a link expecting them to review and edit before approving (a sequence to approve, a draft to tweak) can silently set up a save that will fail every single time.

This is exactly what happened to Jacob Doty (Aspire): a fallback path (unrelated bug, already fixed in #2781) saved his "Zeke the Sequencer" review doc under thread/.../keavy-omalley-keyes-outreach-sequence instead of user/notes/.... He opened it, edited it to sound more like him, approved , and none of his edits ever saved, with only a quiet "Save failed" badge as a clue.

What changed

Added a short callout to apps/server/.claude/skills/documents/SKILL.md, right after the path-reference table (where thread/{threadId}/canvas etc. are already listed) , this is the skill the write-document tool's own description tells every agent to load before writing anything, so it's the highest-leverage single spot. It tells agents plainly: thread/ is agent-only scratch space, and anything meant for the user to open and edit belongs at user/notes/{name} instead.

How to test

Docs-only change , no code path affected. Read the new callout in context: apps/server/.claude/skills/documents/SKILL.md, "Document Paths and Types" section.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UPnwxwkTP5oh7k6MhZn97b

Greptile Summary

This PR updates the documents skill to steer agents away from placing user-editable review artifacts in thread-scoped scratch space.

  • Explains that the standard file-system editor cannot persist changes to thread/ paths.
  • Recommends user/notes/{name} for artifacts the user is expected to review and edit.
  • The warning should distinguish standard document saves from the supported HTML WYSIWYG save route, which can persist authorized thread-scoped edits.

Confidence Score: 4/5

The documentation change is safe to merge, though its universal description of thread-document editability should be narrowed for accuracy.

The standard Y.js/file-system editor does reject thread-scoped saves, but the supported HTML WYSIWYG editor uses a separate authorized route that can persist them, making the new “never” and “only” claims too broad.

Files Needing Attention: apps/server/.claude/skills/documents/SKILL.md

Important Files Changed

FilenameOverview
apps/server/.claude/skills/documents/SKILL.mdAdds useful path-selection guidance, but overstates the write restriction by overlooking the authorized HTML editor route.
Prompt To Fix All With AI
### Issue 1
apps/server/.claude/skills/documents/SKILL.md:151-153
**Thread Editability Is Overstated**

The claim that users can never save edits to `thread/` documents is inaccurate for HTML documents. The in-place WYSIWYG editor saves through `documents.updateHtmlContent`, which authorizes the document path and persists approved `thread/` edits without calling `scopeFromPath`. Please limit this warning to file-system/Y.js editor saves so agents are not incorrectly told that only `write-document` can update every thread-scoped document.

---

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

Reviews (1): Last reviewed commit: ["docs(agent-skills

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/documents/SKILL.mdno production surface mapped