Skip to content

fix(config): refuse unreadable project scope fallback - #899

Open
ydflow wants to merge 1 commit into
Tencent:mainfrom
ydflow:fix/auto-detect-unreadable-project-config
Open

ydflow wants to merge 1 commit into
Tencent:mainfrom
ydflow:fix/auto-detect-unreadable-project-config

Conversation

@ydflow

@ydflow ydflow commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Stop autoDetectInit when a project config exists but cannot be read, so commands cannot silently act on another team's project or user scope.
  • Preserve the actionable config error through teamai uninstall instead of letting its invalid-config fallback proceed.
  • Add a unit regression and real CLI coverage for push, status, and uninstall.

Closes #892

Verification

  • npm run build — passed.
  • npx tsc --noEmit — passed.
  • npm run lint — passed.
  • npx vitest run src/__tests__/config-not-initialized.test.ts -t "reports a broken project partition" — passed.
  • npx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/auto-detect-unreadable-scope.test.ts — 3 passed. The tests run the built CLI for push --dry-run, status, and uninstall --dry-run --force; each exits 1, names the broken project config, and leaves the user config and team repo unchanged.

The broader focused unit invocation had 66 passing tests and 5 Windows filesystem failures (symlink creation returned EPERM; a chmod case returned ENOENT). The new unit regression and CLI E2E tests passed.

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

Copy link
Copy Markdown
  • [P2 non-blocking] Update the scope-resolution documentation — autoDetectInit now refuses an unreadable authoritative project config, but docs/designs/data-directory-layout.md still states that read-only commands such as status keep using the double-read fallback. The repository rules require behavior changes to update every affected document. src/config.ts:650

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.

[bug] an unreadable project config falls back to the user scope in autoDetectInit

2 participants