Skip to content

refactor(runtime): clear the Sonar findings in internal/exec/runtime - #1606

Merged
HuiJun merged 2 commits into
developfrom
fix/sonar-runtime
Oct 28, 2026
Merged

HuiJun merged 2 commits into
developfrom
fix/sonar-runtime

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Clears the 13 open SonarCloud findings under internal/exec/runtime on develop, each at the root rather than by suppression. Behaviour is unchanged: every edit is a split into named helpers, a renamed variable, or a message that now reports the value it compares.

Rule File:line on develop What was done
go:S3776 (39) eval.go:1572 evalFeatureChain Fixed: split into enactedConstraintChain, occurrenceChainValue, valuelessChain, operandChainValue; the order of the reads is unchanged.
go:S3776 (35) held_image.go:1091 recordedOccurrences Fixed: the made/madeAll closures became madeID/madeIDs methods; start values and transfers are carried by carriedStartValues and carriedTransfer.
go:S3776 (44) subsetting.go:1113 bindingWitnesses Fixed: the per-binding draw is drawBindingWitnesses over a witnessDraw (pool, taken, chosen, seen) whose pick draws the linked count.
go:S1186 connector.go:87 Fixed: the placeholder undoFills := func() {} is gone — the fill runs first and fail closes over the undo it returns (which is never nil).
go:S1186 connector.go:368 Fixed: the three literal no-ops for a non-connector usage are one named noJournal() whose body says why there is nothing to commit, undo or drain.
go:S1186 namespace_binding.go:676 Fixed: same noJournal().
go:S107 invoke_calc.go:933 bindCalcParameters Fixed: the three parameters that describe where a usage's bindings land (nested, occurrence, open) are one calcBindingSite value; five call sites updated.
go:S1940 robustness_loop_performances_test.go:94 Fixed: !(a <= b) → a > b.
go:S978 robustness_value_stand_in_test.go:182 Fixed: copy → replica.
godre:S8193 binding_connector_multiplicity_test.go:39 Fixed: the counted got is now reported in the failure message.
godre:S8193 shape_items_limits_test.go:53 Fixed: same.

No dispositions, nothing deferred.

How it was verified

  • go build ./..., go vet ./internal/exec/runtime/..., gofmt -l empty.
  • go test -count=1 -timeout 60m ./internal/exec/runtime/... green (one pilot-corpus gate re-run green after the corpora were provided to the worktree); ./internal/exec/... ./tests/corpus ./tests/grpc run as consumers.
  • gocognit -over 30 on the three files: none of the three functions remains over 30.
  • Sonar's analyze_code_snippet on each changed file: the develop copies report exactly the findings above; the branch copies report none of them (the remaining hits are findings already resolved on develop).

Overlap with open PRs

Checklist

  • make test and make lint pass locally
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md — not needed: refactor only, no behaviour change
  • baselines regenerated and make docs-counts run if a gate count moved (compliance rows need nothing: the census is counted at docs build) — no count moved
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

Requested by: @HuiJun

Split evalFeatureChain, recordedOccurrences and bindingWitnesses into named
helpers, pass the binding site of a calc invocation as one value, take the
connector fill's own undo instead of a placeholder closure, name the journal
nothing opened, and tidy four tests (opposite operator, a shadowed copy, two
counts now reported).

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review October 28, 2026 03:53
@HuiJun
HuiJun merged commit fc3ffad into develop Oct 28, 2026
54 of 103 checks passed
@HuiJun
HuiJun deleted the fix/sonar-runtime branch October 28, 2026 13:05
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