api: grow a lib, so an outage can be tested instead of only observed #27

Merged
PerishFire merged 1 commit from api-lib into main 2026-07-21 15:46:13 +00:00
Owner
No description provided.
api: grow a lib, so an outage can be tested instead of only observed
All checks were successful
guard / guard (pull_request) Successful in 3m43s
e822b9627b
#25 split "the database errored" from "there is no such row" across
eleven reads, and nothing pinned it. The act harness cannot reach that
contract: it speaks HTTP to a live server, has no postgres client, and
this box has no psql, so the only proof was a manual docker restart.

api was a bin-only crate, so tests/ could not reach Booth either — and
negentropy grants test syntax to crates/*/tests/**/*.rs alone, which is
the right rule. A lib target satisfies both: the crate is publish = false,
so its public surface is internal to the repo, and the test exercises it
as a consumer rather than reaching into it.

main.rs keeps four lines and calls sail(). Booth gains new() so its fields
stay pub(crate); birth, shield and verify become pub because the test
drives those three ceremonies and no others.

tests/probe.rs wraps Sqlite in a Wire that starts sound and dies on
command. outage asserts a valid password answers 500 during the failure
and succeeds once it lifts, with a wrong password refused throughout;
refused pins the control cases. It reuses shape/hail/seed from the real
bootstrap rather than copying grant seeding, so it cannot drift from the
product. Proved red against the old folding: left Err(401), right Err(500).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PerishFire deleted branch api-lib 2026-07-21 15:46:13 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
PerishLab/ensign!27
No description provided.