Skip to content

Conversation

ztgrace
Copy link
Collaborator

@ztgrace ztgrace commented Sep 9, 2025

Adding WithStrictness to modules to support setting the strictness on the module chains.

Summary by CodeRabbit

  • New Features

    • Added per-module strictness configuration to control how processing errors are handled (e.g., lax vs stricter behavior).
    • Chain initialization now respects and applies a module’s strictness, ensuring consistent behavior across linked operations.
    • Introduced a fluent configuration option to set strictness when building modules.
  • Tests

    • Added tests covering lax versus default strictness to verify error-tolerant processing under lax mode and error enforcement under default settings.

Copy link

coderabbitai bot commented Sep 9, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a per-module strictness setting to Module, threads it into Chain construction, and introduces tests verifying behavior for lax (no error) vs default (error) strictness when a ProcessError link is present.

Changes

Cohort / File(s) Summary
Chain module strictness
pkg/chain/module.go, pkg/chain/module_test.go
Module gains a new field strictness Strictness and method WithStrictness(Strictness) *Module. New() propagates module strictness to the Chain via WithStrictness(m.strictness) after WithConfigs(...). Tests add lax vs default strictness cases validating error handling differences with ProcessErrorLink.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client
  participant Module
  participant Chain

  Note over Module: Configuration phase
  Client->>Module: WithConfigs(cfgs...)
  Client->>Module: WithStrictness(strictness)

  Note over Module,Chain: Construction
  Client->>Module: New()
  Module->>Chain: New().WithConfigs(cfgs...)
  Module->>Chain: WithStrictness(strictness)

  Note over Client,Chain: Execution
  Client->>Chain: Run(input)
  alt strictness == Lax
    Note right of Chain: ProcessError allowed to pass
    Chain-->>Client: nil error
  else strictness != Lax
    Note right of Chain: ProcessError triggers error
    Chain-->>Client: error
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A rabbit taps code with a gentle knack,
Now modules choose strict, or soften to Lax.
Chains heed the tone as they hop through the flow,
Errors may burrow—or harmlessly go.
With tests all passing, I twitch and cheer:
“Strict when you must, be lax when it’s clear!” 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 915a140 and d25fb52.

📒 Files selected for processing (2)
  • pkg/chain/module.go (3 hunks)
  • pkg/chain/module_test.go (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ztg/mod-strictness

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

Copy link

github-actions bot commented Sep 9, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

@josephwhenry josephwhenry merged commit 2af6e19 into main Sep 9, 2025
0 of 2 checks passed
@josephwhenry josephwhenry deleted the ztg/mod-strictness branch September 9, 2025 15:49
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