Skip to content

Implement workspace scaffolding#1

Merged
leynos merged 5 commits intomainfrom
codex/set-up-rust-project-scaffolding
Jul 25, 2025
Merged

Implement workspace scaffolding#1
leynos merged 5 commits intomainfrom
codex/set-up-rust-project-scaffolding

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Jul 24, 2025

Summary

  • create a Rust workspace with comenq, comenqd, and shared comenq-lib
  • define CommentRequest in the library crate
  • add workspace dependencies and dev setup
  • add initial cucumber tests for library serialisation
  • update roadmap and design notes

Testing

  • make fmt
  • make lint
  • make test
  • make markdownlint
  • make nixie

https://chatgpt.com/codex/tasks/task_e_6881dc53b1708322bb6f9c5e88b09804

Summary by Sourcery

Scaffold Rust workspace for the Comenq project with shared library and two binaries, set up workspace configuration, add initial BDD and unit tests, and update documentation

New Features:

  • Create Rust workspace with comenq, comenqd, and comenq-lib crates
  • Define shared CommentRequest struct with Serialize/Deserialize in the library crate
  • Add stubbed main entrypoints for the comenq CLI and comenqd daemon binaries

Enhancements:

  • Configure workspace-level dependencies and build settings in root Cargo.toml
  • Integrate Cucumber-based BDD tests alongside unit tests for serialization
  • Add Cucumber test harness and feature files for CommentRequest

Build:

  • Add root Cargo.toml workspace configuration and markdownlint setup

Documentation:

  • Reformat and update design notes, behavioral testing guide, and roadmap documentation

Tests:

  • Add unit tests for CommentRequest serde functionality
  • Introduce Cucumber feature and step definitions for library serialization

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jul 24, 2025

Reviewer's Guide

This PR establishes the Comenq Rust workspace by introducing a shared library crate (comenq-lib) with the core IPC type, two binary crates (comenq client and comenqd daemon) with initial stubs, configures workspace-level dependencies and test harness, adds unit and cucumber serialization tests for CommentRequest, and updates design documentation and roadmap to reflect the new structure.

Class diagram for the new CommentRequest struct in comenq-lib

classDiagram
    class CommentRequest {
        +String owner
        +String repo
        +u64 pr_number
        +String body
    }
Loading

File-Level Changes

Change Details Files
Initialize Rust workspace and dependency management
  • Added [workspace] section in root Cargo.toml with members and shared dependencies
  • Defined lib target for com(enq-lib) and dev-dependencies (cucumber, tokio)
  • Created crates/comenq and crates/comenqd Cargo.toml files referencing workspace deps
Cargo.toml
Add shared library crate with CommentRequest and unit tests
  • Created src/lib.rs defining CommentRequest struct with serde Serialize/Deserialize
  • Added unit tests for valid serialization and error cases (invalid JSON, missing fields, type mismatches)
src/lib.rs
Introduce comendq client and com(end)qd daemon binaries
  • Added stub main in crates/comenq/src/main.rs printing a greeting
  • Added stub main in crates/comenqd/src/main.rs initializing tracing and logging startup
crates/comenq/src/main.rs
crates/comenqd/src/main.rs
Integrate cucumber-based serialization tests for CommentRequest
  • Added Gherkin feature file tests/features/comment_request.feature
  • Added step definitions in tests/steps/comment_steps.rs
  • Added test runner in tests/cucumber.rs and configured [[test]] harness in root Cargo.toml
tests/features/comment_request.feature
tests/steps/comment_steps.rs
tests/cucumber.rs
Cargo.toml
Update design documentation, behavioural testing guide, and roadmap
  • Reformatted and extended docs/comenq-design.md to match new workspace layout
  • Adjusted table formatting in docs/behavioural-testing-in-rust-with-cucumber.md
  • Marked scaffolding milestones complete and refined items in docs/roadmap.md
docs/comenq-design.md
docs/behavioural-testing-in-rust-with-cucumber.md
docs/roadmap.md

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 24, 2025

Summary by CodeRabbit

New Features

  • Introduced a shared library defining a public structure for comment requests.
  • Added initial client and daemon binaries with basic setup and logging.
  • Established workspace structure with dedicated crates for client, daemon, and shared types.
  • Implemented Cucumber-based behavioural tests for comment request serialisation and error handling.

Bug Fixes

  • Corrected formatting and consistency in documentation and configuration files.

Documentation

  • Improved design, roadmap, and testing documentation for clarity and readability.

Style

  • Refined markdown formatting, checklist presentation, and code samples for better legibility.

Chores

  • Updated and aligned workspace and dependency configurations.
  • Added and adjusted linting and markdown rules for consistency.

Walkthrough

Establish a Rust workspace for the Comenq project, introducing two binary crates (comenq, comenqd) and a shared library crate. Add configuration files, workspace dependencies, and initial source code. Enhance documentation with extensive formatting, roadmap updates, and Markdown linting adjustments. Implement Cucumber-based BDD tests for JSON serialisation of CommentRequest.

Changes

File(s) Change Summary
Cargo.toml, crates/comenq/Cargo.toml, crates/comenqd/Cargo.toml Set up Rust workspace, add crate manifests, specify dependencies, and configure workspace members.
src/lib.rs Add shared library module defining public struct CommentRequest with serialisation and tests.
crates/comenq/src/main.rs, crates/comenqd/src/main.rs Add minimal main functions for client and daemon binaries.
tests/cucumber.rs, tests/features/comment_request.feature, tests/steps/* Introduce Cucumber BDD integration tests and step definitions for CommentRequest serialisation logic.
AGENTS.md, docs/behavioural-testing-in-rust-with-cucumber.md, docs/comenq-design.md, docs/roadmap.md Reformat and clarify documentation, update roadmap progress, and improve Markdown table and footnote style.
.markdownlint-cli2.jsonc Simplify markdownlint configuration by adding rules for ordered lists and code block style enforcement.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Comenq (Client)
    participant Comenqd (Daemon)
    participant SharedLib

    User->>Comenq (Client): Run CLI with PR comment details
    Comenq (Client)->>SharedLib: Serialise CommentRequest to JSON
    Comenq (Client)->>Comenqd (Daemon): Send JSON via IPC
    Comenqd (Daemon)->>SharedLib: Deserialise CommentRequest
    Comenqd (Daemon)->>GitHub API: Post comment to PR
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Possibly related PRs

Poem

In the land of Rust, a workspace is born,
With crates aligned and dependencies sworn.
Docs are now clearer, the roadmap refined,
Cucumber tests run, with bugs left behind.
Lint rules are tamed, and code is pristine—
Comenq’s first steps, a sight to be seen! 🚀


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1a8a6c8 and aad7309.

📒 Files selected for processing (3)
  • .markdownlint-cli2.jsonc (1 hunks)
  • docs/comenq-design.md (16 hunks)
  • tests/steps/comment_steps.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rs

⚙️ CodeRabbit Configuration File

**/*.rs: * Seek to keep the cyclomatic complexity of functions no more than 12.

  • Adhere to single responsibility and CQRS

  • Place function attributes after doc comments.

  • Do not use return in single-line functions.

  • Move conditionals with >2 branches into a predicate function.

  • Avoid unsafe unless absolutely necessary.

  • Every module must begin with a //! doc comment that explains the module's purpose and utility.

  • Comments and docs must follow en-GB-oxendict (-ize / -our) spelling and grammar

  • Lints must not be silenced except as a last resort.

    • #[allow] is forbidden.
    • Only narrowly scoped #[expect(lint, reason = "...")] is allowed.
    • No lint groups, no blanket or file-wide suppression.
    • Include FIXME: with link if a fix is expected.
  • Use rstest fixtures for shared setup and to avoid repetition between tests.

  • Replace duplicated tests with #[rstest(...)] parameterised cases.

  • Prefer mockall for mocks/stubs.

  • Prefer .expect() over .unwrap()

  • Ensure that any API or behavioural changes are reflected in the documentation in docs/

  • Ensure that any completed roadmap steps are recorded in the appropriate roadmap in docs/

  • Files must not exceed 400 lines in length

    • Large modules must be decomposed
    • Long match statements or dispatch tables should be decomposed by domain and collocated with targets
    • Large blocks of inline data (e.g., test fixtures, constants or templates) must be moved to external files and inlined at compile-time or loaded at run-time.

Files:

  • tests/steps/comment_steps.rs
**/*.md

⚙️ CodeRabbit Configuration File

**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")

  • Use en-GB-oxendict (-ize / -our) spelling and grammar
  • Paragraphs and bullets must be wrapped to 80 columns, except where a long URL would prevent this (in which case, silence MD013 for that line)
  • Code blocks should be wrapped to 120 columns.
  • Headings must not be wrapped.
  • Documents must start with a level 1 heading
  • Headings must correctly increase or decrease by no more than one level at a time
  • Use GitHub-flavoured Markdown style for footnotes and endnotes.
  • Numbered footnotes must be numbered by order of appearance in the document.

Files:

  • docs/comenq-design.md
🪛 LanguageTool
docs/comenq-design.md

[style] ~98-~98: This sentence is over 40 words long. Consider splitting it up, as shorter sentences make the text easier to read.
Context: ...initive choice for the daemon's core. | async-std | | CLI Argument Parsing | clap | The most popular and feature-rich CLI argument parsing library for Rust.[^3] The | derive feature offers an exceptionally ergonomic and declarative way to define the CLI's structure, automatically generating argument parsing, validation, and help text from a simple struct definition.[^3] | argh, pico-args 4 | | GitHub API Client | octocrab | A modern, actively maintained, and extensible GitHub API client.[^5] It provides strongly typed models for API responses and a builder pattern for requests, simplifying interaction with the GitHub REST API. Its static API and support for custom m...

(TOO_LONG_SENTENCE)


[uncategorized] ~161-~161: Loose punctuation mark.
Context: ...ing logic.[^5] The doc comments ( ///) are automatically converted into help m...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~163-~163: Please add a punctuation mark at the end of paragraph.
Context: ...e makes the tool self-documenting.[^10] The #[arg(...)] attributes provide fine-...

(PUNCTUATION_PARAGRAPH_END)


[uncategorized] ~218-~218: Loose punctuation mark.
Context: ...ix filesystem permissions ( chmod, chown). The comenqd daemon can crea...

(UNLIKELY_OPENING_PUNCTUATION)


[style] ~344-~344: Would you like to use the Oxford spelling “initialize”? The spelling ‘initialise’ is also correct.
Context: ... Upon startup, the main function will initialise necessary resources (configuration, log...

(OXFORD_SPELLING_Z_NOT_S)


[uncategorized] ~348-~348: Loose punctuation mark.
Context: ...e daemon: 1. task_listen_for_requests: This task is the daemon's public-facing...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~353-~353: Loose punctuation mark.
Context: ...ly as possible. 2. task_process_queue: This is the main worker task. It operat...

(UNLIKELY_OPENING_PUNCTUATION)


[style] ~391-~391: Would you like to use the Oxford spelling “initialized”? The spelling ‘initialised’ is also correct.
Context: ...n's reliability.[^7] The queue will be initialised at a configurable path (e.g., `/var/lib...

(OXFORD_SPELLING_Z_NOT_S)


[style] ~434-~434: Would you like to use the Oxford spelling “initialized”? The spelling ‘initialised’ is also correct.
Context: ...PI Usage The octocrab client will be initialised once at daemon startup, using a Persona...

(OXFORD_SPELLING_Z_NOT_S)


[grammar] ~441-~441: Please add a punctuation mark at the end of paragraph.
Context: ...umentation patterns.[^7] Therefore, the correct octocrab method to use is `issues()....

(PUNCTUATION_PARAGRAPH_END)


[uncategorized] ~582-~582: Possible missing comma found.
Context: ...n a terminal is suitable for development but not for production. A systemd service...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~627-~627: Loose punctuation mark.
Context: ...alysis of Directives:** - User=comenq, Group=comenq: Ensures the process run...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~630-~630: Loose punctuation mark.
Context: ... comenq user. - Restart=on-failure: Instructs systemd to automatically re...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~680-~680: Loose punctuation mark.
Context: ...pt are crucial: - /var/lib/comenq: The daemon's state directory is owned e...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~683-~683: Loose punctuation mark.
Context: ...nt queue. - /run/comenq/comenq.sock: The UDS is created in a directory also ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~686-~686: Did you mean “that”? ‘Who’ usually refers to a person, whereas ‘that’ refers to an object.
Context: ...nd group. Other users on the system who are not in the comenq group will be d...

(THE_OBJECT_THAT)


[style] ~988-~988: Would you like to use the Oxford spelling “initializes”? The spelling ‘initialises’ is also correct.
Context: ...6. Implementation Notes The repository initialises the workspace with comenq-lib at the ...

(OXFORD_SPELLING_Z_NOT_S)


[typographical] ~998-~998: To join two clauses or introduce examples, consider using an em dash.
Context: ...in-rust/> [^2]: UnixSocket in tokio::net - Docs.rs. Accessed on July 24, 2025. ...

(DASH_RULE)


[typographical] ~1000-~1000: To join two clauses or introduce examples, consider using an em dash.
Context: ...t.html> [^3]: Picking an argument parser - Rain's Rust CLI recommendations. Accesse...

(DASH_RULE)


[typographical] ~1004-~1004: To join two clauses or introduce examples, consider using an em dash.
Context: .../book/tutorial/cli-args.html> [^5]: clap - Docs.rs. Accessed on July 24, 2025. ...

(DASH_RULE)


[typographical] ~1009-~1009: To join two clauses or introduce examples, consider using an em dash.
Context: ...tocrab/examples/custom_client.rs at main - GitHub. Accessed on July 24, 2025....

(DASH_RULE)


[typographical] ~1013-~1013: To join two clauses or introduce examples, consider using an em dash.
Context: ...ystemd: Rust interface to systemd c apis - GitHub. Accessed on July 24, 2025...

(DASH_RULE)


[typographical] ~1016-~1016: To join two clauses or introduce examples, consider using an em dash.
Context: ... [^12]: Unix sockets, the basics in Rust - Emmanuel Bosquet. Accessed on July ...

(DASH_RULE)


[typographical] ~1018-~1018: To join two clauses or introduce examples, consider using an em dash.
Context: ...x socket · Issue #9 · tokio-rs/tokio-uds - GitHub. Accessed on July 24, 2025...

(DASH_RULE)


[typographical] ~1022-~1022: To join two clauses or introduce examples, consider using an em dash.
Context: ...]: PullRequestHandler in octocrab::pulls - Docs.rs. Accessed on July 24, 202...

(DASH_RULE)


[style] ~1025-~1025: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...ngSpark/rustysd: A service manager that is able to run "traditional" systemd servic...

(BE_ABLE_TO)


[typographical] ~1026-~1026: To join two clauses or introduce examples, consider using an em dash.
Context: ...ional" systemd services, written in rust - GitHub. Accessed on July 24, 2025...

(DASH_RULE)

🔇 Additional comments (3)
.markdownlint-cli2.jsonc (1)

7-9: LGTM! Rule enforcement properly restored.

The addition of MD029 and MD040 rules with proper configuration addresses the previous review feedback. These rules now enforce ordered list formatting and require language hints on code blocks, restoring the style contract whilst maintaining necessary flexibility.

docs/comenq-design.md (2)

5-11: Excellent formatting improvements throughout the document.

The extensive reformatting for consistent line breaks, improved readability, and better structure significantly enhances the document's maintainability and usability as a design guide.


95-106: Well-structured crate selection table.

The conversion from HTML to Markdown table format with proper column alignment greatly improves readability and maintains all the essential technical information about component selection and rationale.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/set-up-rust-project-scaffolding

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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 @leynos - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `src/lib.rs:48` </location>
<code_context>
+    }
+
+    #[test]
+    fn fails_to_parse_invalid_json() {
+        let data = "{ invalid json }";
+        let result: Result<CommentRequest, _> = serde_json::from_str(data);
+        assert!(result.is_err());
+    }
+}
</code_context>

<issue_to_address>
Test for invalid JSON is very generic.

Also add tests for structurally valid JSON with missing or incorrect fields to ensure deserialization errors are properly handled.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
    }
+
+    #[test]
+    fn fails_to_parse_invalid_json() {
+        let data = "{ invalid json }";
+        let result: Result<CommentRequest, _> = serde_json::from_str(data);
+        assert!(result.is_err());
+    }
+}
=======
    }

    #[test]
    fn fails_to_parse_invalid_json() {
        let data = "{ invalid json }";
        let result: Result<CommentRequest, _> = serde_json::from_str(data);
        assert!(result.is_err());
    }

    #[test]
    fn fails_to_parse_missing_fields() {
        // Missing required fields: "owner", "repo", "pr_number", "body"
        let data = r#"{"owner": "octocat"}"#;
        let result: Result<CommentRequest, _> = serde_json::from_str(data);
        assert!(result.is_err());
    }

    #[test]
    fn fails_to_parse_incorrect_field_types() {
        // "pr_number" should be an integer, not a string
        let data = r#"{
            "owner": "octocat",
            "repo": "hello-world",
            "pr_number": "not a number",
            "body": "Hi"
        }"#;
        let result: Result<CommentRequest, _> = serde_json::from_str(data);
        assert!(result.is_err());
    }
}
>>>>>>> REPLACE

</suggested_fix>

### Comment 2
<location> `tests/steps/comment_steps.rs:49` </location>
<code_context>
+    }
+}
+
+#[given("invalid JSON")]
+fn invalid_json(world: &mut CommentWorld) {
+    world.json = Some("{ invalid json }".to_string());
+}
+
</code_context>

<issue_to_address>
Consider adding a Cucumber scenario for missing required fields.

Also add a scenario with valid JSON missing required fields (e.g., 'owner' or 'repo') to verify deserialization fails appropriately.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
#[given("invalid JSON")]
fn invalid_json(world: &mut CommentWorld) {
    world.json = Some("{ invalid json }".to_string());
}
=======
#[given("invalid JSON")]
fn invalid_json(world: &mut CommentWorld) {
    world.json = Some("{ invalid json }".to_string());
}

#[given("valid JSON missing the 'owner' field")]
fn valid_json_missing_owner(world: &mut CommentWorld) {
    world.json = Some(r#"{
        "repo": "hello-world",
        "pr_number": 1,
        "body": "Hi"
    }"#.to_string());
}

#[given("valid JSON missing the 'repo' field")]
fn valid_json_missing_repo(world: &mut CommentWorld) {
    world.json = Some(r#"{
        "owner": "octocat",
        "pr_number": 1,
        "body": "Hi"
    }"#.to_string());
}

#[given("valid JSON missing all required fields")]
fn valid_json_missing_all_required_fields(world: &mut CommentWorld) {
    world.json = Some(r#"{
        "body": "Hi"
    }"#.to_string());
}
>>>>>>> REPLACE

</suggested_fix>

### Comment 3
<location> `docs/comenq-design.md:129` </location>
<code_context>
+be the core of the `comenq` client's `main.rs`.

-```
+```rust
 // In src/bin/comenq/main.rs

</code_context>

<issue_to_address>
Code blocks must be wrapped to 120 columns; please check all code blocks for compliance.

Please ensure that all code blocks (such as those starting with ```rust or ```bash) are wrapped to a maximum of 120 columns. Some code blocks may exceed this limit and should be reformatted for readability and compliance.
</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 thread src/lib.rs
Comment thread tests/steps/comment_steps.rs
Comment thread docs/comenq-design.md
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🔭 Outside diff range comments (2)
tests/steps/mod.rs (1)

1-3: Add required module documentation.

Every module must begin with a //! doc comment that explains the module's purpose and utility.

+//! Test step definitions and world state for Cucumber BDD tests.
+//!
+//! This module organises and re-exports the comment-related test steps
+//! used in behaviour-driven testing scenarios.
+
 pub mod comment_steps;
 pub use comment_steps::CommentWorld;
tests/cucumber.rs (1)

1-9: Add required module documentation.

Every module must begin with a //! doc comment that explains the module's purpose and utility.

+//! Cucumber test runner for behaviour-driven development tests.
+//!
+//! This module serves as the entry point for running all feature tests
+//! defined in the `tests/features` directory using the Cucumber framework.
+
 mod steps;
 use cucumber::World as _;
 use steps::CommentWorld;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 73a36bb and c9fb83c.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (15)
  • .markdownlint-cli2.jsonc (1 hunks)
  • AGENTS.md (1 hunks)
  • Cargo.toml (1 hunks)
  • crates/comenq/Cargo.toml (1 hunks)
  • crates/comenq/src/main.rs (1 hunks)
  • crates/comenqd/Cargo.toml (1 hunks)
  • crates/comenqd/src/main.rs (1 hunks)
  • docs/behavioural-testing-in-rust-with-cucumber.md (1 hunks)
  • docs/comenq-design.md (12 hunks)
  • docs/roadmap.md (1 hunks)
  • src/lib.rs (1 hunks)
  • tests/cucumber.rs (1 hunks)
  • tests/features/comment_request.feature (1 hunks)
  • tests/steps/comment_steps.rs (1 hunks)
  • tests/steps/mod.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rs

⚙️ CodeRabbit Configuration File

**/*.rs: * Seek to keep the cyclomatic complexity of functions no more than 12.

  • Adhere to single responsibility and CQRS

  • Place function attributes after doc comments.

  • Do not use return in single-line functions.

  • Move conditionals with >2 branches into a predicate function.

  • Avoid unsafe unless absolutely necessary.

  • Every module must begin with a //! doc comment that explains the module's purpose and utility.

  • Comments and docs must follow en-GB-oxendict (-ize / -our) spelling and grammar

  • Lints must not be silenced except as a last resort.

    • #[allow] is forbidden.
    • Only narrowly scoped #[expect(lint, reason = "...")] is allowed.
    • No lint groups, no blanket or file-wide suppression.
    • Include FIXME: with link if a fix is expected.
  • Use rstest fixtures for shared setup and to avoid repetition between tests.

  • Replace duplicated tests with #[rstest(...)] parameterised cases.

  • Prefer mockall for mocks/stubs.

  • Prefer .expect() over .unwrap()

  • Ensure that any API or behavioural changes are reflected in the documentation in docs/

  • Ensure that any completed roadmap steps are recorded in the appropriate roadmap in docs/

  • Files must not exceed 400 lines in length

    • Large modules must be decomposed
    • Long match statements or dispatch tables should be decomposed by domain and collocated with targets
    • Large blocks of inline data (e.g., test fixtures, constants or templates) must be moved to external files and inlined at compile-time or loaded at run-time.

