Skip to content

feat(contract): add work_item_ref shared schema (#1590)#1593

Merged
nextlevelshit merged 1 commit into
mainfrom
1590-work-item-ref-schema
Apr 30, 2026
Merged

feat(contract): add work_item_ref shared schema (#1590)#1593
nextlevelshit merged 1 commit into
mainfrom
1590-work-item-ref-schema

Conversation

@nextlevelshit
Copy link
Copy Markdown
Collaborator

Summary

  • Adds canonical work_item_ref shared 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).
  • Schema discriminates forge sources (github/gitea/gitlab/bitbucket) from non-forge (schedule/manual) via source enum, with conditional forge_host/owner/repo requirements via allOf if/then.
  • Six positive + five negative fixtures cover all source types and the main rejection paths.
  • Registry canonical list updated; ADR-010 and onboarding session plan reflect the new shape.
  • .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 includes work_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.go confirms work_item_ref discoverable in shared registry alongside existing issue_ref / pr_ref.

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).
@nextlevelshit nextlevelshit merged commit 7b6aadc into main Apr 30, 2026
15 checks passed
@nextlevelshit nextlevelshit deleted the 1590-work-item-ref-schema branch April 30, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant