Problem
Rules are stored and iterated as a Go map, so rule execution order is nondeterministic:
internal/rule/registry.go:40-47
internal/engine.go:237-265
internal/engine.go:325-370
File work also completes concurrently. The resulting issue order can vary between identical runs, producing noisy diffs in text and JSON output and making tests harder to reproduce.
Proposed change
Sort the final issue list once at the public processing boundary by stable fields such as filename, start line, start column, rule name, and message. This is smaller than redesigning the registry solely to preserve order and also handles worker completion order.
Acceptance criteria
- Repeated runs over the same inputs produce byte-for-byte stable text and JSON issue ordering.
- Ordering is documented and covered by a test with multiple files and rules.
- Rule execution remains sequential per file and file-level parallelism is preserved.
Problem
Rules are stored and iterated as a Go map, so rule execution order is nondeterministic:
internal/rule/registry.go:40-47internal/engine.go:237-265internal/engine.go:325-370File work also completes concurrently. The resulting issue order can vary between identical runs, producing noisy diffs in text and JSON output and making tests harder to reproduce.
Proposed change
Sort the final issue list once at the public processing boundary by stable fields such as filename, start line, start column, rule name, and message. This is smaller than redesigning the registry solely to preserve order and also handles worker completion order.
Acceptance criteria