Skip to content

feat(org): dual-identity UX bounds — studio vs org room (P1.3) - #78

Merged
XYAIStudio merged 1 commit into
mainfrom
cursor/dual-identity-ux-bounds-69ba
Sep 20, 2026
Merged

XYAIStudio merged 1 commit into
mainfrom
cursor/dual-identity-ux-bounds-69ba

Conversation

@XYAIStudio

@XYAIStudio XYAIStudio commented Sep 20, 2026 •

Copy link
Copy Markdown
Owner

摘要

把 FreeOS 工作室本机登录 与组织 房间登录 拆成两扇门,互不顶替、互不抬权。本机先安顿(注册 / 登录 / 数据留在设备上);组织能力是工作室里的另一间房间——试用、布置流程,可以和宿主对话协作,但不会把两种进入方式捏成同一种。

界面与文档用软隐喻:工作室 / 另一间房间 / 各自留白。不写生硬的「非正式 / 无关账号 / 独立测试环境」。

已 rebase 到最新 main(含 P1.2 #77 与产品契约 P0.1)。冲突仅 CHANGELOG:P1.3 与 P1.2 / P1.1 / P0.2 条目一并保留。双身份边界与测试未丢。

身份边界

  • 工作室门:FreeOS JWT(auth_token,/api/auth/local-session|login|register)。FREEOS_ORG_INTEGRATED 不再替换宿主鉴权。
  • 房间门:组织 JWT(仪表盘 org_room_token;openXYOS iframe 自己的登记本)。
  • resolve_organization_user 宿主角色 始终 Role.USER;组织角色只写在 organization_role。已入库的 admin 会被降回 user。
  • 组织 super_admin 不会被抬成宿主 Role.ADMIN。
  • 工作室访客(含本机管理员)不能拿宿主通行证写房间业务:/api/org-module/business/* 与 sidecar 写操作要求 has_organization_identity。
  • 宿主 JWT 不再转发给 sidecar;未映射的工作室用户 X-FreeOS-Role 为 guest。
  • 取消 /organization 307 跳过工作室壳层;登录页始终是工作室门,房间只作为可选入口。

文案与文档

  • 登录页、组织入口、openXYOS 房间登记页:工作室提示 + 房间门提示。
  • docs/user-guide.md §5.1、docs/architecture-integration.md、docs/org-merge-plan.md IdentityBridge、docs/api.md。
  • CHANGELOG.md Unreleased(与 P1.2 / P1.1 / P0.2 并存)。

测试

  • 后端:tests/unit/api/test_org_identity.py、user manager 不抬权 / 降权、JWT 中间件宿主会话、dashboard_serve 无 307、sidecar 写操作拒绝访客。
  • 前端:hostUserFromOrganization 恒为宿主 user、AuthGuard 不用房间 token 当工作室会话、OrganizationEntry 房间提示。

rebase 后复跑:uv run pytest tests/unit/api/test_org_identity.py tests/unit/test_identity.py tests/unit/test_user_manager.py tests/unit/test_org_module.py tests/unit/api/test_jwt_auth_middleware.py → 81 passed。

Target branch

  • Base is main
  • Base is develop

Type of change

  • New feature
  • Bug fix(堵住身份串门 / 静默提权)
  • Documentation

Checklist

  • Updated CHANGELOG.md
  • README / docs updated
  • Added/updated tests

范围外

P1.4 本地模型/知识库、P1.2 导出(已在 main)、砍 Node、完整 App.tsx 迁移。

成功标准

用户能把 FreeOS 登录和组织房间登录当成两扇分开的门来用;组织管理员不会被悄悄抬成宿主管理员。

Open in Web Open in Cursor 

Keep FreeOS studio auth and organization-room auth as separate doors.
Organization roles stay in organization_role and never become host
Role.ADMIN. Studio guests cannot write org business with a host JWT.

Soft copy uses 工作室 / 另一间房间 / 各自留白.

Co-authored-by: XYAI Labs <haoboy8@gmail.com>
@cursor
cursor Bot force-pushed the cursor/dual-identity-ux-bounds-69ba branch from 1e493b4 to 6390eee Compare September 20, 2026 10:46
@XYAIStudio
XYAIStudio merged commit 7a6c673 into main Sep 20, 2026
4 of 6 checks passed
@XYAIStudio
XYAIStudio deleted the cursor/dual-identity-ux-bounds-69ba branch September 20, 2026 10:47
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