Library-first: one root module with a thin core package#51
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make ClassMesh importable. The repository becomes one root Go module with a
small core package, and the CLI moves to cmd/classmesh as its first consumer.
Classification behavior does not change.
This took me a week 😓 , lesson learn, no stupid internal package
Summary
modules are removed; go.mod retracts v0.1.0 and v0.1.1, which versioned no
importable package.
imports only the standard library. rules, schema, and stream are public;
YAML loading and command wiring live under internal.
import rewrites. The genuinely new code is the root package, the extracted
config loaders, and the proof tests below.
reports a real version.
Testing
codes, stdout, stderr, and created files byte for byte against the
pre-refactor baseline. Runs in CI.
cache with GOWORK=off; a negative-compile test pins the internal boundary;
go list assertions keep the root stdlib-only and yaml/x-text out of the
public surface.
Engine construction pays one extra 32-byte allocation for the cascade's
copy of its stage list. Interleaved 10x10 benchstat runs show engine and
pipeline timings unchanged. Three sub-microsecond sink/source benchmarks
moved 6-14% with the new binary layout; their disassembly and allocations
are identical, so this is code placement, not a code change.