DOC-03 — Use cases
| Field | Value |
|---|---|
| Status | Approved |
| Version | 0.1.0 |
| Product target | MVP 0.1.0 |
| Last updated | 2026-10-16 |
1. Actors
- User: creates files and invokes the CLI.
- CI: invokes the CLI and consumes exit codes.
- Target API: receives requests and returns responses; it is untrusted.
- Operating system: provides files, environment variables, network access, and time.
2. Catalog
| ID | Use case | Requirements |
|---|---|---|
| CU-001 | Run a request | RF-001–004, RF-020–023, RF-030–032 |
| CU-002 | Run with an environment | RF-010–014 |
| CU-003 | Verify an API in CI | RF-021–023, RNF-001–002 |
| CU-004 | Diagnose invalid configuration | RF-004, RF-013, RF-023 |
| CU-005 | Use a secret without persisting it | RF-040–042, RNF-005 |
3. CU-001 — Run a request
Precondition: a valid version: 1 request file exists.
Trigger: sonvik run request.yaml.
- Sonvik loads and validates the document.
- It resolves available variables.
- It builds the request and applies a timeout.
- It sends exactly once.
- It compares the status.
- It displays a summary and exits with
0or1.
Alternatives: invalid file or method → do not send and return 2; timeout, DNS, TLS, or connection failure → return 2; unexpected status → return 1.
4. CU-002 — Run with an environment
- The user passes
--env environment.yamland optionally--var key=value. - Sonvik validates documents and arguments.
- It combines sources using defined precedence.
- It replaces every placeholder or fails before sending.
- It continues with CU-001.
Alternatives: key in multiple sources → highest precedence wins; missing variable → error 2 without traffic.
5. CU-003 — Verify in CI
- The pipeline checks out the repository and injects secrets through its environment.
- It runs the same command used locally.
- It uses the exit code to pass or fail the job.
Postcondition: Sonvik creates no account, remote state, or implicit artifact.
6. CU-004 — Diagnose invalid configuration
- Sonvik reports the file, field, and cause when available.
- It omits resolved sensitive values.
- It sends no partial traffic.
7. CU-005 — Use a secret without persisting it
- The user or CI defines an environment variable.
- The file references its name through a placeholder.
- Sonvik uses the value only during execution.
- Normal output reports the result without headers or bodies.
8. Document history
| Version | Date | Change |
|---|---|---|
| 0.1.0 | 2026-10-16 | Use cases for the first vertical |