You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit efead6c
Browse filesBrowse the repository at this point in the historyBrowse files
feat(ci): differential gate for newly added cross-file line citations, and retire two stored line-number ledgers (objectui#8875) (#8974)
Ruling C on objectui#8875, clauses 2, 3 and 5. Clause 1 (the convention text in
AGENTS.md) is a governed surface and lands as a separate, human-merged PR.
Clause 2 — a DIFFERENTIAL gate. `scripts/check-new-cross-file-line-citations.mjs`
reports the cross-file line-address citations a pull request ADDS, against its
merge base. The 540 existing citations are not its denominator and it sweeps
none of them. An absolute count was refused on a measurement: PR #8887's line
shifts flipped one citation from `drifted` to `resolves` by accident, moving the
tree-wide false count 540 -> 539, an unearned green that belonged to nobody.
It ships report-only (`ENFORCEMENT`), wired into its own workflow so it can see
the markdown-, docs- and changeset-only pull requests `lint.yml` short-circuits.
Its four synthetic controls are fatal in both modes — a differential gate that
reports zero through a broken differ is indistinguishable from a clean branch.
`unresolvable` (chiefly regenerated `dist/*.d.ts`) is a third verdict and is
never counted false.
Clause 3 — the two stored ledgers stop storing line numbers.
`UNGATED_EXAMPLES` is re-keyed from `path:line symbol` to `path symbol
#ordinal`, and the zh-only family citations in the designer-table parity gate
become `{ file, anchor }` with the anchor asserted present in the file exactly
once. Behaviour-preserving on today's tree, proven by before/after runs: the
doc-example gate's whole report is byte-identical, and 89 of 89 ledger rows map
onto the new keys with unchanged values.
Clause 5 — the firing control the ruling asked to keep is intact, but not at
the address the ruling gives. Reported on the card.
Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: content/docs/guide/ci-cd-pipeline.md
+73Lines changed: 73 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,7 @@ one has its own section below.
41
41
|`shell-escape-residue.yml`| Shell Escape Residue Scan | Push / PR to `main`, `develop` — **no path filter**; merge-queue builds; manual |**Yes** — when a fenced block in `AGENTS.md`, `CLAUDE.md`, `skills/**` or `content/docs/**` carries the enumerated machine-produced shell escape, or a scan root fails to resolve |
42
42
|`readme-exports.yml`| README Export Check | Push / PR to `main`, `develop` — **no path filter**; merge-queue builds; manual |**Yes** — when a `packages/**/README.md` imports a name from its own package that the package does not export, or the scan's population collapses |
43
43
|`docs-route-eager-closure.yml`| Docs Route Eager Closure Check | Push / PR to `main`, `develop` — **no path filter**; merge-queue builds; manual |**Yes** — when a package named in `apps/site/app/components/registerCatalogBlocks.ts` is not already reachable from the docs route's module graph (exit 1), or when the gate's own gauge cannot be trusted (exit 2) |
44
+
|`line-citation-gate.yml`| Line Citation Gate | PR to `main`, `develop` — **no path filter**; manual | No — **report-only** while it beds in; it exits 0 whatever it finds, and exits 1 only when one of its own synthetic controls fails. It declares no `merge_group` trigger, so it cannot be a required context in its current state |
44
45
|`governed-surface-guard.yml`| Governed Surface Queue Guard | PR to `main`, `develop` (incl. `ready_for_review`) — **no path filter**; merge-queue builds |**Yes on a queue build only** — a governed-surface diff with no authorized approval record (on any commit) is refused there; on the pull request itself it is deliberately green and prints an early warning |
|`lockfile-integrity.yml`| Lockfile Integrity Check | PR to `main`, `develop` touching `pnpm-lock.yaml` or the gate's own two files; manual | No — **deliberately not a blocking context** ([#8326](https://github.com/objectstack-ai/objectui/issues/8326)); it names the packages and the Dependabot merge gate classifies it `NOT_A_GATE`|
@@ -1597,6 +1598,78 @@ workflow runs as its own first step because a rotted predicate must redden rathe
1597
1598
governed diff through, and the wiring is pinned by
**Triggers:** Pull requests to `main`/`develop`, with **no path filter**, plus manual dispatch. It
1604
+
appears in the checks list as **Line Citation Gate**.
1605
+
1606
+
**What it runs:**`node scripts/check-new-cross-file-line-citations.mjs` — one `node` call over the
1607
+
pull request's own diff. No install, no build.
1608
+
1609
+
**Report-only.** This step **exits 0 regardless of what it finds**. It is not a required context, it
1610
+
declares no `merge_group` trigger, and `scripts/dependabot-merge-gate.mjs` classifies it
1611
+
`NOT_A_GATE` for that reason. The one thing that does make it exit 1 is a failure of its own
1612
+
synthetic controls — a differential gate reporting zero through a broken differ is indistinguishable
1613
+
from a clean branch, so the instrument is checked on every run.
1614
+
1615
+
### What it reads, and the word that decides its shape
1616
+
1617
+
The maintainer ruled the class on 2026-09-10, verbatim: 「跨文件的「某文件第几行」引用,
1618
+
这种完全没必要吧,是否应该避免」. A cross-file line address points somewhere the reader is not
1619
+
looking, and nothing tells them when it moves. Five spellings are read, written here with `NNN`
1620
+
standing in for the digits **on purpose** — a real address in this paragraph would be one more
1621
+
citation for the gate to report, which is the shape of the problem rather than a description of it:
1622
+
1623
+
| spelling | example, digits elided |
1624
+
|---|---|
1625
+
| the dominant form |`NAME.ts:NNN`|
1626
+
| the GitHub permalink form |`NAME.ts#LNNN`|
1627
+
| the address written first |`line NNN of NAME.ts`|
1628
+
| the address written second |`NAME.ts line NNN`|
1629
+
| the **continuation** form, which carries no filename at all | a bare `:NNN` beside an address written on a neighbouring line |
1630
+
1631
+
The continuation form is the one no basename-anchored probe can see, and it is why a one-syntax
1632
+
count is not a reading. Measured on this tree: 1,267 such citations, 540 of them already false.
1633
+
1634
+
The gate is **differential**. It reads only what a pull request **adds**, against its merge base with
1635
+
the target branch. The 540 existing citations are **not** its denominator and it does **not** sweep
1636
+
them in: shifting an already-false address by a hunk delta moves a wrong pointer to a differently
1637
+
wrong place while making the diff look diligent.
1638
+
1639
+
An absolute count was refused on a measurement rather than on taste. PR #8887's line shifts flipped
1640
+
one citation from `drifted` to `resolves` by accident, moving the tree-wide false count 540 → 539 —
1641
+
an unearned green that belonged to nobody, and one a total-reading gate would have scored as
1642
+
progress.
1643
+
1644
+
### The three verdicts, and the one that must not collapse
1645
+
1646
+
Every added citation is a finding — the convention is that the address is not written, not that it
1647
+
is written accurately — but each carries the verdict a reader would reach by following it:
1648
+
1649
+
| verdict | meaning |
1650
+
|---|---|
1651
+
|`false`| the cited line does not carry what the citing prose says it does |
1652
+
|`resolving`| it does, today |
1653
+
|`unresolvable`| nothing can ever decide it — chiefly citations into regenerated `dist/*.d.ts`, which are untracked and rebuilt, plus bare basenames that name several tracked files at once |
1654
+
1655
+
`unresolvable` is **never** counted as `false`. Calling an undecidable citation wrong is an
1656
+
assertion, and the split is pinned by a synthetic control so it cannot quietly regress.
1657
+
1658
+
### What flips it to blocking
1659
+
1660
+
`ENFORCEMENT` in the script is the whole switch, and its test reads the landed value, so the flip
1661
+
cannot happen without the pin moving with it. It flips once the gate reads zero new citations across
1662
+
the in-flight population and the convention text has landed in `AGENTS.md` — an author failed by a
1663
+
rule is owed a document to be failed against. When it does flip, this workflow owes a `merge_group`
1664
+
leg before the context may be required: a required check that never reports on a queue build stalls
1665
+
the queue until the ruleset's 60-minute timeout fails it.
1666
+
1667
+
### The related report
1668
+
1669
+
`pnpm census:cross-file-line-citations` is the tree-wide census the differential gate was derived
1670
+
from. It runs in no workflow, prints the whole population with its per-directory split, and is the
1671
+
right instrument for asking how large the existing class is — never for deciding a pull request.
1672
+
1600
1673
## Lockfile Integrity (`lockfile-integrity.yml`)
1601
1674
1602
1675
**Triggers:** Pull requests to `main`/`develop` that touch `pnpm-lock.yaml`,
0 commit comments