Enforcement map for each prose-only rule #102
Notifications
Due Date
No due date set.
Depends on
#91 Guiding principles for agents and humans
Mortis/Kamino
Reference: Mortis/Kamino#102
Reference in new issue
Block a user
Part of #87
Question
For each rule that exists only as prose, is it enforced by a hook, by CI, left to agent instructions on purpose, or dropped? And which checks run from the base branch so a pull request cannot change its own judge?
Rules without a check today:
NOTICEentry and REUSE annotation for third-party material.pull_request_target; values passed throughenv:.image.ymlreferences the organisation secrets.main.Context
ruffandshellcheckas hooks and in CI); no custom checker is written where a standard tool does not exist, so a new custom check here needs a stated reason.check-json, a Renovate config validator.Resolution: how each prose-only rule is held
Decided in a grilling session against an inventory of
.pre-commit-config.yamland the five workflows (mainatcb50e6f). Each rule: what it says, how it is held.Rules
main's copy (#183)NOTICEentry andREUSE.tomlannotation for third-party materialREUSE.tomlglob makesreuse lintpass regardlesspull_request_target; values throughenv:image.ymlthe push credential,renovate.ymlthe Renovate token,release.ymlthe release token); no other workflow referencessecrets.except the job token.gitea/**(#144). The old wording ("onlyimage.yml") was false:renovate.ymlusesRENOVATE_BOT_TOKEN--all-files), the commit-msg check per commit and gitleaks over the range; an API commit only gets later feedbackmainimages/AGENTS.md: estimate the layer sizes when changing an image and state the estimate in the PR. No pull-request build (maintainer's choice); the registry rejecting the push onmain(HTTP 413) is the backstopminimumReleaseAge, not automerged (CODEOWNERS approval is needed anyway)images/AGENTS.md(kaniko is pinned by layer digests Renovate cannot compute)Which checks judge from
main's copy. A script that decides whether the pull request's own diff is allowed runs frommain's copy: the bot-diff gate, scenario selection, the fragment check, andcheck_image_versions.py bump(moves; it runs from the PR's copy today). A script that checks content or the built artefact runs from the PR's copy, so a PR can change a check together with what it checks:check_tarball.py,check_image_versions.py pins, the lint wrappers and.pre-commit-config.yamlitself; CODEOWNERS review covers edits to them. Scenario: a PR that changes an image input and editsbumpto always pass must fail; a PR that adds a shipped file and its tarball allow-list entry must be able to pass.New controls (shift left).
check-jsonhook; a local hook runningpython -m unittest discover -s tests/scriptsonscripts/andtests/scripts/changes, replacing Lint's separate step;check_image_versions.py pinsas a hook on.gitea/workflows/andimages/(bumpstays CI-only: it needs the base ref);renovate-config-validatoras a Lint job in the pinned Renovate image.Also found: the gitleaks hook does nothing under
pre-commit run --all-files(it scans staged changes); Lint's range scan is the real check. No change.No separate enforcement-map document: every rule carries its "held by" label where it is written (Contributor doc set and the nested
AGENTS.md). No new ADR: each decision is cheap to reverse; the base-copy line becomes one sentence in ADR 0001 (#143).Review of the map (2026-11-15): corrections to this issue.
bumplines conflict with the earlier CI image pipeline: keep, simplify or replace. This resolution sayscheck_image_versions.py bump"moves" tomain's copy and "bumpstays CI-only". Section 3 of the earlier resolution deletes it ("Goes:bump_image_versions.pyand tests,check_image_versions.py bump, the 'bump in the same PR' rule"). Order of the implementation backlog reconciled this in favour of the earlier decision: ci: shift checks left (check-json, script tests, image pins) and run the bump judge from main drops itsbumppart. Read thebumplines here as superseded; the rest of the "judge frommain's copy" rule stands.