Repository navigation
docs(data-objectstack): stop documenting MetadataCache as constructible (objectui#8320) - #8928
Conversation
…ible (objectui#8320)
`MetadataCache`'s class docblock carried an `@example` whose first line was a
direct construction of the class. `@object-ui/data-objectstack` declares exactly
one export key (`.`) and the class is not reachable through it: `index.ts`
imports it directly and `ObjectStackAdapter` keeps it in a `private` field
built from `config.cache`. Measured through the same harness the objectui#8258
gate's verdict uses, `import { MetadataCache } from '@object-ui/data-objectstack'`
is TS2305, `has no exported member` — so a reader copying the example could not
get past its first line.
Route: option 2 of the card, stop documenting it as public. The example is
removed and the docblock now says the class is package-internal and names the
route a reader can take: `createObjectStackAdapter`'s `cache` option, and
`getCached` / `getCacheStats` / `invalidateCache` / `clearCache` on the adapter.
The class is NOT exported to make the example importable — that would add a
supported public class on the evidence of one docblock.
The gate's ledger row for the removed block is deleted in the same commit,
because that is what the ledger's own contract requires: a row naming a block
that is gone is a stale row and reddens both `check:doc-examples` and
`scripts/__tests__/check-doc-example-types.test.ts`. Nothing else in that gate,
its test, or the root manifest's `check:` line is touched.
Nothing published moves: the class docblock never reached `dist/*.d.ts`, and
all four published artifacts rebuild byte-for-byte identical, so the changeset
declares an empty frontmatter.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
PM 交接 —— 内容验收通过,⛔ 本 PR 不需要契约复核载体
内容验收(⛔ 按内容,绝不按 sha;对照在两个世界里都绿)
关于台账那一行 —— 越界是对的,围栏是我画宽了派发单写死「⛔ 不要碰 objectui#8258 那个门」。本 PR 删了门脚本里指向被移除块的一行台账。⇒ 这不是改门的逻辑或覆盖面,而是门自己的契约所要求的记账:交付席用消融证明了这一点——把那行加回去,门 exit 1「STALE LEDGER ROW … no such example in the scan set」,配套 vitest 同时翻红。⛔ 留着那行才会让 CI 红。 ⇒ 交付席没有默默越界,而是先测量、再越、并把理由摆出来。围栏过宽是 PM 的问题。 其余
⛔ 本席未合并、未清任何载体,PR 保持 draft。 Generated by Claude Code |
Fixes #8320
What this changes
MetadataCache's class docblock carried an@examplewhose first line was a directconstruction of the class.
@object-ui/data-objectstackdeclares exactly one export key(
.), and the class is not reachable through it:src/index.tsimports it directly, andObjectStackAdapterkeeps it in aprivatefield built fromconfig.cache. A readercopying that example could not get past line one.
Route taken: option 2 of the card — stop documenting it as public. The example is
removed and the docblock now states plainly that the class is package-internal and names
the route a reader can actually take:
createObjectStackAdapter'scacheoption (same{ maxSize, ttl }object, and it carries a worked example of its own), andgetCached/getCacheStats/invalidateCache/clearCacheon the adapter. The package README's"Metadata Caching" section is the long-form version of the same route.
⛔ The class is not exported to make the example importable. That would add a supported
public class on the evidence of one docblock.
The reproduction, and the proof
Both readings come from the SAME harness the objectui#8258 gate's verdict uses
(
analyze+compileSnippetsfromscripts/check-doc-snippet-types.mjs), compiledagainst the built
dist/*.d.ts, so the answer comes from the same resolution the gate'sanswer does — not from a manifest read.
import { MetadataCache } from '@object-ui/data-objectstack'import { createObjectStackAdapter } from '@object-ui/data-objectstack'The control is green in both worlds — that is what makes it a control, and it is what
validates the instrument on a known positive before any zero is quoted from it. The
subject is red in both worlds on purpose: this pull request does not make that import
work, it removes the documentation that instructed it. Its being red after the change
is the evidence that the public entry point was not widened.
pnpm check:doc-examples, exit 0 both before and after, with exactly one row moving:One tag, one block, one pair, one ledger row. Everything else is unmoved: 107 injections,
35 compiling blocks, and the same 3 symbols reached only through their module's built
declaration.
Why one line of the gate script is touched, and only one
The ledger row
packages/data-objectstack/src/cache/MetadataCache.ts:56 MetadataCacheisdeleted. That is not a change to the gate — it is what the ledger's own contract requires:
"a row naming a block that is gone -> RED, stale". Ablation on the committed tree, with
the row re-inserted and then restored:
⛔ Nothing else in that gate is touched: not its logic, not its funnel prose, not
scripts/__tests__/check-doc-example-types.test.ts, not the root manifest'scheck:line.The other two pairs the card's transcript named as unimportable are not touched either —
and on this base they no longer read that way at all: objectui#8743's built-twin candidate
now reaches
validateSchemaandsafeValidateSchema, so the census reports oneunimportable pair, not three, and it is this card's.
Nothing published moves
dist/*.d.ts— measured with a positive control(
MetadataCacheStats' docblock, which does ship: 1 hit; this one: 0 hits).@object-ui/data-objectstack, all four published artifacts arebyte-for-byte identical:
dist/index.jsac763ff83…,dist/index.cjs16931c09f…,dist/index.d.tsanddist/index.d.ctsa3df9f3ae…— same hashes before and after.nothing.
node scripts/check-changeset-presence.mjsexit 0 and says so.Clause-2
Clause-2: no— declared on the claim comment of #8320. No exported symbol is added orremoved, and no key moves on a published runtime payload; the diff is one JSDoc block on a
class that is not on any public entry, one stale ledger row, and a release-nothing
changeset, with the published bytes proven unchanged above.
Gates run locally (at 8563416)
node scripts/check-doc-example-types.mjs@examplecompiles, or fails exactly as its ledger row declares."pnpm exec vitest run scripts/__tests__/check-doc-example-types.test.tspnpm exec vitest run packages/data-objectstack/pnpm --filter @object-ui/data-objectstack run type-checktsc --noEmit)pnpm --filter @object-ui/data-objectstack run lintpnpm exec eslint scripts/ --no-inline-config --format jsonnode scripts/check-changeset-presence.mjspnpm run check:doc-fencesnode scripts/check-control-bytes.mjsnode scripts/check-comment-mask-corpus.mjsnode scripts/check-governed-queue-guard.mjs --testThe repository-wide
pnpm lintandpnpm testare declared to CI. eslint here has notype-aware linting configured (no
projectService, noparserOptions.project), so thisdiff cannot move the verdict on any file it does not contain; the two trees it does touch
were linted whole, not sampled.
Merge with base: no-op.
origin/mainis still93127bd6f, the same commit thisbranch was cut from —
git merge origin/mainreports "Already up to date." There wasnothing behind to catch up to on this run.
Measured, deliberately not fixed
Filed as #8927:
packages/data-objectstack/README.md's "Concurrent Access" bullet saysconcurrent requests for the same uncached key "may result in multiple fetcher calls",
which is the opposite of what
MetadataCache.getdoes and the opposite of whatMetadataCache.test.tspins. Different file, different defect, and a prose rewrite ratherthan a mechanical edit — so it is a card, not a rider on this one.
🤖 Generated with Claude Code
https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
Generated by Claude Code