d278c4b105a4682a820da7213f4b5e5980de2ce9
APOPHIS
Behavioral confidence for Fastify services.
APOPHIS checks whether route behavior holds across operations, states, and protocol flows.
Supported Node.js versions: 20.x and 22.x.
npm install apophis-fastify fastify @fastify/swagger
apophis init --preset safe-ci
apophis verify --profile quick --routes "POST /users"
Cross-Route Failure Example
Add one behavioral contract next to a route schema. APOPHIS can verify cross-route behavior, such as whether a resource created by one route is retrievable through another.
Route:
app.post('/users', {
schema: {
'x-category': 'constructor',
'x-ensures': [
// BEHAVIORAL: Creating a user must make it retrievable
'response_code(GET /users/{response_body(this).id}) == 200'
]
}
}, async (request, reply) => {
const { name } = request.body;
const id = `usr-${Date.now()}`;
reply.status(201);
return { id, name };
});
APOPHIS output:
Contract violation
POST /users
Profile: quick
Seed: 42
Expected
response_code(GET /users/{response_body(this).id}) == 200
Observed
GET /users/usr-123 returned 404
Why this matters
The resource created by POST /users is not retrievable.
Replay
apophis replay --artifact reports/apophis/failure-2026-04-28T12-30-22Z.json
Next
Check the create/read consistency for POST /users and GET /users/{id}.
JSON Schema cannot express this relationship. APOPHIS turns it into an executable check.
Three Modes
| Mode | Purpose | Default Environments |
|---|---|---|
verify |
Deterministic CI and local contract verification | local, test, CI |
observe |
Runtime visibility and drift detection without blocking | staging, prod |
qualify |
Exercise scenarios, stateful flows, and configured chaos checks before release | local, test, staging |
Quickstart: 3 Commands
# 1. Install
npm install apophis-fastify fastify @fastify/swagger
# 2. Scaffold
apophis init --preset safe-ci
# 3. Verify
apophis verify --profile quick --routes "POST /users"
See docs/getting-started.md for the full walkthrough.
Trust and Safety
- Deterministic replay: Every failure includes a seed and a one-command replay.
- CI-safe default path:
verifyis deterministic and safe for CI pipelines. - Production-safe observe path:
observeis non-blocking by default. Blocking behavior requires explicit break-glass policy. - Qualify path gated away from prod:
qualifyis blocked in production by default. - Explicit environment boundaries: Config rejects unknown keys and unsafe environment mixes.
LLM-Safe
APOPHIS gives coding agents a constrained, repeatable way to encode and verify behavior:
- Official scaffolds (
safe-ci,llm-safe,platform-observe,protocol-lab) apophis doctorchecks for missing dependencies, malformed config, and unsafe modes- CI policy guards catch unknown keys, unsafe environments, and missing seeds
- Generated code follows the same pattern in every repo
See docs/llm-safe-adoption.md for templates and CI policy.
Full Documentation
- Getting Started — First route, first verify run, first replay
- CLI Reference — All 7 commands, global flags, exit codes
- Verify Mode — Deterministic contract verification
- Observe Mode — Runtime visibility and drift detection
- Qualify Mode — Scenarios, stateful testing, chaos
- Performance — Repeatable benchmarks and CPU profiling
- LLM-Safe Adoption — Scaffolds and CI guards
- Protocol Extensions — JWT, X.509, SPIFFE, WIMSE
License
ISC
Description
Languages
TypeScript
98.2%
JavaScript
1.8%