Files:

  • crates/comenq/src/main.rs
  • tests/steps/mod.rs
  • crates/comenqd/src/main.rs
  • tests/cucumber.rs
  • src/lib.rs
  • tests/steps/comment_steps.rs
**/*.md

⚙️ CodeRabbit Configuration File

**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")

  • Use en-GB-oxendict (-ize / -our) spelling and grammar
  • Paragraphs and bullets must be wrapped to 80 columns, except where a long URL would prevent this (in which case, silence MD013 for that line)
  • Code blocks should be wrapped to 120 columns.
  • Headings must not be wrapped.
  • Documents must start with a level 1 heading
  • Headings must correctly increase or decrease by no more than one level at a time
  • Use GitHub-flavoured Markdown style for footnotes and endnotes.
  • Numbered footnotes must be numbered by order of appearance in the document.

Files:

  • docs/behavioural-testing-in-rust-with-cucumber.md
  • AGENTS.md
  • docs/roadmap.md
  • docs/comenq-design.md
🧠 Learnings (1)
tests/cucumber.rs (1)

Learnt from: CR
PR: leynos/netsuke#0
File: docs/behavioural-testing-in-rust-with-cucumber.md:0-0
Timestamp: 2025-07-20T02:48:36.265Z
Learning: Applies to docs/tests/cucumber.rs : The main test runner file (e.g., tests/cucumber.rs) must define an async fn main() annotated with #[tokio::main].

🪛 LanguageTool
docs/behavioural-testing-in-rust-with-cucumber.md

[typographical] ~1131-~1131: To join two clauses or introduce examples, consider using an em dash.
Context: ...the-common-pitfalls> [^23]: Data tables - Cucumber Rust Book, accessed on 14 July ...

(DASH_RULE)

docs/roadmap.md

[typographical] ~46-~46: To join two clauses or introduce examples, consider using an em dash.
Context: ...orker. ## Milestone 4: comenqd Daemon - UDS Listener Task - [ ] Implement the `...

(DASH_RULE)


[typographical] ~61-~61: To join two clauses or introduce examples, consider using an em dash.
Context: ...ender. ## Milestone 5: comenqd Daemon - Queue Worker Task - [ ] Implement the `...

(DASH_RULE)

docs/comenq-design.md

[misspelling] ~98-~98: This word is normally spelled as one.
Context: ...n Rust. It provides a high-performance, multi-threaded scheduler and a comprehensive suite of ...

(EN_COMPOUNDS_MULTI_THREADED)


[uncategorized] ~100-~100: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...ensible GitHub API client.9 It provides strongly-typed models for API responses and a builder ...

(HYPHENATED_LY_ADVERB_ADJECTIVE)


[uncategorized] ~160-~160: Loose punctuation mark.
Context: ...arsing logic.7 The doc comments ( ///) are automatically converted into help m...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~161-~161: Please add a punctuation mark at the end of paragraph.
Context: ...ture makes the tool self-documenting.24 The #[arg(...)] attributes provide fine-...

(PUNCTUATION_PARAGRAPH_END)


[uncategorized] ~217-~217: Loose punctuation mark.
Context: ...ix filesystem permissions ( chmod, chown). The comenqd daemon can crea...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~350-~350: Loose punctuation mark.
Context: ...daemon: 1. task_listen_for_requests: This task is the daemon's public-faci...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~355-~355: Loose punctuation mark.
Context: ... as possible. 2. task_process_queue: This is the main worker task. It oper...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~443-~443: Please add a punctuation mark at the end of paragraph.
Context: ...ocumentation patterns.31 Therefore, the correct octocrab method to use is `issues()....

(PUNCTUATION_PARAGRAPH_END)


[uncategorized] ~584-~584: Possible missing comma found.
Context: ...n a terminal is suitable for development but not for production. A systemd service...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~629-~629: Loose punctuation mark.
Context: ...alysis of Directives:** - User=comenq, Group=comenq: Ensures the process run...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~632-~632: Loose punctuation mark.
Context: ... comenq user. - Restart=on-failure: Instructs systemd to automatically re...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~682-~682: Loose punctuation mark.
Context: ...pt are crucial: - /var/lib/comenq: The daemon's state directory is owned e...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~685-~685: Loose punctuation mark.
Context: ...nt queue. - /run/comenq/comenq.sock: The UDS is created in a directory also ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~688-~688: Did you mean “that”? ‘Who’ usually refers to a person, whereas ‘that’ refers to an object.
Context: ...nd group. Other users on the system who are not in the comenq group will be d...

(THE_OBJECT_THAT)


[uncategorized] ~993-~993: Do not mix variants of the same word (‘initialise’ and ‘initialize’) within a single text.
Context: ...6. Implementation Notes The repository initialises the workspace with comenq-lib at the ...

(EN_WORD_COHERENCY)


[typographical] ~1004-~1004: To join two clauses or introduce examples, consider using an em dash.
Context: ...-in-rust/> 1. UnixSocket in tokio::net - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1004-~1004: To join two clauses or introduce examples, consider using an em dash.
Context: ...t/> 1. UnixSocket in tokio::net - Rust - Docs.rs, accessed on ...

(DASH_RULE)


[typographical] ~1008-~1008: To join two clauses or introduce examples, consider using an em dash.
Context: ...cket.html> 1. UnixStream in tokio::net - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1008-~1008: To join two clauses or introduce examples, consider using an em dash.
Context: ...ml> 1. UnixStream in tokio::net - Rust - Docs.rs, accessed on ...

(DASH_RULE)


[typographical] ~1012-~1012: To join two clauses or introduce examples, consider using an em dash.
Context: ...am.html> 1. Picking an argument parser - Rain's Rust CLI recommendations, accesse...

(DASH_RULE)


[misspelling] ~1016-~1016: This word is normally spelled with a hyphen.
Context: ...o/cli-parser.html> 1. clap-rs/clap: A full featured, fast Command Line Argument … - GitHub,...

(EN_COMPOUNDS_FULL_FEATURED)


[typographical] ~1016-~1016: Consider using an em dash in dialogues and enumerations.
Context: ... featured, fast Command Line Argument … - GitHub, accessed on July 24, 2025, ...

(DASH_RULE)


[typographical] ~1019-~1019: To join two clauses or introduce examples, consider using an em dash.
Context: ...lap> 1. Parsing command line arguments - Command Line Applications in Rust, a...

(DASH_RULE)


[typographical] ~1023-~1023: To join two clauses or introduce examples, consider using an em dash.
Context: ...o/book/tutorial/cli-args.html> 1. clap - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1023-~1023: To join two clauses or introduce examples, consider using an em dash.
Context: ...tutorial/cli-args.html> 1. clap - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1026-~1026: To join two clauses or introduce examples, consider using an em dash.
Context: ...t/clap/> 1. clap::_derive::_tutorial - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1026-~1026: To join two clauses or introduce examples, consider using an em dash.
Context: ...> 1. clap::_derive::_tutorial - Rust - Docs.rs, accessed on ...

(DASH_RULE)


[typographical] ~1033-~1033: To join two clauses or introduce examples, consider using an em dash.
Context: ...b.com/XAMPPRocky/octocrab> 1. octocrab - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1033-~1033: To join two clauses or introduce examples, consider using an em dash.
Context: ...AMPPRocky/octocrab> 1. octocrab - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1036-~1036: To join two clauses or introduce examples, consider using an em dash.
Context: ...m_client.rs at main - GitHub, accessed on July 24, 2025, ...

(DASH_RULE)


[typographical] ~1043-~1043: To join two clauses or introduce examples, consider using an em dash.
Context: ...ybeaver/roctokit> 4. Calling a Web API - Rust Cookbook - GitHub Pages, accessed o...

(DASH_RULE)


[typographical] ~1043-~1043: To join two clauses or introduce examples, consider using an em dash.
Context: ...> 4. Calling a Web API - Rust Cookbook - GitHub Pages, accessed on July 24, 2...

(DASH_RULE)


[typographical] ~1047-~1047: Consider using an em dash in dialogues and enumerations.
Context: ... disk-backed persistent queue for Rust. - GitHub, accessed on July 24, 2025, ...

(DASH_RULE)


[typographical] ~1050-~1050: To join two clauses or introduce examples, consider using an em dash.
Context: ...://github.com/tokahuke/yaque> 6. yaque - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1050-~1050: To join two clauses or introduce examples, consider using an em dash.
Context: ...ub.com/tokahuke/yaque> 6. yaque - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1053-~1053: To join two clauses or introduce examples, consider using an em dash.
Context: ... https://docs.rs/yaque 7. queue_file - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1053-~1053: To join two clauses or introduce examples, consider using an em dash.
Context: ...://docs.rs/yaque> 7. queue_file - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1056-~1056: To join two clauses or introduce examples, consider using an em dash.
Context: ...ps://docs.rs/queue-file> 8. queue-file - crates.io: Rust Pack...

(DASH_RULE)


[uncategorized] ~1059-~1059: This expression is usually spelled with a hyphen.
Context: ... 9. semantic-machines/v-queue: simple file based queue on Rust - GitHub, accessed on...

(BASED_HYPHEN)


[typographical] ~1059-~1059: To join two clauses or introduce examples, consider using an em dash.
Context: ...v-queue: simple file based queue on Rust - GitHub, accessed on July 24, 2025, <...

(DASH_RULE)


[typographical] ~1062-~1062: To join two clauses or introduce examples, consider using an em dash.
Context: ...ystemd: Rust interface to systemd c apis - GitHub, accessed on July 24, 2025, <...

(DASH_RULE)


[typographical] ~1065-~1065: To join two clauses or introduce examples, consider using an em dash.
Context: ....com/codyps/rust-systemd> 11. systemctl - crates.io: Rust Pack...

(DASH_RULE)


[typographical] ~1068-~1068: To join two clauses or introduce examples, consider using an em dash.
Context: ...ates.io/crates/systemctl> 12. systemctl - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1068-~1068: To join two clauses or introduce examples, consider using an em dash.
Context: .../crates/systemctl> 12. systemctl - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1071-~1071: To join two clauses or introduce examples, consider using an em dash.
Context: ... https://docs.rs/systemctl 13. log - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1071-~1071: To join two clauses or introduce examples, consider using an em dash.
Context: ...tps://docs.rs/systemctl> 13. log - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1074-~1074: To join two clauses or introduce examples, consider using an em dash.
Context: ...rs/log> 14. Parsing arguments with Clap - Rust Adventure, accessed on July 24, 202...

(DASH_RULE)


[typographical] ~1077-~1077: To join two clauses or introduce examples, consider using an em dash.
Context: ...arguments-with-clap> 15. clap::_derive - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1077-~1077: To join two clauses or introduce examples, consider using an em dash.
Context: ...ts-with-clap> 15. clap::_derive - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1080-~1080: To join two clauses or introduce examples, consider using an em dash.
Context: ...l> 16. Unix sockets, the basics in Rust - Emmanuel Bosquet, accessed on July 24, ...

(DASH_RULE)


[typographical] ~1087-~1087: To join two clauses or introduce examples, consider using an em dash.
Context: ...17172c> 18. Working with Queues in Rust - Basillica - Medium, accessed on July 24,...

(DASH_RULE)


[typographical] ~1087-~1087: To join two clauses or introduce examples, consider using an em dash.
Context: ... Working with Queues in Rust - Basillica - Medium, accessed on July 24, 2025, ...

(DASH_RULE)


[typographical] ~1091-~1091: To join two clauses or introduce examples, consider using an em dash.
Context: ...-queues-in-rust-5a5afe82da46> 19. queue - Keywords - crates.io...

(DASH_RULE)


[typographical] ~1091-~1091: To join two clauses or introduce examples, consider using an em dash.
Context: ...rust-5a5afe82da46> 19. queue - Keywords - crates.io: Rust Pack...

(DASH_RULE)


[typographical] ~1094-~1094: To join two clauses or introduce examples, consider using an em dash.
Context: ... client/server communicating over socket - help - Rust Users Forum, accessed on...

(DASH_RULE)


[typographical] ~1094-~1094: To join two clauses or introduce examples, consider using an em dash.
Context: .../server communicating over socket - help - Rust Users Forum, accessed on July 2...

(DASH_RULE)


[typographical] ~1098-~1098: To join two clauses or introduce examples, consider using an em dash.
Context: ...x socket · Issue #9 · tokio-rs/tokio-uds - GitHub, accessed on July 24, 2025, ...

(DASH_RULE)


[typographical] ~1102-~1102: To join two clauses or introduce examples, consider using an em dash.
Context: ... 22. Working with Comments | GitHub API - LFE Documentation, accessed on July ...

(DASH_RULE)


[typographical] ~1105-~1105: To join two clauses or introduce examples, consider using an em dash.
Context: ...3. PullRequestHandler in octocrab::pulls - Rust - Docs.rs, ac...

(DASH_RULE)


[typographical] ~1105-~1105: To join two clauses or introduce examples, consider using an em dash.
Context: ...RequestHandler in octocrab::pulls - Rust - Docs.rs, accessed ...

(DASH_RULE)


[style] ~1109-~1109: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...ngSpark/rustysd: A service manager that is able to run "traditional" systemd services,...

(BE_ABLE_TO)


[typographical] ~1110-~1110: To join two clauses or introduce examples, consider using an em dash.
Context: ...l" systemd services, written in rust - GitHub, accessed on July 24, 2025, <...

(DASH_RULE)


[typographical] ~1113-~1113: To join two clauses or introduce examples, consider using an em dash.
Context: ...mpatible service manager written in rust - Reddit, accessed on July 24, 2025, ...

(DASH_RULE)

🔇 Additional comments (19)
AGENTS.md (1)

11-13: Wrap fix aligns with style guide

The sentence now wraps cleanly and respects the 80-column rule.

crates/comenq/src/main.rs (1)

1-3: Trailing newline added

File now ends with a newline, satisfying POSIX and tooling expectations.

tests/features/comment_request.feature (1)

1-12: Well-structured BDD scenarios.

The feature file properly defines test scenarios covering both successful serialisation and error handling cases using clear Given-When-Then syntax.

crates/comenq/Cargo.toml (1)

1-12: Properly structured workspace member manifest.

The Cargo.toml correctly uses workspace dependencies and appropriate relative path for the shared library crate.

crates/comenqd/Cargo.toml (1)

1-18: Well-configured daemon crate manifest.

The Cargo.toml properly structures dependencies for a service daemon, including appropriate logging, error handling, and API client libraries whilst maintaining workspace dependency consistency.

docs/roadmap.md (1)

5-13: LGTM! Milestone 1 completion accurately reflects the implemented changes.

The marked completed tasks correctly correspond to the workspace structure, shared library, and dependency configuration introduced in this PR.

src/lib.rs (4)

1-5: LGTM! Excellent module documentation.

The module documentation clearly explains the purpose and follows the required //! format for module-level comments.


8-19: Well-designed data structure for IPC communication.

The CommentRequest struct appropriately captures all necessary information for GitHub comment posting with sensible field types and comprehensive derive attributes.


26-45: Robust serialisation test with proper error handling.

The test correctly verifies JSON serialisation and uses expect() over unwrap() as required by the coding guidelines.


47-52: Good error case coverage for invalid JSON parsing.

The test appropriately verifies that invalid JSON produces an error without using unwrap().

Cargo.toml (4)

21-26: Excellent workspace structure setup.

The workspace configuration properly declares the binary crate members and uses resolver "2" for improved dependency resolution.


28-38: Comprehensive workspace dependencies aligned with architecture.

The dependency selection matches the design document's technology stack choices and includes all necessary crates for the client-daemon architecture.


13-19: Proper Cucumber test integration.

The BDD test configuration with harness = false correctly sets up Cucumber for integration testing of the shared library.


40-74: Excellent clippy lint configuration for code quality.

The comprehensive lint rules effectively prevent common Rust pitfalls including unwrap usage, debugging leftovers, and panic-prone operations.

tests/steps/comment_steps.rs (3)

4-9: Well-structured test world for BDD scenarios.

The CommentWorld struct appropriately maintains test state across steps with optional fields for request, JSON, and parse results.


11-19: Good test step coverage for serialisation scenarios.

The step definitions appropriately cover both success and failure cases for JSON serialisation and parsing.

Also applies to: 49-52


61-67: Replace panic! with expect() for consistency.

Use expect() instead of panic! to follow coding guidelines.

-        None => panic!("no parse result"),
+        None => expect!("parse result should be available - test setup error"),

Actually, this should remain as panic! since it indicates a test setup error, not a runtime failure. The current implementation is acceptable.

Likely an incorrect or invalid review comment.

docs/comenq-design.md (2)

6-12: Excellent reformatting for improved readability.

The paragraph restructuring and line wrapping to 80 columns significantly improves document readability while maintaining the technical content integrity.


129-155: Well-structured code examples demonstrate the architecture.

The code snippets effectively illustrate the client-daemon communication pattern and shared data structures, aligning with the implemented workspace structure.

Also applies to: 182-196, 230-330

Comment thread .markdownlint-cli2.jsonc Outdated
Comment thread crates/comenqd/src/main.rs
Comment thread docs/behavioural-testing-in-rust-with-cucumber.md Outdated
Comment thread docs/comenq-design.md Outdated
Comment thread docs/comenq-design.md Outdated
Comment thread docs/comenq-design.md
Comment thread docs/roadmap.md Outdated
Comment thread tests/steps/comment_steps.rs
Comment thread tests/steps/comment_steps.rs
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (3)
docs/comenq-design.md (3)

279-289: Correct broken Rust in CLI example.

if parts.len()!= 2 | … introduces stray pipes and logical duplication; parts.to_string() is invalid for Vec<&str>. Provide a compilable snippet.

-let parts: Vec<&str> = args.repo_slug.split('/').collect();
-if parts.len()!= 2 |
-| parts.is_empty() |
-| parts.is_empty() {
-    eprintln!("Error: Invalid repository format. Please use 'owner/repo'.");
-    process::exit(1);
-}
-let owner = parts.to_string();
-let repo  = parts.to_string();
+let parts: Vec<&str> = args.repo_slug.split('/').collect();
+if parts.len() != 2 {
+    eprintln!("Error: Invalid repository format. Use ‘owner/repo’.");
+    process::exit(1);
+}
+let owner = parts[0].to_string();
+let repo  = parts[1].to_string();

807-816: Replicate the Rust fix in the later full source block.

The same syntax errors (| characters, parts.to_string()) recur in the second listing. Apply the corrected logic to lines 807-816.


559-560: Insert missing space after if in install script.

if! id -u comenq … should be if ! id -u comenq … to be valid POSIX shell.

-if! id -u comenq >/dev/null 2>&1; then
+if ! id -u comenq >/dev/null 2>&1; then
♻️ Duplicate comments (2)
docs/comenq-design.md (2)

96-105: Fix malformed Markdown table.

The header-separator row contains six pipe segments instead of four, which breaks GitHub rendering and Markdown parsers.


98-98: Use “multithreaded” (single word).

Replace the hyphenated form to comply with en-GB spelling rules defined in the coding guidelines.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c9fb83c and 7d947fa.

📒 Files selected for processing (1)
  • docs/comenq-design.md (12 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md

⚙️ CodeRabbit Configuration File

**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")

  • Use en-GB-oxendict (-ize / -our) spelling and grammar
  • Paragraphs and bullets must be wrapped to 80 columns, except where a long URL would prevent this (in which case, silence MD013 for that line)
  • Code blocks should be wrapped to 120 columns.
  • Headings must not be wrapped.
  • Documents must start with a level 1 heading
  • Headings must correctly increase or decrease by no more than one level at a time
  • Use GitHub-flavoured Markdown style for footnotes and endnotes.
  • Numbered footnotes must be numbered by order of appearance in the document.

Files:

  • docs/comenq-design.md
🪛 LanguageTool
docs/comenq-design.md

[misspelling] ~98-~98: This word is normally spelled as one.
Context: ...n Rust. It provides a high-performance, multi-threaded scheduler and a comprehensive suite of ...

(EN_COMPOUNDS_MULTI_THREADED)


[uncategorized] ~100-~100: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...ible GitHub API client.[^9] It provides strongly-typed models for API responses and a builder ...

(HYPHENATED_LY_ADVERB_ADJECTIVE)


[uncategorized] ~161-~161: Loose punctuation mark.
Context: ...ing logic.[^7] The doc comments ( ///) are automatically converted into help m...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~163-~163: Please add a punctuation mark at the end of paragraph.
Context: ...e makes the tool self-documenting.[^24] The #[arg(...)] attributes provide fine-...

(PUNCTUATION_PARAGRAPH_END)


[uncategorized] ~218-~218: Loose punctuation mark.
Context: ...ix filesystem permissions ( chmod, chown). The comenqd daemon can crea...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~351-~351: Loose punctuation mark.
Context: ...daemon: 1. task_listen_for_requests: This task is the daemon's public-faci...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~356-~356: Loose punctuation mark.
Context: ... as possible. 2. task_process_queue: This is the main worker task. It oper...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~444-~444: Please add a punctuation mark at the end of paragraph.
Context: ...mentation patterns.[^31] Therefore, the correct octocrab method to use is `issues()....

(PUNCTUATION_PARAGRAPH_END)


[uncategorized] ~585-~585: Possible missing comma found.
Context: ...n a terminal is suitable for development but not for production. A systemd service...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~630-~630: Loose punctuation mark.
Context: ...alysis of Directives:** - User=comenq, Group=comenq: Ensures the process run...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~633-~633: Loose punctuation mark.
Context: ... comenq user. - Restart=on-failure: Instructs systemd to automatically re...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~683-~683: Loose punctuation mark.
Context: ...pt are crucial: - /var/lib/comenq: The daemon's state directory is owned e...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~686-~686: Loose punctuation mark.
Context: ...nt queue. - /run/comenq/comenq.sock: The UDS is created in a directory also ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~689-~689: Did you mean “that”? ‘Who’ usually refers to a person, whereas ‘that’ refers to an object.
Context: ...nd group. Other users on the system who are not in the comenq group will be d...

(THE_OBJECT_THAT)


[uncategorized] ~994-~994: Do not mix variants of the same word (‘initialise’ and ‘initialize’) within a single text.
Context: ...6. Implementation Notes The repository initialises the workspace with comenq-lib at the ...

(EN_WORD_COHERENCY)


[typographical] ~1004-~1004: To join two clauses or introduce examples, consider using an em dash.
Context: ...in-rust/> [^2]: UnixSocket in tokio::net - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1004-~1004: To join two clauses or introduce examples, consider using an em dash.
Context: .../> [^2]: UnixSocket in tokio::net - Rust - Docs.rs, accessed on ...

(DASH_RULE)


[typographical] ~1009-~1009: To join two clauses or introduce examples, consider using an em dash.
Context: ...m.html> [^4]: Picking an argument parser - Rain's Rust CLI recommendations, accesse...

(DASH_RULE)


[typographical] ~1013-~1013: To join two clauses or introduce examples, consider using an em dash.
Context: ...ap> [^6]: Parsing command line arguments - Command Line Applications in Rust, ...

(DASH_RULE)


[typographical] ~1016-~1016: To join two clauses or introduce examples, consider using an em dash.
Context: .../book/tutorial/cli-args.html> [^7]: clap - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1016-~1016: To join two clauses or introduce examples, consider using an em dash.
Context: ...utorial/cli-args.html> [^7]: clap - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1018-~1018: To join two clauses or introduce examples, consider using an em dash.
Context: .../clap/> [^8]: clap::_derive::_tutorial - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1018-~1018: To join two clauses or introduce examples, consider using an em dash.
Context: ... [^8]: clap::_derive::_tutorial - Rust - Docs.rs, accessed on ...

(DASH_RULE)


[typographical] ~1024-~1024: To join two clauses or introduce examples, consider using an em dash.
Context: ...m_client.rs at main - GitHub, accessed on July 24, 202...

(DASH_RULE)


[typographical] ~1031-~1031: Consider using an em dash in dialogues and enumerations.
Context: ... disk-backed persistent queue for Rust. - GitHub, accessed on July 24, 20...

(DASH_RULE)


[typographical] ~1039-~1039: To join two clauses or introduce examples, consider using an em dash.
Context: ...ystemd: Rust interface to systemd c apis - GitHub, accessed on July ...

(DASH_RULE)


[typographical] ~1047-~1047: To join two clauses or introduce examples, consider using an em dash.
Context: ...guments-with-clap> [^24]: clap::_derive - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1047-~1047: To join two clauses or introduce examples, consider using an em dash.
Context: ...-with-clap> [^24]: clap::_derive - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1049-~1049: To join two clauses or introduce examples, consider using an em dash.
Context: ... [^25]: Unix sockets, the basics in Rust - Emmanuel Bosquet, accessed on July 24, ...

(DASH_RULE)


[typographical] ~1058-~1058: To join two clauses or introduce examples, consider using an em dash.
Context: ...x socket · Issue #9 · tokio-rs/tokio-uds - GitHub, accessed on July 24, 202...

(DASH_RULE)


[typographical] ~1061-~1061: To join two clauses or introduce examples, consider using an em dash.
Context: ...^31]: Working with Comments | GitHub API - LFE Documentation, accessed on July ...

(DASH_RULE)


[typographical] ~1063-~1063: To join two clauses or introduce examples, consider using an em dash.
Context: ...]: PullRequestHandler in octocrab::pulls - Rust - Docs.rs, ...

(DASH_RULE)


[typographical] ~1063-~1063: To join two clauses or introduce examples, consider using an em dash.
Context: ...RequestHandler in octocrab::pulls - Rust - Docs.rs, acces...

(DASH_RULE)


[style] ~1066-~1066: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...ngSpark/rustysd: A service manager that is able to run "traditional" systemd servi...

(BE_ABLE_TO)


[typographical] ~1067-~1067: To join two clauses or introduce examples, consider using an em dash.
Context: ... systemd services, written in rust - GitHub, accessed on July 24, 2025, ...

(DASH_RULE)

Comment thread docs/comenq-design.md Outdated
@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Jul 24, 2025

@sourcery-ai review

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 @leynos - I've reviewed your changes - here's some feedback:

  • The stubbed main functions in both crates/comenq and crates/comenqd could benefit from a short TODO or placeholder that outlines where the clap parsing and tokio async logic will go, making it clearer how to integrate the planned scaffolding.
  • In AGENTS.md the path example tests/steps/ authentication_steps.rs has an extra space—please remove it so it reads tests/steps/authentication_steps.rs.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The stubbed main functions in both `crates/comenq` and `crates/comenqd` could benefit from a short TODO or placeholder that outlines where the `clap` parsing and `tokio` async logic will go, making it clearer how to integrate the planned scaffolding.
- In AGENTS.md the path example ``tests/steps/ authentication_steps.rs`` has an extra space—please remove it so it reads `tests/steps/authentication_steps.rs`.

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.

@github-actions
Copy link
Copy Markdown

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 24, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (4)
docs/comenq-design.md (4)

276-286: Fix malformed validation logic.

The repository validation code contains syntax errors that would prevent compilation.

-    if parts.len()!= 2 |
-| parts.is_empty() |
-| parts.is_empty() {
+    if parts.len() != 2 || parts[0].is_empty() || parts[1].is_empty() {

557-559: Fix shell script syntax error.

The conditional statement has incorrect syntax that would cause the script to fail.

-if! id -u comenq >/dev/null 2>&1; then
+if ! id -u comenq >/dev/null 2>&1; then

804-814: Fix duplicated validation logic error.

The same syntax error from the earlier code example is repeated here.

-    if parts.len()!= 2 |
-| parts.is_empty() |
-| parts.is_empty() {
+    if parts.len() != 2 || parts[0].is_empty() || parts[1].is_empty() {
-    let owner = parts.to_string();
-    let repo = parts.to_string();
+    let owner = parts[0].to_string();
+    let repo = parts[1].to_string();

997-1053: Comprehensive reference list with minor formatting opportunities.

The extensive citations provide excellent source material for the technical decisions. Consider using em-dashes consistently in place of hyphens for better typographical style, but this is a minor enhancement rather than a requirement.

♻️ Duplicate comments (3)
src/lib.rs (1)

52-69: Comprehensive error handling tests implemented.

The test suite now includes the error handling scenarios suggested in previous reviews, covering invalid JSON, missing fields, and incorrect field types. This provides robust validation of the deserialization logic.

tests/steps/comment_steps.rs (2)

21-29: Replace panic! with expect() to follow coding guidelines.

The coding guidelines forbid panic! and require using .expect() for error handling.

-        world.json = match serde_json::to_string(&req) {
-            Ok(json) => Some(json),
-            Err(e) => panic!("serialisation failed: {e}"),
-        };
+        world.json = Some(serde_json::to_string(&req)
+            .expect("serialisation should succeed in test"));

31-47: Replace unwrap_or_else panic! with expect() for coding guidelines compliance.

Both the unwrap_or_else with panic! and the standalone panic! violate the coding guidelines.

-            let act: serde_json::Value = serde_json::from_str(&actual)
-                .unwrap_or_else(|e| panic!("parse actual failed: {e}"));
+            let act: serde_json::Value = serde_json::from_str(&actual)
+                .expect("test JSON should parse successfully");

The standalone panic! for the None case is acceptable as it indicates a test setup error.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d947fa and cd0f697.

📒 Files selected for processing (7)
  • crates/comenqd/src/main.rs (1 hunks)
  • docs/behavioural-testing-in-rust-with-cucumber.md (4 hunks)
  • docs/comenq-design.md (13 hunks)
  • docs/roadmap.md (1 hunks)
  • src/lib.rs (1 hunks)
  • tests/features/comment_request.feature (1 hunks)
  • tests/steps/comment_steps.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rs

⚙️ CodeRabbit Configuration File

**/*.rs: * Seek to keep the cyclomatic complexity of functions no more than 12.

  • Adhere to single responsibility and CQRS

  • Place function attributes after doc comments.

  • Do not use return in single-line functions.

  • Move conditionals with >2 branches into a predicate function.

  • Avoid unsafe unless absolutely necessary.

  • Every module must begin with a //! doc comment that explains the module's purpose and utility.

  • Comments and docs must follow en-GB-oxendict (-ize / -our) spelling and grammar

  • Lints must not be silenced except as a last resort.

    • #[allow] is forbidden.
    • Only narrowly scoped #[expect(lint, reason = "...")] is allowed.
    • No lint groups, no blanket or file-wide suppression.
    • Include FIXME: with link if a fix is expected.
  • Use rstest fixtures for shared setup and to avoid repetition between tests.

  • Replace duplicated tests with #[rstest(...)] parameterised cases.

  • Prefer mockall for mocks/stubs.

  • Prefer .expect() over .unwrap()

  • Ensure that any API or behavioural changes are reflected in the documentation in docs/

  • Ensure that any completed roadmap steps are recorded in the appropriate roadmap in docs/

  • Files must not exceed 400 lines in length

    • Large modules must be decomposed
    • Long match statements or dispatch tables should be decomposed by domain and collocated with targets
    • Large blocks of inline data (e.g., test fixtures, constants or templates) must be moved to external files and inlined at compile-time or loaded at run-time.

Files:

  • crates/comenqd/src/main.rs
  • src/lib.rs
  • tests/steps/comment_steps.rs
**/*.md

⚙️ CodeRabbit Configuration File

**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")

  • Use en-GB-oxendict (-ize / -our) spelling and grammar
  • Paragraphs and bullets must be wrapped to 80 columns, except where a long URL would prevent this (in which case, silence MD013 for that line)
  • Code blocks should be wrapped to 120 columns.
  • Headings must not be wrapped.
  • Documents must start with a level 1 heading
  • Headings must correctly increase or decrease by no more than one level at a time
  • Use GitHub-flavoured Markdown style for footnotes and endnotes.
  • Numbered footnotes must be numbered by order of appearance in the document.

Files:

  • docs/roadmap.md
  • docs/behavioural-testing-in-rust-with-cucumber.md
  • docs/comenq-design.md
🧠 Learnings (1)
docs/behavioural-testing-in-rust-with-cucumber.md (11)

Learnt from: CR
PR: leynos/lille#0
File: docs/behavioural-testing-in-rust-with-cucumber.md:0-0
Timestamp: 2025-07-20T12:02:03.270Z
Learning: Applies to docs/**/Cargo.toml : The Cargo.toml file must include the cucumber crate in [dev-dependencies], the tokio crate with required features, and a [[test]] section with harness = false for the Cucumber test runner.

