Skip to content

lint: reject unknown vault.toml keys with BVM004 - #5

Merged
SaMullinsJr merged 1 commit into
mainfrom
fix/vault-toml-unknown-keys
Aug 28, 2026
Merged

SaMullinsJr merged 1 commit into
mainfrom
fix/vault-toml-unknown-keys

Conversation

@SaMullinsJr

Copy link
Copy Markdown
Member

Fixes #2.

bvm-lint now rejects unknown vault.toml keys instead of silently accepting them at PASS/exit 0. This is the issue's option 1, the smaller change.

  • New diagnostic BVM004, one finding per unknown top-level key, naming the key and the closed set (schema, name, method_version).
  • SPEC.md §3 now says the file MUST NOT contain any other key, so the rejection is a documented contract. This also answers the issue's third alternative explicitly: unknown keys are not a forward-compatibility escape hatch here; a later method series arrives through a schema / method_version bump with its own checker contract.
  • Registered in codes.py, schemas/diagnostics.json (diagnostic parity gate), and docs/linter-reference.md.
  • Tests: the receipts_dir = "MY_RECEIPTS" adoption trap from the issue now yields BVM004; a conformant vault.toml stays clean.

./verify_repo.sh returns REPOSITORY VERIFY PASS (50 codes in diagnostic parity); make test passes 70 tests + 10 subtests.

No CHANGELOG entry per repo convention: fix commits do not touch it, the release PR collects them.

An unknown key -- including a plausible one like receipts_dir -- was
accepted silently at PASS/exit 0. In a conformance checker, silence on
unrecognized input is the failure mode worth closing: the author reads
PASS as the setting having taken effect, when nothing read the key.

New diagnostic BVM004 fires per unknown top-level key, naming the key
and the closed declared set (schema, name, method_version). SPEC.md
section 3 now states MUST NOT contain any other key, so rejection is a
documented contract rather than an unstated default -- the issue's
forward-compatibility escape-hatch alternative is thereby declined
explicitly: a later series bumps schema and method_version instead.

Registered in codes.py, schemas/diagnostics.json (diagnostic parity),
and docs/linter-reference.md. Tests cover the receipts_dir adoption
trap from the issue and that the declared keys alone stay clean.
Full repository verify PASS; 70 tests, 10 subtests.
@SaMullinsJr
SaMullinsJr merged commit 7c181c5 into main Aug 28, 2026
6 checks passed
@SaMullinsJr
SaMullinsJr deleted the fix/vault-toml-unknown-keys branch August 28, 2026 13:49
SaMullinsJr added a commit that referenced this pull request Aug 28, 2026
Collects everything since v0.2.0: BVM004 unknown-key rejection (#5), the
four validator hardenings + BVM-01 (#6), CI action bumps. v0.3.0 rejects
vaults v0.2.0 passed; the CHANGELOG names each case.

Method version 0.1.1: SPEC.md section 3 gained one normative sentence
(vault.toml carries no undeclared keys). Same 0.1.x series; templates
and the tutorial vault declare 0.1.1; the parity gate welds all eight
surfaces (release 0.3.0, method 0.1.1, both PASS).

The three version-parity tests hardcoded the literal current method
version in their mutations, so this first in-series bump broke them --
they mutated nothing and asserted about the unmutated file. Rewritten
as regex mutations over the version field with a subn count assert, so
they keep testing drift after any future bump.
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.

vault.toml: unknown keys are silently accepted at PASS/exit 0

1 participant