Rule
Work only in worktrees, treat main as read-only, never run destructive git commands on main.
The Constraints Capsule contains eleven non-negotiable rules that every agent and developer using the Software Delivery Pack must follow. These rules are designed to prevent common mistakes and ensure consistent, safe workflow execution.
LumenFlow is designed to give AI agents and developers autonomy. But autonomy without guardrails leads to chaos. Constraints provide:
Rule
Work only in worktrees, treat main as read-only, never run destructive git commands on main.
Enforcement:
pnpm wu:claim, immediately cd worktrees/<lane>-wu-xxxgit reset --hard, git stash, git clean -fd, git push --forceWhy: Worktree isolation prevents cross-contamination between parallel WUs and protects the main branch from accidental damage.
Example:
Rule
Respect code_paths boundaries, no feature creep, no code blocks in WU YAML files.
Enforcement:
code_pathsWhy: WUs define WHAT to build, not HOW. Implementation decisions belong in code, not specs. This keeps specs clean and prevents scope creep.
Example:
Rule
Documentation WUs use --docs-only gates, code WUs run full gates.
Enforcement:
type: documentation in WU YAML triggers docs-only modepnpm gates --docs-only skips lint/typecheck/testsWhy: Documentation changes shouldn’t require the full test suite. Code changes must pass all gates. Mixing them causes friction.
Example:
Rule
Use LLMs for semantic tasks, fall back to safe defaults (never regex/keywords).
Enforcement:
Why: Regex and keyword matching are brittle and fail on edge cases. LLMs handle natural language variation better. When the LLM fails, use safe defaults - never fall back to keyword hacks.
Example:
Rule
Complete via pnpm wu:prep (gates) then pnpm wu:done; only explicitly named skippable gates can
be skipped, with --reason and --fix-wu.
Enforcement:
pnpm wu:prep runs gates in the worktree--skip-gates binary is removed and always rejected--skip-gate <name> requests require both --reason and --fix-wu.lumenflow/skip-gates-audit.ndjsonformat:check, lint, typecheck, co-change, spec:linter, claim-validation,
unread-directed-signal, invariants, and safety-critical-test are immutable;
configuration rejects skippable: true for these gatesapplicability_paths can narrow only format:check, lint, typecheck,
co-change, spec:linter, and safety-critical-test. claim-validation and
invariants remain always-on; unread-signal exceptions use the audited
--allow-unread-signals --reason flow after signal triageformat:check, lint, typecheck, or spec:linter scripts block in
default modeWhy: Gates ensure quality. Skipping requires accountability and a plan to fix the underlying issue. Without this, quality degrades over time.
Example:
Only skip when ALL are true:
Rule
Respect privacy rules, approved sources, security policies; when uncertain, choose the safer path.
Enforcement:
Why: Safety first. Some mistakes are irreversible. When in doubt, stop and ask rather than proceed and regret.
Stop and ask when:
| Trigger | Action | | ----------------------- | --------- | | Same error 3 times | Stop, ask | | Auth/permission changes | Stop, ask | | PII/secrets involved | Stop, ask | | Cloud spend decisions | Stop, ask | | Policy changes needed | Stop, ask |
Rule
NEW test failures block gates; pre-existing failures (already in the baseline) warn but do not block.
Enforcement:
.lumenflow/test-baseline.jsonpnpm test:baseline:init creates the baseline from the current failing test setpnpm test:baseline:update refreshes the baseline after an intentional ratchet changeWhy: Agents should not be blocked by unrelated, pre-existing failures. The ratchet ensures quality only improves over time — failures can be removed from the baseline, but never silently added without justification.
Rule
Evaluate lane fitness during WU and initiative scoping, and propose a lane change when a WU’s scope no longer fits its lane’s boundaries.
Enforcement:
code_paths align with the claimed lane’s code_paths in workspace.yamlpnpm lane:suggest --paths "..." to get lane recommendations for ambiguous scopingWhy: Lane boundaries define ownership, WIP limits, and parallel execution safety. Misassigned WUs undermine these guarantees and create coordination confusion.
Rule
Never use raw Write/Edit tools to modify workspace.yaml or WU YAML specification files — always
use the dedicated CLI commands.
Enforcement:
workspace.yaml → pnpm config:set (write) / pnpm config:get (read)pnpm wu:edit (modify) / pnpm wu:create (create)Why: CLI tooling provides schema validation, atomic commits, an audit trail, and automatic type coercion. Raw edits bypass all of these safeguards and can produce invalid configuration that breaks downstream commands.
Rule
If the same operation fails three times, stop retrying and escalate to the user with a summary of what failed and why.
Enforcement:
wu:create, wu:claim, wu:done, gates, etc.), git operations, build/install steps, and any repeated validation failureWhy: Retry loops waste user time and context window. Three failures usually means the agent has the wrong mental model of the problem — escalating early lets the user correct course before additional mess accumulates.
Rule
When writing or updating content shown to external stakeholders, do not treat internal docs as ground truth for factual claims — flag specific claims to the user for verification.
Enforcement:
Why: Internal docs go stale. The user always knows what’s current; an agent confidently restating a stale internal fact in client-facing material undermines trust in both the material and the agent.
Before running wu:done, verify:
code_pathspnpm gates or pnpm gates --docs-only)These commands are blocked on main checkout:
Allowed in worktrees: Most commands are safe in isolated worktrees on lane branches. The restrictions apply specifically to the main checkout.
Why: Force bypass mechanisms circumvent all git hook protections. While legitimate for emergency human interventions, agents using them autonomously undermines the entire workflow enforcement model.
Agent Escalation Path:
Legitimate bypass scenarios:
Never bypass for:
Stop and ask a human when:
When approaching context limits (high token usage, 50+ tool calls), spawn a fresh agent instead of continuing after compaction.
Why: Context compaction causes agents to lose critical rules. Starting fresh ensures constraints remain in working memory.