Skip to content

A comment-only edit is impossible in ANY of the 43 scripts/check-*.py checkers, so a false comment in one cannot be corrected #1631

Description

@localai-bot

A comment inside a governance_checker can never be corrected on its own, because check-pr-size.py demands semantic mutation evidence that a comment-only edit cannot produce.

Found while landing #1578, correcting records that the floor repair for #1629 made stale.

Measured, not inferred

scripts/check-pr-size.py:372 carries a comment reading Measured: 31 of 31 red under the stub. After #1629's repair the suite is 32 cases and the same mutation measures FAILED (errors=32). Rewording that one comment was attempted and refused:

$ python3 scripts/check-pr-size.py --base 89925ad6f8... --head <comment-only commit>
ERROR: checker change 'scripts/check-pr-size.py' requires semantic mutation evidence in tests/scripts/test_check_pr_size.py
rc=1

The identical invocation against the parent commit exits 0, so the edit is the only difference.

Mechanism

check-pr-size.py classifies itself as a governance_checker. change_errors therefore requires any change to it to be paired with a tests/scripts/test_check_pr_size.py change that executable_evidence proves goes red against the BASE checker. A comment-only edit leaves BASE and HEAD semantically identical, so no test can distinguish them and no such evidence can exist. The required pr-size CI job runs exactly this invocation.

Consequence: every comment in that file is frozen until someone changes the checker's behaviour in the same commit. A stale comment in a governance checker is therefore permanently stale, and the only way to fix a factual error in one is to attach it to an unrelated semantic change — which is worse than leaving it.

This is the shape AGENTS.md ## Changing the rules or a checker warns about from the other direction: the guard is right to refuse a silent semantic weakening, but it currently cannot tell "weakened an assertion" from "fixed a typo in a comment".

Not fixed in flow

Teaching the guard to distinguish a comment-only or docstring-only diff from a semantic one changes what the gate accepts, so under ## Changing the rules or a checker it needs its own row, a red-before test and green-after evidence. Two candidate directions, neither chosen: compare the two versions with comments and docstrings stripped (an AST or token comparison) and skip the evidence requirement when they are identical; or keep the requirement and stop storing facts that go stale inside checker comments. The second is cheaper and matches ## Records, which already forbids storing a measurement of one file inside another.

The stale comment itself is being left in place in #1578 rather than smuggled in, and this issue records why.

Two smaller things in the same file, both pre-existing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions