refactor(contract): unify schemas with shared $ref definitions#1109
Closed
nextlevelshit wants to merge 2 commits intomainfrom
Closed
refactor(contract): unify schemas with shared $ref definitions#1109nextlevelshit wants to merge 2 commits intomainfrom
nextlevelshit wants to merge 2 commits intomainfrom
Conversation
…tions Create shared _defs/ schemas for severity, finding, PR reference, and issue reference types. Enhance jsonschema validator to preload _defs/ for cross-file $ref resolution. Refactor 10 contract schemas to use $ref instead of inline duplicates. Wire input-side schema_path validation into 4 key pipeline YAMLs. Add unit tests for $ref resolution and chain integration tests for artifact compatibility across pipeline steps.
…add missing chain tests review-findings.schema.json and triage-verdict.schema.json gained minimum:1 and format:uri constraints via $ref to pr-reference that were not present in the original schemas — a breaking change that could reject previously valid artifacts. Reverted pr_number/pr_url to original inline definitions. Added missing chain test coverage for pr-result, gh-pr-comment-result, and research-report (allOf+$ref pattern) schemas.
Collaborator
Author
|
Closing as superseded by #1110. The flat schema approach (no |
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
finding,issue-reference,pr-reference,severity) into_defs/directory under.wave/contracts/$refpointers to shared definitions, eliminating redundant inline definitions$refresolution support in the contract validation engine (internal/contract/jsonschema.go)Related to #994
Changes
.wave/contracts/_defs/*.schema.json— New shared base schemas for findings, issue references, PR references, and severity enums.wave/contracts/*.schema.json— Updated existing schemas to use$refpointers instead of inline definitionsinternal/contract/jsonschema.go— Added$refresolution logic for local file referencesinternal/contract/jsonschema_refs_test.go— Tests for$refresolutioninternal/contract/chain_test.go— Cross-pipeline artifact chaining validation testsinternal/contract/input_validator.go— Minor validation improvementsinternal/adapter/opencode.go— Adapter fix for schema handlinginternal/defaults/pipelines/*.yaml— Pipeline config updates for contract referencesinternal/webui/— Minor UI fixes (unrelated cleanup in same branch)Test Plan
go test ./internal/contract/...— All contract tests pass including new chain and ref resolution tests