Enable create_discourse_relation by default - #8
Open
mattakamatsu wants to merge 1 commit into
Open
Conversation
The tool shipped disabled (ADR-018 point 2) on the grounds that a direct write with no approval step warranted an explicit opt-in. In practice the gate pushed work onto a more dangerous path: an agent auditing dg-team's relation schema had to clean up duplicate relation definitions through raw block deletes on the generic Roam MCP, which has none of the validation this tool performs — no type-pair check, no ambiguity refusal, no idempotency, no dry_run. Flip the default to on (opt out with DG_MCP_RELATION_WRITE=0), matching the canvas tools' posture from #7. The safety properties in ADR-018 points 3-7 are unconditional and unchanged, and the analysis surface stays read-only. ADR-018 gets a dated amendment rather than a silent contradiction, and it records what is still missing: no tool deletes a stored relation, and none repoints a record's hasSchema, so cleanup still falls back to raw block edits. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
create_discourse_relationhas been built, merged (#4) and shipped indist/since July — but gated behindDG_MCP_RELATION_WRITE, which nobody had set. ADR-018 point 2 chose that default because the tool writes directly with no user-visible approval step.The gate turned out to have the opposite effect from the one intended. Auditing dg-team's relation schema this week surfaced two duplicate relation definitions (
Issue addresses Hypothesis,Project addresses Journey) and 124 orphaned stored records. Cleaning that up meant rawdelete_blockcalls through the generic Roam MCP — a path with none of the validation ADR-018 specifies: no type-pair check, no refusal on ambiguous labels, no idempotency, nodry_run. A safety gate that pushes work onto an unsafer path isn't a safety gate.What changes
ENABLE_RELATION_WRITEbecomes!envOff(...), matching the canvas tools' posture from Canvas tools on by default #7. Opt out withDG_MCP_RELATION_WRITE=0/false/off/no.src/relations/README.mdupdated.What does not change
The analysis surface stays read-only, and ADR-018 points 3–7 are unconditional: one block per call, always under
roam/js/discourse-graph/relations, refuse rather than guess, idempotent, one direction only,dry_runavailable. Blast radius of a misfire is one block on a config page, undone by deleting one block.Known gap, recorded in the amendment
There is still no tool to delete a stored relation (
deleteStoredRelationinrelations/write.tsis an internal rollback helper) and none to repoint a record'shasSchema. Those two are the prerequisite for recovering dg-team's 124 orphaned records — 87Flow → Functionand 31Result → Hypothesisedges that exist in the data but are invisible to the plugin. Filed separately.npm run buildclean,npm test28/28.🤖 Generated with Claude Code