fix(omo-opencode): credential lock home Windows rooted-path check and real Windows run

SU
21d ago
+42-8

Summary

  • The test-only credential lock-home override no longer accepts a rooted path without a drive (\\tmp\\x) or a UNC path: testLockHome now uses the same drive-absolute check that guards SystemRoot, shared through a new isDriveAbsolutePath helper.
  • Changes to account-home.ts (and its test) now force the full OS matrix on pull requests, and a Windows-only test runs the real whoami.exe / reg.exe registry lookup on the Windows runner instead of only injected facts.

Changes

  • packages/omo-opencode/src/cli/service-auth/account-home.ts: new exported isDriveAbsolutePath helper; system32Tool reuses it (behavior unchanged); testLockHome accepts posix.isAbsolute || isDriveAbsolutePath.
  • packages/omo-opencode/src/cli/service-auth/account-home.test.ts: rooted-no-drive and UNC values are ignored, C:/... is honored; new test.skipIf(process.platform !== "win32") test runs the real lookup via userRecordHome(systemPlatformFacts) and asserts a drive-absolute profile path.
  • script/ci-fast-path.mjs: account-home.ts and account-home.test.ts added to platformSensitiveExactPaths.
  • script/ci-fast-path.full-matrix.test.ts: two new cases pin the exact paths.

QA & Evidence

  • What was tested: new tests first (RED), then the fix (GREEN); bun test on the account-home file and both CI classifier files; a direct classifyCiMode probe; tsgo --noEmit -p packages/omo-opencode/tsconfig.json; bun fmt on the four changed files.
    Observed result: RED: account-home 1 fail, full-matrix 2 fail. GREEN: account-home 14 pass / 1 skip / 0 fail (54 expects), CI suites 101 pass / 0 fail (239 expects); classifier probe: account-home.ts changed returns fullMatrix: true, an unrelated path still false; tsgo exit 0; bun fmt 0 files reformatted.
    Artifact: local evidence under .omo/evidence/20261113-12995-credential-lock-home/ (gitignored, never committed): unit-account-home.txt sha256 be663fcc222454bacf38b0d82c6bf83b7259b9fdbfb0584a9b4e1d99f4bbe96d, unit-ci-fast-path.txt sha256 81b27c9e8653577dd37217c37664c7f5d2f38864f6552356e25e7cb7f1d7b934, typecheck-omo-opencode.txt sha256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.
    Why sufficient: item 1 is covered at the testLockHome behavior contract and the existing SystemRoot tests pin the helper's other call site; item 2 is covered twice (classifier unit cases plus the direct probe). No existing test changed behavior.

Risks & Residuals

  • Live opencode QA is SKIP, not a pass: this machine has no opencode binary, so the opencode-qa live drive cannot run here. The change touches CLI service-auth code and CI selection, not a hook, tool, agent, or MCP surface; CI (including the Windows leg this change now forces) is the remaining live verification.
  • The Windows-only real-lookup test is skipped on Linux/macOS by design; it executes on the Windows leg.
  • Changelog fragment follows in a separate commit once this PR has a number.

Screenshots

Not applicable.

Automated Checks

bun test packages/omo-opencode/src/cli/service-auth/account-home.test.ts
bun test script/ci-fast-path.full-matrix.test.ts script/ci-fast-path.test.ts
./node_modules/.bin/tsgo --noEmit -p packages/omo-opencode/tsconfig.json

Related Issues

Fixes #12995


Implemented with AI assistance; reviewed and verified by the author (local RED to GREEN, typecheck, and classifier probe above).


Summary by cubic

Fixes the credential lock-home override accepting Windows rooted paths without a drive (\tmp\x) and UNC paths, which could point the lock at unintended locations.

  • testLockHome now rejects rooted-no-drive and UNC values; only drive-absolute paths like C:/... pass, reusing the drive-absolute check that guards SystemRoot.
  • The lock-home module and its tests now force the full OS matrix on pull requests, and a Windows-only test runs the real whoami.exe / reg.exe registry lookup on the Windows runner.
  • Adds a changelog fragment and rebuilds the committed senpi plugin bundle so the bundle-currency CI check passes.