Collapse the actor-stamping factories onto the shared core - #608
Merged
Conversation
xmap
force-pushed
the
collapse/actor-kwarg-factories
branch
from
August 3, 2026 22:42
4415dac to
3608db6
Compare
Agent, Subject and Budget each carried a full copy of `make_update_handler`'s body, and each said in its own docstring that the copy existed because the core could not thread `principal_id` to the decider. Adding `actor_kwarg` to the core removed that reason, so all three become thin wrappers like their non-stamping siblings. Their `_ActorUpdateHandler` protocols go with the bodies: they existed only to describe a return shape the core already declares. Federation does NOT collapse, for a second and unrelated reason. The Seal aggregate is a per-facility singleton whose stream id derives from `command.facility_code` rather than being read off a command attribute, so that factory also carries `resolve_stream_id`, which the core has no equivalent for. Collapsing it means adding a second knob to the shared core, which is its own decision with its own blast radius. The file now records that, with the trigger being a second aggregate anywhere needing a derived stream id. Envelope coverage consolidates rather than disappearing. `test_envelope_principal_id` asserts each handler stamps `principal_id`, and skips files that delegate because the assertion is made once at the delegate. Three cases move from passed to skipped (138/175 to 135/178), exactly the three collapsed here, and the `cora.infrastructure.update_handler` case passes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
xmap
force-pushed
the
collapse/actor-kwarg-factories
branch
from
August 3, 2026 23:13
3608db6 to
46bc198
Compare
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #605. Base is
fix/presence-names-the-caller, notmain, because this depends on theactor_kwargknob that PR adds. Review or merge #605 first.What
Agent, Subject and Budget each carried a full copy of
make_update_handler's body, and each said in its own docstring that the copy existed because the core could not threadprincipal_idto the decider. #605 addedactor_kwargto the core and removed that reason, so all three become thin wrappers like their non-stamping siblings.Their
_ActorUpdateHandlerprotocols go with the bodies: they existed only to describe a return shape the core already declares.Federation does not collapse
For a second and unrelated reason, so it stays. The Seal aggregate is a per-facility singleton whose stream id derives from
command.facility_coderather than being read off a command attribute, so that factory also carriesresolve_stream_id, which the core has no equivalent for.Collapsing it means adding a second knob to the shared core, which is its own decision with its own blast radius. The file now records that, with the trigger being a second aggregate anywhere needing a derived stream id.
Envelope coverage consolidates rather than disappearing
Worth stating explicitly, because the shape of this change is also the shape of a lost check.
test_envelope_principal_idasserts each handler stampsprincipal_idonto the event envelope, and skips files that delegate, because the assertion is made once at the delegate instead. Three cases move from passed to skipped:The delta is exactly the three factories collapsed here, and the
cora.infrastructure.update_handlercase passes.Verification
🤖 Generated with Claude Code