feat(contract): add work_item_ref shared schema (#1590)#1593
Merged
Conversation
Phase 2.1 of Epic #1565 (work-source dispatch). Adds a draft-07 JSON schema at internal/contract/schemas/shared/work_item_ref.json so future WorkSourceService, /work board, and dispatch wiring share a validated shape for forge issues/PRs, scheduled jobs, and manual triggers. Schema details: - $id wave://shared/work_item_ref, title WorkItemRef. - source enum (github, gitea, gitlab, bitbucket, schedule, manual) discriminates forge vs non-forge entries. - Unconditional required: source, url, title, state, created_at. - forge_host, owner, repo are required only for forge sources via allOf if/then; number stays optional even for forge sources because some forges expose numberless work items. - additionalProperties:false for parity with issue_ref / pr_ref. Also: - registry_test.go canonical list includes work_item_ref; sorted-floor bumped 7 -> 8. - New work_item_ref_test.go covers six positive fixtures (one per source) and five negatives (missing forge_host, unknown source, extra property, invalid state, malformed created_at). - ADR-010 updated: schema count 8 -> 9 and a Schema additions footer table. - docs/scope/onboarding-as-session-plan.md: Phase 2.1 row ticked, inline draft snippet replaced with the canonical-shape diff (forge -> source, repo string -> forge_host/owner/repo, kind/id -> number + state). .agents/contracts/ deliberately not mirrored: that registry holds step-output contracts validated by sync_test.go, not pipeline-I/O typed schemas (different system).
This was referenced Apr 30, 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.
Summary
work_item_refshared schema (draft-07) for the work-source dispatch pipeline (Epic Epic: Onboarding-as-Session — work-source-centric webui + self-evolving pipelines #1565 Phase 2.1).sourceenum, with conditionalforge_host/owner/reporequirements viaallOf if/then..agents/contracts/intentionally not mirrored — that registry holds step-output contracts, not pipeline-I/O typed schemas.Related to #1590
Changes
internal/contract/schemas/shared/work_item_ref.json— new draft-07 schema,$id wave://shared/work_item_ref,additionalProperties:false.internal/contract/schemas/shared/work_item_ref_test.go— six positive (one per source) + five negative fixtures.internal/contract/schemas/shared/registry_test.go— canonical list includeswork_item_ref; sorted-floor 7 → 8.docs/adr/010-pipeline-io-protocol.md— schema count 8 → 9, schema-additions footer table.docs/scope/onboarding-as-session-plan.md— Phase 2.1 row ticked, inline snippet replaced with canonical-shape diff.specs/1590-work-item-ref-schema/{spec,plan,tasks}.md— speckit planning artifacts.Test Plan
go test ./internal/contract/schemas/shared/...— all positive fixtures validate, all negative fixtures rejected with expected messages.registry_test.goconfirmswork_item_refdiscoverable in shared registry alongside existingissue_ref/pr_ref.