Skip to content

refactor(agent-session): group lifecycle contracts and records - #36909

Merged
nwparker merged 2 commits into
mainfrom
module-organization/pr57-pr58-session-lifecycle
Nov 1, 2026
Merged

nwparker merged 2 commits into
mainfrom
module-organization/pr57-pr58-session-lifecycle

Conversation

@nwparker

@nwparker nwparker commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 583 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​943 $\color{#cf222e}{\Huge{\mathbf{−}}}$​932 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​11
Prod 648 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1070 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1006 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​64

ELI5

Agent-session lifecycle contracts and records now live together under a concrete folder. Backend, desktop, mobile, and tests import each symbol directly from its implementation owner. Behavior stays the same.

What Changed

  • Move all 42 planned lifecycle/record files into src/shared/agent-session/lifecycle/: 26 production files and 16 test/support files.
  • Retarget their consumers, two dynamic imports, test-selection routes, reliability references, and 14 existing timing entries.
  • Remove nine forwarding declarations for 28 bindings; use concrete defining-owner imports and normalize duplicate imports without changing runtime dependency order.
  • Extract two unchanged spawn-command observation functions into a concrete test fixture so the formatted resume test stays under its existing line limit.
  • Retain five existing legacy CI-selector prefixes through exact reviewed path-baseline entries; add the new concrete destination selectors alongside them. Historical release-checkout paths remain unchanged.

Why

This larger coherent batch completes the related records and lifecycle area together, making ownership and dependencies easier to follow without adding barrel exports or compatibility wrappers.

Linked Issue

Part of the ongoing module-organization cleanup.

Visual Proof

N/A — file organization and import ownership only; no rendered or interaction changes.

Testing

  • Original source head: 549 focused tests passed across 23 suites, including moved test entrypoints, dynamic imports, selection/path gates, mobile queued sessions, and runtime resume cases.
  • Current refreshed head: all 34 runtime resume cases passed again; 1,434 unrelated cases were skipped and are not counted as passed. Reliability, test discovery, and all 13,492 unit-shard assignments passed fresh validation. Original 549-test and typecheck evidence remains tied to its recorded source head; the fresh 34-case run overlaps that coverage.
  • Root and mobile typechecks passed.
  • Scoped formatting, lint, import boundaries, max-lines ratchet, path-literal ratchet, test discovery, reliability gates, and changed-code quality passed. Zero new quality findings.
  • Independent native Codex source and integration audits approve the exact refreshed head, fixture extraction, direct owners, five baseline exceptions, and preservation of upstream changes. All 15 hosted workflows passed on the tested head.
  • The one newer upstream dependency test passed all eight cases on the exact proposed integration tree; the optional notifier type addition emits identical runtime JavaScript.
  • Latest upstream test cleanup: all 30 deleted suites remain absent. At the reviewed 30242d17 integration tree, 48 metadata-gate cases and the one remaining changed runtime case passed; 1,465 nonselected runtime cases were skipped. Reliability and test discovery passed, and all 13,509 unit files were assigned once across 12 shards. The two metadata files contain only the original path retargets over current main.
  • Tested locally on macOS with ORCA_BACKGROUND_LAUNCH=1; configured hosted checks cover their platforms. No additional low-value tests were added for the mechanical move.

Review

Detailed evidence and the full tracker stay local. The unmodified refactor-audit preservation gate passed before and after merge. Actual squash 57454e6d7eacfc22ad055102048d16e1d52a185b has the exact reviewed immediate parent and integration tree; all other current-main files remain preserved.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer material copied or translated.

Notes

Wire names, permission and lifecycle semantics, runtime dependency order, platform behavior, remote compatibility, folder workspaces, and mobile behavior are preserved.

Checklist

  • Coherent larger batch with direct owners and no new barrels
  • Explained the resulting organization and its purpose
  • Visual proof N/A with reason
  • Scoped local validation passed
  • Cross-platform, SSH/remote, folder-workspace, and mobile impact considered
  • Required hosted checks and final independent source/integration reviews passed

@nwparker
nwparker merged commit 57454e6 into main Nov 1, 2026
146 of 148 checks passed
nwparker added a commit that referenced this pull request Nov 2, 2026
…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.
nwparker added a commit that referenced this pull request Nov 2, 2026
…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.
audichuang pushed a commit to audichuang/orca that referenced this pull request Nov 2, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant