8000 Phase 7.9: Publish Prep — API narrowing, rustdoc, clippy clean, CI matrix (v0.19.0) by adityamukho · Pull Request #109 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

Phase 7.9: Publish Prep — API narrowing, rustdoc, clippy clean, CI matrix (v0.19.0) - #109

Merged
adityamukho merged 18 commits into
mainfrom
feature/phase-7-9-publish-prep
Apr 8, 2026
Merged

adityamukho merged 18 commits into
mainfrom
feature/phase-7-9-publish-prep

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Summary

  • API narrowing: All internal types narrowed to pub(crate); public surface is now Minigraf, OpenOptions, WriteTransaction, Repl, Value, EntityId, QueryResult, AsOf, ValidAt, BindValue, PreparedQuery
  • Minigraf::repl(): New factory method replaces direct Repl::new(FactStorage) — Repl<'_> now borrows &Minigraf for lifetime safety; users call db.repl().run()
  • Rustdoc sweep: Full /// doc coverage on all public items with # Examples doctests; #![warn(missing_docs)] enforced; [package.metadata.docs.rs] added for docs.rs builds
  • Clippy clean: cargo clippy -- -D warnings passes; FileHeader::to_bytes takes self by value; strict clippy step added to CI
  • Unwrap audit: Bare .unwrap() in library code replaced with descriptive .expect() messages
  • CI matrix: macOS and Windows added to rust.yml; strict clippy step added to rust-clippy.yml
  • Version: 0.18.0 → 0.19.0
  • README: Installation section + crates.io/docs.rs badges added

Test Plan

  • cargo test — 788 tests passing (0 failing)
  • cargo doc --no-deps — zero warnings
  • cargo clippy -- -D warnings — zero warnings
  • cargo publish --dry-run — passes
  • cargo fmt --check — clean (pre-push hook verified)
  • CI green on Linux / macOS / Windows

🤖 Generated with Claude Code

adityamukho and others added 16 commits April 7, 2026 14:35
…self) -> Repl<'_>

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…helpers

Delete the now-dead `inner_fact_storage` method from `Minigraf` (no callers
after Repl refactor) and remove unused `&self` from the three private Repl
helper methods (`is_command_complete`, `print_result`, `format_value`),
calling them via `Self::` instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…evel rustdoc

- Replace src/lib.rs with narrow public surface: only db, repl modules
  public; graph, query, storage, temporal, wal are pub(crate)
- Re-export only: Minigraf, OpenOptions, OpenOptionsWithPath, WriteTransaction,
  Repl, EntityId, Value, QueryResult, AsOf, ValidAt, BindValue, PreparedQuery
- Add crate-level rustdoc with quick-start doctest using Minigraf::in_memory()
- Add #![warn(missing_docs)] and #![cfg_attr(docsrs, feature(doc_cfg))]
- Update integration tests to use new public API paths (minigraf::Value,
  minigraf::QueryResult) instead of private module paths
- Migrate bitemporal_test, complex_queries_test, concurrency_test,
  recursive_rules_test from FactStorage/DatalogExecutor to Minigraf::in_memory()
- Fix doctests in src/db.rs, src/graph/types.rs, src/graph/storage.rs,
  src/query/datalog/rules.rs that referenced now-internal module paths
- Fix wal_test.rs to avoid FileHeader/PAGE_SIZE (now internal): inline
  PAGE_SIZE=4096 constant and read raw bytes for header field checks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fact, TxId, Attribute, TransactOptions, VALID_TIME_FOREVER, tx_id_* and
FactStorage are now pub(crate); only Value and EntityI
F438
d remain pub as
they are part of the public API re-exported from lib.rs. Dead pub use
lines in graph/mod.rs are replaced with pub(crate) use.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove unused re-exports from graph/mod.rs (all callers use
`crate::graph::types::*` directly; only `FactStorage` needed via
`crate::graph::FactStorage`). Move test-only methods/functions
(`get_facts_by_entity`, `get_facts_by_attribute`, `get_facts_valid_at`,
`get_facts_by_entity_attribute`, `get_current_value`, `fact_count`,
`asserted_fact_count`, `index_counts`, `resolve_fact_ref`,
`next_string_prefix`) to `#[cfg(test)]` impl/free-function blocks.
Move `with_asserted` and `is_retracted` on `Fact` to a `#[cfg(test)]`
impl block. Move `tx_id_from_system_time` and `tx_id_to_system_time`
into the types test module. Fixes all dead_code and unused_import
warnings originating from src/graph/.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rage/query/wal modules

Category A: removed unused pub use re-exports from query/mod.rs,
query/datalog/mod.rs (keeping QueryResult for repl.rs), and restored
FileBackend re-export with #[allow(unused_imports)] (used in tests).

Category B: added #[allow(dead_code)] to legitimate-but-unused API
methods in storage traits, btree_v6, cache, persistent_facts, index,
packed_pages, executor, evaluator, functions, rules, types, and temporal;
added #![allow(dead_code)] module attribute to legacy btree.rs.
Also fixed unused variable and unused import in test code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace .read().unwrap()/.write().unwrap() in cache.rs and evaluator.rs
with .expect("lock poisoned"), and wal.as_mut().unwrap() in db.rs with
.expect("WAL not initialized") for clearer panic messages in published lib.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- CLAUDE.md: bump test count 780 → 788
- README.md: update phase badge 7.8 → 7.9
- ROADMAP.md: mark Phase 7 and 7.9 complete; update Current Focus and version history
- CHANGELOG.md: add v0.19.0 entry (API visibility, rustdoc, clippy, CI matrix)
- TEST_COVERAGE.md: bump counts (780 → 788), add Phase 7.9 completion section, update next steps

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
codecov Bot commented Apr 7, 2026 •
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.73%. Comparing base (f9f725e) to head (65ef4f6).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
src/repl.rs 9.09% 10 Missing ⚠️
src/wal.rs 41.66% 7 Missing ⚠️
src/graph/storage.rs 97.36% 2 Missing ⚠️
src/main.rs 0.00% 1 Missing ⚠️
src/storage/cache.rs 85.71% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #109      +/-   ##
==========================================
+ Coverage   83.61%   83.73%   +0.12%     
==========================================
  Files          26       26              
  Lines        4816     4729      -87     
==========================================
- Hits         4027     3960      -67     
+ Misses        789      769      -20     
Files with missing lines Coverage Δ
src/db.rs 91.94% <100.00%> (+0.67%) ⬆️
src/graph/types.rs 84.48% <100.00%> (+2.39%) ⬆️
src/query/datalog/evaluator.rs 91.04% <100.00%> (ø)
src/query/datalog/executor.rs 93.32% <ø> (ø)
src/query/datalog/functions.rs 83.56% <ø> (ø)
src/query/datalog/prepared.rs 61.95% <ø> (ø)
src/query/datalog/rules.rs 93.33% <ø> (ø)
src/query/datalog/types.rs 86.00% <ø> (ø)
src/storage/backend/file.rs 88.57% <ø> (ø)
src/storage/btree.rs 67.14% <ø> (ø)
... and 11 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adityamukho
adityamukho merged commit 8438ab2 into main Apr 8, 2026
17 checks passed
@adityamukho
adityamukho deleted the feature/phase-7-9-publish-prep branch April 8, 2026 03:23
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

0