PATTERN Cited by 1 source
SCM workflow state machine¶
Definition¶
An SCM workflow state machine is a pattern where source-control
operations (branch creation, PR preparation, CI validation, merge)
are modeled as a finite set of states with blocking gates between
them, each transition driven by a CLI command that validates
preconditions before performing work. The state is persisted in a
schema-validated file (e.g., .lakebase/workflow-state.json) that
serves as the single source of truth for both human and agent actors.
The pattern ensures that agents and humans follow identical paths through the development lifecycle, with the substrate refusing transitions that violate declared invariants (wrong parent tier, CI not green, migration not applied).
Mechanics¶
- Define states as a linear sequence with explicit gates
- Each gate has documented preconditions and postconditions
- Transitions are CLI-driven — no ad-hoc API calls bypass the gate
- State is written to a schema-validated artifact after each transition
- Failed gates leave the machine at the prior state (recoverable, not corrupted)
- Structural decisions (tier hierarchy, promotion path) are declared once and honored by the substrate
Anti-pattern¶
Treating an agent as a "senior engineer in a chat window" — dumping context and asking for output. This breaks at team scale because the context cannot be reviewed, governed, or replayed. The state machine ensures every action is auditable and constrained.
Seen in¶
- systems/lakebase-app-dev-kit — ships a five-state SCM machine (
scaffold-complete → feature-claimed → pr-ready → ci-green → merged) (Source: sources/2026-06-12-databricks-enabling-evolutionary-database-development-database-branchin-part3)