Skip to content

invitation-scope-gates: cancel-invitation writes status:'canceled', a value absent from the spec InvitationStatus enum (spec-vs-platform-object divergence) #7726

Description

@huangyiirene

Symptom

cancel-invitation writes status: 'canceled' onto the sys_invitation row. But the spec enum this item's source names as the authority does not include canceled:

  • Spec (authority named by the item): InvitationStatus = z.enum(['pending', 'accepted', 'rejected', 'expired'])packages/spec/src/identity/organization.zod.ts:105. Four values, no canceled.
  • Platform object (what actually gets written): a divergent 5-value select including canceledpackages/platform-objects/src/identity/sys-invitation.object.ts:214: status: Field.select(['pending', 'accepted', 'rejected', 'expired', 'canceled'], …).

Consequence: anything validating an invitation against InvitationSchema (which composes InvitationStatus) rejects a canceled row. Both refs confirmed present on origin/main.

Root cause

A spec-vs-platform-object contract divergence: the two definitions of the invitation status vocabulary disagree by one value. The platform object treats canceled as a legitimate terminal state (it is even used in a listView filter, sys-invitation.object.ts:158 filters status in ['expired','rejected','canceled']), while the spec enum omits it.

Decision needed (routing / authority)

This needs a maintainer ruling on which side is authoritative, then reconcile the other:

  • If the spec enum is the contract of record → add canceled to InvitationStatus (organization.zod.ts:105). This is the likely direction, hence domain:spec.
  • If the spec deliberately excludes canceled → the platform object and the cancel-invitation writer must stop producing it (use rejected/expired semantics, or drop the value).

Filed under domain:spec (the enum) with a note to reconcile the platform object; flag the decision rather than assume the fix side.

Reproduction

  1. Create an invitation (status:'pending').
  2. cancel-invitation on it.
  3. Read the row → status:'canceled'.
  4. Validate that row against InvitationSchema / InvitationStatus → rejected, because canceled is not in the spec enum.

Source

Extracted from the QA run #7663 (framework 92f26f7, console 09987b680).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions