Skip to content

plugin-auth sso-register harness never registers sys_position / sys_user_position, so the platform-admin standing resolver logs 8 DATABASE_ERROR lines on every green run #14846

Description

@claude

Found while converting the five plugin-auth harnesses in #14756 to import
authIdentityObjects from the plugin manifest. Filed unassigned, not fixed
there: the objects involved are not in authIdentityObjects, so the manifest
import cannot reach them, and picking a fix crosses a package ownership line
that card does not own.

What is measured

packages/plugins/plugin-auth/src/sso-register-platform-admin-gate.test.ts
boots an in-memory engine in bootEngine() and registers the auth identity
objects plus two hand-declared fixtures, sys_permission_set and
sys_user_permission_set. It never registers sys_position or
sys_user_position.

The platform-admin standing resolver the suite drives reads both:
packages/core/src/security/admin-standing-surface.ts declares
sys_user_position and the position lookup beside it. Those objects are owned
by plugin-security (packages/plugins/plugin-security/src/objects/sys-position.object.ts
and its SysUserPosition sibling), not by plugin-auth.

So every green run of that suite emits driver errors for tables that do not
exist. Tallied on main at 2d40f9146, one vitest run of that single file:

table refused-read lines per run
sys_position 4
sys_user_position 4

Each is a [sql-driver] DATABASE_ERROR ... no such table line. The suite still
reports Tests 4 passed (4) — the resolver treats the failed read as "no
positions" and the assertions never notice.

This is unchanged by the #14756 conversion (verified: 4 and 4 both before and
after), because neither object is in the auth identity manifest.

Why it matters

It is the same shape #14756 exists to remove: a harness whose registered object
set is narrower than the code path it drives, kept invisible because the errors
are logged rather than thrown and the run is green. A future change that makes
platform-admin standing actually depend on a position row would be tested
against an engine that can never return one, and the suite would keep passing.

Possible directions, not a recommendation

Which of those is right is a judgement about ownership and about the resolver's
contract, so this is filed for triage rather than fixed.

Generated by Claude Code


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions