Skip to content

feat: create Cargo workspace with crate structure#49

Merged
Bakobiibizo merged 2 commits intorelease-candidatefrom
001-create-cargo-workspace
Dec 25, 2025
Merged

feat: create Cargo workspace with crate structure#49
Bakobiibizo merged 2 commits intorelease-candidatefrom
001-create-cargo-workspace

Conversation

@Bakobiibizo
Copy link
Copy Markdown
Contributor

@Bakobiibizo Bakobiibizo commented Dec 25, 2025

  • Create workspace root Cargo.toml with 5 member crates
  • Add esrp-core, esrp-canonical, esrp-workspace, esrp-http crates
  • Add esrp-cli tool in tools directory
  • Create bindings directories (python, typescript)
  • Create fixtures directory structure (v1/requests, canonical, responses)
  • Create tests/conformance directory
  • Define workspace-level dependencies

Closes #1

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

Summary by Sourcery

Set up a Rust Cargo workspace for the ESRP project with multiple crates and a CLI tool, and align documentation to track this workspace initialization work.

New Features:

  • Introduce a Cargo workspace root with shared package metadata and common dependencies.
  • Add initial ESRP core, canonical, HTTP, and workspace crates with placeholder library modules.
  • Add an esrp-cli binary crate as a command-line entry point for the protocol.

Enhancements:

  • Update project documentation to reflect the active workspace-creation ticket and its progress.

- Create workspace root Cargo.toml with 5 member crates
- Add esrp-core, esrp-canonical, esrp-workspace, esrp-http crates
- Add esrp-cli tool in tools directory
- Create bindings directories (python, typescript)
- Create fixtures directory structure (v1/requests, canonical, responses)
- Create tests/conformance directory
- Define workspace-level dependencies

Closes #1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Dec 25, 2025

Reviewer's Guide

Sets up a Rust Cargo workspace with shared workspace-level metadata and dependencies, introduces skeleton crates and a CLI tool, and updates project docs to reflect the new workspace structure and ticket status.

Flow diagram for updated repository directory structure

graph TD
    root["Repository_root"]

    root --> cargo_toml["Cargo.toml<br/>Workspace_definition"]
    root --> crates_dir["crates/"]
    root --> tools_dir["tools/"]
    root --> bindings_dir["bindings/"]
    root --> fixtures_dir["fixtures/"]
    root --> tests_dir["tests/"]
    root --> docs_dir["docs/"]

    subgraph crates["Crates"]
        crates_dir --> esrp_core["esrp_core/"]
        crates_dir --> esrp_canonical["esrp_canonical/"]
        crates_dir --> esrp_http["esrp_http/"]
        crates_dir --> esrp_workspace["esrp_workspace/"]
    end

    subgraph tools["Tools"]
        tools_dir --> esrp_cli["esrp_cli/"]
    end

    subgraph bindings["Language_bindings"]
        bindings_dir --> py["python/"]
        bindings_dir --> ts["typescript/"]
    end

    subgraph fixtures["Fixtures"]
        fixtures_dir --> fx_v1["v1/"]
        fx_v1 --> fx_requests["requests/"]
        fx_v1 --> fx_canonical["canonical/"]
        fx_v1 --> fx_responses["responses/"]
    end

    subgraph tests["Tests"]
        tests_dir --> conf["conformance/"]
    end

    subgraph docs["Documentation"]
        docs_dir --> tickets["tickets/"]
        tickets --> t000["000_index.md"]
        tickets --> t001["001_create_cargo_workspace.md"]
    end
Loading

File-Level Changes

Change Details Files
Convert the repository from a single crate to a multi-crate Cargo workspace with shared metadata and dependencies.
  • Replace root package manifest with a workspace definition and member list for core, canonical, workspace, http crates, and CLI tool.
  • Introduce workspace.package section to centralize version, edition, license, and repository metadata.
  • Define workspace.dependencies for common libraries like serde, uuid, chrono, tokio, axum, and reqwest to be shared across member crates.
Cargo.toml
Cargo.lock
Add initial crate manifests and stub implementations for protocol-related libraries and HTTP transport.
  • Create esrp-core crate for core ESRP types with a basic lib.rs module-level doc comment.
  • Create esrp-canonical crate for deterministic JSON serialization with a basic lib.rs doc comment.
  • Create esrp-workspace crate for workspace URI handling with a basic lib.rs doc comment.
  • Create esrp-http crate for HTTP transport with a basic lib.rs doc comment, all inheriting workspace metadata and currently with empty dependency sections.
