Skip to content

v0.0.9: add dir_rule/base_dir support for post_process script; docume…#8

Merged
hect0x7 merged 2 commits into
masterfrom
dev
Mar 13, 2026
Merged

v0.0.9: add dir_rule/base_dir support for post_process script; docume…#8
hect0x7 merged 2 commits into
masterfrom
dev

Conversation

@hect0x7

@hect0x7 hect0x7 commented Mar 13, 2026

Copy link
Copy Markdown
Owner

…nt script-tool mapping and boundaries; bump version to 0.0.9

描述

相关 Issue

Closes #

更改类型

  • 🐛 Bug 修复 (non-breaking change which fixes an issue)
  • ✨ 新功能 (non-breaking change which adds functionality)
  • 💥 破坏性变更 (fix or feature that would cause existing functionality to change)
  • 📚 文档更新 (changes to documentation only)
  • 🔧 配置/工具 (changes to configuration or tooling)
  • ♻️ 代码重构 (refactoring code without changing functionality)

测试

  • 本地测试通过
  • 添加了新的测试用例
  • 所有现有测试通过

检查清单

  • 我的代码遵循项目的代码风格
  • 我已经更新了相关文档
  • 我已经添加了必要的测试
  • 所有 CI 检查通过

截图(如适用)

其他信息

Summary by CodeRabbit

  • New Features

    • Added --dir-rule and --base-dir parameters for precise post-processing output path control via a dir_rule DSL.
    • Added validation to prevent conflicting option combinations and ensure paired usage.
  • Documentation

    • Added "Script Parameters ↔ MCP Tools Mapping" explaining parameter-to-tool alignment and mapping policy.
    • Expanded usage examples and important notes (rate limiting, storage, default config).
  • Chores

    • Bumped project version to 0.0.9.

…nt script-tool mapping and boundaries; bump version to 0.0.9
@coderabbitai

coderabbitai Bot commented Mar 13, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 72aafaa8-6227-4eba-b097-83b0a5265c73

📥 Commits

Reviewing files that changed from the base of the PR and between e6ddf7d and 0d75baa.

📒 Files selected for processing (1)
  • src/jmcomic_ai/skills/jmcomic/scripts/post_process.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/jmcomic_ai/skills/jmcomic/scripts/post_process.py

📝 Walkthrough

Walkthrough

Adds version 0.0.9 metadata, introduces two CLI options (--dir-rule, --base-dir) with mutual-exclusion and pairing validation to the post_process script, converts legacy --outdir to a dir_rule form, and expands SKILL.md with a "Script Parameters ↔ MCP Tools Mapping" section and usage examples.

Changes

Cohort / File(s) Summary
Version metadata
CHANGELOG.md, pyproject.toml, src/jmcomic_ai/__init__.py
Bumped project and package version from 0.0.8 to 0.0.9; changelog entry added.
Post-process CLI
src/jmcomic_ai/skills/jmcomic/scripts/post_process.py
Added --dir-rule and --base-dir CLI options; enforce pairing of --dir-rule--base-dir, forbid combining these with --outdir; normalize legacy --outdir into dir_rule param when used alone.
Documentation
src/jmcomic_ai/skills/jmcomic/SKILL.md
Expanded post_process docs with CLI examples showing --dir-rule/--base-dir, added "Script Parameters ↔ MCP Tools Mapping", mapping policy, and additional important notes.

Sequence Diagram(s)

sequenceDiagram
    participant User as User (CLI)
    participant Script as post_process.py
    participant MCP as MCP Tools
    participant FS as Filesystem

    User->>Script: invoke with flags (--dir-rule/--base-dir/--outdir)
    Script->>Script: validate flags (pairing & mutual exclusion)
    alt invalid flags
        Script->>User: exit with error (invalid combination)
    else valid flags
        Script->>MCP: prepare params (dir_rule or converted from outdir)
        MCP->>FS: request/write output paths per dir_rule
        MCP->>User: return status/results
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A version bump hops into the day,
With dir-rule and base-dir leading the way,
Flags checked, paths tamed with gentle art,
Docs sing contracts that map each part,
Hopping on—this rabbit loves neat charts! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: version bump to 0.0.9, addition of dir_rule/base_dir support for post_process script, and documentation of script-tool mapping.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

You can get early access to new features in CodeRabbit.

Enable the early_access setting to enable early access features such as new models, tools, and more.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/jmcomic_ai/skills/jmcomic/SKILL.md (1)

422-451: ⚠️ Potential issue | 🟡 Minor

Document the full output-path flag contract here.

This adds the happy-path --dir-rule example, but it still omits the actual CLI contract: --dir-rule and --base-dir must be passed together, both are mutually exclusive with --outdir, and --outdir is the shorthand for {"rule": "Bd", "base_dir": ...}. Without that, agents will keep generating commands the script rejects. As per coding guidelines, Every new tool or parameter change must be reflected in src/jmcomic_ai/skills/jmcomic/SKILL.md - this file is the agent manual documenting all capabilities.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/jmcomic_ai/skills/jmcomic/SKILL.md` around lines 422 - 451, The SKILL.md
post_process section omits the precise CLI contract for output path flags;
update the post_process.py documentation in
src/jmcomic_ai/skills/jmcomic/SKILL.md to state that --dir-rule and --base-dir
must always be provided together, they are mutually exclusive with --outdir, and
that --outdir is a shorthand equivalent to providing params {"rule": "Bd",
"base_dir": "<path>"}; include a concise example for each case (happy-path with
--dir-rule + --base-dir, shorthand with --outdir), and mention the script
validation behavior (rejects mixed usage and missing pair) so agents generate
only accepted flag combinations.
🧹 Nitpick comments (1)
src/jmcomic_ai/skills/jmcomic/scripts/post_process.py (1)

39-42: Give params an explicit type before growing this branch.

params now carries str, bool, and nested dict values, but main remains untyped, so mypy still will not meaningfully check this path. Please annotate main() -> None, type params (dict[str, Any] or a small TypedDict), and run mypy on this file so the new dir_rule payload is actually covered. As per coding guidelines, src/**/*.py: Use static type hints and verify with mypy.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/jmcomic_ai/skills/jmcomic/scripts/post_process.py` around lines 39 - 42,
Annotate main() with a return type (main() -> None) and give params an explicit
type (for example declare params: dict[str, Any] or create a small TypedDict for
the expected keys) before the branch that assigns dir_rule; update imports to
include typing.Any or TypedDict as needed, and ensure the dir_rule value
conforms to that typed shape (refer to the params variable and the main function
in post_process.py and the dir_rule payload assigned in the if/elif block);
finally run mypy on this file and fix any resulting type errors so the new
dir_rule path is statically checked.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/jmcomic_ai/skills/jmcomic/scripts/post_process.py`:
- Around line 30-37: The flag-combination checks run after constructing
JmcomicService so invalid CLI invocations can initialize the service before
failing; move or duplicate the parser.error checks to run before the
JmcomicService(args.option) instantiation (i.e., validate args.outdir,
args.dir_rule and args.base_dir immediately after parsing) so parser.error is
invoked prior to creating JmcomicService; ensure you reference the same
conditions (args.outdir && (args.dir_rule || args.base_dir), args.dir_rule &&
!args.base_dir, args.base_dir && !args.dir_rule) and keep the existing
parser.error messages.

---

Outside diff comments:
In `@src/jmcomic_ai/skills/jmcomic/SKILL.md`:
- Around line 422-451: The SKILL.md post_process section omits the precise CLI
contract for output path flags; update the post_process.py documentation in
src/jmcomic_ai/skills/jmcomic/SKILL.md to state that --dir-rule and --base-dir
must always be provided together, they are mutually exclusive with --outdir, and
that --outdir is a shorthand equivalent to providing params {"rule": "Bd",
"base_dir": "<path>"}; include a concise example for each case (happy-path with
--dir-rule + --base-dir, shorthand with --outdir), and mention the script
validation behavior (rejects mixed usage and missing pair) so agents generate
only accepted flag combinations.

---

Nitpick comments:
In `@src/jmcomic_ai/skills/jmcomic/scripts/post_process.py`:
- Around line 39-42: Annotate main() with a return type (main() -> None) and
give params an explicit type (for example declare params: dict[str, Any] or
create a small TypedDict for the expected keys) before the branch that assigns
dir_rule; update imports to include typing.Any or TypedDict as needed, and
ensure the dir_rule value conforms to that typed shape (refer to the params
variable and the main function in post_process.py and the dir_rule payload
assigned in the if/elif block); finally run mypy on this file and fix any
resulting type errors so the new dir_rule path is statically checked.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 98b17d7e-7a22-4b5f-bdc2-82e87b71077e

📥 Commits

Reviewing files that changed from the base of the PR and between 0c96833 and e6ddf7d.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • pyproject.toml
  • src/jmcomic_ai/__init__.py
  • src/jmcomic_ai/skills/jmcomic/SKILL.md
  • src/jmcomic_ai/skills/jmcomic/scripts/post_process.py

Comment thread src/jmcomic_ai/skills/jmcomic/scripts/post_process.py Outdated
@hect0x7 hect0x7 merged commit e43edd1 into master Mar 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant