Skip to content

docs: redesign public API guidance and slim CI allocation gates#42

Merged
hyfdev merged 7 commits into
mainfrom
docs/public-api-guidance
Jul 12, 2026
Merged

docs: redesign public API guidance and slim CI allocation gates#42
hyfdev merged 7 commits into
mainfrom
docs/public-api-guidance

Conversation

@hyfdev

@hyfdev hyfdev commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

Polish the unreleased 3.0 public docs so the crate reads like a small professional path library, and slim the continuous CI / allocation gate so PR pushes stop double-running and only the useful snapshots are checked.

Documentation

  • Restructure the README around installation, quick start, API choice, semantics, ownership, features, platform notes, and 2.x migration
  • Align src/lib.rs crate docs with that entry path
  • Fill method rustdoc (panic/error/Windows contracts + examples for ambient, try, and slash-policy APIs)
  • Fix AGENTS.md architecture note: ambient cwd helper is try_get_current_dir(), not get_current_dir()
  • Add Cargo package metadata (documentation, readme, docs.rs all-features) and clearer feature comments

CI and allocation gates

  • Stop double-running Test on feature-branch pushes: push is limited to main; PRs use pull_request only
  • Add concurrency cancellation for the same PR; run host-independent fmt / rustdoc once on Ubuntu
  • Keep continuous allocation gates to Linux and Windows only (x86_64-unknown-linux-gnu.snap, x86_64-pc-windows-msvc.snap)
  • Make cargo allocs the single entry point; the tracker always measures cached_current_dir (drop allocs-rolldown and dual default/Rolldown committed snaps)
  • CI cargo doc with RUSTDOCFLAGS=-D warnings

Notes

  • Cargo.toml version remains 2.0.1 on purpose; the version / lockfile / release changelog bump belongs to the release flow after this lands. The README states that main documents the upcoming 3.0 API and points at 2.0.1 docs for the published surface.
  • README method links point at source on main until 3.0 rustdoc is published on docs.rs.
  • CodSpeed may report small timing noise on unrelated rows for this docs/CI PR; treat allocation snapshots and semantic tests as the gate for this change.

Test plan

  • RUSTDOCFLAGS="-D warnings" cargo doc --locked --workspace --all-features --no-deps
  • cargo test --locked --doc
  • cargo test --locked --workspace
  • cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
  • cargo fmt --all --check
  • CI: Lint, Test (ubuntu/macos/windows), Allocation snapshot (ubuntu/windows), CodSpeed

hyfdev added 2 commits July 12, 2026 14:42
Fill remaining method examples and try/lossy contracts, polish the
README for crates.io/docs.rs readers, and declare package docs metadata.
@hyfdev
hyfdev marked this pull request as ready for review July 12, 2026 06:50
Copilot AI review requested due to automatic review settings July 12, 2026 06:50
@codspeed-hq

codspeed-hq Bot commented Jul 12, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 12.87%

⚡ 1 improved benchmark
✅ 215 untouched benchmarks
⏩ 30 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation string 255.8 ns 226.7 ns +12.87%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing docs/public-api-guidance (63d7509) with main (6cce331)

Open in CodSpeed

Footnotes

  1. 30 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Restrict push triggers to main (match CodSpeed), cancel in-progress runs
for the same PR, and run host-independent fmt/doc once on Ubuntu.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refreshes the public-facing documentation and method contracts for the upcoming 3.0 API surface, positioning the crate as a small, task-oriented path utility with clear semantics, platform notes, and ownership/Unicode guarantees.

Changes:

  • Reworked README and crate-level docs to guide users by task (normalize/absolutize/relative/slash conversion) and to clarify lexical vs filesystem semantics, ownership, and platform behavior.
  • Expanded rustdoc for the SugarPath / SugarPathBuf traits with stronger contracts and more examples (including ambient/try/explicit-cwd APIs and slash-policy APIs).
  • Strengthened documentation quality gates and metadata (CI cargo doc with -D warnings, docs.rs all-features, package metadata).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/sugar_path.rs Expanded SugarPath rustdoc contracts and added targeted examples (normalize/absolutize/relative/slash APIs).
src/sugar_path_buf.rs Added examples and clarified error/Unicode and reuse semantics for consuming PathBuf APIs.
src/lib.rs Redesigned crate-level rustdoc as a task-oriented landing page and enabled rustdoc link linting.
README.md Restructured documentation for installation, API selection, semantics, platform support, and 2.x→3.x upgrade guidance.
CHANGELOG.md Adjusted 2.0.0 compare link base and removed an outdated “pending integration” note.
Cargo.toml Improved package metadata (docs/readme/categories), docs.rs all-features, and clarified feature comments.
AGENTS.md Documented the local doc-build command mirroring CI’s “deny rustdoc warnings” behavior.
.github/workflows/test.yaml Added a CI documentation step running cargo doc with RUSTDOCFLAGS=-D warnings.
.agents/docs/architecture.md Updated architectural docs to reflect README/lib.rs as the primary user entry points and contracts location.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

hyfdev added 4 commits July 12, 2026 14:54
Drop macOS and default-feature committed snapshots. Continuous CI checks
the two primary-consumer Rolldown snaps only, and docs/PCR stay in sync.
Always measure cached_current_dir in the tracker, drop allocs-rolldown,
and rename the committed snaps to plain target triples.
Align architecture notes with try_get_current_dir after the ambient
cwd API returned Result.
Inline the fixed cached_current_dir configuration label into the format
string so CI clippy -D warnings passes again.
@hyfdev hyfdev changed the title docs: redesign public API guidance docs: redesign public API guidance and slim CI allocation gates Jul 12, 2026
@hyfdev
hyfdev merged commit 5982476 into main Jul 12, 2026
9 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 12, 2026
@hyfdev hyfdev mentioned this pull request Jul 12, 2026
7 tasks
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.

2 participants