openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: API specification servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: predictions description: Locked daily predictions and cumulative results paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check description: Returns server health status responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /predictions: get: operationId: listPredictionDates tags: [predictions] summary: List dates with a locked prediction slate responses: "200": description: Dates, newest first content: application/json: schema: $ref: "#/components/schemas/PredictionDates" /predictions/{date}: get: operationId: getPredictionDay tags: [predictions] summary: The locked predictions for one date parameters: - name: date in: path required: true schema: type: string pattern: "^\\d{4}-\\d{2}-\\d{2}$" responses: "200": description: The prediction lock, exactly as committed content: application/json: schema: $ref: "#/components/schemas/PredictionDay" "404": description: No lock exists for this date content: application/json: schema: $ref: "#/components/schemas/ApiError" /report: get: operationId: getReportSummary tags: [predictions] summary: Cumulative record across all settled dates responses: "200": description: Aggregated history plus the current learning state content: application/json: schema: $ref: "#/components/schemas/ReportSummary" /reviews: get: operationId: listReviewDates tags: [predictions] summary: List dates with an AI reviewer briefing responses: "200": description: Dates, newest first (empty until reviews run) content: application/json: schema: $ref: "#/components/schemas/PredictionDates" /reviews/{date}: get: operationId: getReviewBriefing tags: [predictions] summary: The AI reviewer briefing for one date (verbatim markdown) parameters: - name: date in: path required: true schema: type: string pattern: "^\\d{4}-\\d{2}-\\d{2}$" responses: "200": description: The committed briefing, untouched — advisory only content: application/json: schema: $ref: "#/components/schemas/ReviewBriefing" "404": description: No briefing exists for this date content: application/json: schema: $ref: "#/components/schemas/ApiError" /audit: get: operationId: getStandingAudit tags: [predictions] summary: The latest weekly standing audit (verbatim markdown) responses: "200": description: The committed audit.md, untouched content: application/json: schema: $ref: "#/components/schemas/AuditReport" "404": description: No standing audit committed yet content: application/json: schema: $ref: "#/components/schemas/ApiError" /npb/predictions: get: operationId: listNpbPredictionDates tags: [npb] summary: List dates with a locked NPB prediction slate responses: "200": description: Dates, newest first content: application/json: schema: $ref: "#/components/schemas/PredictionDates" /npb/predictions/{date}: get: operationId: getNpbPredictionDay tags: [npb] summary: The locked NPB predictions for one date parameters: - name: date in: path required: true schema: type: string pattern: "^\\d{4}-\\d{2}-\\d{2}$" responses: "200": description: The prediction lock, exactly as committed content: application/json: schema: $ref: "#/components/schemas/PredictionDay" "404": description: No lock exists for this date content: application/json: schema: $ref: "#/components/schemas/ApiError" /npb/report: get: operationId: getNpbReportSummary tags: [npb] summary: Cumulative NPB record across all settled dates responses: "200": description: Aggregated history plus the current learning state content: application/json: schema: $ref: "#/components/schemas/ReportSummary" /npb/reviews: get: operationId: listNpbReviewDates tags: [npb] summary: List dates with an NPB AI reviewer briefing responses: "200": description: Dates, newest first (empty until reviews run) content: application/json: schema: $ref: "#/components/schemas/PredictionDates" /npb/reviews/{date}: get: operationId: getNpbReviewBriefing tags: [npb] summary: The NPB AI reviewer briefing for one date (verbatim markdown) parameters: - name: date in: path required: true schema: type: string pattern: "^\\d{4}-\\d{2}-\\d{2}$" responses: "200": description: The committed briefing, untouched — advisory only content: application/json: schema: $ref: "#/components/schemas/ReviewBriefing" "404": description: No briefing exists for this date content: application/json: schema: $ref: "#/components/schemas/ApiError" /npb/audit: get: operationId: getNpbStandingAudit tags: [npb] summary: The latest weekly NPB standing audit (verbatim markdown) responses: "200": description: The committed audit.md, untouched content: application/json: schema: $ref: "#/components/schemas/AuditReport" "404": description: No standing audit committed yet content: application/json: schema: $ref: "#/components/schemas/ApiError" components: schemas: HealthStatus: type: object properties: status: type: string required: - status ApiError: type: object properties: error: type: string required: - error PredictionDates: type: object properties: dates: type: array items: type: string required: - dates GamePrediction: type: object description: >- One game's locked prediction. Only the fields the UI keys on are typed; the full engine payload (handicap, total, expectedRuns, reasons, flags) passes through untouched. properties: gamePk: type: number gameDate: type: [string, "null"] home: type: string away: type: string pass: type: boolean predictedWinner: type: [string, "null"] winProbability: type: number confidence: type: string enum: [S, A, B, C] required: - gamePk - home - away - pass - predictedWinner - winProbability - confidence additionalProperties: true PredictionDay: type: object properties: date: type: string lockedAt: type: string final: type: boolean predictions: type: array items: $ref: "#/components/schemas/GamePrediction" required: - date - lockedAt - predictions additionalProperties: true ReportSummary: type: object description: >- aggregateHistory() output plus the learned calibration state. The shape is owned by @workspace/sports-data; the API passes it through. properties: summary: type: object additionalProperties: true calibration: type: object additionalProperties: true required: - summary - calibration ReviewBriefing: type: object description: >- One date's AI reviewer briefing (Data Auditor / Matchup Analyst / Risk Reviewer), exactly as committed — advisory only, written after the lock; markdown passes through verbatim. properties: league: type: string enum: [mlb, npb] date: type: string updatedAt: type: string format: date-time markdown: type: string required: - league - date - updatedAt - markdown AuditReport: type: object description: >- The weekly standing audit exactly as the Monday cron committed it — markdown passes through verbatim, never re-rendered. properties: league: type: string enum: [mlb, npb] updatedAt: type: string format: date-time markdown: type: string required: - league - updatedAt - markdown