Skip to content

refactor: complete explicit session lifetime migration - #3152

Merged
thymikee merged 4 commits into
fix/replay-observation-lifetimesfrom
refactor/session-fixture-lifetimes-core
Oct 4, 2026
Merged

thymikee merged 4 commits into
fix/replay-observation-lifetimesfrom
refactor/session-fixture-lifetimes-core

Conversation

@thymikee

@thymikee thymikee commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Complete the fixture migration to explicit session publish/update/retire operations and remove SessionStore.set. Retain captured occupant identity and independent successor-fence controls. Depends on #3144. Related to #3116.

Validation

d5472b0523: pnpm check:affected --base 62d6af6340 --run passed. Test Files 329 passed (329); Tests 2177 passed (2177). Selected tooling passed. Rebased onto the corrected optional recorder without expanding this layer. Fresh GitHub CI remains pending; ancestor native evidence and approval are separate requirements. User handles merges.

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 4.98 MB 4.98 MB -137 B
Package (unpacked) 4.98 MB 4.98 MB -137 B
Package (download) 1.49 MB 1.49 MB -25 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.6 ms 26.5 ms -0.1 ms
CLI --help 81.2 ms 79.6 ms -1.6 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 100 files

Re-trigger cubic

@thymikee

thymikee commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

This PR is ready. I reviewed commit 26f32c6 and found no problems in the test and fixture changes. The diff touches no production files, and all 13 checks are green. There are no conflicts. It can merge once the base PR #3151 lands.

