Repository navigation
test(lint): assert closed check objects, not an open contract root - #18
Merged
Merged
Conversation
The offline CLI suite fails on main: TestContractLint/invalid_contract expects `bogus_field` at the contract root to exit 2, but lint accepts it and exits 0. Two PRs merged a minute apart caused this. #16 synced the contract JSON schema from the backend, which flips the root from "additionalProperties": false to true — unknown top-level keys are now allowed by design — and dropped its own TestLintFile_InvalidProperty accordingly. #17 branched before that landed and added a CLI test asserting the old behavior. Both were green against their own base; the merge of the two is not. The schema is generated backend-side, so pinning the root closed again would be reverted by the next sync and would reject contracts the backend accepts. Point the subtest at a check object instead: those are still closed, so it keeps CLI-level coverage of the "additional properties not allowed" path rather than deleting it. Refs: #16, #17 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
m1n0
approved these changes
Sep 11, 2026
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.
Problem
The offline CLI job on
mainis red.TestContractLint/invalid_contractexpectsbogus_fieldat the contract root to fail lint with exit 2, but lint accepts it and exits 0.This is a semantic merge conflict between two PRs that landed a minute apart:
"additionalProperties": falsetotrue— unknown top-level keys are allowed by design now — and correctly dropped its ownTestLintFile_InvalidProperty.Each PR was green against its own base, so nothing caught it until both were on
main. The lint code is fine; the test's premise went stale.Change
Points the subtest at an unknown key inside a check rather than at the contract root. Checks are still closed in the synced schema, so this keeps CLI-level coverage of the "additional properties not allowed" error path instead of deleting the case outright.
Alternatives considered
Restoring
"additionalProperties": falseat the schema root. Rejected: the schema is generated backend-side, so the next sync would revert it, and in the meantime the CLI would reject contracts the backend accepts.Testing
Both offline tiers — the two jobs CI runs — pass locally:
go test ./...go test -tags cli ./tests/integration/...— all 10TestContractLintsubtests passNote for reviewers
This class of failure recurs on every backend schema sync. Requiring PRs to be up to date with
mainbefore merge (branch protection) would catch it, since both PRs here were individually green.