feat(validate): make manifesto contract defaults executable#5
Merged
Conversation
The manifesto protects the leader key, picker, explorer, terminal, and LSP strategy defaults, but neither the static validator nor the update-contract test asserted them, so a silent default swap would have passed validation. Add the six contract defaults to scripts/update-contract.lua (asserted from blak.config.defaults at runtime) and mirror them as a textual check in scripts/validate.py so make validate enforces the contract without Neovim. Document the new check in VALIDATION.md.
03849c0 to
ebbfbaa
Compare
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.
Summary
The manifesto says a default picker, completion engine, explorer, LSP strategy, leader key, or core workflow changes "only through an explicit upgrade path, not by surprise" — but nothing enforced that.
scripts/update-contract.luatested snapshot/restore mechanics and one user-override case, while the contract-relevant defaults themselves were unasserted; a silent swap ofpicker.provideror the leader key would have passed all validation.Two layers of enforcement, same six defaults (
leader,localleader,picker.provider = "fff",explorer.provider = "oil",terminal.provider = "native",lsp.automatic_enable = true):scripts/update-contract.lua: asserts them at runtime fromblak.config.defaults(read directly so the test's own setup overrides don't mask anything).scripts/validate.py: a textualcheck_contract_defaults()mirror, so plainmake validatecatches a contract change even without Neovim installed. The error message points at the manifesto and tells the author to ship an explicit upgrade path and update both checks deliberately.Completion isn't asserted because it has no provider option — blink.cmp is structurally the only engine.
VALIDATION.mddocuments the new check.Validation
make validatepasses. Verified the new check fails correctly by mutatingpicker.provider→"snacks"andleader→","locally (both caught, then reverted). The update-contract assertions follow the existing script'sassertstyle and run before any test-config setup.