CRUMB a card from devarno-cloud

Five Unit Types & Nine-State Lifecycle

grace intermediate 6 min read

ELI5

Every STRATT unit is one of five Lego brick shapes — a who (role), a must/must-not (rule), a do-this (task), a recipe (chain), or a reusable part (supply). Each brick walks through nine boxes from sketch to grave; once a brick is in a stricter box, it can only move to a stricter one.

Technical Deep Dive

Source: packages/schema/src/types/{role,rule,task,chain,supply}.ts, packages/schema/src/lifecycle.ts, packages/schema/src/constants.ts.

The Five Unit Types

TypeBody FieldForbids composition
rolepersona (lens, tone, behaviour, output_format)yes
rulerule_block (polarity: always|never, statement, scope)yes
taskprompt_body + contract + councilno (allowed)
chaincomposition + contract + councilno (required)
supplysupply_body (string)yes

Lifecycle States & Restriction Hierarchy

tampered is an error state, not part of the linear pipeline. CRDT merge picks the lower priority number (more restrictive).

PriorityState
-1tampered
0tombstoned
1archived
2deprecated
3published
4active
5approved
6review
7draft

State Machine

stateDiagram-v2
[*] --> draft
draft --> review
review --> draft
review --> approved : gate
approved --> review
approved --> published : gate
published --> active
published --> deprecated : gate
published --> published : patch/minor/major
active --> deprecated : gate
active --> active
deprecated --> published
deprecated --> archived
deprecated --> tombstoned : gate
archived --> deprecated
archived --> tombstoned : gate
tampered --> draft
tombstoned --> [*]

Schema Class View

classDiagram
class BaseUnit {
+URI id
+string domain
+string slug
+semver version
+Fingerprint fingerprint
+LifecycleStatus status
+Import[] imports
+Meta meta
}
class Role { +Persona persona }
class Rule { +RuleBlock rule_block }
class Task { +Contract contract; +Composition? prompt_body; +string council }
class Chain { +Contract contract; +Composition composition; +string council }
class Supply { +string supply_body }
BaseUnit <|-- Role
BaseUnit <|-- Rule
BaseUnit <|-- Task
BaseUnit <|-- Chain
BaseUnit <|-- Supply

Key Terms

  • Restriction hierarchy → CRDT-merge precedence; the more restrictive status (lower number) wins.
  • Gate-required transitionreview→approved, published→deprecated, active→deprecated, deprecated→tombstoned, archived→tombstoned.
  • Tampered → Fingerprint mismatch; only valid forward transition is back to draft.

Q&A

Q: Which two unit types forbid a composition block? A: role, rule, and supply all forbid it (three, not two — composition is exclusive to task and chain). Source: validate.ts lines 97–104.

Q: Why does CRDT pick the more restrictive status? A: Safety. If two replicas disagree on whether a unit is published or deprecated, the deprecated wins so production never accidentally re-promotes a unit someone marked for removal.

Q: Can a tombstoned unit be revived? A: No. It is terminal. Lifecycle table has no outbound transitions from tombstoned.

Examples

A reviewer flags stratt://dev/task/boot-review@1.2.0 as obsolete:

  1. active → deprecated — gate authority LEWIS-06 must approve (Pathfinder gate).
  2. After 90-day grace window, deprecated → tombstoned — gate again.
  3. Any chain importing the deprecated unit raises FM-07 as soon as the chain is bumped to a non-deprecated version range.

neighbors on the map