Commit 940ffdc
authored
feat(schema): reserve validations key in schema spec v0.1.0
Reserves the top-level `validations:` key in schema spec v0.1.0 — proto, DB, YAML parser, lint, storage round-trip — without shipping the CEL engine. The engine and runtime evaluation land in Phase 2 (#76).
Wire format mirrors Kubernetes CRD x-kubernetes-validations and buf/protovalidate per the cel-validation design brief: each rule carries a path prefix, the CEL expression source, a human-readable failure message, an optional severity hint (error / warning), and an optional machine-readable reason code.
v0.1.0 lint at ImportSchema is structural only — rule and message required, severity optional and constrained to error / warning, x-* extension keys accepted. CEL compilation, field-reference resolution, and contradiction detection all defer to Phase 2 once the engine ships.
Why now: spec v0.1.0 freezes the meta-schema. Reserving the key now costs ~50 lines of plumbing; adding it later is a breaking spec bump that downstream tooling has to handle. Schema authors who want cross-field rules today can write CEL expressions; ImportSchema accepts and persists them, and they become no-ops at write time until Phase 2.
Closes #192. Final Phase-1 subtask of the cross-field validation umbrella (#76); pairs with #193 (dependentRequired) and #194 (prefix-overlap lint), both already in main.1 parent a8c766a commit 940ffdc
18 files changed
Lines changed: 771 additions & 85 deletions
File tree
- api/centralconfig/v1
- cmd/server
- db
- migrations
- queries
- docs/api
- internal
- schema
- storage
- dbstore
- domain
- proto/centralconfig/v1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
344 | 345 | | |
345 | 346 | | |
346 | 347 | | |
| 348 | + | |
347 | 349 | | |
348 | 350 | | |
349 | 351 | | |
| |||
515 | 517 | | |
516 | 518 | | |
517 | 519 | | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
518 | 547 | | |
519 | 548 | | |
520 | 549 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
619 | 624 | | |
620 | 625 | | |
621 | 626 | | |
| |||
626 | 631 | | |
627 | 632 | | |
628 | 633 | | |
629 | | - | |
| 634 | + | |
630 | 635 | | |
631 | 636 | | |
632 | 637 | | |
| |||
651 | 656 | | |
652 | 657 | | |
653 | 658 | | |
654 | | - | |
| 659 | + | |
655 | 660 | | |
656 | 661 | | |
657 | 662 | | |
658 | 663 | | |
659 | 664 | | |
660 | 665 | | |
661 | | - | |
| 666 | + | |
662 | 667 | | |
663 | 668 | | |
664 | 669 | | |
| |||
674 | 679 | | |
675 | 680 | | |
676 | 681 | | |
| 682 | + | |
677 | 683 | | |
678 | 684 | | |
679 | 685 | | |
| |||
690 | 696 | | |
691 | 697 | | |
692 | 698 | | |
693 | | - | |
| 699 | + | |
694 | 700 | | |
695 | 701 | | |
696 | 702 | | |
697 | 703 | | |
698 | 704 | | |
699 | 705 | | |
700 | 706 | | |
| 707 | + | |
701 | 708 | | |
702 | 709 | | |
703 | 710 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
148 | 152 | | |
149 | 153 | | |
150 | 154 | | |
| |||
154 | 158 | | |
155 | 159 | | |
156 | 160 | | |
| 161 | + | |
157 | 162 | | |
158 | 163 | | |
159 | 164 | | |
| |||
0 commit comments