glove/tests/host
0xkite 4c49af1660
fix(control): bind degradation to authenticated outcomes and bound the control audit journal
Closes the sol-audit blockers in dd7d3f3:

HIGH - degradation could not stop the guest. create() moved
config.runtime into the protocol and then stored the moved-from config,
so the degrade path always saw an empty runtime pointer and a guest
launched by start_session outlived its vanished controller connection.
The server now shares the live runtime with the protocol (copy on
compose, one owner of teardown authority), and a Linux-gated server test
drives the real create() -> handle_frame -> broken-pipe path and proves
the guest is torn down (fails on the pre-fix ownership bug).

MEDIUM - degradation was not bound to authentication/application. The
degrade path re-decoded the raw frame to extract start_session and its
session id, granting teardown authority with no auth/schema/deadline or
application evidence; a same-UID peer could reset the socket after
submitting a valid-shaped but unauthorized frame to trigger stop() on a
named session. handle_frame now emits structured
receipt_control_outcome metadata (authenticated / applied /
response_success / method / session_id) from the real dispatch, and
degrade_failed_delivery acts only on genuinely authenticated+applied
start_session outcomes; every other outcome records only the
connection-scoped audit event. The raw frame is never re-decoded.

MEDIUM - control-audit.jsonl guarantees. jsonl_sink::record() is now
bounded by an optional max_file_bytes policy with oldest-record
truncation (newest event always attempted); gloved configures the cap
(host::control_audit_max_file_bytes, 4 MiB) with a bound test.
record_control_delivery_audit() surfaces sink write failures as
structured stderr logs instead of discarding them (receipt-chain audit
guarantees stay fatal). The derived control-audit.jsonl path is
registered in all_configured_paths() so it cannot alias the receipt
journal, audit key, session store, or any other configured path, with a
config-distinctness test.

MEDIUM - tests missed the production failure mode. The degrade test now
constructs the real server through create() and drives a real
authenticated+applied start_session over the socket; the broken-pipe
test synchronizes on an observable (runtime recorded the applied start)
before the client resets, removing the reset-vs-write race; a protocol-
level test proves wrong-secret / expired-deadline / rejected / non-start
outcomes never stop the guest; the Linux executor test asserts the
durable mark_stopping ordering survives an independent registry reopen.

LOW - unified the duplicate wire::rpc_error / response envelope in
remote_protocol.cpp with receipt_wire.hpp (ODR hazard).

Validated: clang build + CTest 80/80 local; Ghost g++14.2 build and
CTest in a follow-up artifact. No push.
2026-08-31 08:19:39 -06:00
..
config_test.cpp fix(control): bind degradation to authenticated outcomes and bound the control audit journal 2026-08-31 08:19:39 -06:00
daemon_test.cpp fix(host): recover missing runtime state 2026-07-29 17:32:44 -04:00
onboarding_cli_test.cpp feat(remote): add construction-only backend 2026-08-07 22:27:35 -04:00
onboarding_plan_test.cpp fix(onboarding): harden setup plan 2026-08-03 09:19:50 -04:00
operator_experience_test.cpp feat(host): guide managed harness setup 2026-07-29 16:15:04 -04:00
remote_backend_test.cpp feat(control): neutral guest channels, quarantine recovery, capability sealing, local-service proxy 2026-08-30 20:28:41 -06:00
runtime_policy_test.cpp fix(ci): require complete designated initializers 2026-08-14 15:27:14 -06:00