Skip to content

Commit a8f0853

Browse files
os-muskclaude
andauthored
docs(objectql): the last two carriers of the falsified "schema-uniform" premise state what the tree does (#17717)
* docs(objectql): the last two carriers of the falsified "schema-uniform" premise state what the tree does `engine.insert`'s per-call `preserveAudit` warning and the docblock of `preserveAuditIgnoredOnInsertWarning` both justified a batch-level union with "the strip is schema-uniform". Maintainer ruling C (#14147) falsified that: the static-`readonly` strip runs INSIDE `engine.insert`, after the `beforeInsert` hooks, and exempts keys a hook itself assigned — armed per ROW (`hookWrittenKeys: rowHookWrittenKeys[i]`), so two rows can lose different sets. The aggregation is unchanged and stays right on the reason the producer already has: a log line has no per-row slot, so the union is the only view one line can represent. Both sites now say that and tell a reader how to read a name — "at least one row lost this field", never "every row did". `rule-validator.ts` contradicted itself: its `hookWrittenKeys` option docs state "Per ROW, never per call" ~240 lines above the sentence that claimed uniformity. The file now gives one answer. Claude-Session: https://claude.ai/code/session_01RuoNSXUbBoWHkNS4AknTrM Co-authored-by: Claude <noreply@anthropic.com> * chore: changeset for the objectql schema-uniform carrier correction Claude-Session: https://claude.ai/code/session_01RuoNSXUbBoWHkNS4AknTrM Co-authored-by: Claude <noreply@anthropic.com> * chore: drop the changeset — this diff publishes nothing from a released package Maintainer ruling on the open question: `skip-changeset` is defined as the label for a diff that publishes nothing from any released package, and this diff is one. Measured two independent ways: - `engine.ts` carries an inline `//` comment inside a method body, never emitted to a `.d.ts` under any configuration. - `rule-validator.ts`'s docblock is on `preserveAuditIgnoredOnInsertWarning`, exported from its module but NOT re-exported from `packages/objectql/src/index.ts`, so it never reaches `dist/index.d.ts`. Control: that entry re-exports three other symbols from the same file, so it is selective, not empty. - After a real build, `dist/` greps 0 for both the old and the new text while the positive control (the runtime string literal from the same function) hits 4 files. The prior comment-only changesets are not precedent for "comment-only ⇒ patch": each measured that its corrected TSDoc DOES reach the built `.d.ts`. Same rule, opposite measurement. Claude-Session: https://claude.ai/code/session_01RuoNSXUbBoWHkNS4AknTrM Co-authored-by: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent ab37ded commit a8f0853

2 files changed

Lines changed: 21 additions & 5 deletions

File tree

‎packages/objectql/src/engine.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10636,8 +10636,14 @@ export class ObjectQL implements IObjectQLEngine {
1063610636
rowHookContexts[i].input.data = stripped;
1063710637
}
1063810638
// One line per CALL, not per row, and only when the exemption was
10639-
// ASKED FOR and something was actually removed — the union is
10640-
// faithful because the strip is schema-uniform.
10639+
// ASKED FOR and something was actually removed. Per CALL because a
10640+
// log line has no per-row slot: the union of what the batch lost is
10641+
// the only view one line can represent — ⛔ NOT because every row
10642+
// lost the same set. `hookWrittenKeys: rowHookWrittenKeys[i]` above
10643+
// is armed per ROW and its only power is to turn a strip into a
10644+
// KEEP, so a hook that stamps a protected key on some rows and not
10645+
// others makes those rows lose DIFFERENT sets. Read a name in this
10646+
// line as "at least one row lost this field", never "every row did".
1064110647
if (preserveAuditIgnored.length > 0) {
1064210648
this.logger.warn(preserveAuditIgnoredOnInsertWarning(object, preserveAuditIgnored));
1064310649
}

‎packages/objectql/src/validation/rule-validator.ts‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,9 +1652,19 @@ export function staticReadonlyInsertSubject(
16521652
* "the exemption you requested does not exist on this path". This says the
16531653
* second one, by name. It fires ONLY when `preserveAudit` was requested AND
16541654
* something was actually removed — a request that loses nothing has nothing to
1655-
* report — and one line per CALL, not per row: the strip is schema-uniform, so
1656-
* the union of what the batch lost is the faithful signal (the same aggregation
1657-
* `onFieldsDropped` already applies).
1655+
* report — and one line per CALL, not per row, because a log line has no
1656+
* per-row slot: the union of what the batch lost is the only view one line can
1657+
* represent (the same aggregation `onFieldsDropped` already applies, and reads
1658+
* the same way).
1659+
*
1660+
* ⚠️ So read a name in this line as "AT LEAST ONE row lost this field", never
1661+
* "every row lost the same set". The strip is NOT uniform across a batch:
1662+
* `engine.insert` hands {@link stripReadonlyFields} the option
1663+
* `hookWrittenKeys: rowHookWrittenKeys[i]` (maintainer ruling C, #14147) — one
1664+
* recording armed per ROW, whose only power is to turn a STRIP into a KEEP — so
1665+
* a hook that stamps a protected key on some rows and not others makes those
1666+
* rows lose DIFFERENT sets. That is the granularity both `hookWrittenKeys`
1667+
* option docs above already state.
16581668
*/
16591669
export function preserveAuditIgnoredOnInsertWarning(object: string, fields: readonly string[]): string {
16601670
return (

0 commit comments

Comments
 (0)