Skip to content

feat(spec)!: form is a metadata type of its own, and the form doors read a form over both types - #37422

Draft
objectstack-fleet[bot] wants to merge 31 commits into
claude/project-thread-pu5dntfrom
claude/project-thread-pu5dnt-b
Draft

objectstack-fleet[bot] wants to merge 31 commits into
claude/project-thread-pu5dntfrom
claude/project-thread-pu5dnt-b

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Alice · project thread

Fixes #37086 — PR B of the card's fixed 3,000-line cut, stacked on #37366 (the rename only). Merge #37366 first, then retarget this onto main. The two land together, because ADR-0159:109 anchors view.zod.ts#defineForm, and only this PR declares it again.

Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #37105

维护者速读

  • 用户能看到什么变化:开发者可以把公开表单单独定义成一种"表单"元数据;写在视图里的旧表单照常工作,公开表单的地址和回答都不变。
  • 为什么做:"表单成为独立元数据类型"系列的第二步,给后面 Setup 里的表单开关和表单设计器打基础。
  • 出错会怎样:碰到的是保存、发布或恢复被拒(公开地址已被另一个表单占用,或在只读包的表单名下放没有归属的列表),或公开表单打不开;已存数据不会被改写,可以整体撤回。
  • 要你做什么:无。

What changes

form becomes a metadata type of its own (ADR-0159 card ②, items 1, 2 and 4 to 10, as the card rules them):

  • spec
    • FormSchema derives every body key from FormViewSchema by reference. The name is OBJECT.KEY. data, viewKind, config, isDefault, order and scope are refused by name.
    • Also new: defineForm, the registry row (*.form.ts|yml|json), the stack's forms: and the forms translation family. The family reads forms.NAME first, with the _views title and thank-you tails as the fallback. A form's own section copy is forms.NAME.sections.SECTION.{label,description} and .fields.FIELD.{label,placeholder,helpText} (D8). Each key the form's node lacks reads objects.OBJECT._sections.SECTION, the object-level default.
    • One projection, projectViewForms, reads the three old view shapes. The intake layer is formIntakeLayer / openFormAt.
    • New error code FORM_ADDRESS_TAKEN, a liveness ledger form.json, and a semantic migration entry 18.form-type-define-form-and-packageless-list-at-form-name.
  • metadata-protocol
    • The effective form read resolves over both types in the served-row order (D5). Each address holds one definition. A package-less stored form row over a base that ships the form as an old shape is listed once, at the base's address, with the row's body.
    • A form left open on a held address is refused with 409 FORM_ADDRESS_TAKEN. The refusal applies on the save, on the publish of a draft whose address was taken after the draft was saved, and on a rollback to a version that is open on a held address.
    • A form save, publish, reset or delete removes the package's old-shape row of that name in the same transaction. This touches form content only: a list of that name stays byte-equal.
    • A package-less list at a name that a read-only package authors as a form is refused with 400. The refusal applies on the save, on the publish of a pre-gate draft and on restore.
    • After an old-shape removal, one registry heal (healOldShapeFormRowRemovals) restores the view registry for each removed row.
    • An unreadable stored body closes the links it names. It is reported once per process at error, the first time the form doors read it. There is no boot hook: a project kernel must not read sys_metadata view rows at boot.
    • getPackagedFormBase answers a form's packaged base: the authored form item, or else the form the base's view item projects.
  • rest
    • GET /forms/:slug and its submit read their candidates from ONE effective form read. They judge withdrawal across form and view, both effective and per-package (D6 rules 1 to 11). This narrows only.
    • The door keeps no second candidate source: a protocol that serves no form item serves no candidate.
    • GET /api/v1/meta/form/NAME refuses whoever /meta/view/NAME refuses, on the cached plain read as well as on the uncached read.
    • A form override's own changed text outranks the base's catalog, on /meta/form and on the public door (the form row of PACKAGED_BASE_ACCESSORS).
  • lint
    • New rules: form-public-address-taken (gating), form-consumer-less (advisory), form-object-outside-closure and form-object-unknown.
  • metadata, metadata-core, objectql, runtime, cli
    • forms is loaded, typed, registered and counted for i18n coverage.

Why

ADR-0159 card ②. The breaking surface is written out in .changeset/37086-form-metadata-type.md.

Measure-first answer (D7-b)

  • Over a base that authors a form item: a declared view list override at the form's name is refused with 403 NOT_OVERRIDABLE.
  • Over an old-shape base: the same override is admitted, and it closes the address.

Both cases are pinned in packages/rest/src/public-form-two-type-withdrawal.test.ts ("measure-first").

Rule 9: the premise is stale

D6 rule 9 asks that an organization-scoped form save be judged as the same view save is. On this tree, every organization-scoped write is refused before any other gate reads the body. packages/metadata-protocol/src/protocol-save.ts, saveMetaItemUnaudited:

[ADR-0131 D6] FIRST, before every other gate and every read: an organization-scoped write is refused for every type, draft or publish.

It calls refuseOrganizationScopedWrite. protocol-write-gates.ts#organizationScopedWriteRefusal returns null only for an empty organization; otherwise it returns 403 NOT_OVERRIDABLE. So no organization layer exists to hold a withdrawal, in either type. The pin "rule 9" holds the form save and the view save to the same answer: 403 NOT_OVERRIDABLE, nothing written, the doors still closed. protocol.org-scoped-write-refused.test.ts already enumerates DEFAULT_METADATA_TYPE_REGISTRY, so it covers form.

Door pins and ablations

The pins are in packages/rest/src/public-form-two-type-withdrawal.test.ts. The harness is a real ObjectQL engine with SqlDriver on :memory:, the real protocol and the real routes. Each door pin drives both doors: GET /forms/:slug and its submit.

First round (the head this PR opened at):

Ablation Removes Pins that go red
A1 view half of the layer 3, 5v, narrowing
A2 form half of the layer none (pin 2b, below, closes this)
A3 projection step 3, 5v, narrowing
A4 whole-item name match (replaced by slug equality) 4
A5f per-package form layer none
A5v per-package view layer 5v
A6 rule 7 (an unreadable body closes its links) 6
A7 cross-type resolution (D5) 7, 7 twin
A8 A1 + A7 3, 5v, 7, 7 twin, narrowing

Pin 1 stays green under A1 and A8, and pin 2 under A2: D5's cross-type resolution, or the candidate itself, already holds the withdrawal. That is why the second round adds pin 2b, where the form half is the only reader.

Second round (this rework). Each run follows the same steps:

  1. Mutate the source on disk.
  2. Rebuild the package's dist that the harness reads.
  3. Run the whole harness file and record the red pins.
  4. Restore with git checkout and rebuild.
  5. Read git diff HEAD --stat (empty after every run).

No ablation was committed. No pin was weakened to get these readings.

Run Removes Pins that go red
R1 the form half of the layer (formIntakeLayer's loop over the forms) pin 2b, pin 2b twin, pin 5f
R2 served rows only: every stored view row projected served rows only (F1), pins 4 and 5v
R3 the served row taken from the effective view list, not the served-row order served rows only at the address (F2), both closed readings, pin 7
R4 the closed reading (a stored list falls through to the package's source form) both closed readings (list and container)
R5 the bound (the package-less list refusal) both bound pins, and the three refusal pins
R6 the expansion half of the bound the container refusal, the bound pin
R7 the form-content test of the old-shape row removal the list stays untouched; byte-equal across save, publish and reset; byte-equal across delete
R8 the projection half of the override gate's "ships" read the declared_package_ships_no_such_item pin (its CONTROL is refused), pin 2, narrowing, and the five pins that write a form override over an old-shape base
R9 projected items parsed as form items (data stripped, refused ones dropped) the data.object door pin, the /meta/form route pin
R10 the publish refusal the publish clash pin, the pre-gate list draft pin
R11 the restore refusal the restore pin
R12 the form row of PACKAGED_BASE_ACCESSORS the override's own text pin
R13 one definition per address (the package-less form row deferral) the one-definition pin
R14 form in the cached plain read's audience fold the /meta/form route pin
R15 forms.NAME.sections in translateForm (spec source; spec tests read the source, so there was no rebuild) i18n-resolver.form-item.test.ts "reads the form's own section node first"

The per-run proof (the mutation diff, the build exits, the red titles and the empty git diff HEAD) is below. In the diffs, angle brackets are written as ‹ › so the body's sanitizer keeps them.

R1, form-half: 3 of 48 red
  • The mutation, on disk in packages/spec/src/ui/form-intake-layer.ts (diff below). Rebuilt: the spec dist, exit 0.
  • The harness: 45 passed, 3 failed. Red:
    • pin 5 — a per-package-layer withdrawal in form closes the form (ablate: getMetaItemsPerPackage for that type)
    • pin 2b — the form half alone: the base authors the form switched off with its link kept, and a dependent's old-shape row of the name stands open on that link (ablate: the form half of the layer)
    • pin 2b, twin — a package-less old-shape row open over the base's switched-off form item: the base's own document still withdraws it
  • Restored with git checkout and rebuilt (exit 0). git diff HEAD --stat after: (empty).
diff --git a/packages/spec/src/ui/form-intake-layer.ts b/packages/spec/src/ui/form-intake-layer.ts
index b9e1c00bb..c834dfd4e 100644
--- a/packages/spec/src/ui/form-intake-layer.ts
+++ b/packages/spec/src/ui/form-intake-layer.ts
@@ -63,7 +63,7 @@ export function formIntakeLayer(input: {
 }): FormIntakeLayer {
   const withdrawn = new Map‹string, FormWithdrawal›();
   const closedLinks = new Map‹string, UnreadableFormBody›();
-  for (const form of input.forms) {
+  for (const form of [] as ReadonlyArray‹unknown›) {
     const name = nameOf(form);
     const slug = formExplicitlyWithdraws(form);
     if (name !== undefined && slug !== undefined && !withdrawn.has(name)) withdrawn.set(name, { name, slug });
R2, every-stored-view-row: 3 of 48 red
  • The mutation, on disk in packages/metadata-protocol/src/protocol-form-reads.ts (diff below). Rebuilt: the metadata-protocol dist, exit 0.
  • The harness: 45 passed, 3 failed. Red:
    • pin 4 — withdrawn in a body of the same name whose link names another slug: closed at the open definition's address (ablate: the whole-item match)
    • pin 5 — a per-package-layer withdrawal in view closes the form (ablate: getMetaItemsPerPackage for that type)
    • served rows only — a writable package's own list beside a package-less open old shape of the name: 404 before and after (ablate: project every stored view row)
  • Restored with git checkout and rebuilt (exit 0). git diff HEAD --stat after: (empty).
diff --git a/packages/metadata-protocol/src/protocol-form-reads.ts b/packages/metadata-protocol/src/protocol-form-reads.ts
index 2305840bb..7114bb948 100644
--- a/packages/metadata-protocol/src/protocol-form-reads.ts
+++ b/packages/metadata-protocol/src/protocol-form-reads.ts
@@ -249,7 +249,7 @@ export async function readEffectiveFormList(
     // Step 2: the projection of the served `view` list, per (package, name).
     const projected = new Map‹string, Record‹string, unknown››();
     const projectedOrder: string[] = [];
-    for (const view of views) {
+    for (const view of [...views, ...(await storedEntries(host, 'view')).map((e) =› ({ ...(e.data as object), ...(e.packageId ? { _packageId: e.packageId } : {}) }))]) {
         const pkg = packageOf(view);
         for (const form of projectViewForms(view).forms) {
             const key = keyOf(pkg, form.name);
R3, served-rows-from-view-list: 4 of 48 red
  • The mutation, on disk in packages/metadata-protocol/src/protocol-form-reads.ts (diff below). Rebuilt: the metadata-protocol dist, exit 0.
  • The harness: 44 passed, 4 failed. Red:
    • pin 7 — replacement across the types: a view override with no link over an open authored form item closes the address (ablate: the cross-type resolution of D5)
    • served rows only, at the address — a read-only package's open form item under a package-less row whose form has no link: 404 before and after a list of the name is saved beside it (ablate: take the served rows from the effective view list)
    • the closed reading — a stored package-less list at the name keeps both doors at 404 at the package's address (ablate: fall through to the package's source form item)
    • the closed reading — so does a stored package-less container whose expansion writes a list at the name
  • Restored with git checkout and rebuilt (exit 0). git diff HEAD --stat after: (empty).
diff --git a/packages/metadata-protocol/src/protocol-form-reads.ts b/packages/metadata-protocol/src/protocol-form-reads.ts
index 2305840bb..ca4736911 100644
--- a/packages/metadata-protocol/src/protocol-form-reads.ts
+++ b/packages/metadata-protocol/src/protocol-form-reads.ts
@@ -311,7 +311,8 @@ export async function readEffectiveFormList(
             put(key, item);
             continue;
         }
-        const served = servedFormHolding(await placesOf(), name, pkg!, installed);
+        const viaList = projected.get(keyOf(pkg, name)) ?? projected.get(keyOf(undefined, name));
+        const served = (viaList ? { holding: { kind: 'form', item: viaList }, place: { type: 'view' } } : undefined) as any;
         if (served === undefined || served.place.type === 'form') {
             // No stored row, or a stored `form` row: the generic merge served
             // the same candidate order over the `form` rows alone.
R4, closed-reading-fallthrough: 2 of 48 red
  • The mutation, on disk in packages/metadata-protocol/src/protocol-form-reads.ts (diff below). Rebuilt: the metadata-protocol dist, exit 0.
  • The harness: 46 passed, 2 failed. Red:
    • the closed reading — a stored package-less list at the name keeps both doors at 404 at the package's address (ablate: fall through to the package's source form item)
    • the closed reading — so does a stored package-less container whose expansion writes a list at the name
  • Restored with git checkout and rebuilt (exit 0). git diff HEAD --stat after: (empty).
diff --git a/packages/metadata-protocol/src/protocol-form-reads.ts b/packages/metadata-protocol/src/protocol-form-reads.ts
index 2305840bb..776738263 100644
--- a/packages/metadata-protocol/src/protocol-form-reads.ts
+++ b/packages/metadata-protocol/src/protocol-form-reads.ts
@@ -320,7 +320,7 @@ export async function readEffectiveFormList(
         }
         // A stored `view` row is the served row at this address.
         if (served.holding.kind === 'form') put(key, projectedServed(served.holding.item, pkg));
-        // …else the closed reading: nothing is served for the name from the package.
+        else put(key, item);
     }
     // A package that authors the form but has no item in the generic list (its
     // item withheld) is not re-introduced here.
R5, the-bound: 5 of 48 red
  • The mutation, on disk in packages/metadata-protocol/src/protocol-form-writes.ts (diff below). Rebuilt: the metadata-protocol dist, exit 0.
  • The harness: 43 passed, 5 failed. Red:
    • refuses the save of a list item with 400 VALIDATION_ERROR, naming the package
    • refuses a container whose expansion writes a list at the name
    • refuses the publish of a list draft saved before the gate
    • refused where the base's pair cannot be ensured too; the list saved into an app of the environment's own and into the pair as its own item saves; after all of them the doors serve the package's form (ablate: the bound; the expansion half)
    • …and with the pair ensurable: the list into an app of the environment's own and into the pair as its own item saves, and the doors still serve the package's form
  • Restored with git checkout and rebuilt (exit 0). git diff HEAD --stat after: (empty).
diff --git a/packages/metadata-protocol/src/protocol-form-writes.ts b/packages/metadata-protocol/src/protocol-form-writes.ts
index 187a768e6..ea2731bef 100644
--- a/packages/metadata-protocol/src/protocol-form-writes.ts
+++ b/packages/metadata-protocol/src/protocol-form-writes.ts
@@ -77,7 +77,7 @@ export function packagelessListOverFormRefusal(
     saveName: string,
     packageId: string | null | undefined,
 ): (Error & { code: 'VALIDATION_ERROR'; status: 400 }) | undefined {
-    if ((PLURAL_TO_SINGULAR[type] ?? type) !== 'view') return undefined;
+    if (type.length › 0) return undefined;
     if (!isPackageless(packageId)) return undefined;
     if (!item || typeof item !== 'object' || Array.isArray(item)) return undefined;
     for (const name of listNamesOf(host, type, item as Record‹string, unknown›, saveName)) {
R6, expansion-half: 2 of 48 red
  • The mutation, on disk in packages/metadata-protocol/src/protocol-form-writes.ts (diff below). Rebuilt: the metadata-protocol dist, exit 0.
  • The harness: 46 passed, 2 failed. Red:
    • refuses a container whose expansion writes a list at the name
    • refused where the base's pair cannot be ensured too; the list saved into an app of the environment's own and into the pair as its own item saves; after all of them the doors serve the package's form (ablate: the bound; the expansion half)
  • Restored with git checkout and rebuilt (exit 0). git diff HEAD --stat after: (empty).
diff --git a/packages/metadata-protocol/src/protocol-form-writes.ts b/packages/metadata-protocol/src/protocol-form-writes.ts
index 187a768e6..edddbd1f4 100644
--- a/packages/metadata-protocol/src/protocol-form-writes.ts
+++ b/packages/metadata-protocol/src/protocol-form-writes.ts
@@ -43,7 +43,7 @@ function listNamesOf(
     if (isAggregatedViewContainer(stamped)) {
         const names: string[] = [];
         for (const expanded of host.expandRuntimeViewContainer(type, stamped, { packageId: null })) {
-            names.push(...projectViewForms(expanded).lists);
+            void expanded;
         }
         return [...new Set(names)];
     }
R7, removal-form-content-test: 3 of 48 red
  • The mutation, on disk in packages/metadata-protocol/src/protocol-form-writes.ts (diff below). Rebuilt: the metadata-protocol dist, exit 0.
  • The harness: 45 passed, 3 failed. Red:
    • a form write leaves a list row of the same name untouched
    • a list row of the name stays byte-equal across the form draft save, its publish and its reset (ablate: the form-content test of the old-shape row removal)
    • …and across the form delete of an override whose base ships the form as an old shape
  • Restored with git checkout and rebuilt (exit 0). git diff HEAD --stat after: (empty).
diff --git a/packages/metadata-protocol/src/protocol-form-writes.ts b/packages/metadata-protocol/src/protocol-form-writes.ts
index 187a768e6..cf23f73cd 100644
--- a/packages/metadata-protocol/src/protocol-form-writes.ts
+++ b/packages/metadata-protocol/src/protocol-form-writes.ts
@@ -206,7 +206,7 @@ export function oldShapeFormRowRemovals(
         const body = row.data;
         if (!body || typeof body !== 'object' || Array.isArray(body)) continue;
         const projection = projectViewForms(body);
-        if (!projection.forms.some((form) =› form.name === name)) continue;
+        void projection;
         if (!isAggregatedViewContainer(body)) {
             out.push({ kind: 'delete', row: { name: row.name, packageId } });
             continue;
R8, override-gate-projection-half: 8 of 48 red
  • The mutation, on disk in packages/metadata-protocol/src/protocol-packaged-base-refusal.ts (diff below). Rebuilt: the metadata-protocol dist, exit 0.
  • The harness: 40 passed, 8 failed. Red:
    • pin 2 — the mirror: withdrawn by a form override, open as an old-shape item in the base (ablate: the form half)
    • narrowing only: an open form override cannot re-open a form the base's old shape withdraws
    • a form save at a package removes that package's old-shape row of the name, in the same write
    • a form write leaves a list row of the same name untouched
    • a form override of a name the base ships in neither type is refused declared_package_ships_no_such_item (ablate: the projection half of the gate's "ships" read; the CONTROL below is then refused)
    • …and across the form delete of an override whose base ships the form as an old shape
    • a form delete at the pair removes the pair's old-shape row of the name
    • a form write that fails leaves both rows as they were
  • Restored with git checkout and rebuilt (exit 0). git diff HEAD --stat after: (empty).
diff --git a/packages/metadata-protocol/src/protocol-packaged-base-refusal.ts b/packages/metadata-protocol/src/protocol-packaged-base-refusal.ts
index 71bbd31be..991c0bb0c 100644
--- a/packages/metadata-protocol/src/protocol-packaged-base-refusal.ts
+++ b/packages/metadata-protocol/src/protocol-packaged-base-refusal.ts
@@ -1439,7 +1439,7 @@ export function overrideWriteVerdict(
             // is an old shape, and its `form` override switches it off.
             ...((PLURAL_TO_SINGULAR[request.type] ?? request.type) === 'form'
                 ? this.shippedArtifactsOf('view', request.name)
-                    .filter((a) =› projectViewForms(a).forms.some((form) =› form.name === request.name))
+                    .filter((a) =› projectViewForms(a).forms.some(() =› false))
                     .map((a) =› (a as { _packageId?: unknown } | null | undefined)?._packageId)
                     .filter((id): id is string =› typeof id === 'string' && dependencies.includes(id)
                         && !this.isWritablePackage(id))
R9, parse-projected-with-FormSchema: 2 of 48 red
  • The mutation, on disk in packages/metadata-protocol/src/protocol-form-reads.ts (diff below). Rebuilt: the metadata-protocol dist, exit 0.
  • The harness: 46 passed, 2 failed. Red:
    • a caller refused a form's document at /api/v1/meta/view/NAME is refused it at /api/v1/meta/form/NAME; its holder is served both
    • an old-shape form whose data.object differs from its container's object answers both doors as before, byte-equal on the resolve door (ablate: parse projected items with FormSchema)
  • Restored with git checkout and rebuilt (exit 0). git diff HEAD --stat after: (empty).
diff --git a/packages/metadata-protocol/src/protocol-form-reads.ts b/packages/metadata-protocol/src/protocol-form-reads.ts
index 2305840bb..1edc48f41 100644
--- a/packages/metadata-protocol/src/protocol-form-reads.ts
+++ b/packages/metadata-protocol/src/protocol-form-reads.ts
@@ -249,9 +249,12 @@ export async function readEffectiveFormList(
     // Step 2: the projection of the served `view` list, per (package, name).
     const projected = new Map‹string, Record‹string, unknown››();
     const projectedOrder: string[] = [];
+    // ABLATION: the projected items parsed as `form` items (`data` stripped, as a normalizing parse would), the refused ones dropped.
+    const { FormSchema: AblFormSchema } = await import('@objectstack/spec/ui');
+    const asFormItem = (f: unknown): boolean =› { const { [PROJECTED_FORM_SOURCE_KEY]: _m, data: _d, ...plain } = f as Record‹string, unknown›; return (AblFormSchema as any).safeParse(plain).success; };
     for (const view of views) {
         const pkg = packageOf(view);
-        for (const form of projectViewForms(view).forms) {
+        for (const form of projectViewForms(view).forms.filter(asFormItem)) {
             const key = keyOf(pkg, form.name);
             if (projected.has(key)) continue;
             projected.set(key, projectedServed(form, pkg));
R10, publish-refusal: 2 of 48 red
  • The mutation, on disk in packages/metadata-protocol/src/protocol-history-and-publish.ts (diff below). Rebuilt: the metadata-protocol dist, exit 0.
  • The harness: 46 passed, 2 failed. Red:
    • refuses the publish of a list draft saved before the gate
    • publish — a form draft left open on an address another form took after the draft was saved is refused 409 FORM_ADDRESS_TAKEN, naming both forms, and nothing is promoted
  • Restored with git checkout and rebuilt (exit 0). git diff HEAD --stat after: (empty).
diff --git a/packages/metadata-protocol/src/protocol-history-and-publish.ts b/packages/metadata-protocol/src/protocol-history-and-publish.ts
index 3def2e34c..42b498e3e 100644
--- a/packages/metadata-protocol/src/protocol-history-and-publish.ts
+++ b/packages/metadata-protocol/src/protocol-history-and-publish.ts
@@ -1205,10 +1205,7 @@ export class ProtocolHistoryAndPublishFacet {
         // draft was saved (`FORM_ADDRESS_TAKEN`, 409). See
         // {@link formTypeWriteRefusal}.
         if (draftForGate) {
-            const formRefusal = await formTypeWriteRefusal(
-                host, singularType, draftForGate.body, request.name, promoteInto,
-            );
-            if (formRefusal) throw formRefusal;
+            void formTypeWriteRefusal;
         }
         // [#28905, ADR-0146 D1, D11] …and the promotion INTO the read-only
         // base itself, of an item of one of the five overlay types it ships:
R11, restore-refusal: 1 of 48 red
  • The mutation, on disk in packages/metadata-protocol/src/protocol.ts (diff below). Rebuilt: the metadata-protocol dist, exit 0.
  • The harness: 47 passed, 1 failed. Red:
    • restore — a rollback to a version open on an address another form holds now is refused 409 FORM_ADDRESS_TAKEN, and the row stays as it is; CONTROL: the address free, it is restored
  • Restored with git checkout and rebuilt (exit 0). git diff HEAD --stat after: (empty).
diff --git a/packages/metadata-protocol/src/protocol.ts b/packages/metadata-protocol/src/protocol.ts
index 0b2b200c6..a7a055762 100644
--- a/packages/metadata-protocol/src/protocol.ts
+++ b/packages/metadata-protocol/src/protocol.ts
@@ -1593,7 +1593,7 @@ export class ObjectStackProtocolImplementation implements
 
     /** [ADR-0159 card ② items 5 and 7] {@link formTypeWriteRefusal}, asked of a restored body against its binding. */
     private formRestoreRefusal(type: string, item: unknown, name: string, binding: string | null): Promise‹Error | undefined› {
-        return formTypeWriteRefusal(protocolHost(this), type, item, name, binding);
+        return formTypeWriteRefusal(protocolHost(this), type, item, name, binding).then(() =› undefined);
     }
 
     /**
R12, packaged-base-accessor-form-row: 1 of 48 red
  • The mutation, on disk in packages/rest/src/meta-item-read-gate.ts (diff below). Rebuilt: none (the rest tests run its source), exit 0.
  • The harness: 47 passed, 1 failed. Red:
    • an override's own changed text outranks the base's catalog on /meta/form and on the public door; text it kept is translated (ablate: the form row of PACKAGED_BASE_ACCESSORS)
  • Restored with git checkout and rebuilt (exit 0). git diff HEAD --stat after: (empty).
diff --git a/packages/rest/src/meta-item-read-gate.ts b/packages/rest/src/meta-item-read-gate.ts
index fc63e35c6..f986a2176 100644
--- a/packages/rest/src/meta-item-read-gate.ts
+++ b/packages/rest/src/meta-item-read-gate.ts
@@ -3444,7 +3444,6 @@ const PACKAGED_BASE_ACCESSORS: ReadonlyMap‹string, string› = new Map‹string, str
     ['mapping', 'getPackagedMappingBase'],
     // [ADR-0159, ADR-0029 D9.2a] A `form` override's own changed text outranks
     // its base's catalog, the base an authored `form` item or an old shape's projection.
-    ['form', 'getPackagedFormBase'],
 ]);
 
 /**
R13, one-definition-per-address: 1 of 48 red
  • The mutation, on disk in packages/metadata-protocol/src/protocol-form-reads.ts (diff below). Rebuilt: the metadata-protocol dist, exit 0.
  • The harness: 47 passed, 1 failed. Red:
    • one definition per address: a package-less stored form row over a base that ships the form as an old shape is listed once, at the base's address, with the row's body (D5 served-row order)
  • Restored with git checkout and rebuilt (exit 0). git diff HEAD --stat after: (empty).
diff --git a/packages/metadata-protocol/src/protocol-form-reads.ts b/packages/metadata-protocol/src/protocol-form-reads.ts
index 2305840bb..b607bc08f 100644
--- a/packages/metadata-protocol/src/protocol-form-reads.ts
+++ b/packages/metadata-protocol/src/protocol-form-reads.ts
@@ -303,7 +303,7 @@ export async function readEffectiveFormList(
     for (const [key, item] of genericByKey) {
         const name = String((item as { name?: unknown }).name);
         const pkg = packageOf(item);
-        if (pkg === undefined && projectedAddressesOf.has(name)) {
+        if (pkg === undefined && projectedAddressesOf.has(name) && name.length ‹ 0) {
             packagelessFormRows.set(name, { key, item });
             continue;
         }
R14, cached-read-audience-form: 1 of 48 red
  • The mutation, on disk in packages/rest/src/meta-item-read-routes.ts (diff below). Rebuilt: none (the rest tests run its source), exit 0.
  • The harness: 47 passed, 1 failed. Red:
    • a caller refused a form's document at /api/v1/meta/view/NAME is refused it at /api/v1/meta/form/NAME; its holder is served both
  • Restored with git checkout and rebuilt (exit 0). git diff HEAD --stat after: (empty).
diff --git a/packages/rest/src/meta-item-read-routes.ts b/packages/rest/src/meta-item-read-routes.ts
index 57ea70a58..aff07896b 100644
--- a/packages/rest/src/meta-item-read-routes.ts
+++ b/packages/rest/src/meta-item-read-routes.ts
@@ -775,7 +775,7 @@ export function registerMetaItemReadRoutes(this: MetaItemReadRouteHost, scope: M
                         // [ADR-0159, card ② item 2] …and a `form`, whose own
                         // `requiredPermissions` (a projected item carries its
                         // view item's) the gate judges as the `view` arm does.
-                        const audienceFolds = metaType === 'view' || metaType === 'object' || metaType === 'form';
+                        const audienceFolds = metaType === 'view' || metaType === 'object';
                         // [ADR-0106 D1] And for an `action`: it is withheld
                         // from a caller who cannot read a field it binds, and
                         // that caller is answered as for a name with nothing
R15, forms.NAME.sections: 1 of 10 red
  • The mutation, on disk in packages/spec/src/system/i18n-resolver.ts: translateForm passes no form name to translateFormSections, so only _sections is read.
  • pnpm exec vitest run src/system/i18n-resolver.form-item.test.ts (spec tests import the source): 9 passed, 1 failed. Red: "reads the form's own section node first, and _sections for each key it lacks". The CONTROL ("with no forms.NAME.sections node, _sections translates the section as before") stays green.
  • Restored with git checkout. git diff HEAD --stat after: (empty).
-    ? translateFormSections(form.sections, catalogs, formSectionObjectName(form, objectName), opts, base, name)
+    ? translateFormSections(form.sections, catalogs, formSectionObjectName(form, objectName), opts, base)

The fixtures taken before the type

packages/rest/src/form-old-shape-before.json was captured on PR A's head, cb854ea4d: the rename-only tree, which has no form type. A throwaway test booted the same stacks these pins boot, and it was never committed (git status on PR A is clean). The fixture holds three answers:

  • GET /api/v1/meta/view over a container's default form, a formViews entry and a stored viewKind: 'form' item;
  • a formViews entry whose data.object names another object, on both doors;
  • the CRM's GET /forms/contact-us.

Each answer is compared as the wire serializes it, byte for byte. The save clock is written as TIME, because it is the one value two runs cannot share. The CRM pin (public-form-app-crm-byte-equal.test.ts, repo project) reads two examples/app-crm files. They are declared as rest test:repo inputs in scripts/cross-package-test-inputs.mjs and in turbo.json.

Per-type arm inventory (card item 2)

Command: git grep -nE "=== 'view'|'view'," -- packages/rest/src packages/metadata-protocol/src packages/spec/src/kernel. It finds 64 hits in source files. The test files are left out: they hold fixture rows, not arms. Each hit is listed with whether form takes the arm.

64 source hits, by file

rest

  • form-routes.ts:245, 300, 511-514: the doors' own reads of the view carrier of a projected form. These are by design; form is the other half of the same reads.
  • meta-item-read-gate.ts:1796 (item audience) and :1998 (list audience): taken. The form arms sit at :1818 and :2015.
  • meta-item-read-gate.ts:2850 and :4780-4782 (the object list filter): not taken. The filter is the view list's. The form list declares no filter, and a form's object is its name's prefix.
  • meta-item-read-gate.ts:3438 (PACKAGED_BASE_ACCESSORS): taken, as ['form', 'getPackagedFormBase'] (S4).
  • meta-item-read-gate.ts:3791 and :3867 (withoutInventedViewLabel): not taken. translateForm translates only a label that the form authors, so it invents none.
  • meta-item-read-gate.ts:3843 and :3932 (container translation): not taken. A form item is never a container.
  • meta-item-read-gate.ts:4492 and :4526 (lists: 'app' | 'view'): not taken. These name the two list shapes that a navigation member reads.
  • meta-app-bundle-routes.ts:311 (an app bundle's view members): not taken. No app navigates to a form item until card ③.
  • meta-item-read-routes.ts:778 (the cached plain read's audience fold): taken (this rework), so the cached arm applies the same audience gate as the uncached one. See R14.
  • meta-item-read-routes.ts:766 and rest-server.ts:4445 (the public-form intake warning stamped on a served view): not taken. The warning's reader is the console's form designer, which is card ③. A form write is warned at the save door (runtime-authoring-gate.ts:437).
  • rest-server.ts:4096 (gatesOnItsOwnKey, the history, diff, audit and published doors): not taken. Those doors serve stored form rows only. An authored form item declares no requiredPermissions, so its gate always passes. A projected form, the only form that carries a gate, has no form rows, so those doors expose nothing of it.

metadata-protocol

  • build-probes.ts:653-674 (the renderer probe over published views): not taken. The probe reads the view renderer's path, and the public form renderer reads a form item through the doors pinned above.
  • destructive-still-shown-by.ts:343 (views that still show a field a destructive change removes): not taken in card ②. A form item's sections name fields too. Measuring that it should be shown is listed under "Named for the seat".
  • meta-compile-cache.ts:159: not taken, by design. The form read is never cached, because its answer moves with the stored view rows (protocol-meta-item-reads.ts, the by-name read's header).
  • metadata-diagnostics.ts:645 and :736 (form-layout diagnostics on a served form view): not taken. The consumer is Studio's form designer, card ③. The save and publish gate runs the form rules registered for the type.
  • package-namespace-rename.ts:133 and package-unmanaged-install.ts:634-642 and :1015-1017 (the copy names of a view and of a container's expansions): not measured for form. A form item named OBJECT.KEY follows the generic renameName, not the qualified-view rename. Whether an unmanaged copy of a package that authors forms: keeps the name's prefix equal to its renamed object is listed under "Named for the seat".
  • protocol-authoring-gate.ts:663 (the storage fold of a disabled extension's fields): not taken. No rule that a form write runs reads its object's fields. The form rules judge the object binding only.
  • protocol-discovery-and-bases.ts:879 and :947: the view half of getPackagedViewBase, and the old-shape fallback of the new getPackagedFormBase.
  • protocol-form-reads.ts and protocol-form-writes.ts (all hits): the cross-type reads and writes themselves.
  • protocol-meta-item-reads.ts:704: the projected-item mark. :1592 (ADR-0047 list-view reference diagnostics) is not taken: those rules read list-only keys.
  • protocol-meta-list-reads.ts:320 (the view merge's container handling) and :1027 (containers left out of the view list): not taken. A form row is never a container.
  • protocol-packaged-base-refusal.ts:1349 (a container's expansion in the override gate): not taken, for the same reason. :1441 is the form gate's projection half (R8).
  • protocol-registry-hydration.ts:872 and :2024 (finding(metadata-protocol): on an unscoped kernel, a package-bound stored row of a view name two packages ship is hydrated into the registry's bare slot, so a by-name read naming the other package serves that row's body under its own _packageId #22057, a view row bound to one package is not registered under a name another package ships): not taken in card ②. The header marks the case "View only". The form read resolves the address itself and does not read the registry for a stored row.
  • protocol-save.ts:1511: the package-less list refusal. :1706 (projectStorableViewBody) is not taken: a form body is stored through the generic path, and FormSchema is strict, so no undeclared key survives the parse.
  • protocol-unmanaged-import.ts:60: a container's expansions. Not taken.
  • runtime-authoring-gate.ts:1670: taken. PUBLIC_FORM_INTAKE_UNAVAILABLE runs for form.
  • protocol-diff-delete-load.ts:841, protocol-registry-hydration.ts:1694 and sys-metadata-repository.ts:2433: comments.

spec/kernel

  • metadata-plugin.zod.ts:98 and :967: form has its own enum member and its own registry row.

Notes for the review items

Accepted deviations (review nits)

  • N1 (form-consumer-less is silent for every overrides item). Kept. Lint judges the authoring stack, and the base form's consumers live in the installed base, which is not in that stack. The rule cannot tell an override that keeps a consumed address closed from one that steers nothing. A warning there would invite the removal of the override that keeps the address closed (validate-form-items.ts header).
  • N2 (readEffectiveFormItem scoped to a package where the name is listed only at another). Kept. That branch is the pair's address answered by its base, the same layered by-name answer every type gives. The address is closed on both doors, so nothing is exposed.

The other three nits are done:

  • N3: form.json sharing cites findPublicForm, openFormAt and the slug rule.
  • N4: the registry-row comment says what overlays a form.
  • N5: scripts/adr-anchors/packages__metadata-protocol__src__protocol-form-reads.ts.json anchors the cross-type resolution.

Verification

The head is 67af96fb6. Every count below was read on this rework's tree.

  • Local, affected packages:
    • @objectstack/metadata-protocol, full vitest run: 370 files passed and 9 skipped; 23454 tests passed and 45 skipped.
    • @objectstack/rest, local project, full run: 430 files passed; 8900 tests passed and 351 skipped.
    • The door harness: 48 of 48. The CRM byte-equal pin (repo project): 1 of 1.
    • Spec: i18n-resolver.form-item.test.ts, i18n-resolver.form-sections.test.ts and i18n-resolver.test.ts, 578 of 578. The first holds the new sections describe, 10 of 10.
    • typecheck for spec, metadata-protocol and rest: exit 0. Rest's includes check:test-typecheck over tsconfig.test.json.
    • The full runs were read at b1a299432. The one commit after it, 67af96fb6, changes only three files: the CRM test (re-run green, and rest typecheck re-run green), a changeset, and the examples coupling gate (--self-test 39 of 39, and the scan).
  • Local, gates: these exited 0:
    • check:generated, check:liveness, check:authorable-surface, check:api-surface, check:spec-changes, check:strictness-ledger and check:export-origins;
    • check:i18n, check:i18n-coverage and check:i18n-walk-parity;
    • check:cross-package-test-inputs, check:test-source-alias, check:examples-live-imports and check:declared-population-live;
    • check:adr-anchors, check:adr-symbol-anchors and check:doc-anchors;
    • check:facade-delegation-only (protocol.ts at 11705 of 11705) and check:nul-bytes;
    • check:error-code-casing, check:engine-double-contract, check:meta-type-normalized and check:rest-log-spy-declared;
    • check:turbo-task-graph, check:undeclared-dep-imports, check:watch-hint-literal and check:ci-filter-parity;
    • the changeset no-major, empty-changeset, ADR-0087 registration and issue-citation scripts.
  • Declared narrowing: dispatch-gates --ran reads 164 of 196 derived families as unrun. The derivation covers the whole stacked diff, so this round ran the families that read the files it changed. CI runs the farm.
  • Not measured: check:type-check-debt did not finish inside the 300-second budget.
  • Not from this diff: check:platform-checklist reports areas/automation.json ABSENT SYMBOL FlowItemMoreMenu.tsx#FlowItemMoreMenu. Neither file is in this diff. The finding is on main (80da086 and b8c8c88).

Edits needed outside this PR's surface (named, not made):

  • .claude/skills/spec-property-retirement: the lines that name defineForm as the Studio helper.
  • ui/docs/adr/0056: the same naming.
  • ADR-0159:109: the anchor resolves again with this PR, onto a symbol whose meaning is the opposite of the sentence. The ADR's text is the seat's to order.

Named for the seat (from the arm inventory; measured nowhere yet, so no card is asked):

  • Does the destructive-change "still shown by" read need form items, whose sections name fields?
  • Does an unmanaged copy of a package that authors forms: keep each form name's prefix equal to its renamed object?

Finding for a follow-up: a security item is with the owner seat.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint is CI's.
  • 4. One issue, one branch, one pull request (the card's cut: PR A refactor(spec)!: rename the Studio helper defineForm to defineMetadataForm and its modules to *.metadata-form.ts #37366 + this PR B, stacked).
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq

…ead a form over both types

ADR-0159 card ②, everything past the rename (PR B of the card's cut):
FormSchema derived from FormViewSchema by reference with defineForm and
*.form.ts; the registry row, the stack's forms collection and the forms
translation family; one projection of the three old view shapes; the
effective form read resolved over both types; the form write's removal of
the old-shape row; the address clash refusal (FORM_ADDRESS_TAKEN); the
package-less list-at-a-form's-name refusal on save, publish and restore;
the anonymous doors' two-type withdrawal layer with rule 7's closed links;
the lint rules, the liveness ledger and the showcase form.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…gation, cli i18n bucket, provenance row, checklist waiver, transcript counts

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…les, showcase feedback form zh-CN, walk-parity fixture member; typed form-body refinement params

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…ocol serving no form item, one registry heal for old-shape removals, the by-name form read keeps the generic answer unless resolved across types, census and enumeration pins

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
The owner-stamp fixture tables, the meta list/item census, the CLI
schema-gate classification and the metadata-form catalog ratchets each
gain the form type (ADR-0159 card ②, #37086).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
@github-actions github-actions Bot added documentation Improvements or additions to documentation protocol:system protocol:ui tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 10 package(s): @objectstack/cli, @objectstack/lint, @objectstack/metadata-core, @objectstack/metadata-protocol, @objectstack/metadata, @objectstack/objectql, @objectstack/platform-objects, @objectstack/rest, @objectstack/runtime, @objectstack/spec, touching 302 documentable anchor(s). ⚠️ 24 changed file(s) yielded no anchor (packages/lint/src/index.ts, packages/rest/src/form-old-shape-before.json, packages/rest/vitest.repo-tests.json, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

82 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json cb854ea4d065c489e03a0d1b3b5bb9aeb8998626.

⛔ 22 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 24 changed file(s) yielded no anchor (packages/lint/src/index.ts, packages/rest/src/form-old-shape-before.json, packages/rest/vitest.repo-tests.json, …) — pages documenting those are invisible to this run
  • 2 anchor(s) matched too much of the corpus to be a work list: VALIDATION_ERROR (literal, 39 pages), objectName (literal, 59 pages)
  • 30 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 191 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json cb854ea4d065c489e03a0d1b3b5bb9aeb8998626 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from f6099f18fa1d0e2f0ffeecb359e3f71aa73f69c1 — the merge of head c75ea6281cd7418af82eeb6de9cf927027ff77a6 into base cb854ea4d065c489e03a0d1b3b5bb9aeb8998626, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older claude/project-thread-pu5dnt holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin f6099f18fa1d0e2f0ffeecb359e3f71aa73f69c1 && git checkout f6099f18fa1d0e2f0ffeecb359e3f71aa73f69c1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin cb854ea4d065c489e03a0d1b3b5bb9aeb8998626 c75ea6281cd7418af82eeb6de9cf927027ff77a6 && git checkout -B drift-repro cb854ea4d065c489e03a0d1b3b5bb9aeb8998626 && git merge --no-ff c75ea6281cd7418af82eeb6de9cf927027ff77a6

node scripts/docs-audit/affected-docs.mjs --json cb854ea4d065c489e03a0d1b3b5bb9aeb8998626

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs cb854ea4d065c489e03a0d1b3b5bb9aeb8998626 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…object

translateForm reads a form item's section headings at
objects.<object>._sections.<name>, so translation-target-unknown must
accept those keys. The showcase feedback form's zh-CN section heading
tripped it in the dogfood build.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…ectstack-ai/objectstack into claude/project-thread-pu5dnt-b

# Conflicts:
#	packages/spec/dropped-refinements.baseline.json
- TranslationPreview draws the forms group, with its strings and fixtures.
- Pending changes count a drafted form in every pack.
- The console loader namespaces a served forms group.
- Studio's directory and menu leave form out until card ③ brings its
  designer, placement and ADR-0084 row.
- The types censuses: spec FormSchema is a name collision with the
  form node, and checkFormItemNamePrefix judges a schema objectui does
  not mirror.
- rest: the unused withdrawal import goes, and the intake test pays the
  objectql load at collection.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…ectstack-ai/objectstack into claude/project-thread-pu5dnt-b

# Conflicts:
#	content/docs/deployment/cli.mdx
#	content/docs/deployment/validating-metadata.mdx
#	content/docs/getting-started/build-with-claude-code.mdx
#	content/docs/ui/react-pages.mdx
…vel keys

The enumeration row only (check:skill-top-level-keys); the prose,
examples and evals are #37105's. The token ceiling moves by the row's
measured +2 (6149 -> 6151), the standing enumeration-row case: ruling A
on #32584 (record 6819475461), made standing by #32673 letter A
(record 6840575378).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-alice · session_011y7As8wf3DSPRevwNnYLcM

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 97341d57da84d7143c7990ef72a82fff0e8b77ef
Local-runs: none
Scope: packages/spec/src/api/error-code-ledger.zod.ts, packages/spec/src/index.ts, packages/spec/src/kernel/collection-item-owner-stamp.ts, packages/spec/src/kernel/customization-package.ts, packages/spec/src/kernel/metadata-plugin.zod.ts, packages/spec/src/kernel/metadata-type-schemas.ts, packages/spec/src/meta-spelling/manifest-collection-spelling.ts, packages/spec/src/meta-spelling/meta-url-data.generated.ts, packages/spec/src/migrations/entries/semantic/18.form-type-define-form-and-packageless-list-at-form-name.ts, packages/spec/src/stack.zod.ts, packages/spec/src/system/i18n-resolver.ts, packages/spec/src/system/translation.zod.ts, packages/spec/src/ui/anonymous-form-intake.ts, packages/spec/src/ui/form-intake-layer.ts, packages/spec/src/ui/index.ts, packages/spec/src/ui/old-shape-form-withdrawals.ts, packages/spec/src/ui/view.zod.ts, skills/objectstack-platform/SKILL.md + packages/rest/src/form-routes.ts, packages/rest/src/meta-item-read-gate.ts, packages/rest/src/public-form-two-type-withdrawal.test.ts, packages/metadata-protocol/src/protocol-form-reads.ts, packages/metadata-protocol/src/protocol-form-writes.ts, packages/metadata-protocol/src/protocol-save.ts, packages/metadata-protocol/src/protocol-history-and-publish.ts, packages/metadata-protocol/src/protocol-diff-delete-load.ts, packages/metadata-protocol/src/protocol-meta-item-reads.ts, packages/metadata-protocol/src/protocol-meta-list-reads.ts, packages/metadata-protocol/src/protocol-packaged-base-refusal.ts, packages/metadata-protocol/src/protocol-authoring-gate.ts, packages/metadata-protocol/src/runtime-authoring-gate.ts, packages/metadata-protocol/src/protocol.ts, packages/lint/src/validate-form-items.ts, packages/lint/src/authoring-rules.ts, packages/lint/src/i18n-walk.ts, packages/lint/src/validate-translation-references.ts, packages/spec/liveness/form.json, packages/spec/src/kernel/metadata-credential-fields.test.ts, scripts/adr-anchors/packages__rest__src__form-routes.ts.json, scripts/adr-anchors/packages__spec__src__ui__old-shape-form-withdrawals.ts.json, scripts/check-skills-token-ratchet.mjs, scripts/check-stack-collection-maps.mjs, ui/scripts/check-spec-symbol-derivation.mjs, docs/qa/platform-checklist/coverage.json, examples/app-showcase/src/ui/forms/feedback.form.ts, .changeset/37086-form-metadata-type.md, .changeset/37086-form-type-console-strings.md
Security-touching: yes
Rule-change-verified: none

PR #37422 (PR B of card #37086's fixed cut), base = PR A's branch claude/project-thread-pu5dnt, 153 files, +4117 / -306, 14 commits. Read: the card body and its six comments, the PR body, the file list, the net diff against PR A's head, the check-runs on this head, ADR-0159 on main, and the cited code at this head. Nothing was built, run or ablated. The narrowing face holds, so every path of the diff is in the floor; + names the files the published hunks make a claim about.

The security question of the brief, answered first. No path that re-opens a withdrawn public form was found by reading. Traced: a view override's withdrawal against an authored form; a form override against an old-shape base; a base-withdrawn form item under a package-less or override old-shape row; rule 11 for the pair row and the package-less row; served rows only; the package-less list refusal at save, publish and restore; the door's own fallback read (S1). What follows is that the design reads closed, and that the card's proof of it is not in the PR: see M2.

① Derived judgments

Each accept-set and public-surface change, named right or wrong.

  • FormSchema (packages/spec/src/ui/view.zod.ts): a strict object of name, object, label, the body keys of FormViewSchema taken by reference less data, the protection and override-declaration fields; data, viewKind, config, isDefault, order, scope refused with guidance; the form-body refinement shared with the view (checkFormViewBody), the name-prefix check, the groups-into-sections fold. Right (D2, D3, ruled question 2 = A).
  • defineForm declared again as the form type's factory. Right (ruled question 1 = A); it is absent on PR A's head and has one meaning here.
  • form as a metadata type: enum member, registry row with page's flags and **/*.form.ts|yml|json, type-to-schema map, forms stack collection, plural fold, owner stamp, form: listed in the customization package. Right (D1).
  • forms offers the array form only (waivers in scripts/check-stack-collection-maps.mjs). A dev-derived decision the card does not rule. Right: the name is OBJECT.KEY and is checked against object, so a map key would be a second spelling of the same identity.
  • projectViewForms / projectedFormsOf, the _formDefinedIn marker: one projection of the three old shapes; the marker is stripped before the anonymous door answers (formBodyOf). Right (D5).
  • formIntakeLayer / openFormAt: withdrawal by whole-item name over both types, closed links from unreadable bodies. Right (D6 rules 4 to 7).
  • oldShapeFormWithdrawals: the exempt reader, with the required words in its docblock and its own anchor file; not registered as an ADR-0087 conversion. Right (item 6).
  • FORM_ADDRESS_TAKEN in the error-code ledger. The code is right; the ledger comment that publishes where it is refused is wrong (M1).
  • The package-less list refusal, 400 VALIDATION_ERROR, at save, draft promotion and restore. Right (item 5), and it is the declared narrowing.
  • The override gate's "ships" read over both types (overrideWriteVerdict). Right (item 5).
  • /meta/form read gate arms (meta-item-read-gate.ts): requiredPermissions judged as for view. Right; the route pin the card asks for is missing (M2).
  • The forms translation family: label, description, title, submitBehavior in a strict object. Wrong against D8, which lists a sections branch as part of the family (S3).
  • The door's second candidate source (servedForms.length test in form-routes.ts). Wrong (S1).
  • form hidden from Studio's directory (HIDDEN_DIRECTORY_TYPES). Right: ruled A in 7183329743.

② Semver level

  • .changeset/37086-form-metadata-type.md: minor on spec, metadata-protocol, rest, lint, metadata, metadata-core, objectql, runtime, cli, platform-objects; Clause-②: yes (narrowing); Metadata-protocol: narrowed. Consistent with AGENTS.md (a protocol kind takes at least minor on a package the diff moves) and with the card's Done-when. The BREAKING banner names the export's new meaning and the refusal, the saves refused that are admitted today, and the one-line fix.
  • One ADR-0087 marker: registered form-type-define-form-and-packageless-list-at-form-name, with its entry in hits. It covers the export and the refusal together, as the card asks. PR A's changeset carries its own single marker for the rename; see that record.
  • .changeset/37086-form-type-console-strings.md: patch on @object-ui/app-shell and @object-ui/i18n, Clause-②: no, Metadata-protocol: none. Check Changeset accepts it. Against the card's "minor on every package the diff moves" it is a deviation the seat should rule: S8.
  • @object-ui/types: test files only, no changeset line. Right; the dev says so in the report.

③ Boundary flags

  • Open question 1 (who adds the forms row to skills/objectstack-platform/SKILL.md): answered A in 7183329743. Verified: the skill's hunk is one line, the top-level key enumeration gains `forms`, and nothing else; no teaching text, example or eval. scripts/check-skills-token-ratchet.mjs raises the ceiling 6149 to 6151 and the arithmetic holds (24594 to 24603 priced bytes, a quarter rounded up is 6151): exactly the row's measured delta. The two rulings are cited in the script comment only, not in the PR body as the amendment asks: S9. The two cited records were not opened; they are outside this review's inputs, and the seat checks the citation.
  • Open question 2 (keep form hidden in Studio until card ③): answered A. Verified in directoryScope.ts.
  • .claude/**: no path in the diff. Three gate-data edits are in it and are named for the seat, since each lets something through a check: the ratchet ceiling above; the forms waivers in scripts/check-stack-collection-maps.mjs; and an allow-list entry @object-ui/types:FormSchema in ui/scripts/check-spec-symbol-derivation.mjs for a name collision with the spec's new FormSchema. Each carries its reason, none changes what an agent may do without the maintainer, so the header reads none.
  • The dev's out-of-scope finding on sharing credential marking (class c): escalated by the seat. A security item is with the owner seat; no detail here.
  • The dev's security_findings: withheld: not answered on the card. The seat collects it through the private channel; this review did not see it and cannot say it is covered by the findings below.
  • Other dev decisions surfaced for the seat: KNOWN_UNSEEDED gains form in metadata-create-seeds.test.ts; docs/qa/platform-checklist/coverage.json waives form (S7); the liveness ledger form.json inherits view's verdicts (N3).
  • Named, not made: .claude/skills/spec-property-retirement and ui/docs/adr/0056 still name defineForm as the Studio helper; after this PR that is false twice over. ADR-0159:109 resolves again, onto a symbol with the opposite meaning of its sentence. All three are the seat's to order.
  • SQL push-down (Prime Directive 5): a finding. S5.
  • Check-runs on this head: 67 runs, 60 success, 7 skipped, none red, none running. Test Core was still running when the review began and finished green. Lint · docs & code guards is green here, which is what restores PR A's red lane.

④ Design judgment

Against ADR-0159 D1 to D8, the ruled questions, and the card's Done-when. The tree was read, not the PR body's account.

M1 (must-fix) — The address-clash refusal is judged at one door, and the published ledger says three. formAddressClashRefusal has one call site, the save door (protocol-save.ts). Draft promotion and the restore writer ask the package-less list refusal and do not ask this one, and the holder read is of published forms. So a draft is not judged against another draft, a draft saved before a holder took the address is not judged again at publish, and a restore is not judged at all: each leaves two open forms on one address, which is the arrangement ruled question 3 = A refuses. Card item 7 names publish ("The form write door, os validate and publish each refuse") and Done-when asks a pin for each of the three refusals; there is no publish pin. The second comment on FORM_ADDRESS_TAKEN in packages/spec/src/api/error-code-ledger.zod.ts says "the form save, draft promotion and restore doors refuse": declared, not enforced, in a hits file. Fix: ask the refusal in promoteDraftForPublish and the restore writer beside the list refusal, pin each, or correct the ledger and take the gap to the seat.

M2 (must-fix) — Done-when's pins are not all there, and two of the eight D6 pins do not hold the read they name. The card makes the pins the proof that no withdrawn form re-opens; a design that reads closed is not that proof.

  • By the PR's own table, ablation A2 (the form half of the layer) and A5f (the per-package form layer) turn nothing red, and pin 1 stays green under A1. The form half of the two-type layer is therefore unpinned: it can be deleted with the suite green. The card's fixture for pin 2 cannot show it, because the withdrawing override is itself the served candidate. A fixture that does: the base authors the form with its link kept and switched off, and an old-shape row of that name stands open on the same link; both doors must answer 404. If the dev finds no fixture where that half is the only thing keeping an address closed, that is a finding for the seat (the half is dead), not a reason to leave it unpinned.
  • Absent: the served-rows-only pin, both fixtures. The closed-reading pin (a seeded package-less list, and a stored package-less container, over an authored form). In the bound pin: "where the base's pair cannot be ensured", "into the pair as its own item", and "after all of them the doors serve the package's form". The rule 9 pin (and see S6). The declared_package_ships_no_such_item pin for a form override of a name shipped in neither type. The route pin that a caller refused /api/v1/meta/view/NAME is refused /api/v1/meta/form/NAME. The reset and delete pins; the container re-saved without the member; the failed write that leaves both rows. Byte-equality of the list row (the one test asserts viewKind, on save only). The data.object door pin. The GET /api/v1/meta/view fixture pin. The examples/app-crm byte-equal pin. The pin that an old-shape view write on a taken slug still saves. The publish clash pin (M1).
  • Not in the PR: the per-type arm inventory of item 2; the ablation records for the D5 pins; the rebuild, on-disk mutation and empty-git diff HEAD proof Done-when asks of each ablation run.

S1 (should-fix) — packages/rest/src/form-routes.ts: servedForms.length being zero switches the door to projectedFormsOf(views). That is a second candidate source inside the door, keyed on emptiness, where D6 rules 1 and 3 give the door one read, and it is a consumer-side fallback (Prime Directive 12). It was added for test doubles that answer an empty list. No divergence from the protocol's read was constructed, so it is not graded must-fix; key it on the protocol's capability or remove it and fix the doubles.

S2 (should-fix) — packages/metadata-protocol/src/protocol-form-reads.ts: the cross-type served-row resolution runs only at addresses where the package authors a form item. Over a base that ships the form as an old shape, a package-less stored form row of the same name (a write the doors admit) is listed beside the base's projected form: two definitions at one address, against D5's "one address holds one definition" and its one served-row order. The answer also changes when the base later moves to forms:. It fails closed, so it is not a re-opening; it is an upgrade-time surprise. Scenario detail is in the summary to the seat.

S3 (should-fix) — packages/spec/src/system/translation.zod.ts, system/i18n-resolver.ts: D8 lists forms.NAME.sections.SECTION.label, .description and .fields.FIELD.* as part of the family, with _sections as the default when the family has no key. The family schema is strict and refuses sections; translateForm reads section copy from _sections only. Add the branch, or have the seat name the card that owns it.

S4 (should-fix) — packages/rest/src/meta-item-read-gate.ts and the protocol: form is overridable, and translateForm promises the ADR-0029 D9.2a rule that an override's own changed text outranks the base's catalog. There is no packaged-base accessor for form (no row in PACKAGED_BASE_ACCESSORS), so the comparison has no base and an override's changed title is replaced by the base's translation, on /meta/form and on the public door.

S5 (should-fix, SQL first) — readEffectiveForms drops names and packageId from the request and filters in memory after full reads of both types and of every stored row of both. readEffectiveFormItem calls it up to three times for one by-name read, and each anonymous door request repeats the view-list and stored-row reads for the form read, the two per-package layers and the unreadable bodies. No reason is given in the code. Push the name and package predicates down, or state why the two-type resolution cannot.

S6 (should-fix) — Rule 9: Done-when asks a pin that an organization-scoped form save leaving a withdrawn form open is refused "as the same view save is today". On this tree no write-time withdrawal judgement exists in metadata-protocol (anonymousFormIntakeWithdrawnIn has no caller there; refuseOrganizationScopedWrite refuses every organization-scoped write first). The PR neither pins the form case nor reports that the item's premise is stale. Report it to the seat with the reading.

S7 (should-fix) — docs/qa/platform-checklist/coverage.json: the waiver says no app the checklist drives authors forms:, and this diff adds forms: [FeedbackForm] to the showcase. It also names card ③ as the mover of contact-us where the card says ④.

S8 (should-fix) — the second changeset declares Clause-②: no / Metadata-protocol: none at patch for two packages in a PR whose kind is narrowed. The gate is green; the card's sentence is not met to the letter. The seat rules whether the @object-ui train is exempt.

S9 (should-fix) — the PR body still lists the SKILL.md row under "named, not made" and does not cite the two rulings for the ceiling raise, which amendment 7183329743 asks for in the body. A body edit; it moves no head.

N1 (nit) — packages/lint/src/validate-form-items.ts: the consumer-less advisory is silent for every item that declares overrides, where D1 and item 9 ask it silent only when the base's form has a consumer.
N2 (nit) — protocol-meta-item-reads.ts: readEffectiveFormItem answers the generic item when the name is listed only at another package; closed at this address, so no exposure.
N3 (nit) — packages/spec/liveness/form.json (sharing): the evidence quotes lines findPublicForm no longer has and names the view path for a form item.
N4 (nit) — packages/spec/src/kernel/metadata-plugin.zod.ts: the registry-row comment says "overlayable per org" and names a scope set of global, org and user, while organization-scoped writes are refused on this tree (ADR-0131 D6); the comment describes a layer no door writes.
N5 (nit) — the cross-type resolution in protocol-form-reads.ts has no anchor file of its own; the doors' ADR-0159 anchor is an edit of the existing form-routes.ts file.

Files that hold. packages/spec/src/ui/view.zod.ts, ui/form-intake-layer.ts, ui/anonymous-form-intake.ts, ui/old-shape-form-withdrawals.ts, ui/index.ts, src/index.ts, stack.zod.ts, kernel/metadata-type-schemas.ts, kernel/customization-package.ts, kernel/collection-item-owner-stamp.ts, meta-spelling/manifest-collection-spelling.ts, meta-spelling/meta-url-data.generated.ts, the migration entry, skills/objectstack-platform/SKILL.md: each agrees with the decision it implements. protocol-form-writes.ts (the list refusal and the same-transaction row removal), protocol-packaged-base-refusal.ts, runtime-authoring-gate.ts, the two anchor files, feedback.form.ts: hold as read. Their findings are the ones graded above.

Two must-fix. The verdict is on M1 and M2; the nine should-fix items do not carry it.

Implemented-by: claude/project-thread-pu5dnt-b
Reviewed-by: l2-37086 subagent of session_011y7As8wf3DSPRevwNnYLcM

VERDICT: FAIL

…ectstack-ai/objectstack into claude/project-thread-pu5dnt-b

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…estore; one candidate read at the form doors

formTypeWriteRefusal asks the package-less list refusal and the public
address clash together, at draft promotion and in the restore writer,
so the three doors the ledger names all refuse FORM_ADDRESS_TAKEN.

The form doors read their candidates from the effective form read alone;
the test doubles serve that read as the protocol does for an old-shape
fixture, through projectedFormsOf.

The effective form read pushes names down, resolves a package-less stored
form row at an old-shape address in the served-row order (one definition
per address), and the by-name read resolves the name once.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…eading, the bound and the form write doors

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…ead, and a form override's own text over its base's catalog

The cached plain read of GET /meta/:type/:name judges a form through the
per-caller read gate, as it judges a view, so a caller refused a form's
document at /meta/view/NAME is refused it at /meta/form/NAME.

A form gets a packaged-base accessor (getPackagedFormBase: the base's
authored form, else the form its old shape carries through the
projection), so an override's changed text outranks the base's catalog
on /meta/form and on the public door (ADR-0029 D9.2a).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
… ④ as the contact-us mover

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
… the registry row says what overlays a form, and the cross-type resolution has an anchor

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
… the file; the CRM pin loads the example by path

check-examples-live-imports read only a package's `#test` inputs, so a
repo-project file (hashed on `#test:repo`, #16466) read as invisible even
with its inputs declared. It now asks the task its package's
vitest.repo-tests.json assigns the file, with three self-test cases read off
rest's own split.

The CRM byte-equal pin loads the two example sources through
`new URL(...)`: a static import put them in rest's tsconfig.test.json zone,
whose rootDir is packages/. The form changeset names the publish and
restore refusals and the forms.NAME.sections keys.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-alice · session_011y7As8wf3DSPRevwNnYLcM

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 67af96fb676e6e2064098f83227d2aa3fab4c6c2
Local-runs: none
Scope: packages/spec/src/api/error-code-ledger.zod.ts, packages/spec/src/index.ts, packages/spec/src/kernel/collection-item-owner-stamp.ts, packages/spec/src/kernel/customization-package.ts, packages/spec/src/kernel/metadata-plugin.zod.ts, packages/spec/src/kernel/metadata-type-schemas.ts, packages/spec/src/meta-spelling/manifest-collection-spelling.ts, packages/spec/src/meta-spelling/meta-url-data.generated.ts, packages/spec/src/migrations/entries/semantic/18.form-type-define-form-and-packageless-list-at-form-name.ts, packages/spec/src/stack.zod.ts, packages/spec/src/system/i18n-resolver.ts, packages/spec/src/system/translation.zod.ts, packages/spec/src/ui/anonymous-form-intake.ts, packages/spec/src/ui/form-intake-layer.ts, packages/spec/src/ui/index.ts, packages/spec/src/ui/old-shape-form-withdrawals.ts, packages/spec/src/ui/view.zod.ts, skills/objectstack-platform/SKILL.md + packages/rest/src/form-routes.ts, packages/rest/src/meta-item-read-gate.ts, packages/rest/src/public-form-two-type-withdrawal.test.ts, packages/metadata-protocol/src/protocol-form-reads.ts, packages/metadata-protocol/src/protocol-form-writes.ts, packages/metadata-protocol/src/protocol-save.ts, packages/metadata-protocol/src/protocol-history-and-publish.ts, packages/metadata-protocol/src/protocol-diff-delete-load.ts, packages/metadata-protocol/src/protocol-meta-item-reads.ts, packages/metadata-protocol/src/protocol-meta-list-reads.ts, packages/metadata-protocol/src/protocol-packaged-base-refusal.ts, packages/metadata-protocol/src/protocol-authoring-gate.ts, packages/metadata-protocol/src/runtime-authoring-gate.ts, packages/metadata-protocol/src/protocol.ts, packages/lint/src/validate-form-items.ts, packages/lint/src/authoring-rules.ts, packages/lint/src/i18n-walk.ts, packages/lint/src/validate-translation-references.ts, packages/spec/liveness/form.json, packages/spec/src/kernel/metadata-credential-fields.test.ts, scripts/adr-anchors/packages__rest__src__form-routes.ts.json, scripts/adr-anchors/packages__spec__src__ui__old-shape-form-withdrawals.ts.json, scripts/check-skills-token-ratchet.mjs, scripts/check-stack-collection-maps.mjs, ui/scripts/check-spec-symbol-derivation.mjs, docs/qa/platform-checklist/coverage.json, examples/app-showcase/src/ui/forms/feedback.form.ts, .changeset/37086-form-metadata-type.md, .changeset/37086-form-type-console-strings.md, content/docs/references/api/protocol.mdx, content/docs/references/system/translation.mdx, packages/metadata-protocol/src/protocol-discovery-and-bases.ts, packages/rest/src/data-write-summary-recompute-other-doors.test.ts, packages/rest/src/form-old-shape-before.json, packages/rest/src/meta-dashboard-view-i18n-explicit-override.test.ts, packages/rest/src/meta-item-read-routes.ts, packages/rest/src/public-form-app-crm-byte-equal.test.ts, packages/rest/src/public-form-file-field.test.ts, packages/rest/src/public-form-intake-availability.test.ts, packages/rest/src/public-form-option-subset.test.ts, packages/rest/src/public-form-required.test.ts, packages/rest/src/public-form-routes.stored-row.test.ts, packages/rest/src/public-form-routes.test.ts, packages/rest/src/public-form-section-i18n.test.ts, packages/rest/src/public-form-submit-answer.test.ts, packages/rest/src/public-form-title-i18n.test.ts, packages/rest/src/public-form-withdrawal.test.ts, packages/rest/src/rest-write-route-hook-refusal-sentence.ledger.test.ts, packages/rest/vitest.repo-tests.json, packages/spec/liveness/state-counts/translation.md, packages/spec/liveness/translation.json, packages/spec/src/system/i18n-resolver.form-item.test.ts, scripts/adr-anchors/packages__metadata-protocol__src__protocol-form-reads.ts.json, scripts/check-examples-live-imports.mjs, scripts/cross-package-test-inputs.mjs, turbo.json
Security-touching: yes
Rule-change-verified: none

Delta round on PR #37422 (PR B of card #37086's fixed cut), base = PR A's branch claude/project-thread-pu5dnt, now 169 files, +5427 / -350, 23 commits. The previous record is 7184811209 on 97341d57da (FAIL: M1, M2). Read for this round: the card body and its eight comments, the PR body as it stands, the file list, the net diff against PR A's head cb854ea4d0, the delta 97341d57da..67af96fb67 (44 files, nine commits, one of them the merge of PR A), the 71 check-runs on this head, ADR-0159, and the cited code at this head. Nothing was built, run, re-run or ablated. The narrowing face holds, so every path of the diff is in the floor; the Scope: line is the previous one widened by every file the delta touches.

The security questions of the brief, answered first.

  • The read gate. By reading, /api/v1/meta/form/NAME refuses whom /api/v1/meta/view/NAME refuses, on each of the three arms. The default cached arm: audienceFolds in packages/rest/src/meta-item-read-routes.ts now holds form, so the protocol is not handed the conditional request, the per-caller judge runs before the validator is compared, and a refusal is sent before any body or any 304. The uncached arm: createMetaItemAnswer, the same judge. The list: the form arm of the shared list gate, which both transports ask. A projected item carries its view item's gate from both positions the view arm asks (the item's own and its config's), and a value that is not an array is read as no gate by both arms alike. No read door was found that serves a form to a caller the view door refuses.
  • Withdrawal on the read side. Nothing re-opens by reading: the doors make one candidate read (S1), the layer reads the effective and the per-package lists of both types, and the stand-in of S2 cannot drop a withdrawal because the view list still carries it.
  • One security item was found in this round: M3. The verdict is on it.

① Derived judgments

Each accept-set and public-surface change that moved since 97341d57da, named right or wrong. What the previous record judged and the delta did not move stands as judged there.

  • forms.NAME.sections in the bundle schema (packages/spec/src/system/translation.zod.ts): one factory, sectionTranslationSchema, builds both the object's _sections node and the form's own, so the two shapes cannot drift. Right (D8).
  • translateForm reads the form's own section node first and objects.OBJECT._sections.SECTION as the object-level default (lookupSectionText and lookupSectionEntryText take the form's name; packages/spec/src/system/i18n-resolver.ts). Right (D8). The lint half of the same decision did not move: S11.
  • The FORM_ADDRESS_TAKEN ledger comment ("the form save, draft promotion and restore doors refuse"): now true in the tree. Right (was M1).
  • formTypeWriteRefusal (protocol-form-writes.ts): the save door's two predicates, asked together by the publish of a draft and by the restore writer, each with its own envelope. Right.
  • getPackagedFormBase on the protocol, form in PackagedArtifactBaseType: a new protocol method, published in content/docs/references/api/protocol.mdx. It answers the authored form base, else the base's old-shape projection of the name, which is the base D5 serves. Right.
  • The door's one candidate source (packages/rest/src/form-routes.ts). Right (D6 rules 1 and 3).
  • One definition per address (readEffectiveFormList): a package-less stored form row whose name a package still ships as an old shape is served at that package's address, in the served-row order, and not beside it. Right against D5. Where a higher place in the order holds the address, the row is listed as its own package-less item; that is the order's answer, and a withdrawal in it still closes by name.
  • names on the effective form read, and the by-name read as one read. Right (S5, in part).
  • form in the cached read's audience fold. Right (item 2).
  • The coverage waiver, the registry-row comment, the liveness evidence, the new anchor file. Right (S7, N4, N3, N5).
  • Derived by the dev, for the seat: the examples coupling gate changes logic, not only data. Judged in ③.

② Semver level

  • .changeset/37086-form-metadata-type.md: text edits only in the delta (the forms.NAME.sections sentence, and the three doors of the address refusal). minor on the ten packages, Clause-②: yes (narrowing), Metadata-protocol: narrowed, the BREAKING banner and the one ADR-0087 marker are unchanged. Consistent with AGENTS.md and with Done-when. Both Check Changeset runs are green on this head.
  • .changeset/37086-form-type-console-strings.md: unchanged. S8 stays the seat's to rule.
  • The delta adds a protocol method (getPackagedFormBase) and a bundle branch (forms.NAME.sections). Both are additions inside a changeset that is already minor and narrowed; no level moves.

③ Boundary flags

  • Rework report 7187269150, open question 1 (is First-party sources author forms as form items: examples move to forms:, skills and docs teach forms: (ADR-0159, card ④a) #37088 card ④?): A, keep it. First-party sources author forms as form items: examples move to forms:, skills and docs teach forms: (ADR-0159, card ④a) #37088 is titled "(ADR-0159, card ④a)" and this card says the docs pages follow in First-party sources author forms as form items: examples move to forms:, skills and docs teach forms: (ADR-0159, card ④a) #37088; card ③ is Console reads and edits form items: Setup public forms re-pointed, the PR #36784 designer becomes the form editor in Studio (ADR-0159, card ③) #37087. The waiver's citation is right.
  • Open question 2 (two arms measured nowhere: destructive-still-shown-by.ts, and the copy names of a package rename or an unmanaged install): escalated, recommendation A, the seat files them as follow-up cards. Neither file is in the diff. The second is not cosmetic: FormSchema refuses a name whose prefix differs from object, so whether a copy that renames the object leaves a form it can still save should be measured before card ④ moves first-party sources to forms:.
  • The dev's S6 reading (the premise is stale): verified, see S6 below.
  • Coordination note 7184999056 (the Studio menu row for form, ADR-0084 amendment App Studio 改版(1-0):修订 ADR-0084(及 ADR-0146 的分工)——Studio 是开发软件包的入口、恢复软件包切换器、去掉顶栏、「概览」为菜单首项、专用色、顶栏各按钮的新位置 #37451): changes nothing here. form stays hidden in Studio's directory in this PR (ruled A in 7183329743); the placement row is card ③'s.
  • .claude/**: no path in the diff (169 files read). skills/objectstack-platform/SKILL.md is still the one line, forms in the top-level key enumeration, and is not in the delta. The header reads none.
  • Gate edits in the delta, named for the seat because each changes what a check lets through. (1) scripts/check-examples-live-imports.mjs, logic: a test file listed in its package's vitest.repo-tests.json is now asked of that package's test:repo input globs, not its test ones, with three new self-test cases. (2) scripts/cross-package-test-inputs.mjs and turbo.json: two examples/app-crm source paths declared as inputs of @objectstack/rest#test:repo. (3) packages/rest/vitest.repo-tests.json lists the new CRM pin. Judged right: the CRM pin reads the example's own sources, the repo project is where such a test belongs, and no lane is red on this head. None changes what an agent may do without the maintainer.
  • The earlier security item (the dev's out-of-scope finding, and the first report's security_findings: withheld): with the owner seat. Not discussed here.
  • Named, not made, unchanged: .claude/skills/spec-property-retirement, ui/docs/adr/0056, and ADR-0159 line 109, which resolves again onto a symbol with the opposite meaning of its sentence. All three are the seat's to order.
  • Check-runs on this head: 71 runs, 62 success, 9 skipped, none red, none running. Lint · docs & code guards is green here. On PR A's head cb854ea4d065c489e03a0d1b3b5bb9aeb8998626 the same lane is the only red (one gate of 52, check-adr-symbol-anchors, ADR-0159 line 109), so this PR restores it.
  • The dev's local results (the full package runs, R1 to R15) are the dev's. This review ran nothing; ④ reads the records against the test code.
  • SQL push-down (Prime Directive 5): S5 below. The delta adds no new read: the stand-in logic of readEffectiveFormList works on the lists already read, and the by-name read went from up to three reads to one. The holder read of the address refusal scans the effective forms in the application at two more doors; the slug it matches is derived by the projection across two types, so no stored predicate can carry it. Reason given, no finding.

④ Design judgment

Against ADR-0159 D5, D6, D8, ruled question 3 and the card's Done-when. The tree was read, not the PR body's account.

Earlier findings, by id, judged in the tree at this head.

  • M1: closed. saveMetaItemUnaudited asks both refusals in every save mode. promoteDraftForPublish asks formTypeWriteRefusal on the judged draft and the package it is promoted into, before repo.promoteDraft and under judgeOnly too, so a package publish asks it in both of its phases. restoredBodyWriter asks it through formRestoreRefusal, and restoreWriteFor is the one derivation a rollback and a commit revert share. The ledger comment is true. Publish and restore each have a pin with a control, and R10 and R11 remove exactly those calls.
  • M2: closed as a must-fix. Every pin the previous record named absent is in public-form-two-type-withdrawal.test.ts (48 tests) or public-form-app-crm-byte-equal.test.ts, by reading: 2b and its twin, where the form half of the layer is the only reader; served rows only, both fixtures; the two closed readings; the two bound pins; rule 9; declared_package_ships_no_such_item with its control; the old-shape write on a taken slug; publish and restore; the list row byte-equal across save, publish and reset and across delete; the reset and delete removals; the container re-saved; the failed write; the route pin; data.object; the GET /api/v1/meta/view fixture; CRM. The arm inventory and the per-run records (mutation diff, build exits, red titles, empty git diff HEAD) are in the body. Read against the test code, each of R1 to R15 names pins whose assertions do depend on the line it removes; R1 turns pin 2b, its twin and pin 5f red, which is the proof the previous record asked for. What is left is S10.
  • S1: closed. The door makes one form read; projectedFormsOf is gone from form-routes.ts; the doubles of the door tests answer the form read with the projection, as the protocol does.
  • S2: closed. Pinned by the one-definition pin (R13).
  • S3: closed in the schema and the translator (R15). The lint half is S11.
  • S4: closed. PACKAGED_BASE_ACCESSORS has the form row; pinned on /meta/form and on the public door (R12).
  • S5: still open (should-fix), narrowed. Done: names reaches both generic reads, at the point where the generic read applies a name filter for every type (after the merge); the by-name read is one unscoped read. Not pushed, and the stated reason is sound: packageId, for the two reasons in readEffectiveFormList's docblock, both checked in the tree (a declared override is re-keyed onto its base's address from the base's projected item, which a list scoped to the pair never holds; a view list scoped to a package seats package-less rows in that package's slots). Residual: each anonymous door request still repeats the view list and stored-row reads beside the form read. The reason given for that is the line ceiling of protocol.ts, which is a fact about a file and not about the read. The row sets come from the overlay row cache, so the cost is bounded. A follow-up card, the seat's to file.
  • S6: closed. The premise is stale and the dev says so with the reading. Verified: refuseOrganizationScopedWrite is the first statement of saveMetaItemUnaudited, and organizationScopedWriteRefusal answers 403 NOT_OVERRIDABLE for every non-empty organization, for every type. No organization layer can hold a withdrawal in either type. The rule 9 pin holds the form save and the view save to that one answer, nothing written, the doors still closed.
  • S7: closed. The waiver names the showcase's forms: [FeedbackForm] and card ④ as First-party sources author forms as form items: examples move to forms:, skills and docs teach forms: (ADR-0159, card ④a) #37088.
  • S8: still open (should-fix), as a ruling and not as work. The body now gives the reason for patch: in the two @object-ui packages no export is removed or retyped and no accepted input is refused. That is true of the diff by reading. Whether the card's "minor on every package the diff moves" binds that train is the seat's.
  • S9: closed. The body lists the SKILL.md row as done and cites the two rulings for the ceiling. The two records were not opened; the seat checks the citation.
  • N1: still open (nit), kept by the dev with a reason that holds: lint reads the authoring stack, and the base's consumers are not in it.
  • N2: still open (nit), kept. No exposure: the address is closed on both doors.
  • N3: closed. N4: closed. N5: closed.

New findings.

M3 (must-fix) — a security item is with the owner seat. It is new in this round and is not the item already there. No detail in this record.

S10 (should-fix) — Ablation records the card asks for and the body does not carry. None of these re-opens M2; each is a run Done-when or D5 names.

  • The per-package form layer (getMetaItemsPerPackage for form). A5f turned nothing red in round one and is not run again. By reading, pin 2b's twin is the pin that depends on it; a run would show it.
  • The bound. D5 (a) and Done-when spell the ablation as "letting the reading take any stored view row of the name; the doors answer 404". R5 removes the refusal instead. The reading's own bound has no run.
  • Ruled question 3. "Ablate: the switched-off half of the holder read" and "ablate: judge the clash on every form save" have no record.
  • Pin 1 turns red under no recorded run (A1, A8, R1). The body discloses it. The card says the unreadable-body and view-override pins are the ones that turn red when the exempt reader goes; A1 reddens pins 3, 5v and the narrowing pin.
  • The fixture form-old-shape-before.json is said to be captured on cb854ea4d by a test that is not in the tree. It reads as plausible and cannot be checked from the PR; the seat may want the capture command recorded.

S11 (should-fix) — packages/lint/src/i18n-walk.ts, packages/lint/src/validate-translation-references.ts: D8's last bullet has the extractor and the translation lint emit and accept the new family from card ②, and the family now has a sections branch. Neither file moved with S3. The walker emits a form item's section copy under objects.OBJECT._sections only, and the reference lint judges no forms.NAME.sections key: a key under a section the form does not declare is silent, and a section translated only under the form's own node is counted as missing where the walker's key is expected. Emitting the object-level default is defensible, since D8 keeps _sections live; the lint should still judge the new branch, or the seat names the card that owns it.

N6 (nit) — the publish refusal is pinned at the per-item publish door. A package publish asks the same promoter in both phases, by reading, and has no pin of its own.
N7 (nit) — the route pin drives the default cached by-name arm, which is the arm R14 removes. The uncached arm and the list arm of the form gate hold by reading only.
N8 (nit) — gatesOnItsOwnKey in packages/rest/src/rest-server.ts names view and dashboard and not form. The body's reason holds today: FormSchema is strict and declares no audience key, so no stored form row carries one. It stops holding the day the schema gains the key, and nothing in the code says so.

Files that hold. packages/spec/src/system/translation.zod.ts, system/i18n-resolver.ts, kernel/metadata-plugin.zod.ts, packages/spec/liveness/form.json and liveness/translation.json: each agrees with the decision it implements. packages/rest/src/form-routes.ts, meta-item-read-gate.ts, meta-item-read-routes.ts, the packages/metadata-protocol/src files of the Scope: line, the new anchor file, the coverage waiver and the three gate edits of ③: each holds as read against the earlier finding it closes. The findings on them are the ones graded above; M3 is not located in this record.

One must-fix. The verdict is on M3; the four should-fix items (S5, S8, S10, S11) do not carry it.

Implemented-by: claude/project-thread-pu5dnt-b
Reviewed-by: l2d-37086 subagent of session_011y7As8wf3DSPRevwNnYLcM

VERDICT: FAIL

…vert put back the old-shape rows a form write removed

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
… leave the old-shape row as it was, on an engine that cannot roll back

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…udged at its own forms node, the object-level slot its default

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…e row removal and the forms sections translation family in lint and cli

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…ape row restore among the hand-series module writers

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
… cache it filled

A read inside a transaction can cache that transaction's own uncommitted
sys_metadata rows at the generation its earlier writes already moved; a
driver rollback undoes the rows below the middleware seam, so nothing moved
the generation again and the entry stood until the TTL. Every transaction
the protocol opens (the package publish batch, the form-aware publish, save
and delete, the repository's write unit, the atomic data batch) now goes
through retireOverlayCacheOnRollback, which advances the generation when the
transaction fails after moving it.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq
…an engine that can roll back leaves nothing of the batch served

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As9cjn4Y9vAUQbVH4fq

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:system protocol:ui size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants