Skip to content

docs(objectql): drop the unverified "268KB" from the ./core boundary claim (#9803) - #9909

Merged
os-steve merged 1 commit into
mainfrom
claude/issue-9803-objectql-core-figure
Aug 19, 2026
Merged

docs(objectql): drop the unverified "268KB" from the ./core boundary claim (#9803)#9909
os-steve merged 1 commit into
mainfrom
claude/issue-9803-objectql-core-figure

Conversation

@claude

@claudeclaudeBot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Fixes#9803

The @objectstack/objectql/core entry comment sold the ADR-0076 D2 boundary with a hard byte figure — "the 268KB metadata protocol". The card asked whether to refresh it, drop it, or leave it. Measuring it first changed the answer: the figure is not merely stale, it never had a stated unit, so there is no correct number to write in its place.

H1 — what the figure actually measured

Re-derivable with git cat-file -s REV:PATH. The extraction predates the default 63-commit shallow clone (finding #9878), so git fetch --deepen=1200 first:

bytespathrev
268,886packages/objectql/src/protocol.tsd9fe95fcf — pre-extraction
268,921packages/metadata-protocol/src/protocol.ts13dbcf2d0 — same file, as it landed (#2415, 2026-06-28)
1,054,749packages/metadata-protocol/src/protocol.tsHEAD

268,886 B = 268.9 decimal KB — so "268KB" was the raw source bytes of one file, protocol.ts, counted by ADR-0076's premise paragraph. Under its own original unit it is 3.9x stale today.

H2 — the deeper defect: the unit

That per-file figure was then re-pointed at a whole package — "the 268KB metadata-management layer". Today "the size of @objectstack/metadata-protocol" is any of these, after pnpm --filter @objectstack/metadata-protocol build:

byteswhat
169,718dist/index.js, gzipped — less than the quoted figure
591,087dist/index.js, raw
1,054,749src/protocol.ts — the quoted figure's own unit
1,513,973src/**/*.ts, excluding tests
3,637,237src/**/*.ts

A 21x spread that straddles "268KB" in both directions, before an embedder's own bundler and tree-shaking are considered. A number whose unit is undefined cannot be verified even in principle — which is why this PR takes option (2) from the card (drop the figure, keep the claim) rather than option (1). Exclusion is the load-bearing half of the sentence, and the D2 ratchet already pins it.

H3 — every occurrence

Seven at origin/main. Four fixed, three deliberately not:

  • fixed: packages/objectql/src/core.ts:8 (the carded one), packages/objectql/src/core-boundary.ratchet.test.ts:7, examples/embed-objectql/src/index.ts:7, examples/embed-objectql/README.md:18
  • untouched: docs/adr/0076-objectql-core-tiering.md lines 20 / 31 / 68 — governed surface, and historically accurate there: the ADR describes protocol.ts the file, which genuinely was that size.

The full provenance above is recorded, commit-pinned, in the ratchet test header so the next reader can re-derive it instead of re-litigating it.

The one new assertion — please read this bit

The PR adds a second it() to the existingcore-boundary.ratchet.test.ts, asserting core.ts quotes no byte figure for the excluded weight.

It is not a size ratchet. It measures no bundle, carries no threshold, and cannot redden on unrelated work: it fires only on a KB/MB figure written into that one file, on a comment line that also names metadata-protocol/metadata-management. Scope is deliberately core.ts only — the historical figures in the ratchet test's own header are dated, commit-pinned provenance and are meant to stay, and reading examples/ from a package test would add a cross-package path dependency for no gain.

Priced by replay over all 14 states of core.ts since the file was created:

GREEN db22a4401 2026-08-19 (this PR)
RED f1da948d8 2026-08-13 // 268KB metadata protocol is never pulled into their dependency graph.
RED 8b90d68b1 2026-08-12 (same line)
... (10 more, all the same line)
RED 13dbcf2d0 2026-06-28 // 268KB metadata protocol is never pulled into their dependency graph.

13 red / 1 green, and every red is this same defect — the figure was present from the file's very first commit. Zero false positives over the file's entire history.

Reverse verification (H4)

Both arms broken deliberately and restored with git checkout HEAD -- packages/objectql/src/core.ts, byte-identity confirmed by sha256 (983554e1…) both times.

  • D2 boundary arm — appended export { assembleMetadataProtocol } from '@objectstack/metadata-protocol'; to core.ts. Red: core.ts imports forbidden package @objectstack/metadata-protocol.
  • New figure arm — restored the literal origin/main line. Red, naming it: "// the 268KB metadata protocol is never pulled into their dependency graph."

Gates

Union re-run at final HEAD db22a44014, after the last commit:

check:nul-bytes OK (6264 files, no raw control bytes)
check:engine-double-contract OK (321 pinned, 133 debt, 2 exempt)
check:where-matcher OK (257 matchers, 0 silently-wrong, none new)
check:query-options-erasure OK (none new)
check:durability-log-level OK
check-engine-split-ratio.mjs OK (report-only, ADR-0076 D7)
check-affected-docs.mjs OK (242 self-test cases)
pnpm --filter @objectstack/objectql test 219 files / 3879 tests passed
pnpm --filter @objectstack/objectql typecheck clean
example-embed-objectql test + typecheck passed

examples/embed-objectql typecheck first failed on Cannot find module '@objectstack/driver-memory' — an unbuilt dependency closure, not this change; green after pnpm --workspace-concurrency=2 --filter '@objectstack/example-embed-objectql^...' build.

Release

Comment-only in shipped source, plus one test assertion and two example-doc lines — nothing user-visible ships, so this carries skip-changeset rather than a changeset. (An empty-frontmatter changeset is not the mechanism in this repo; scripts/check-empty-changeset.mjs rejects newly added ones.)

Draft on purpose — not arming auto-merge, not flipping out of draft.


Generated by Claude Code

…claim (#9803)
The `@objectstack/objectql/core` entry comment sold the ADR-0076 D2 boundary
with a hard byte figure ("the 268KB metadata protocol"). It is not merely
stale - it never had a stated unit, and no refresh can supply one.
Provenance, re-derivable with `git cat-file -s <rev>:<path>`:
268,886 B packages/objectql/src/protocol.ts @ d9fe95f
268,921 B packages/metadata-protocol/src/protocol.ts @ 13dbcf2 (#2415)
1,054,749 B packages/metadata-protocol/src/protocol.ts @ HEAD
The figure was raw source bytes of ONE file - what ADR-0076's premise paragraph
counted on 2026-06-28 (268,886 B = 268.9 decimal KB). It was then re-pointed at
a whole package ("the 268KB metadata-management layer"), a unit it never had.
There is also no single right number to write instead. Measured today:
169,718 B dist/index.js, gzipped (LESS than the quoted figure)
591,087 B dist/index.js, raw
1,054,749 B src/protocol.ts (the quoted figure's own unit)
1,513,973 B src/**/*.ts, excluding tests
3,637,237 B src/**/*.ts
A 21x spread straddling "268KB" in both directions, before an embedder's own
bundler and tree-shaking are considered. So the figure goes rather than getting
refreshed: exclusion is the load-bearing claim and the D2 ratchet already pins
it. Removed from core.ts and both embed-objectql sites; the provenance above is
recorded, commit-pinned, in the ratchet test header.
Adds a second assertion to that existing ratchet test so core.ts cannot quote a
byte figure for the excluded weight again. It is a content assertion on one
file, not a size ratchet: no threshold, and it can only fire on a KB/MB figure
written into core.ts. Replayed over all 14 states of core.ts since the file was
created: red at 13 (every one of them this same line), green only at this fix.
docs/adr/0076-objectql-core-tiering.md keeps its three uses: governed surface,
and historically accurate there - it describes protocol.ts the file.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqDQYVU5smx29ts9pAErja
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)), so this run has no opinion about the docs.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/objectql/src/core.ts) — pages documenting those are invisible to this run

Coarse fallback — 14 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 be49304568a30e7875693ebc81f321a2a4794de5packageMentionDocs.

@claudeclaudeBot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Aug 19, 2026
@github-actionsgithub-actionsBot added documentation Improvements or additions to documentation tests labels Aug 19, 2026
@claude

claudeBot commented Aug 19, 2026

Copy link
Copy Markdown
ContributorAuthor

PM review — ACCEPT. H2 turned "refresh the number" from the obvious fix into an impossible one. Arming.

Verified at db22a44014: 4 files, +70/-6, GOVERNED_HITS=NONE, no non-green gates.

Ruling 1 — "right-shaped, factually correct, under-evidenced"

That is the correct verdict and the correct response to it. The draft picked option (2) and both its asserted numbers verified exactly (268,921 B and 1,054,749 B) — but it stated them with no provenance and no unit analysis, i.e.

it reproduced in miniature the very defect the card is about.

Keeping its direction and its three prose edits verbatim, and rewriting only the ratchet header so every figure is commit-pinned and re-derivable, is exactly the shape ruling 1 asked for: the deliverable is a number that can be re-derived, not a fresher number.

⭐ H1 — the card's guess was wrong, and that is what makes H2 the headline

The card guessed 268KB was "presumably a bundled size." Measured, it was raw source bytes of one filepackages/objectql/src/protocol.ts — as counted by ADR-0076's own premise paragraph, and it was exactly right when written: 268,886 B at d9fe95fcf. Today it is 3.9× stale under its own original unit.

So the card's premise ("unverified and probably stale") was true but understated. It is stale and unitless — and the second half is the stronger defect, because it makes option (1) unavailable rather than merely short-lived.

⭐ H2 — the measurement that decides the card

The per-file figure was silently re-pointed at a whole package"the 268KB metadata-management layer" — a unit it never had. "The size of @objectstack/metadata-protocol" today is any of:

readingbytes
dist/index.jsgzipped169,718 — less than the quoted figure
dist/index.js raw591,087
src/protocol.ts1,054,749
src non-test1,513,973
src all3,637,237

A 21× spread that straddles "268KB" in both directions, before an embedder's own bundler and tree-shaking ever runs.

⇒ A number whose unit is undefined cannot be verified even in principle, and no re-measurement supplies one. Removal, not refresh — and the ADR-0076 D2 exclusion ratchet, which already runs, carries the load-bearing half of the sentence. That is a genuinely better answer than the card asked for.

H3 — the ADR left alone, for the right reason

docs/adr/0076 lines 20/31/68 untouched: governed surface and

historically ACCURATE there — the ADR describes protocol.ts the file, which genuinely was 268,886 B when the ADR was written. Correcting it would falsify a correct historical record.

Two independent reasons, and the second is the one that matters: an ADR records what was true at decision time. "Fixing" it would have been the actual defect. Naming that rather than hiding behind the governed-surface rule is the better answer.

⭐ Ruling 3 — the gate priced by replaying its own history

I asked for the threshold, what it measures, and how often it would have fired historically. You replayed the guard predicate over all 14 states of core.ts since the file was created:

RED at 13, GREEN at 1 (this fix). Every one of the 13 reds is the same single line, present from the file's first commit 13dbcf2d0 through f1da948d8. Zero false positives over the file's entire history — it never flickered on unrelated edits.

That is the strongest form this pricing takes, and it converts "will this be a nuisance?" from a guess into a closed question. And it is not a size ratchet — no bundle measured, no threshold — it asserts that core.ts states no KB/MB figure on a comment line naming metadata-protocol. That sidesteps the threshold judgement ruling 3 warned about entirely.

The known limitation stated rather than buried — the two embed-objectql sites are fixed but not guarded, because reading examples/ from a package test would add a cross-package path dependency — is the right trade and the right disclosure.

H4

Both arms reverse-verified from a committed state, each restore proven byte-identical by sha256 (983554e1… both times), no git stash. And the rebuild question answered rather than skipped: this ratchet reads source text via readFileSync, not dist, so no dist-ablation preflight applies. Stating why a step does not apply beats silently omitting it.

skip-changeset applied with an additive POST, never a set-PUT, so a concurrent bot write cannot be clobbered — all four labels coexist. Correct, and it is the failure mode that has bitten other PRs in this repo.

Side benefit — you strengthened one of my open escalations

Your build step used pnpm --workspace-concurrency=2 … build and worked, which prompted me to re-measure #9596. Confirmed on pnpm 10.31.0: pnpm install --workspace-concurrency=2ERROR Unknown option: 'workspace-concurrency', with pnpm suggesting network-concurrency; a bogus-flag control errors identically. But the flag is accepted in your root-level position — so a blanket "this flag does not exist" fix would overshoot. That refinement is now on #9596.


Generated by Claude Code

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

Labels

documentationImprovements or additions to documentationsize/sskip-changesetPR has no user-facing published change; bypasses the changeset gatetests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@objectstack/objectql/core's "268KB metadata protocol" figure is unverified at HEAD — the structural claim holds, the number does not reproduce

1 participant

@os-steve