Skip to main content

Testing

Stemix IDP uses a three-layer testing architecture that keeps intent, proof, and implementation cleanly separated. This section documents how testing works, how to run tests, and how to build a new compliant implementation.

Three-layer architecture​

LayerWhat it isWhere it lives
Layer 1 — Intent specsGherkin .feature files that declare what the platform must do, in plain languagetests/features/
Layer 2 — Contract harnessTypeScript test runner that proves implementations satisfy the intent specs via HTTPtests/src/
Layer 3 — ImplementationsLanguage and framework stacks that must pass all declared profilesstacks/

The .feature files are the ground truth. The TypeScript harness is derived from them. When they disagree, the .feature file wins.

See ADR-0009 for the rationale behind using Gherkin as the Layer 1 format.

Conformance profiles​

Tests are grouped into conformance profiles. Each profile covers a bounded area of expected behavior. A stack declares which profiles it must pass in its stack.json.

ProfileRequired byTestsDescription
coreAll stacks5Baseline HTTP surface: reachability, content-type, and field presence
operationalTier 1 stacks5Runtime conventions and exact semantic values
status-profileStatus-capable stacks (opt-in)3API-first IDP status checks for the shared portal summary contract
ui-profileUI stacks (opt-in)5Observable HTML output plus rendered status UI behavior
mcp-profileMCP servers (opt-in)4MCP initialize, tool discovery, and tool invocation
auth-profileAuth-capable stacks (opt-in)5OAuth 2.0 auth endpoint contract: 401 unauthenticated, login redirect, callback round-trip, 200 authenticated, logout

The flow insight Layer 1 intent scenarios live in flow/intent-scenarios. They are not yet a conformance profile; the Layer 2 harness will follow once the canonical model stabilizes.

Guides​

DocumentAudienceDescription
Contract Test HarnessImplementers, contributorsHow the harness works, how to run it, and how to build a new compliant implementation
Core ProfileImplementersBaseline scenarios every stack must pass
Operational ProfileImplementersSemantic correctness scenarios for Tier 1 stacks
Status ProfileImplementers, operatorsAPI-first status contract for IDP-owned components
UI ProfileImplementersOpt-in UI behavior scenarios
Auth ProfileImplementersOpt-in OAuth 2.0 auth endpoint scenarios