Skip to content

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

Merged
avrabe merged 1 commit intomainfrom
docs/sexpr-artifact-format
Apr 22, 2026
Merged

docs: s-expression artifact format — honest cost analysis, recommend Option A#162
avrabe merged 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: e221234 Previous: 1dc7457 Ratio
link_graph_build/10000 39687050 ns/iter (± 2635290) 24443913 ns/iter (± 1413500) 1.62
validate/10000 18636227 ns/iter (± 851951) 10834171 ns/iter (± 816671) 1.72
diff/10000 10563695 ns/iter (± 365601) 7858152 ns/iter (± 303969) 1.34

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 6 times, most recently from 9b3f8de to 8b8478a Compare April 22, 2026 04:20
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 8b8478a to e221234 Compare April 22, 2026 04:20
@avrabe avrabe merged commit d143663 into main Apr 22, 2026
13 checks passed
@avrabe avrabe deleted the docs/sexpr-artifact-format branch April 22, 2026 04:20
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