Skip to content

Own native HTTP deadlines, interruption, and private response bytes - #253

Merged
relh merged 2 commits into
masterfrom
relh/native-http-lifecycle
Oct 3, 2026
Merged

relh merged 2 commits into
masterfrom
relh/native-http-lifecycle

Conversation

@relh

@relh relh commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Native Coworld requests must preserve received bytes and finish owned cleanup before an interrupted engine seals its private episode. Curly streaming calls reset timeout behavior after initial data and hide some interrupted response bytes.

This adds synchronous libcurl transport with one absolute monotonic deadline, typed completion/deadline/interruption/failure results, exact header/body bytes, and actual transfer/status/latency evidence. SIGTERM/SIGINT and owned cleanup share an allocation-free irreversible stop flag. The game still owns provider parsing, identity validation, action acceptance, and private trajectory sealing.

Private attempt records add nullable response_body_b64, response_headers_b64, response_complete, and http_status. Strict wire readers validate canonical base64 and raw-response byte equality. Existing shipped evidence without these new fields stays explicitly unobserved; current writers emit all four. Scripted teacher fixtures carry no serving metadata.

Validation: remote Zephyrus, pinned Nim 2.2.4, bounded 2 CPU/2 GiB/180-second owned unit. Fourteen trajectory tests passed. Six real credential-free HTTP fixtures passed: complete binary body, empty 200, incomplete UTF8 body, headers without body, no received response, and SIGTERM during an owned request. Reusing an expired deadline or stopped process starts no second request. CI runs these fixtures with libcurl development headers.

Proof: /tmp/coworld-bitworld-native-http on Zephyrus, unit coworld-bitworld-native-http-cpu-v5 inactive/exit 0; native-http.log, trajectory.log, build-probe.log preserved. Earlier failing compiler and transport iterations remain archived.

This is a shared transport boundary. Game integration, interrupted episode sealing, authenticated model receipts, and production deployment remain separate required gates. No provider calls, releases, physics changes, or public replay metadata are included.

relh and others added 2 commits October 2, 2026 23:48
@relh
relh merged commit 0815c71 into master Oct 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant