Skip to content

Library-first: one root module with a thin core package#51

Merged
eitamring merged 6 commits into
mainfrom
refactor/library-first
Jul 17, 2026
Merged

Library-first: one root module with a thin core package#51
eitamring merged 6 commits into
mainfrom
refactor/library-first

Conversation

@eitamring

@eitamring eitamring commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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

  • One module, github.com/ClassMesh/classmesh. The workspace and both nested
    modules are removed; go.mod retracts v0.1.0 and v0.1.1, which versioned no
    importable package.
  • The root package owns Record, Stage, Classification, and Cascade, and
    imports only the standard library. rules, schema, and stream are public;
    YAML loading and command wiring live under internal.
  • The raw diff is 153 files, +2,248/-1,688, almost all of it file moves and
    import rewrites. The genuinely new code is the root package, the extracted
    config loaders, and the proof tests below.
  • classmesh version falls back to module build info, so a tagged go install
    reports a real version.

Testing

  • A committed 12-case golden suite runs the built binary and compares exit
    codes, stdout, stderr, and created files byte for byte against the
    pre-refactor baseline. Runs in CI.
  • A consumer fixture builds against root, rules, and stream from a clean
    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.
  • Per-record hot paths allocate exactly as before; sinks stay at zero.
    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.
  • make verify, tidy, vet, cgo-check, test, lint, vuln pass locally; CI green.

@eitamring
eitamring merged commit 39af3af into main Jul 17, 2026
3 checks passed
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