WIN AIP Contract Sync
Boundary
WIN owns the complete API and validates requests/responses. AIP needs a small job-path catalog plus the public response types its code imports. Keep path discovery automatic; do not introduce a handwritten list or flags marking which APIs the frontend needs. Some unused generated path names are acceptable.
Detailed job schemas remain in WIN's API/OpenAPI rather than an unused full JSON copy in AIP. A model/provider change such as adding MAI transcription, with no path or frontend-consumed DTO change, requires no frontend generation, edits, or checks. Continue the backend task.
Workflow
- Read both repos' guidance and inspect their git status. Trace the affected interface: frontend caller/import, proxy, WIN handler, and response model. Generated-file entries and documentation examples are not actual consumers.
- Keep backend database models internal and map to public DTOs explicitly.
PUBLIC_DTOSin WIN'sscripts/contracts/export_public_dto_contracts.pylists response types actually imported by frontend code. Do not remove backend response models merely because their generated frontend copies are unused. - When registered job paths/identities or frontend-imported DTOs change, run
from WIN:
The script reads WIN locally and writes directly into the sibling AIP repo. It discovers job paths automatically and refreshes selected public DTOs. Git commits, pushes, and remote CI are not part of this file generation.scripts/local/sync_aip_contracts.sh - Inspect the diff; do not hand-edit
aipodcasting/lib/aip/contracts/**. Submit frontend jobs throughsubmitJobById/submitJob, using generated IDs. IDs are path slugs: strip slashes and replace/and-with_. Read the generated ID rather than guessing. Remove temporary proxy exceptions or casts once a registered endpoint is generated. Synchronous AIP routes remain thin HTTP proxies; do not add frontend database access. - Validate proportionally:
- Focused WIN tests for changed handlers/exporters.
scripts/local/check_aip_contracts_drift.shchecks output without rewriting AIP.- If frontend code or consumed types changed, run AIP
pnpm type-check,pnpm lint, and relevant feature/proxy tests. - If backend-only changes leave frontend contracts unchanged, do not create frontend work or run unrelated frontend checks.
- Report the affected interface and evidence. The generic submit helper accepts
unknownpayloads; do not claim it provides frontend request-schema validation. WIN owns that validation.
Cleanup and delivery
Verify imports, re-exports, dynamic reads, and request paths before pruning a file. Remove unused exports from their generator and regenerate, so they do not return. Keep backend models and active frontend consumers. Prefer small tests that prove model-only changes leave path output identical and new job paths are discovered automatically.
Local Git automation handles history and remote backup. Local production reconciliation builds and activates clean committed releases separately; editing or generating files does not activate live services. Do not bypass that release boundary or manually commit/push unless explicitly requested.
Exact contracts and commands live in WIN's
docs/references/api-endpoint-implementation.md and AIP's
docs/references/aip-backend-integration.md.