Repository navigation
Commit c679140
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
File tree
- .github/workflows
- scripts
- ui/scripts
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
732 | 732 | | |
733 | 733 | | |
734 | 734 | | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
739 | 741 | | |
740 | 742 | | |
741 | 743 | | |
| |||
773 | 775 | | |
774 | 776 | | |
775 | 777 | | |
776 | | - | |
777 | | - | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
778 | 797 | | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
| 798 | + | |
787 | 799 | | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
788 | 821 | | |
789 | 822 | | |
790 | 823 | | |
| |||
0 commit comments