Skip to content

docs(kernel): align data-engine contract page with the shipped engine seam (#7057) - #7173

Merged
os-help merged 1 commit into
mainfrom
claude/issue-7057-data-engine-docs-drift
Aug 10, 2026
Merged

docs(kernel): align data-engine contract page with the shipped engine seam (#7057)#7173
os-help merged 1 commit into
mainfrom
claude/issue-7057-data-engine-docs-drift

Conversation

@os-help

@os-help os-help commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Fixes #7057

Docs-only. Three measured divergences on content/docs/kernel/contracts/data-engine.mdx, each re-derived against origin/main (@ 5087ac6) rather than against the issue's line anchors — the file moved twice on 2026-08-09 (#7125, then the tree advanced again during this task).

1 + 2. EngineQueryOptions.cursor and query-level distinct — retired by #4286

Both were still listed as live members of the interface. They are not merely gone from the schema: packages/spec/src/data/data-engine.zod.ts keeps a retiredKey() tombstone for each, so a query carrying one is rejected by name. The page was telling readers to write a key the engine refuses — copy-the-docs-and-fail, exactly the class the triage ruling named.

Both lines are removed from the code block and replaced by a Removed in protocol 17 subsection carrying each tombstone's own migration prescription:

  • cursor — express the keyset as an ordinary where predicate on your sort key with the matching orderBy; QueryBuilder.cursor() went with it.
  • distinctdistinct(object, field) on the SQL/memory drivers, groupBy for unique combinations, the count_distinct aggregation for a deduplicated count.

The prose follows this file's own house style for a removal (the AggregationNode.distinct note added by PR #7051 sits ~200 lines below).

3. WriteObservabilityOptions — stopped at #3407

The PM's dispatch table called this row "partly overtaken by #7125". Measured, that is right for the code block and wrong for the prose, so the repair is larger than the table implies:

Sub-divergence State found on origin/main
reason enum missing primary_key already repaired by #7125 — left alone
strictReadonlyWrites absent from the code block still absent (#5126)
"The write still succeeds" unconditional still unconditional — false under strict
Prose strip list names only the two author-declared strips still stale#7125 repaired the enum in the code block but not the sentence above it, so the runtime-owned strip (#5503) and the primary-key strip (#6437) were still unmentioned in prose

Rewritten against packages/spec/src/contracts/data-engine.ts (read-only for this card):

The layering claim was verified, not relayed. The issue thread suggested carrying over the engine-seam vs DataProtocol-ingress distinction (#3043 / #6640). packages/metadata-protocol/src/protocol.ts stripReadonlyForInsert confirms it in code: the ingress enforces its own author-declared readonly policy on create, knows only isSystem, deliberately does not read preserveAudit (#6640), and leaves runtime-owned types to the engine strip (#5503). That is what the new Callout says, and it says nothing wider.

Verification

Premise confirmed at the schema level, then reverse-verified by parsing (a probe run against EngineQueryOptionsSchema, not committed):

cursor   => success: false   msg: `query.cursor` was removed in @objectstack/spec 17 (#4286, ADR-0049) — no driver ever implemented keyset pagination...
distinct => success: false   msg: `query.distinct` was removed in @objectstack/spec 17 (#4286, ADR-0049 / ADR-0078) — no driver ever rendered SELECT DISTINCT...
control (no retired key) => success: true

Gates run locally (docs-facing families for this surface; the full farm is CI's):

  • pnpm check:doc-authoring — green, 374 files clean
  • pnpm check:docs-audit-scope — green, 179 hand-written docs in sync
  • pnpm --filter @objectstack/lint run check:doc-formula-expressions — green, 22 examples across 387 files
  • pnpm --filter @objectstack/spec run check:skill-examples — green, 209 prose examples type-check; the edited block is in the checked set (content/docs/kernel/contracts/data-engine.mdx:311), since the WriteObservabilityOptions fence carries the os:check marker
  • node scripts/check-nul-bytes.mjs — green

Scope notes


Generated by Claude Code

… seam (#7057)

Three measured divergences on content/docs/kernel/contracts/data-engine.mdx,
all verified against origin/main rather than the issue's line anchors.

1. `EngineQueryOptions.cursor` and 2. query-level `distinct` were retired by
   #4286 (ADR-0049 / ADR-0078) but were still listed as live members of the
   interface. They are not merely absent from the schema: `retiredKey()`
   tombstones REJECT them by name, so a reader copying this block wrote a query
   the engine refuses. Both lines are removed from the code block and replaced
   by a "Removed in protocol 17" subsection carrying each tombstone's own
   migration prescription (keyset as a `where` predicate on the sort key;
   `distinct(object, field)` / `groupBy` / `count_distinct`).

3. The `WriteObservabilityOptions` section stopped at #3407 and never learned
   #5126's `strictReadonlyWrites` — absent from both prose and the code block —
   so "The write still succeeds" read unconditionally where strict refuses the
   write with ERR_READONLY_FIELD_REJECTED. The strip enumeration also still
   named only the two author-declared strips, missing the runtime-owned strip
   (#5503, the one that also runs on INSERT) and the primary-key strip (#6437),
   even though #7125 had already repaired the `reason` enum in the code block.

   The section is rewritten against packages/spec/src/contracts/data-engine.ts:
   a strip table (strip / reason / verbs / writers it skips), the two options as
   alternative outputs of one seam (`onFieldsDropped` does NOT fire on a refused
   write), the INSERT rule and its two exempt writers, and the engine-seam vs
   DataProtocol-ingress layering note (#3043; `preserveAudit` is UPDATE-only at
   the ingress, #6640) — that layering verified in metadata-protocol's
   `stripReadonlyForInsert`, not taken on trust. The in-process-only Callout now
   covers the whole bag, since a client toggling write-refusal is the specific
   thing #5126 ruled out.

Docs-only; no package behaviour changes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KJATVrh6V2ysutYUJigh3B
@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Aug 10, 2026 1:46am

Request Review

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation labels Aug 10, 2026
@os-help os-help added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Aug 10, 2026 — with Claude
@os-help
os-help marked this pull request as ready for review August 10, 2026 02:04
@os-help
os-help added this pull request to the merge queue Aug 10, 2026
Merged via the queue into main with commit 52c9cab Aug 10, 2026
25 checks passed
@os-help
os-help deleted the claude/issue-7057-data-engine-docs-drift branch August 10, 2026 02:16
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 size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: data-engine.mdx still documents EngineQueryOptions.cursor and query-level distinct — both retired by #4286

2 participants