Repository navigation
refactor: consolidate single-consumer core surfaces - #180711
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
Codex review: needs maintainer review before merge. What this changesThis PR folds private helpers and tool factories into their existing consumers while preserving supported behavior. Example: A direct message send returns message ID m1 for chat c1 on Alpha.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-directed refactor consolidates private ownership without a definite introduced defect; current-head CI remains unresolved. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherAgent assembly, Gateway policy, service installation, subprocess execution, and terminal formatting consume prepared configuration and requests and produce tools, process results, service operations, and user-facing text. flowchart TD
A[Prepared configuration and requests] --> B[Existing core owners]
B --> C[Agent tool assembly]
B --> D[Gateway and service policy]
B --> E[Process lifecycle]
C --> F[Tools and results]
D --> F
E --> G[CLI and terminal output]
Technical reviewBest possible solution: Keep the consolidation with its existing owners and resolve current-head CI before landing. Do we have a high-confidence way to reproduce the issue? This PR claims no user-visible bug fix; inspection confirms the principal changes relocate existing implementations. Is this the best way to solve the issue? The consolidation follows existing owners, removes replaced paths, and preserves observable contracts without introducing parallel machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5b8a35f45e4a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -221, Tests +128, Other -5. Total -98 across 57 files. Added test files: 1. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 22, 2026, 11:18 AM ET / 15:18 UTC. |
|
Merged via squash.
|
* refactor(migrate): resolve selection in its existing kind loop * refactor(daemon): keep single-use systemd frames in their callers * refactor(agents): keep static catalog row conversion private * refactor(runtime): keep identity caches and resource ports with their owners * refactor(agents): spawn bundle LSP servers in their runtime owner * refactor(agents): truncate CLI diagnostic tails in their owner * refactor(process): keep broker command adapters private to spawn owner * refactor(gateway): classify profile families at descriptor construction * refactor(commands): format delivery summaries at the CLI owner * refactor(infra): colocate approval and event queue surfaces * refactor(gateway): own legacy environment notices at startup * refactor(exec): localize approval follow-up formatting * refactor(agents): assemble node plugin tools at their sole caller * refactor(terminal): localize single-use ANSI parser frames * refactor(agents): assemble conversations in their serving owner * refactor(agents): document relocated schema invariant and prune orphan ratchets * refactor(gateway): defer native-codegen slice pending replay
What Problem This Solves
Single-consumer internal modules and factory exports spread one responsibility across unnecessary API boundaries.
User Impact
No user-visible change or migration. Public CLI, package, Plugin SDK, configuration, and protocol contracts remain unchanged, as do lazy imports, authorization, durable state, and ordinary concurrency. Phase E session memory is untouched.
Why This Change Was Made
Keep node-plugin and conversation tool assembly with their serving owners; colocate internal approval/event types and process adapters; localize systemd, migration-selection, CLI-output, and terminal-parser preparation. Tests that depended on retired leaves now use the existing serving entry points with their assertions retained.
This is the core/runtime/CLI/packages area of an 88-path family, split under campaign rule 11 to keep CI attribution bounded. The disjoint plugin area follows separately. After dropping the native-codegen-reachable slice below, this area removes 214 net production lines (+944/-1158) across 33 production paths, excluding tests, fixtures, test support, generated files, and declarations. Relocated bodies are not counted as eliminated behavior.
Best-effort tradeoffs accepted
None for supported behavior. No protective guard is removed. The same checks, tool order, schema identities, requester fields, cancellation, deadlines, idempotency, process cleanup, and live effect-authority boundaries remain. Three construction-time copies of an already-prepared plain conversation-options record become one read-only captured record.
Evidence
Every packet has focused public-consumer tests, targeted native typing, typed lint, formatting, and independent P0–P2 review. Retained proof includes 36 conversation/prefix cases across five files, 17 selected node-materialization/tooling cases plus six prefix cases, 90 approval/system-event cases, 30 Gateway configuration/warning cases, 34 exec-output cases, and 46 terminal cases. Conversation and warning test migrations also passed against unchanged production before their folds. Gateway node-deadline E2E was migrated and typechecked, not run locally under the campaign's no-E2E budget.
All 15 area commits applied patch-identically, without conflicts, onto fresh main
c5650f3a5e59d6523c913a8ebfff2b787cf58435. Full-area independent P0–P2 review is clean. Runtime and static cycle checks report zero; wrapper/eager-import closure and line caps pass. Two orphan ratchet entries shrink with deleted paths; no allowance, suppression, timeout, retry, or skip is added. The moved existing schema cast documents why normalized node JSON schemas do not need TypeBox-only metadata when forwarded.Local baseline limitation: suppression inventory reports 103 entries against 100, with extras in untouched cron mutation, transcript test support, and sessions-view files. Those files, the inventory test, parser, and file-enumeration helpers are byte-identical to this branch's main base. No allowlist was widened. Exact-head hosted CI is broad proof; no local build, broad typecheck, E2E, live model/channel, or native-device claim is made.
CI attribution and dropped slice
Run
39800506556on former headdd290b8ede4a3d7ad937b118d356b855a0275ffbfailed Android Play'sTalkModeManagerTest.publishedGatewayRelayContractsStartTheAdvertisedTransportwhile awaiting its local mock WebSocket connection. This was not a matching catalog flake, and all six recent scheduled main Android jobs passed. Although the relevant generated Kotlin values are source-equivalent, native generation imports the modified core method-policy owner, so a whole-build-graph disjointness claim would be wrong. A serial native head-versus-base replay is unavailable within the campaign's proof budget.Under campaign rule 8, the two reachable changed files (
core-method-policy.tsandcore-profile-access.ts) are restored to current main. Only that seven-line cut is dropped, not unrelated families. It is preserved without a PR ondeslop/z25-parked-android-native-codegen-20261015for source-bound native replay. The next exact-head CI is required; the failed former head is not reported green or reused as broad success.Final exact-head landing
The replacement head
6233e6c9906553ad61afb1012f6b31374fbe1db8passed native completed-hosted preparation and ordinary replacement recovery after the prior auto intent was confirmed cancelled. The exact-head aggregate CI, dependency and security gates succeeded; no failing check was reported. Four leaf checks retained stale in-progress metadata despite successful test and cleanup steps; the native verifier accepted the completed hosted evidence. No CI rerun, synthetic push, admin exception or renewed auto intent was used.Merged through the native workflow as squash
cf3702eb9a43628bdfe2ac93d8c697f4709812ea. GitHub reports MERGED with the exact reviewed head, and the squash is ancestry-verified against fetched main1be2a77ca03b120301a47e21455f9fb23627e3ca. The native completion receipt and comment retain the replacement history. The seven-line native-codegen slice remains parked; it is not part of this landed result.