Skip to content

State Machine

Mentu enforces a strict state machine for both of its core objects. Every transition is triggered by a specific operation and recorded as an immutable entry in the ledger. There are no ad-hoc status changes — only valid operations applied to valid states.

A commitment has five possible states.

StateMeaning
openCreated but not yet claimed by anyone. Available for pickup.
claimedAn actor has taken ownership. Work is in progress.
in_reviewWork submitted for review. Waiting for approval or rejection.
closedCompleted with evidence. Terminal state (unless reopened).
reopenedPreviously closed, then determined to be incomplete or incorrect.
stateDiagram-v2
[*] --> open : commit
open --> claimed : claim
claimed --> open : release
claimed --> in_review : submit
claimed --> closed : close (direct)
in_review --> closed : approve
in_review --> reopened : reopen
reopened --> claimed : claim
closed --> reopened : reopen

Each row describes one valid state transition.

FromToOperationWho Can Do ItNotes
(none)opencommitAny actorRequires source (memory ID). Creates the commitment.
openclaimedclaimAny actorSignals ownership. Only one active claim at a time.
claimedopenreleaseClaimantGives up ownership. Commitment returns to the pool.
claimedin_reviewsubmitClaimantSends work for review. Enters the accountability airlock.
claimedclosedcloseClaimantDirect closure with evidence. Bypasses review (Tier 1).
in_reviewclosedapproveReviewerReviewer accepts the submission. Evidence is sealed.
in_reviewreopenedreopenReviewerReviewer rejects the submission. Needs more work.
closedreopenedreopenAny actorDetermined incomplete after the fact. Rare but valid.
reopenedclaimedclaimAny actorSomeone picks it back up to address the issues.

Invalid transitions are rejected by the API. For example, you cannot close a commitment that is in the open state — it must be claimed first (or go through in_review).

A memory has four possible states.

StateMeaning
untriagedFreshly captured. No decision has been made about it.
linkedAssociated with an existing commitment as additional context.
committedPromoted into a new commitment (via commit with this memory as source).
dismissedExplicitly decided to not act on. Remains in the ledger for the record.
stateDiagram-v2
[*] --> untriaged : capture
untriaged --> committed : commit (as source)
untriaged --> linked : link
untriaged --> dismissed : dismiss
linked --> committed : commit (as source)
dismissed --> committed : commit (as source)
FromToOperationNotes
(none)untriagedcaptureCreates the memory.
untriagedcommittedcommitMemory used as source for a new commitment.
untriagedlinkedlinkMemory attached to an existing commitment as context.
untriageddismisseddismissExplicitly triaged as “no action needed.”
linkedcommittedcommitA linked memory can still become the source for a new commitment.
dismissedcommittedcommitA dismissed memory can be reconsidered. The dismiss and commit are both in the log.

Note that committed is a terminal state for memories — once a memory has been promoted to a commitment, it cannot be further transitioned. The linked and dismissed states are soft — they can still be promoted to committed if circumstances change.

States fall into three categories that help you understand what needs attention.

States where work is happening or expected.

  • Commitment: open, claimed, reopened
  • Memory: untriaged

These are the states you monitor. Open commitments need someone to claim them. Claimed commitments are in progress. Reopened commitments need to be re-claimed. Untriaged memories need a decision.

States that require a decision from a specific actor.

  • Commitment: in_review — a reviewer must approve or reopen
  • Memory: untriaged — someone must commit, link, or dismiss

States where no further transitions are expected (though reopening is possible).

  • Commitment: closed
  • Memory: committed, linked, dismissed

The in_review state is Mentu’s mechanism for ensuring that closure is legitimate. It is called the accountability airlock because it creates a buffer zone between “I say I’m done” and “the record says I’m done.”

The flow through the airlock:

claimed → submit → in_review → approve → closed
→ reopen → reopened

When a claimant submits their work, the commitment enters in_review. At this point, the claimant cannot close it themselves. A separate actor (the reviewer) must either:

  • Approve — accepting the evidence and moving to closed
  • Reopen — rejecting the submission and sending it back for more work

This separation of concerns prevents the person doing the work from also being the person certifying the work. The airlock is especially valuable in agent workflows, where an AI agent does the work and a human (or a different agent) validates the output.

Not every commitment needs formal review. The close operation (as opposed to submit + approve) allows direct closure from the claimed state:

claimed → close(evidence[]) → closed

This is appropriate for low-risk work, self-evident completions, or contexts where the overhead of formal review is not justified. The evidence requirement still applies — you must provide proof even when bypassing the airlock.

Mentu supports three tiers of review, allowing you to match the review overhead to the risk level.

The claimant closes directly. No reviewer involved. Evidence is still required and permanently recorded, but no second actor validates it.

mentu_close({
"commitment": "cmt_abc123",
"evidence": [
{ "type": "link", "value": "https://github.com/acme/app/pull/42" }
]
})

Use for: routine work, low-risk changes, automated pipeline steps.

The claimant submits. A reviewer approves or reopens asynchronously — no blocking wait.

// Claimant submits
mentu_submit({
"commitment": "cmt_abc123",
"evidence": [
{ "type": "link", "value": "https://github.com/acme/app/pull/99" },
{ "type": "text", "value": "Migration tested on staging. Zero downtime." }
]
})
// Later, reviewer approves
mentu_approve({
"commitment": "cmt_abc123"
})

Use for: standard development work, changes that benefit from a second pair of eyes.

The claimant submits. Work is blocked until a reviewer approves. The in_review state acts as a hard gate — nothing downstream proceeds until the reviewer acts.

The API mechanics are the same as Tier 2 (submit + approve/reopen), but the workflow is configured so that downstream operations depend on the commitment being closed. This makes the review a blocking gate rather than an async check.

Use for: production deployments, security-sensitive changes, compliance-critical work.

All 12 operations and the objects they act on:

OperationTargetEffect
captureCreates MemoryNew memory in untriaged state
commitCreates Commitment + transitions MemoryNew commitment in open state, source memory to committed
claimCommitmentopen or reopened to claimed
releaseCommitmentclaimed to open
submitCommitmentclaimed to in_review
approveCommitmentin_review to closed
reopenCommitmentin_review or closed to reopened
closeCommitmentclaimed to closed (direct, with evidence)
annotateMemory or CommitmentAdds a note. No state change.
linkMemoryuntriaged to linked (associates with existing commitment)
dismissMemoryuntriaged to dismissed
triageMemoryBulk operation for processing untriaged memories

Each operation is recorded as an immutable operation envelope in the ledger, with the actor, timestamp, target, and payload preserved forever.