Skip to content

Admission engine owns conflict detection: claims by rule id replace the wrapped detector - #1322

Merged
malpern merged 1 commit into
masterfrom
feat/admission-claims
Oct 20, 2026
Merged

malpern merged 1 commit into
masterfrom
feat/admission-claims

Conversation

@malpern

@malpern malpern commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Replace, not wrap (review §4.4g).

What

Tests

  • The old detector's entire corpus (RuleCollectionDeduplicatorTests, MultiCollectionConflictTests, AliasDeduplicationTests, DeduplicatorEdgeCaseTests, ChordGroupsIntegrationTests, CLI and save-pipeline tests) now runs against the engine, unchanged in its assertions — the proof the replacement preserves behaviour.
  • New: testSameTitledRulesAreToldApart, testConflictDetailsNameTheHoldAndTheActivator.
  • KEYPATH_TEST_ENFORCE_CLEAN_SUMMARY=1 Scripts/run-tests-safe.sh: 5,786 passed, 0 app warnings/errors, 0 build warnings. check-accessibility.py clean.

🤖 Generated with Claude Code

…he wrapped detector

Phase 3 wrapped RuleCollectionDeduplicator.detectConflicts, which reported
display names, and mapped names back to ids — so two rules titled alike were
both blamed for one collision. The engine now computes every conflict from
claims (what each owner puts on which slot): key slots with the leader key,
activator-vs-mapping, activator-vs-activator, chord groups within an owner,
and alias-name collisions. Reason.conflict carries the details (hold action,
activator target, alias origin) the presenter and the save gate's
MappingConflictInfo both render. The old detector is deleted; the save gate
and the CLI call AdmissionEngine.mappingConflicts, and the detector's test
corpus runs against the engine unchanged.

See docs/architecture/rules-admission-review.md §4.4g.

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

chatgpt-codex-connector Bot commented Oct 20, 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-10-20T12:18:24.641755Z ba5578f 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.

@claude

claude Bot commented Oct 20, 2026

Copy link
Copy Markdown

Review of PR #1322 (the diff was truncated at 60 KB, so I only saw part of the test changes).

1. Chord-group conflicts now have no fixes (AdmissionEngine.swift, section 4 of conflicts(owners:leaderKey:))

  • Both chord checks (duplicate group names and cross-group shared keys) use .named(...) parties. conflict(...) drops .named parties when it builds fixes.
  • So these .needsChoice verdicts now have fixes == []. The old code offered .disable(.named(...)) for each party, which wasn't actionable either. Now the UI gets a blocking verdict with no option to resolve it.
  • RuleCollectionsManager+ConflictDetection matches on parties.contains(subject). The owning collection is no longer among the parties, so a toggle-time check won't attribute these conflicts to the chord collection.
  • Suggested fix: include .disable(owner.subject) in the fixes for these verdicts, and consider adding owner.subject to parties. A test asserting that fixes are non-empty for chord conflicts would cover it.

2. Doc comment typo (KanataConfiguration+BlockBuilders.swift)

  • It reads AdmissionEngine.conflicts(in:leaderKey:)(), with stray parentheses. Also, the primary gate is really mappingConflicts, which the save path calls.

3. Minor

  • mappingConflicts falls back to "a rule" when an id isn't in collections. Two different unknown parties then collapse to the same label.
  • The @MainActor enum now exposes nonisolated static entry points that call KanataConfiguration.effectiveMappings and generatedAliasNames. Please confirm those are nonisolated. Otherwise this won't compile under strict concurrency, or it will hop actors.

@malpern
malpern merged commit 1343af7 into master Oct 20, 2026
6 checks passed
@malpern
malpern deleted the feat/admission-claims branch October 20, 2026 12:19
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