crates/esrp-core/Cargo.toml
crates/esrp-core/src/lib.rs
crates/esrp-canonical/Cargo.toml
crates/esrp-canonical/src/lib.rs
crates/esrp-workspace/Cargo.toml
crates/esrp-workspace/src/lib.rs
crates/esrp-http/Cargo.toml
crates/esrp-http/src/lib.rs
Introduce a CLI tool crate wired into the workspace.
  • Add esrp-cli package manifest configured as a binary crate with workspace-inherited metadata.
  • Implement a minimal main.rs that prints a placeholder message to verify compilation.
tools/esrp-cli/Cargo.toml
tools/esrp-cli/src/main.rs
Align documentation with the new workspace and ticket progress.
  • Extend CLAUDE.md with a "Current Work" section describing the active ticket, branch, and task checklist for the workspace setup.
  • Update the ticket index to mark the workspace creation ticket as in-progress instead of not started.
CLAUDE.md
docs/tickets/000-index.md
Remove the old single-crate entry point in favor of the new multi-crate structure.
  • Delete the previous src/main.rs tied to the now-removed root binary crate.
src/main.rs

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The workspace-level dependency list is quite broad for an initial scaffold (e.g., axum, reqwest, tower-http, tokio with full); consider adding only what the current crates actually need to keep compile times and upgrade surface area smaller.
  • The status of ticket 001 is now marked as [~] in 000-index.md while CLAUDE.md still shows it as "In Progress" with remaining tasks; it would be helpful to align these status markers before merging so project planning stays consistent.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The workspace-level dependency list is quite broad for an initial scaffold (e.g., axum, reqwest, tower-http, tokio with `full`); consider adding only what the current crates actually need to keep compile times and upgrade surface area smaller.
- The status of ticket 001 is now marked as `[~]` in `000-index.md` while CLAUDE.md still shows it as "In Progress" with remaining tasks; it would be helpful to align these status markers before merging so project planning stays consistent.

## Individual Comments

### Comment 1
<location> `docs/tickets/000-index.md:47-49` </location>
<code_context>

 ### Phase 0: Repository Setup
-- [ ] [001 - Create Cargo Workspace](001-create-cargo-workspace.md)
+- [~] [001 - Create Cargo Workspace](001-create-cargo-workspace.md)
 - [ ] [002 - Initialize Git Repository](002-initialize-git-repository.md)

</code_context>

<issue_to_address>
**suggestion:** Nonstandard `[~]` checkbox may not render or parse correctly in Markdown task lists.

This entry uses `[~]` instead of the standard `[ ]` / `[x]` used elsewhere. If you need an "in progress" state, either document this convention or use a standard checkbox plus status text so Markdown task list rendering and any parsing tools remain consistent.

```suggestion
### Phase 0: Repository Setup
- [ ] [001 - Create Cargo Workspace](001-create-cargo-workspace.md) _(in progress)_
- [ ] [002 - Initialize Git Repository](002-initialize-git-repository.md)
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines 47 to 49
### Phase 0: Repository Setup
- [ ] [001 - Create Cargo Workspace](001-create-cargo-workspace.md)
- [~] [001 - Create Cargo Workspace](001-create-cargo-workspace.md)
- [ ] [002 - Initialize Git Repository](002-initialize-git-repository.md)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: Nonstandard [~] checkbox may not render or parse correctly in Markdown task lists.

This entry uses [~] instead of the standard [ ] / [x] used elsewhere. If you need an "in progress" state, either document this convention or use a standard checkbox plus status text so Markdown task list rendering and any parsing tools remain consistent.

Suggested change
### Phase 0: Repository Setup
- [ ] [001 - Create Cargo Workspace](001-create-cargo-workspace.md)
- [~] [001 - Create Cargo Workspace](001-create-cargo-workspace.md)
- [ ] [002 - Initialize Git Repository](002-initialize-git-repository.md)
### Phase 0: Repository Setup
- [ ] [001 - Create Cargo Workspace](001-create-cargo-workspace.md) _(in progress)_
- [ ] [002 - Initialize Git Repository](002-initialize-git-repository.md)

@Bakobiibizo Bakobiibizo merged commit 7c35901 into release-candidate Dec 25, 2025
5 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