Enforce owner/namespace/scope field shapes per spec 006#36
Merged
Conversation
Adds capability_validation.py checks for spec 006 FR-002/FR-003/FR-004: owner must be an object with a non-empty team string, namespace must be a non-empty string, and a top-level scope field is rejected (resolution tier is a consumer-side concept, not part of a published record). Wires a unit test suite into the capability-validation CI job. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
82b6d6b to
218277e
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
Strengthens
scripts/ci/capability_validation.pyto enforce the field shapesspecs/006-public-scope-and-identityfinalizes:ownermust be an object with a non-emptyteamstring (contract.invalid_owner, spec 006 FR-003)namespacemust be a non-empty string (contract.invalid_namespace, spec 006 FR-002), in addition to the existing path-mismatch checkcontract.jsonmust NOT contain a top-levelscopefield (contract.forbidden_scope_field, spec 006 FR-004 — resolution tier is a consumer-side concept)Adds
scripts/ci/tests/test_capability_validation.py(stdlibunittest, no new dependency) and wires it into thecapability-validationCI job.Governing Spec
Project Item
Definition of Done
ownermissing, non-object, or lacking a non-emptyteamstring, with a field-specific stable error codescopefield, with an error message pointing to spec 006 FR-004namespace(path-segment mismatch already covered)Validation
python3 -m unittest scripts/ci/tests/test_capability_validation.py -v— 9/9 pass locally (re-run after rebase onto latest main)python3 scripts/ci/capability_validation.pyagainst the currentcapabilities/tree — zero regressions