Skip to content

docs: s-expression artifact format — honest cost analysis, recommend Option A#162

Open
avrabe wants to merge 1 commit intomainfrom
docs/sexpr-artifact-format
Open

docs: s-expression artifact format — honest cost analysis, recommend Option A#162
avrabe wants to merge 1 commit intomainfrom
docs/sexpr-artifact-format

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 21, 2026

What this ships

`docs/design/sexpr-artifact-format.md` — honest cost analysis for adding s-expression as an artifact format alongside YAML.

TL;DR

Recommended path: Option A (`rivet convert --to sexpr`, one-way export-only), gated on the YAML fuzzer (#158 in this batch).

  • Option A (~5 days): one-way export. Audit-archive use. No LSP work. Ships regardless of fuzzer outcome.
  • Option B (~15-20 days): read-only import. Only if fuzzer finds real bugs on our corpus.
  • Option C (40-60 days + ~20%/yr dual-path maintenance): not justified on current evidence.
  • Option D (replace YAML): not recommended.

Total for recommended: ~5 (Option A) + ~2 (fuzzer) ≈ 7 days.

Why not further

  1. Paper honesty: arxiv:2604.13108 shows LLM comprehension is format-agnostic. JSON has lower silent-corruption (21%) than both YAML and S-expr (50% each). The paper's own proposal is a single top-level `intent.lisp`, not per-artifact migration.
  2. What we already have (verified by reading code, not guessing):
    • `sexpr.rs` (579 LoC) is rowan-based and lossless — comment/whitespace preservation free
    • `yaml_hir.rs::extract_schema_driven` is 1901 LoC — its s-expr twin is the single largest item (~900-1200 LoC)
    • `yaml_edit.rs` is 1210 LoC line-based — s-expr twin is cleaner but still ~800-1000 LoC
    • 7 call sites filter on `.yaml`/`.yml` extensions (enumerated)
    • vscode-rivet has no TextMate grammar — `.rivet` grammar is new work
  3. 3 of 8 Mythos findings retired by s-expr ingest (null shorthand, multi-doc truncation, Norway problem). The other 5 are orthogonal.

Test plan

Doc only.

🤖 Generated with Claude Code

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Rivet Criterion Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: aef153e Previous: aa706fc Ratio
link_graph_build/10000 37599747 ns/iter (± 2642609) 27530692 ns/iter (± 3638629) 1.37
validate/10000 15082659 ns/iter (± 1425852) 10896266 ns/iter (± 1631891) 1.38
query/10000 146593 ns/iter (± 676) 90574 ns/iter (± 529) 1.62

This comment was automatically generated by workflow using github-action-benchmark.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@avrabe avrabe force-pushed the docs/sexpr-artifact-format branch from aef153e to 9b4f497 Compare April 21, 2026 18:59
Concrete, cost-estimated design doc covering four scope options (A: export-
only, B: read-only import, C: full bidirectional, D: replace YAML) with
verified LoC-based effort estimates drawn from reading the existing
rivet-core and rivet-cli sources.

Recommendation: Option A gated on YAML fuzzer results. Option C is
40-60 person-days up front plus ~20%/yr dual-path maintenance and is
not justified on current evidence.

Refs: #128
Refs: DD-048
@avrabe avrabe force-pushed the docs/sexpr-artifact-format branch from 9b4f497 to 422f847 Compare April 21, 2026 19:47
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