Skip to content

The tool-contract guard cannot see a submodule pin rollback #2496

Closed

Description

@lilyshen0722

scripts/verify-moltbot-tool-contract.js asserts the _external/clawdbot pin is contained in the declared branch. That is true of every commit the branch ever had — and a rollback is by definition to a commit the branch already had — so containment can never catch one.

Measured on main 9ac61bdef, through the suite's own injected-exec seam: a pin that is a strict ancestor of the merge base's pin returns contained. #1089's exact shape passes the guard.

#1089 was caught because ux-lead read the diff by hand.

How the bad pin arrives is why the check must not key on intent: git add -A in a checkout whose submodule sits at an older commit stages that stale pointer as if it were an edit. The author types no submodule command, so a guard keyed on a title or a label misses the entire population — the regression happens precisely in PRs that believe they have nothing to do with the submodule.

Prior art: #1090 implemented the direction check in August and was re-reviewed clean, then never merged; it is two months behind main. Its own "Not verified" section names two gaps — the forward-bump cell was argued rather than exercised, and there was no unit test. A suite with an injected exec now exists (backend/__tests__/unit/scripts/moltbotToolContract.test.js), so both can be closed.

Row TASK-367 (SRE PR triage 2026-10-23).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions