Skip to content

feat(modify,add): reject a status outside the declared enum (REQ-135, #354)#371

Merged
avrabe merged 1 commit into
mainfrom
feat/req-135-modify-schemashow
May 31, 2026
Merged

feat(modify,add): reject a status outside the declared enum (REQ-135, #354)#371
avrabe merged 1 commit into
mainfrom
feat/req-135-modify-schemashow

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented May 31, 2026

Builds on #370's retained base-fields. rivet modify --set-status / rivet add now reject a status outside the status base-field's declared allowed-values at mutation time (so a typo never reaches a file), with the allowed set named. Replaces the old do-nothing stub with a real shared check_status_allowed. Inert when no enum declared. Regression test + verified e2e (typo'd --set-status rejected). Closes the #354 part of REQ-135; schema show listing remains a follow-up.

…354)

Builds on the retained base-fields (REQ-135). `validate_add` and
`validate_modify` now check the artifact's `status` (and `--set-status`) against
the `status` base-field's `allowed-values` when declared, rejecting an
out-of-enum value at mutation time so a typo never reaches a file. The old stub
("status is a base field and generally freeform, but we'll accept it") is
replaced with a real, shared `check_status_allowed`. Inert when no enum is
declared (free-form preserved). Regression test + verified end-to-end (a typo'd
`--set-status` is rejected with the allowed set named).

Remaining REQ-135 follow-up: `schema show` listing the status values (spans
CLI + HTML render surfaces).

Implements: REQ-135
Verifies: REQ-135
Refs: REQ-007

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

📐 Rivet artifact delta

No artifact changes in this PR. Code-only changes (renderer, CLI wiring, tests) don't touch the artifact graph.

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: 3ad0072 Previous: cfd7ac7 Ratio
store_insert/100 84428 ns/iter (± 243) 67059 ns/iter (± 1246) 1.26
store_insert/1000 948018 ns/iter (± 6261) 723769 ns/iter (± 5552) 1.31
store_insert/10000 15213337 ns/iter (± 724744) 12191528 ns/iter (± 902947) 1.25
store_lookup/100 1928 ns/iter (± 5) 1469 ns/iter (± 5) 1.31
store_lookup/1000 24996 ns/iter (± 63) 18482 ns/iter (± 94) 1.35
store_lookup/10000 369186 ns/iter (± 2179) 277076 ns/iter (± 1247) 1.33
store_by_type/100 97 ns/iter (± 0) 75 ns/iter (± 0) 1.29
store_by_type/1000 97 ns/iter (± 0) 75 ns/iter (± 0) 1.29
store_by_type/10000 97 ns/iter (± 0) 75 ns/iter (± 1) 1.29
schema_load_and_merge 1464595 ns/iter (± 34360) 1121589 ns/iter (± 25710) 1.31
link_graph_build/100 165718 ns/iter (± 1370) 128229 ns/iter (± 353) 1.29
link_graph_build/1000 1940823 ns/iter (± 18139) 1474865 ns/iter (± 20370) 1.32
link_graph_build/10000 40730143 ns/iter (± 5618221) 29762739 ns/iter (± 4303625) 1.37
validate/100 124203 ns/iter (± 1856) 96187 ns/iter (± 2041) 1.29
validate/1000 1155914 ns/iter (± 22557) 879728 ns/iter (± 20643) 1.31
traceability_matrix/100 4159 ns/iter (± 7) 3399 ns/iter (± 80) 1.22
traceability_matrix/1000 48327 ns/iter (± 945) 34428 ns/iter (± 836) 1.40
traceability_matrix/10000 757277 ns/iter (± 13872) 577729 ns/iter (± 8498) 1.31
diff/100 62912 ns/iter (± 398) 48244 ns/iter (± 880) 1.30
diff/1000 712413 ns/iter (± 3055) 515227 ns/iter (± 3556) 1.38
query/100 771 ns/iter (± 1) 592 ns/iter (± 1) 1.30
query/1000 7052 ns/iter (± 15) 5129 ns/iter (± 55) 1.37
query/10000 98778 ns/iter (± 900) 78307 ns/iter (± 395) 1.26
document_parse/10 21103 ns/iter (± 466) 16500 ns/iter (± 56) 1.28
document_parse/100 145325 ns/iter (± 1759) 111341 ns/iter (± 425) 1.31
document_parse/1000 1354227 ns/iter (± 8869) 1043280 ns/iter (± 4159) 1.30

This comment was automatically generated by workflow using github-action-benchmark.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

❌ Patch coverage is 96.29630% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rivet-core/src/mutate.rs 96.29% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@avrabe avrabe merged commit 9ae05c2 into main May 31, 2026
19 of 39 checks passed
@avrabe avrabe deleted the feat/req-135-modify-schemashow branch May 31, 2026 16:17
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