docs(spec): publicSharing.enabled is a standing policy held at redemption; resolveToken names the switched-off block among its null causes - #16196
Conversation
…tion; resolveToken names the switched-off block
The TSDoc above `publicSharing.enabled` described only the mint half
("no share links can be issued"). The switch is a standing policy
re-read on every redemption, so with it off no existing link resolves
either — links minted while it was on, and links minted through the
system-context / `permissive` mint bypass alike. The comment now states
that, in the shape the sibling `eligibility` predicate's prose uses.
`IShareLinkService.resolveToken`'s `null`-cause list gains the
switched-off block in the position the gates run; the contract's
design notes gain a matching entry beside the eligibility one, and the
`isSystem` mint bypass is marked mint-only.
Documentation only: no schema, shape or behaviour change; the
`.describe()` string feeding the generated reference is untouched.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T6HeZvT9wdSJD1ZxJb5Eno
…ers, as measured on the built package The contract file's new lines all survive into dist/contracts/index.d.ts; the object.zod.ts property comment reaches no .d.ts and ships through the directly published source file and the data sourcemap. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T6HeZvT9wdSJD1ZxJb5Eno
📓 Docs Drift CheckThis PR changes 1 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 130 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin bcb23e32750d5a58da998286ae0a0cc7918b1c71 && git checkout bcb23e32750d5a58da998286ae0a0cc7918b1c71
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 9f3989771062ef660133b3432a32e03e0cd07f5a a1e1610acab2d7a85e31db64d26c95eec4fa95b3 && git checkout -B drift-repro 9f3989771062ef660133b3432a32e03e0cd07f5a && git merge --no-ff a1e1610acab2d7a85e31db64d26c95eec4fa95b3
node scripts/docs-audit/affected-docs.mjs --json 9f3989771062ef660133b3432a32e03e0cd07f5a
|
Fixes #14703
What changed
TSDoc only — two sites, one fact:
publicSharing.enabledis a standing policy held at every redemption, not a mint-time switch (the #14033 ruling, landed by PR #14580). No schema, shape or behaviour change; the.describe()string onpublicSharing.enabledis untouched, and no generated tree moved (content/docs/references,json-schema,authorable-surface,api-surface: 0 files in the diff).packages/spec/src/data/object.zod.ts— the comment abovepublicSharing.enabledread "no share links can be issued for this object". True, but the mint half only. It now states the redemption half too: with the switch off no link on the object resolves — links minted while it was on, and links minted through the system-context /permissivemint bypass alike; re-enabling the block serves them again, no row moves; off means nothing inside the block is evaluated. Written in the shape the siblingeligibilitypredicate's prose (sharing:publicSharing.eligibilityis evaluated only at mint — a link keeps serving a record after it stops being eligible #13608) already uses.packages/spec/src/contracts/share-link-service.ts— three hunks:IShareLinkService.resolveToken'snull-cause list gains the switched-off block, inserted where the gate runs in the implementation (after the audience/password gates, before the record probe 记录删除后sys_share_link能力令牌仍然有效 —— 与 #5103 同族,但因为是无身份令牌所以更糟 #5190 and the eligibility predicate sharing:publicSharing.eligibilityis evaluated only at mint — a link keeps serving a record after it stops being eligible #13608); the existence-oracle sentence names "switched off" beside the other indistinguishable reasons.publicSharing.eligibilityis evaluated only at mint — a link keeps serving a record after it stops being eligible #13608 model): same shape, same "the refusal is the same undifferentiatednull" ending.isSystembypass sentence on the interface is marked mint-only, because the card's third point (bypass-minted links are governed at redemption) contradicts an unqualified "bypass"..changeset/public-sharing-enabled-standing-policy-tsdoc.md—@objectstack/specpatch, "documentation only", following the shape of the docs-only spec changeset that landed atd5d8d50db. It states where the text reaches consumers, measured on the built package: every new line of the contract file ships indist/contracts/index.d.ts(14033×3,design note 7×2,STANDING policy too×1 in both.d.tsand.d.mts); theobject.zod.tsproperty comment reaches no.d.ts(inferred type) and ships through the directly publishedsrc/**/*.zod.tsfile anddist/data/index.js.map.Route chosen (dispatch zone 3)
Restate in the
resolveTokenlist as one clause (the enumeration entry, exactly as #5190 and #13608 have one), carry the mechanism in design note 7 beside note 6, and have theobject.zod.tscomment point atIShareLinkService.resolveTokenfor thenull. Reason: note 6 already set this convention for #13608 — header note carries the mechanism, the list carries one clause — and a pointer-only entry would be the odd one out in the list. Two statements of the fact remain (schema side, contract side), cross-linked, each in its file's existing convention.Premise re-check against
origin/mainatd5d8d50dbgit show origin/main:packages/spec/src/data/object.zod.ts— the line drifted from:2237to:2279; the READ is unchanged:/** Master switch. When false (default), no share links can be issued for this object. */.git grep -n "13608\|14033" origin/main -- packages/spec/src/contracts/share-link-service.ts—:41and:236, both sharing:publicSharing.eligibilityis evaluated only at mint — a link keeps serving a record after it stops being eligible #13608; no [Decision] What does turningpublicSharing.enabledoff mean for an ALREADY-MINTED share link? — the parent switch is mint-only while its own child predicate is now a standing policy #14033 line. Both sites still stale — premise holds.packages/plugins/plugin-sharing/src/share-link-service.tsresolveTokenreadspolicy.enabledafter the cheap gates and before the record probe and returnsnullwith theSHARING_NOT_ENABLEDlog line; thepermissiveoption's own doc says "Mint ONLY"; the[#14033]pins inshare-link-service.test.tsandshare-link-eligibility.test.tsare onmain. Documented what is measured, not what the card asserts.Verification (final head
a1e1610ac; source commit0b9aac129, the second commit touches the changeset only)ts.transpileModulewithremoveComments: trueon BASE vs HEAD of both files — emit byte-identical (object.zod.ts76755 = 76755 chars;share-link-service.ts48 = 48 chars). No runtime or type reaches any consumer differently.pnpm --filter @objectstack/spec build—VERDICT command-exit 0;git statusclean afterwards (no generated artifact moved).pnpm --filter @objectstack/spec typecheck—VERDICT command-exit 0(tsc --noEmit,check:scripts-typecheck,check:test-typecheckOK).pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2—Test Files 482 passed (482) · Tests 13089 passed (13089),VERDICT command-exit 0.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands(69 families): all 69 run ata1e1610ac, 68 green, 1 NOT-MEASURED (pnpm check:dual-build-cjs-loads, prerequisite unmet — below), 0 UNRUN;dispatch-gates.mjs --ranreconciliation ✓ (69 derived famil(ies) accounted for — 68 run, 1 NOT-MEASURED). The 17@objectstack/specgates includecheck:docs,check:authorable-surfaceandcheck:api-surfacegreen after the rebuild — the mechanical proof that the.describe()string and the generated reference did not move.check:doc-formula-expressionsrefused on first run (formula/lint unbuilt); afterturbo run build --filter=@objectstack/formula --filter=@objectstack/lintit measured green.turbo ls --affectedlists 75 packages (spec and every dependent). Ran spec's own typecheck and test; the other 74 are declared to CI on the comment-only proof above — their emitted JS and their types are unchanged byte-for-byte, so only text-scanning gates can move, and those are in the union.pnpm check:dual-build-cjs-loadsis NOT MEASURED locally: it refuses (exit 3,PREREQUISITE NOT MET) until all 86 unbuilt packages have adist/, i.e. a whole-repopnpm build, which is CI's run.Out of scope, noted for the PM
publicSharing(same file, ~30 lines up) still describes the mint half only ("refuses to create share-link rows"). It is true as written and the correctedenabledcomment sits inside that block, so it was left alone under the two-site ruling; not filed as an issue.sharing.zod.tsdocblock sentences go false when #15072 lands — thefieldrecipient stops being "not yet authorable" #15239 (sharing.zod.tsdocblocks) is a different file and was not touched.Generated by Claude Code