Skip to content

refactor: resolve session artifact paths without a store - #3134

Merged
thymikee merged 0 commit into
fix/daemon-review-hardeningfrom
refactor/session-artifact-paths
Oct 3, 2026
Merged

thymikee merged 0 commit into
fix/daemon-review-hardeningfrom
refactor/session-artifact-paths

Conversation

@thymikee

@thymikee thymikee commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Session directory and app-log paths now come from the existing artifact-path module. Stale-claim recovery resolves paths from the dead owner's state directory directly, without constructing a session store. Store consumers delegate to the same validated functions.

Removes the SessionStore.expandHome forwarder and migrates all nine production callers to expandSessionPath. Path sanitization, errors, filenames and cwd handling are preserved. Moves the existing path tests to their defining modules, retaining their assertions.

Depends on #3133. Ref #3116. Ten files, 191 gross changed lines.

Validation

Tested 64f40ac3bf5b081a98b09b204bf72a482c8d3a7d:

  • 38 focused tests pass across four files; zero skips.
  • Quick checks and Fallow pass.
  • Exact-head affected checks pass: 388 files, 2,709 related tests; zero skips.
  • Independent read-only audit confirms preserved path validation/layout, recorded-owner recovery scope, complete caller migration and test discovery. No findings.
  • CI-owned coverage and provider checks remain pending.

Review in cubic

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 4.95 MB 4.95 MB -351 B
Package (unpacked) 4.95 MB 4.95 MB -351 B
Package (download) 1.48 MB 1.48 MB +299 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 17.7 ms 17.1 ms -0.5 ms
CLI --help 50.6 ms 51.9 ms +1.3 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.

All reported issues were addressed across 10 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/host-kit/src/session-paths.test.ts
@thymikee

thymikee commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

This PR is ready at 64f40ac. The code looks right, and the moved tests keep their assertions. All 14 checks pass, and there are no conflicts. It waits only on its base, #3133, landing. Not blocking, and you can take or leave these: device-claim-reconciliation.ts line 28 still joins safeSessionName(claim.session) itself, so it skips the empty, . and .. refusal in resolveSessionDir, and durable-capture-resource.ts line 58 does the same from a package that cannot import src/daemon, so a follow-up could route the first through resolveSessionDir and inject it into capture-kit; the doc on isSafeSessionSegment still names SessionStore.resolveSessionDir, and it should point at resolveSessionDir in session-artifact-paths.ts. I did not run the tests, and I read the #3138 follow-up only through your comment, not its diff.

@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:46
@thymikee
thymikee force-pushed the fix/daemon-review-hardening branch from 5411c0b to 7c81188 Compare October 3, 2026 14:40
@thymikee
thymikee force-pushed the refactor/session-artifact-paths branch from 64f40ac to b4a1636 Compare October 3, 2026 14:41
@thymikee
thymikee force-pushed the fix/daemon-review-hardening branch from 7c81188 to c7b6c1e Compare October 3, 2026 16:41
@thymikee
thymikee force-pushed the refactor/session-artifact-paths branch from b4a1636 to 9a29273 Compare October 3, 2026 16:41
@thymikee
thymikee force-pushed the fix/daemon-review-hardening branch from c7b6c1e to bbc844f Compare October 3, 2026 17:49
@thymikee
thymikee force-pushed the refactor/session-artifact-paths branch from 9a29273 to 5cbf879 Compare October 3, 2026 17:49
@thymikee
thymikee removed this pull request from stack #3146 October 3, 2026 19:38
@thymikee
thymikee merged commit a4efad5 into fix/daemon-review-hardening Oct 3, 2026
@thymikee
thymikee force-pushed the fix/daemon-review-hardening branch from bbc844f to e4a21ee Compare October 3, 2026 19:39
@thymikee
thymikee deleted the refactor/session-artifact-paths branch October 3, 2026 19:39
@thymikee
thymikee force-pushed the refactor/session-artifact-paths branch from 5cbf879 to a4efad5 Compare October 3, 2026 19:39
@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 19:39 UTC

@thymikee

thymikee commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

#3186 lands the unchanged path-helper patch on main at a4efad510b4df439f397765769ce2f860c1571e8. GitHub marked this PR merged into its former feature base during the stack reorder; that event did not land the helper on main.

The replacement preserves the reviewed patch (git range-diff is identical). Its exact-head affected gate passes 2,679 tests across 389 files, and fresh CI is running. The remaining 25 layers are grouped in native stack #3187 beneath that independent dependency.

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