Documentation
¶
Overview ¶
Package identity checks that the git author identity a commit would use in a managed repo matches the identity pinned in .abcd/config/identity.json.
It is the single source of truth for the iss-62 managed-repo identity gate: `ahoy doctor` surfaces a divergence as a detection gap, and the installed pre-commit hook calls Check to fail closed before a mis-attributed commit can land — so a stray repo-local override (e.g. a sandbox "Test User") is caught up front rather than discovered later.
Index ¶
Constants ¶
const PinRelPath = ".abcd/config/identity.json"
PinRelPath is the committed identity pin, relative to the repo root.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Effective ¶
Effective is the identity git would actually stamp on a commit in the repo, resolved as git resolves the author: the GIT_AUTHOR_NAME/GIT_AUTHOR_EMAIL environment overrides first, then git config's local > global > system layering.
func EffectiveIdentity ¶
EffectiveIdentity returns the author identity git would stamp on a commit in root. Git gives the GIT_AUTHOR_NAME/GIT_AUTHOR_EMAIL environment variables HIGHER precedence than user.name/user.email config, so an agent/CI sandbox that exports them lands a mis-attributed commit that a config-only check would wave through. Each field is therefore resolved from its GIT_AUTHOR_* override first, falling back to `git config` (local > global > system) when the override is unset or blank. Unset name or email yields an empty field, not an error.
type Pin ¶
Pin is the expected commit identity, committed so every checkout enforces the same value regardless of local git config.
type Result ¶
Result carries the comparison outcome and both identities for reporting.
type Status ¶
type Status int
Status is the outcome of comparing the effective identity to the pin.
const ( // StatusOK: a pin exists and the effective identity matches it. StatusOK Status = iota // StatusNoPin: no identity.json — the repo has not opted into the gate. StatusNoPin // StatusMismatch: a pin exists and the effective identity differs. StatusMismatch // StatusUnset: a pin exists but git has no author identity configured. StatusUnset )