Repository navigation
feat(spec, metadata-protocol): Seed.fallback marks the set an organization gets when its locale matches no set of the object - #35065
Conversation
…k locale set (WIP) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi6WQ71HhZSLSvHhdF
…r selection Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi6WQ71HhZSLSvHhdF
… and heal paths Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi6WQ71HhZSLSvHhdF
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi6WQ71HhZSLSvHhdF
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi6WQ71HhZSLSvHhdF
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi6WQ71HhZSLSvHhdF
…able Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi6WQ71HhZSLSvHhdF
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi6WQ71HhZSLSvHhdF
… rows; load metadata at test module top Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi6WQ71HhZSLSvHhdF
…ed-locale-fallback
📓 Docs Drift CheckThis PR changes 2 package(s): 3 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 174 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 34bed4eb30e483339580a7c619c9066e915f1b99 && git checkout 34bed4eb30e483339580a7c619c9066e915f1b99
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 958ee03594968c651db1bc40ecb05bfe72f94b2d cc0a04bff73226fd76034146fa72cf4f781d0e8d && git checkout -B drift-repro 958ee03594968c651db1bc40ecb05bfe72f94b2d && git merge --no-ff cc0a04bff73226fd76034146fa72cf4f781d0e8d
node scripts/docs-audit/affected-docs.mjs --json 958ee03594968c651db1bc40ecb05bfe72f94b2d
|
…to a domain:skills card Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi6WQ71HhZSLSvHhdF
|
repo:objectstack#3 · os-support-ai · session_01WGufzi8zDwpH6wX7ZPUcHR 席位核对L1 review · REWORK (PR body only; the code is accepted) · Head-sha: This is a full review: there is no earlier L1 record. I read the whole diff from merge-base Schema (
Loader (
Ledgers and docs.
Paper.
Should-fix (blocks; paper only)
For the seat's contract review (not a finding)
Owed, for the seat: the contract review (Clause-② yes, |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract-review-claim: session_01WGufzgh1zkZzDXL36ckWAG · head |
|
repo:objectstack#3 · os-support-ai · session_01WGufzi8zDwpH6wX7ZPUcHR 席位核对L1 same-head review · ACCEPT · Head-sha: This follows L1 6966814360 (REWORK, PR body only) at the same head. The code is unchanged.
No new findings. Owed, for the seat: the contract review (Clause-② yes, |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: Read: card #34940 (body, comments 6956175603, 6963214228, 6966124515, 6966753013), PR #35065 (body, file list, comments 6966126603, 6966814360, 6966829726), the net diff from merge-base Security-touching: no ① Derived judgments
② Semver levelClause-②: yes (widening). Holds: one new optional authorable key, nothing previously accepted refused.
③ Boundary flags
④ Design judgment
The key, its literal-
Selection is correct sentence by sentence: M1 (must-fix) — a correctly authored fallback set refuses every later organization's seed after an ordinary reseed or upgrade.
S1 (should-fix) — the refusal's reach is the whole load, across packages, and it is quiet at the replay.
Nits:
Implemented-by: VERDICT: FAIL |
… copies once The per-organization replay list holds a package's datasets once per merge, so one reseed left two copies of the one fallback set and the whole load was refused for every new organization. The loader now counts distinct declarations (the runtime `_` envelope excluded, keys sorted) and refuses only the marked sets of an object with two different ones, logged at warn; every other dataset and object still seeds. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi6WQ71HhZSLSvHhdF
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi6WQ71HhZSLSvHhdF
|
repo:objectstack#3 · os-support-ai · session_01WGufzi8zDwpH6wX7ZPUcHR 席位核对L1 delta review · ACCEPT · Head-sha: This reviews the delta from L1 6966854128 (ACCEPT at
No findings. Note for the seat's contract-review delta (not a finding): a refused object loses all its marked sets, including for the locales those sets list themselves. An Owed, for the seat: the contract-review delta for |
|
repo:objectstack#3 · os-support-ai · session_01WGufzi6WQ71HhZSLSvHhdF Hand-off · PR #35065 (card #34940) · area o3-I → next PM · 2026-11-18T03:25ZSeat 3 is winding down on the maintainer's word (2026-11-18T03:19Z). This comment holds everything the next owner needs. Nothing is kept in threads or scratchpads. State: ready, awaiting the seat's L2 delta. Not armed, not queued.
Next step: run the contract-review delta on Card #34940 is handed over unfinished, so Update 2026-11-18T03:37Z: the seat's L2 delta is FAIL (6968234700) at |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract-review-claim: session_01WGufzgh1zkZzDXL36ckWAG · head |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: Delta of the FAIL record 6966933253 at Read: card #34940 (body and all seven comments, the ruling 6966988997 and the dev report 6968061404 among them), PR #35065 (body, file list, comments through the claim 6968151959, L1-e's delta ACCEPT 6968076064 among them), the net diff from merge-base Security-touching: no The merge resolved nothing by hand in this PR's files. M1: closed ① Derived judgments
② Semver levelClause-②: yes (widening). Holds: one new optional authorable key, nothing previously accepted refused. The changeset still carries ③ Boundary flags
④ Design judgment
The amended bullet ("Two different datasets of one object both marked ... none of that object's marked datasets loads, the load reports the object, and its other datasets and every other object still seed. Identical copies of one dataset (a package's list merged twice) count once") and the describe text each hold in the loader, sentence by sentence. The contract is implemented as written. Where it breaks is M2: "a package's list merged twice" is the only way the contract expects one author's set to appear twice, and the shared list also holds it twice when it was merged once per version.
M1: closed. The pins asked for exist and state the right answer.
S1: closed, per the ruling. The refusal no longer reaches another object or another package's other objects, and it is said at What "identical" means in the collapse, read in the code.
M2 (must-fix) — after an upgrade that changes a package's fallback set, every organization founded until the next restart gets none of that object's marked sets, for the locales the set lists as well.
Nits:
Implemented-by: VERDICT: FAIL |
… with two marked seed sets Seat ruling 6968296038: every marked set still loads for the locales it lists; no marked set fills in for an unlisted locale; the object is reported at warn. The refusal sentence names both causes instead of blaming the author. Claude-Session: https://claude.ai/code/session_01JQwxbaX2qDxUq9sF93EqqL Co-authored-by: Claude <noreply@anthropic.com>
…seed set, one process per organization Claude-Session: https://claude.ai/code/session_01JQwxbaX2qDxUq9sF93EqqL Co-authored-by: Claude <noreply@anthropic.com>
…text Claude-Session: https://claude.ai/code/session_01JQwxbaX2qDxUq9sF93EqqL Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-warren · session_01JQwxbaX2qDxUq9sF93EqqL Review head · PR #35065 · 2026-11-18T04:44Z
|
|
repo:objectstack#1 · os-warren · session_01JQwxbaX2qDxUq9sF93EqqL Contract-review-claim: session_01JQwxbaX2qDxUq9sF93EqqL · head |
|
repo:objectstack#1 · os-warren · session_01JQwxbXr9wLAH24MEgxaLud 席位核对L1 delta · ACCEPT · Head-sha: Delta from L1-e ACCEPT 6968076064 at Checked against the ruling
Notes, no change asked
Not mine, still owed before landing
|
|
repo:objectstack#1 · os-warren · session_01JQwxbaX2qDxUq9sF93EqqL Contract reviewServed-tier: Delta of the FAIL record 6966933253 at Read: card #34940 (body and all ten comments, the rulings 6966988997 and 6968296038 and the dev report 6969255396 among them, the report as data), PR #35065 (body, file list, the two earlier records), the net diff from merge-base M2: closed ① Derived judgments
② Semver levelClause-②: yes (widening). Holds: one new optional authorable key, nothing previously accepted refused; this delta narrows a refusal inside the unreleased widening and publishes nothing new. The changeset still carries ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
The reworded warn sentence, against the loader.
M2: closed. A correctly authored package that changes its marked set in an upgrade no longer loses, for any organization, a row the same package would give it unmarked. What remains until restart is the ruled bound: an organization on a locale no set lists gets no fallback for that object, said at Nits:
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-warren · session_01JQwxbXr9wLAH24MEgxaLud 席位核对L1 delta (merge only) · ACCEPT carries · Head-sha: The only commit since my ACCEPT 6969436624 at |
|
repo:objectstack#1 · os-warren · session_01JQwxbaX2qDxUq9sF93EqqL Landing · 2026-11-18T06:35Z. The 18.6.0 freeze is lifted (seat comment 6970550718), and seat 1 gave the go to enqueue this PR now. Head |
Requested by Yibo Wang · project thread
Closes #34940
Ruling: seat 3, route A (claim comment 6963214228 on the card): an explicit optional per-set marker
fallback: trueon a seed set, loaded only when no set of the same object matches the resolved locale; additive and opt-in, with conditions (1) at most one fallback set per object, (2) enforced at boot and at install/reseed/heal/replay with the liveness ledger recording the key live, (3) the seed docs and the skills seed page name it.Seat rulings on this PR's open questions (2026-11-18T01:25Z):
skills/objectstack-data/references/seeds.mdhunk is dropped from this PR. Adomain:skillschild card, filed by triage, carries the seeds.md field rows and the eval case. Commite020dc236arestores seeds.md to itsorigin/mainbytes; history is not rewritten.fallbackneedslocalestands.Seat ruling on the contract review of
e020dc236a(FAIL, M1, comment 6966933253): the shared per-organization replay list is appended to on every merge (boot rehydrate, install or upgrade, reseed), so one reseed left two copies of the one fallback set and the whole-load refusal gave every new organization no seed rows. Fix round 2 (f64d23edfd):_envelope, with keys sorted.mergeSeedDatasetsis not changed (outside the claim). Object names are global, so there is no per-package scoping: two packages that mark different fallback sets for one object refuse that object.Seat ruling on the contract review of
09232b7d0c(FAIL, M2, comment 6968234700): seat 1, comment 6968296038, route (a), quoted verbatim:Fix round 3 (
e2c865b89a,6e660b0fd2,00b85b668b): M2 was an upgrade inside one running process. The shared replay list then holds version 1's and version 2's datasets. If the marked set changed between the versions, those are two distinct marked declarations from one correctly written package. Before this round, every marked set of the object was then removed, so anenorganization lost theenrows it would have had without the marker. Now the marked sets stay in the locale filter as ordinary sets. Only their use as the fallback for a locale none of them lists is withheld.mergeSeedDatasetsis still unchanged (ruling 6966988997).Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up #35070
维护者速读
fallback: true。按语言拆分的种子(如 zh-CN 与 en 两套标准价格表),标记其中一套后,语言不在任何一套之列的组织(ja-JP、es-ES)也能拿到这一套,而不是一条都没有。fallback的数据集行为逐字节不变(每条路径都有不带标记的对照用例)。同一对象标记了两套不同的回退集时(例如同一进程内升级改动了回退集),只拒绝「回退」这一选择:各套仍按自己列出的语言加载,与不带标记时完全相同,未列出语言的组织拿不到回退,并以 warn 报出该对象;同一套被重复合并(重新加载、升级、重置示例数据)只算一套。回滚即还原本 PR。packages/metadata-protocol/src/seed-loader.ts(filterByLocale的回退分支与refusedFallbackObjects条件、findDuplicateFallbackSets的提示文案);packages/spec/src/data/seed.zod.ts(新键与dependentRequired规则)。pnpm --filter @objectstack/metadata-protocol exec vitest run src/seed-loader-locale-scope.test.ts,预期 35 个用例全过,其中Seed.fallback fills in…一组 19 个。What changes
SeedSchema): new optional keyfallback: true(the one value istrue).fallbackwithoutlocaleis refused at parse, at thefallbackkey, throughdependentRequired({ fallback: ['locale'] })from the closed projection list, so the published JSON Schema carries the rule (dependentRequired: { fallback: ['locale'] }) anddropped-refinements.baseline.jsondoes not grow.localedocs now point at the marker.SeedLoaderService, the one funnel every seeding path goes through):filterByLocalekeeps a marked dataset the resolved locale would drop when no locale-scoped dataset of its object lists that locale, and logs each such fallback at info. When the env-kept datasets of a load mark two different sets of one object, only the fallback choice is refused: every marked set still loads for the locales it lists, exactly as an unmarked set would, and none fills in for a locale no set lists. The load reports one error per object (field: 'fallback',success: false) and logs it at warn. The message names both causes (more than one marked set across the packages being seeded, or an upgrade in this process that changed a package's marked set) instead of telling the author to drop a marker. Identical copies of one set count once, so a list merged twice seeds normally. A load with no locale is unchanged: every dataset loads and the existing warning names the marked one too.packages/spec/liveness/seed.jsongains alivefallbackrow (evidence, producer, pins);state-counts/seed.mdregenerated (19 → 20).authorable-surface/data.json(+data/Seed:fallback), and the reference pagesgen:docsrewrites (references/data/seed.mdx,seed-loader.mdx, and the two that embed the seed table:api/package-api.mdx,kernel/manifest.mdx).content/docs/data-modeling/seed-data.mdxgets an "A Fallback Set" section, adefineSeedsignature line and a best-practice pointer. The skills seed page is not touched here (Q1 = B above).Decisions taken (the ruling asked for these to be decided and documented):
fallback: truewith nolocaleis refused, not read as redundant (the stricter option). An unscoped dataset already loads for every locale, so the marker could only promise a behaviour the loader does not have, which is the declared-not-enforced shape ADR-0049 forbids.localeis locale-neutral: it loads beside the chosen set and does not block the fallback. Under the literal reading (an unscoped set "matches" every locale), any object carrying shared rows could never fall back.env. A setenvscoped out neither matches nor falls back. Two marked sets in different environments are not refused.Tests
Fix round 3 (head
00b85b668b, see the Verification block for the commands and their sha):seed-loader-locale-scope.test.ts, 35/35):zh-CN,en,ja-JPand no locale each get the sameprice_bookrows as the unmarked control.ja-JPgets none. Every load reportsfield: 'fallback'.fallback set(s) loadedinfo line is printed, and the message no longer says "drop it from the others".enset gained a row).engetsPartner, Standard, the same as the unmarked control.ja-JPgets noprice_book. Onewarnnames'price_book'.de-DEstill gets the other package's marked set.app-plugin.seed-locale-producer.test.ts, 37/37):AppPlugin.start, then version 2 through a second start (shared list length 6). Fororg_enandorg_ja, the rows match the unmarked control,accountseeds, and exactly onewarnappears (0 in the control).org_engetsStandard.zh-CNstill gets its marked set.6e660b0fd2, loader suite from source:scripts/ablation-replace.mjsreplaced the guard&& !refusedFallbackObjects.has(dataset.object)with&& true /* ablated */. It checked anchor 1 to 0 and marker 0 to 1 on disk. Result: 5 failed of 35 (the four round-3 loader cases and the two-package case). Restored: the blob equals HEAD95540e642a, andgit diff HEADis empty. A first attempt used the replacement) {, which the anchor itself contains. The tool refused it before running anything, so that attempt was a no-op.Earlier rounds (kept as recorded):
Final head
09232b7d0c: the fixf64d23edfd, then a merge oforigin/main. The merge does not touchseed-loader.ts,seed-datasets.ts,seed-locale.tsor the seed schema.pnpm --filter @objectstack/spec teston09232b7d0c: Test Files 852 passed (852), Tests 27306 passed, 1 todo.pnpm --filter @objectstack/metadata-protocol test: Test Files 352 passed, 9 skipped (361); Tests 23143 passed, 45 skipped. Run onf64d23edfd, and again on09232b7d0cwith the same counts.pnpm --filter @objectstack/runtime testonf64d23edfd: Test Files 618 passed (618), Tests 11474 passed, 23 skipped. NOT MEASURED on09232b7d0c: the re-run was stopped at the wind-down order before it finished.09232b7d0c, after the merge and a closure rebuild:seed-loader-locale-scope.test.ts33/33 andapp-plugin.seed-locale-producer.test.ts36/36.f64d23edfd.AppPlugin.start(6 entries in the shared list) still gets the fallback set, and the rest seeds. Pin (b) a second package marking a differentprice_bookfallback set refuses onlyprice_book;accountand the second package'splan_enstill seed. The install path also gets a per-object refusal case and a list-merged-twice case.Ablations (one-time, not kept), on
f64d23edfdEach ablation ran
scripts/ablation-replace.mjs --hold(anchor count 1 to 0, marker 0 to 1), rebuilt@objectstack/metadata-protocol, and confirmed withablation-dist-preflightthat the marker was in 2 built files. The restore usedgit checkout HEAD -- path, checked that the blob hash equals HEAD (9926b3211f), rebuilt, and ran--absent(marker absent from 24 built files, tree clean).distinct.set(fingerprint + "#ABLATE_NO_COLLAPSE" + distinct.size, …)). Loader: 1 failed of 33 (identical copies). Runtime: 2 failed of 36, which are pin (a) and the install list-merged-twice case.Acceptance notes
Round 3 file surface:
packages/spec/liveness/seed.jsonwas outside the claim's listed surface. Itsfallbackrow's evidence and note described the round-2 behaviour ("skipped"), which this round makes false, so it was updated in the same commit. That row was added by this PR and has not been released.N3/N4 (nits of 6968234700) not taken: the fingerprint's non-JSON values and its cost are unchanged. A wrong collapse now leaves both sets marked and both used as the fallback; no row is lost.
Out of scope, routed by the seat: the append-only shared
seed-datasetslist after an upgrade (ruling 6968296038, last bullet), filed by triage as seed: the shared seed-datasets replay list is append-only, so after a package upgrade it keeps the superseded version's datasets until restart — new orgs replay old and new seed sets #35109. This PR does not change it.Not governed: after the seeds.md revert,
check-governed-merges --branchreads 0 of 14 paths on the register — NOT governed.check-skills-token-ratchetstays green against main's seeds.md (1747 / 1747).One fallback per object is a loader refusal, not a stack-level schema refinement. A refinement over
data: SeedSchema[]would live inpackages/spec/src/stack.zod.ts, which is outside this claim's file surface, and it would not see storedseeditems, which reach the loader without a stack. Stack-level authoring-time detection (os validate) is a possible follow-up.Generated reference pages
api/package-api.mdxandkernel/manifest.mdxchanged because they embed the seed table. That isgen:docsoutput, whichcheck:docsrequires.#34791sharesseed-loader.ts,seed.zod.ts,seed.test.tsand the seed docs;overlap-checkreads that it merges cleanly.Verification
Local gates on
09232b7d0c:dispatch-gates.mjs --commandsderived 116 families; 94 exit 0, 2 NOT MEASURED, 20 not run:: exit N.check:skill-examples(exit 3). PREREQUISITE NOT MET:packages/client-react/distwas not built in this worktree.check:dual-build-cjs-loads(exit 3). PREREQUISITE NOT MET: 34 published packages are unbuilt.check:refd-timer-probein the derived list, stopped at the wind-down order.dispatch-gates --ranreads: 20 of 116 UNRUN, 2 NOT-MEASURED.09232b7d0cwith exit 0:check:generated,check:liveness,check:docs,check:authorable-surface,check:api-surfaceandcheck:nul-bytes.check:test-source-aliasis among the 20 not run.overlap-checkon09232b7d0c:VERDICT clean exit 0.origin/mainmerges cleanly, and#34791merges cleanly.Full CI (
Test Core, dogfood shards and the rest of the farm) is left to the PR's check-runs. Dogfood battery: not owed (no!in the title,(widening)arm).🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzi6WQ71HhZSLSvHhdF