Transactional state changes
Configured writes can use locks, invariant checks, ordered transitions, and recorded projections.
- Locks and invariant checks
- Ordered transitions
- Recorded projections
MaxQ Engine V2
This MaxQ V2 architecture concept combines transactional state changes, saved checkpoints, and permission-scoped task access.
Workflow: customer-onboarding.example Status: waiting Current step: wait.documents Wake condition: DocumentBundleUploaded Committed steps: ok start-onboarding ok emit CustomerOnboardingStarted Pending: - verify-documents - approve-or-escalate
The problem
Retries, timeouts, human approvals, and agent actions can leave systems with conflicting or incomplete state when recovery and permissions are handled separately.
Multiple systems update the same entity with no single source of truth.
Retries, waits, and long jobs create duplicate side effects.
Agents lack permission-scoped, current context and invent missing product state.
Teams cannot see what happened, why, and what is allowed next.
The engine
MaxQ combines transactional state changes, durable checkpoints, permission-scoped task context, and audit records for agent writes.
Review design checks ->Configured writes can use locks, invariant checks, ordered transitions, and recorded projections.
Configured workflows can save a checkpoint, wait for a timer, signal, or approval, and resume from saved state.
Agents receive fields and permitted actions selected for a task instead of broad database access.
Interactive concept
Click through the configuration models to compare inputs, execution state, task context, and permitted outputs.
Workflow: customer-onboarding.example
Mode: transactional state
tx.start("start-onboarding")
lock customer record
require status != "blocked"
transition onboarding.started
project CustomerAccess
result: illustrative state transitionThis concept records an event, checks configured invariants, locks the record, updates projections, and commits the next state.
Design checks
Locks, invariant checks, and ordered transitions record how configured writes change product state.
Configured work can wait on timers, signals, or human approval and resume from a saved checkpoint.
Recovery can start from saved execution state instead of rerunning the entire job.
The context model selects current fields, permissions, workflows, and recent events for a task.
const tx = await maxq.kernel.transaction("customer.onboarding");
tx.lock(Customer, customerId);
tx.require(customer.status !== "blocked");
tx.transition("onboarding.started");
tx.project(CustomerAccess);
await tx.commit();example entity schema loaded example transition map loaded example invariant set loaded example permission check complete
Where MaxQ fits
Wait for documents, verify risk, escalate when needed, and resume from a saved checkpoint.
Record transitions for subscriptions, invoices, permissions, and agent decisions.
Give agents task-specific fields and permission-gated actions instead of broad database access.
Implementation
Use transactional state changes, durable checkpoints, scoped data, permission gates, and audit replay in one runtime.