Skip to content

rules: a rule with no enforcer keeps its planned check; rule enforce sets an existing rule - #10

Merged
MaxonT merged 1 commit into
mainfrom
port-enforcement-planned
Nov 12, 2026
Merged

MaxonT merged 1 commit into
mainfrom
port-enforcement-planned

Conversation

@MaxonT

@MaxonT MaxonT commented Nov 12, 2026

Copy link
Copy Markdown
Owner

What

  • rules-enforcement.toml entries may carry planned / size / since: the check that would enforce a rule and is not written yet. Due days: S 7, M 30, L 90.
  • New aisync rule enforce R-### --enforced-by | --judgment-only | --planned --size [--since] [--note] sets the enforcement of an existing rule. 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 on record. Replacing a planned rule keeps its plan and its day.
  • Enforcer paths are stored absolute (with ~). rule enforcement --rebase DIR repairs old relative entries; --prune drops entries of retired rules.
  • 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, so an existing hub keeps its exit code.
  • aisync tidy prints 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

  • 434 tests pass locally (19 new in tests/test_enforcement.py).
  • Privacy scan: 0 hits (tree, wheel, sdist).
  • No version bump: this lands on main and ships with the next release.

…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]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T22:24:48.627814Z 6631074 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment thread ai_sync/collab.py
Comment on lines +197 to +198
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"]))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@MaxonT
MaxonT merged commit ff52d2e into main Nov 12, 2026
6 checks passed
@MaxonT
MaxonT deleted the port-enforcement-planned branch November 12, 2026 22:25
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