Commit 2bfae6f
authored
feat: reorganize Go package into internal/ subtree (v0.4.0) (#75)
* docs: map existing codebase
* docs: initialize project
* chore: add project config
* docs: complete project research
* docs: define v1 requirements
* docs: create roadmap (5 phases)
* docs(01): capture phase context
* docs(state): record phase 1 context session
* docs(01): research phase domain
* docs(phase-1): add validation strategy
* docs(01-layout-design): create phase plan
* feat(01-01): add skeleton packages for internal/runtime and internal/library
- internal/runtime/runtime.go with bare package declaration and doc comment
- internal/library/library.go with bare package declaration and doc comment
- go build ./internal/... passes
* test(01-01): add anchor validation test for internal package imports
- internal_test.go at repo root with package chroma_test
- Blank-imports internal/runtime and internal/library
- Proves root package can import internal/ packages
- go build, go vet, golangci-lint all pass
* docs(01-01): complete layout-design plan
- Add 01-01-SUMMARY.md with execution results
- Update STATE.md with phase completion and decisions
- Update ROADMAP.md progress table
- Mark LAYOUT-01 and LAYOUT-02 requirements complete
* docs(phase-01): complete phase execution
* docs(phase-01): evolve PROJECT.md after phase completion
* docs(02): capture phase context
* docs(state): record phase 2 context session
* docs(02): research phase domain
* docs(phase-02): add validation strategy
* docs(02-file-migration): create phase plan
* fix(02): add go test -race compile check to 02-02 verify per checker feedback
* feat(02-01): move library files to internal/library/ and export LoadLibrary
- Move library.go, library_unix.go, library_windows.go, library_test.go from root to internal/library/
- Change package declaration from chroma to library
- Export loadLibrary as LoadLibrary (capital L) in platform files
- Preserve build tags verbatim (//go:build !windows, //go:build windows)
- All types and helpers remain unexported
- Delete original root library files
* feat(02-01): bridge chroma.go Init() to call library.LoadLibrary
- Add import for github.com/amikos-tech/chroma-go-local/internal/library
- Change Init() from loadLibrary(libPath) to library.LoadLibrary(libPath)
- go build ./... compiles successfully
- Platform build tags verified via GOOS=linux and GOOS=windows go list
* docs(02-01): complete library file migration plan
- Add 02-01-SUMMARY.md with execution results
- Update STATE.md with plan position, decisions, and metrics
- Mark LAYOUT-04 requirement as complete in REQUIREMENTS.md
* feat(02-02): move implementation files to internal/runtime/ with goruntime alias
- Move chroma.go, config.go, embedded.go, errors.go, backup.go, rebuild.go, compaction.go, wal_prune.go to internal/runtime/
- Change package declarations from chroma to runtime
- Alias stdlib runtime import as goruntime in files that use SetFinalizer/KeepAlive
- Transfer Phase 1 skeleton doc comment to chroma.go, delete runtime.go skeleton
- Preserve internal/library import bridge from Plan 01
* feat(02-02): move test files to internal/runtime/, fix paths, remove anchor test
- Move 11 test files from root to internal/runtime/ with package runtime
- Fix shim/Cargo.toml relative path to ../../shim/Cargo.toml in chroma_test.go
- Alias stdlib runtime as goruntime in backup_test.go (runtime.GOOS usage)
- Remove internal_test.go Phase 1 anchor test
- Zero .go files remain at repo root
- go build, go vet, go test -race compile check all pass for ./internal/...
* docs(02-02): complete runtime file migration plan
- Create 02-02-SUMMARY.md with migration results
- Update STATE.md with position, decisions, metrics
- Update ROADMAP.md with phase 02 plan progress
- Mark LAYOUT-03 requirement as complete
* docs(phase-02): complete phase execution
* docs(phase-02): evolve PROJECT.md after phase completion
* docs(phase-02): add/update validation strategy
* docs(phase-03): gather context for root facade phase
* docs(phase-03): research root facade domain
* docs(phase-03): add validation strategy
* docs(03-root-facade): create phase plan
* feat(03-01): add root facade re-exporting server, config, and error symbols
- doc.go: package documentation for chroma
- chroma.go: Server, StartServerConfig types and Init, StartServer, Version, VersionWithError
- config.go: ServerConfig, ServerOption types and all With* builder functions plus NewServer
- errors.go: error code constants and sentinel error variables
* docs(03-01): complete root facade plan
- Add 03-01-SUMMARY.md with execution results
- Update STATE.md with position, decisions, metrics
- Update ROADMAP.md with plan progress
- Mark FACADE-01 through FACADE-05 complete in REQUIREMENTS.md
* feat(03-02): add embedded.go facade with all embedded types and functions
- 32 type aliases re-exporting Embedded, EmbeddedConfig, request/response types
- 3 constants: DefaultTenantID, DefaultDatabase, DefaultEmbeddedDir
- 7 thin wrapper functions: NewEmbedded, StartEmbedded, DefaultEmbeddedConfig, With* options
* feat(03-02): add backup, rebuild, compaction, and WAL prune facade files
- backup.go: 7 type aliases, 2 mode constants, 4 option wrapper functions
- rebuild.go: 2 type aliases, 4 option wrapper functions
- compaction.go: 4 type aliases (types only, methods auto-forward)
- wal_prune.go: 3 type aliases, 7 option wrapper functions (includes time.Duration import)
* docs(03-02): complete embedded and maintenance facade plan
- SUMMARY.md with 2 task commits, 5 facade files created
- STATE.md advanced to phase 03 complete
- ROADMAP.md updated with plan progress
* docs(phase-03): complete phase execution
* docs(phase-03): evolve PROJECT.md after phase completion
* docs(04): capture phase context
* docs(state): record phase 4 context session
* docs(04): research phase domain
* docs(phase-4): add validation strategy
* docs(04): create phase plan
* fix(04): revise plan 04-03 based on checker feedback
* fix(04-01): correct gci import prefix in .golangci.yml
- Replace stale prefix(github.com/chaoslabs-bg/tclr-v2/) with prefix(github.com/amikos-tech/chroma-go-local/)
* fix(04-01): suppress SA1019 on deprecated type re-exports in backup.go
- Add nolint:staticcheck to ServerBackupOptions and EmbeddedBackupOptions type aliases
* fix(04-01): reorder imports in chroma.go for corrected gci prefix
- Move project import to its own group per gci formatter sections
* feat(04-02): add compile-time API surface gate and behavioral smoke tests
- compat_test.go with package chroma_test (external test package)
- Compile-time var _ references for all exported symbols (54 types, 37 functions, 14 constants, 5 error vars)
- 9 behavioral smoke tests: Init, Version, VersionWithError, DefaultServerConfig, NewServer, DefaultEmbeddedConfig, plus option builders for backup, rebuild, WAL prune
* docs(04-02): complete compat-test plan
- 04-02-SUMMARY.md with execution results
- STATE.md updated with position and decisions
- ROADMAP.md updated with plan progress
- REQUIREMENTS.md marks TEST-02, TEST-03 complete
* docs(04-01): complete lint fix plan
- Add 04-01-SUMMARY.md with execution results
- Update STATE.md with plan progress and decisions
- Update ROADMAP.md with phase 04 progress
- Mark BUILD-03 requirement complete
* fix(04-03): suppress errcheck on deferred server.Stop in compat_test.go
- Wrap deferred server.Stop() call to explicitly discard error value
* docs(phase-04): update validation strategy with audit results
* docs(04-03): complete full verification pass plan
- All make targets, lint, cross-compile verified passing
- Phase 4 success criteria approved by user
- Requirements TEST-01, TEST-04, BUILD-01, BUILD-02, BUILD-04 marked complete
* docs(phase-04): complete phase execution and verification
* docs(phase-04): evolve PROJECT.md after phase completion
* docs(05): capture phase context
* docs(state): record phase 5 context session
* docs(05): research phase domain
* docs(phase-5): add validation strategy
* docs(05): create phase plan
* docs(05-02): update README, CLAUDE.md, GO_API_SURFACE for internal/ layout
- README.md Project Structure shows facade + internal/runtime + internal/library
- README.md Architecture section explains thin facade pattern
- CLAUDE.md architecture diagram updated with full facade -> internal mapping
- CLAUDE.md Key Patterns includes facade pattern code example
- GO_API_SURFACE.md note clarifies types defined in internal/, re-exported at root
* docs(05-02): create CHANGELOG.md with v0.4.0 release entry
- Keep a Changelog format with UNRELEASED date placeholder
- Compatibility statement: no breaking changes, zero modifications required
- Comparison link to v0.3.4 baseline
* feat(05-01): add api-compat CI job for apidiff on PRs to main
- New api-compat job runs only on PRs targeting main
- Dynamically resolves latest release tag for comparison
- Reports as informational warning, not build failure
- Writes results to GITHUB_STEP_SUMMARY for visibility
- Gracefully skips if no release tags exist
* docs(05-02): complete documentation update plan
- SUMMARY.md with task commits and self-check
- STATE.md updated with position, decisions, metrics
- ROADMAP.md updated with phase 05 progress
- REQUIREMENTS.md: DOCS-02, DOCS-03, DOCS-04, COMPAT-03 marked complete
* docs(05-01): complete API compatibility verification plan
- SUMMARY.md: apidiff confirmed 90 type-alias false positives, zero genuine breaking changes
- STATE.md: updated position, decisions, metrics
- REQUIREMENTS.md: marked DOCS-01, COMPAT-01, COMPAT-02 complete
* docs(phase-05): complete phase execution
* docs(phase-05): evolve PROJECT.md after phase completion
* docs(05): ship phase 05 — PR #75
* fix(ci): ensure api-compat job exits 0 on expected false positives
apidiff returns exit code 1 when it detects changes, even though
the type-alias false positives are expected. The if/else block
handled the output correctly but didn't force exit 0, causing
the step to fail.
* fix(ci): use stable Go for api-compat job
apidiff@latest requires Go 1.25+ but go.mod specifies 1.21.
The api-compat job only runs the apidiff tool, not project code,
so it can safely use the latest stable Go.
* fix: address PR review feedback (compaction comment, dynamic port)
- Add comment to compaction.go explaining why it has types only
(uses request structs, not variadic option builders)
- Replace hardcoded port 9999 in TestNewServer with dynamic port
allocation via net.Listen to avoid CI port conflicts1 parent a683017 commit 2bfae6f
99 files changed
Lines changed: 15350 additions & 3677 deletions
File tree
- .github/workflows
- .planning
- codebase
- phases
- 01-layout-design
- 02-file-migration
- 03-root-facade
- 04-build-and-test
- 05-compatibility-and-docs
- research
- internal
- library
- runtime
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
0 commit comments