Home / Projects / Orchestrata Ultimate / Decisions / ADR index / ADR-0093

ADR-0093: Promotion, test and gate work re-injects the process, test and gate memories, and compaction resets the injector

field value
Status Accepted
Date 2026-10-12
Register factory (docs/adr, 4-digit ids)
Source docs/adr/0093-promotion-test-and-gate-work-re-injects-the-process-test-and-gate-memories-and-compaction-resets-the-injector.md — recorded on branch docs/adr-register-0080-0085 at 3f68a11a5, not yet on master
Wiki register entry ADR-0093 (wiki status: Accepted)

← ADR-0092 · ADR-0094 →

The record

Status: Accepted · Date: 2026-10-12 · Ruled: 2026-10-12 (Mohamed's directive; the mechanism below is designed under it)

Context

Decision

Mohamed's directive above is the decision. Under it:

  1. Prompt trigger.
    • workflow_context_inject.py gains a promotion domain. Its triggers are word-boundary regexes: promote, promotion, deploy, deployment, ship, release, prod, production, rollback, "test env", promote_env, run_tests, gate, gates, preflight.
    • Its block carries a fixed tests-and-gates checklist of at most 20 lines. The checklist is versioned in the repo and ships with the plugin (ADR-0092).
    • For each named memory file, the block gives its one-line description, its **How to apply:** line and its absolute path, and instructs the session to read the files before running a promotion, test or gate command.
    • A named memory file that is missing is named as missing in the block. It is never skipped silently.
  2. Command trigger.
    • A PreToolUse(Bash) hook injects the same checklist and paths on EVERY Bash command that runs promote_env.py, ship.sh, install-orchestrata.sh, install-claude-config.sh, install-plugin.sh, provision_app_container.sh, run_tests.py, .run_exclusive.sh, gate.py, gates.py, tofu, or git push.
    • It never dedups: the command is the moment a forgotten rule costs.
  3. Truthful dedup. The injector's seen-state is cleared whenever the context is rebuilt, by SessionStart with source compact, resume or clear. "Already in context" is then printed only when the text is in the current context. This applies to all five domains.
  4. Memory dir resolution.
    • The path is ${CLAUDE_CONFIG_DIR:-$HOME/.claude}/projects/<parent of the git common dir, with every "/" replaced by "-">/memory, computed from the hook's cwd.
    • Outside a git repository the triggers emit only the checklist.
  5. Delivery is measured, not assumed.
    • A test drives a real headless claude session and asserts that the injected text reaches the session for both the UserPromptSubmit event and the PreToolUse event.
    • This is the 2026-08-13 lesson recorded in _emit: a hook can run, write its state, exit 0 and deliver nothing.

Alternatives rejected

Consequences

Provenance

Rulings cited

Specs cited

None (or no spec page exists for the ones named).