Rule
Work only in worktrees, treat main as read-only, never run destructive git commands on main.
The Constraints Capsule contains six 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; skip-gates only for pre-existing failures
with --reason and --fix-wu.
Enforcement:
pnpm wu:prep runs gates in the worktree--skip-gates requires both --reason and --fix-wu.lumenflow/skip-gates-audit.logWhy: 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 |
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.