code-safety is advisory — rule text an agent reads, with no mechanism behind it. That label
is honest, and this catalog's credibility rests on keeping it honest: 22 of 39 policies are
advisory and we say so plainly.
But some advisory rules contain a slice a machine can check. For this policy the candidate is:
the "deleted an assertion" and "left an unused import" cases the rule names
The second half is nearly free — every linter already finds unused imports, so the work is
wiring rather than detection. The first half is the interesting one: a diff that removes an
assert is mechanically detectable, and it is one of the most common ways a change quietly
weakens the thing that was protecting it.
What to do: pick the slice, implement it as a guard or a content_regex over the diff, write
eval cases in both directions, and re-label only the slice you actually mechanised.
The case that decides whether your check is any good: a legitimate edit that removes an
assertion — because the code it guarded is gone, or the test was genuinely rewritten — must still
pass. A check that fires on every assertion removal will be routed around within a week, and a
check people route around is worse than none.
The rule that governs this work: never claim an enforcement tier the mechanism does not
deliver. tools/check_effects.py will catch a claim the code does not back.
Sized to an afternoon for a narrow slice. Files: base/code-safety/, registry.yaml.
code-safetyis advisory — rule text an agent reads, with no mechanism behind it. That labelis honest, and this catalog's credibility rests on keeping it honest: 22 of 39 policies are
advisory and we say so plainly.
But some advisory rules contain a slice a machine can check. For this policy the candidate is:
The second half is nearly free — every linter already finds unused imports, so the work is
wiring rather than detection. The first half is the interesting one: a diff that removes an
assertis mechanically detectable, and it is one of the most common ways a change quietlyweakens the thing that was protecting it.
What to do: pick the slice, implement it as a guard or a
content_regexover the diff, writeeval cases in both directions, and re-label only the slice you actually mechanised.
The case that decides whether your check is any good: a legitimate edit that removes an
assertion — because the code it guarded is gone, or the test was genuinely rewritten — must still
pass. A check that fires on every assertion removal will be routed around within a week, and a
check people route around is worse than none.
The rule that governs this work: never claim an enforcement tier the mechanism does not
deliver.
tools/check_effects.pywill catch a claim the code does not back.Sized to an afternoon for a narrow slice. Files:
base/code-safety/,registry.yaml.