Repository navigation
refactor(agent-hooks): move the hand-off wrappers out of AgentConcurrencyUtilHooks (#1213) - #1218
Merged
Merged
Conversation
…encyUtilHooks (#1213) AgentConcurrencyUtilHooks was the largest main class (5,137 lines with #1209), and every agent-feed fix grows it. Its public static hooks are bound by the weaver by owner and descriptor and are public API under japicmp's semantic-versioning gate, so none can move in 1.x. Its package-private machinery can: HandedAll, Handed, HandedTask, HandedStage, StageFunction, StageBiFunction and Submissions now live nested in AgentHandOffHooks, reached by import, with three outer members widened from private to package-private. 4,757 to 4,227 lines on this base; no behaviour change. The holder's name is load-bearing: SiteCapture skips frames of an Agent*Hooks class and its nested classes, and a HandedTask.run() frame named AgentHandOffs$HandedTask would have been attributed as the user's line. SiteCaptureTest pinned that rule with the old nested name as a string literal, which would have stayed green through the regression; it now resolves the real class, so a future move fails it. Stacked on #1208, which adds an Arrays.equals call that keeps java.util.Arrays imported; ForkJoinWorkerThread is unused on every branch and goes. Verified: static chain (clean verify -DskipTests) green; fast tier on this branch; a simulated merge with #1209 merges the hooks file cleanly (CHANGELOG conflicts only between #1208 and #1209), compiles, and passes 191 tests across the hook, site and feed-coverage suites. Diagram structure gains exactly one node, AgentHandOffHooks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
PIsberg
added a commit
that referenced
this pull request
Nov 8, 2026
…ntrancy class-diagram.svg conflicted (generated): regenerated with tools/generate-architecture-diagrams.sh, which keeps main's AgentHandOffHooks (#1218) and adds this branch's KotlinMutexReentrancyDetector and KotlinMutexes.
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.
Closes #1213. Stacked on #1208: this PR targets #1208's branch, and GitHub retargets it to
mainwhen #1208 merges.What moved
HandedAll,Handed,HandedTask,HandedStage,StageFunction,StageBiFunctionandSubmissionsnow live nested in a new package-privateAgentHandOffHooks. To make that work, three members ofAgentConcurrencyUtilHookswent fromprivateto package-private (COMMON_POOL_TASK,RUNNING_HANDED,observed). Nothing else changed behaviour.AgentConcurrencyUtilHooks: 4,757 → 4,227 lines on #1208's base.What did not move, and why
The ~200 public static hooks stay put. The weaver binds call sites to them by owner and descriptor, and they are public API under japicmp's semantic-versioning gate, so moving one is a removal that 1.x cannot ship. That split is filed for 2.0 as #1217.
Why the new class name ends in
HooksNothing in it is a hook, but the suffix is load-bearing:
SiteCaptureskips frames of anAgent*Hooksclass and its nested classes. Under the nameAgentHandOffs, a finding raised underHandedTask.run()would have named this file as the user's line.DetectorFeedCoverageTestandDetectorConditionalInsertTestscan onlyAgent*Hooks.javasources, and this file calls two detector accessors.SiteCaptureTestpinned the nested-class rule with the old name as a string literal, which would have stayed green through that regression. It now resolves the real class, so a future move fails it.Verification
clean verify -DskipTests: checkstyle, PMD, SpotBugs, javadoc, japicmp): green. PMD caughtForkJoinWorkerThreadas unused after the move, so I removed it.java.util.Arraysstays because fix(agent): observe quiet ThreadPoolExecutor subclasses, spare custom handlers (#1173) #1208 uses it.CHANGELOG, between fix(agent): observe quiet ThreadPoolExecutor subclasses, spare custom handlers (#1173) #1208 and fix(agent): follow a parallel Stream's map, filter, reduce and collect lambdas (#1172) #1209), compiles, and 191 tests across the hook, site-capture and feed-coverage suites pass.AgentHandOffHooks. Onlyclass-diagram.svgis committed, because the other SVGs changed only in node order.🤖 Generated with Claude Code