Skip to content

Commit 68de65c

Browse files
authored
Merge pull request #659 from pulseengine/feat/req-246-authoring-dd
docs(decision): DD-071 — schema-aware LSP completion for REQ-246 authoring friction (#546)
2 parents a23af22 + ceabda5 commit 68de65c

2 files changed

Lines changed: 68 additions & 2 deletions

File tree

artifacts/decisions.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,3 +1380,69 @@ artifacts:
13801380
created-by: ai-assisted
13811381
model: claude-opus-4-8
13821382
timestamp: 2026-06-25T09:00:00Z
1383+
1384+
- id: DD-071
1385+
type: design-decision
1386+
title: Reduce raw-YAML authoring friction via schema-aware LSP completion, not a new write surface
1387+
status: proposed
1388+
description: >
1389+
REQ-246 (#546): a user finds raw-YAML artifact editing cumbersome — "we
1390+
should have all in common but we miss the UI for helping humans to work
1391+
with." Decision: deliver the human-authoring help on the surface that IS
1392+
"all in common" — the rivet LSP — by making its completion schema-aware,
1393+
rather than standing up a new editing surface (a serve write form or a
1394+
VSIX webview form). YAML stays the artifact and the single source of
1395+
truth; no new write path is introduced; and the help reaches every
1396+
LSP-capable editor (VSIX, Neovim, Helix, …), not just VS Code.
1397+
tags: [lsp, authoring, ux, editing, vsix, schema, dogfooding]
1398+
links:
1399+
- type: satisfies
1400+
target: REQ-246
1401+
fields:
1402+
baseline: v0.24.0-track
1403+
source-ref: >
1404+
rivet-cli/src/main.rs:18192 (lsp_completions — the surface to enrich),
1405+
:17205 (completion_provider capability, trigger chars `[`/`:`),
1406+
rivet-core/src/schema.rs:1320 (Schema::artifact_type),
1407+
:1334 (from_type_can_link), :258 (FieldDef.required),
1408+
:272 (LinkFieldDef.target_types); vscode-rivet/src/extension.ts:176
1409+
(VSIX already runs the LSP as a LanguageClient).
1410+
rationale: >
1411+
Grounded in the existing surfaces (source-read, not README): artifact
1412+
WRITES already funnel through one core — rivet-core/src/mutate.rs
1413+
(render_artifact_yaml allowlist at :526, reserved-key guard at :308) —
1414+
shared by the CLI (cmd_add/cmd_modify) and the MCP tools
1415+
(rivet_add/rivet_modify in mcp.rs). The gap is not a missing writer; it
1416+
is that nothing helps a human FILL IN a correct artifact at the point of
1417+
editing. The LSP already registers completion + code-action capability
1418+
(main.rs:17205/:17209) and the VSIX already consumes it
1419+
(extension.ts:176), but lsp_completions (:18205-18224) only offers
1420+
artifact-IDs after `target:`/`[[` and already-seen types after `type:` —
1421+
it ignores the schema entirely. The schema already exposes everything a
1422+
human needs: per-type fields with required flags (FieldDef.required),
1423+
link-types with allowed target types (from_type_can_link,
1424+
LinkFieldDef.target_types), and enum field values. Enriching completion
1425+
(field names with required markers, enum values, link types + valid
1426+
targets, and a per-artifact-type skeleton snippet) reuses the schema
1427+
API that validate_add/validate_modify already consume — so what the
1428+
editor suggests is exactly what the writer will accept. This is
1429+
completing an existing surface on the shared core, matching the issue's
1430+
own "all in common" framing and the project's "design on existing
1431+
patterns, not new directives" doctrine.
1432+
alternatives: >
1433+
(1) Dashboard edit form in `rivet serve` — rejected as the primary
1434+
mechanism: serve is today strictly read-only for artifacts (every route
1435+
is GET; the only POST, /api/v1/sql, hard-rejects non-SELECT and rejects
1436+
cross-origin), so this would stand up the first-ever server write path
1437+
plus CSRF/origin surface, for VS-Code-external users only. (2) VSIX
1438+
webview form — rejected as primary: a new UI bound to one editor, and it
1439+
would still need the same schema-driven field model this decision builds
1440+
for the LSP; viable as a LATER increment that reuses the schema model.
1441+
(3) Do nothing / docs — rejected: the friction is real and repeatable.
1442+
Chosen: schema-aware LSP completion + snippets first (reaches all
1443+
editors, no new write surface, YAML stays canonical); leave a dashboard
1444+
or VSIX form as an optional follow-up if demand persists.
1445+
provenance:
1446+
created-by: ai-assisted
1447+
model: claude-opus-4-8
1448+
timestamp: 2026-07-02T08:15:00Z

artifacts/requirements.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7656,8 +7656,8 @@ artifacts:
76567656
- id: REQ-246
76577657
type: requirement
76587658
title: human-friendly artifact editing UI (reduce raw-YAML friction)
7659-
status: draft
7660-
description: "A user reported raw-YAML artifact editing is cumbersome; the core is shared but there is no human-facing UI to help author/edit artifacts. Design a friendlier editing path (dashboard form and/or VSIX assist). Scope TBD — needs a design decision before implementation. #546."
7659+
status: approved
7660+
description: "A user reported raw-YAML artifact editing is cumbersome; the core is shared but there is no human-facing UI to help author/edit artifacts. DD-071 decides the direction: deliver the help on the shared LSP (schema-aware completion + snippets — field names with required markers, enum field values, link types + valid target types, per-artifact-type skeletons), not a new serve/VSIX write surface, so YAML stays canonical and every LSP editor benefits. #546."
76617661
provenance:
76627662
created-by: ai-assisted
76637663
model: claude-opus-4-8

0 commit comments

Comments
 (0)