Skip to content

fix: retire only the captured expired session lifetime - #3139

Closed
thymikee wants to merge 1 commit into
fix/daemon-capture-review-controlsfrom
fix/leased-session-lifetimes
Closed

thymikee wants to merge 1 commit into
fix/daemon-capture-review-controlsfrom
fix/leased-session-lifetimes

Conversation

@thymikee

@thymikee thymikee commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Summary

For #3116, lease expiry now passes one captured SessionRef through teardown and retirement. A cwd-scoped session keeps its stored address; cleanup cannot bind a separate default session or delete a successor published during cleanup. Lease renewal patches the same lifetime's latest record.

Addresses the scoped-expiry review on #3137. Depends on #3138.

Validation

Head: a037cd67f5; five changed files. All locally runnable affected checks pass, including 224 files/1,293 related tests. The 41 focused tests pass without skips; the existing expiry test moved unchanged. Both public-name lookup and unguarded-retirement mutants fail, then restore green. Lint, typecheck, format and Fallow pass. Independent read-only audit found no actionable findings. Device CI remains GitHub-authoritative.

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 4.96 MB 4.96 MB +17 B
Package (unpacked) 4.96 MB 4.96 MB +17 B
Package (download) 1.49 MB 1.49 MB +12 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.3 ms 26.5 ms +0.2 ms
CLI --help 82.0 ms 79.9 ms -2.1 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 5 files

Re-trigger cubic

@thymikee

thymikee commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

This PR is ready at a037cd6. The change retires only the captured expired session, and I found nothing that needs to change. All 14 checks pass. This PR is stacked on #3138, so that base branch has to land first. This review covers only the delta from 0780e5e to a037cd6.

Not blocking, and you can take or leave these. At src/daemon/lease-lifecycle.ts#L132 the update callback uses current.lease!. You can spread existingSession.lease, which is already narrowed, instead. At src/daemon/request-execution-scope.ts#L420 runtime hints are now read from ref.address before teardown, and no test sets runtime hints, so seeding them on the original in the 'retire' variant and asserting that finalize receives them would pin that order. At src/daemon/server/daemon-session-idle-expiry.ts#L494 the idle-expiry path still removes by address with delete(sessionName), which fits the #3116 SessionRef retirement follow-up better than this PR.

I did not run the focused tests or your two mutants. I judged that the old code fails the new cases by reading it at 0780e5e. I also did not trace whether finalizeBoundSessionApplicationLifecycle on the captured original could touch a same-device successor in a retire and republish race. That race cannot happen under the current locking, and the old code behaved the same way.

@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 08:50
@thymikee
thymikee force-pushed the fix/daemon-capture-review-controls branch from 0780e5e to aa51d9b Compare October 3, 2026 14:41
@thymikee
thymikee force-pushed the fix/leased-session-lifetimes branch from a037cd6 to 356f874 Compare October 3, 2026 14:41
@thymikee
thymikee force-pushed the fix/daemon-capture-review-controls branch from aa51d9b to d9019e1 Compare October 3, 2026 15:16
@thymikee
thymikee force-pushed the fix/leased-session-lifetimes branch from 356f874 to 431d814 Compare October 3, 2026 15:16
@thymikee
thymikee force-pushed the fix/daemon-capture-review-controls branch from d9019e1 to ee66f4b Compare October 3, 2026 16:41
@thymikee
thymikee force-pushed the fix/leased-session-lifetimes branch 2 times, most recently from ab19199 to d26668d Compare October 3, 2026 16:56
@thymikee
thymikee force-pushed the fix/daemon-capture-review-controls branch 2 times, most recently from 2184bed to a0b22de Compare October 3, 2026 17:49
@thymikee
thymikee force-pushed the fix/leased-session-lifetimes branch from d26668d to 36c82ac 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 fix/leased-session-lifetimes branch from 36c82ac to a360ff3 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 commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

Consolidated into #3135 as part of reducing #3116 to seven PRs. The composition preserves the complete pre-consolidation source tree, including tests and later review corrections. This PR is superseded; its review discussion and native evidence remain available. Outstanding findings transfer to the owning keeper in the implementation record.

@thymikee thymikee closed this Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-03 21:17 UTC

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