Skip to content

docs: sync v0.4.2 rivet artifacts + stamp bug fixes (pre-tag)#192

Merged
avrabe merged 1 commit intomainfrom
docs/v042-artifact-sync
Apr 22, 2026
Merged

docs: sync v0.4.2 rivet artifacts + stamp bug fixes (pre-tag)#192
avrabe merged 1 commit intomainfrom
docs/v042-artifact-sync

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 22, 2026

Summary

First release where the artifact record is authored before the tag, not retroactively (v0.4.0 and v0.4.1 both had the "authored after release" caveat in their own files).

New artifacts (artifacts/v042-artifacts.yaml)

  • 3 design-decisions: silent-accept closure theme, deny_unknown_fields strategy, SCRC lint-escalation roadmap
  • 6 features: rivet-stamp batch flags, rivet-delta workflow, schema-consistency validator, docs-check namespace exemption, LSP workspace-schema fix, artifact reverse-references
  • 1 requirement: every embed option must validate before render

Stamp bug fixes (surfaced while authoring the above)

  • --missing-provenance was a no-op — filter checked fields.get("provenance") but Provenance is a first-class struct field. rivet stamp all --missing-provenance was overwriting timestamps on every call. Same silent-accept antipattern this release is about (bit ourselves).
  • set_provenance failure bailed the whole batch — a single STPA control-action the CST can't navigate into would abort stamping for all artifacts. Now warns and skips.

Stamp sweep side-effects

  • Added provenance to REQ-054/055/058/059 (legitimately lacked it since creation)
  • Re-stamped safety/stpa/ai-in-the-loop.yaml (inline-flow provenance the rowan CST can't see yet — v0.4.3 flow-mapping support will close the gap)

Test plan

  • cargo test --workspace — all 36 test groups green
  • cargo run -- docs check — PASS (41 files, 0 violations)
  • cargo run -- validate — no new diagnostics introduced by our additions
  • rivet stamp all --missing-provenance is now idempotent (re-run produces 0 stamps)
  • After merge: retag v0.4.2, release supervise

🤖 Generated with Claude Code

…items; add v0.4.2 artifacts

Two stamp correctness fixes surfaced while authoring artifacts/v042-artifacts.yaml:

1. --missing-provenance was a no-op. The filter checked
   `a.fields.get("provenance")` but Provenance is a first-class
   Option<Provenance> struct field on Artifact, not a custom entry in
   the fields: BTreeMap. Result: `rivet stamp all --missing-provenance`
   touched every artifact on every call — the opposite of idempotent.
   Now uses a.provenance.is_none(). Silent-accept of a buggy filter
   (this release's theme, bitten by it ourselves).

2. set_provenance errors on one artifact used to bail the whole batch.
   Nested artifacts (STPA control-actions inside a controller entry)
   are visible to the store walk but invisible to the YamlEditor CST
   walk — the batch would die on the first CA-* and stamp nothing.
   Now warns per-skipped-item and continues. Consistent with the
   "stamp everything I can" intent of --missing-provenance + batch
   filters.

artifacts/v042-artifacts.yaml — first release where artifact record
is authored *before* the tag, not retroactively:

  - DD-056: Silent-accept theme (18 fixes, rationale + alternatives)
  - DD-057: deny_unknown_fields on all schema-author structs
  - DD-058: SCRC clippy lint escalation roadmap (v0.4.3–v0.4.7)
  - FEAT-123: rivet stamp batch filter flags
  - FEAT-124: rivet-delta PR workflow (graphical diff)
  - FEAT-125: Schema::validate_consistency fail-fast
  - FEAT-126: docs-check external-namespace exemption
  - FEAT-127: LSP workspace schema resolution
  - FEAT-128: Artifact reverse-reference view
  - REQ-060: Every embed option must validate before render

Stamp sweep filled provenance on REQ-054/055/058/059 (legitimately
missing since creation) and re-stamped
safety/stpa/ai-in-the-loop.yaml (inline-flow provenance that rowan
CST couldn't see — will be visible once the flow-mapping CST gap is
closed in v0.4.3).

Implements: REQ-004, REQ-007, REQ-008, REQ-010, REQ-029
Verifies: REQ-004, REQ-010

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit d1c64fe into main Apr 22, 2026
2 of 12 checks passed
@avrabe avrabe deleted the docs/v042-artifact-sync branch April 22, 2026 20:34
@github-actions
Copy link
Copy Markdown

📐 Rivet artifact delta

Change Count
Added 9
Removed 0
Modified 1
Downstream impacted (depth ≤ 5) 0

Graph

graph LR
  DD_056["DD-056"]:::added
  DD_057["DD-057"]:::added
  DD_058["DD-058"]:::added
  FEAT_123["FEAT-123"]:::added
  FEAT_124["FEAT-124"]:::added
  FEAT_125["FEAT-125"]:::added
  FEAT_126["FEAT-126"]:::added
  FEAT_127["FEAT-127"]:::added
  FEAT_128["FEAT-128"]:::added
  REQ_060["REQ-060"]:::modified
  classDef added fill:#d4edda,stroke:#28a745,color:#155724
  classDef removed fill:#f8d7da,stroke:#dc3545,color:#721c24
  classDef modified fill:#fff3cd,stroke:#ffc107,color:#856404
  classDef overflow fill:#e2e3e5,stroke:#6c757d,color:#495057,stroke-dasharray: 3 3
Loading
Added
  • DD-056
  • DD-057
  • DD-058
  • FEAT-123
  • FEAT-124
  • FEAT-125
  • FEAT-126
  • FEAT-127
  • FEAT-128
Modified
ID Changes
REQ-060

📎 Full HTML dashboard attached as workflow artifact rivet-delta-pr-192download from the workflow run.

Posted by rivet-delta workflow. The graph shows only changed artifacts; open the HTML dashboard (above) for full context.

avrabe added a commit that referenced this pull request Apr 22, 2026
…iority fix (#193)

* feat(ci): rivet-delta renders mermaid → SVG for email/mobile visibility

PR #192's delta comment proved the concept: the mermaid diagram rendered
inline on GitHub web, but showed as raw source in email digests and
the GitHub mobile app (both of those strip ```mermaid blocks).

This change pre-renders the diagram to SVG in the workflow and pushes
it to a dedicated orphan branch (`rivet-delta-renders`), then rewrites
the PR comment to put an <img> tag above the mermaid source. Email
and mobile clients see the rendered image; GitHub web users still get
the interactive mermaid graph in a collapsed <details>.

Workflow:
- New step: npx @mermaid-js/mermaid-cli@11.4.2 mmdc -i diagram.mmd -o diagram.svg
- Push SVG to rivet-delta-renders:pr-<N>/run-<RUN>/diagram.svg
- Two-pass script invocation: pass 1 emits mermaid source to disk via
  --mmd-out; pass 2 rewrites the comment with --svg-url pointing at
  the raw.githubusercontent.com URL of the pushed SVG.
- Falls back to pass-1 mermaid-only output if SVG push fails (so a
  permissions glitch doesn't lose the whole comment).
- Needs contents: write to push to the orphan branch — permission
  scope expanded from read-only.

Script (scripts/diff-to-markdown.mjs):
- --mmd-out PATH writes raw mermaid source (fences stripped) to PATH
  for the mermaid-cli renderer.
- --svg-url URL injects an <img> reference above the mermaid block
  and wraps the mermaid source in <details><summary>Interactive
  graph</summary> so it collapses on the web UI.
- Classification priority fix: build the mermaid node-class Map with
  modified first, then added/removed, so terminal classes (added,
  removed) win over modified when the same ID appears in multiple
  lists. Regression guard for the PR #192 "newly-added REQ-060 shown
  as modified/yellow" glitch.

Playwright coverage (tests/playwright/rivet-delta.spec.ts):
- svg-url flag injects image above mermaid block, mermaid moves to
  <details>, <img src> points at the raw URL.
- mmd-out flag writes raw mermaid source without fences to the given
  path.
- Classification priority: NEW-1 duplicated in `added` and `modified`
  renders as :::added, not :::modified.

Also fixed the REQ-060 bucket-as-modified bug from v0.4.2: the
rivet-core diff engine itself was correct (IDs can't be in both
added and common); the bug was script-side.

Implements: FEAT-124
Refs: DD-058

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(serve): sidebar badges now refresh on Reload — use HX-Redirect not HX-Location

When the user clicked the Reload button in `rivet serve`, the reload
handler returned `HX-Location` targeting `#content` only. Everything
outside `#content` — including the sidebar with artifact count,
document count, variant count, STPA count, EU-AI-Act count, and
diagnostic badges — stayed untouched in the DOM. If a reload added or
removed artifacts on disk, the sidebar numbers lied.

Swapping to `HX-Redirect` tells HTMX to do a full browser navigation
to the same URL. The whole shell re-renders, sidebar included. Cheap
in practice because HTMX stays in-session and the server serves the
page out of the freshly-reloaded salsa state.

Playwright regression pins the contract: the /reload response must
carry HX-Redirect, not HX-Location. The old shape (HX-Location +
target=#content) is what left the sidebar stale, so refusing it at
test time prevents the bug from silently coming back.

Fixes: REQ-008
Refs: FEAT-001

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avrabe avrabe mentioned this pull request Apr 23, 2026
3 tasks
avrabe added a commit that referenced this pull request Apr 23, 2026
* feat(variant): rivet variant explain for debugging solve outcomes

Answers "why did my variant pick/skip feature X?" — a dev/debug UX gap
called out in the v0.4.3 scope.

Two modes:

  # Full audit: every effective feature + origin, unselected features,
  # and the constraint list
  rivet variant explain --model fm.yaml --variant prod.yaml

  # Single-feature focus: origin, attribute values, and every
  # constraint that mentions the feature
  rivet variant explain --model fm.yaml --variant prod.yaml asil-c

Each effective feature carries an origin:
  - `selected`        — user listed it under `selects:`
  - `mandatory`       — parent group is mandatory, or is the root
  - `implied by <X>`  — a constraint forced it in once <X> was selected
  - `allowed`         — present but not proven mandatory

`--format json` emits a structured audit for scripts (dashboard uses
the same shape for the variant sidebar).

Coverage:
  - explain_single_feature_shows_origin_and_attrs (text mode)
  - explain_single_feature_json_mode
  - explain_full_variant_audit_lists_origins_and_unselected

Docs: new "Debugging" subsection in docs/getting-started.md under the
variant management chapter, with an origin table.

Implements: REQ-046
Refs: DD-050

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(variant): enrich eu-adas-c example + per-format smoke on realistic model

Adds realistic `attributes:` to examples/variant/feature-model.yaml
for every market (eu/us/cn with compliance+locale) and every ASIL
level (asil-numeric + required analysis techniques). These match the
worked examples in docs/getting-started.md so users can run the
snippets against the shipped fixture and see the same output.

New integration test `every_format_renders_realistic_example`
exercises all 7 --format values against the enriched example and
asserts each output contains the variant name and the asil-c marker
(in whatever casing the format uses). Catches regressions that pass
on toy models but break on constraint-driven inclusion, multi-attr
features, or non-trivial tree depth.

Implements: REQ-046
Refs: DD-050

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(release): v0.4.3

Workspace version bump 0.4.2 → 0.4.3, CHANGELOG entry covering the
v0.4.3 changes that have already landed on main:

- rivet variant features/value/attr for 7 build systems (#197)
- docs: variant emitter walkthrough + exit-code contract (#198)
- rivet variant explain for debugging solve outcomes (#199)
- test: enrich eu-adas-c example + per-format smoke (#199)
- sexpr count-compare + matches parse-time regex (#196)
- SCRC Phase 1 clippy restriction lint escalation (#195)
- Rivet Delta SVG render for email/mobile (#193)
- stamp --missing-provenance filter + warn-skip (#192)

v043-artifacts.yaml gains five new entries matching the implementations:
  - DD-061  build-system emitters are namespaced and loud-on-failure
  - FEAT-130 rivet variant features/value/attr
  - FEAT-131 rivet variant explain
  - DD-062  matches regex + count-compare validated at lower time
  - FEAT-132 count-compare lowering + matches parse-time regex
  - FEAT-133 Rivet Delta SVG render for email/mobile
  - FEAT-134 rivet stamp filter + warn-skip

All 41 test binaries green. rivet validate: only pre-existing SPAR
aadl-component schema errors remain (unrelated to this release).

Implements: REQ-046
Refs: REQ-004, REQ-010, DD-050, DD-058

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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