Repository navigation
rules: a rule with no enforcer keeps its planned check; rule enforce sets an existing rule - #10
Conversation
…force sets an existing rule A rule whose check is possible but not written used to have nothing on record: no plan, no date, and no command to record the enforcer once someone wrote it. Enforcer paths were stored as typed, so a relative path read as missing from any other directory. - registry (rules-enforcement.toml): optional planned / size / since on any entry; due days S 7, M 30, L 90 - aisync rule enforce R-### --enforced-by | --judgment-only | --planned --size [--since] [--note]; rule add and the MCP rule_add take --planned / --size - a plan's clock only runs: a later day, a larger size or a switch to judgment-only needs --reason and stays in note; replacing a planned rule keeps its plan and its day; every change is a journal event - paths are stored absolute with ~ (symlinks kept); rule enforcement --rebase DIR repairs old entries; --prune drops entries of retired rules (only IDs found in the archive) - rule enforcement prints one next step per open line; with require_enforcer = true it also exits 1 on a rule with no plan, an overdue plan, or no rules read (without it those are listed, not failed) - tidy prints each planned check and a new 'Enforcer files gone' section Tests: 434 passed (tests/test_enforcement.py +19, tests/test_tidy.py); privacy scan 0 hits. Agent: claude-code Co-authored-by: MaxonT <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6631074baa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if was.get("planned") and entry.get("planned"): # the clock of a replaced rule keeps running | ||
| entry["since"] = min(str(entry["since"]), str(was.get("since") or entry["since"])) |
There was a problem hiding this comment.
Guard size increases when carrying a replacement's plan forward
When a planned rule is replaced, this preserves its start date but accepts a larger size without requiring or recording a reason. For example, replacing an S plan dated 2026-11-02 with the same planned check and size L changes it from overdue to not overdue on 2026-11-12. This bypasses the deadline protection enforced by set_entry() and lets an ordinary rule revision silently postpone an outstanding check. Validate size increases before retiring the original rule, requiring and recording a reason just as rule enforce does.
Useful? React with 👍 / 👎.
What
rules-enforcement.tomlentries may carryplanned/size/since: the check that would enforce a rule and is not written yet. Due days: S 7, M 30, L 90.aisync rule enforce R-### --enforced-by | --judgment-only | --planned --size [--since] [--note]sets the enforcement of an existing rule.rule addand the MCPrule_addtake--planned/--size.--reasonand stays on record. Replacing a planned rule keeps its plan and its day.~).rule enforcement --rebase DIRrepairs old relative entries;--prunedrops entries of retired rules.rule enforcementprints one next step per open line. Withrequire_enforcer = trueit also exits 1 on a rule with no plan, an overdue plan, or no rules read; without it those are listed, not failed, so an existing hub keeps its exit code.aisync tidyprints each planned check and a new 'Enforcer files gone' section.Why
A rule whose check was possible but unwritten had nothing on record, and no command could record the enforcer once someone wrote it. A relative enforcer path read as missing from any other directory.
Checks
tests/test_enforcement.py).