Skip to main content

Module gate_identity

Module gate_identity 

Source
Expand description

What a stamp token says it was made by.

A gate stamp is keyed by the git TREE, so it proves the content has not changed since a check passed. It said nothing about WHICH check passed: upgrade the tool a declared check runs (a new node, a reinstalled cargo) and the old pass still skipped the new run. The tree already covers everything in the repository, the manifest and the lockfiles included, so this adds only what lives OUTSIDE it.

A token is <name>@<identity>, and only the complete token authorizes a skip (hooks.gate-stamp-key, ADR-0010):

  • a declared check: its full command line, its flags, and the identity of the program it runs. A program found on PATH is identified by the resolved binary’s path, size and modification time, which a package manager’s upgrade changes and which needs no command run (a script’s own --version could do anything). A program named by a path inside the repository is the tree’s business and adds nothing.
  • a built-in: its name and amont’s own version.

An identity that cannot be worked out — the program is missing, git would not hash the material — is None, and None is a cache miss everywhere: no token is written, none is honoured, the gate runs. Never a skip on a guess.

Constants§

CLUSTER_CONTRACT
The versioned contract between amont and the gate-runner image: the Job shape, the fetch protocol, the verdict rules (ADR-0016). A change to any of them bumps this, which invalidates every cluster token at once.

Functions§

base
The name a token was written under, for display and accounting only.
builtin_token
A built-in gate’s token.
external_token
The token for one declared check, written under name (the script name at commit time, the id at push time).
program_missing
Is the gate called name a declared command whose program is not installed here (ADR-0018)? Such a gate has no identity, so no stamp or record can ever answer for it. Any other reason a token cannot be made (a hash git would not compute, a built-in) is not this: those gates stay owed.
token
The token for the gate called name, whether that is a declared check (looked up by id, then by a pre-commit short name) or a built-in.