From 7be4c2b3b26cda831490a9dd43c98257c87d2a3e Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 8 Sep 2026 20:12:23 +0000 Subject: [PATCH] docs(spec): the block-level publicSharing TSDoc states the standing policy, not just the mint half MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The block comment above `ObjectSchema.publicSharing` said that with the block omitted or `enabled:false` "the platform refuses to create share-link rows for this object — independent of any permission the caller holds". Literally true, and the mint half only. `publicSharing.enabled` is a STANDING policy held again at every redemption: `resolveToken` re-reads the object's CURRENT block before it probes the record or stamps the counters, so a block that is off refuses every token on it — those minted while it was on, and those minted through the system-context / `permissive` mint bypass alike. The `permissive` option is documented and implemented as MINT-only; the redemption gate takes no bypass. That correction already reached the `enabled` property comment thirty lines below, `IShareLinkService.resolveToken`'s `null`-cause list and design note 7 of `contracts/share-link-service.ts`. This carrier was left behind, so the same file stated one fact two ways with nothing telling a reader which was current, and the block doc is the more likely landing site of the two: it is what a reader scanning the object schema for the sharing policy meets first, and it carries the `@see` pointers that make it read as the block's orientation text. The sentence now names both halves and points at `enabled` for the full statement rather than restating the mechanism a third time. Comment text only: no schema arm, bound, default, `.describe()` string or runtime behaviour moves, and no generated artefact changes. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_016N6xmWt5hYm94ffVEwGH8x --- .../public-sharing-block-doc-standing-policy.md | 11 +++++++++++ packages/spec/src/data/object.zod.ts | 9 +++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 .changeset/public-sharing-block-doc-standing-policy.md diff --git a/.changeset/public-sharing-block-doc-standing-policy.md b/.changeset/public-sharing-block-doc-standing-policy.md new file mode 100644 index 0000000000..92210a5aa8 --- /dev/null +++ b/.changeset/public-sharing-block-doc-standing-policy.md @@ -0,0 +1,11 @@ +--- +"@objectstack/spec": patch +--- + +The block-level `publicSharing` TSDoc now states the standing policy, not just the mint half. + +`ObjectSchema.publicSharing`'s block comment said that with the block omitted or `enabled:false` "the platform refuses to create share-link rows for this object — independent of any permission the caller holds". Literally true, and the mint half only. Since #14033 the switch is a **standing policy held again at every redemption**: `resolveToken` re-reads the object's current block, so a block that is off refuses every token on it — those minted while it was on, and those minted through the system-context / `permissive` mint bypass alike. + +That correction already landed on the `enabled` property comment thirty lines below, on `IShareLinkService.resolveToken`'s `null`-cause list and in design note 7 of `contracts/share-link-service.ts`. The block-level sentence was left behind, so the same file stated one fact two ways with no signal telling a reader which was current — and the block doc is the more likely landing site of the two, since it is what a reader scanning the object schema for the sharing policy meets first and it carries the `@see` pointers that make it read as the block's orientation text. + +The sentence now names both halves and points at `enabled` for the full statement rather than restating the mechanism a third time. Comment text only: no schema arm, bound, default, `.describe()` string or runtime behaviour moves, and no generated artefact changes. The text ships because `packages/spec` publishes both `src/**/*.zod.ts` and unminified bundles that carry source comments verbatim. diff --git a/packages/spec/src/data/object.zod.ts b/packages/spec/src/data/object.zod.ts index c3acdefb4b..5323c6664f 100644 --- a/packages/spec/src/data/object.zod.ts +++ b/packages/spec/src/data/object.zod.ts @@ -2231,8 +2231,13 @@ const ObjectSchemaBase = strictObject( * Opt-in declaration that records of this object MAY be published via * an opaque capability token (Notion / Google Docs / Figma "anyone with * the link" style). When omitted or `enabled:false`, the platform - * refuses to create share-link rows for this object — independent of - * any permission the caller holds. + * refuses to create share-link rows for this object AND refuses to + * resolve any that already exist — a STANDING policy held at every + * redemption, not a mint-time check (#14033), so links minted while the + * block was on stop serving the moment it is turned off, those minted + * through the system-context / `permissive` mint bypass included. Both + * halves are independent of any permission the caller holds; see + * `enabled` below for the whole statement. * * Distinct from {@link sharingModel}, which governs *principal-based* * sharing (share with specific users / teams / roles). A single object