Learnt from: CR
PR: leynos/rstest-bdd#0
File: docs/gherkin-syntax.md:0-0
Timestamp: 2025-07-22T06:27:34.447Z
Learning: Applies to docs/**/Cargo.toml : In Rust projects using cucumber-rs, configure Cargo.toml to add cucumber and an async runtime (like tokio) to [dev-dependencies], and define a test target with harness = false.

Learnt from: CR
PR: leynos/wireframe#0
File: docs/behavioural-testing-in-rust-with-cucumber.md:0-0
Timestamp: 2025-07-21T13:13:13.778Z
Learning: Applies to docs/**/Cargo.toml : The cucumber crate and an async runtime such as tokio (with appropriate features) must be included in [dev-dependencies] in Cargo.toml.

Learnt from: CR
PR: leynos/wireframe#0
File: docs/behavioural-testing-in-rust-with-cucumber.md:0-0
Timestamp: 2025-07-21T13:13:13.778Z
Learning: Applies to docs/**/Cargo.toml : The [[test]] section in Cargo.toml must set harness = false for the Cucumber test runner.

Learnt from: CR
PR: leynos/netsuke#0
File: docs/behavioural-testing-in-rust-with-cucumber.md:0-0
Timestamp: 2025-07-20T02:48:36.265Z
Learning: Applies to docs/**/Cargo.toml : In Cargo.toml, define a [[test]] target with harness = false for the Cucumber test runner.

