feat: document embeds Phase 1 — parser, renderers, CLI, provenance#95
Merged
feat: document embeds Phase 1 — parser, renderers, CLI, provenance#95
Conversation
Introduces rivet-core::embed module with EmbedRequest::parse() for
unified {{name:arg key=val}} syntax. EmbedError renders visible HTML
per SC-EMBED-3.
Refs: FEAT-074
Implements render_stats() and render_coverage() in the embed module, dispatched via resolve_embed(). Renders HTML tables with type counts, status groups, validation summary, and per-rule coverage percentages. Refs: FEAT-074
Thread embed_resolver through render_to_html → resolve_inline. Legacy embeds (artifact/links/table) keep inline logic. New computed embeds (stats/coverage) dispatch through the closure. All call sites updated. Refs: FEAT-074
Resolves embed queries (stats, coverage) from CLI with text or HTML output. Useful for scripting and testing embed resolution. 3 integration tests: stats:types, coverage, unknown embed error.
Computed embeds in exported documents now include a provenance footer with commit hash and timestamp (SC-EMBED-4). Export warns on stderr when the working tree is dirty (SC-EMBED-1). Satisfies: SC-EMBED-1, SC-EMBED-4
Adds integration tests for embed resolution in serve and CLI, plus parser edge-case unit tests for backward compatibility with existing artifact/links/table embed syntax. Playwright tests verify no embed-error spans appear in rendered documents. Verifies: SC-EMBED-3
Add #[allow(clippy::too_many_arguments)] for export functions and remove needless borrow in documents embed resolver.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
avrabe
added a commit
that referenced
this pull request
Apr 21, 2026
Addresses three gaps found in the post-v0.4.0 dogfooding audit. **v0.4.0 shipped-work artifacts** — `artifacts/v040-features.yaml` was last touched 2026-04-12 and describes variant/PLE work (FEAT-106..114), not the verification pyramid that actually shipped on 2026-04-19. New file `artifacts/v040-verification.yaml` authors 4 design decisions (DD-052 four-layer verification pyramid, DD-053 suffix-based yaml-section matching, DD-054 non-blocking framing for formal CI jobs, DD-055 cfg-gate platform syscalls), 8 features (FEAT-115..122 covering Kani 27-harness expansion, differential YAML tests, operation-sequence proptest, STPA-Sec suite, suffix-based UCA extraction, nested control-action extraction, Zola export, Windows support), and 1 requirement (REQ-060 cross-platform binaries). Counts were verified against the actual codebase — 27 `#[kani::proof]` attrs in proofs.rs, 6 differential tests, 16 STPA-Sec tests. **Retroactive trailer map** — extended `AGENTS.md` with three more legacy orphans (51f2054 #126, f958a7e, 75521b8 #44), a new v0.4.0 PR-level section for #150/#151/#152/#153, and an honest "genuinely-unmappable" section calling out `ca97dd9f` (#95) whose `SC-EMBED-*` trailers point to artifacts that were never authored. **Verus Proofs → hard gate** — rules_verus PR #21 (merged as 5bc96f39) fixes the hub-repo's ambiguous `:all` alias by emitting proper `toolchain()` wrappers per platform. Updates the git_override pin from e2c1600a (Feb 2026, broken) to 5bc96f39 and removes `continue-on-error: true` from the Verus job. Implements: REQ-030, REQ-060 Refs: DD-052, DD-053, DD-054, DD-055, FEAT-115, FEAT-116, FEAT-117, FEAT-118, FEAT-119, FEAT-120, FEAT-121, FEAT-122 Verifies: REQ-030
avrabe
added a commit
that referenced
this pull request
Apr 21, 2026
Addresses three gaps found in the post-v0.4.0 dogfooding audit. **v0.4.0 shipped-work artifacts** — `artifacts/v040-features.yaml` was last touched 2026-04-12 and describes variant/PLE work (FEAT-106..114), not the verification pyramid that actually shipped on 2026-04-19. New file `artifacts/v040-verification.yaml` authors 4 design decisions (DD-052 four-layer verification pyramid, DD-053 suffix-based yaml-section matching, DD-054 non-blocking framing for formal CI jobs, DD-055 cfg-gate platform syscalls), 8 features (FEAT-115..122 covering Kani 27-harness expansion, differential YAML tests, operation-sequence proptest, STPA-Sec suite, suffix-based UCA extraction, nested control-action extraction, Zola export, Windows support), and 1 requirement (REQ-060 cross-platform binaries). Counts were verified against the actual codebase — 27 `#[kani::proof]` attrs in proofs.rs, 6 differential tests, 16 STPA-Sec tests. **Retroactive trailer map** — extended `AGENTS.md` with three more legacy orphans (51f2054 #126, f958a7e, 75521b8 #44), a new v0.4.0 PR-level section for #150/#151/#152/#153, and an honest "genuinely-unmappable" section calling out `ca97dd9f` (#95) whose `SC-EMBED-*` trailers point to artifacts that were never authored. **Verus Proofs → hard gate** — rules_verus PR #21 (merged as 5bc96f39) fixes the hub-repo's ambiguous `:all` alias by emitting proper `toolchain()` wrappers per platform. Updates the git_override pin from e2c1600a (Feb 2026, broken) to 5bc96f39 and removes `continue-on-error: true` from the Verus job. Implements: REQ-030, REQ-060 Refs: DD-052, DD-053, DD-054, DD-055, FEAT-115, FEAT-116, FEAT-117, FEAT-118, FEAT-119, FEAT-120, FEAT-121, FEAT-122 Verifies: REQ-030
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
Completes Document Embeds Phase 1 (issue #91) — the unified
EmbedRequestarchitecture for computed data embeds in documents.EmbedRequestparser: parses{{name:arg1:arg2 key=val}}syntax with positional args and key=value options{{stats}},{{stats:types}},{{coverage}},{{coverage:rule-name}}embeds produce HTML tablesrender_to_htmlrefactor: addedembed_resolverclosure parameter so each caller (serve, export, CLI) can provide its own resolution contextrivet embedCLI command:rivet embed "stats:types"for scripting and terminal-friendly outputrivet export --format htmlwarns on stderr when working tree has uncommitted changesSafety constraints satisfied
cmd_export_html()checksgit.is_dirty, prints stderr warningEmbedError::to_error_html()renders visible<span class="embed-error">, never empty stringrender_provenance_stamp()appended to every computed embed in exportTest coverage
rivet embedcommand)Closes #91.
Test plan
cargo test --workspace— all ~580 tests passcargo clippy --all-targets -- -D warnings— clean🤖 Generated with Claude Code