Skip to content

fix(objectql): MetadataFacade reads return the stored document — content is a real authorable field, not a storage envelope - #8377

Merged
os-zhuang merged 2 commits into
mainfrom
claude/issue-7519-facade-content-unwrap
Aug 13, 2026
Merged

fix(objectql): MetadataFacade reads return the stored document — content is a real authorable field, not a storage envelope#8377
os-zhuang merged 2 commits into
mainfrom
claude/issue-7519-facade-content-unwrap

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Fixes#7519

What

MetadataFacade.get, list, and listNames unwrapped every stored item through the content-or-item fallback (and a content-dot-name fallback limb in listNames), presuming content marked the facade's own storage envelope. But content is a real authorable field — packages/spec/src/system/doc.zod.ts declares it as the doc's required raw-Markdown body (line 92 at HEAD, located by symbol), and packages/spec/src/ai/knowledge-document.zod.ts declares it on both of its shapes — so register('doc', name, document) followed by get('doc', name) answered the Markdown string instead of the document: truthy, string-typed, silent. That is exactly the silent non-round-trip the #7378 three-cell ruling (2026-08-12) forbids: register(t, n, d) then get(t, n) round-trips or refuses loudly.

All three reads now return the stored document verbatim.

Why removal, not a renamed envelope

The envelope the unwrap presumed has no producer — measured, not assumed:

With no envelope on any write path, an unwrap on the read path can only corrupt. And because no replacement envelope key is introduced, there is no next authorable key to collide with — the collision surface is gone, not moved. This is a restore-the-invariant change riding the #7378 ruling, not a second envelope beside it.

Both directions pinned

Reverse verification — direction predicted before running

Predicted: with the unwrap restored from origin/main, the get-document, list, knowledge_document, and conformance (MetadataFacade subject only) pins go red; listNames / exists / getEntry / content-less pins stay green, because those members already answered name-carrying documents correctly. Observed exactly that: 4 failed, 98 passed. Fix restored from the committed branch, not from working-tree memory.

Blast radius

Re-measured at HEAD: new MetadataFacade appears only in test files and one migration doc — no production caller constructs one. The defect stays dormant until a host wires the facade; the class is exported from the package root, so downstream hosts pick up the fix via the changeset (patch, @objectstack/objectql).

Verification

  • Full @objectstack/objectql suite: 196 files, 3506 tests, all green.
  • pnpm --filter @objectstack/objectql typecheck clean.
  • Gates: check:durability-log-level, check:engine-double-contract, check-engine-split-ratio (informational), check:query-options-erasure (test-surface ceiling unchanged), check:type-check-coverage, check:nul-bytes — all green; dispatch-gates.mjs re-derived on the changed paths names no family beyond these.

Generated by Claude Code

…ent is a real authorable field, not a storage envelope (#7519)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RDTnVvsgA6cUZ4xFVtPZRy
@vercel

vercelBot commented Aug 13, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
objectstackIgnoredIgnoredAug 13, 2026 10:05am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/objectql.

15 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/concepts/metadata-lifecycle.mdx(via @objectstack/objectql)
  • content/docs/data-modeling/formulas.mdx(via packages/objectql)
  • content/docs/deployment/migration-from-objectql.mdx(via @objectstack/objectql)
  • content/docs/deployment/vercel.mdx(via @objectstack/objectql)
  • content/docs/kernel/contracts/data-engine.mdx(via @objectstack/objectql)
  • content/docs/kernel/runtime-services/examples.mdx(via packages/objectql)
  • content/docs/kernel/services-checklist.mdx(via @objectstack/objectql)
  • content/docs/kernel/services.mdx(via @objectstack/objectql)
  • content/docs/permissions/authentication.mdx(via @objectstack/objectql)
  • content/docs/permissions/system-context.mdx(via packages/objectql)
  • content/docs/plugins/index.mdx(via @objectstack/objectql)
  • content/docs/plugins/packages.mdx(via @objectstack/objectql)
  • content/docs/protocol/kernel/index.mdx(via @objectstack/objectql)
  • content/docs/protocol/objectql/query-syntax.mdx(via packages/objectql)
  • content/docs/protocol/objectql/state-machine.mdx(via @objectstack/objectql)

1 release-owned page(s) also reference the affected code. These are read-only:

  • content/docs/releases/implementation-status.mdx(via @objectstack/objectql)

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@github-actionsgithub-actionsBot added documentation Improvements or additions to documentation tests tooling labels Aug 13, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review August 13, 2026 10:51
@os-zhuang
os-zhuang added this pull request to the merge queueAug 13, 2026
@github-merge-queue
github-merge-queueBot removed this pull request from the merge queue due to failed status checks Aug 13, 2026
@os-zhuang
os-zhuang added this pull request to the merge queueAug 13, 2026
Merged via the queue into main with commit fdca3a1Aug 13, 2026
26 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-7519-facade-content-unwrap branch August 13, 2026 11:48
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/mteststooling

Projects

None yet

2 participants

@os-zhuang@claude