Skip to content

The clone threshold ratchet is not enforced mechanically #409

Open

Description

@Blind-Striker

docs/engineering/quality-gates.md (Clone gate) says the tests ceiling only falls. Since #439 (2026-10-17, maintainer delegated to the lead) the rule keeps a minimum headroom: the ceiling is the measurement plus 0.25 points, rounded up to the next 0.5%. The old rule, plain rounding up, could leave almost no headroom: 5.48% would have given 5.5%, with 0.02 points.

Nothing enforces that. The ceiling stayed at 8.5% (tools/OpenCode.Sdk.Tools/Clones/CloneScopes.cs) while the measurement fell to 7.64%, then 7.2% across the TST-E7 moves, and no pull request applied the ratchet. TST-E0c lowers it by hand to 7% (6.81% measured at its head, rounded up to the next 0.5%), but the next change that removes clones can again forget.

Suggested fix: a test that fails when the tests scope's ceiling exceeds the current measurement plus 0.25 points, rounded up to the next 0.5%. It would read the measurement from verify-clones or the tests scope's report, and the failure names both values and the ceiling to set. The tools/ ceiling (3%) is a fixed cap, not a ratchet, and stays out of it.

Out of scope for TST-E0c.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions