docs(multitenant): guard commit attribution via pre-commit hook
Confirms the Agent Identity fix zAI landed in 8138173: per-clone
`user.name` is sufficient for distinguishing zAI and Claude commits on
shared-Linux setups, provided each agent resets `user.name` at session
start. The one gotcha is that `.git/config` persists whichever name was
set last, so a forgotten reset silently misattributes.
Adds a dormant hooks/pre-commit guard that rejects any commit whose
`user.name` does not start with `Operator & ` (or the legacy
`Clawdie AI`). The hook only activates after `npm run install-hooks`
sets `core.hooksPath=hooks`, matching the existing opt-in pattern.
This commit itself is authored as `Operator & Claude`, proving the
mechanism end-to-end.
This commit is contained in:
parent
813817380c
commit
8bafe79e6b
2 changed files with 22 additions and 1 deletions
|
|
@ -17,6 +17,15 @@ Each agent must set `user.name` in the repo before committing:
|
||||||
git config user.name "Operator & <agent>"
|
git config user.name "Operator & <agent>"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
`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
|
## In flight
|
||||||
|
|
||||||
This branch is worked on by more than one agent in parallel. Before
|
This branch is worked on by more than one agent in parallel. Before
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,18 @@
|
||||||
#!/bin/sh
|
#!/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 & <agent>"` 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 & <agent>'." >&2
|
||||||
|
echo " Run: git config user.name \"Operator & <agent>\"" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Auto-update README Current Release version from package.json
|
||||||
VERSION=$(node -e "process.stdout.write(require('./package.json').version)")
|
VERSION=$(node -e "process.stdout.write(require('./package.json').version)")
|
||||||
if [ -z "$VERSION" ]; then exit 0; fi
|
if [ -z "$VERSION" ]; then exit 0; fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue