feat(modify,add): reject a status outside the declared enum (REQ-135, #354)#371
Merged
Conversation
…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>
📐 Rivet artifact deltaNo artifact changes in this PR. Code-only changes (renderer, CLI wiring, tests) don't touch the artifact graph. |
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: 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 Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Builds on #370's retained base-fields.
rivet modify --set-status/rivet addnow reject a status outside thestatusbase-field's declaredallowed-valuesat mutation time (so a typo never reaches a file), with the allowed set named. Replaces the old do-nothing stub with a real sharedcheck_status_allowed. Inert when no enum declared. Regression test + verified e2e (typo'd--set-statusrejected). Closes the #354 part of REQ-135;schema showlisting remains a follow-up.