Files
praxisandClaude Fable 5.2 8e02dccb86 In-client stack: transport, session lifecycle and engine bridge
175 files, from working commit b1a079a.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 01:32:48 +02:00

82 lines
4.1 KiB
C

#pragma once
#include <stdint.h>
/* Owned laboratory account control, not a Forever engine account structure.
* Paths are private inputs; passwords and SRP keys never enter this mailbox.
* state: 0 idle, 1 authenticating, 2 prepared, 3 failed, 4 closed, 5 select realm.
* Publish configuration before command3 at the verified frame safepoint.
*/
struct gw_wire_auth_control {
uint32_t abi,size;
volatile int32_t command,state,error,thread,auth_result,discovery_result,
realm_count,selected_index,transport_result,elapsed_ms,cancel,
server_proof_verified,transport_prepared;
uint32_t auth_port,retention_ms;
char username[128],password_path[512],version_hash_path[512],addon_path[512];
};
_Static_assert(sizeof(struct gw_wire_auth_control)==1732,"Owned account ABI changed");
/* Separate one-shot memory input; never append secrets to the old control ABI.
* Only the first32 bytes are public diagnostics. The remaining100 bytes must
* never be read by diagnostic/logging code or persisted to a file.
* Producer: while account is idle, copy an ASCII account(1..32) and password
* (1..64), terminate username, set a strictly increasing nonzero generation,
* then publish state1 LAST before the existing frame command3. password_path
* must be empty. Never overwrite a published/scheduled/active submission.
* State:0 empty,1 published,2 scheduled,3 consumed/wiped,-1 rejected/wiped.
* Worker copies to its own stack before wiping the mailbox; it wipes that
* stack immediately after the synchronous real SRP dispatch. No async borrowed
* pointer or credential file is used. UINT32_MAX generation requires reload.
*/
struct gw_wire_auth_credentials {
uint32_t abi,size;
volatile int32_t state;
uint32_t generation,username_bytes,password_bytes,consumed_generation,reserved;
char username[33];
uint8_t password[64],padding[3];
};
_Static_assert(sizeof(struct gw_wire_auth_credentials)==132,"Owned credential ABI changed");
/* Explicit public destination input, separate from both old account ABIs.
* kind0 is the unchanged loopback profile and requires a zero address array.
* kind1 opts into a canonical numeric unicast IPv4 address; no DNS is performed.
* Configure only while idle. start() validates and freezes a private copy for
* the worker/realm lifecycle; changing this input cannot redirect that session.
*/
struct gw_wire_endpoint_profile {
uint32_t abi,size,kind,reserved;
char auth_ipv4[16];
};
_Static_assert(sizeof(struct gw_wire_endpoint_profile)==32,"Owned endpoint profile ABI changed");
/* Engine connection lease, separate from credentials/opaque channel. An attach
* succeeds only after genuine SRP/M2 AND accepted world authentication. Main
* frame/real pipe activity renews it; disconnect/cancellation drops it. */
struct gw_wire_session_lease {
uint32_t abi,size;
volatile int32_t attached,heartbeats;
volatile uint64_t last_heartbeat_ms;
volatile int32_t released,reserved;
};
_Static_assert(sizeof(struct gw_wire_session_lease)==32,"Owned session lease ABI changed");
/* Read-only Source login/realm view for an additive owned Glue provider.
* This deliberately excludes all credential/user/path fields from auth_control.
* Source state is reported as Source state, never as native C_Login success. */
struct gw_wire_account_ui_state {
uint32_t abi,size,generation,endpoint_kind;
int32_t state,error,auth_result,discovery_result,server_proof_verified,
realm_count,selected_index,transport_prepared,cancel;
uint32_t auth_port,copied_realms;
int32_t genuine_discovery;
};
_Static_assert(sizeof(struct gw_wire_account_ui_state)==64,"Source realm UI view ABI changed");
/* Owned UI intent only. request packs generation:32 | (Source index+1):32.
* The supervisor validates this proposal through its existing genuine-realm
* contract before it publishes any selected_index to the account worker. */
struct gw_wire_account_ui_control {
uint32_t abi,size;
volatile uint64_t request;
volatile int32_t state,error,enabled,reserved;
};
_Static_assert(sizeof(struct gw_wire_account_ui_control)==32,"Source realm UI proposal ABI changed");