Skip to content

refactor(census): export StripModelSource directly instead of forwarding to an unexported twin - #1495

Merged
HuiJun merged 1 commit into
developfrom
refactor/strip-model-source-forwarder
Oct 25, 2026
Merged

HuiJun merged 1 commit into
developfrom
refactor/strip-model-source-forwarder

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

What and why

tools/census/grammar kept two names for one function: the unexported stripModelSource held the implementation, and the exported StripModelSource was a one-line forwarder to it for tools/census/metaclassmap. The implementation is now exported as StripModelSource (keeping its doc comment); the two internal callers (buildLiteralIndex in corpus.go and literal.go) and the tests use it directly, and the forwarder is gone. Behaviour is unchanged — same signature, same body, same external caller.

How it was verified

Run from the tools module (where the change lives) and from the repository root:

tools$ go build ./...        # ok
tools$ go vet ./...          # ok
tools$ go test ./...         # ok (tools/bench/llm re-run alone after a 10m default timeout under parallel load: ok 1161s)
$ go build ./...             # ok
$ go vet ./...               # ok
$ gofmt -l .                 # (no output)
$ go test ./...              # ok (tests/wasm re-run alone after a 10m default timeout under parallel load: ok 290s)
$ python3 scripts/changelog.py check   # ok

TestStripModelSource and TestStripModelSourceUnterminated in tools/census/grammar now exercise the exported function directly.

Checklist

  • make test and make lint pass locally (go build, go vet, gofmt -l, go test ./... in both modules as above)
  • Tests added or updated for the change (existing tests retargeted to the surviving function)
  • Documentation extended where it already covers the surface (none covers this helper)
  • Changelog entry added as changes/unreleased/strip-model-source-forwarder.changed.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (no count moved)
  • 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/05456a63661b43d288ec073855f3514c
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/05456a63661b43d288ec073855f3514c?variant=devin
Requested by: @HuiJun

…ing to an unexported twin

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
devin-ai-integration Bot marked this pull request as ready for review October 25, 2026 04:56

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Devin Review: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

@HuiJun
HuiJun merged commit 91d9f6f into develop Oct 25, 2026
53 checks passed
@HuiJun
HuiJun deleted the refactor/strip-model-source-forwarder branch October 25, 2026 16:43
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