One owner for the retired set and the exercise revision (PA.f82)
The resolver's retired set in patch.rs seeded itself with its own `matches!(assignment, ControllerAssignment::Retired)`, a second reading of the same predicate the kernel's `is_retired` already owns. Made `is_retired` `pub(crate)` and had the resolver call it (over `controller_assignments.keys()`, then `Key::Existing(scope.subject_id)`) instead of matching the assignment enum itself, so "is this subject retired" has exactly one reader — the kernel's own statement of retirement, the one audience derivation and preconditions already trust. The exercise revision had two independent computations of the same `state.revision + 1` arithmetic (action.rs's `exercise`, written out inline, and the kernel's own `resolution_revision`), and `apply_effect`'s `DecisionExercised` arm then called `resolution_revision` a second time per invocation even though `exercise` had already produced the identical value into `event.revision` moments earlier (and the arm had just proved `derived == *event`, so `event.revision` is provably that same value). Collapsed to one arithmetic owner — `exercise` now calls `super::resolution_revision(state)` instead of duplicating the `+1` inline — and cut the redundant call site: `DecisionExercised` now reads `event.revision` for `apply_operations`'s `resolves_to` rather than recomputing it. Mutation: `is_retired` forced to always return `false`. Both the kernel's own retirement tests (`tests::a_retired_institution_lends_no_authority_to_ its_office_holder`, 12 of the `clock_tests::a_retired_*`/`retiring_*` cases) and the resolver's own test (`patch::tests::a_grant_after_retiring_the_lending_institution_is_admitted`) fail together — 14 failures total — which is the shared-ownership proof; restored after confirming. PA.f48's and PA.f49's existing tests stay green (34 retirement-shaped tests including both PA.f48 resolver tests; the two PA.f49 `acquired_at`-revision tests). Full lib suite: 620 passed, 0 failed, 1 ignored. Dungeon bin suite: 63 passed, 0 failed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
9b91940d9a
commit
3c2bdf3a7c
3 changed files with 9 additions and 10 deletions
|
|
@ -3296,9 +3296,9 @@ pub(super) fn resolve_patch(
|
|||
// extended below for a subject this same patch declares.
|
||||
let mut retired: BTreeSet<Key<SubjectId>> = state
|
||||
.controller_assignments
|
||||
.iter()
|
||||
.filter(|(_, assignment)| matches!(assignment, ControllerAssignment::Retired))
|
||||
.map(|(scope, _)| Key::Existing(scope.subject_id))
|
||||
.keys()
|
||||
.filter(|scope| super::is_retired(state, scope.subject_id))
|
||||
.map(|scope| Key::Existing(scope.subject_id))
|
||||
.collect();
|
||||
let mut mirrors: BTreeSet<Key<SubjectId>> = state
|
||||
.controller_assignments
|
||||
|
|
|
|||
Loading…
Reference in a new issue