Repository navigation
refactor: group Claude structured session owners - #37036
Conversation
|
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
be8096b6-aa2f-44dc-8b0b-3212311bcfff
Files selected for processing: 227-
config/flaky-test-pattern-baseline.txtconfig/path-literal-baseline.txtconfig/scripts/ci-shard-timings.jsonsrc/main/ai-vault/structured-session-ownership.tssrc/main/claude-accounts/claude-launch-routing.test.tssrc/main/claude/claude-adapter-capture-replay.test.tssrc/main/claude/claude-api-retry-idle-sweep.test.tssrc/main/claude/claude-api-retry-row.test.tssrc/main/claude/claude-assistant-failures.tssrc/main/claude/claude-at-rest-commands.tssrc/main/claude/claude-background-task-turn-resumption.test.tssrc/main/claude/claude-background-wake-retention.test.tssrc/main/claude/claude-can-use-tool-test-support.tssrc/main/claude/claude-child-tool-queries.tssrc/main/claude/claude-child-work-evidence-retention.test.tssrc/main/claude/claude-child-work-evidence.tssrc/main/claude/claude-child-work-producer-harness.test-fixture.tssrc/main/claude/claude-cli-flag-prewarm.tssrc/main/claude/claude-close-turn-end.test.tssrc/main/claude/claude-command-lifecycle-frames.test.tssrc/main/claude/claude-command-lifecycle.test.tssrc/main/claude/claude-command-lifecycle.tssrc/main/claude/claude-command-turn.test.tssrc/main/claude/claude-command-turn.tssrc/main/claude/claude-context-facts.tssrc/main/claude/claude-context-usage-restart.test.tssrc/main/claude/claude-context-usage-test-support.tssrc/main/claude/claude-context-usage-unloaded-turn.test.tssrc/main/claude/claude-fold-steer-receipt.test.tssrc/main/claude/claude-informational-row.test.tssrc/main/claude/claude-informational-row.tssrc/main/claude/claude-journal-translator-contract.tssrc/main/claude/claude-journal-turn-scope.test.tssrc/main/claude/claude-message-journaling.tssrc/main/claude/claude-model-catalog-probe.test.tssrc/main/claude/claude-model-catalog-probe.tssrc/main/claude/claude-naming-generation.tssrc/main/claude/claude-naming-invocation.tssrc/main/claude/claude-plan-approval-mode.test.tssrc/main/claude/claude-replay-turn-resolution.tssrc/main/claude/claude-result-journaling.tssrc/main/claude/claude-result-outcome.tssrc/main/claude/claude-session-state-turn-over.tssrc/main/claude/claude-stop-ack-race.test.tssrc/main/claude/claude-stream-json-connection.test.tssrc/main/claude/claude-stream-json-connection.tssrc/main/claude/claude-streamed-block-identity.tssrc/main/claude/claude-streamed-thinking.tssrc/main/claude/claude-structured-launch-home-perf.test.tssrc/main/claude/claude-structured-location-support.tssrc/main/claude/claude-structured-result-control-overlap.test.tssrc/main/claude/claude-subagent-permission-request.test.tssrc/main/claude/claude-subagent-resume-after-restart.test.tssrc/main/claude/claude-subagent-task-frames.tssrc/main/claude/claude-supervised-stop-real-cli.test.tssrc/main/claude/claude-thread-goal-journaling.test.tssrc/main/claude/claude-thread-goal.tssrc/main/claude/claude-transcript-catch-up-test-support.tssrc/main/claude/claude-transcript-catch-up.test.tssrc/main/claude/claude-transcript-import-plan.tssrc/main/claude/claude-transcript-tail.tssrc/main/claude/claude-turn-opening.tssrc/main/claude/claude-turn-outcome.test.tssrc/main/claude/claude-turn-ownership.test.tssrc/main/claude/claude-turn-resumption.test.tssrc/main/claude/claude-usage-limits.test.tssrc/main/claude/claude-usage-limits.tssrc/main/claude/structured/claude-structured-acquisition-release.tssrc/main/claude/structured/claude-structured-agent-definition.tssrc/main/claude/structured/claude-structured-child-work-captures.test.tssrc/main/claude/structured/claude-structured-child-work-producer.test.tssrc/main/claude/structured/claude-structured-command-dispatch.tssrc/main/claude/structured/claude-structured-content-parts.test.tssrc/main/claude/structured/claude-structured-control-actions.test.tssrc/main/claude/structured/claude-structured-control-actions.tssrc/main/claude/structured/claude-structured-conversation-stop.test.tssrc/main/claude/structured/claude-structured-dispatch-admission.test.tssrc/main/claude/structured/claude-structured-dispatch-attachment-rejection.test.tssrc/main/claude/structured/claude-structured-dispatch-boundary.test.tssrc/main/claude/structured/claude-structured-dispatch-content.test.tssrc/main/claude/structured/claude-structured-dispatch-content.tssrc/main/claude/structured/claude-structured-dispatch-queue-boundary.test.tssrc/main/claude/structured/claude-structured-dispatch-test-support.tssrc/main/claude/structured/claude-structured-dispatch-waiters.tssrc/main/claude/structured/claude-structured-dispatch.test.tssrc/main/claude/structured/claude-structured-dispatch.tssrc/main/claude/structured/claude-structured-effort-default-at-rest.test.tssrc/main/claude/structured/claude-structured-effort-reporting.test.tssrc/main/claude/structured/claude-structured-event-delivery.tssrc/main/claude/structured/claude-structured-execution-observations.tssrc/main/claude/structured/claude-structured-execution-recording.test.tssrc/main/claude/structured/claude-structured-in-turn-stop.test.tssrc/main/claude/structured/claude-structured-inbound-control.test.tssrc/main/claude/structured/claude-structured-inbound-control.tssrc/main/claude/structured/claude-structured-init-proof.tssrc/main/claude/structured/claude-structured-live-provider-process.test.tssrc/main/claude/structured/claude-structured-option-confirmation.test.tssrc/main/claude/structured/claude-structured-queued-stop.test.tssrc/main/claude/structured/claude-structured-rate-limit-retry.test.tssrc/main/claude/structured/claude-structured-real-cli-fold.test.tssrc/main/claude/structured/claude-structured-real-cli-rewind.test.tssrc/main/claude/structured/claude-structured-real-cli-stop-task.test.tssrc/main/claude/structured/claude-structured-real-cli-visuals.test.tssrc/main/claude/structured/claude-structured-real-cli.test.tssrc/main/claude/structured/claude-structured-reasoning-lifecycle.test.tssrc/main/claude/structured/claude-structured-reasoning.test.tssrc/main/claude/structured/claude-structured-requested-stop.test.tssrc/main/claude/structured/claude-structured-resume-point.test.tssrc/main/claude/structured/claude-structured-resume-point.tssrc/main/claude/structured/claude-structured-session-acquisition-processless.test.tssrc/main/claude/structured/claude-structured-session-acquisition.tssrc/main/claude/structured/claude-structured-session-adapter-turns.test.tssrc/main/claude/structured/claude-structured-session-adapter.test.tssrc/main/claude/structured/claude-structured-session-adapter.tssrc/main/claude/structured/claude-structured-session-close.test.tssrc/main/claude/structured/claude-structured-session-close.tssrc/main/claude/structured/claude-structured-session-commands.test.tssrc/main/claude/structured/claude-structured-session-exit-blame.test.tssrc/main/claude/structured/claude-structured-session-exit-lifecycle.tssrc/main/claude/structured/claude-structured-session-open.tssrc/main/claude/structured/claude-structured-session-publication.tssrc/main/claude/structured/claude-structured-session-reading-control.test.tssrc/main/claude/structured/claude-structured-session-recovery.test.tssrc/main/claude/structured/claude-structured-session-startup.test.tssrc/main/claude/structured/claude-structured-session-startup.tssrc/main/claude/structured/claude-structured-session-state.tssrc/main/claude/structured/claude-structured-session-test-support.tssrc/main/claude/structured/claude-structured-sign-in.test.tssrc/main/claude/structured/claude-structured-startup-settled-test-support.tssrc/main/claude/structured/claude-structured-turn-resume-point.test.tssrc/main/claude/structured/journal/claude-structured-item-translation.tssrc/main/claude/structured/journal/claude-structured-journal-prompt-cards.test.tssrc/main/claude/structured/journal/claude-structured-journal-prompt-retry.test.tssrc/main/claude/structured/journal/claude-structured-journal-prompts.tssrc/main/claude/structured/journal/claude-structured-journal-translation-background-tasks.test.tssrc/main/claude/structured/journal/claude-structured-journal-translation-context-usage.test.tssrc/main/claude/structured/journal/claude-structured-journal-translation-subagents.test.tssrc/main/claude/structured/journal/claude-structured-journal-translation-turn-timing.test.tssrc/main/claude/structured/journal/claude-structured-journal-translation.test.tssrc/main/claude/structured/journal/claude-structured-journal-translation.tssrc/main/claude/structured/journal/claude-structured-prompt-items.test.tssrc/main/claude/structured/journal/claude-structured-prompt-items.tssrc/main/claude/structured/journal/claude-structured-prompt-ownership.test.tssrc/main/claude/structured/journal/claude-structured-prompt-ownership.tssrc/main/claude/structured/journal/claude-structured-prompt-replies.tssrc/main/claude/structured/journal/claude-structured-session-journal-control.tssrc/main/claude/structured/launch/claude-structured-acquisition-launch.tssrc/main/claude/structured/launch/claude-structured-applied-options.test.tssrc/main/claude/structured/launch/claude-structured-catalog-listing.tssrc/main/claude/structured/launch/claude-structured-child-env.test.tssrc/main/claude/structured/launch/claude-structured-child-env.tssrc/main/claude/structured/launch/claude-structured-launch-account-routing.test.tssrc/main/claude/structured/launch/claude-structured-launch-args.tssrc/main/claude/structured/launch/claude-structured-launch-flags.tssrc/main/claude/structured/launch/claude-structured-launch-home.tssrc/main/claude/structured/launch/claude-structured-launch-resolution.test.tssrc/main/claude/structured/launch/claude-structured-launch-resolution.tssrc/main/claude/structured/launch/claude-structured-launch-visuals.test.tssrc/main/claude/structured/launch/claude-structured-location-support.tssrc/main/claude/structured/launch/claude-structured-message-options.test.tssrc/main/claude/structured/launch/claude-structured-message-options.tssrc/main/claude/structured/launch/claude-structured-model-catalog.tssrc/main/claude/structured/launch/claude-structured-model-confirmation.test.tssrc/main/claude/structured/launch/claude-structured-options-context-window.test.tssrc/main/claude/structured/launch/claude-structured-options.test.tssrc/main/claude/structured/launch/claude-structured-options.tssrc/main/claude/structured/launch/claude-structured-provider-fallback.test.tssrc/main/claude/structured/launch/claude-structured-provider-fallback.tssrc/main/claude/structured/launch/claude-structured-real-cli-options.test.tssrc/main/claude/structured/launch/claude-structured-session-acquisition-options.tssrc/main/claude/structured/launch/claude-structured-session-options.tssrc/main/claude/structured/launch/claude-structured-spawn-options.test.tssrc/main/claude/structured/launch/claude-structured-spawn-options.tssrc/main/native-chat/agent-session-journal/journal-projection-streams.test.tssrc/main/native-chat/agent-session-journal/journal-received-content.test.tssrc/main/native-chat/agent-session-wire/hook-outcome-rows.test.tssrc/main/native-chat/agent-session-wire/mobile-queued-edit-host.test-fixture.tssrc/main/native-chat/agent-session-wire/provider-turn-activity-routing.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-adapter-router-test-support.tssrc/main/native-chat/agent-session-wire/structured-agent-session-at-rest-command-rig.test-fixture.tssrc/main/native-chat/agent-session-wire/structured-agent-session-claude-compact-stop.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-claude-echo-working.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-claude-hung-start-stop.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-claude-opening-send-hold.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-claude-queued-stop.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-claude-root-exit.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-claude-stop-contract-test-actions.tssrc/main/native-chat/agent-session-wire/structured-agent-session-claude-stop-contract-test-fixture.tssrc/main/native-chat/agent-session-wire/structured-agent-session-claude-stop-ends-session.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-claude-stop-exit-ends-record.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-claude-stop-note-end.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-claude-stop-queue-cards.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-claude-stop-turn-end.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-claude-subagent-row.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-command-publication.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-ended-prompt-cancel.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-message-choices.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-options-read.accepted-inputs.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-options-read.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-outgrown-child.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-owed-work-release.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-receiving-auth.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-restart-provider-output.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-status-feed.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-stop-deadline.test-fixture.tssrc/main/native-chat/agent-session-wire/structured-agent-session-subagent-recency.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-view-start-after-failed-start.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-workspace-sleep-lifetime.test.tssrc/main/pi/rpc-message-dispatch.tssrc/main/pi/rpc-prompt.tssrc/main/runtime/claude-structured-fake-connection-test-fixture.tssrc/main/runtime/rpc/methods/structured-agent-session-restart-dismiss-fence.test.tssrc/main/runtime/runtime-client-agent-launch-settings-durability.test.tssrc/main/runtime/structured-agent-install-refresh.test.tssrc/main/runtime/structured-agent-launch-composition.test-support.tssrc/main/runtime/structured-agent-launch-parity.test.tssrc/main/runtime/structured-agent-runtime-metadata.tssrc/main/runtime/structured-agent-runtime-registrations.tssrc/main/runtime/structured-chat-naming-agent-launch.tssrc/main/runtime/structured-claude-naming-test-support.tssrc/main/runtime/structured-claude-pending-rewind.test.tssrc/main/runtime/structured-claude-runtime-adapter.tssrc/main/runtime/structured-claude-thinking-display-refusal.test.tssrc/shared/agent-launch-picker-legacy-permission.test.tstests/e2e/cross-version-wire/released-chat-writers.tstests/e2e/structured-agent-session-launch-continuation.unit.test.tstests/e2e/structured-permission-report-publication.unit.test.ts
Files with no reviewable changes: 1-
- src/main/claude/claude-structured-location-support.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
-
f6a8ffe to
3310aad
Compare
…fines them v1.4.246 is the first release cut after #36909, #36979, #37036 and #37070 moved the agent-session modules, so suites that imported the old paths from the newest release failed with ERR_MODULE_NOT_FOUND for every PR running cross-version wire. importReleaseCheckoutModule now resolves a moved module to the path the checked-out release ships, from one table of current and earlier locations, so both the rolling baseline and older pinned refs load. The released-chat writers drop their own per-module existsSync fallbacks for it. v1.4.246 also ships outcome storage, so it reads chats this build writes and closes its own rows with the outcomes marker. The downgrade test pins its refusing window to the two releases before outcome storage, and the upgrade test leaves the marker to the outcome reader, which restoreJournal checks.
…fines them (#37297) * test(cross-version): load moved modules from wherever each release defines them v1.4.246 is the first release cut after #36909, #36979, #37036 and #37070 moved the agent-session modules, so suites that imported the old paths from the newest release failed with ERR_MODULE_NOT_FOUND for every PR running cross-version wire. importReleaseCheckoutModule now resolves a moved module to the path the checked-out release ships, from one table of current and earlier locations, so both the rolling baseline and older pinned refs load. The released-chat writers drop their own per-module existsSync fallbacks for it. v1.4.246 also ships outcome storage, so it reads chats this build writes and closes its own rows with the outcomes marker. The downgrade test pins its refusing window to the two releases before outcome storage, and the upgrade test leaves the marker to the outcome reader, which restoreJournal checks. * test(cross-version): find a moved module by name in the release instead of a path table A table of earlier paths is a list of stale src literals the path-literal ratchet rightly refuses, and needs an entry for every future move. The release checkout itself says where it ships each module: the one file with that name under the same source root. Prunes the three released-chat-writers entries the ratchet baseline grandfathered. * test(cross-version): pin the chat-upgrade writers to the releases before outcome storage v1.4.246 keeps a chat in outcome tables, so its rows hold only the marker and there is no row upgrade to carry on; the newest release stays the reader this build must match.
…fines them (stablyai#37297) * test(cross-version): load moved modules from wherever each release defines them v1.4.246 is the first release cut after stablyai#36909, stablyai#36979, stablyai#37036 and stablyai#37070 moved the agent-session modules, so suites that imported the old paths from the newest release failed with ERR_MODULE_NOT_FOUND for every PR running cross-version wire. importReleaseCheckoutModule now resolves a moved module to the path the checked-out release ships, from one table of current and earlier locations, so both the rolling baseline and older pinned refs load. The released-chat writers drop their own per-module existsSync fallbacks for it. v1.4.246 also ships outcome storage, so it reads chats this build writes and closes its own rows with the outcomes marker. The downgrade test pins its refusing window to the two releases before outcome storage, and the upgrade test leaves the marker to the outcome reader, which restoreJournal checks. * test(cross-version): find a moved module by name in the release instead of a path table A table of earlier paths is a list of stale src literals the path-literal ratchet rightly refuses, and needs an entry for every future move. The release checkout itself says where it ships each module: the one file with that name under the same source root. Prunes the three released-chat-writers entries the ratchet baseline grandfathered. * test(cross-version): pin the chat-upgrade writers to the releases before outcome storage v1.4.246 keeps a chat in outcome tables, so its rows hold only the marker and there is no row upgrade to carry on; the newest release stays the reader this build must match. (cherry picked from commit bdd997f)
ELI5
Keep Claude session code near the part of the session it owns, so changes are easier to find and review.
What Changed
Combine the structured Claude launch/options, journal and session-lifecycle moves into one coherent refactor: 97 files (35 production owners and 62 test/support files). Launch/options owners live in
claude/structured/launch/, journal owners inclaude/structured/journal/, and session lifecycle owners inclaude/structured/.Callers import concrete defining owners. Remove three forwarding declarations; preserve namespace identity, mocks, runtime evaluation order and production function bodies. Retarget one moved fixture URL, timing keys and flaky-test paths. Select current or historical owner paths from each release checkout for the Claude translator and previously moved failure modules. Keep the historical fallbacks and explicitly admit the old Claude path in the path-literal baseline. A real-writer regression test treats the current workspace as a future release without copying source or dependencies.
Ten original tracker paths were already deleted upstream; this PR does not recreate them or count them as moves.
Why
These three tasks share 49 module edges. Reviewing their moves together keeps the complete Claude ownership boundary in one PR and avoids three rounds of caller churn.
Linked Issue
Internal module-organization tracker; no new issue.
Visual Proof
N/A — module organization only; no UI or interaction change.
Testing
Local node/web/CLI typechecks, import boundaries, changed-code quality and normal commit hooks passed. The initial related run passed 1,348 test files and failed four tests across two compiled-CLI suites; rebuilding the CLI and rerunning both suites plus amended-import consumers passed all 13 files / 131 tests. Focused lint, format and the historical path-literal ratchet pass after the reviewed import-only/baseline-only amendment. The original composite remains 26/29; it was not rerun in full.
The new current-layout test reproduced the historical-path failure, then passed with the layout-aware loader. That test and all six cases across three real old releases pass (2 files / 7 tests). Focused e2e typecheck, lint, format, runner classification and path-literal ratchet pass. An intermediate forbidden type-query lint diagnostic was resolved with an erased namespace type import; its emitted runtime JavaScript is unchanged.
Tests run on macOS arm64 with
ORCA_BACKGROUND_LAUNCH=1; Linux, Windows and remote execution are covered by hosted checks rather than local execution.Review
Two independent source audits cover bodies, imports, forwarding removal, namespace/mock identity and relocated resources. Fresh current-main preservation and the unchanged live refactor merge gate remain required before merge.
Agent skill upstream boundary
Notes
No wire names, platform policy or remote-version behavior changes. Historical release-checkout paths remain compatible with the released module layout.
Checklist