Skip to content

Add API/export contract enforcement checks #23

Description

@ProfRandom92

Goal

Add lightweight contract enforcement checks for real Comptextv7 API/export payload shapes using the machine-readable contracts introduced in PR #22.

Background

Comptextv7 now has:

  • machine-readable contract schemas under contracts/
  • synthetic examples under contracts/examples/
  • scripts/validate_contracts.py
  • agent CI guardrails

The next step is to validate generated API/export sample payloads against these contracts without requiring a live server or real Daimler data.

Scope

Create a CI-friendly enforcement layer:

  • scripts/generate_contract_fixtures.py
  • scripts/validate_api_exports.py
  • contracts/examples/api-dashboard.example.json
  • update .github/workflows/agent-checks.yml
  • update docs/API_SURFACE.md
  • update docs/AGENT_WORKFLOW.md

Requirements

  • Prefer Python standard library only.
  • Do not require a live server.
  • Do not require real Daimler data.
  • Use synthetic fixtures only.
  • Do not commit secrets, tokens, cookies, customer data, raw production logs, or proprietary documents.
  • Reuse the existing contract validation approach where possible.
  • Keep the PR small and reviewable.

Desired behavior

  • Generate deterministic synthetic API/export fixtures.
  • Validate generated fixtures against contracts/api-dashboard.schema.json.
  • Produce docs/reports/api-export-validation-report.md.
  • CI should run this check.
  • Missing optional runtime components should report a safe skip, not fail.

Acceptance criteria

  • API/export fixture generation exists and is deterministic.
  • API/export validation exists and runs in CI.
  • No live server is required.
  • No real Daimler data is included.
  • Reports are generated under docs/reports/.
  • Future agents can use this as a compatibility gate before dashboard/API PRs.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions