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
What
"Is this
sys_userrow a HUMAN?" —u.id !== SystemUserId.SYSTEM && u.role !== 'system'— is spelled in three places:packages/plugins/plugin-auth/src/auth-plugin.ts(dev-admin seed precondition)packages/plugins/plugin-auth/src/auth-manager.ts(the feat(spec,auth)!: one declared audience posture for who may self-register into an app — invite_only|email_domain|open, default invite_only #11739 audience bootstrap bypass)packages/plugins/plugin-security/src/bootstrap-platform-admin.ts:401(isHumanUser, also used at :426 and :472)objectstack#11767 consolidated the first two onto one owner,
isHumanUserRowinplugin-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-securitydoes not depend onplugin-auth, so sharing across them needs the predicate to move to a package both depend on (@objectstack/specor@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 adminand 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 legacyusr_systemservice 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/systemsits besideSystemUserIditself) and have all three read it. Note this touchespackages/specexports and so needsgen:api-surface.Related