Skip to content

fix(usai-catalog): allow summary and title roles in catalog recommendations schema - #551

Merged
mogul merged 1 commit into
mainfrom
fix/usai-recommendations-schema-roles
Oct 29, 2026
Merged

mogul merged 1 commit into
mainfrom
fix/usai-recommendations-schema-roles

Conversation

@mogul

@mogul mogul commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

🤖: AI agent (First Mate), AI-assisted change (OpenCode). Human review required before merge.

Context

integrations/providers/usai/catalog.schema.json allowed only primary, small, compaction under recommendations (additionalProperties: false), but the shipped catalog.json and the OpenCode kit renderer also use summary and title. Part of the epic #357.

Plan / Changes

  • Add summary and title (string, minLength 1) to recommendations in catalog.schema.json. No defaults block; catalog.json data unchanged.
  • README note on the role vocabulary.
  • New scripts/tests/test_usai_catalog_schema.py (runs in CI via pytest scripts/tests/): shipped catalog validates against shipped schema with jsonschema; role set equals renderer vocabulary; unknown role and empty values rejected.

Premise check

  • Before fix, a real validator (jsonschema 4.26.0, Draft 2020-12) rejects shipped catalog.json: recommendations: Additional properties are not allowed ('summary', 'title').
  • The hand-written validateCatalog() in build-catalog.mjs does NOT check recommendations (only top-level/gateway/vendor/model keys), so no existing test caught it.
  • Other copies checked: neutral schema acq-neutral-model-catalog.schema.json and normalize-catalog.mjs already list all five roles; render-provider-config.mjs ROLE_PATHS and validate_provider_input_contract.py need no change.

Verification

  • New test before fix: 2 failed, 7 passed; after fix: 9 passed.
  • make validate: all validators passed.
  • pytest scripts/tests: 740 passed.
  • make test-kits: opencode 62, usai-provider 18, paseo 65, providers/usai 122 pass, 0 fail.
  • Adversarial blocker-only review: no blockers.

Rollback

Revert this commit; no data or runtime change.

Security Impact

None: schema permits two additional advisory role keys already used by shipped data.

…ations schema

catalog.schema.json restricted recommendations to primary/small/compaction
while the shipped catalog.json and the OpenCode renderer also use summary
and title. Add both roles and a schema-level test (real JSON Schema
validator) so schema, data, and renderer vocabulary stay aligned.

Co-authored-by: OpenCode Agent <user@gsa.gov>
@mogul
mogul marked this pull request as ready for review October 29, 2026 03:53
@mogul
mogul requested a review from a team as a code owner October 29, 2026 03:53
@mogul
mogul enabled auto-merge October 29, 2026 04:02

@wz-gsa wz-gsa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed-head review of 28a6c3ea3d77cc595369885491cbce24c7df8832: the three-file schema-only slice adds summary and title as nonempty advisory recommendation roles. The shipped catalog.json already contains those five roles, and the OpenCode renderer’s role vocabulary matches. The new Python test validates the shipped catalog with Draft 2020-12 and rejects unknown/empty role values. Required current-head checks pass and no unresolved threads were observed. This approval covers schema compatibility only: the existing catalog builder does not yet preserve recommendations through regeneration or check role-reference membership; the stacked #553 explicitly owns that behavior and must remain separately reviewed and gated. AI-assisted static review (OpenCode), no PR code executed on the host.

@mogul
mogul added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit ad2aadd Oct 29, 2026
7 checks passed
@mogul
mogul deleted the fix/usai-recommendations-schema-roles branch October 29, 2026 13:58
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.

2 participants