Skip to content

test(migration): make workdir bucket hash expectation platform-aware#275

Closed
haosenwang1018 wants to merge 1 commit into
MoonshotAI:mainfrom
haosenwang1018:test/workdir-bucket-platform-hash
Closed

test(migration): make workdir bucket hash expectation platform-aware#275
haosenwang1018 wants to merge 1 commit into
MoonshotAI:mainfrom
haosenwang1018:test/workdir-bucket-platform-hash

Conversation

@haosenwang1018
Copy link
Copy Markdown

Related Issue

Part of #225

Problem

computeWorkdirBucket() intentionally hashes resolve(workdirPath), matching the running app's workdir key behavior. One test hardcoded the expected hash from the raw POSIX-looking string '/Users/me/Developer/proj'. That is stable on POSIX, but on Windows resolve() re-anchors the input to the current drive, so the product function and the test expected value diverge even though the function is behaving as documented.

What changed

  • Updated the test expected hash to derive from resolve(input), the same normalization contract used by computeWorkdirBucket().
  • Kept the existing slug and hash-shape assertions intact.
  • Added an empty changeset because this is a test-only portability fix with no published package bump.

Verification

  • pnpm --filter @moonshot-ai/migration-legacy exec vitest run test/sessions/workdir-bucket.test.ts
  • pnpm --filter @moonshot-ai/migration-legacy run typecheck
  • pnpm exec oxlint packages/migration-legacy/test/sessions/workdir-bucket.test.ts
  • pnpm --filter @moonshot-ai/migration-legacy run test
  • pnpm changeset status --since=origin/main

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 1, 2026

🦋 Changeset detected

Latest commit: a1b491c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@liruifengv liruifengv closed this Jun 2, 2026
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.

2 participants