Orchestrata Ultimate › Gates › prod-separation

Gate: prod-separation

At a glance

Purpose Refuse an installed orchestrata-*.service user unit whose path-bearing directives point at the development checkout.
Where it runs The scripts/gates.py battery (registered as prod-separation).
Trigger A battery run whose fingerprint changed, or whose last cached verdict was not ok.
Exact command python scripts/check_prod_tree_separation.py
Blocks Exit 1 on violations, 2 when the units could not be inspected, 0 clean.
Ruling / ADR RUL-027 — prod runs its own checkout; ADR-0062 — production runs from a pinned-ref git checkout under /opt/orchestrata.
Last recorded verdict ok: false in the primary checkout's .cache/gates.json (file last written 2026-09-22 10:01 local; the cause is not recorded there). wt-MAP-PRECOMMIT has no .cache/gates.json.

What it refuses

An installed production systemd unit (orchestrata-*.service under ~/.config/systemd/user) that points any path-bearing directive at the development checkout.

Why it exists

Module docstring, quoting the ruling and the state it corrected:

"Prod/dev tree separation gate — the mechanism for ruling RUL-027. 'Separate dev code from prod' (user command, 2026-08-08).

Production must execute from its own checkout. Before RUL-027 all six orchestrata-* user units carried WorkingDirectory=/home/mohamed/workspace/orchestrata-ultimate-architecture together with Environment=ORCHESTRATA_ENV_PROFILE=prod, so production ran whatever the development tree happened to contain: every edit was a pending deploy, and git checkout moved production silently."

Why it reads installed units, not templates: "a template can be correct while the installed copy has drifted, and the installed copy is what actually runs."

One directive is there because of a recorded miss:

"Environment= is here because of a real miss: orchestrata-history-mining carried Environment=PYTHONPATH=<dev tree>/src. An exported PYTHONPATH OUTRANKS a checkout's own .pth, so that one line makes a unit execute the development tree's source no matter how correct its WorkingDirectory and ExecStart are. It is the same trap RUL-021 hit in worktrees, and the first version of this gate walked straight past it."

How it runs

Typical failures and how to fix them

Wiring