Skip to content

fix(cycle-detection): make rule opt-in to silence false positives#192

Merged
notJoon merged 1 commit into
mainfrom
fix/cycle-detection-opt-in
May 5, 2026
Merged

fix(cycle-detection): make rule opt-in to silence false positives#192
notJoon merged 1 commit into
mainfrom
fix/cycle-detection-opt-in

Conversation

@notJoon

@notJoon notJoon commented May 5, 2026

Copy link
Copy Markdown
Member

AST-only call-graph detection cannot distinguish bounded mutual recursion (recursive-descent decoders, depth-guarded tree walks) from a real cycle. Defaulting to SeverityError surfaced these as build-breaking errors on otherwise-correct code.

Flip DefaultSeverity to SeverityOff so the rule stays silent unless a project explicitly opts in via .tlin.yaml. The engine already skips dispatch when effective severity is Off, so no engine change is required.

TestRulesFireOnTestdata previously asserted cycle-detection fires on cycle0.gno under NewEngine(nil); split that case out into a new TestRulesFireOnTestdata_OptIn that enables the rule via config and asserts the same wiring invariant.

AST-only call-graph detection cannot distinguish bounded mutual
recursion (recursive-descent decoders, depth-guarded tree walks)
from a real cycle. Defaulting to SeverityError surfaced these as
build-breaking errors on otherwise-correct code.

Flip DefaultSeverity to SeverityOff so the rule stays silent unless
a project explicitly opts in via .tlin.yaml. The engine already
skips dispatch when effective severity is Off, so no engine change
is required.

TestRulesFireOnTestdata previously asserted cycle-detection fires
on cycle0.gno under NewEngine(nil); split that case out into a new
TestRulesFireOnTestdata_OptIn that enables the rule via config and
asserts the same wiring invariant.
@notJoon notJoon merged commit 6dc57b0 into main May 5, 2026
6 checks passed
@notJoon notJoon deleted the fix/cycle-detection-opt-in branch May 5, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant