Skip to content

Only conflicts involving the changed rules fail the consistency check - #236

Merged
tzhouam merged 1 commit into
mainfrom
kb/local-consistency-scope
Sep 29, 2026
Merged

tzhouam merged 1 commit into
mainfrom
kb/local-consistency-scope

Conversation

@tzhouam

@tzhouam tzhouam commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

The consistency judge reviews a whole owner directory, and the gate failed a change for ANY conflict in it, including conflicts between rules the change never touched. Those are unfixable by refining, so every change in such a directory was blocked forever after two paid refine rounds.

First live run (service on the GPU box, shadow): both intake batches ended refine_exhausted on conflicts already on main at 48e8b4a — CONF-1a..4a duplicated across two configuration pages, DIFF-2s/2t and SERV-4o/4r5.

  • Only a conflict naming a rule the change adds/edits/retires/supersedes (including ### rules nested inside them) fails the change; others are kept as preexisting and the directory counts as consistent.
  • A conflict naming no rule, with null/non-string IDs, or malformed still fails (fail-closed).
  • The judge prompt carries changed_rule_ids; calibration keeps the strict whole-directory verdict.

Tests in test_kb_intake_gate.py: pre-existing conflict passes; conflict with the new rule fails; unnamed/null conflict fails; nested rule counts; judge sees the changed IDs. Commit hook (gpt-6-astra-high) APPROVE at iteration 2 (iteration 1 found the nested-ID and null-ID bypasses, fixed and tested).

🤖 Generated with Claude Code

The consistency judge reviews a whole owner directory and so reports every
conflict in it. The gate failed the change for any of them, including
conflicts between rules the change never touched. Refining cannot fix
those, so every change in such a directory was blocked for good and spent
two paid refine rounds on it.

The first live run hit exactly this. On main (48e8b4a), CONF-1a..4a are
duplicated across two configuration pages, and DIFF-2s/2t and SERV-4o/4r5
already conflict. Both intake batches ended refine_exhausted.

- check_consistency(changed=...) now takes the rule IDs the change adds,
  edits, retires or supersedes.
  - A conflict naming one of them is the change's.
  - A conflict between untouched rules is kept as "preexisting" and does
    not fail the change; the directory then counts as consistent.
  - The changed IDs include the ### rules nested inside a changed rule.
  - A conflict that names no rule, has null or non-string IDs, or is
    malformed still counts against the change (fail closed).
- The judge's prompt now carries changed_rule_ids.
- Calibration passes no `changed`, so it keeps the strict whole-directory
  verdict.

Tests: a conflict already on main passes; one involving the new rule
fails; an unnamed or null-ID conflict fails; a conflict naming a nested rule of the new rule fails; the judge is told the changed IDs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T08:56:14.221228Z 7bd7979 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: 7bd797917f

ℹ️ 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 on lines +230 to +233
ids = conflict[:2]
if not all(isinstance(i, str) and i.strip() for i in ids):
return True
return any(i.strip() in changed for i in ids)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Fail closed on unrecognized rule IDs

If the consistency model reports a changed-rule conflict with a typo or decoration in the ID—for example DEMO-2 instead of changed rule DEMO-2a—both IDs remain nonempty strings, so _names_changed returns false and lines 212–217 promote the overall conflict verdict to consistent. This can allow contradictory rules to be signed and auto-merged. Only classify a conflict as preexisting when both reported IDs resolve to known unchanged rules in the judged tree; unrecognized IDs should remain fail-closed.

Useful? React with 👍 / 👎.

@tzhouam
tzhouam merged commit fffd7a5 into main Sep 29, 2026
2 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