Not blocking: the comment above the "moved to another device" test in daemon-session-idle-expiry-scheduling.test.ts (https://github.com/callstack/agent-device/blob/26f32c6/src/daemon/server/daemon-session-idle-expiry-scheduling.test.ts#L309) still says a command can replace the record with one bound to a different device, but the fixture now patches the same lifetime with sessionStore.update, so rewording it would help. You can take or leave this.

I did not run the test suites. I took the pass counts in the PR body and the green checks as reported. I did not read all 100 files line by line. I read the timer-based retire tests, the update-based rebuilds, the fixture rewrites and the removed re-sets, and I checked the mechanical set-to-publish swaps by count only. Whether each publish swap is safe on an occupied address rests on the passing suites, since publish throws session_address_occupied there.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 3, 2026
@thymikee
thymikee added this pull request to stack #3146 October 3, 2026 13:46
@thymikee
thymikee force-pushed the refactor/session-fixture-lifetimes-core branch from 26f32c6 to fac2276 Compare October 3, 2026 14:41
@thymikee
thymikee force-pushed the refactor/session-fixture-lifetimes-core branch from fac2276 to 6822c67 Compare October 3, 2026 15:16
@thymikee
thymikee force-pushed the refactor/session-fixture-lifetimes-core branch 2 times, most recently from 4f71a3a to 3a1c1eb Compare October 3, 2026 16:56
@thymikee
thymikee force-pushed the refactor/session-fixture-lifetimes-core branch from 3a1c1eb to a42feba Compare October 3, 2026 17:49
@thymikee
thymikee removed this pull request from stack #3146 October 3, 2026 19:38
@thymikee
thymikee force-pushed the refactor/session-fixture-lifetimes-core branch from a42feba to 5fd249b Compare October 3, 2026 19:39
@thymikee
thymikee added this pull request to stack #3187 October 3, 2026 19:45
@thymikee
thymikee removed this pull request from stack #3187 October 3, 2026 20:59
@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 3, 2026
@thymikee thymikee changed the title refactor: make core fixtures declare session lifetimes refactor: complete explicit session lifetime migration Oct 3, 2026
@thymikee
thymikee changed the base branch from fix/session-observation-review to fix/replay-observation-lifetimes October 3, 2026 21:00
@thymikee
thymikee force-pushed the refactor/session-fixture-lifetimes-core branch from 5fd249b to 0f7487f Compare October 3, 2026 21:00
@thymikee
thymikee added this pull request to stack #3196 October 3, 2026 21:03
@thymikee
thymikee force-pushed the refactor/session-fixture-lifetimes-core branch from 0f7487f to a8430eb Compare October 3, 2026 21:16
@thymikee
thymikee force-pushed the refactor/session-fixture-lifetimes-core branch from d877daf to b33a1c1 Compare October 4, 2026 06:05
@thymikee
thymikee force-pushed the refactor/session-fixture-lifetimes-core branch from b33a1c1 to b1f008d Compare October 4, 2026 06:10
@thymikee
thymikee force-pushed the refactor/session-fixture-lifetimes-core branch from b1f008d to 349f12d Compare October 4, 2026 06:47
@thymikee
thymikee force-pushed the refactor/session-fixture-lifetimes-core branch 2 times, most recently from 529874d to 1bec0d3 Compare October 4, 2026 07:00
@thymikee
thymikee force-pushed the refactor/session-fixture-lifetimes-core branch from 1bec0d3 to 3766ea1 Compare October 4, 2026 07:28
@thymikee

thymikee commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

The three new commits since a8430eb look good at 1bec0d3. They only touch test fixtures and finish the removal of SessionStore.set and delete, so I found no code problems in the delta.

CI is still pending. All 9 non-passing checks are queued, with no failures shown yet. Lint & Format, Coverage, Integration and Smoke would exercise this code, so please wait for them to finish green. Typecheck is the final proof that no SessionStore.set or delete callers remain.

I did not run typecheck or tests locally. I also did not verify your note that the earlier iOS smoke failure was a daemon-startup registration-busy exit. If Smoke fails again, please share the run so we can confirm it is unrelated.

The head moved to 3766ea1 after this review. The new commit comes from the base branch (it joins daemon dispatches before shutdown retires session admission), so this verdict still describes 1bec0d3. I will check the new head separately.

@thymikee
thymikee force-pushed the refactor/session-fixture-lifetimes-core branch 3 times, most recently from 66fe5bf to c2f4c19 Compare October 4, 2026 08:45
@thymikee
thymikee force-pushed the refactor/session-fixture-lifetimes-core branch from c2f4c19 to a94493c Compare October 4, 2026 08:50
@thymikee

thymikee commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

This PR is ready at a94493c. The earlier review at a8430eb (#3152 (comment)) was clean, and the changes since then are test and fixture only, with no production code touched.

Not blocking: the R7 gate header in scripts/layering/session-state.ts (lines 2 and 12) and the header in scripts/layering/session-resource-ownership.ts (line 4) still give SessionStore.get()/set() as the reason modules can mutate store-owned state, but set() is gone and writes now go through update(ref, patch), publish and retire, so you could reword those three comments to say get() returns the live record and writes use that API, or leave them.

Smoke Tests and Bundle Size show as cancelled from a superseded run, not failed, and this delta does not touch anything either job exercises. A fresh run on a94493c should settle both, and Typecheck must also finish green there; typecheck is what proves no SessionStore.set or delete caller remains, and I did not run it or the tests, only grepped the production code at this head. I did not re-check the earlier iOS smoke failure that was tied to a daemon-startup registration race, since it sits outside this delta. Cubic and Copilot have not reviewed this head, and there are no open review threads. There are no conflicts, so the only thing left before merge is those green runs on a94493c.

@thymikee
thymikee force-pushed the refactor/session-fixture-lifetimes-core branch from a94493c to d5472b0 Compare October 4, 2026 10:08
@thymikee

thymikee commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

The PR is ready. The earlier clean review at a94493c still holds, and at d5472b0 the rebased migration onto the new base adds no new problems.

Not blocking: the comment at session-replay-repair-loop.test.ts line 283 still says the earlier waits are "on the discarded session", but no session is discarded now, because the openRebuildsActions option clears the action list on the same record, so you could reword it to say open rebuilt the action list (and note the scenario is synthetic, since production open keeps actions), or leave it as is.

CI is still pending: Smoke Tests is running with no failure so far, and the other checks are green. I did not run tests locally, so the claim that the rebased migration compiles and passes against the new base rests on CI. I did not re-review the full diff outside this update, which the earlier clean reviews covered. The only route-relevant production change here is the alert and settings recording through recordSessionAction, and it comes from base PR #3144, not from this PR. No conflicts. Before merge, Smoke Tests must finish green and #3144 must merge first.

@thymikee
thymikee merged commit 8d84db2 into main Oct 4, 2026
19 checks passed
@thymikee
thymikee deleted the refactor/session-fixture-lifetimes-core branch October 4, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant