Work Units (WUs)
A Work Unit (WU) is a small, well-defined piece of work with clear acceptance criteria and proof of completion.
Why WUs?
Section titled “Why WUs?”Traditional tickets are:
- Vague (“Fix the login bug”)
- Unbounded (no clear definition of done)
- Trust-based (marked done without proof)
WUs are:
- Specific (“Add email validation to login form”)
- Bounded (completable in a single session, <50 tool calls)
- Evidence-based (tests and artifacts prove completion)
Anatomy of a WU
Section titled “Anatomy of a WU”Canonical WU IDs
Section titled “Canonical WU IDs”Every Work Unit has a canonical id made of a configurable prefix and a
zero-padded integer. Defaults preserve backward compatibility — every existing
LumenFlow repo keeps emitting WU- prefixed ids without any config change.
Format rule
Section titled “Format rule”A canonical id is <prefix><zero-padded-integer> where:
prefixmatches/^[A-Z][A-Z0-9]{1,9}-$/(default'WU-').- the integer body is at least
widthcharacters wide (default4). - the integer body may be wider than
widthonce the sequence overflows (e.g.WU-10000is canonical even whenwidth=4); the sequence never truncates.
wu:create canonicalizes --id input before any file is written — passing
--id WU-14 writes WU-0014.yaml. Auto-generated ids are zero-padded too.
Collision protection
Section titled “Collision protection”Two different string forms of the same integer cannot coexist: WU-14 and
WU-0014 resolve to the same canonical integer and wu:create hard-errors if
the integer is already represented anywhere on disk. The error ships with a
copy-pasteable wu:rename remediation command.
Configuration
Section titled “Configuration”Canonical ID behaviour is controlled by software_delivery.wu_id.* in
workspace.yaml:
Default (WU-) example
Section titled “Default (WU-) example”Vendor-neutral prefix example (TASK-)
Section titled “Vendor-neutral prefix example (TASK-)”Teams that prefer a non-WU- prefix can pick a different one without touching any WU source file:
Legacy drift and wu:rename
Section titled “Legacy drift and wu:rename”pnpm lumenflow:doctor --deep flags any WU YAML whose id is valid but not canonical
(e.g. WU-5.yaml when width=4). Offenders come with copy-pasteable repair
commands:
wu:rename moves the YAML, rewrites the id: field, moves the .done stamp,
appends a wu_renamed event to .lumenflow/state/wu-events.jsonl, and
regenerates backlog.md and status.md. When a downstream repo has already
canonicalized its YAML out-of-band but the generated views still regenerate
with legacy ids, use --replay-only to append the event without touching the
filesystem:
Either form is append-only — history is never rewritten. Historical events
retain their original wuId; a replay-time projection resolves them to the
new canonical id so generated views only show the post-rename form.
Strict vs permissive mode
Section titled “Strict vs permissive mode”strict: true(default) —lumenflow:doctor --deeptreats drift as exit code 1,wu:rename’s CLI guard refuses a non-canonical--to.strict: false— legacy unpadded ids are tolerated (warning-only). Use this as a migration ramp for repos that cannot normalize in one go; integer-level collision detection still hard-blocks same-integer duplicates.
WU Lifecycle
Section titled “WU Lifecycle”| Status | Meaning |
|---|---|
ready | Approved, can be claimed |
in_progress | Someone is working on it |
blocked | Waiting on external dependency |
done | Acceptance met, stamp created |
WU Types
Section titled “WU Types”wu:create --type accepts seven canonical WU types:
| Type | Use it for |
|---|---|
feature | Net-new user or system capability |
bug | Broken or regressed behavior fix |
documentation | Documentation-only change |
process | Workflow or operating-process maintenance |
tooling | Tooling, automation, or developer-experience work |
chore | Repository upkeep or housekeeping |
refactor | Behavior-preserving code restructure |
Two rules matter in practice:
featureWUs requirespec_refs. A plan link or spec reference is part of the contract, not an optional note.documentationandprocessare the non-code WU types. Use them when the work truly changes docs or operating workflow without touching runtime behavior.
Right-Sizing WUs
Section titled “Right-Sizing WUs”WUs should be completable in a single session (<50 tool calls, <30% context). If bigger, split them.
Too Big
Section titled “Too Big”❌ “Implement user authentication system”
Right-Sized
Section titled “Right-Sized”✅ “Add login form UI” ✅ “Add password validation” ✅ “Connect login to auth API” ✅ “Add session persistence”
See Sizing Guide for detailed heuristics.
WU vs PR
Section titled “WU vs PR”In LumenFlow:
| Traditional | LumenFlow |
|---|---|
| Create ticket → Code → Open PR → Review → Merge | Create WU → Claim → Code in worktree → Gates → Done |
The “review” is automated gates, not human PR review. This unblocks flow while maintaining quality.
Evidence, Not Claims
Section titled “Evidence, Not Claims”LumenFlow provides two levels of completion evidence:
Kernel-Level Evidence
Section titled “Kernel-Level Evidence”Every tool call during a WU’s execution is recorded in the evidence store:
- Content-addressed inputs — Tool inputs are hashed with SHA-256 and stored as immutable blobs
- Tool traces —
TOOL_CALL_STARTEDandTOOL_CALL_FINISHEDentries with timing, scope enforcement results, and policy decisions - Denial records — Even denied tool calls produce evidence, proving what the agent attempted
WU-Level Evidence
Section titled “WU-Level Evidence”At completion, wu:done creates:
- Stamp file in
.lumenflow/stamps/WU-XXX.done - Test results proving acceptance criteria
- Git history linking to the WU spec
This audit trail answers: What was the agent asked to do? Was the action authorized? What actually happened? See Evidence Store for the full model.
Creating WUs
Section titled “Creating WUs”The command prints the generated ID. The created WU goes into
docs/operations/tasks/wu/WU-XXX.yaml with status ready.
Plan-less conversations: If your plan lives in chat or a meeting, keep it lightweight:
use --plan to generate a stub at lumenflow://plans/WU-XXX-plan.md, summarize the plan
there, and reference it in spec_refs. Feature WUs require spec_refs; notes do not replace
the plan link.
Next Steps
Section titled “Next Steps”- Lanes — Organizing work streams with scope boundaries
- Gates — Quality enforcement as kernel policies
- Evidence Store — The immutable audit trail behind every WU
- Kernel Runtime — How WU tasks map to kernel task lifecycle
- Sizing Guide — How to size WUs properly