Skip to content

Expose --sequence and --stop_processing_rules on rule-create so callers can control evaluation order and chain-stop for overlapping rule predicates (closes #19, child of epic #17). - #24

Merged
neilgfoster merged 2 commits into
mainfrom
worktree-agent-a7f84e504abda252f
Jul 24, 2026
Merged

Expose --sequence and --stop_processing_rules on rule-create so callers can control evaluation order and chain-stop for overlapping rule predicates (closes #19, child of epic #17).#24
neilgfoster merged 2 commits into
mainfrom
worktree-agent-a7f84e504abda252f

Conversation

@neilgfoster

Copy link
Copy Markdown
Owner

What and why

Expose --sequence and --stop_processing_rules on rule-create so callers can control evaluation order and chain-stop for overlapping rule predicates (closes #19, child of epic #17).

Conventions

  • Runtime stays stdlib-only, zero-dependency, zero-backend (urllib/json; ruff/pytest are
    dev tooling only).
  • No secrets/tokens in the repo — they live outside it in an XDG path (0600).
  • Any new/changed skill follows docs/AGENT-FRIENDLY.md (description + CLI I/O are the contract).
  • Read-only safety model intact: Mail.Read-only read path, scope ratchet for writes,
    verify-then-install (read-only catch-set), file-to-folder (never delete).

Verification

ruff check . && ruff format --check .
python3 -m pytest -q
  • ruff check . and ruff format --check . pass.
  • python3 -m pytest -q passes.

@neilgfoster neilgfoster left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

plugin/skills/rule-create/SKILL.md:1, plugin/skills/rule-create/SKILL.md:53-60, and plugin/src/msgraph/client.py:187-192 — --stop_processing_rules is documented (in the description frontmatter, argument-hint, and the "Typical flow" example: --sequence 1 --stop_processing_rules) as a bare boolean flag taking no value, but the argparse definition in client.py (type=lambda v: str(v).lower() not in (...), no nargs='?'/action='store_true') requires an explicit following value, matching this codebase's existing convention for --dry_run, --include_hidden, --include_nested (all of which are correctly documented elsewhere as --flag true|false). Concrete failure: an agent follows the SKILL.md example verbatim and runs rule-create ... --sequence 1 --stop_processing_rules, which argparse rejects with error: argument --stop_processing_rules: expected one argument (exit code 2) before the command ever runs — verified by reproducing the identical argparse pattern locally. The doc should read --stop_processing_rules true (and the argument-hint [--stop_processing_rules true|false]) to match the actual CLI contract, consistent with the rest of the plugin's boolean flags.

No other correctness issues found: the --sequence validation (int type via argparse, then isinstance/< 1 check in verbs.py before any Graph call) is sound, defaults preserve prior hardcoded behavior (sequence=1, stopProcessingRules=False), and the new tests correctly exercise default/explicit/rejected paths and assert no network call on the rejected path.

neilgfoster-xyz and others added 2 commits July 24, 2026 05:57
The POST body previously hardcoded sequence: 1 and stopProcessingRules:
False, so callers had no way to make a specific rule evaluate before a
broader one or stop lower-priority rules from also acting once a message
matched. Both fields are now optional rule-create arguments, defaulting
to the prior hardcoded values so existing callers are unaffected; an
invalid --sequence is refused before any Graph call.

Also lays down the GitHub Spec Kit substrate (.specify/, .gitattributes,
.gitignore block) used to plan this change, per this repo's SDD workflow.

Closes #19

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011NWPnfcJ9JXDvRThCCUcCH
…lse value

The frontmatter description, argument-hint, and Typical flow example
documented --stop_processing_rules as a bare boolean flag, but the argparse
definition requires an explicit value (matching --dry_run's convention).
Following the documented example verbatim would fail with an argparse
error. Fix docs to show --stop_processing_rules true|false.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011NWPnfcJ9JXDvRThCCUcCH
@neilgfoster
neilgfoster force-pushed the worktree-agent-a7f84e504abda252f branch from 3a07d78 to d95ab7a Compare July 24, 2026 05:58
@neilgfoster
neilgfoster merged commit f7fae9f into main Jul 24, 2026
1 check passed
@neilgfoster
neilgfoster deleted the worktree-agent-a7f84e504abda252f branch July 24, 2026 05:59
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.

rule-create hardcodes stopProcessingRules and sequence

2 participants