Repository navigation
fix(lint): os validate and os build resolve a report's dataset through the reading package's declared closure, as the runtime does - #33171
Conversation
…h the reading package's declared closure, as the runtime does chart-dataset-unknown read the judged stack's own datasets alone, so on the per-package pass a report, joined block, list-view chart or page chart over a declared dependency's dataset was refused while the runtime served it. It now reads the resolution the dashboard rule reads (indexArtifactDatasetResolution) and takes that rule's refusal and unverified sentences for a name the runtime refuses the reader. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvtG32iBab1PR1fpR6
📓 Docs Drift Check3 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 4 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 f44820166e09b621622a5b7ed4920806a122a632 && git checkout f44820166e09b621622a5b7ed4920806a122a632
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5e250a65992192bdc9b3fb3be304a2fca245b2d1 60edc5ee5bdec64faf79dbd47fd0530618a89b33 && git checkout -B drift-repro 5e250a65992192bdc9b3fb3be304a2fca245b2d1 && git merge --no-ff 60edc5ee5bdec64faf79dbd47fd0530618a89b33
node scripts/docs-audit/affected-docs.mjs --json 5e250a65992192bdc9b3fb3be304a2fca245b2d1 |
|
epic:#31527#3 · os-tesla · session_01L9qibzECS2npZFku4956Um 席位核对 · ACCEPT · PR #33171 (#33128) · 2026-11-14T00:16ZHead-sha:
Generated by Claude Code |
Requested by Tesla · project thread
Fixes #33128
Clause-②: no
Metadata-protocol: none
维护者速读
os validate/os build误报chart-dataset-unknown。callerPackage从依赖闭包解析报表的数据集并正常返回,作者期却只看本包自己的datasets,有效的模块化应用构建不过(看板那一半已由 fix(lint)!: os validate and os build resolve a dashboard's dataset through the reader's declared closure, as the runtime does #33121 修好,这是报表那一半)。packages/lint/src/validate-chart-bindings.ts的resolveDataset(拒绝与警告两支)和indexDatasets(改读看板同一份解析结果)。pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-chart-bindings.test.ts,预期 91/91 通过,其中[#33128]一组 11 条。Red lines
indexArtifactDatasetResolution, the resolutionwidget-dataset-unknownandreport-filter-field-unknownalready read; this PR adds no second walk and no wider reach. A dataset only an undeclared package holds stays refused:REFUSES a report over a dataset only an UNDECLARED package holds, naming the holder and the dependency to declare, and the CONTROL half ofACCEPTS the same dependency’s dataset on a joined block, a list-view chart and a page chart. The phase-1 one-holder tests are not touched (packages/core,packages/objectqlare outside the diff); bare-name URL behaviour is not touched (no runtime file in the diff).REFUSES a name two packages of the closure hold, naming both: nothing picks one (red line 2)asserts the code, the severity, the path and the message's first clause naming both holders, and that the report's positions are judged against neither.REPORTS, not refuses, when the reader declares a dependency the artifact does not carry; never softens an ambiguitykeeps it an error when an outside dependency is declared. Ablation A4 (the resolver picks the first holder) turns both red.@objectstack/lint,patch), no runtime answer moves, nothing in this diff waits on a sibling card. No migration: nothing stored changes. No behaviour moves between layers, so no ADR-0087 entry is owed (the authoring gate stops refusing what the runtime serves).What changes
os validate/os build/os lint, per-package pass: a report, joined block, list-view chart or page chart bound to a dataset a package it declares holds (transitively)chart-dataset-unknownerror, "resolves to no declared dataset … Declared datasets: (none)"chart-dataset-unknownerror naming the holder and the open fix (declare the dependency, or move when the holder already depends on the reader): the dashboard rule's sentencechart-dataset-unknownerror naming both; nothing picks onechart-dataset-unknownwarning: not judged, that package may hold it once installed (the dashboard rule's S1 arm)datasetsbeside the composition (manifest: 'preserve')packages[]; the publish door (its write snapshot carries nopackages[])Why every surface of this rule and not only reports: every reader it judges sends its own served package as
callerPackage(DatasetReportRenderer,ObjectChart, the list view's chart inobjectViewListRenderer.tsx), and the dataset doors resolve the name from that package by ADR-0150 D3: "?callerPackage=Pnames the package of the item that reads the name (a dashboard, report or chart of P) … The name resolves from P by D3" (ADR-0150, amendment note of 2026-11-11). On the per-package pass every item is the judged package's, so one resolution serves all three surfaces.Which resolver: the order points at
packages/core/src/package-scoped-resolution.ts. PR #33121's dashboard half resolves withindexArtifactDatasetResolution(packages/lint/src/validate-widget-bindings.ts), overpackageResolutionClosure(@objectstack/metadata-core); core's module holds the D3 rule's runtime vocabulary, which the lint does not call. This PR imports that same lint function and its two wording functions; nothing is copied, and neitherpackage-scoped-resolution.tsnorvalidate-widget-bindings.tsis edited.validate-report-runtime-filter.ts(review nit N1 on PR #33121), re-judged: it does not share the defect. It has readindexResolvableDatasets, the same closure-aware index, since #33121, so a report'sruntimeFilterover a declared dependency's dataset already resolves that dataset. No change. Its per-package pass leaves a refused name unjudged, andchart-dataset-unknownnow carries that verdict with the reason; the union run still judges the filter.Clause-② reads
no: the lint now accepts only what the runtime and ADR-0150 D3 already accept (the quotation above); no published contract refuses it. Metadata-protocol readsnone: no key, value or type is added or removed, no meaning or default changes (the authoring gate stops a false refusal); copied from the claim.Tests
packages/lint/src/validate-chart-bindings.test.ts, one new top-leveldescribe,[#33128] chart-dataset-unknown resolves through the reading package’s declared closure(11 cases):datasetsno longer hides the module’s own (CONTROL: the app's per-package pass is refused with the cycle hint)Ablations (mutation through
scripts/ablation-replace.mjs, red seen, restored with blob == HEAD andgit diff HEADempty; the suite importssrc/, so no dist leg):A1 · the BASE index back (`stack.datasets` alone)
A2 · the refusal arm dropped (a refused name falls to the generic sentence)
A3 · every refusal softened to the warning
A4 · the shared resolver picks the first of two closure holders (validate-widget-bindings.ts, mutation only)
Acceptance notes
origin/main47f6c93,validateChartBindingson the per-package shape (modulecom.example.mdeclarescom.example.d, which holdsds; the module's report readsds): onechart-dataset-unknownerror, "binds dataset "ds", which resolves to no declared dataset — there is no data to render." / "Declared datasets: (none)."ruling|Ruling-ref|maintainer|⛔:validate-chart-bindings.ts:93names the maintainer ruling onchart-field-unknown(presentation positions warn, query positions error); this diff moves no position's severity.validate-report-runtime-filter.ts: no hit.package-scoped-resolution.ts: not edited; no export was needed.validate-report-date-range.ts(not in this surface) indexesstack.datasetsalone, so on the per-package pass a report'sdateRangeover a declared dependency's dataset is not judged there; the union run judges it. Not a false refusal and no verdict lost; noted, not filed.report-filter-field-unknownand the dashboard twin): the per-package object graph holds the package's own objects, so a key on an object the dependency holds is skipped on that pass and judged on the union run. Probe at this head: a report over the dependency's dataset withruntimeFilter: { nope: 'x' }gives no per-package finding. The twin behaves the same; noted, not filed.Verification
All at head
60edc5ee, worktree offorigin/main47f6c93 (git merge origin/main: already up to date).pnpm --filter @objectstack/lint build && … typecheck && … test(underos-verify-lock):VERDICT command-exit 0, Test Files 208 passed (208), Tests 8836 passed (8836); typecheck istsc --noEmit && pnpm check:test-typecheck.pnpm lint(repo-wide eslint): exit 0.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 59 families, each run with stdin from/dev/null, exit codes captured before any pipe;--ran: "59 derived famil(ies) accounted for — 59 run, 0 NOT-MEASURED (a DERIVED zero — all 59 recorded an exit code and none of them is 3)". Three first runs were prerequisite failures, not reds, and are recorded at their rerun:check-plugin-teardown-shape.mjs --self-testexit 3 on the shallow clone (its pinned fixture commit unreachable), exit 0 aftergit fetch --unshallow;check:dts-closureexit 1 andcheck:dual-build-cjs-loadsexit 3 (PREREQUISITE NOT MET, nodist/) after anOS_SKIP_DTS=1CLI build of mine, both exit 0 after a fullpnpm build(VERDICT command-exit 0).!in the title and no(narrowing)arm.os validate through the built CLI, BASE by ablation into dist
A scratch
objectstack.config.mjs:composeStacks([library, sales], { manifest: 'preserve' }), the library module holding datasetrptl_book_metrics, thesalesapp's summary report reading it;declared=saleslists the library independencies.A first try at this leg carried the marker in a line comment, which the bundle strips: its preflight answered "marker ABSENT" and that reading was discarded; the leg above carries the marker in a string literal.
Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code