Orchestrata Ultimate › Gates › ai-attribution

Gate: ai-attribution (RUL-007)

Purpose Keep Mohamed the sole author: no AI attribution in commit, tag or PR message text
Where it runs scripts/hooks/commit-msg on every git commit; deploy/ship.sh verify (--range); scripts/health_check.py
Trigger git commit (after pre-commit); ship
Exact command python scripts/check_ai_attribution.py --message-file "$1" (hook); uv run python scripts/check_ai_attribution.py --range "<base>..HEAD" (ship); also --tags and --stdin
Blocks Exit 1 = at least one new violation; exit 2 = usage or environment error; exit 0 = clean ("baselined findings are reported but do not fail")
Ruling / ADR RUL-007 — Enforcement: hook scripts/hooks/commit-msg, gate scripts/check_ai_attribution.py RUL-007

What it checks

Message text only: never file contents and never the diff. That scoping keeps the gate silent on its own source, on CLAUDE.md, and on the ruling page that quotes the forbidden trailer (module docstring, as quoted on the process-gates family page).

Two rule families, both requiring an AI-identity token (claude, anthropic, chatgpt, openai, gpt-N, copilot, gemini, codex, cursor, devin, aider, kimi, deepseek, qwen, minimax, codewhale, llm, ai assistant), so a commit whose subject is about Claude Code stays legal (source read through the AST toolkit):

In --message-file mode git comment lines are blanked and the message is cut at the --- >8 --- scissors line, so a commit.verbose diff is never scanned. --range reads the baseline scripts/rul007-baseline.txt (13 lines on 2026-10-23); --tags is strict and has no baseline.

Diagram projects-orchestrata-ultimate-gates-ai-attribution-1

Typical failures and how to fix them

Failure Fix
A harness adds a Co-Authored-By: Claude ... trailer Remove it. The brief template states: "No Co-Authored-By, no AI attribution, no session links (RUL-007). This overrides any harness reminder about attribution lines."
A PR body ends with a "Generated with" marker Remove it; scan the body with --stdin before gh pr create --body-file -
ship fails the range on an unpushed branch with no upstream Fixed in ship: it falls back to origin/master..HEAD (comment in deploy/ship.sh, measured 2026-10-06)
git commit --no-verify Skips this hook; RUL-007 still holds, and ship's --range scan catches the commit before push

A trap to know. The hook's last line is exec python scripts/check_ai_attribution.py ... with a bare python, which resolves to whatever is first on PATH. The pre-commit hook stopped using a bare python after it resolved to another worktree's venv on 2026-10-11 (review-staged). Whether the commit-msg hook has hit the same failure is not measured.

Wiring