feat: embed phases 2+5 — diagnostics, matrix, snapshots, docs#96
Merged
feat: embed phases 2+5 — diagnostics, matrix, snapshots, docs#96
Conversation
Phase 5: adds two new computed embed types:
- {{diagnostics}} / {{diagnostics:error|warning|info}} — validation
issues as HTML table with severity filter and summary footer
- {{matrix}} / {{matrix:from_type:to_type}} — inline traceability
matrix with coverage bar, auto-detects link type from schema rules
7 unit tests + 2 CLI integration tests.
Phase 2: project snapshot infrastructure for baseline comparison: - Snapshot struct with stats, coverage, diagnostics, git context - rivet snapshot capture — dumps current state to JSON - rivet snapshot diff — compares current vs baseline (text/json/markdown) - rivet snapshot list — lists available snapshots - Delta computation with NEW/RESOLVED diagnostic tracking - SC-EMBED-2 (git commit in snapshot), SC-EMBED-6 (schema version) 5 unit tests + 2 CLI integration tests.
Adds optional baseline snapshot to EmbedContext so embed renderers can show delta columns when delta=BASELINE option is used. All callers updated to pass baseline: None (wiring comes next).
Phase 4: self-documenting schema guide for AI agents and developers: - /api/v1/guide — JSON endpoint with artifact types, fields, link types, traceability rules, embed syntax reference, commit trailers, and common mistakes - rivet guide --format json|text — CLI equivalent for scripting - Refreshes from current AppState on each request (SC-EMBED-5) 2 CLI integration tests + 1 serve integration test.
There was a problem hiding this comment.
⚠️ 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: b4e3dfc | Previous: ca97dd9 | Ratio |
|---|---|---|---|
store_insert/10000 |
14664673 ns/iter (± 745083) |
10878958 ns/iter (± 357041) |
1.35 |
link_graph_build/10000 |
41461816 ns/iter (± 2979474) |
25883542 ns/iter (± 188443) |
1.60 |
validate/10000 |
6734006 ns/iter (± 480908) |
5184757 ns/iter (± 21355) |
1.30 |
query/10000 |
137180 ns/iter (± 362) |
91618 ns/iter (± 423) |
1.50 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This reverts commit d93efb8.
Instead of a separate guide endpoint (reverted — duplicated rivet schema
and rivet context), add the embed syntax documentation to the existing
'documents' topic in rivet docs where it naturally belongs.
Covers: {{stats}}, {{coverage}}, {{diagnostics}}, {{matrix}},
{{artifact:ID}}, {{links:ID}}, {{table:TYPE:FIELDS}}, error handling,
and HTML export provenance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Phases 2 and 5 from issue #92, plus embed documentation:
Phase 5: Diagnostics + matrix embeds
{{diagnostics}}/{{diagnostics:error|warning|info}}— validation issues as HTML table with severity filter and summary footer{{matrix}}/{{matrix:from_type:to_type}}— inline traceability matrix with coverage bar, auto-detects link type from schema rulesPhase 2: Snapshot infrastructure
rivet snapshot capture— dumps project state (stats, coverage, diagnostics) to JSON with git commit + dirty statusrivet snapshot diff— compares current vs baseline (text/json/markdown)rivet snapshot list— lists available snapshots with summaryEmbedContext.baselinefield for futuredelta=BASELINErenderingDocumentation
{{stats}},{{coverage}},{{diagnostics}},{{matrix}}, etc.) to the existingrivet docs documentstopicrivet schema+rivet contextSafety constraints
Tests
Refs #92.
Test plan
cargo test --workspace— all tests passcargo clippy --all-targets -- -D warnings— cleancargo fmt --all -- --check— clean🤖 Generated with Claude Code