Skip to main content

gwk_domain/
lib.rs

1//! The GridWork contract: shared domain types, event definitions, and state machines.
2//!
3//! Everything the kernel, clients, and adapters agree on lives here. The TypeScript
4//! contract consumed by external tooling is generated from these types and CI-checked
5//! against the committed artifact.
6
7pub mod blob;
8pub mod checkpoint;
9pub mod command;
10pub mod contract_sql;
11pub mod entity;
12pub mod envelope;
13pub mod fsm;
14pub mod ids;
15pub mod ingestion;
16pub mod inherited;
17pub mod port;
18pub mod protocol;
19pub mod transition;
20
21pub use blob::{
22    BLOB_ADDRESS_SCHEME, BLOB_CHUNK_BYTES, BlobAddress, BlobAddressError, BlobDescriptor,
23    SHA256_HEX_LEN, is_sha256_hex,
24};
25pub use checkpoint::{
26    CHECKPOINT_EVENT_INTERVAL, CHECKPOINT_INTERVAL_SECS, CHECKPOINT_SCHEMA_VERSION, Checkpoint,
27};
28pub use command::{CommandDecodeError, KernelCommand};
29pub use entity::{
30    Attempt, AttentionItem, AuthorityGrant, Budget, Command, DISPATCH_NODE_INITIAL_STATE,
31    DispatchNode, EngineSession, Evidence, Gate, IngestedRecord, Lease, Message, Receipt, Task,
32    Worktree,
33};
34pub use envelope::{
35    Actor, CommandEnvelope, ENVELOPE_SCHEMA_VERSION, EventEnvelope, INLINE_PAYLOAD_MAX_BYTES,
36    Origin, PayloadRef, UnknownSchemaVersion, accept_schema_version,
37};
38pub use fsm::{
39    AttemptState, CommandState, GateVerdict, LeaseMode, LeaseState, MessageState, Outcome,
40    StateMachine, TaskState,
41};
42pub use ids::{
43    AggregateId, AttemptId, AttentionItemId, AuthorityGrantId, BlobUploadId, ByteCount, CommandId,
44    CorrelationId, CostMicros, DispatchNodeId, EngineId, EngineSessionId, EventCount, EventId,
45    EvidenceId, FenceToken, GateId, IdempotencyKey, IngestedRecordId, LeaseId, MessageId,
46    ProjectId, ReceiptId, RequestId, Seq, TaskId, Timestamp, WorktreeId, WriterEpoch,
47};
48pub use ingestion::IngestionKind;
49pub use inherited::{
50    BudgetCursor, FindingAction, LeaseSnapshot, OpenAttemptRef, OrchestratorCheckpoint,
51    PendingApproval, RoundFindingSummary,
52};
53pub use protocol::{
54    CAPABILITY_NAME_MAX_BYTES, CONNECTION_EGRESS_BYTES_PER_WINDOW,
55    CONNECTION_INGRESS_BYTES_PER_WINDOW, CONTRACT_VERSION, CapabilityName, CapabilityNameError,
56    ClientControl, FRAME_BODY_MAX_BYTES, FRAME_BODY_MIN_BYTES, FRAME_KIND_RESERVED_STREAM,
57    FRAME_LENGTH_PREFIX_BYTES, FrameKind, HELLO_DEADLINE_SECS, HELLO_MAX_BYTES, KernelErrorCode,
58    KernelRequest, KernelResult, MAX_CAPABILITIES, PROTOCOL_MINOR, ProjectionKind,
59    ProjectionRecord, ProtocolVersion, SLOW_CONSUMER_TIMEOUT_SECS, ServerControl,
60};
61pub use transition::{
62    Cursor, GuardCtx, GuardViolation, LIVENESS_PRODUCER_KIND, TransitionGuard, TransitionRequest,
63    TransitionResult, apply,
64};