Skip to content

Commit c679140

Browse files
ci(filter-parity): judge every ui test read outside ui/, pin the ui scheduling, and admit every out-of-tree markdown read (#38286)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDypKu7B9nwbu5WuV7AEio8)_ Fixes #38132 Fixes #38133 Fixes #38134 Clause-②: no Metadata-protocol: none repo:objectstack#1 · os-elon-musk · session_016WV4cxRDKprCtjpEdtiPFW ## 维护者速读 - 用户能看到什么变化:用户无感;开发者这边,只改 ui 测试会读的那些 ui 目录外文件的 PR,现在也会跑 ui 测试;CI 配置里任何让 ui 测试少跑或多跑的改动,都要同时更新一份调度基线,否则检查会拦下。 - 为什么做:CI 与合并队列的 ui 调度;替维护者堵住“ui 测试在 PR 上被静默跳过、合进主干才暴露”的漏洞。 - 出错会怎样:最坏是某个只改这几个文件的 PR 多跑一轮 ui 测试,或改 CI 配置的人需要顺手更新调度基线;可直接撤回本 PR。 - 要你做的:本 PR 改了 CI 工作流,按规定需你审批合并。 ## What changes - **#38133: the fifth subject of `check:ci-filter-parity` covers every file outside `ui/` that a ui test reads**, not only the root `docs/adr`. - The population is still derived by the shared walker (`scanPathExpressions`). Imports resolve through `check-cross-package-test-inputs`'s own `resolveImportTarget`, which is exported with a `root` parameter and has no behaviour change. - Rework M1: a one-piece relative literal that climbs out of `ui/` and names a file is a read. This covers the `await import(new URL('../…', import.meta.url).href)` spelling the walker does not read. That is how `metadata-form-option-names.test.ts` loads `packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts`, which now has a `ui:` row. - Rework S4: a module a test loads runs its own first-party imports, so each is a read of that test. The gate uses `firstPartyModuleClosure`, attributed as `TEST (via MODULE)`. This brings in `scripts/invoked-as.mjs`, which `scripts/ci-shard-matrix.mjs` imports, and it gets a row. - The header states the bound: file reads and computed `import()`s inside a loaded module are not followed. - The walker module that the ui selector loads by a computed `import()`, `scripts/check-cross-package-test-inputs.mjs`, is a row above the heading, held by the pin. - Round 3, S5: the module closure reads TypeScript modules the way TypeScript resolves them. A `.js` specifier names its `.ts` source, an extensionless one gains the TS extensions or `/index.ts`, and a type-only `import type` / `export type` is not followed. Only a module the test loads is walked; a file a test reads as text (`readFileSync`) is a read, and what it imports is not. The third subject's `firstPartyModuleClosure`, which stages runnable copies, is unchanged. - Round 3: a module reached only through a declared trade-off inherits it, and `--list` reports it as a trade-off. `packages/mcp/src/skill-md.ts` loads `./ask-skill.generated.js`, which is a `.ts` on disk, and the `mcp-http-tools.ts` closure. Those 9 modules are now listed under the mcp trade-off, and the ci.yml trade-off comment names them. A module that a test also loads directly still needs its own row. - Measured on this head: 25 reads outside `ui/`. 15 are covered by `ui` or `ui_consumers`. The other 10 are `packages/mcp/src/skill-md.ts`, the declared trade-off, and the 9 modules that inherit it. - The rows sit in a reads group at the end of the `ui:` list, under a `UI TEST READS OUTSIDE ui/` heading. The gate holds that group to the reads in both directions. - Rework N3: a trade-off's reason now runs over its continuation comment lines. - **The ui selector** (`ui/scripts/select-affected-tests.mjs`) treats a `new URL(literal, import.meta.url)` that leaves the tree as a disk read. The test goes to the always-on lane, as M1 asked to verify. - Measured with `--explain` on a probe diff that touches only the platform pack: the always-on count goes from 525 to 526, and the one addition is `metadata-form-option-names.test.ts`. - **#38132: a new sixth subject pins how ci.yml schedules the ui jobs** against `scripts/ci-filter-parity.ui-pin.json`. Every part is held EXACTLY, as a ratchet (rework S2): - the paths-filter step's `with:` keys; - the `filter` outputs the ui jobs read; - the rows of `ui` (above the reads group) and of `ui_consumers`. A row gone reds as missing, and a row added reds as unpinned until the pin names it, so its later removal is caught; - the `if:` of every job that reads a ui output, 9 jobs, compared in CNF: - A clause added, a disjunct dropped or an atom rewritten reds as narrowed. - A clause dropped or a disjunct added reds as wider than the pin. - Rework S1: a condition with no status function carries GitHub's implicit `success()` clause. Dropping `!cancelled()` or `always()` is therefore a narrowing. - A ui job with no pin is red, and so is a pinned job that is gone. No job's `if:` is changed. - Rework N2: the header bounds now name the workflow's own `on:` `paths`, `paths-ignore` and `branches` filters as not judged. - **#38134: `deriveCandidates()` in `ui/scripts/markdown-test-inputs.mjs` admits markdown read outside `ui/`**, not only `content/docs`. - Rework S3, narrowed: an out-of-tree document is a candidate only when the root `ci.yml` `ui:` filter covers it, so any change to it starts the job that runs this ledger's test. A root `README.md` or `CHANGELOG.md` that a test only names can no longer red the next ui PR. - The root-noise `notRead` entries from round 1 (58 of them, plus two entries that existed only for them) are gone. - A new test pins every `../` entry in the ledger to a `ui:` row. - The reads that #38134 surfaced stay adjudicated: the ADR-0084 read, the `CONTRIBUTING.md` read and the `../skills/objectui/**` reads. - Rework N1: the redundant `monorepoRoot` default is now `path.dirname(root)`. - Round 3, N5: the admission reads both lists that the ui test job ORs, `ui:` and `ui_consumers:`, so a markdown read under a `ui_consumers` subtree reaches the ledger. - The monorepo root is now a fallback base. A fragment that one of the test's own directories already resolves inside `ui/` means that document, not a same-named one at the root. - One fixture literal in `check-doc-links.test.ts` is recorded as `notRead`. - Round 3, N6: the self-test reads the reads group from the `filters:` string, as the gate does. ## Tests - `node scripts/check-ci-filter-parity.mjs --self-test`: 232 assertions. Battery (12) has 48 cases and (13) has 43, at those floors. - Round 3, in (12): - a `.ts` module's `./dep.js` import walked to its `.ts` source, with the type-only import skipped; - a module read as text not walked; - a traded-off module's import inheriting the trade-off, but not when a test loads it directly; - the real `ask-skill.generated.ts` inheriting the mcp trade-off; - the dropped mcp trade-off reporting skill-md and all 9 modules it loads. - Round 3 ablations, each mutated on disk and then restored with `cmp`. Every one turns the self-test red: - the closure walked back to `.js`/`.mjs` only: 3 assertions; - type-only imports followed: 2; - text reads walked: 11; - trade-off inheritance removed: 12. - New in (12): - a scratch `new URL` import read with its module's import attributed through it; - a directory literal read as nothing; - an unresolvable module import refused; - a synthetic literal ignored; - the platform pack and `invoked-as.mjs` read on the real tree; - both new rows rolled back off the real ci.yml, each reported by path; - the multi-line trade-off reason. - New in (13): - a row added reds as unpinned, goes green once pinned, and reds as missing when removed after that; - the walker-module row pinned; - the reads-group rows kept out of the pin; - a dropped conjunct reds as wider; - the implicit `success()` clause, with `!cancelled()` and `always()` dropped, an absent `if:`, and `always()` rewritten to `!cancelled()`; - `!cancelled()` dropped from the real `test-ui-plan` job reds it. - Gate-code ablations, each mutated on disk, run, then restored and checked with `cmp`. Every one turns the self-test red: - escaping literals removed: 8 assertions red; - module closure removed: 8; - implicit `success()` limited to an absent `if:`: 4; - unpinned-row detection removed: 1; - wider-condition detection removed: 2; - trade-off continuation removed: 1. - `ui` vitest, `markdown-test-inputs.test.ts`, `select-affected-tests.test.ts` and `check-pending-changeset-literals.test.ts`: 3 files, 110 of 110 pass. - Round 3 ablation: reading `ui:` alone and dropping the fallback base reds 2 tests. The S3/N5 scratch case reds on its `ui_consumers` document, and the ledger audit reds on the root `packages/core/README.md` noise. - The S3 ablation, the out-of-tree filter removed, reds the ledger test and the S3 scratch case. - The selector ablation, the `new URL` rule removed, reds `makes the closure unbounded`. ## Acceptance notes - Rework N4, the pin file on the governed register, is **not in this push**. Adding the row to `GOVERNED_SURFACES` reds `check:pm-governed-merges` and `check:pm-governed-prose`. Those gates require the governed-surface lists in `AGENTS.md` and `.claude/skills/pm-dispatch/SKILL.md` to name it, which makes this a fleet-rule change (`Rule-change: yes`). It is left for the seat to route. - `ui/scripts/check-pending-changeset-literals.mjs` matches only the `ui/.changeset/` prefix. It goes to the seat as a follow-up card and is not filed here. - The bounds of both subjects are stated in the gate header. ## Verification Run `node scripts/check-ci-filter-parity.mjs --list`. Expect each of the 25 reads outside `ui/` printed `ok` (the mcp ones as `trade-off`), then `ok the paths-filter input, the ui outputs, the pinned rows and every ui job condition hold`. Read first, by risk: 1. `scripts/check-ci-filter-parity.mjs`, `conditionClauses` (the implicit `success()` clause) and `judgeUiScheduling` (the exact ratchet). 2. `scripts/check-ci-filter-parity.mjs`, `uiRootReadsOf` / `moduleReadClosure` / `inheritedTradeOff` (escaping literals, the TypeScript-aware closure and trade-off inheritance). 3. `ui/scripts/markdown-test-inputs.mjs`, the `ui:` / `ui_consumers:` admission and the fallback base in `deriveCandidates()`. <details><summary>Local gates, at head 230afe6</summary> - The gate set comes from `dispatch-gates --commands --repo objectstack-ai/objectstack`, which derived 75 families from the tree at `230afe66db`, after merging origin/main because the first derivation reported a stale tree. The `--ran` reconciliation shows 75 derived, 75 run and 0 unrun. - 70 families exit 0, among them `check:ci-filter-parity` (both legs, 232 assertions; the gate reports 25 reads covered or traded off and the pin held exactly), `check:cross-package-test-inputs`, `check:pm-dispatch-gates`, `check:nul-bytes` and `check:required-contexts`. - NOT MEASURED: `check:dts-closure`, `check:dual-build-cjs-loads`, `check:lean-entry-closure` and `check:sourcemap-no-sources-content`. Reason: each exits 3 with PREREQUISITE NOT MET because this worktree has no built `dist/`. The diff touches no package, and Build Core runs all four in CI. - `ui` `vitest run scripts/` on the shared box: 150 files pass and 22 fail, the same 22 files as last round. All need build output this worktree lacks: `@objectstack/spec` subpaths or built ui packages. - None of the failures is in the three test files this diff changes. - Test UI in CI is the reading of record. - `overlap-check --branch=HEAD --base=origin/main`: VERDICT clean, exit 0. The branch also merges cleanly with #38331, which shares ci.yml. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cxRDKprCtjpEdtiPFW)_ <!-- signed: repo:objectstack#1 · os-elon-musk · session_016WV4cxRDKprCtjpEdtiPFW --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 887f4de commit c679140

8 files changed

Lines changed: 1298 additions & 117 deletions

‎.github/workflows/ci.yml‎

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -732,10 +732,12 @@ jobs:
732732
# - `content/docs/ui/pages.mdx`, where the per-element data
733733
# binding section of the old data-source guide landed. Two Test
734734
# UI pins read its fences and its block table (objectstack#27145).
735-
# And, a class of its own outside that count: each root
736-
# `docs/adr/` file a ui test reads, named verbatim (objectstack#37935,
737-
# the row at the end of this list). `check:ci-filter-parity` derives
738-
# those rows from the ui tests and holds them to them both ways.
735+
# And, a class of its own outside that count: each file outside ui/
736+
# that a ui test reads, named verbatim (objectstack#37935, #38133;
737+
# the group at the end of this list). `check:ci-filter-parity`
738+
# derives those rows from the ui tests and holds them to them both
739+
# ways, and pins this whole step's input and every ui job's `if:`
740+
# (objectstack#38132).
739741
ui:
740742
- 'ui/**'
741743
- 'pnpm-lock.yaml'
@@ -773,18 +775,49 @@ jobs:
773775
# confined to a pnpm bump matched no list here, so the ui jobs
774776
# skipped on the PR and in the queue alike.
775777
- 'package.json'
776-
# The ADR files under the root `docs/adr/` that a ui test reads
777-
# (#37935), each named verbatim. Today one: Test UI's
778+
# The root path walker, which ui/scripts/select-affected-tests.mjs
779+
# imports at run time (`loadPathWalker`) to place every ui test:
780+
# select-affected-tests.test.ts asserts on it. A read inside an
781+
# imported ui module, which the gate's ui-test scan does not see,
782+
# so it is named here rather than in the group below.
783+
- 'scripts/check-cross-package-test-inputs.mjs'
784+
# ── UI TEST READS OUTSIDE ui/ ───────────────────────────────
785+
# Each file outside ui/ that a ui test reads, named verbatim
786+
# (#37935, #38133). A diff confined to one could break the test
787+
# that reads it while starting no ui job, on the PR or in the
788+
# queue (this list reads the queue diff too). Named files rather
789+
# than a subtree: a subtree row would start the whole ui battery
790+
# on every edit beside the one file a test reads, and `ui_consumers`
791+
# already covers the seven packages it names.
792+
# `check:ci-filter-parity` derives the readers from the ui tests
793+
# and holds every row below this heading to them, both ways. A
794+
# read deliberately left unscheduled is a `ui-read trade-off:`
795+
# line naming the file and why, never a missing row.
796+
#
778797
# studioMenuPlacement.test.ts holds ADR-0084's type-to-group
779-
# table equal to the Studio menu code, so an edit confined to
780-
# that ADR could break the pin while starting no ui job, on the
781-
# PR or in the queue (this list reads the queue diff too). Named
782-
# files rather than `docs/adr/**`: no other ui test reads under
783-
# the root `docs/adr/` (the ui tree's own ADRs are `ui/**`), and
784-
# a subtree row would start the whole ui battery on every ADR
785-
# edit. `check:ci-filter-parity` derives the readers from the ui
786-
# tests themselves and holds this group to them, both ways.
798+
# table equal to the Studio menu code.
787799
- 'docs/adr/0084-application-builder-information-architecture.md'
800+
# quick-reference-commands-4149.test.ts holds the root
801+
# CONTRIBUTING.md's UI Workspace commands to the ui scripts.
802+
- 'CONTRIBUTING.md'
803+
# identityImportFields.endpointColumns-34536.test.ts holds the
804+
# identity import dialog's columns to what the endpoint reads.
805+
- 'packages/plugins/plugin-auth/src/admin-import-users.ts'
806+
# The ui shard planner and selector tests import the shard
807+
# count from the root roster reader, which imports invoked-as.
808+
- 'scripts/ci-shard-matrix.mjs'
809+
- 'scripts/invoked-as.mjs'
810+
# metadata-form-option-names.test.ts loads the platform zh-CN
811+
# forms pack through `new URL(literal, import.meta.url)` and holds
812+
# the Console's option maps equal to it.
813+
- 'packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts'
814+
# ui-read trade-off: packages/mcp/src/skill-md.ts -- the
815+
# Console's objectstack-skill.test.ts imports it to pin the
816+
# "Download skill" mirror; the server half of that drift pin
817+
# runs in Test Core on every packages/mcp change, and a
818+
# mirror-only diff starts it through the `crosspkg` row (#31017).
819+
# The modules it loads at runtime (ask-skill.generated.ts,
820+
# mcp-http-tools.ts and theirs) inherit this trade-off.
788821
# The seven packages objectui installs from this tree (the set its
789822
# `.objectstack-pin` used to pack). A change here compiles, builds
790823
# and tests the Console in the same PR — the check the retired Spec

0 commit comments

Comments
 (0)