Skip to content

[Decision] demoStaff on hosted environments: a hosted demo organization has no platform door to get an app's declared demo accounts, so apps fall back to their own account scripts #33113

Closed

Description

@os-bob

Filing gate: ② a decision only the maintainer can make (security boundary of who may mint sign-in accounts), filed on the maintainer's direct word, verbatim: 「demoStaff 的问题,立平台的决策卡」 (2026-11-13, Claude Code session session_012dn2AfRg91ZPAKHATZmsTW, PM seat for steedos-labs/os-project-blackcat-crm). Reader: triage for routing (touches plugin-auth, cli compile and the hosted install path, so the cloud lane is a likely reader), then the director seat to present.
Dedupe: is:issue demoStaff (17 hits: #25777 origin, #26616 manager key, #26302/#26764 skills, #26424 prose — none on hosted environments); is:issue demo accounts cloud environment (35 hits; nearest is #30680, hosted sample-row ownership, ruled A — rows go to the installer — which this card does not reopen). New.

维护者速读

应用用 demoStaff 声明的演示账号只在本地 os dev 创建,os build 会把名单从部署包里删掉,部署环境也会拒绝创建,这是 hotclm#28 裁决 D 定下的安全边界。结果是托管的演示环境(比如给客户做汇报的 ObjectOS Cloud 演示组织)装好应用和示例数据后,一个演示账号都没有,种子里按名字分配给业务员的记录也找不到人。下游应用只能各自再写一个建账号脚本,这正是裁决 D 想消除的局面。本卡请你定:托管环境要不要、通过哪个入口拿到演示账号。我推荐 C:扩展现有的管理员批量导入用户接口,让它也能分配岗位和权限集;demoStaff 仍然只用于本地开发,部署包里不带演示名单,也不新增演示专用的能力。

The question

An app declares its demo accounts in demoStaff (spec 18.2, manager since 18.3). They are provisioned only on a local development boot:

  • packages/plugins/plugin-auth/src/demo-staff.ts header: three gates — NODE_ENV === 'development', a loopback auth base URL, single tenancy — plus "a database with no sign-in yet gets none".
  • packages/cli/src/commands/compile.ts:1237-1248: os build deletes demoStaff from the artifact, so a deployment has no list to provision.
  • Governing text: packages/spec/src/system/demo-staff.zod.ts — "The maintainer ruled the account creation the platform's (hotclm#28, letter D): 'demo accounts are the platform's to create; the app only declares them'" and "Development only — the security boundary … a password every developer of the application knows".

When a hosted demo environment (a demo organization on ObjectOS Cloud, never a customer's) needs the same people, what platform door gives them to it?

Evidence of pull (measured)

steedos-labs/os-project-blackcat-crm demos a carbon-black CRM to a client from a hosted demo environment. Its seed deals customers and orders to named reps, and the demo needs 9 accounts with positions, permission sets and direct managers (the two-level rating approval and the margin special approval route by position and by manager). Today it ships scripts/demo-carbon.ts --remote plus a manual workflow that creates the accounts through admin APIs: an app-side account script, the shape ruling D retired for local boots.

The existing admin door, POST /api/v1/auth/admin/import-users (packages/plugins/plugin-auth/src/admin-import-users.ts), already creates sign-in accounts on any environment with the right credential policy (invite, or temporary: generated, shown once, must_change_password), and resolves a manager_id column by address. It does not assign positions or permission sets (no such columns), so the gap left to app scripts is exactly that.

Options

Shape Security boundary Work
A No change. Hosted demo environments use the existing admin doors by hand (import users, then assign positions and sets in Setup); apps document the steps, and app-side scripts stay as they are unchanged none (per demo reset: manual steps; downstream keeps its script)
B Hosted opt-in demo provisioning: the artifact carries demoStaff (no password), and an organization admin on a hosted environment can trigger "create this app's demo accounts", credentials via the import-users policies (never the dev password) widened: the artifact gains a list of accounts that can be minted in production; needs a revised ruling D and an install-time guard so a customer org never gets them M–L (spec + compile + plugin-auth + hosted install UI)
C Extend import-users with position and permission-set columns, resolved like manager_id (a second pass, through the same checks as Setup); demoStaff stays dev-only. A hosted demo is one CSV import, and real customers onboarding staff get the same door unchanged (an admin-only door that already mints accounts gains two assignment columns, each through the existing assignment checks) S–M (plugin-auth + spec of the import columns + docs/skills)

Four-dimension analysis

  • 实际业务需求:有实测拉动。下游项目每次给客户演示都要在托管环境里建 9 个带岗位和直属上级的账号,目前只能靠自写脚本。C 的入口不止服务演示:真实客户批量导入员工时同样要分配岗位,这是同一个需求。B 只服务演示。
  • 项目长远合理性(权重 ≥50%):C 把"建账号 + 分配岗位"收进平台已有的管理员入口,demoStaff 的开发专用边界和"部署包不带演示名单"都不动。B 要在生产部署包里放一份能创建账号的名单,需要改写裁决 D,长期多一个必须一直守住的安全面。A 让每个应用继续自写脚本,和裁决 D 的方向相反。
  • 防 AI 写错:C 让 AI 只有一条路可走:本地用 demoStaff,托管环境用导入用户。B 会让 AI 误以为 demoStaff 在生产环境也生效,把演示名单写进客户应用。A 会继续诱导 AI 在应用里写账号脚本。
  • 不扩散需求:C 只给现有接口加两列。B 是新的演示专用能力面,按创业阶段的聚焦原则默认不做。A 什么都不加,但把成本留给了每个应用。

Recommendation: C. Fallback if the maintainer wants no widening now: A.

Downstream state

steedos-labs/os-project-blackcat-crm#11 moves its local demo to demoStaff + defineSeed (spec-conformant) and keeps the hosted account step as a tracked interim, to be deleted once this card is ruled and executed.

Activity

  1. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    Contributor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: grade p2 → p1, on the maintainer's word · 2026-11-15T03:10Z

    ⛔ Not a claim.

    Blocked-by: #33181, #33187, objectstack-ai/cloud#4469

  2. added
    priority:p1
    and removed
    priority:p2
    on Nov 15, 2026
  3. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    Contributor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Maintainer ruling · option C, narrowed · p1 · 2026-11-16T15:13Z

    The maintainer ruled in the triage seat's thread at 2026-11-16T15:12Z, verbatim: 「C,只加岗位列,p1」.

    The ruling:

    • POST /api/v1/auth/admin/import-users gains one column, the position.
    • It is resolved in a second pass, like manager_id, and goes through the same checks as assigning a position in Setup.
    • An unresolved or refused position is a per-row error. The user is still created.
    • No permission-set column. Under ADR-0090 a position carries its sets (PositionSchema.permissionSets). The maintainer's own question in the thread: 「权限级不是绑定到岗位的吗」. A rare direct grant stays a Setup step.
    • demoStaff stays development-only, and the artifact carries no demo list. Ruling D's boundary is unchanged.
    • Option B is not taken: it would widen production with a mintable account list.

    Why it matters: a hosted demo organization, and a real customer onboarding staff, get people with positions and managers from one CSV. Downstream account scripts can then retire (steedos-labs/os-project-blackcat-crm#11 keeps its interim step until this ships).

    Grade: p1, set by the maintainer (focus theme: 中文客户能用起来). The card leaves pm:blocked for pm:queue on the server lane. The build also updates the import page's column help, the authentication docs, and the skills that teach the import.

  4. added
    pm:queue
    and removed
    pm:blocked
    on Nov 16, 2026
  5. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

    Claim: PM loop round 1 (area o2-D, repo:objectstack#2; large card, built in its own card thread)
    Session: session_01ADHkmRXuRn93HphKp7kXEz
    Thread session: session_01ADHkmRNTuoSXYcZLxRV232
    Account: os-steve
    Branch: claude/project-thread-7l0awc
    Worktree: the card thread's own checkout
    Domain: domain:server
    Seat: repo:objectstack#2
    File surface: packages/plugins/plugin-auth/src/admin-import-users.ts and its tests (the position column, resolved in a second pass), the Setup position-assignment check it reuses (imported, never copied), the import page's column help under ui/packages/app-shell/src/views/identityImport.ts / objectViewIdentity.tsx and ui/packages/auth/src/types.ts (the row outcome type), content/docs/permissions/authentication.mdx, .changeset/ (stop on breach; explain in the report). ⛔ Not auth-plugin.ts or auth-route-ledger.ts unless measured necessary (open PR #34333 touches both: merge-tree before the first push).
    Container & model: L, mode:thread, model: default judgment tier, effort: high
    Clause-②: yes (widening)
    Metadata-protocol: none
    Responsibility: n/a — not a defect card (maintainer-ruled widening of an admin import door)
    Thread-read: 6920428750
    Premise: holds (admin-import-users.ts on origin/main e8cba8f admits manager_id as its only assignment column)
    Ruling-ref: 6920428750 (maintainer 「C,只加岗位列,p1」, 2026-11-16T15:12Z): one column, the position; resolved in a second pass like manager_id, through the same checks as assigning a position in Setup; an unresolved or refused position is a per-row error and the user is still created; no permission-set column (ADR-0090: a position carries its sets); demoStaff stays development-only; option B not taken. The skills that teach the import are a separate domain:skills card, filed by the seat.
    Serial constraints cleared: open PR #34333 (seat 1, plugin-auth) touches auth-plugin.ts and auth-route-ledger.ts, outside this surface; no open PR touches admin-import-users.ts (intersected on a deepened checkout at 22:31Z).
    Pre-claim lane: domain:server (packages/plugins/plugin-auth) with a ui/** rider kept in-lane (area-lease 留道 rule); large-card trigger (Clause-② yes) ⇒ own card thread, owes a contract-tier L2 review at TIER_DEFAULT.
    Pre-claim deps: the earlier Blocked-by: #33181, #33187, objectstack-ai/cloud#4469 was cleared by the ruling 6920428750, which moved the card to pm:queue.
    Prior rulings read: 6920428750 (this card), ruling D (hotclm#28, demoStaff dev-only, governing text packages/spec/src/system/demo-staff.zod.ts), ruling 5651634638 row 7 (manager_id second pass), ADR-0090 (positions carry permission sets); thread: #33113; repo: objectstack-ai/objectstack

  6. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 16, 2026
  7. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

    File surface amended (claim 6931355877, card thread session_01ADHkmRNTuoSXYcZLxRV232, branch claude/project-thread-7l0awc), on the building thread's measured read:

    • added packages/plugins/plugin-auth/src/auth-plugin.ts, ONE line: the import-users mount's deps pass createGrant: createGrantFor(c), the seam create-user and import-sso-users already use, so the position is written under the importing admin's own execution context and meets the security middleware, the delegated-administration gate and the position-catalogue check exactly as a Setup assignment does (a SYSTEM-context write would bypass all three). Open PR feat(auth): an invitation is accepted in one step with the proof its mail carries #34333 adds two lines to the same file: the thread runs git merge-tree against it before the first push and reports the result. auth-route-ledger.ts stays untouched.
    • added packages/plugins/plugin-auth/src/pending-sso-users.ts, export only: readNameList (import-sso-users' positions-column reader) gains export, and import-users imports it rather than copying it.
  8. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

    File surface corrected again (claim 6931355877; supersedes the matching lines of the previous amendment), on the building thread's measured read:

    • packages/plugins/plugin-auth/src/pending-sso-users.ts no longer gains an export: readNameList would become a new public name through the package index's export *. It moves instead into a new module packages/plugins/plugin-auth/src/name-list-cell.ts, which the index does not re-export; pending-sso-users.ts and admin-import-users.ts both import it.
    • the console import list lives in ui/packages/app-shell/src/views/IdentityImportPanels.tsx (the field list and the options panel), not in identityImport.ts / objectViewIdentity.tsx: the wizard sends only mapped columns, so the positions column and its one-line help go there.
    • the help is a new i18n key, console.identityImport.positionsHint, so each of the eleven packs under ui/packages/i18n/src/locales/ gains one line (the all-locales key-parity gate).
    • removed: ui/packages/auth/src/types.ts (the row outcome type does not live there).

    The only file shared with open PR #34333 is still packages/plugins/plugin-auth/src/auth-plugin.ts (one line here).

  9. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

    File surface amended (claim 6931355877, card thread session_01ADHkmRNTuoSXYcZLxRV232): the derived gate check:tenant-audit-census counts the new sys_user_position write site (321 to 322). Its own fix, node scripts/tenant-audit-census.mjs --write, regenerates the census, so these two files join the surface as gate artefacts (neither is a governed surface):

    • content/docs/permissions/tenant-audit-census.mdx (the generated table and the hand-written count in its prose);
    • docs/audits/2026-08-tenant-audit-write-call-sites.counts.md.
  10. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-steve · session_01ADHkmRNTuoSXYcZLxRV232
    os-dev-report

    {
      "issue": 33113,
      "status": "done",
      "branch": "claude/project-thread-7l0awc",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34531",
      "session": "session_01ADHkmRNTuoSXYcZLxRV232",
      "premise_still_valid": true,
      "summary": "POST /api/v1/auth/admin/import-users admits one new column, positions (position machine names, ;-separated, the column admin/import-sso-users already reads; seat named it). After runImport, beside the manager pass, each named position is a sys_user_position insert under the importing admin's own execution context (createGrant seam, wired with one line in auth-plugin.ts), so Setup's checks judge it; unresolved/refused positions are per-row outcomes (rows[].positions, summary.positions, audit row) and the user is still created. A file naming positions on a host with no seam answers 501, an unresolvable caller 403, nothing created, dry runs included. Console import wizard offers the column with a hint in all 11 locale packs; authentication.mdx documents it; tenant-audit census re-measured (321 to 322).",
      "tests": "head d3c32ee1c. plugin-auth: pnpm --filter @objectstack/plugin-auth test -> Test Files 280 passed (280), Tests 5774 passed | 10 skipped; new describe in admin-import-users-manager-pass.test.ts, 11 cases green. ui: vitest identityImport.test.ts, identityImportFields.emailRule-11913.test.tsx, identityImport.csvBatches-13315.test.tsx, packages/i18n/ -> Test Files 105 passed, Tests 1924 passed | 13 skipped. Ablations via scripts/ablation-replace.mjs on src (tests import src, no dist leg), each landed (anchor 1->0, blob moved) and restored to HEAD blob 980fdb49c95b with git diff HEAD empty: (1) grant written as SYSTEM_CTX -> 3 red; (2) second pass skipped -> 6 red; (3) up-front settlement skipped -> 7 red.",
      "gates": "local: dispatch-gates --commands derived 111 on head d3c32ee1c, all 111 exit 0; --ran: 111 derived, 111 run, 0 NOT-MEASURED, 0 UNRUN (file /mnt/project-files/objectstack-seat2/33113-gates-ran.txt). plugin-auth typecheck exit 0 (check:test-typecheck OK); @object-ui/i18n and @object-ui/app-shell type-check VERDICT command-exit 0. First run red on check:tenant-audit-census (new write site 321->322): fixed by --write + prose figures in the same PR. CI check-runs: in_progress at hand-back.",
      "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "3 — mcp__github__issue_read (get, get_comments) x2, mcp__github__pull_request_read get_files (#34333) x1; no write tool",
      "api_writes": "2 — fleet-write pr_create (POST pulls + POST issues/34531/assignees), post-stamped comment on #33113 (POST issues/33113/comments)",
      "open_questions": [
        { "question": "Needs contract review (Clause-②: yes (widening), TIER_DEFAULT) at head d3c32ee1cc975ea3ffa747f22a32deace0a95208.", "options": ["seat routes to the online review seat"], "recommendation": "seat routes" },
        { "question": "A request whose rows name positions on a host with no grant seam, or whose caller's context does not resolve, is refused whole (501 / 403) before any write, rather than per row.", "options": ["A keep whole-request refusal, as create-user and import-sso-users settle grants before writing", "B create the users and report every position per row"], "recommendation": "A, because the ruling's per-row clause is about a position that does not resolve or is refused, while a host that cannot judge any grant is known before the first write and creating accounts that silently miss every position is the half-done import the sibling doors refuse" }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "class: a · reach: POST /api/v1/auth/admin/import-users in multi-organization mode creates users with no membership in the importing admin's current organization (create-user joins it via joinCurrentOrganization; import-users has no join), so every positions cell is refused per row by the grant-holder membership refusal (VALIDATION_FAILED, user_id reference_not_found) · evidence: admin-user-endpoints.ts create-user join block vs admin-import-users.ts createData (authApi.createUser only); reconcile-membership.ts returns none in multi mode · dedupe words: import-users multi-org membership, imported users member-less, import join current organization",
        "class: a · reach: Console Users list Import wizard offers email, phone_number, name, role, positions but no manager_id target, so the manager column the endpoint admits cannot be mapped from the UI · evidence: ui/packages/app-shell/src/views/IdentityImportPanels.tsx identityImportFields · dedupe words: import wizard manager_id column, identityImportFields manager",
        "carrier: seat · the skills that teach import-users need the positions column (domain:skills card, per claim)"
      ]
    }
  11. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

    PR #34531 at 987b7e725: L1 ACCEPT 6936586013 (r3), TIER_DEFAULT declaration record 6936574759 (PASS), landing 6936625179 (ready, auto-merge armed). r3 reports a position that cannot be judged as refused on its row (NOT_IMPLEMENTED / PERMISSION_DENIED) and still creates the user, as ruling 6920428750 directs. Follow-ups filed: #34535, #34536, #34537.

  12. removed
    pm:dispatched
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:serverpriority:p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions