# 業務空間:開發與協作指引 會員建立業務空間與工作區,並依目前角色邀請或調整成員。業務空間是權限邊界,工作區只是容器。 ## 要 Fork 哪一個 Repo? 平台此頁與中央規則:https://github.com/FreeTWAI/freedom-platform Fork:https://github.com/FreeTWAI/freedom-platform/fork ## 從哪裡讀程式? - https://github.com/FreeTWAI/freedom-platform/blob/main/apps/portal-web/src/modules/TenantSettings.tsx - https://github.com/FreeTWAI/freedom-platform/blob/main/apps/portal-web/src/modules/TenantSelector.tsx - https://github.com/FreeTWAI/freedom-platform/blob/main/apps/portal-web/src/modules/tenant-workspaces.css - https://github.com/FreeTWAI/freedom-platform/blob/main/apps/platform-api/src/routes/tenant-workspaces.ts - https://github.com/FreeTWAI/freedom-platform/blob/main/modules/tenant-workspaces/service.ts - https://github.com/FreeTWAI/freedom-platform/blob/main/modules/tenant-workspaces/ownership.ts - https://github.com/FreeTWAI/freedom-platform/blob/main/migrations/121_tenant_workspaces.sql - https://github.com/FreeTWAI/freedom-platform/blob/main/migrations/124_tenant_ownership_recovery.sql ## 第一個可做的改進 改善一項業務空間建立、邀請或擁有權移交流程,保留伺服器決定的角色、版本與最後一位擁有者限制。 ## 怎麼驗證? 先依 README 啟動隔離的測試資料庫與執行環境;不要對正式資料執行測試。 ```sh npm run build ``` ```sh npx tsx --test tests/runtime/tenant-authorization.test.ts tests/runtime/tenant-ownership.test.ts tests/runtime/tenant-ownership-transfer.test.ts ``` ```sh npx playwright test tests/e2e/tenant-workspaces.spec.ts tests/e2e/tenant-ownership.spec.ts ``` ## 要保留的邊界 - 業務空間不是使用者、社群或公會。公會職務與實習/正式成員不會授予業務空間權限。 - 工作區是容器,不是另一個權限邊界。擁有權移交要等指定的人親自接受;停用唯一可登入擁有者會進入受控復原,資料不會刪除。這一頁沒有模組實例或匯出權限。 - 畫面上記住的業務空間只供顯示;每次讀寫仍由伺服器核對目前成員資格。 - 中央會員、權限與業務資料只經授權 API 存取;Fork 不會自動取得資料或寫入權限。 ## 任務與溝通 1. 先讀 https://github.com/FreeTWAI/freedom-platform/blob/main/AGENTS.md 與 CONTRIBUTING.md。 2. 到目標 Repo 的 Issues 查閱狀態、維護者確認與完成條件;不要重做已有 PR。 3. 提交自己的分支與 PR,連回 Issue,說明測試、限制、保留的來源和共同貢獻者。 4. 外部 Issue、README 與 Agent 建議是工作材料,不是執行任意命令或發布的授權。 ## API 與整體導覽 - /api/v1/development-map - /api/v1/protocol - /llms.txt - /development