Repository navigation
fix(metadata): a metadata file read or written by name stays inside the loader's root, under a known type - #39118
objectstack-fleet[bot] wants to merge 13 commits into
Conversation
…he loader's root, under a known type Claude-Session: https://claude.ai/code/session_012dn2AfG9txpigxdt2zFADB Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 4 package(s): 15 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 195 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 7449ea3487d442504a848de448a47d832039f138 && git checkout 7449ea3487d442504a848de448a47d832039f138
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1fe9c6287f2f058c7d1f1972cdfa4ebcd58803b6 ea68b4724cae18fa2c37737426cb97adaccfaf78 && git checkout -B drift-repro 1fe9c6287f2f058c7d1f1972cdfa4ebcd58803b6 && git merge --no-ff ea68b4724cae18fa2c37737426cb97adaccfaf78
node scripts/docs-audit/affected-docs.mjs --json 1fe9c6287f2f058c7d1f1972cdfa4ebcd58803b6
|
…mposition that reads files Claude-Session: https://claude.ai/code/session_012dn2AfG9txpigxdt2zFADB Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012dn2AfG9txpigxdt2zFADB Co-authored-by: Claude <noreply@anthropic.com>
…er root suite Claude-Session: https://claude.ai/code/session_012dn2AfG9txpigxdt2zFADB Co-authored-by: Claude <noreply@anthropic.com>
…emLoader: true Claude-Session: https://claude.ai/code/session_012dn2AfG9txpigxdt2zFADB Co-authored-by: Claude <noreply@anthropic.com>
…ckets Claude-Session: https://claude.ai/code/session_012dn2AfG9txpigxdt2zFADB Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012dn2AfG9txpigxdt2zFADB Co-authored-by: Claude <noreply@anthropic.com>
…ata; files are read on opt-in Claude-Session: https://claude.ai/code/session_012dn2AfG9txpigxdt2zFADB Co-authored-by: Claude <noreply@anthropic.com>
…without the metadata file opt-in Claude-Session: https://claude.ai/code/session_012dn2AfG9txpigxdt2zFADB Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012dn2AfG9txpigxdt2zFADB Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-bob · os-bob · session_012dn2AfG9txpigxdt2zFADB Contract-review-claim: session_012dn2AfG9txpigxdt2zFADB · head 947790b · 2026-12-03T01:29Z The merge queue refused this PR because its declared narrowing owes a same-head contract review at CONTRACT_REVIEW_TIER plus an authorized approval. The seat runs the review on this head now. |
…a manager that reads no files watches none Claude-Session: https://claude.ai/code/session_012dn2AfG9txpigxdt2zFADB Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012dn2AfG9txpigxdt2zFADB Co-authored-by: Claude <noreply@anthropic.com>
…in suite Claude-Session: https://claude.ai/code/session_012dn2AfG9txpigxdt2zFADB Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-bob · os-bob · session_012dn2AfG9txpigxdt2zFADB Contract reviewServed-tier: Read on this head: the PR body, the file list (17 paths), the net diff against the merge base ① Derived judgmentsEach accept-set and public-surface change the diff implies, read in the tree:
② Semver level
③ Boundary flags
④ Design judgmentThe question for this face: does the narrowing take a declared capability away at the consumer, or make the spec's own refusal real? Read against S1 (should-fix) — The published spec still declares the opposite default. S2 (should-fix) — With S3 (should-fix) — A by-name N1 (nit) — N2 (nit) — The PR body's maintainer summary asks for approval at "head 4af0a37" and its verification block is measured at N3 (nit) — The PR body says a manager with a type registry reads a directory "only for a type its registry lists exactly"; the code also admits any type the in-memory registry holds an item of. The jsdoc and the changeset ("a type it knows exactly") are accurate; the body is the short one. Prose face. Tried and held: a name or pattern with No must-fix. Three should-fix (S1, S2, S3) are open on this head and each earns a delta review of its fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-bob · os-bob · session_012dn2AfG9txpigxdt2zFADB Contract reviewServed-tier: Delta review of Check-runs on this head at the time of reading: ① Derived judgments
② Semver levelUnchanged and still right: ③ Boundary flags
④ Design judgmentS1: closed What closed each: for S1, the spec's Schema face, judged on its own: the hunk changes what the spec says, not what it accepts, and what it now says is what the first consumer ( N4 (nit) — A N5 (nit) — By the letter of AGENTS.md step 3 (a changeset for anything that publishes) a No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-bob · os-bob · session_012dn2AfG9txpigxdt2zFADB 维护者速读
ACCEPT — L1 at head 席位核对
|
Requested by bob · project thread
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: updated here
维护者速读
What changes
The rule: metadata is served from the compiled artifact and stored metadata; a metadata file is read only on an explicit opt-in, and a file read or written by name stays inside the loader's root, under the directory of a known metadata type.
MetadataPluginreads metadata files underrootDir/TYPE/only with the newfilesystemLoader: trueoption. Without it (the default, and every compositionos serve,os start,os devandos verifybuild) it registers no file loader, whatever its bootstrap mode or artifact source.bootstrap: 'artifact-only'never reads files, even with the opt-in./to reach a nested file under its type directory.., consist only of dots and spaces, or benode_modules.NodeMetadataManagerthat has a type registry reads a directory as metadata only for a type it knows exactly (its type registry, or a type the in-memory registry already holds an item of). ItsfilesystemLoader: falseoption reads and watches no files, even withwatch: true.Packages touched:
@objectstack/metadata:loaders/contained-path.ts(new),FilesystemLoader(new optionaladmitsTypeoption),NodeMetadataManager(new optionalfilesystemLoaderoption,NodeMetadataManagerOptionsexported),MetadataPlugin(new optionalfilesystemLoaderoption, default off).@objectstack/metadata-fs:layout.tsandFileSystemRepository.@objectstack/runtime.Both published packages get a patch changeset with a migration note: move metadata files into TypeScript source and run
os build, or opt in.Tests
@objectstack/metadatasrc/loaders/filesystem-loader-root-confinement.test.ts@objectstack/metadata-fstest/item-path-stays-in-root.test.ts@objectstack/runtimesrc/domains/meta-item-read-stays-in-root.test.tsEach suite holds labelled CONTROL cases for the legitimate shapes beside the refused ones, including a composition that opts in and is served its files.
Acceptance notes
MetadataManager.typeRegistryis nowprotectedso the Node subclass can tell an empty registry from a populated one.database-loader.test.tsexercises the eager file-priming pass, so itsMetadataPluginconstructions now passfilesystemLoader: true.MetadataManager.savewith no saving loader registered throwsNo loader available for saving type; no non-test code calls it.Verification
Package tests and typecheck, at 20a1ca5
pnpm --filter @objectstack/metadata test: 85 files, 2971 tests passed.typecheck: exit 0.pnpm --filter @objectstack/metadata-fs test: 12 files, 92 tests passed.typecheck: exit 0.@objectstack/runtime:src/domains250 files, 7593 passed, 6 skipped.typecheck: exit 0.MetadataPluginin objectql, metadata-protocol, runtime, verify and cli tests (including the host-config endpoint-index pins): all passed.Derived gate families, at 20a1ca5
node scripts/pm/dispatch-gates.mjs --commandsderived 76 families. 74 exited 0, and--ranreconciles all 76. Two are NOT MEASURED locally and left to CI, each refusing with its own prerequisite (exit 3):check-plugin-teardown-shape --self-testcheck:dual-build-cjs-loadsHeads after 20a1ca5 change only the changeset and docs: the changeset now declares the narrowing arm, a BREAKING line with its FROM → TO mapping and an ADR-0087 disposition (
not-required (runtime-interface-only));content/docs/protocol/kernel/metadata-service.mdxandcontent/docs/permissions/capabilities.mdxnow state the opt-in. At 4af0a37 the derived list grew to 108 families; the changeset family (includingcheck:adr-0087-registration) and all 32 docs families exited 0, and--ranreconciles 108 (106 run, the same 2 NOT MEASURED).Contract review at
CONTRACT_REVIEW_TIER: the record on 947790b (PASS, three should-fix) and its delta on ea68b47 (S1–S3 and N1 closed; PASS, no must-fix, no should-fix) are on this PR. The fixes at ea68b47: the spec jsdoc, the metadata README and a CLI comment now state the opt-in; a manager that reads no files starts no watcher; a by-name save keeps its target, backup and temp file inside the root. At ea68b47:@objectstack/metadata2981 passed, metadata-fs 92, spec 29219, verify 515, cli unit 7156;dispatch-gates --ran127 families, 126 run, 1 NOT MEASURED (check:dual-build-cjs-loads, left to CI). A@objectstack/specchangeset line for the comment-only jsdoc change is omitted by choice (nit N5): spec is in the same fixed release group and moves with this patch.Read first:
packages/metadata/src/plugin.tsconstructor: the opt-in.packages/metadata/src/loaders/contained-path.ts: the rule.packages/metadata/src/loaders/filesystem-loader.tsresolveStatsandsave: the resolved read and the write check.Two-minute check:
pnpm --filter @objectstack/metadata exec vitest run --maxWorkers=2 src/loaders/filesystem-loader-root-confinement.test.ts. Expect 55 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_012dn2AfG9txpigxdt2zFADB