Lifecycle Specification Guide
Every Workstream OS object that participates in a lifecycle must define its state machine in a YAML file inside this directory. The goal is to make the rules machine-readable so that CLI commands, validators, and status-check tools can rely on the exact same definition.
Each lifecycle file should answer these questions:
Canonical exam: Lifecycle state machine rubric β enumerate (n(n-1)) edges, prune to valid; class roles vs kind tokens; catalyst / preconditions / postconditions / shockwave / similarity. Start with policy membranes even when policy occupancy is thin.
Shockwave catalog: Invariants for cascading transitions and dependent lifecycle shockwaves across parent/child object relations.
-
What are the valid statuses?
Include display labels,role(class), whether the status is origin, terminal (ending), archive, or system-only/error. For each: catalyst, hold preconditions, postconditions of hops that enter it. -
What transitions are allowed?
Prune from the complete directed graph. For every kept edge: origin, destination, manual and/or automatic, qualifyingpreconditions, hold-after-hoppostconditions, shockwave (on_dependent_status/ side_effects). -
What preconditions exist for originating the object?
If an object cannot be created unless certain references exist, capture it in the lifecycle file or itsmetadatasection. -
What is the initial / origin status?
Explicitly mark one status withorigin: true(andinitial: truewhere used). -
What are the ending statuses?
Mark any terminal states withterminal: true. -
What status represents archival?
Either setarchive: trueon a status or document it inside the metadata block. Many lifecycles allow* β archived. -
What status represents an error / halt?
Systemerror(system: true) vs kindhalted(paused/blocked). Halt resume must not launder a check valve (see rubric). Not every kind should copy priority_plan'shalted β shovel_readyrule.
YAML Structure
object_type: backlog_item
metadata:
description: >
High-level explanation of the lifecycle and any originating preconditions.
originating_preconditions:
- "Link to at least one goal (optional)"
archive_status: archived
error_status: error
statuses:
- value: exploring
display: "Exploring"
initial: true
- value: validated
display: "Validated"
- value: roadmap
display: "Roadmap"
- value: in_progress
display: "In Progress"
- value: complete
display: "Complete"
terminal: true
- value: archived
display: "Archived"
archive: true
terminal: true
- value: error
display: "Error"
system: true
transitions:
- from: exploring
to: validated
manual: true
description: "Idea reviewed and ready for deeper planning"
- from: roadmap
to: in_progress
manual: true
preconditions:
- "At least one milestone_ref"
- "Owner assigned"
Additional sections (e.g., percent_complete, auto_transition_rules) are
optional but encouraged.
Error Handling Pattern
When the CLI detects an illegal transition or a lifecycle incoherency it should:
- Move the object to the lifecycleβs
error_status. -
Emit a structured error using a shared template
(e.g.,LIFECYCLE_INVALID_TRANSITION,LIFECYCLE_STATE_UNKNOWN). -
Surface the error differently depending on context: - View mode: Detailed explanation plus remediation guidance. - List mode: Concise summary with the error code.
- Increment telemetry counters per error code so we can track trends and feed
them into
status-checkor future health dashboards.
Capturing lifecycles in a single, consistent format unlocks:
- Uniform validation across CLI, MCP server, and automation agents.
status-checkcommands for every object type with shared heuristics.- Future top-level
workstream-os status-checkruns that aggregate findings.
When authoring a new lifecycle file, copy the template above and fill in the
object-specific details. Keep the information in sync with the documentation in
docs/architecture/LIFECYCLE_DEFINITIONS_EXPLAINED.md.