Skip to content

[finding] find-envelope-limb-removal.test.ts drives a read on sys_user_permission_set against an engine that never registered it — the last refused read left in plugin-auth after #14846 #16315

Description

@os-warren

Filed by the domain:services PM seat while verifying PR #16305 (card #14846). Recording only — unassigned, ungraded, and deliberately not fixed in that PR's fence.

Measured, not inferred

Full package run at PR #16305's own head 519a76915:

pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2
  → Test Files  102 passed (102) / Tests  2158 passed (2158), exit 0
  → [sql-driver] DATABASE_ERROR lines: 1

Exactly one refused read survives, and it is not in the file #14846 repaired:

[sql-driver] DATABASE_ERROR — the backend refused a read on 'sys_user_permission_set' (SQLITE_ERROR).
  … select * from `sys_user_permission_set`
      where `user_id` = 'upuTZFizHQUFCJOLEWdoCrYoaFLoLjfv'
        and `permission_set_id` = 'ps_member_default' limit 1
      - no such table: sys_user_permission_set

The stack ends at packages/plugins/plugin-auth/src/find-envelope-limb-removal.test.ts:343. Immediately above the failure the run logs [Registry] Registered object: sys_permission_set (own, priority=100) from @objectstack/plugin-security — so the set half is registered and the junction half is not, and the same run also emits the driver's Paged read of 'sys_user_permission_set' is NOT deterministic … declare the object so this driver manages its table line for the same table.

Why it is the same class, and why it is a different card

Same shape as #14846: a harness whose registered object set is narrower than the code path it drives, kept invisible because the driver logs the refusal instead of throwing, and the resolver reads the refusal as "this principal holds no permission sets". The suite reports 102 passed on top of it and no assertion can notice.

Not covered by the two cards that look adjacent:

Shape of a fix, not prescribed

The precedent is already in the sibling file: hand-declare the junction locally with only the columns the resolver reads, exactly as sso-register-platform-admin-gate.test.ts declares sysUserPermissionSet (id, user_id, permission_set_id, organization_id), so a fixture adds no dependency edge from plugin-auth to plugin-security. One registerObject line in the harness's engine boot.

Not this card: deciding that the resolver's absent-table read is a benign discriminated case and no longer logging it. That is the fenced arm of #14615 and was kept out of #14846's PR on triage's instruction for the same reason.

⚠️ Confidence gap — what was NOT measured

Refs: #14846 (the position pair, PR #16305) · #14756 / PR #14844 (the OAuth manifest sweep) · #14615 (the fenced logging arm)

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions