Reference
Enforcement
Parallax does not rely on agents following instructions voluntarily. Its rules are enforced in layers that do not depend on the agent reading anything: a client guard hook, the MCP server gate, the CLI kernel gate, the stage and quality locks, the git hooks, and verify. This page explains each layer, what it checks, the order the layers fire in, and what can be bypassed.
Some commands take a literal --by owner or --owner flag. In those flags, "owner" means you: the person who runs the kit and approves the work.
The request-time layers, in the order they fire
A pipeline command (one that builds or changes content) can be stopped before it runs by three gates. Which ones it meets depends on how it is started: a shell command never passes the MCP server gate, and a client without hooks has no guard hook.
File: kit/scripts/parallax_guard.py. It is installed by lune run parallax connect <client> (and kept in step by lune run parallax harness) for the clients that run hooks: Claude Code (a PreToolUse hook on writes, shell calls and the Parallax MCP tools) and Gemini CLI (a BeforeTool hook). It fires first, before the tool call runs.
The guard activates on any of four signals:
- A: a mutating
lune run parallax|kit <cmd>(orpython kit/<lane>/...) outside the read-only allowlist. Wrapper commands (env,timeout,nohup,time,xargs, PowerShell&andStart-Process,pwsh/bash -c) are unwrapped before the check. A command that carries--maintenanceis not a signal. - B: a call to the Parallax MCP server.
- C: a write to a pipeline path (
assets/<kind>/,src/<kind>/,tests/playtest/,library/<kind>/, at the root or undergames/<Name>/) or to a hard-protected path (generated model files, the kit's own internals, the session token). - D: the session token itself (
.verify/parallax_session.json).
When a signal fires, the guard blocks unless a fresh session covers the work. Generated files and the session token are always blocked: change a generated file's input and rebuild it. The kit's internals need a fresh parallax or kit lane session.
A shell command that sets PARALLAX_EXEMPT or *_ENFORCE is treated as tampering. It is blocked unless a fresh parallax or kit lane session is active.
File: kit/mcp/server.py, function gate() (lines 185–211).
The MCP server checks every call to its parallax tool. If the call is a mutating pipeline command and no fresh session covers its lane, the server returns isError: true and prints the exact parallax_start call that creates one. The session token is written by lune run parallax start <lane> --prompt "..." or lune run parallax prompt compile.
The mutating command set is: new, asset, make, cad, gen, optimize, vfx, anim, world, ui, sfx, move, net, upload.
Never gated: the bootstrap, read-only and governance allowlist (such as start, prompt, status, verify, task, lesson, verdict, approve, plan), asset all, a look-up subcommand (help, list, find, --check and similar), a call that carries --maintenance, and every call when PARALLAX_ENFORCE=off.
File: kit/lib/enforcer.luau, function Enforcer.before(); wired in as Cli.before by kit/init.luau (line 80). It runs before every CLI command, however it was started.
For each command it does these things, in this order:
- Shows the department's vault page when it is due: at most once per department per 120-minute window (
kit/lib/vaultgate.luau;vault.reshow_minutesinkit.config.json). This never blocks. - Refuses a mutating command without a fresh
.verify/parallax_session.jsontoken, or whose lane the token does not cover. - Refuses a command whose own words name a route its case forbids.
- Refuses a heavy build of a named piece without
assets/plans/<piece>.plan.json. A plan whose tools the case forbids, or one missing a required upgrade tool that exists on disk, is also refused.
A refusal exits with code 6 and prints summary: and next_action: lines that name the command that unlocks it.
A request through the layers
Session token
The session token is a JSON file at .verify/parallax_session.json. It is created by lune run parallax start <lane> --prompt "..." or by lune run parallax prompt compile. It records the lane, the PROMPT-X sha (the id of the compiled prompt packet), the start time, the branch and the active game.
- Time to live
- 4 hours by default (
Enforcer.TTL = 4 * 3600;kit/lib/enforcer.luau). - Fresh means
- Not expired, its PROMPT-X sha names a compiled packet, made on the branch the checkout is on, and made for the active game.
- Coverage
- The token's lane, plus the lanes of its case contracts. A
parallaxorkitlane session covers every lane. A command for a lane the token does not cover is refused. - Renewed by
lune run parallax start <lane> --prompt "..."orlune run parallax prompt compile.- Protected
- The guard hook blocks any direct write to this file, and the CLI kernel refuses a token whose PROMPT-X sha names no compiled packet.
Plan files for heavy builds
A heavy build of a named piece (for example asset, make, gen, or a vfx, anim, world or sfx build of a piece whose input file exists) requires a plan file at assets/plans/<piece>.plan.json. The plan lists the tools chosen for each part or beat, drawn from the lane's capability menu after the references have been seen.
The CLI kernel refuses the build command when:
- the plan file does not exist,
- the plan names a tool the piece's case forbids, or
- the plan is missing a required upgrade tool that already exists on disk.
You write the plan file yourself. The lane's menu comes from:
lune run parallax case <lane> "<the request>"
Separately, the 3D pipeline's lune run parallax plan <asset> shows an asset's stages in order, refuses a later stage until the earlier ones are done, and keeps its clock.
Quality locks
Quality locks are checks that go beyond "is the session valid" and ask "is the work ready to continue." They are enforced by kit/lib/lanelocks.luau, by the lanes' own build commands, and by lune run parallax verify.
Open-piece cap
Each lane holds at most 3 new pieces you have not scored, in each project (LaneLocks.OPEN_CAP = 3 in kit/lib/lanelocks.luau). "Unscored" means no verdict from you yet (lune run parallax verdict ... not yet run). The project root and each games/<Name>/ count separately. At the cap, new refuses the next piece, the lane's build commands refuse a new piece, and verify fails above it. A piece you waived holds no slot.
Lessons sheet
A new VFX, UI, animation, sound or world piece must have its ranked lessons answered (via lune run parallax answer <lane> <name>) before it builds and before verify's quality locks pass. For 3D assets, lune run parallax study <asset> --new fills the same role.
Each lesson you must answer gets either - <id>: how this piece applies it or - skip <id>: why it does not apply, each at least 6 words. If the piece's route changes, run the command with --reroute: the earlier answers are kept under a heading ## Earlier answers and every matched lesson is asked again for the new route.
Approval locks
Some steps wait for your go-ahead, recorded with lune run parallax approve <lane> <name> "<your words>" --by owner. They differ by lane: for example, a new complex, hero or AAA 3D asset needs your approval of its brief, a new sound needs a reference you chose (or your synth-only waiver), and a new world needs real reference stills. Some stages are locked one by one with --stage: sheet and blockout in 3D, style and animatic in VFX, and blocking and design in animation. A stage approval is asked again when its artefact changes or is made again.
The 10 / 30 / 60-minute clocks
Each piece gets a time budget by tier:
- Prop or simple: 10 minutes
- Complex: 30 minutes
- Hero or AAA: 60 minutes, only when you approved the piece; otherwise it counts as complex
A piece that names no tier takes its lane's default: effects, animation clips and worlds are complex; a single sound and a screen are simple. Past the budget, the lane's build commands refuse any change to that piece. You extend or restart the budget with your words:
lune run parallax clock <lane> <name> --extend <minutes> "<your words>"
lune run parallax clock <lane> <name> --restart "<your words>"
The clock records the words with each extension. One extension is at most 120 minutes. The kit expects these words to be yours; it does not check who typed them.
Git hooks
Two git hooks are installed in a clone when install, connect or harness runs in it (git never copies hooks between clones).
pre-commit
File: kit/scripts/precommit.py. Runs on every git commit and checks only the staged files, not the whole tree:
- Staged Luau files must pass
stylua --check(format) andselene(lint). - Staged Python files must compile.
- The Parallax backstop (
kit/scripts/parallax_guard.py --hook pre-commit): staged pipeline files are scanned for their cases' anti-patterns, and when the commit touches files the harness writes or reads,lune run parallax harness --checkmust pass.
A missing tool is skipped with a note; it never causes a false refusal. The hook has no bypass flag: fix the staged files and commit again (never --no-verify).
commit-msg (lane fence)
File: kit/scripts/lane_fence.py; driven by kit/knowledge/lanes.json. Each lane owns a set of path prefixes there (the same paths inside games/<Name>/ count too). The fence refuses a commit that touches two or more lanes' exclusive paths unless the commit message contains the whole word cross.
- Lanes listed together count as one:
sfxwithworld, andcodewithqa. - The project's first commit (its install) is not fenced.
- A golden or graveyard row that links a verdict note must be committed with that note.
lanes.json'smodedecides:enforcerefuses,warnonly prints.
# a commit mixing 3D and VFX work intentionally:
git commit -m "cross: sync vfx textures from new sword model"
Files not listed in any lane's exclusive paths are shared and can appear in any commit without triggering the fence.
verify, selftest, audit and prove
lune run parallax verify- The full gate: format → selene → types → tests → VFX → UI → world → moves → contract → anim → models → audit → build, with the Python tests running beside them.
--continueruns every gate and names every failure, not only the first. lune run parallax selftest- Feeds every content gate a bad fixture and passes only when all were caught.
--laneruns only the named lanes' cases;--changedruns only the lanes with changed files. A case green at the same inputs is reused from a cache unless you pass--no-cache(the cold proof). lune run parallax audit- Security audit: every remote handler is checked for unvalidated arguments, and
src/is scanned for backdoor patterns (require(<id>),loadstring,getfenv). Runs as a step insideverifyand can be run standalone. lune run parallax prove- Checks HEAD out into a sandbox worktree beside the project, runs
verifythere (andselftestwith--selftest), and shows the verdict (sha, date) instatus.--ref <sha>proves a specific commit.
enforce, audit and off modes
The environment variable PARALLAX_ENFORCE (or KIT_ENFORCE) sets the mode. Set it in your own environment; a shell command that sets it counts as tampering (see the guard hook).
| Mode | Guard hook | MCP server gate | CLI kernel gate | pre-commit |
|---|---|---|---|---|
enforce (default) | Blocks | Refuses | Refuses | Enforced |
audit | Says it, does not block | Refuses | Says it, runs anyway | Enforced |
off | Off | Off | Off | Format, lint and compile still enforced |
The pre-commit hook's format, lint and compile checks run in every mode.
Escape hatches
Two escapes exist for maintenance work on gated commands. Both need a reason, and both are logged into the session file when one exists, for your review.
# run a gated command without a session (not pipeline work)
lune run parallax <cmd> --maintenance "<why>"
# skip one tool the plan or case would require
lune run parallax <cmd> --skip-tool <tool> --why "<why>"
What can and cannot be bypassed
| Gate | Can be bypassed? | How |
|---|---|---|
| Client guard hook (commands) | logged escape | --maintenance "<why>" on the command |
| Client guard hook (generated files, session token) | no | Change the input and rebuild; start a session |
| MCP server gate | logged escape | Start a session (parallax_start or parallax_prompt), or --maintenance "<why>" |
| CLI kernel token check | logged escape | --maintenance "<why>" |
| CLI kernel tool check | logged escape | --skip-tool <tool> --why "<why>" |
| Open-piece cap | your verdict or waiver | Score a piece with verdict, or waive it with approve ... --waive |
| Lessons sheet | per lesson | - skip <id>: <6+ word reason> in the sheet |
| Approval locks | per step | --waive <step> in approve |
| Time-budget clock | your words | clock --extend or clock --restart |
| pre-commit hook | no | Fix the staged files |
| Lane fence (commit-msg) | opt-in | Write cross in the commit message |
| PARALLAX_EXEMPT / *_ENFORCE in shell | tampering | Blocked unless a fresh parallax / kit lane session is active |