Skip to content

Commit 3eea8f0

Browse files
committed
docs(metadata-protocol): the endpoints' known limit names one saved env-wide container copy, and shipped withdrawals too
The narrowed "Known limit: packages and names" wording stated the anonymous endpoints' exception as two packages each saving an env-wide copy of one view container. One saved copy is enough: where a package's env-wide copy of a view container is saved, the endpoints read that copy's expansion alone for each form it expands, and can miss another package's withdrawal of that form, whether saved or shipped. The organization-scoped save check still judges every package's env-wide definition of the name, and a withdrawal of a view name still closes that name in every package, so it may over-close. Corrected in the public data collection docs page, this card's save-check changeset and the anonymousFormIntakeWithdrawnIn docblock. Reading each package's expansion separately is tracked in #21967. No code change. Claude-Session: https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi Co-authored-by: Claude <noreply@anthropic.com>
1 parent 7c30229 commit 3eea8f0

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

‎.changeset/21934-save-check-anchor-per-package.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
The organization-scoped save check judges a view overlay against every package's environment-wide definition of its row
66

77
- An organization-scoped `view` save or publish in the organization the anonymous form endpoints read is refused when it would leave open a form the environment-wide definition withdraws. Its row anchor is now resolved per package, the way the list read resolves each package's item: each package's own environment-wide row, else the package-less environment-wide row (which stands in for every package), else that package's artifact. Before, with no environment-wide row stored, it judged only the first package's artifact in registry order, and a stored row of any one package hid every package's artifact of the name.
8-
- The known limit stated with the public-form withdrawal ("it may over-close, never under-close") is narrowed. A withdrawal of a view name still closes that name in every package, so it may over-close. Both checks read every package's environment-wide definition of the name, except at the anonymous endpoints when two packages each have an environment-wide copy of the same view container saved: there the endpoints read one package's copy of each form those containers expand, and can miss the other package's withdrawal of that form until it is withdrawn in each package's copy. The organization-scoped save check still judges both copies.
8+
- The known limit stated with the public-form withdrawal ("it may over-close, never under-close") is narrowed. A withdrawal of a view name still closes that name in every package, so it may over-close. The organization-scoped save check judges every package's environment-wide definition of the name. The anonymous endpoints do too, with one exception: where a package's environment-wide copy of a view container is saved, the endpoints read that copy's expansion alone for each form it expands, and can miss another package's withdrawal of that form, whether saved or shipped, until the form is withdrawn in every saved environment-wide copy of that container as well. Reading each package's expansion separately is tracked in #21967.

‎content/docs/ui/public-data-collection.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ A withdrawal is a kill switch across metadata layers. If the environment-wide de
6868

6969
**Forms a package ships.** A package's form is part of the environment-wide definition, not a separate layer beneath it. A definition parsed by the stack schema (strict `defineStack`, the default) gets the schema's default `enabled: false`, so a shipped form that keeps its link without setting `enabled: true` counts as withdrawn and an organization's copy cannot open it. A definition loaded without that parse (`defineStack(..., { strict: false })` or a hand-built manifest) is judged as written: a switch it leaves out is absent, which is not a withdrawal, so set `enabled: false` explicitly to ship a form closed. The environment-wide definition is the administrator's switch: an environment-wide save may open a form that the package ships closed.
7070

71-
**Known limit: packages and names.** A withdrawal of a view name closes that name in every package. When two packages each ship a view of the same name, one package's withdrawal also closes the other package's form of that name, so this may close more than was meant. Both checks read every package's environment-wide definition of the name, with one exception at the endpoints: when two packages each have an environment-wide copy of the same view container saved, the endpoints read only one package's copy of each form those containers expand, so they can miss the other package's withdrawal of that form. The organization-scoped save check still judges both copies. To close such a form at the endpoints, withdraw it in each package's environment-wide copy.
71+
**Known limit: packages and names.** A withdrawal of a view name closes that name in every package. When two packages each ship a view of the same name, one package's withdrawal also closes the other package's form of that name, so this may close more than was meant. The organization-scoped save check judges every package's environment-wide definition of the name. The endpoints do too, with one exception: where a package's environment-wide copy of a view container is saved, the endpoints read that copy's expansion alone for each form it expands, and can miss another package's withdrawal of that form, whether saved or shipped. To close such a form at the endpoints, withdraw it in every saved environment-wide copy of that container as well. Reading each package's expansion separately is tracked in #21967.
7272

7373
**Known limit.** The save check runs only when an organization's copy is saved or published. A copy that was already stored before the environment-wide withdrawal, or that a rollback or revert restores, is judged only by the endpoints, which match by served item name. If that copy keeps the form open under a different key or place than the environment-wide definition, the endpoints can still serve it. To close it, withdraw the form in that organization's copy too; the next organization-scoped save of a copy that keeps it open is refused.
7474

‎packages/metadata-core/src/anonymous-form-intake.ts‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,14 @@ function anonymousFormExplicitWithdrawals(view: unknown): Array<{ slot: string;
324324
* limit that fails closed: it may over-close another package's form of the
325325
* same name). It judges only the bodies the layer holds, so a caller closes a
326326
* name in every package only when its layer holds every package's body of the
327-
* name: the organization-scoped write door anchors one body per package, and
328-
* the env-wide view list the anonymous doors read holds one item per package
329-
* of a name, except that it holds one package's expansion of each name that
330-
* stored view containers of several packages expand. A layer with no body of
331-
* the row, or whose body has no explicit withdrawal, withdraws nothing, so a
332-
* form published only in an organization stays open there.
327+
* name. The organization-scoped write door anchors one body per package. The
328+
* env-wide view list the anonymous doors read holds one item per package of a
329+
* name, with one exception: where a package's env-wide copy of a view
330+
* container is saved, the list holds that copy's expansion alone for each form
331+
* it expands, so the doors can miss another package's withdrawal of that
332+
* form, whether saved or shipped (per-package expansion is #21967). A layer
333+
* with no body of the row, or whose body has no explicit withdrawal, withdraws
334+
* nothing, so a form published only in an organization stays open there.
333335
*/
334336
export function anonymousFormIntakeWithdrawnIn(
335337
layer: ReadonlyArray<unknown>,

0 commit comments

Comments
 (0)