Skip to content

refactor: organize modules and make result types explicit - #49

Merged
tisonkun merged 14 commits into
mainfrom
codex/organize-region-modules
Sep 10, 2026
Merged

tisonkun merged 14 commits into
mainfrom
codex/organize-region-modules

Conversation

@tisonkun

@tisonkun tisonkun commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Group Region persistence, indexing, record formats, recovery, and runtime under region; keep eviction in memory and file access and execution in io. Internal callers use owning modules, while the crate root selects public exports.
  • Rename the public I/O configuration enum to IoEngineConfig and remove custom Result aliases. Public callers use the standard Result<T, Error> with Error imported from cache2; examples and migration notes follow the final API.
  • Keep versioned fixtures beside their format modules, simplify imports, and give documentation links concise display names.
  • Make CONTRIBUTING.md the source of contribution rules, with a one-way link from AGENTS.md and design constraints in ARCHITECTURE.md. Describe changelog entries relative to the latest release.

Runtime behavior, concrete error types, and golden fixture bytes are unchanged.

Validation: cargo +1.98.0 x check, cargo +1.98.0 x test (including doctests and extended library tests), and cargo +1.98.0 x lint all pass.

Keep each versioned golden file beside its encoding and decoding module. Preserve fixture bytes and keep only the shared parser and assertions in fixtures.rs.
Use imports for referenced symbols and start intra-crate paths at crate. Reserve parent glob imports for tests, and keep short qualifiers or explicit aliases where they clarify symbol origins. Document the conventions in CONTRIBUTING.md.
Use direct paths where aliases or conditional imports obscure symbol origins, retain conventional short qualifiers, and give rustdoc links concise labels with explicit targets.
Remove the public cache2::Result alias and the private recovery metadata Result alias. Name the error type at each return boundary, and update caller examples and migration notes while preserving the underlying error types.
Keep the workspace entry points, tool setup, validation commands, and lasting contribution requirements. Refer to existing code and source configuration for details.
@tisonkun tisonkun changed the title refactor: organize internal modules by subsystem refactor: organize modules and make result types explicit Sep 9, 2026
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Keep selective public exports at the crate root. Expose internal child modules through private parents and reference their definitions directly, removing redundant re-exports. Keep implementations used only by their parent module private.
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
@tisonkun
tisonkun enabled auto-merge (squash) September 10, 2026 03:22
@tisonkun
tisonkun merged commit 5b80202 into main Sep 10, 2026
8 checks passed
@tisonkun
tisonkun deleted the codex/organize-region-modules branch September 10, 2026 03:25
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