Files
mtusi2026lab6/student-tests/ACCOUNT-HTTP-CASES.md

30 lines
2.9 KiB
Markdown

# Native account HTTP capture cases
The production provisioner uses a separate HTTP factory with mandatory request/capture ports. Tests invoke this actual factory with explicit fakes; they never invoke the live entrypoint. The legacy extraction retains parse-before-capture until RED is reproduced; the following implementation changes only the capture boundary.
| Situation | Example | Expected observable behavior | Level |
|---|---|---|---|
| Invalid JSON after accepted POST | 200 with a partial one-time token JSON | Raw bytes captured before decoding fails; no retry | Factory with explicit ports |
| Body read error | One token-prefix chunk then a reader error | Available partial bytes and uncertain outcome captured, one request | Factory with explicit ports |
| Response cap | Six available bytes with four-byte cap | First four bytes captured with size-exceeded outcome, no unbounded buffer | Factory with explicit ports |
| Network uncertainty | Request rejects before response | Empty response capture with null status and network-uncertain outcome, no retry | Factory with explicit ports |
| Valid response | 200 with known synthetic token | Raw capture exists before parsed token is returned | Factory with explicit ports |
The preliminary extraction probe is not a native account-creation incident. Raw wire responses stay in exclusive0600 files under an already claimed private0700 operation directory. Metadata is secondary to raw capture; error reporting preserves the primary uncertainty if capture fails. Never automatically repeat an uncertain account POST.
## Bootstrap continuation cases (recorded before the correction)
The production caller now invokes `createAccountBootstrap` with all ports required. Legacy RED is8 failures/1 positive control; corrected workflow9 tests/24 expectations. Combined HTTP/workflow suite14 tests/46 expectations. The immutable legacy source and RED output remain evidence, not active imports.
| Bootstrap state | Expected observation |
|---|---|
| Ingest received, query create fails | Ingest checkpoint already present; no derived publication |
| One checkpoint survives | Resume does not repeat that account POST |
| Intent plus valid captured native response | Recover token and reverify without repeating POST |
| Intent without recoverable response | Fail closed; zero automatic POST retries |
| Saved token search401, ingest503, admin401 | Reject startup before derived credentials/successful continuation |
| Healthy first bootstrap | Persist ingest before query create; publish only after both verified |
| Healthy saved pair | Reverify both, zero account create calls |
The first native verification performs owned identity_probe ingestion before its exact-event search, so no preexisting application stream is required. The current native existing-pair readback proves the production wiring; fresh-volume runtime remains a separate final acceptance gate.