Skip to content

Commit ee4a59b

Browse files
claude[bot]claude
andauthored
docs(spec): the block-level publicSharing TSDoc states the standing policy, not just the mint half (#16964)
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. Claude-Session: https://claude.ai/code/session_016N6xmWt5hYm94ffVEwGH8x Co-authored-by: Claude <noreply@anthropic.com>
1 parent efd6b43 commit ee4a59b

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@objectstack/spec": patch
3+
---
4+
5+
The block-level `publicSharing` TSDoc now states the standing policy, not just the mint half.
6+
7+
`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.
8+
9+
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.
10+
11+
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.

packages/spec/src/data/object.zod.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2231,8 +2231,13 @@ const ObjectSchemaBase = strictObject(
22312231
* Opt-in declaration that records of this object MAY be published via
22322232
* an opaque capability token (Notion / Google Docs / Figma "anyone with
22332233
* the link" style). When omitted or `enabled:false`, the platform
2234-
* refuses to create share-link rows for this object — independent of
2235-
* any permission the caller holds.
2234+
* refuses to create share-link rows for this object AND refuses to
2235+
* resolve any that already exist — a STANDING policy held at every
2236+
* redemption, not a mint-time check (#14033), so links minted while the
2237+
* block was on stop serving the moment it is turned off, those minted
2238+
* through the system-context / `permissive` mint bypass included. Both
2239+
* halves are independent of any permission the caller holds; see
2240+
* `enabled` below for the whole statement.
22362241
*
22372242
* Distinct from {@link sharingModel}, which governs *principal-based*
22382243
* sharing (share with specific users / teams / roles). A single object

0 commit comments

Comments
 (0)