docs(decision): DD-071 — schema-aware LSP completion for REQ-246 authoring friction (#546)#659
Merged
Merged
Conversation
…are LSP completion (REQ-246, #546) Records the design decision for REQ-246: deliver human-authoring help on the shared rivet LSP (schema-aware completion + snippets) rather than standing up a new write surface (serve edit form or VSIX webview form). YAML stays canonical, no new write path, and every LSP editor benefits — matching the issue's own "all in common" framing. Grounded in the existing surfaces: writes already funnel through rivet-core/src/mutate.rs (shared by CLI + MCP); the LSP already registers completion capability and the VSIX already runs it as a LanguageClient; the schema already exposes per-type fields (required flags), link types, and target constraints. The gap is only that lsp_completions ignores the schema. Advances REQ-246 draft -> approved. Refs: REQ-246, FEAT-001
📐 Rivet artifact delta
Graphgraph LR
REQ_246["REQ-246"]:::modified
DD_071["DD-071"]:::added
classDef added fill:#d4edda,stroke:#28a745,color:#155724
classDef removed fill:#f8d7da,stroke:#dc3545,color:#721c24
classDef modified fill:#fff3cd,stroke:#ffc107,color:#856404
classDef overflow fill:#e2e3e5,stroke:#6c757d,color:#495057,stroke-dasharray: 3 3
Added
Modified
Posted by |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Design decision for REQ-246 (#546)
A user finds raw-YAML artifact editing cumbersome — "we should have all in common but we miss the UI for helping humans to work with."
DD-071 decides: deliver the authoring help on the surface that already is "all in common" — the rivet LSP — by making its completion schema-aware, rather than standing up a new editing surface (a
rivet servewrite form or a VSIX webview form).Why the LSP (grounded in source)
rivet-core/src/mutate.rs(allowlist serializerrender_artifact_yaml) — shared by the CLI and the MCP tools. The gap is not a missing writer; it's that nothing helps a human fill in a correct artifact while editing.completion_provider(main.rs:17205) and the VSIX already runs it as a LanguageClient (extension.ts:176) — butlsp_completions(main.rs:18205) only offers artifact-IDs aftertarget:/[[and already-seen types aftertype:; it ignores the schema.requiredflags, link-types with allowed target types (from_type_can_link), and enum values (schema.rs:1320/1334/258/272).Consequence (the REQ-246 implementation this unblocks)
Enrich
lsp_completionsto offer, from the schema: field names (with required markers), enum field values, link types + valid target types, and a per-artifact-type skeleton snippet — validated against the same rulesvalidate_add/validate_modifyenforce, so suggestions match what the writer accepts. YAML stays canonical; no new write surface; every LSP editor benefits (not just VS Code).Alternatives rejected
serve(today strictly read-only for artifacts) plus CSRF/origin surface.Advances REQ-246
draft → approved.rivet validatePASS.Refs: REQ-246, FEAT-001
🤖 Generated with Claude Code