Repository navigation
docs(adr): add ADR-0029, structured statement edits for raw Workshop - #784
Merged
Merged
Conversation
ADR-0029 decides the write direction that ADR-0024 left open: clients submit rule-content-v1 statements, workshop-rs converts and emits them as checked source edits, and Wright exposes editStatements over serve and MCP, validated through the existing edit-transaction path.
Statement comments survive replace and go with delete, inserting into an absent section creates it, editStatements takes the same optional sources as validateEditTransaction, and emission uses the session's resolved locale. The ADR also states that a replaced statement is visibly respelled in canonical form.
An insert now takes a statements array, so an If, its body, and its End land at one address without tripping the same-address conflict rule. The ADR defines statement, statement address, and structured view, and leaves the view's form factor and its operation boundary to the decision that introduces it. Accepted after the owner confirmed raw-Workshop-only scope, comment preservation on replace, visible canonical respelling, and the caller-writes edit path.
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.
Summary
Proposes ADR-0029: structured statement edits for raw Workshop. It decides the write direction that ADR-0024 left open ("a typed authoring API").
rule-content-v1list item. No second authoring format.workshop-rsconverts the statement to its public model and returns the checkedSourceEdit(canonical text in the file's locale, indentation relative to the surrounding source). Wright composes no Workshop text.editStatementsoperation inwright-agent/v1(serve + MCP).conditions/actions+ index +insert/replace/delete.inserttakes astatementsarray.inputIdentity.validateEditTransactionpath. Nothing is written by the operation.replacekeeps a statement's leading comment anddeleteremoves it with the statement.sourcesworks for unsaved buffers, as invalidateEditTransaction.content(parse(emit(from_content(c)))) == c, checked byworkshop-rsover its corpora.Out of scope: rule-level edits, declarations, a CLI command, source-language authoring, and the form factor of an editing view.
Why now
A read-only structured editing prototype (rule tree plus in-game-style create condition/action forms built from
lookupsignatures) produces correctrule-content-v1nodes, but no operation turns a node into source text. Without this decision every client would carry its own copy of Workshop emission.Related catalog gaps found by the same prototype are tracked separately: #781, #782, #783, wrightkit/workshop-rs#495, wrightkit/workshop-rs#496, wrightkit/workshop-rs#497, wrightkit/workshop-rs#498.
Review
Accepted by the owner after review of the open points: raw-Workshop-only scope, comment preservation on replace, visible canonical respelling, and the caller-writes edit path. The review also changed
insertto take astatementsarray so anIf, its body, and itsEndshare one address. Documentation only; no code or behavior changes.