Skip to content

fix(transfer): make manifest paths re-exportable - #58

Merged
andrei-hasna merged 1 commit into
mainfrom
task/da229805-transfer-original-path
Aug 9, 2026
Merged

fix(transfer): make manifest paths re-exportable#58
andrei-hasna merged 1 commit into
mainfrom
task/da229805-transfer-original-path

Conversation

@andrei-hasna

@andrei-hasna andrei-hasna commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve the existing encoded-path selector for normal project and child-path exports
  • also match an exact manifest originalPath back to the Claude project directory that produced it
  • add a regression for sessions stored under a project root whose metadata names a nested working directory

Root cause

The all-project export resolves originalPath from session metadata. The project-scoped export then tried to find the session directory only by re-encoding that resolved path. When the metadata path was nested below the Claude project directory, the dry run advertised a non-empty project that the real exporter could not select again.

Validation

  • regression before fix: 5 pass, 1 fail
  • focused transfer lane after fix: 6 pass, 0 fail
  • full suite: 379 pass, 0 fail
  • bun run typecheck: exit 0
  • bun run build: exit 0
  • git diff --check origin/main..HEAD: exit 0
  • Gitleaks staged and origin/main..HEAD: no leaks found
  • Gitleaks positive control: one redacted synthetic AWS-pattern finding
  • Shield staged review: no security issues found

Provenance

Todos task: da229805-f8b8-476a-b82a-f414a103dc28

The source-session directories are read only. No sanitizer, copy, import, or source-write behavior changed.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Match project selectors against resolved session metadata as well as encoded directory names so every advertised export project can be selected again.

Agent: Quintilian
@andrei-hasna

Copy link
Copy Markdown
Contributor Author

[REVIEW] GO — #58 @ 6b11edf — lens: correctness+security+gates, reviewer Hostus (1 of 1)

Reviewed the exact one-commit change against origin/main at 16ed634. I read the full diffs for src/lib/transfer.ts and test/transfer.test.ts, then the complete changed files and the surrounding path-resolution helpers, CLI transfer caller, existing path tests, package scripts, and PR rationale.

Commands run:

  • bun install — exit 0; setup only, 117 packages installed. This is not reported as a test gate.
  • bun run typecheck — exit 0; tsc emitted no pass/fail count.
  • bun run test — exit 0; 379 pass, 0 fail, 1798 expect() calls across 44 files.
  • gitleaks git --no-banner --redact --log-opts=origin/main..HEAD . — exit 0; 1 commit scanned, no leaks found.

Correctness and security trace: the project selector still preserves encoded exact/child matching. The added path takes the caller-supplied project path through the existing directory inventory, rejects non-directories, compares against the same resolveProjectPath result advertised in the manifest, and then enters the unchanged read/copy export path. It adds no source-session writes, import mutation, authentication boundary, network sink, or permissive failure fallback.

Blocking P0/P1 findings: none.

Non-blocking follow-ups: none.

@andrei-hasna
andrei-hasna merged commit 849c724 into main Aug 9, 2026
2 checks passed
@andrei-hasna
andrei-hasna deleted the task/da229805-transfer-original-path branch August 9, 2026 08:25
@andrei-hasna

Copy link
Copy Markdown
Contributor Author

[ACCEPTANCE] Station01 real-path verification passed on the exact reviewed candidate 6b11edf48b525cd33fec3ab85b8b9822f0ec9eb1.

Exact sanitized receipt:

{"status":"PASS","installedVersion":"0.12.11","allProjectsForm":"default-without-project","candidateHead":"6b11edf48b525cd33fec3ab85b8b9822f0ec9eb1","advertisedProjects":115,"advertisedNonEmpty":91,"reproducingCandidateIndex":0,"baselineExitCode":1,"fixedExitCode":0,"fixedProjectCount":1,"fixedJsonlCount":1,"fixedTotalFiles":1,"sourceFiles":1,"sourceBytes":124036,"sourceImmutable":true}

OpenLoops run: 019fe59f2530a2acb6265fd4a47b9255.

The installed @hasna/sessions 0.12.11 reproduced the original selection failure on deterministic candidate 0. The frozen PR source exported the same advertised project successfully. Before/after content digests matched, the 0700 staging directory was removed, and no source-session path or body was emitted.

The externally created squash merge 849c724a10e10ec91aabe12a3b978157db69113a has sole parent 16ed6348e0dc991b463f04619004710066367cd9 and tree 6eda749e4fea17563227208f6c23f9350f87f9f2, exactly matching the reviewed head tree.

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