Skip to content

spec/plugin-sharing: retire the ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED provenance waiver together with its stamp site, once the objectql recognizer lands #16160

Description

@claude

Filed by the domain:engine execution seat while building #16156. ⛔ Not claimed, no assignee — this is bookkeeping that becomes actionable only after that PR merges, and it spans two lanes.

What is owed, in the waiver's own words

PROVENANCE_WAIVERS in packages/spec/src/api/error-code-ledger.zod.ts carries an entry for @objectstack/plugin-sharing / ERR_SYSTEM_WRITE_ORGANIZATION_REQUIRED (registered under @objectstack/objectql, adjudicated on #14937, maintainer ruling A, 2026-09-04). Its reason ends:

Removed together with the stamp site when #14936 lands and objectql publishes a recognizer.

#16156 is that recognizer. It publishes SYSTEM_WRITE_ORGANIZATION_REQUIRED_CODE and isSystemWriteOrganizationRequiredError from @objectstack/objectql, so plugin-sharing no longer needs its own spelling of the literal — but that PR deliberately did not perform the removal, because it spans packages/spec and packages/plugins/plugin-sharing, both outside its landing surface.

Why it cannot be split, and must be one PR

check:error-code-provenance reconciles a waiver in three directions at once (its header states them): the registeredUnder key must still list the code, the waived package must still NOT list it, and the scan must still find a site for the pair. So the two halves redden the gate independently:

  • remove the plugin-sharing stamp site alone ⇒ the waiver's site is gone ⇒ the gate fails on the stale waiver;
  • remove the waiver alone ⇒ the stamp site has no row and no waiver ⇒ the gate fails on the site.

⇒ Both edits in one PR, or neither.

The work

  1. In packages/plugins/plugin-sharing/src/sharing-rule-service.ts: replace the local ENGINE_ORGANIZATION_REFUSAL_CODE constant (:137, typed as SystemWriteOrganizationRequiredError['code']) and the err?.code !== … comparison at :1683 with the published import — either the constant or isSystemWriteOrganizationRequiredError. Note :1691 re-emits the code in its own refusal envelope; that site is a separate judgement, not automatically the same edit.
  2. In packages/spec/src/api/error-code-ledger.zod.ts: delete the corresponding PROVENANCE_WAIVERS entry.
  3. Re-run pnpm --filter @objectstack/spec run check:error-code-provenance⚠️ it is not derived by scripts/pm/dispatch-gates.mjs ([finding] dispatch-gates --commands does not derive check:optional-error-sink for a diff that adds a new logger-sink interface #14880); the derivation places it in the "artifact rosters" block, whose silence is a fact about a list and never a clearance. Run it explicitly, and confirm the site count drops by one and the waiver count by one.

Blocked-by: #16156 (nothing here is safe to do while that PR is open — the waiver is still live and correct until it merges).

⚠️ Lane note for triage: packages/spec is single-owner, so this likely wants that lane rather than domain:engine, even though the trigger sits in the engine's package.

Refs: #14936 · #14935 · #14937 · #16156 · #14930 · #14880


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

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions