Skip to main content

Module diagnostics

Module diagnostics 

Source
Expand description

Diagnostics-bundle capability (09-05, EXT-02; 09-07 Invalid capture) — the support-bundle slice of GET/POST /data/api/v1/diagnostics/bundle/*, wire-shaped STRICTLY from the live captures (09-LIVE-CAPTURES §5 — the Pitfall-2 capture: observed, never guessed).

The state vocabulary is capture-locked — THREE states observed across the 09-02 rigs and the 2026-09-07 UAT (09-UAT.md Gap 3): Generating (mid-generation, both rigs), Valid (terminal/ready, both rigs), and Invalid (TERMINAL steady state — the gateway’s steady-state “no current bundle” answer). PascalCase throughout; lowercase guesses would have shipped wrong. Invalid’s provenance (8.3.6 rig ign-p9-836, 2026-09-07): a Valid bundle decays to Invalid within ~2 minutes UNPROMPTED under passive status-only polling (TTL-probe evidence: Valid at min 4-5, Invalid at min 6) and STAYS Invalid — only a fresh generate changes it, so the wait action exits immediately on it (BUNDLE_UNAVAILABLE_STATES, exit 6 bundle_not_available). Any string OUTSIDE the captured set is UNKNOWN: it rides passthrough, never refuses, and is treated as NOT terminal by the wait action (honest unknowns — keep polling to the deadline).

Gateway-side wire quirk (observation, NOT behavior): during the same UAT the one Valid bundle reported fileSize 64708 on one poll and 73889 on others — the bundle file appears non-static while Valid. The CLI reports the value faithfully at every hop; this is recorded as a gateway-side fact only, encoded nowhere as behavior.

fileSize units (Decisions 2): ABSENT while generating (not null, not 0 — the key is missing), present integer bytes when Valid, equal to the download’s Content-Length exactly.

Structs§

BundleStatusWire
One bundle status body (POST …/generate’s 200 answer IS the same shape — live capture: {"state":"Generating"}). state is a String BY DECISION (Pitfall 2: never an enum from guessed values — an unobserved future state must ride, never refuse the parse).

Constants§

BUNDLE_CAPTURED_STATES
The full CAPTURED state vocabulary — every state the rigs ever answered (09-LIVE-CAPTURES §5 + the 2026-09-07 UAT, 09-UAT.md Gap 3). A string OUTSIDE this set is UNKNOWN: the wait action keeps polling (honest unknowns — a state the captures never saw must not be declared terminal). Unobserved members still round-trip through the wire model’s passthrough (version tolerance).
BUNDLE_DOWNLOAD_TIMEOUT
Per-request timeout override for the bundle download (Pitfall 8): the 30 s client default would TRUNCATE MB-sized bundles mid-stream. Same class as the logs-download 120 s / project-export 120 s / gwbk 300 s overrides — this ride goes through download_to_file’s RequestBuilder::timeout, never a second client. Pinned at 300 s by the unit test below (the REQUIRED deterministic timeout-override check lives here, where the constant is born).
BUNDLE_GENERATING_STATES
The states that mean “still generating” — EXACTLY the captured mid-generation strings, one member on the captured evidence (09-LIVE-CAPTURES §5 Decisions 1). Case-SENSITIVE membership: the gateway owns the vocabulary (PascalCase); this CLI never guesses.
BUNDLE_UNAVAILABLE_STATES
The captured states meaning “no bundle is available” — TERMINAL steady states the wait action refuses on IMMEDIATELY (exit 6, bundle_not_available): only a fresh generate changes them, polling cannot. Case-SENSITIVE membership, same shape as is_generating. A subset of BUNDLE_CAPTURED_STATES by construction (unit-pinned below).
DIAGNOSTICS_DOWNLOAD_PATH
GET path of the bundle download (a ZIP, streamed).
DIAGNOSTICS_GENERATE_PATH
POST path that starts bundle generation (no body).
DIAGNOSTICS_STATUS_PATH
GET path of the bundle status poll.

Functions§

is_bundle_unavailable
true when state is in the CAPTURED unavailable set — a case-sensitive exact match (BUNDLE_UNAVAILABLE_STATES membership). Unknown states are deliberately NOT unavailable (they are not anything we have seen).
is_generating
true when state is in the CAPTURED generating set — a case-sensitive exact match (BUNDLE_GENERATING_STATES membership). Unknown states are deliberately NOT generating (they are not anything we have seen).