Skip to content

fix: anchor project-relative docs destinations - #652

Merged
jeff-r2026 merged 1 commit into
Tencent:mainfrom
dvd233:codex/fix/project-docs-destination-635
Sep 20, 2026
Merged

jeff-r2026 merged 1 commit into
Tencent:mainfrom
dvd233:codex/fix/project-docs-destination-635

Conversation

@dvd233

@dvd233 dvd233 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Anchor relative sharing.docs.localDir values to the active scope base directory instead of the process cwd.
  • Reuse the shared resolver from uninstall so cleanup targets the same directory that pull and doctor use.
  • Preserve existing project ~/... and absolute-path behavior.

Fixes #635

Root cause

Project-scope initialization writes ./.teamai/docs. The old resolver returned that string unchanged, so pull/doctor/uninstall resolved it against whichever cwd invoked the command. This could create duplicate bundles in nested directories and let uninstall remove a user-owned cwd-relative directory while leaving the actual bundle behind.

Validation

  • Regression red on origin/main: the new docs-destination test failed for both project- and user-relative paths because the resolver returned ./.teamai/docs unchanged.
  • Focused regression + doctor + uninstall tests: 57 passed.
  • npx tsc --noEmit: passed.
  • npm run build: passed.
  • Real CLI E2E after build: doctor --json resolved the relative path under the temporary HOME; uninstall --force removed the anchored TeamAI docs while preserving a packages/web/.teamai/docs/keep.md decoy.
  • Full npm test: 3,436 passed; 73 existing Windows/path/permission/platform failures and one Vitest worker timeout remain unrelated to this change.
  • git diff --check: passed.

@jeff-r2026 jeff-r2026 self-assigned this Sep 19, 2026
@github-actions

Copy link
Copy Markdown
  • [P1 blocking] Prevent empty destinations from resolving to the scope rootsrc/resources/docs.ts:19 converts localDir: "", currently valid under the z.string() schema, into HOME for user scope or projectRoot for project scope. uninstall --force then recursively removes that entire directory via remove(plan.docsDir). Reject empty/blank values and defensively refuse deleting the scope root.

The PR description includes a sufficient test plan and a concrete real-CLI E2E record.

@jeff-r2026
jeff-r2026 merged commit bd85772 into Tencent:main Sep 20, 2026
10 checks passed
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.

fix(docs): sharing.docs.localDir is resolved against the process cwd, so the bundle follows wherever teamai ran

2 participants