Documentation

Docs / Reference

ADR 0088 - Settings editing: one guarded edit of graphvein.yaml with value origins

Status: Accepted (delegated review, 2026-11-25)

Context

The web UI gets a Settings page (T039): the commonly changed graphvein.yaml keys as a form, the whole file one click away, every value with its origin, and a re-index prompt for keys that only an index run reads. graphvein.yaml stays the source of truth: the page never keeps a second copy of a setting.

Three guarded edits of configuration files already exist, each with the same pattern (ADR 0075's manifest edit, ADR 0081's explorer path values and try-it environments): typed operations, a unified-diff preview, the hash of the file the edit was based on, the hash of the previewed result, a per-process session token, a loopback peer, http.CrossOriginProtection and an atomic write. They re-encode the file through yaml.v3, which keeps comments attached to nodes but re-indents the whole file with two spaces and drops blank lines, so a one-value edit of a hand-formatted file shows a diff of every line.

Constraints from the developer's decisions (2026-11-19/20, 2026-11-24): comments and keys the form does not show are preserved; an invalid file is never written; each value says where it comes from (built-in default, repository file, this browser; the browser level stays in the UI); keys that need a re-index say so; in project mode each member's own file plus the manifest's try-it environments; ignore patterns are shown read-only from .graphveinignore (no new key); ui.impact_depth and ui.chain_depth appear only once T042 adds them.

Options considered

  1. A new GET/POST /api/v0/config with typed operations on a fixed key table, plus a whole-text form (design D1 (a), D2 (a)). One endpoint, one key table, one claim contract; the existing endpoints keep their own semantics.
  2. Extend each existing endpoint per section. No single place says which keys the form edits; origins and re-index needs would be spread over several answers.
  3. Let the UI parse YAML for origins and edits. Two parsers that can disagree with the strict decoder; rejected (design D4).

For the write itself:

For "needs a re-index":

For what that stored hash covers:

For where it is stored:

Decision

Option 1 with write strategy (c), the fixed per-key table, and a record of the index inputs (ii) in a column of its own on every index run.

Consequences

Known gaps

Review notes (delegated review, 2026-11-25, T039)

Accepted after the final CI gate of 2026-11-25 (CI runs 45627357238, 45632313364 and 45638139948 (the last green on Linux, Postgres and Windows; postgres log 0 FAIL, 291 /postgres PASS)). One independent review (R-1..R-8: decoder-faithful values, comments from the parser, the link template row, editor info refresh) fixed with failing-first tests; integration added the depth keys ST-31/32 and the Editor section. graphvein.yaml stays the source of truth; every write goes through the previewed guarded edit. Known gaps as recorded above (keys outside the form compared by raw text, on the safe side).

Report a problem with this pageSource: docs/adr/0088-settings-editing.md