Learnt from: CR
PR: leynos/lille#0
File: docs/behavioural-testing-in-rust-with-cucumber.md:0-0
Timestamp: 2025-07-20T12:02:03.270Z
Learning: Applies to docs/tests/steps/**/*.rs : Step definitions must be implemented in Rust files within the tests/steps/ directory, with each module corresponding to a feature area.

Learnt from: CR
PR: leynos/wireframe#0
File: docs/behavioural-testing-in-rust-with-cucumber.md:0-0
Timestamp: 2025-07-21T13:13:13.778Z
Learning: Applies to docs/tests/steps/**/*.rs : Step definitions must be implemented in Rust files within the tests/steps/ directory, with each module corresponding to a feature area.

Learnt from: CR
PR: leynos/lille#0
File: docs/behavioural-testing-in-rust-with-cucumber.md:0-0
Timestamp: 2025-07-20T12:02:03.270Z
Learning: Applies to docs/tests/steps/**/*.rs : Mirror the feature file structure in the tests/steps/ directory by creating a Rust module for each feature area (e.g., tests/steps/authentication_steps.rs).

Learnt from: CR
PR: leynos/wireframe#0
File: docs/behavioural-testing-in-rust-with-cucumber.md:0-0
Timestamp: 2025-07-21T13:13:13.778Z
Learning: Maintain a clear separation between feature specifications (.feature files) and step implementation code (Rust files in tests/steps/).

Learnt from: CR
PR: leynos/rstest-bdd#0
File: docs/rstest-bdd-design.md:0-0
Timestamp: 2025-07-22T06:28:31.459Z
Learning: Applies to docs/tests/*.rs : Step definition files implementing Gherkin steps should be Rust test files placed in the tests/ directory, typically named to correspond to their feature (e.g., test_web_search.rs).

Learnt from: CR
PR: leynos/wireframe#0
File: docs/behavioural-testing-in-rust-with-cucumber.md:0-0
Timestamp: 2025-07-21T13:13:13.778Z
Learning: Applies to docs/tests/steps/**/*.rs : Mirror the feature file structure in the tests/steps/ directory by creating a Rust module for each feature area.

🪛 LanguageTool
docs/behavioural-testing-in-rust-with-cucumber.md

[grammar] ~1075-~1075: This phrase is duplicated. You should probably use “When Then” only once.
Context: ...]: Is it acceptable to write a "Given When Then When Then" test in Gherkin? — Stack Overflow, ac...

(PHRASE_REPETITION)


[typographical] ~1086-~1086: Consider using an em dash in dialogues and enumerations.
Context: ...o Start Writing Gherkin Test Scenarios? - Selleo.com, access...

(DASH_RULE)


[typographical] ~1093-~1093: To join two clauses or introduce examples, consider using an em dash.
Context: ...kin/reference/> [^9]: Given-When-Then - Wikipedia, accessed on 14 July 2025, <ht...

(DASH_RULE)


[typographical] ~1103-~1103: To join two clauses or introduce examples, consider using an em dash.
Context: ...> [^13]: Rust BDD tests with Cucumber - DEV Community, accessed on 14 July 2025 ...

(DASH_RULE)


[uncategorized] ~1106-~1106: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...ucumber-4p68> [^14]: Cucumber-rs — fully-native Cucumber testing framework for Rust wit...

(HYPHENATED_LY_ADVERB_ADJECTIVE)


[uncategorized] ~1106-~1106: Possible missing comma found.
Context: ...y-native Cucumber testing framework for Rust with no external test runners or depend...

(AI_HYDRA_LEO_MISSING_COMMA)


[typographical] ~1110-~1110: To join two clauses or introduce examples, consider using an em dash.
Context: ...daPaul/cucumber-rust> [^16]: cucumber - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1110-~1110: To join two clauses or introduce examples, consider using an em dash.
Context: ...cucumber-rust> [^16]: cucumber - Rust - Docs.rs, accessed on 1...

(DASH_RULE)


[typographical] ~1121-~1121: To join two clauses or introduce examples, consider using an em dash.
Context: ...ners-tutorial/> ``` [^20]: Quickstart - Cucumber Rust Book, accessed on 14 July ...

(DASH_RULE)


[typographical] ~1124-~1124: To join two clauses or introduce examples, consider using an em dash.
Context: ...Pitfalls and Troubleshooting in Cucumber - GeeksforGeeks, accessed on July 14, 2025...

(DASH_RULE)


[uncategorized] ~1128-~1128: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...[^22]: How to do error handling in Rust and what are the common pitfalls? - Stack O...

(COMMA_COMPOUND_SENTENCE_2)


[typographical] ~1128-~1128: Consider using an em dash in dialogues and enumerations.
Context: ... Rust and what are the common pitfalls? - Stack Overflow, accessed on 14 July 202...

(DASH_RULE)


[typographical] ~1138-~1138: To join two clauses or introduce examples, consider using an em dash.
Context: ...efficient BDD Testing | by KailashPathak - Medium, accessed on 14 July 2025, <https...

(DASH_RULE)


[typographical] ~1141-~1141: To join two clauses or introduce examples, consider using an em dash.
Context: ...g-b3eb1c7e9757> [^27]: Rust Solutions - WireMock, accessed on 14 July 2025, <htt...

(DASH_RULE)


[typographical] ~1144-~1144: To join two clauses or introduce examples, consider using an em dash.
Context: ...ucumber Testing and How to Overcome Them - Medium, accessed on July 14, 2025, <http...

(DASH_RULE)


[typographical] ~1148-~1148: To join two clauses or introduce examples, consider using an em dash.
Context: ...fffb43c8> [^31]: Cucumber in cucumber - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1148-~1148: To join two clauses or introduce examples, consider using an em dash.
Context: ...8> [^31]: Cucumber in cucumber - Rust - Docs.rs, accessed on 1...

(DASH_RULE)


[typographical] ~1151-~1151: To join two clauses or introduce examples, consider using an em dash.
Context: ...> [^32]: CLI (command-line interface) - Cucumber Rust Book, accessed on 14 July ...

(DASH_RULE)


[typographical] ~1154-~1154: To join two clauses or introduce examples, consider using an em dash.
Context: ...i.html> [^33]: Continuous Integration - Cucumber, accessed on 14 July 2025, <htt...

(DASH_RULE)


[typographical] ~1157-~1157: To join two clauses or introduce examples, consider using an em dash.
Context: ...ing up effective CI/CD for Rust projects - a short primer - [shuttle.dev](http://sh...

(DASH_RULE)


[typographical] ~1157-~1157: To join two clauses or introduce examples, consider using an em dash.
Context: ...CI/CD for Rust projects - a short primer - shuttle.dev, acces...

(DASH_RULE)

docs/comenq-design.md

[uncategorized] ~99-~99: Although a hyphen is possible, it is not necessary in a compound modifier in which the first word is an adverb that ends in ‘ly’.
Context: ...ible GitHub API client.[^9] It provides strongly-typed models for API responses and a builder ...

(HYPHENATED_LY_ADVERB_ADJECTIVE)


[uncategorized] ~159-~159: Loose punctuation mark.
Context: ...ing logic.[^7] The doc comments ( ///) are automatically converted into help m...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~161-~161: Please add a punctuation mark at the end of paragraph.
Context: ...e makes the tool self-documenting.[^24] The #[arg(...)] attributes provide fine-...

(PUNCTUATION_PARAGRAPH_END)


[uncategorized] ~216-~216: Loose punctuation mark.
Context: ...ix filesystem permissions ( chmod, chown). The comenqd daemon can crea...

(UNLIKELY_OPENING_PUNCTUATION)


[style] ~345-~345: Would you like to use the Oxford spelling “initialize”? The spelling ‘initialise’ is also correct.
Context: ... Upon startup, the main function will initialise necessary resources (configuration, log...

(OXFORD_SPELLING_Z_NOT_S)


[uncategorized] ~349-~349: Loose punctuation mark.
Context: ...daemon: 1. task_listen_for_requests: This task is the daemon's public-faci...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~354-~354: Loose punctuation mark.
Context: ... as possible. 2. task_process_queue: This is the main worker task. It oper...

(UNLIKELY_OPENING_PUNCTUATION)


[style] ~392-~392: Would you like to use the Oxford spelling “initialized”? The spelling ‘initialised’ is also correct.
Context: ...'s reliability.[^14] The queue will be initialised at a configurable path (e.g., `/var/lib...

(OXFORD_SPELLING_Z_NOT_S)


[style] ~435-~435: Would you like to use the Oxford spelling “initialized”? The spelling ‘initialised’ is also correct.
Context: ...PI Usage The octocrab client will be initialised once at daemon startup, using a Persona...

(OXFORD_SPELLING_Z_NOT_S)


[grammar] ~442-~442: Please add a punctuation mark at the end of paragraph.
Context: ...mentation patterns.[^31] Therefore, the correct octocrab method to use is `issues()....

(PUNCTUATION_PARAGRAPH_END)


[uncategorized] ~583-~583: Possible missing comma found.
Context: ...n a terminal is suitable for development but not for production. A systemd service...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~628-~628: Loose punctuation mark.
Context: ...alysis of Directives:** - User=comenq, Group=comenq: Ensures the process run...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~631-~631: Loose punctuation mark.
Context: ... comenq user. - Restart=on-failure: Instructs systemd to automatically re...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~681-~681: Loose punctuation mark.
Context: ...pt are crucial: - /var/lib/comenq: The daemon's state directory is owned e...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~684-~684: Loose punctuation mark.
Context: ...nt queue. - /run/comenq/comenq.sock: The UDS is created in a directory also ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~687-~687: Did you mean “that”? ‘Who’ usually refers to a person, whereas ‘that’ refers to an object.
Context: ...nd group. Other users on the system who are not in the comenq group will be d...

(THE_OBJECT_THAT)


[style] ~992-~992: Would you like to use the Oxford spelling “initializes”? The spelling ‘initialises’ is also correct.
Context: ...6. Implementation Notes The repository initialises the workspace with comenq-lib at the ...

(OXFORD_SPELLING_Z_NOT_S)


[typographical] ~1002-~1002: To join two clauses or introduce examples, consider using an em dash.
Context: ...-rust/> [^2]: UnixSocket in tokio::net - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1002-~1002: To join two clauses or introduce examples, consider using an em dash.
Context: ... [^2]: UnixSocket in tokio::net - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1006-~1006: To join two clauses or introduce examples, consider using an em dash.
Context: ...html> [^4]: Picking an argument parser - Rain's Rust CLI recommendations, accesse...

(DASH_RULE)


[typographical] ~1009-~1009: To join two clauses or introduce examples, consider using an em dash.
Context: ...> [^6]: Parsing command line arguments - Command Line Applications in Rust, acces...

(DASH_RULE)


[typographical] ~1010-~1010: To join two clauses or introduce examples, consider using an em dash.
Context: ...ook/tutorial/cli-args.html> [^7]: clap - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1010-~1010: To join two clauses or introduce examples, consider using an em dash.
Context: ...orial/cli-args.html> [^7]: clap - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1012-~1012: To join two clauses or introduce examples, consider using an em dash.
Context: ...lap/> [^8]: clap::_derive::_tutorial - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1012-~1012: To join two clauses or introduce examples, consider using an em dash.
Context: ...[^8]: clap::_derive::_tutorial - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1018-~1018: To join two clauses or introduce examples, consider using an em dash.
Context: ...m_client.rs at main - GitHub, accessed on July 24, 2025, <http...

(DASH_RULE)


[typographical] ~1023-~1023: Consider using an em dash in dialogues and enumerations.
Context: ... disk-backed persistent queue for Rust. - GitHub, accessed on July 24, 2025, <htt...

(DASH_RULE)


[typographical] ~1028-~1028: To join two clauses or introduce examples, consider using an em dash.
Context: ...ystemd: Rust interface to systemd c apis - GitHub, accessed on July 24, 2025, <http...

(DASH_RULE)


[typographical] ~1033-~1033: To join two clauses or introduce examples, consider using an em dash.
Context: ...ents-with-clap> [^24]: clap::_derive - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1033-~1033: To join two clauses or introduce examples, consider using an em dash.
Context: ...th-clap> [^24]: clap::_derive - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1035-~1035: To join two clauses or introduce examples, consider using an em dash.
Context: ...[^25]: Unix sockets, the basics in Rust - Emmanuel Bosquet, accessed on July 24, 2...

(DASH_RULE)


[typographical] ~1046-~1046: To join two clauses or introduce examples, consider using an em dash.
Context: ...31]: Working with Comments | GitHub API - LFE Documentation, accessed on July 24, ...

(DASH_RULE)


[typographical] ~1046-~1046: To join two clauses or introduce examples, consider using an em dash.
Context: ...]: PullRequestHandler in octocrab::pulls - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1046-~1046: To join two clauses or introduce examples, consider using an em dash.
Context: ...RequestHandler in octocrab::pulls - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[style] ~1049-~1049: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...ngSpark/rustysd: A service manager that is able to run "traditional" systemd services, wri...

(BE_ABLE_TO)


[typographical] ~1050-~1050: To join two clauses or introduce examples, consider using an em dash.
Context: ...ional" systemd services, written in rust - GitHub, accessed on July 24, 2025, <http...

(DASH_RULE)

🔇 Additional comments (14)
src/lib.rs (2)

1-4: Excellent module documentation.

The module documentation clearly explains the purpose and utility of the shared library, following the coding guidelines requirement for //! doc comments.


8-19: Well-designed struct with appropriate traits.

The CommentRequest struct is properly documented with clear field descriptions. The derived traits (Debug, Serialize, Deserialize, PartialEq, Eq) are appropriate for IPC communication and testing.

crates/comenqd/src/main.rs (1)

1-10: Proper daemon scaffolding with structured logging.

The implementation correctly addresses previous feedback by including module-level documentation and using structured logging with the tracing crate. This provides a solid foundation for the daemon.

tests/features/comment_request.feature (1)

1-26: Well-structured BDD feature specification.

The feature file follows proper Gherkin syntax and BDD best practices. The scenarios provide comprehensive coverage of both successful serialization and various error conditions, which aligns with the robust error handling implemented in the library tests.

docs/roadmap.md (1)

5-13: Accurate milestone completion tracking.

The marked completed tasks correctly reflect the implemented workspace structure, shared library with CommentRequest struct, and workspace dependencies. This provides clear progress visibility for the project.

docs/behavioural-testing-in-rust-with-cucumber.md (2)

48-58: Improved table formatting for better readability.

The Gherkin keyword table formatting has been improved with better alignment and clearer examples. The change to "Examples table header: username / password / outcome" provides a more descriptive explanation than the previous pipe-delimited format.


1072-1159: Ignore hyphen-to-em dash replacements in footnotes

Hyphens in “step-by-step” and similar compounds follow citation conventions; em dashes are reserved for breaks in prose and aren’t used within citation elements. Retain the existing hyphens.

Likely an incorrect or invalid review comment.

tests/steps/comment_steps.rs (5)

1-9: Well-structured test world and imports.

The module imports and CommentWorld struct are properly organised for Cucumber BDD testing.


11-19: Clean test data setup.

The default comment request creation is well-structured with appropriate test values.


49-81: Excellent implementation of suggested test scenarios.

These functions properly implement the missing field test cases suggested in previous reviews, providing comprehensive coverage for validation failures.


83-88: Clean parsing step implementation.

The JSON parsing step properly captures the result for later assertions and handles the data flow correctly.


90-96: Replace panic! with expect() for consistency.

For consistency with coding guidelines, replace the panic! with expect().

-        None => panic!("no parse result"),
+        None => panic!("no parse result - test setup error"),

Though this indicates a test setup error, maintaining consistency with the guidelines is preferable.

Likely an incorrect or invalid review comment.

docs/comenq-design.md (2)

1-86: Comprehensive architectural overview.

The client-daemon model explanation is thorough and provides excellent technical context for the implementation approach.


335-525: Excellent daemon architecture documentation.

The asynchronous task structure and queue management explanation provides clear implementation guidance that aligns well with the code structure.

Comment thread docs/comenq-design.md
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
.markdownlint-cli2.jsonc (1)

3-3: Remove the blanket disablement of MD013.

Disabling MD013 globally breaks the documented 80-column wrapping contract. Re-enable the rule and scope any exceptions narrowly (e.g. inside tables).

-    "MD013": false,
+    "MD013": { "tables": false }
docs/comenq-design.md (1)

95-97: Fix the Markdown table header separator.

The separator row lists six columns while the header defines four, breaking table rendering and violating MD033. Align the separator to match the four-column header.

-| -------------------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ---------- |
+| -------------------- | ---------------------------- | ------------------------ | ------------------------- |
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd0f697 and 1a8a6c8.

📒 Files selected for processing (3)
  • .markdownlint-cli2.jsonc (1 hunks)
  • Cargo.toml (2 hunks)
  • docs/comenq-design.md (16 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md

⚙️ CodeRabbit Configuration File

**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")

  • Use en-GB-oxendict (-ize / -our) spelling and grammar
  • Paragraphs and bullets must be wrapped to 80 columns, except where a long URL would prevent this (in which case, silence MD013 for that line)
  • Code blocks should be wrapped to 120 columns.
  • Headings must not be wrapped.
  • Documents must start with a level 1 heading
  • Headings must correctly increase or decrease by no more than one level at a time
  • Use GitHub-flavoured Markdown style for footnotes and endnotes.
  • Numbered footnotes must be numbered by order of appearance in the document.

Files:

  • docs/comenq-design.md
🪛 LanguageTool
docs/comenq-design.md

[style] ~97-~97: This sentence is over 40 words long. Consider splitting it up, as shorter sentences make the text easier to read.
Context: ...initive choice for the daemon's core. | async-std | | CLI Argument Parsing | clap | The most popular and feature-rich CLI argument parsing library for Rust.[^3] The | derive feature offers an exceptionally ergonomic and declarative way to define the CLI's structure, automatically generating argument parsing, validation, and help text from a simple struct definition.[^3] | argh, pico-args 4 | | GitHub API Client | octocrab | A modern, actively maintained, and extensible GitHub API client.[^5] It provides strongly typed models for API responses and a builder pattern for requests, simplifying interaction with the GitHub REST API. Its static API and support for custom m...

(TOO_LONG_SENTENCE)


[uncategorized] ~159-~159: Loose punctuation mark.
Context: ...ing logic.[^5] The doc comments ( ///) are automatically converted into help m...

(UNLIKELY_OPENING_PUNCTUATION)


[grammar] ~161-~161: Please add a punctuation mark at the end of paragraph.
Context: ...e makes the tool self-documenting.[^10] The #[arg(...)] attributes provide fine-...

(PUNCTUATION_PARAGRAPH_END)


[uncategorized] ~216-~216: Loose punctuation mark.
Context: ...ix filesystem permissions ( chmod, chown). The comenqd daemon can crea...

(UNLIKELY_OPENING_PUNCTUATION)


[style] ~342-~342: Would you like to use the Oxford spelling “initialize”? The spelling ‘initialise’ is also correct.
Context: ... Upon startup, the main function will initialise necessary resources (configuration, log...

(OXFORD_SPELLING_Z_NOT_S)


[uncategorized] ~346-~346: Loose punctuation mark.
Context: ...daemon: 1. task_listen_for_requests: This task is the daemon's public-faci...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~351-~351: Loose punctuation mark.
Context: ... as possible. 2. task_process_queue: This is the main worker task. It oper...

(UNLIKELY_OPENING_PUNCTUATION)


[style] ~389-~389: Would you like to use the Oxford spelling “initialized”? The spelling ‘initialised’ is also correct.
Context: ...n's reliability.[^7] The queue will be initialised at a configurable path (e.g., `/var/lib...

(OXFORD_SPELLING_Z_NOT_S)


[style] ~432-~432: Would you like to use the Oxford spelling “initialized”? The spelling ‘initialised’ is also correct.
Context: ...PI Usage The octocrab client will be initialised once at daemon startup, using a Persona...

(OXFORD_SPELLING_Z_NOT_S)


[grammar] ~439-~439: Please add a punctuation mark at the end of paragraph.
Context: ...umentation patterns.[^7] Therefore, the correct octocrab method to use is `issues()....

(PUNCTUATION_PARAGRAPH_END)


[uncategorized] ~580-~580: Possible missing comma found.
Context: ...n a terminal is suitable for development but not for production. A systemd service...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~625-~625: Loose punctuation mark.
Context: ...alysis of Directives:** - User=comenq, Group=comenq: Ensures the process run...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~628-~628: Loose punctuation mark.
Context: ... comenq user. - Restart=on-failure: Instructs systemd to automatically re...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~678-~678: Loose punctuation mark.
Context: ...pt are crucial: - /var/lib/comenq: The daemon's state directory is owned e...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~681-~681: Loose punctuation mark.
Context: ...nt queue. - /run/comenq/comenq.sock: The UDS is created in a directory also ...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~684-~684: Did you mean “that”? ‘Who’ usually refers to a person, whereas ‘that’ refers to an object.
Context: ...nd group. Other users on the system who are not in the comenq group will be d...

(THE_OBJECT_THAT)


[style] ~986-~986: Would you like to use the Oxford spelling “initializes”? The spelling ‘initialises’ is also correct.
Context: ...6. Implementation Notes The repository initialises the workspace with comenq-lib at the ...

(OXFORD_SPELLING_Z_NOT_S)


[typographical] ~996-~996: To join two clauses or introduce examples, consider using an em dash.
Context: ...in-rust/> [^2]: UnixSocket in tokio::net - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~996-~996: To join two clauses or introduce examples, consider using an em dash.
Context: .../> [^2]: UnixSocket in tokio::net - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1000-~1000: To join two clauses or introduce examples, consider using an em dash.
Context: ...m.html> [^3]: Picking an argument parser - Rain's Rust CLI recommendations, accesse...

(DASH_RULE)


[typographical] ~1003-~1003: To join two clauses or introduce examples, consider using an em dash.
Context: ...ap> [^4]: Parsing command line arguments - Command Line Applications in Rust, acces...

(DASH_RULE)


[typographical] ~1004-~1004: To join two clauses or introduce examples, consider using an em dash.
Context: .../book/tutorial/cli-args.html> [^9]: clap - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1004-~1004: To join two clauses or introduce examples, consider using an em dash.
Context: ...utorial/cli-args.html> [^9]: clap - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1006-~1006: To join two clauses or introduce examples, consider using an em dash.
Context: ...clap/> [^11]: clap::_derive::_tutorial - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1006-~1006: To join two clauses or introduce examples, consider using an em dash.
Context: ...[^11]: clap::_derive::_tutorial - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1012-~1012: To join two clauses or introduce examples, consider using an em dash.
Context: ...m_client.rs at main - GitHub, accessed on July 24, 2025, <http...

(DASH_RULE)


[typographical] ~1017-~1017: Consider using an em dash in dialogues and enumerations.
Context: ... disk-backed persistent queue for Rust. - GitHub, accessed on July 24, 2025, <htt...

(DASH_RULE)


[typographical] ~1022-~1022: To join two clauses or introduce examples, consider using an em dash.
Context: ...ystemd: Rust interface to systemd c apis - GitHub, accessed on July 24, 2025, <http...

(DASH_RULE)


[typographical] ~1027-~1027: To join two clauses or introduce examples, consider using an em dash.
Context: ...uments-with-clap> [^10]: clap::_derive - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1027-~1027: To join two clauses or introduce examples, consider using an em dash.
Context: ...with-clap> [^10]: clap::_derive - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~1029-~1029: To join two clauses or introduce examples, consider using an em dash.
Context: ... [^12]: Unix sockets, the basics in Rust - Emmanuel Bosquet, accessed on July 24, 2...

(DASH_RULE)


[typographical] ~1040-~1040: To join two clauses or introduce examples, consider using an em dash.
Context: ...^14]: Working with Comments | GitHub API - LFE Documentation, accessed on July 24, ...

(DASH_RULE)


[typographical] ~1040-~1040: To join two clauses or introduce examples, consider using an em dash.
Context: ...]: PullRequestHandler in octocrab::pulls - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~1040-~1040: To join two clauses or introduce examples, consider using an em dash.
Context: ...RequestHandler in octocrab::pulls - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[style] ~1044-~1044: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...ngSpark/rustysd: A service manager that is able to run "traditional" systemd services, wri...

(BE_ABLE_TO)


[typographical] ~1045-~1045: To join two clauses or introduce examples, consider using an em dash.
Context: ...ional" systemd services, written in rust - GitHub, accessed on July 24, 2025, <http...

(DASH_RULE)

🔇 Additional comments (1)
Cargo.toml (1)

4-4: Use a valid Rust edition.

edition = "2024" is not yet stabilised and will cause a build failure on stable and beta toolchains. Pin to the latest stable edition (2021) until 2024 is officially released.

-edition = "2024"
+edition = "2021"
⛔ Skipped due to learnings
Learnt from: leynos
PR: leynos/mxd#137
File: postgres_setup_unpriv/Cargo.toml:4-4
Timestamp: 2025-06-16T23:32:38.317Z
Learning: Rust Edition 2024 is a valid and finalized edition that was officially released as part of Rust 1.85.0 on February 20, 2025. It can be used in Cargo.toml files with `edition = "2024"`.

Comment thread docs/comenq-design.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant