Skip to content

docs: propose canonical flow documents - #51

Merged
wavekat-eason merged 2 commits into
mainfrom
docs/canonical-document
Oct 17, 2026
Merged

wavekat-eason merged 2 commits into
mainfrom
docs/canonical-document

Conversation

@wavekat-eason

@wavekat-eason wavekat-eason commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A design proposal: docs/01-canonical-document.md. It replaces the closed #50.

The flow YAML should be the single source of truth, with nothing meaningful outside the model. Then any tool, in any language and offline, edits by parsing → changing the model → serializing, with no text splicing or CST surgery.

  • Notes: an optional note on every node (and the flow) replaces YAML comments. It's a compatible addition to v1 and v2, with no version bump. Comments become a comment_ignored warning.
  • Order: maps keep document order. Rust generates IndexMap through typify's with_map_type, and serde_json gets preserve_order for ui.
  • One canonical text: Rust to_yaml and TS serializeFlow produce byte-identical output. A new conformance/canonical/ corpus pins it, including fixed-point and lossless round-trip checks.
  • Editors: mutate.ts keeps its API but edits through the model. Editors refuse to save a document with unknown fields, so a round trip can't silently drop data.
  • Migration: a one-time platform migration moves stored comments into note.

The open questions are resolved in the doc (flow-level note: yes; multi-line strings: double-quoted with \n; one general flow-style rule). The doc also has a Consumers section: what the platform, CLI and voice daemon each change.

Test plan

  • Open questions settled (see "Resolved questions" in the doc).
  • Owner review of the design.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GNFHhzw4ZsqCFnv6ERigjd

wavekat-eason and others added 2 commits October 17, 2026 21:55
Make the document the whole truth so editing is parse, change the
model, serialize: per-node `note` instead of YAML comments, ordered
maps, and one canonical serialization pinned by the corpus in both
languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GNFHhzw4ZsqCFnv6ERigjd
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GNFHhzw4ZsqCFnv6ERigjd
@wavekat-eason
wavekat-eason added this pull request to stack #53 October 17, 2026 11:19
@wavekat-eason
wavekat-eason marked this pull request as ready for review October 17, 2026 22:38
@wavekat-eason
wavekat-eason merged commit dd1aaeb into main Oct 17, 2026
3 checks passed
@wavekat-eason
wavekat-eason deleted the docs/canonical-document branch October 17, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant