Skip to content

refactor(tools): split the long command drivers and referees into named steps - #1346

Merged
HuiJun merged 2 commits into
developfrom
fix/sonar-tools
Oct 21, 2026
Merged

HuiJun merged 2 commits into
developfrom
fix/sonar-tools

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown
Contributor

What and why

Clears the SonarCloud findings on develop under tools/, all go:S3776 but one:

  • bench/llm/main.go runCommand: flag parsing and option validation are parseRunOptions; the arm list is parseArms; opening a replay or live provider is providerFor; starting the results file is newResults; writing the fixture and results after each cell is saveProgress.
  • cmd/conformance/main.go runSuite: validating the options against each other is planSuite (a suitePlan); building the binaries the plan lacks is buildMissingBinaries; one capability configuration is runConfiguration with a configurationRun whose protocol method opens a client, checks its capabilities and runs the scenarios; the reports and exit error are finishSuite.
  • oracle/specexamples/extract.go Extract: the line scanner is an extractor with scan, turnPage, blankLine, accumulate and flush, replacing the closure over eight locals.
  • oracle/specexamples/main.go go:S1192: the pin stamp file name is one constant, pinStamp.
  • referee/apijson/ours.go exportOurs: reading and parsing is parseDocuments, converting each document alone is convertAlone, and finding the documents whose ids collide is collidingIDs.
  • referee/flexo/library.go measureUserModel and libraryFindings: following each typing into the library is followTypings, re-converting the delivered model to notation is readBackNotation, declaring the ProjectUsage is declareLibraryUsage, and the user-model lines of the findings are userModelFindings.

Each helper holds the code it replaced, moved verbatim; no changelog fragment.

Behaviour changes

Two in bench/llm run, both on invalid or odd flag sets:

  • -rounds below zero is refused while the flags are parsed, before the toolchain, corpus or provider are opened; a command line that is wrong in both ways now reports the rounds first, where it reported the toolchain first.
  • -arms=mcp,mcp starts one MCP server. The old loop started one per entry but kept only the last in runner.MCP (the earlier ones ran unused until exit), so the one server is the behaviour every cell already had.

A pull request gets no SonarCloud analysis (the CircleCI scan job runs on develop and main only); the proof that these findings clear is the post-merge scan of develop.

How it was verified

gofmt -l . empty, go build ./... and go vet ./... in the tools module, make lint (both modules), go test ./bench/llm ./cmd/conformance ./oracle/specexamples ./referee/apijson ./referee/flexo in tools and go test ./tests/hygiene pass locally. The SonarCloud analyzer run over each edited file reports no finding (it caught two go:S107 parameter-count findings in the first cut of the split, which the configurationRun struct and the anyElement argument remove).

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
  • baselines regenerated and make docs-counts run if a gate count moved (compliance rows need nothing: the census is counted at docs build)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/c2b1ac4ad6de4d8788e78fd86c7c1729
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/c2b1ac4ad6de4d8788e78fd86c7c1729?variant=devin
Requested by: @HuiJun

…ed steps

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 21, 2026 08:48
@HuiJun
HuiJun merged commit 274b04e into develop Oct 21, 2026
50 checks passed
@HuiJun
HuiJun deleted the fix/sonar-tools branch October 21, 2026 19:36
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