Skip to content

fix(openapi): add 11 missing RepositorySettings fields + a structural-drift CI check #2556

Description

@JSONbored

Parent: #1936

Problem

RepositorySettingsSchema and RepoSettingsPreviewSchema (src/openapi/schemas.ts) are hand-authored Zod schemas and are missing 11 real fields that the runtime RepositorySettings TS type has and the API handler actually serializes: sizeGateMode, gateDryRun, aiReviewMode, aiReviewByok, aiReviewProvider, aiReviewModel, aiReviewAllAuthors, aiReviewCloseConfidence, closeOwnerAuthors, badgeEnabled, slopAiAdvisory. ui:openapi:check (already in CI) only verifies the generated openapi.json matches the hand-written Zod schema — it never verifies the Zod schema matches the actual RepositorySettings TS interface. This silently breaks generated API clients, including @jsonbored/gittensory-mcp, which consume the OpenAPI spec and have no way to know about fields the spec doesn't mention.

Requirements

  • Add all 11 missing fields to RepositorySettingsSchema (and RepoSettingsPreviewSchema where applicable), matching the actual TS type's shape/optionality.
  • Add a lightweight structural-diff check to test:ci (or a dedicated npm run script) that compares the Zod schema's declared keys against keyof RepositorySettings, failing CI on any field present in one but not the other — closing the gap ui:openapi:check doesn't cover.
  • Regenerate apps/gittensory-ui/public/openapi.json after the schema fix.

Deliverables

  • Updated RepositorySettingsSchema/RepoSettingsPreviewSchema with all 11 fields.
  • A new structural-diff check wired into test:ci, following the same "regenerate + diff" pattern already proven by ui:openapi:check.
  • Regenerated apps/gittensory-ui/public/openapi.json.

Acceptance criteria

  • Every field present in the runtime RepositorySettings type that the API actually serializes is present in the OpenAPI schema.
  • The new structural-diff check fails CI if a future field is added to RepositorySettings (and actually returned by the API) without a corresponding OpenAPI schema update.
  • @jsonbored/gittensory-mcp and any other OpenAPI-generated client can see the full field set.

Expected outcome

The OpenAPI spec — and everything generated from it — stops silently drifting from the actual API surface, with a permanent CI guard against recurrence rather than a one-time fix.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.roadmapOn the Wave-2 agent-layer roadmap board (project 9)

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions