Skip to content

Conversation

@assembler-0
Copy link
Owner

@assembler-0 assembler-0 commented Sep 21, 2025

Summary by CodeRabbit

  • New Features
    • Structured error handling with categorized results and user-friendly error summaries across process operations.
  • Refactor
    • Public APIs now return result objects instead of direct values, requiring explicit success/error handling.
  • Documentation
    • README updated with comprehensive error-handling guidance, examples, and usage patterns.
  • Chores
    • Build now requires C++23.
    • Compiler warnings are treated as errors (while retaining existing warning/optimization flags).

@assembler-0 assembler-0 merged commit 639356d into main Sep 21, 2025
2 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Sep 21, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The build switches to C++23 and treats warnings as errors. A new public Errors framework is added, changing Command/Child APIs to return Result. CommandResult gains ExecutionError and helpers. Tests and README are updated to use IsOk/Value/IsError patterns. No other files are modified.

Changes

Cohort / File(s) Summary
Build configuration
CMakeLists.txt
Set C++ standard to 23; appended -Werror to existing CXX flags (-pedantic, -Wall, -Wextra, -O2).
Public API and error framework
CatalystCX.hpp
Introduced Errors namespace (ErrorCategory, ErrorCode, ErrorInfo, Result, Result, MakeError, MakeSystemError). Changed Command::Execute/Spawn and Child::Wait/Kill to return Errors::Result. Added CommandResult::ExecutionError, HasExecutionError, GetErrorSummary. Added CatalystCX_VERSION macros.
Tests and evaluation harness
Evaluate.cpp
Refactored to use Result pattern: IsOk()/Value()/IsError() across Execute/Spawn/Wait/Kill; guarded accesses; adjusted assertions and control flow for error propagation.
Documentation
README.md
Updated examples and guides to Result-based error handling; added sections on Error Handling and Error Codes/Categories; revised async/kill/signal examples; minor formatting updates.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Cmd as Command
  participant OS as OS/Platform
  participant Err as Errors::Result

  User->>Cmd: Execute()
  Cmd->>OS: Spawn process
  alt spawn fails
    OS-->>Cmd: System error
    Cmd->>Err: MakeSystemError(SpawnFailed)
    Cmd-->>User: Result<CommandResult>{Error}
  else spawn succeeds
    OS-->>Cmd: PID/handles
    Cmd->>OS: Wait for completion
    alt wait fails
      OS-->>Cmd: System error
      Cmd->>Err: MakeSystemError(WaitFailed)
      Cmd-->>User: Result<CommandResult>{Error}
    else process exits
      OS-->>Cmd: Exit data (code, io)
      Cmd-->>User: Result<CommandResult>{Value}
    end
  end
Loading
sequenceDiagram
  autonumber
  actor User
  participant Cmd as Command
  participant Child as Child
  participant OS as OS/Signals
  participant Err as Errors::Result

  User->>Cmd: Spawn()
  alt error
    Cmd-->>User: Result<Child>{Error}
  else ok
    Cmd-->>User: Result<Child>{Value}
    User->>Child: Kill(...)
    alt kill error
      Child-->>User: Result<void>{Error}
    else kill ok
      Child-->>User: Result<void>{Value}
      User->>Child: Wait(...)
      Child-->>User: Result<CommandResult>{Value or Error}
    end
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Better test suite #3 — Prior API adjustments to execution methods; this PR continues by wrapping those methods in Errors::Result.
  • Development #7 — Changes to public process API; closely related to adding Errors framework and new CommandResult helpers.
  • Development #5 — Modifies CMake C++ standard/flags; overlaps with this PR’s CMake updates.

Poem

A rabbit taps the build with gentle paws,
C++23 now guards with stricter laws.
Results hop back: Ok or Err they show,
With tidy trails of why and how they flow.
Tests nibble safely, docs burrow deep—
Errors tamed, the carrots keep! 🥕✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Development

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7bb87cf and 36d21d1.

📒 Files selected for processing (4)
  • CMakeLists.txt (1 hunks)
  • CatalystCX.hpp (22 hunks)
  • Evaluate.cpp (6 hunks)
  • README.md (5 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants