|
| 1 | +# CAS Reference Product Integration |
| 2 | + |
| 3 | +CAS Evals includes an opt-in deterministic adapter for the local |
| 4 | +`cas-reference-product` `POST /api/v1/workflows` endpoint. The existing offline |
| 5 | +evaluator remains the default and never requires a service, network access, or |
| 6 | +secrets. |
| 7 | + |
| 8 | +## Run The Golden Path |
| 9 | + |
| 10 | +Start `cas-reference-product` in local mode from its own repository: |
| 11 | + |
| 12 | +```powershell |
| 13 | +.\scripts\run-local.ps1 |
| 14 | +``` |
| 15 | + |
| 16 | +Then run both reference-product corpora from `cas-evals`: |
| 17 | + |
| 18 | +```powershell |
| 19 | +python -m cas_evals.cli benchmarks/reference-product/v0.1/golden.json ` |
| 20 | + --reference-product-url ` |
| 21 | + --output artifacts/reference-product-golden.json |
| 22 | +
|
| 23 | +python -m cas_evals.cli benchmarks/reference-product/v0.1/adversarial.json ` |
| 24 | + --reference-product-url ` |
| 25 | + --output artifacts/reference-product-adversarial.json |
| 26 | +``` |
| 27 | + |
| 28 | +Pass an explicit URL after `--reference-product-url` when the endpoint is not |
| 29 | +`http://127.0.0.1:8080/api/v1/workflows`. |
| 30 | + |
| 31 | +## Evidence Guarantees |
| 32 | + |
| 33 | +For every case, the adapter: |
| 34 | + |
| 35 | +- creates deterministic `correlationId`, `promptId`, `runId`, and W3C trace context; |
| 36 | +- requires every returned lifecycle event to preserve those values; |
| 37 | +- evaluates the actual returned `output`, not the fixture's reference response; |
| 38 | +- records the source fixture digest and returned-output digest; |
| 39 | +- removes server timestamps and endpoint-specific addresses from persisted evidence; |
| 40 | +- uses fixture-observed normalized latency so identical service output produces byte-identical evidence. |
| 41 | + |
| 42 | +The adapter fails closed for unavailable endpoints, invalid JSON, oversized |
| 43 | +responses, empty outputs, invalid response shapes, or lifecycle metadata drift. |
| 44 | +The HTTP timeout controls transport behavior but is not written into evidence. |
| 45 | + |
| 46 | +## CI Boundary |
| 47 | + |
| 48 | +CI runs the adapter contract against a local deterministic HTTP server. This |
| 49 | +proves the executable HTTP path on Windows and Linux without coupling the |
| 50 | +offline repository to another checkout or a hosted service. The full sibling |
| 51 | +repository golden path is an explicit local integration check. |
0 commit comments