Status: Phase 1 (MVP) — implemented Owner: BreachDirect Target program: Drips Stellar Wave 8 — Contributor Track (drips.network/wave/stellar)
Stellar-ecosystem backends (escrow services, marketplace APIs, trust/reputation services) repeatedly need the same class of fix: API contract regressions. Concretely, across Wave issue trackers this shows up as:
- Error response shapes drifting between releases, breaking client error handling
(confirmed pattern: Wave issue #159,
Talenttrust/Talenttrust-Backend— "Add API contract tests to lock error envelope stability and key error codes"). - Wrong status codes shipped for known states — e.g. a delete-on-non-pending
resource returning
400instead of409(observed instellarmarket-labs/stellar-marketPR #833, which had to retrofit six status-code tests: 401/403/404/409/204 after the fact). - Auth boundaries not being asserted at all (routes that should 401/403 silently falling through to 200, or vice versa).
- No shared, reusable way to assert this — every team hand-rolls a handful of
assert resp.status_code == ...tests inside their own framework, if they write them at all.
ShieldScan (a related project) solves a different problem — full DAST /
vulnerability scanning of a running web app. That's too heavy a tool to reach for
when what a backend team actually needs is a fast, declarative, CI-friendly
contract checker that runs in seconds against localhost:8000 and fails the
build the moment an error envelope or status code contract breaks.
Give any Stellar Wave backend team a way to:
- Declare their API's expected contract (endpoints, status codes, error envelope shape, auth requirements) in one YAML file.
- Run
schemalock testlocally or in CI and get a pass/fail + JSON report in seconds, with no dependency on a full browser or a running scanner stack. - Catch the two most common backend regressions before merge: error envelope drift and auth-boundary regressions.
- Not a fuzzer, not a DAST tool, not a vulnerability scanner (that's ShieldScan's job).
- Not a full OpenAPI/JSON-Schema validator (Phase 2+).
- Not a load-testing or performance tool.
- Not GraphQL-schema-aware yet — Phase 1 treats GraphQL endpoints as POST/JSON contract targets (status code + envelope only); real GraphQL error-shape validation is Phase 2.
- Backend maintainers on Wave-funded repos (Rust/Node/Python APIs) who need a drop-in CI check.
- Wave contributors picking up "add contract tests" style issues, who want a tool instead of hand-rolling assertions per repo.
| # | Requirement | Status |
|---|---|---|
| R1 | YAML config format (schemalock.yaml) defining base URL, endpoints, expected status, auth requirement, error envelope shape |
✅ |
| R2 | CLI: schemalock test --config schemalock.yaml --base-url <url> |
✅ |
| R3 | Built-in check: error envelope stability (required fields + types present on error responses) | ✅ |
| R4 | Built-in check: auth-required routes (401/403 enforced when no/invalid credentials sent) | ✅ |
| R5 | Built-in check: status code pattern matching (404/422/503/etc. per endpoint) | ✅ |
| R6 | Pytest-style assertion failures with clear diffs, non-zero exit code on failure | ✅ |
| R7 | JSON report output (--json-report report.json) for CI artifact upload |
✅ |
| R8 | Example config against a mock escrow/GraphQL-style backend, runnable standalone | ✅ |
| R9 | CI pipeline (GitHub Actions) that installs, lints, and runs SchemaLock against its own mock server | ✅ |
pip install -e .+schemalock test --config examples/escrow_api.yaml --base-url http://127.0.0.1:8000runs against the bundled mock server and produces a correct pass/fail report.- A deliberately broken mock response (wrong status, missing envelope field, missing auth check) is caught and reported with a specific, actionable message.
- CI is green on a clean checkout.
- Phase 2 — Schema-aware checks: OpenAPI/JSON-Schema validation of full response bodies (not just envelope), GraphQL error-shape validation, response header contracts.
- Phase 3 — CI/CD packaging: Reusable GitHub Action, PR status checks, Slack/ webhook failure notifications, badge generation.
- Phase 4 — Auth matrix testing: Role-based access matrices (multiple roles × multiple routes), JWT expiry/replay/tampering checks.
- Phase 5 — Drift detection & reporting: Store historical run results, diff contract behavior across deploys/releases, HTML trend dashboard.
This project targets Drips Stellar Wave 8 (drips.network/wave/stellar). It is scoped as a standalone, reusable open-source tool (not tied to any single Wave org's private codebase) so any Wave-funded backend can adopt it as a dependency or CI step.