Repository navigation
Hash every class that produces projection rows into the projection digest - #2777
Merged
Merged
Conversation
…gest The projection digest from #2773 hashed only the record family, the claim transitions and their capability classes. The code that decides row content also lives on MessageKind.route_rows, the message roles' activity_rows, CommandTarget.direct_names, ChannelActivity.from_message, the claim scopes and the response policies. None of those were hashed, so editing them left stale projections marked fresh. Proven with the interpreter on main: changing ConversationRole.activity_rows left the digest at 3a79e1f3ed68fff9. The capability is now declared on the classes themselves. ProjectionSource (projection_source.py) registers every class that inherits it, and the digest hashes the produced rows plus every ProjectionSource class. The (family, capability) pairs and producer_classes are deleted. BusProjectionTables declares only the package it produces from. The classes were found by profiling a full rebuild of a copy of the live bus (19,503 records): 40 classes outside the old digest ran row-producing code. Each family is marked at its root. The old 31 owners are all still covered; the digest now has 156 owners. test_every_class_that_produces_projection_rows_is_in_the_digest profiles a rebuild and fails on any class that ran and is not in the digest, apart from the decode, store and dispatch mechanism modules. With the MessageKind mark removed it fails and names MessageKind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
trissim
marked this pull request as ready for review
October 23, 2026 13:25
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
debt-src at 1573ed4, every finding: |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Defect
#2773's projection digest left out the classes whose code decides projection row content:
MessageKind.route_rows, the roles'activity_rows,CommandTarget.direct_names,ChannelActivity.from_message, the claim scopes and the response policies. Editing any of them left stale projections marked fresh.Evidence on main: editing
ConversationRole.activity_rows(messages.py) leavesBusProjectionTables._producer_digest()at3a79e1f3ed68fff9before and after. On this branch the same edit moves it fromce848e21ba1151aetoe2d495136f7281f3.Shape
ProjectionSourcecapability (projection_source.py) is declared on the producing classes. Its__init_subclass__registry is the digest's set.ProducedRow.producer_capabilities,ProducedRow.producer_classesand the (family, capability) pairs in messages.py.BusProjectionTablesdeclares onlyproducer_package().DeclaredFamily.discover_packageis now public, so the digest can import the package before reading the registry.How the classes were found
I profiled a full rebuild of a copy of the live bus (19,503 records). 40 classes outside the old digest ran code during production. Each family is marked at its root; the digest has 156 owners, up from 31, and none of the old 31 are lost.
Still outside the digest, on purpose:
audience_manifest._bounded_text,_canonical_jsonand_digest, andchannel_targets.exact_stored_target. They only raise and never shape row content.Guard
test_every_class_that_produces_projection_rows_is_in_the_digestprofiles a rebuild and fails on any agent_comms class that ran and is not in the digest. With theMessageKindmark removed, it fails and namesagent_comms.messages.MessageKind.Four new cases in
test_projection_digest_tracks_producing_source:activity_rows,route_rows,ThreadTarget.direct_namesandChannelActivity.from_message.Tests
tests/test_bus.py -k "digest or projection": 13 passed.Cost
The digest now changes on more edits, so installs rebuild projections (about 15 s) more often. That is the price of the rows being correct.
🤖 Generated with Claude Code