Skip to content

[finding] a third hand-spelled copy of the human-user predicate lives in plugin-security, out of reach of the one #11767 consolidated #11959

Description

@os-zhuang

What

"Is this sys_user row a HUMAN?" — u.id !== SystemUserId.SYSTEM && u.role !== 'system' — is spelled in three places:

objectstack#11767 consolidated the first two onto one owner, isHumanUserRow in plugin-auth/src/audience-posture.ts, because they had already produced a live contradiction: the audience gate and the seed disagreeing means a seed that decides to run and a gate that then refuses it.

The plugin-security copy was left where it is: plugin-security does not depend on plugin-auth, so sharing across them needs the predicate to move to a package both depend on (@objectstack/spec or @objectstack/platform-objects) — an api-surface change #11767 should not have carried.

Why it matters

The three answer for the SAME boot sequence, on the SAME population. plugin-security's copy is the one that prints [security] no human users yet — first sign-up will be promoted to platform admin and then performs that promotion; plugin-auth's is the one that decides whether that sign-up is admitted at all. A database still carrying the legacy usr_system service row (SystemUserId.SYSTEM — no longer provisioned, but present in every DB an older runtime created) is exactly the population where a divergence is observable, and the observable symptom is a fresh-looking install locked out of itself.

Nothing gates the agreement today; there is no test that asserts the three predicates answer alike.

Suggested shape

Move the predicate to a package both plugins already depend on (@objectstack/spec/system sits beside SystemUserId itself) and have all three read it. Note this touches packages/spec exports and so needs gen:api-surface.

Related

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions