Skip to content

feat(validate): --structural gates on integrity only, via Diagnostic::is_structural() (REQ-161, #408)#418

Merged
avrabe merged 1 commit into
mainfrom
feat/structural-gate
Jun 3, 2026
Merged

feat(validate): --structural gates on integrity only, via Diagnostic::is_structural() (REQ-161, #408)#418
avrabe merged 1 commit into
mainfrom
feat/structural-gate

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Jun 3, 2026

Implements #408. You delegated the 3 borderline classifications — I went with my recommendation (all coverage/lint), documented inline.

Why

rivet validate's PASS/FAIL lumps structural integrity (a broken graph) with coverage/lint (incomplete/non-compliant). A bulk status-flip or edit can't tell "did I break the graph?" from "still incomplete". spar and sigil both hand-rolled a 0 broken cross-refs gate for exactly this (#353/#355).

What

  • Diagnostic::is_structural() — explicit allowlist: artifact-parse-error, duplicate-artifact-id, known-type, unknown-link-type, link-target-type, cardinality, broken-link, doc-broken-ref, yaml-type-coercion, conditional-rule-consistency, coverage-rule-consistency. Everything else (including all schema-defined coverage/status-gate rules) is coverage/lint.
  • Borderline calls (you delegated): required-field, unknown-field, status-allowed-valuescoverage/lint (an incomplete/extra/typo'd field doesn't break the graph). Easy to flip later if you disagree — they're one line in the allowlist.
  • rivet validate --structural retains only structural diagnostics before counting/display, so shown set + counts + PASS/FAIL all reflect structural-only.
  • No rename of validate_structural* (option b) — the classification is a Diagnostic method, decoupled from that misnamed function.

Verify

  • rivet repo validate --structuralPASS, 0 shown (its 207 warnings are all coverage/lint).
  • Broken-link fixture → --structural FAILs and shows it; coverage-only fixture → --structural PASSes.
  • is_structural_classifies_every_builtin_rule (enumerates every built-in rule) + validate_structural_gates_on_structural_only CLI test.
  • clippy --all-targets + fmt clean; docs check PASS. --help documents the flag.

Deferred

Per-rule allow: config (net-new infra) and any validate_structural* rename.

Implements: REQ-161

🤖 Generated with Claude Code

…:is_structural() (REQ-161, #408)

From #408 (and the recurring #353/#355 ask): `rivet validate`'s PASS/FAIL
lumps structural integrity (a broken graph) together with coverage/lint
findings, so a bulk status-flip can't tell "did I break the graph?" from
"the project is still incomplete". spar/sigil both hand-rolled a
`0 broken cross-refs` gate for exactly this.

Add `Diagnostic::is_structural()` — an explicit allowlist of the
structural rule ids (broken-link, duplicate-artifact-id,
artifact-parse-error, link-target-type, cardinality, known-type,
unknown-link-type, doc-broken-ref, yaml-type-coercion,
conditional-rule-consistency, coverage-rule-consistency). Everything else
is coverage/lint, including the three borderline rules required-field /
unknown-field / status-allowed-values (an incomplete/extra/typo'd field
doesn't break the graph) and all schema-defined coverage/status-gate
rules.

`rivet validate --structural` retains only structural diagnostics before
counting/display, so the shown set, counts, and PASS/FAIL exit reflect
structural-only. No rename of `validate_structural*` (its name is
unrelated to this gate) — the classification lives on Diagnostic (#408
option b).

Verified: rivet repo `validate --structural` PASSes with 0 shown (its
206 warnings are all coverage/lint); a broken-link fixture FAILs
--structural; a coverage-only fixture PASSes. Unit test enumerates every
built-in rule's class; CLI test covers the gate. clippy --all-targets +
fmt clean; docs check PASS.

Implements: REQ-161
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

📐 Rivet artifact delta

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

Graph

graph LR
  REQ_161["REQ-161"]:::added
  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
  • REQ-161

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

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@avrabe avrabe merged commit 950c605 into main Jun 3, 2026
19 of 39 checks passed
@avrabe avrabe deleted the feat/structural-gate branch June 3, 2026 05:08
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