diff --git a/docs/internal/MULTITENANT-HANDOFF.md b/docs/internal/MULTITENANT-HANDOFF.md index c8701ce..7fc4eba 100644 --- a/docs/internal/MULTITENANT-HANDOFF.md +++ b/docs/internal/MULTITENANT-HANDOFF.md @@ -17,6 +17,15 @@ Each agent must set `user.name` in the repo before committing: git config user.name "Operator & " ``` +`user.name` lives in `.git/config` (per-clone, not per-host). If zAI and +Claude share a clone on the same Linux box, whoever set `user.name` most +recently wins โ€” so each agent must run the command above at the start of +its own session, not rely on an earlier agent's value. A quick guard is +committed below: `hooks/pre-commit` now refuses any commit whose +`user.name` does not start with `Operator & ` (or the legacy +`Clawdie AI`), so a forgotten reset produces a fast error instead of a +misattributed commit. + ## In flight This branch is worked on by more than one agent in parallel. Before diff --git a/hooks/pre-commit b/hooks/pre-commit index 99dec5e..55bf8e9 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -1,6 +1,18 @@ #!/bin/sh -# Auto-update README Current Release version from package.json +# Attribution guard: fail fast if user.name was not set for this session. +# Each agent must run `git config user.name "Operator & "` before +# committing โ€” see docs/internal/MULTITENANT-HANDOFF.md ยง Agent Identity. +AUTHOR_NAME=$(git config user.name || true) +case "$AUTHOR_NAME" in + "Operator & "*|"Clawdie AI") ;; + *) + echo "pre-commit: git user.name is '$AUTHOR_NAME' โ€” expected 'Operator & '." >&2 + echo " Run: git config user.name \"Operator & \"" >&2 + exit 1 + ;; +esac +# Auto-update README Current Release version from package.json VERSION=$(node -e "process.stdout.write(require('./package.json').version)") if [ -z "$VERSION" ]; then exit 0; fi