feat(schemas): add SeamDefinition schema — typed seam registry object [T0-2] - #230
Merged
Conversation
… (T0-2) Typed architectural seam: an ungated boundary that is an attack surface. Each names where trust is not enforced, the exploit vector, and the gate that closes it. One object per example file (type discriminator) per repo convention; examples cover SEAM-002/008/013 from the 13-seam registry. - schemas/SeamDefinition.json (v1.0.0, draft 2020-12); seam_id pattern SEAM-###, implementation_status 4-enum, gate_requirements required non-empty. - tools/validate_seam_definition_examples.py: validates each example + 5 rejection invariants (R1-R5). - Makefile: validate-seam-definition-examples wired into validate. make validate green; validator enforces R1-R5. Closes #229
There was a problem hiding this comment.
Pull request overview
This PR implements Issue #229 (T0-2) by introducing a new Draft 2020-12 JSON Schema (SeamDefinition) plus validated example fixtures, and wiring a dedicated validator into make validate so the spec stays fixture-backed and regression-checked.
Changes:
- Added
schemas/SeamDefinition.jsondefining the canonical typed seam registry object (including requiredgate_requirements,implementation_status, andpriorityenums). - Added three
examples/seam-definition*.jsonfixtures (SEAM-002, SEAM-008, SEAM-013) and a validator (tools/validate_seam_definition_examples.py) that enforces both positive validation and rejection invariants (R1–R5). - Integrated seam validation into the Makefile via
validate-seam-definition-examplesand included it in thevalidatemeta-target.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/validate_seam_definition_examples.py | Adds schema+fixtures validator with enum assertion and negative controls (R1–R5). |
| schemas/SeamDefinition.json | Introduces the SeamDefinition Draft 2020-12 schema and required fields/enums. |
| Makefile | Wires the new seam-definition validator into make validate. |
| examples/seam-definition.json | Adds SEAM-002 example instance. |
| examples/seam-definition.seam-008.json | Adds SEAM-008 example instance. |
| examples/seam-definition.seam-013.json | Adds SEAM-013 example instance. |
Suppressed comments (2)
schemas/SeamDefinition.json:40
- gate_requirements is required/non-empty via minItems: 1, but individual entries can still be empty strings. Enforcing minLength on each item better matches the intent (“no stated gate is not actionable”) and is consistent with other schemas’ string arrays.
"items": { "type": "string" },
schemas/SeamDefinition.json:51
- linked_repos currently allows empty-string entries. Consider requiring non-empty strings for consistency with other string-array fields and to avoid placeholder/blank values silently validating.
"items": { "type": "string" },
| "attack_vector": { "type": "string", "minLength": 1, "description": "How the ungated boundary is exploited." }, | ||
| "known_exploits": { | ||
| "type": "array", | ||
| "items": { "type": "string" }, |
| @@ -1,12 +1,16 @@ | |||
| .PHONY: validate validate-resource-contract validate-measurement validate-value-type validate-source-locator validate-sourceos-repo-manifest validate-mesh-action-registry validate-control-plane-examples validate-nlboot-examples validate-lattice-data-governai-examples validate-ops-history-examples validate-runtime-observability-examples validate-interpretability-examples validate-lifecycle-boundary-examples validate-svf-contracts validate-sync-cycle-receipts validate-onboarding-examples validate-runtime-causality-examples validate-agentic-os-examples validate-triparty-examples validate-labor-market-examples validate-supply-chain-risk-examples validate-reasoning-examples validate-mpcc-event-examples validate-knowledge-nugget-examples validate-semantic-action-examples validate-epistemic-kernel-examples validate-ab-update-examples validate-device-service-examples validate-duplicate-schema-ids validate-lawful-dispatch-receipt validate-architectural-building-block validate-agent-passport-examples validate-measurement | |||
| .PHONY: validate validate-resource-contract validate-measurement validate-value-type validate-source-locator validate-sourceos-repo-manifest validate-mesh-action-registry validate-control-plane-examples validate-nlboot-examples validate-lattice-data-governai-examples validate-ops-history-examples validate-runtime-observability-examples validate-interpretability-examples validate-lifecycle-boundary-examples validate-svf-contracts validate-sync-cycle-receipts validate-onboarding-examples validate-runtime-causality-examples validate-agentic-os-examples validate-triparty-examples validate-labor-market-examples validate-supply-chain-risk-examples validate-reasoning-examples validate-mpcc-event-examples validate-knowledge-nugget-examples validate-semantic-action-examples validate-epistemic-kernel-examples validate-ab-update-examples validate-device-service-examples validate-duplicate-schema-ids validate-lawful-dispatch-receipt validate-architectural-building-block validate-agent-passport-examples validate-seam-definition-examples validate-measurement | |||
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.
Implements T0-2. Adds
schemas/SeamDefinition.json+ 3 example seams (SEAM-002/008/013) + validator wired intomake validate.Verification
python3 tools/validate_seam_definition_examples.py→OK: SeamDefinition schema valid; 3 seams validated (SEAM-002, SEAM-008, SEAM-013); 5 rejection invariants enforced (R1-R5)make validate-duplicate-schema-ids→OK: 324 unique schema $id valuesmake validate→OK: validateAcceptance criteria
implementation_statusenum contains exactly four values (asserted by validator)make validatepassesRejection invariants: R1 bad status · R2 empty gate_requirements · R3 missing seam_id · R4 malformed seam_id · R5 bad priority.
Closes #229