Skip to content

Commit 7aec120

Browse files
committed
docs(spec): keep the ruling id out of the customer-facing droppedFields string
`check:doc-authoring` refuses an internal issue id inside customer-facing spec text, and the rewritten `.describe()` had put one there: a `.describe()` string projects into `content/docs/references/**` and the generated skill artifacts, whose readers have no tracker to resolve `#NNNN` against. The id moves to an adjacent `//` comment — the placement the gate itself prescribes for a reference that is load-bearing for an internal reader — and the customer-facing sentence now states the mechanism directly instead of citing the ruling that produced it, which is what a caller reading the field can act on. Claude-Session: https://claude.ai/code/session_016N6xmWt5hYm94ffVEwGH8x Co-authored-by: Claude <noreply@anthropic.com>
1 parent bb4f181 commit 7aec120

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

content/docs/references/api/protocol.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ A write-path strip event: caller-supplied fields legally dropped from the payloa
569569
| **object** | `string` || Object name |
570570
| **records** | `Record<string, any>[]` || Created records |
571571
| **count** | `number` || Number of records created |
572-
| **droppedFields** | `{ object: string; fields: string[]; reason: Enum<'readonly' \| 'readonly_when' \| 'primary_key'> }[]` | optional | Write-observability: caller-supplied `readonly` fields the in-engine create-side strip (`engine.insert`, `isSystem`-gated) removed before the rows were written. AGGREGATED across the batch (one event per object/reason with the UNION of dropped field names) rather than per-row, because this response is `{ object, records, count }` and has no per-row slot to hang a drop set on — a union is the only view it can represent. So read a name here as "at least one row dropped this field", NOT "every row dropped the same set": since ruling C (#14147) the strip runs INSIDE `engine.insert` after the `beforeInsert` hooks and exempts keys a hook itself wrote, tracked per row, so rows a hook stamped differently drop different sets. Present ONLY when ≥1 field was dropped; the creates still succeeded without them (count/success unchanged). Optional — omit-when-empty keeps the shape backward-compatible. (The per-row `insertMany`/`batch` paths carry per-row `droppedFields` on each result instead — see BatchOperationResultSchema.) |
572+
| **droppedFields** | `{ object: string; fields: string[]; reason: Enum<'readonly' \| 'readonly_when' \| 'primary_key'> }[]` | optional | Write-observability: caller-supplied `readonly` fields the in-engine create-side strip (`engine.insert`, `isSystem`-gated) removed before the rows were written. AGGREGATED across the batch (one event per object/reason with the UNION of dropped field names) rather than per-row, because this response is `{ object, records, count }` and has no per-row slot to hang a drop set on — a union is the only view it can represent. So read a name here as "at least one row dropped this field", NOT "every row dropped the same set": the strip runs INSIDE `engine.insert` after the `beforeInsert` hooks and exempts keys a hook itself wrote, tracked per row: rows where a hook stamped a protected key drop a different set from rows where it did not. Present ONLY when ≥1 field was dropped; the creates still succeeded without them (count/success unchanged). Optional — omit-when-empty keeps the shape backward-compatible. (The per-row `insertMany`/`batch` paths carry per-row `droppedFields` on each result instead — see BatchOperationResultSchema.) |
573573

574574
### Nested Shape: `CreateManyDataResponse.droppedFields[number]`
575575

packages/spec/src/api/protocol.zod.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2354,16 +2354,20 @@ export const CreateManyDataResponseSchema = lazySchema(() => z.object({
23542354
object: z.string().describe('Object name'),
23552355
records: z.array(z.record(z.string(), z.unknown())).describe('Created records'),
23562356
count: z.number().describe('Number of records created'),
2357+
// The per-row read below is maintainer ruling C (#14147): the static-`readonly` strip
2358+
// moved into `engine.insert`, after `beforeInsert`, exempting keys a hook wrote
2359+
// (`rowHookWrittenKeys`). The id stays in this comment, never in the `.describe()` —
2360+
// that string is printed AT the customer, who has no tracker to resolve it.
23572361
droppedFields: z.array(DroppedFieldsEventSchema).optional().describe(
23582362
'Write-observability: caller-supplied `readonly` fields the in-engine create-side ' +
23592363
'strip (`engine.insert`, `isSystem`-gated) removed before the rows were written. AGGREGATED across the batch ' +
23602364
'(one event per object/reason with the UNION of dropped field names) rather than per-row, ' +
23612365
'because this response is `{ object, records, count }` and has no per-row slot to hang a ' +
23622366
'drop set on — a union is the only view it can represent. So read a name here as "at least ' +
2363-
'one row dropped this field", NOT "every row dropped the same set": since ruling C (#14147) ' +
2364-
'the strip runs INSIDE `engine.insert` after the `beforeInsert` hooks and exempts keys a ' +
2365-
'hook itself wrote, tracked per row, so rows a hook stamped differently drop different ' +
2366-
'sets. Present ONLY when ≥1 field was dropped; the creates still succeeded ' +
2367+
'one row dropped this field", NOT "every row dropped the same set": the strip runs INSIDE ' +
2368+
'`engine.insert` after the `beforeInsert` hooks and exempts keys a hook itself wrote, ' +
2369+
'tracked per row: rows where a hook stamped a protected key drop a different set from ' +
2370+
'rows where it did not. Present ONLY when ≥1 field was dropped; the creates still succeeded ' +
23672371
'without them (count/success unchanged). Optional — omit-when-empty keeps the shape ' +
23682372
'backward-compatible. (The per-row `insertMany`/`batch` paths carry per-row `droppedFields` ' +
23692373
'on each result instead — see BatchOperationResultSchema.)'

0 commit comments

Comments
 (0)