E2: gradual-adoption policy and documentation - #18
Merged
Conversation
15 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a “gradual adoption” path for validation by introducing a policy helper that downgrades all checks to warnings, and updates public documentation to describe validation scope and identifier utilities.
Changes:
- Introduces
Check::ALLandValidationPolicy::warn_all()to support warn-mode rollouts. - Adds tests around
warn_all()behavior and basic sanity checks forCheck::ALL. - Updates README and
docs/validation.mdto reflect the implemented validator and current API names.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/validate.rs | Adds Check::ALL and ValidationPolicy::warn_all() plus API docs. |
| src/tests.rs | Adds tests for warn_all() and Check::ALL invariants. |
| README.md | Documents validation behavior and identifier utilities; fixes KtCode naming. |
| docs/validation.md | Marks validation design as implemented and updates the recorded work order. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1383
to
+1385
| fn check_all_lists_every_variant() { | ||
| // `Check::ALL` drives `warn_all`, so a check missing from it would silently | ||
| // stay fatal during a warn-mode rollout. Names are unique and non-empty. |
Comment on lines
+72
to
+74
| /// Every check, so a policy can be built over all of them. Adding a check | ||
| /// extends this list, which is what keeps | ||
| /// [`ValidationPolicy::warn_all`] correct as the set grows. |
Adds ValidationPolicy::warn_all() and Check::ALL. A generator that already produces output can turn every check into a warning, look at what comes back, and drop the call once it is quiet — much less disruptive than a build that starts failing on output that was fine yesterday. Check::ALL keeps warn_all correct as checks are added, and a test pins that every variant is in it. Documents what shipped: README gains sections on validation and on the identifier utilities, and drops a stale reference to the old `Code` name. docs/validation.md is marked implemented and its work order updated to the one the chain actually followed. The remaining half of the rollout — running warn mode against the downstream generated output and confirming it is quiet — belongs with the consumer migration, which the umbrella scopes out of this chain.
milyin
force-pushed
the
step/e2-rollout-and-docs
branch
from
August 6, 2026 11:40
ce16ec3 to
f13aef6
Compare
milyin
force-pushed
the
step/b3-shape-checks
branch
from
August 6, 2026 11:40
133b37d to
42419dc
Compare
milyin
changed the base branch from
step/b3-shape-checks
to
docs/validation-umbrella
August 6, 2026 11:41
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.
Step E2 of #6. Stacked on #17. Last PR in the chain.
Gradual adoption
ValidationPolicy::warn_all()turns every check into a warning. That is how agenerator which already produces output adopts validation: run in warning mode,
look at what comes back, drop the call once it is quiet. Much less disruptive
than a build that starts failing on output that was fine yesterday.
Check::ALLbacks it, so adding a check later extendswarn_allautomaticallyrather than leaving the new one silently fatal during someone's rollout. A test
pins that every variant appears in it.
Documentation
README gains a section on what is caught and — as importantly — what is
deliberately not, plus one on the identifier utilities. It also drops a stale
reference to
Code, which was renamedKtCodebefore any of this.docs/validation.mdis marked implemented, with its work order corrected to theone the chain actually followed (E1 moved ahead of B1, since the checks needed
the diagnostics plumbing to exist first).
What is left
The other half of the rollout — running warn mode against the downstream
generated output and confirming it is quiet — needs the consumer, which #6
scopes out of this chain. It goes with the
prebindgen-jnimigration.The JVM-erasure check (
f(List<String>)vsf(List<Int>)) remains deliberatelydeferred; the reasoning is in
docs/validation.md.