Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

Commit ff1d5ea

Browse files
claude[bot]claudeos-try-charles
authored
ci(deps): require the committed lockfile to be deduped (objectui#8333 remedy A) (#9389)
Part of objectui#8333 — remedy **A**. Deliberately **not** a closing reference: this PR takes one decision (enrolling the new check as *blocking* for Dependabot auto-merge) that sits in the same class as a reservation objectui#8326's own header makes to the maintainer. See "The decision this PR takes" below; the card should close when that is confirmed, or when the name is deliberately demoted. ⛔ **This PR stays DRAFT.** Not flipped ready, not enqueued, no auto-merge. ## What this delivers objectui#8333's ruling was **B then A**: - **B** = objectui#9215, the lockfile dedupe. ✅ Landed (PR objectui#9316, merged `69aa9c017f`). ⛔ Not touched here. - **A** = require `pnpm dedupe` in the bump PR, so `Bundle Analysis` measures the bump alone. This is **A**: a new gate `scripts/check-lockfile-dedupe.mjs` + `.github/workflows/lockfile-dedupe.yml` that runs `pnpm dedupe --check` and requires the committed lockfile to have nothing left to collapse, classified in `OPTIONAL_CONTEXTS` so a red stops a Dependabot auto-merge. ⭐ The deeper reason it is worth a gate rather than a note: **it is what keeps B from decaying.** `pnpm dedupe` in a bump PR is only cheap while `main` is already deduped. Nothing today holds that property — objectui#8326's gate is a ratchet that watches for copies *gained*, and is correctly green on a tree that is merely duplicated. Without this, `main` drifts back and A becomes expensive and unreadable again. ## ⚠️ Every number in the card is superseded — re-derived here, ⛔ none inherited All readings on `origin/main` = `80eb827f60409001399b5b55c7554188cf9aa7c7`, pnpm 10.31.0, Node v22.22.2, dedicated worktree. The card's figures were already superseded once by its own first round; they moved **again** since. | reading | card (2026-09-07) | round 1 (2026-09-11) | **here, on `80eb827f60`** | |:--|:--|:--|:--| | better-auth latest for `^1.7.2` | 1.7.3 | 1.7.4 | **1.7.4** | | the forked zod | 4.5.4 | 4.6.2 | **4.6.4** | | base zod peer contexts | 99 | 97 + 5 | **23 × 4.4.3 + 2 × 3.25.76 = 25** | | after the bump | 25 + 89 | 23 + 87 | **7 × 4.4.3 + 22 × 4.6.4 + 2 × 3.25.76 = 31** | ⇒ read the card's title as a **mechanism**, ⛔ never as a reading. **⛔ Populations, named, because three different ones are in play here and merging them is this card's own recorded failure:** - `packages:` entry keys = **distinct resolved identities** (`name@version`, no peer suffix). - `snapshots:` entry keys = **physical copies** (identity × peer context). - `(zod@ver)` substrings inside snapshot keys = **peer-context mentions**; one key can carry several. ⚠️ The parser that produced these was **wrong on its first version and caught before any number was used**: a lazy group let ` resolution:` match as an entry key, inflating `packages:` to 6350. It is validated against an independent `grep -cE "^ '?[^ ].*:"` over the same byte ranges, and the two now agree exactly at **1767 / 1773**. ## The measurement ### 1. Control — the resolver is deterministic here, both directions, same run ``` pnpm install --lockfile-only (unmodified base) -> exit 0 git diff --stat -- pnpm-lock.yaml -> 0 bytes of output sha256 778e8dc427318a5b570ea1d5e16642ac054cae4ae30b10583da01dbf55ca331d HEAD:pnpm-lock.yaml sha256 778e8dc427318a5b570ea1d5e16642ac054cae4ae30b10583da01dbf55ca331d worktree pnpm-lock.yaml non-empty guard: 682,076 bytes (sha256 of the empty string is e3b0c44298fc1c14…) ``` Positive leg, same tree, same run — appending two bytes makes the same command print `1 file changed, 2 insertions(+)`, then `git checkout HEAD -- pnpm-lock.yaml` restores it (`git diff HEAD --stat` 0 bytes). ### 2. The fork reproduces, and the gate catches it Bumping **only** the declaration `packages/auth/package.json` `better-auth` `^1.7.2` → `^1.7.4`, then a plain `pnpm install --lockfile-only`: | population | base `80eb827f60` | after the bump | after `pnpm dedupe` | |:--|--:|--:|--:| | `packages:` entry keys (identities) | 1767 | **1768** | 1767 | | `snapshots:` entry keys (physical copies) | 1773 | **1780** | 1773 | | zod distinct physical copies | 2 | **3** | 2 | | zod peer-context mentions | 25 | **31** | 25 | | `check-lockfile-integrity` (objectui#8326) | — | **exit 1**, 5 findings | exit 0, `VERDICT clean` | | **this gate** | **exit 0** | **exit 1** | exit 0 | This gate's red names them: ``` VERDICT not deduped — `pnpm dedupe` would still collapse duplicate copies: @ai-sdk/gateway, @ai-sdk/provider-utils, @objectstack/formula, @objectstack/lint, @objectstack/spec, ai, zod, zod-validation-error. ``` The mutation was proved on disk in both directions (old text count 1→0, new text 0→1) before the resolve, under a `trap … EXIT INT TERM`; restoration proved by sha256 back to `778e8dc4…` and `packages/auth/package.json` back to `33b2338d…`, not by an exit code. ⛔ Nothing from this leg is in the diff — `git status` after it shows only the new files. ### 3. ⭐ B-then-A, confirmed: the collateral is now exactly zero This is the claim triage's ruling rests on, and it had never been measured after B landed. ``` delta of POPULATION "packages: entry keys", base 80eb827 -> bump + pnpm dedupe 1767 -> 1767 ADDED (9): @better-auth/{core,drizzle-adapter,kysely-adapter,memory-adapter, mongo-adapter,prisma-adapter,telemetry}@1.7.4, better-auth@1.7.4, zod@4.6.4 REMOVED (9): the same eight at 1.7.2, and zod@4.4.3 ``` ⇒ **nothing but the bump and the zod it forked.** A bump PR that runs `pnpm dedupe` today carries no collateral at all, so `Bundle Analysis` measures the bump. **Control with a known direction, and it hits:** the same delta across B itself (`28be0786d9` → `69aa9c017f`) is **47 removed / 0 added** — independently reproducing objectui#9215's figure. That 47 is exactly what a bump PR's dedupe would have dragged along *before* B. ⇒ B-before-A was load-bearing, ⛔ not tidiness. ### 4. What it would have caught, and the determinism leg ``` pnpm dedupe --check on 28be078 (pre-B main) -> exit 1, sentinel present, 60 removal lines pnpm dedupe --check on 80eb827 (current main) -> exit 0 x3 consecutive runs wall 22.8s / 22.9s / 23.2s ``` ⇒ the zero is not a command that cannot fire: the identical command reds one commit range earlier. ### 5. ⚠️ It is not a registry-drift-flaky gate — measured, not assumed The obvious objection to any gate that resolves against a live registry is that a publish reds it spontaneously. Measured directly: `better-auth` is declared `^1.7.2`, locked at **1.7.2**, and the registry serves **1.7.4**, which that range admits — and this gate is **green** on that tree. ⇒ `pnpm dedupe` collapses copies already in the tree rather than chasing the newest version in range. ⚠️ Stated as what it is: one measured instance plus pnpm's documented behaviour, ⛔ not a proof over all future pnpm versions. The instrument that re-derives it is this gate's own run history. ### 6. PM's reading at `#issuecomment-5652441791`, re-measured on a sharper population — it holds That note read `zod` mentions as `141 → 141 → 141` across B and concluded the dedupe left this neighbourhood unmoved. `grep -c zod` is a raw-string population that could in principle be blind to a peer-context change, so it was re-taken on two populations that are not: | | pre-B `28be0786d9` | post-B `69aa9c017f` | current `80eb827f60` | |:--|--:|--:|--:| | zod distinct physical copies | 2 | 2 | 2 | | zod peer-context mentions | 25 | 25 | 25 | ⇒ **confirmed, not corrected.** The unblocking card genuinely neither helped nor harmed this one. ## The decision this PR takes, and the fence next to it `Lockfile Dedupe Check` is classified in `OPTIONAL_CONTEXTS` — blocking when it runs. Its neighbour `Lockfile Integrity Check` is in `NOT_A_GATE` and **stays there, untouched**, because objectui#8326's header reserves that promotion for the maintainer. ⚠️ Enrolling a *new* lockfile check as blocking is the same **class** of decision, so it is surfaced here rather than taken silently. The argument for treating it differently: 1. **Different remedy.** objectui#8326's gate names a duplication and leaves the answer open — re-lock, pin, or accept the split — a judgement call. This gate has exactly one mechanical remedy and pnpm prints it: `pnpm dedupe`, changing no declaration, range or override. 2. **Different blast radius.** `dependabot-merge-gate.mjs` is consulted only by `dependabot-auto-merge.yml` (`if: github.actor == 'dependabot[bot]'`). Enrolment changes what may **auto-merge**, which is precisely the "bump PR" remedy A names. It does not touch branch protection or the merge-queue required set, which this repo can neither read nor change. 3. **Measured cost, and it is near zero — today.** Green on `main` as it stands, so nothing currently mergeable is blocked. That is true *only because* objectui#9215 landed first; on pre-B `main` the same command reds. ⇒ ⚠️ **If the maintainer would rather it not block**, the flip is one line: move the name from `OPTIONAL_CONTEXTS` to `NOT_A_GATE`. `scripts/__tests__/check-lockfile-dedupe.test.ts` fails on that demotion, so it stays a decision rather than a drift; ⛔ deleting the name from both buckets fails the partition test instead. ## Why a gate, and not the other two shapes - ⛔ **A dependabot-workflow step that pushes the dedupe** — rejected: pushing to a Dependabot branch stops Dependabot from maintaining the PR, and it needs write permissions on a workflow that currently has none of that shape. - ⛔ **A documented + pinned convention** — rejected: nothing re-derives it. AGENTS.md commandment #9 is explicit that prose declaring something checked states a fact derived once and never again. - ✅ **A gate**, because the repo already has this exact shape: a path-filtered, blocking-when-it-runs check, enrolled as `OPTIONAL_CONTEXTS`. `Bundle Analysis` is enrolled on those terms and its filter also includes `pnpm-lock.yaml`. ⛔ **C and D stay rejected and are not implemented**: an `overrides` pin and bumping the five declarations both spend a declaration to fix a resolution artefact. ⚠️ Noted for whoever writes an override in this repo later: objectui's `pnpm.overrides` lives in the **root `package.json`** (9 entries in force); `pnpm-workspace.yaml` has no `overrides` key. ## The tests, and the ablations that prove they can fail A passing test proves nothing until it has been made to fail. Both ablations declared their direction in advance, mutated on disk with a proof, and restored under a trap with the restore proved by sha256. | ablation | partition test | this PR's pin test | |:--|:--|:--| | delete the `Lockfile Dedupe Check` classification entirely | **RED** (1 failed, at `unclassified`) | — | | move the name `OPTIONAL_CONTEXTS` → `NOT_A_GATE` | **green (exit 0)** | **RED** (2 failed) | ⇒ the two are not redundant: the existing partition test cannot see a **demotion**, which is exactly the silent change that would turn this gate into an alarm. That is the gap the new pin fills. Restores proved by `sha256 89c192811f5e64e5d932ee6e3a18d18b73d0860854265ece5558689b9d716bc9` both times, plus the occurrence count back to 1. ## Gates run locally Exit codes captured **before** any pipe (`cmd > file 2>&1; EXIT=$?`). ``` node scripts/check-lockfile-dedupe.mjs --self-test exit 0 17 cases node scripts/check-lockfile-dedupe.mjs exit 0 VERDICT deduped node scripts/check-lockfile-integrity.mjs exit 0 VERDICT clean node scripts/check-pre-install-import-graph.mjs exit 0 (picks up the new gate: builtins + one repo-relative import) node scripts/check-changeset-presence.mjs exit 0 node scripts/check-changeset-{no-major,overwrite,claims,fixed}.mjs exit 0 node scripts/check-control-bytes.mjs exit 0 node scripts/check-action-ref-convention.mjs exit 0 node scripts/check-doc-links.mjs exit 0 node scripts/check-doc-fence-languages.mjs exit 0 node scripts/check-shell-escape-residue.mjs exit 0 node scripts/check-governed-queue-guard.mjs --test (7 paths) exit 0 NOT GOVERNED control in the same run: AGENTS.md -> GOVERNED pnpm exec tsc -p tsconfig.scripts.json exit 0 --listFiles confirms the new test IS in the program (1 hit), so this is a measurement pnpm exec vitest run --project unit scripts/__tests__ exit 0 153 files, 4516 tests ``` **Lint, run whole rather than narrowed.** `eslint .` over the root population — its own config, not a guess at it — is **349 files, 0 errors, 32 warnings**, all 32 pre-existing. Anti-vacuity: all three edited/added JS/TS files appear in the `--format json` output, each at 0 errors / 0 warnings. Run on the final commit, `git rev-parse --short HEAD` = `43d5d4f`. Control-byte sweep beyond the gate, over the seven changed paths: `grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]'` exits 1 (no hits), with a positive control in the same sweep exiting 0. ## ⚠️ Not measured, stated as such Whether the fork numerically reds `Bundle Analysis`. Reachability is structural (after the fork `apps/console` and `@object-ui/app-shell` resolve `@objectstack/spec` to different zod variants, so both enter one Vite graph); the byte delta was not measured here, and under this remedy the question does not arise because the duplication is removed before `Bundle Analysis` ever sees it. This gate also does **not** claim the lockfile is minimal: packages whose ranges genuinely do not overlap keep their copies and are not findings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr --- _Generated by [Claude Code](https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr)_ --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: os-try-charles <mqmscharles@gmail.com>
1 parent 511e402 commit ff1d5ea

8 files changed

Lines changed: 681 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
---
3+
4+
Require the committed `pnpm-lock.yaml` to be deduped (objectui#8333).
5+
6+
New gate `scripts/check-lockfile-dedupe.mjs` + `.github/workflows/lockfile-dedupe.yml` runs
7+
`pnpm dedupe --check` on pull requests that touch the lockfile, and the Dependabot merge gate
8+
classifies the resulting `Lockfile Dedupe Check` as a blocking context. A dependency bump can
9+
re-resolve part of the peer graph and fork a single-copy package without changing any declaration,
10+
range or override; `Bundle Analysis` then reads the growth as the bump's. This makes
11+
`pnpm dedupe` a requirement of the bump pull request instead, so that reading is attributable.
12+
13+
CI, scripts and docs only; no package is released by this change.
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
name: Lockfile Dedupe
2+
3+
# objectui#8333 — the committed `pnpm-lock.yaml` must already be DEDUPED, i.e.
4+
# `pnpm dedupe` on it may not collapse anything. The mechanism, what it catches
5+
# and what its green does NOT mean are documented at length in
6+
# `scripts/check-lockfile-dedupe.mjs`.
7+
#
8+
# ── Why this exists next to `lockfile-integrity.yml` rather than inside it ────
9+
#
10+
# They answer different questions. objectui#8326's gate reports a DELTA against
11+
# the merge base — "did THIS change duplicate something?" — and needs two
12+
# revisions of one file to do it. This one reports a PROPERTY of a single tree —
13+
# "would `pnpm dedupe` still have work to do here?" — and needs no base at all,
14+
# but does need pnpm and the registry. Different subject, different cost,
15+
# different failure modes, so they are separate jobs and each stays readable.
16+
#
17+
# ── Why it is path-filtered ──────────────────────────────────────────────────
18+
#
19+
# Its subject is one file. A pull request that does not touch `pnpm-lock.yaml`
20+
# cannot change whether that lockfile is deduped, so the filter costs no
21+
# coverage. A manifest edit that WOULD change the resolution cannot reach `main`
22+
# without moving the lockfile either, because `ci.yml` installs with
23+
# `--frozen-lockfile` and fails first. Same argument shape as its neighbour.
24+
#
25+
# The filter also lists this gate's RUNTIME CLOSURE — the files the job actually
26+
# executes — which is this repository's convention for a path-filtered gate
27+
# (`performance-budget.yml` states it at length): without that, a change to the
28+
# checker itself ships having never run once, and the wiring bug then surfaces on
29+
# somebody else's next lockfile PR, reading to them as a problem of their own.
30+
#
31+
# ⚠️ The filter is also what makes it UNREQUIRABLE: objectui#3523's rule,
32+
# enforced by `scripts/__tests__/dependabot-merge-gate.test.ts`, is that a
33+
# REQUIRED context must come from a workflow whose `pull_request` trigger has no
34+
# path filter. It is enrolled as an OPTIONAL context instead — blocking when it
35+
# runs, not waited for when the filter keeps it out. `Bundle Analysis` is
36+
# enrolled on exactly those terms and its filter also includes `pnpm-lock.yaml`.
37+
#
38+
# ── ⚠️ It IS a blocking context, and that is a decision, not a default ────────
39+
#
40+
# `scripts/dependabot-merge-gate.mjs` classifies `Lockfile Dedupe Check` in
41+
# `OPTIONAL_CONTEXTS`, so a red here stops a Dependabot auto-merge. Its
42+
# neighbour `Lockfile Integrity Check` is deliberately NOT enrolled, and that
43+
# difference is intentional rather than an inconsistency to tidy away:
44+
#
45+
# * #8326's gate reports a duplication and leaves the ANSWER open — re-lock,
46+
# pin, or accept the split — so enrolling it would block pull requests on a
47+
# judgement call with no mechanical remedy. Its header reserves that for the
48+
# maintainer, and ⛔ this file does not touch that reservation.
49+
# * This gate has exactly ONE remedy and pnpm prints it: run `pnpm dedupe` and
50+
# commit the lockfile. No declaration, range or override changes. There is no
51+
# judgement call to reserve.
52+
#
53+
# The cost of enrolling it was measured before it was taken, and it is near zero
54+
# TODAY only because objectui#9215 landed first: on `main` after that collapse
55+
# this gate is green, so nothing currently-mergeable is blocked by it. On `main`
56+
# BEFORE it, the same command reds. ⇒ what this gate really defends is that
57+
# objectui#9215's paydown does not silently accrue again — which is the whole
58+
# reason the bump PR's `pnpm dedupe` is cheap enough to require at all.
59+
#
60+
# ⇒ ⚠️ If this ever needs to stop blocking, the flip is one line: move
61+
# `Lockfile Dedupe Check` from `OPTIONAL_CONTEXTS` to `NOT_A_GATE` in
62+
# `scripts/dependabot-merge-gate.mjs`. The partition test keeps either state
63+
# honest; ⛔ deleting the name from both buckets fails that test rather than
64+
# quietly shrinking the gate.
65+
#
66+
# ── No `merge_group` trigger ─────────────────────────────────────────────────
67+
#
68+
# Deliberate, and the same shape as `lockfile-integrity.yml` and
69+
# `performance-budget.yml`: under objectui#3523 a required context that does not
70+
# report on a queue build stalls the queue until the ruleset timeout fails it, so
71+
# a path-filtered, non-required gate must not subscribe one.
72+
73+
on:
74+
pull_request:
75+
branches: [main, develop]
76+
paths:
77+
- 'pnpm-lock.yaml'
78+
# This gate's runtime closure — the files this job executes. An edit to any
79+
# of them must be able to red this gate on its OWN pull request.
80+
- '.github/workflows/lockfile-dedupe.yml'
81+
- 'scripts/check-lockfile-dedupe.mjs'
82+
# `isEntrypoint` decides whether `main()` runs at all, so a regression in it
83+
# makes this checker exit 0 having measured nothing — the exact silent-green
84+
# failure the rest of this gate exists to prevent. Same reason
85+
# `performance-budget.yml` and `half-state-patrol.yml` list it.
86+
- 'scripts/invoked-as.mjs'
87+
# The toolchain step this job runs before pnpm is on PATH.
88+
- 'scripts/ci-setup-pnpm.sh'
89+
workflow_dispatch:
90+
91+
concurrency:
92+
group: lockfile-dedupe-${{ github.event.pull_request.number || github.ref }}
93+
cancel-in-progress: true
94+
95+
permissions:
96+
contents: read
97+
98+
jobs:
99+
lockfile-dedupe:
100+
name: Lockfile Dedupe Check
101+
runs-on: ubuntu-latest
102+
103+
# ── The job ceiling, DERIVED FOR THIS JOB ────────────────────────────────
104+
#
105+
# ⛔ NOT inherited from `lockfile-integrity.yml`'s 5 or `ci.yml`'s ladder —
106+
# objectui#7048 fences exactly that. The arithmetic below is this job's own,
107+
# and its weakness is stated rather than hidden.
108+
#
109+
# - Population: `pnpm dedupe --check` on a clean `origin/main` worktree,
110+
# n=3 consecutive runs, pnpm 10.31.0 / Node 22.22.2, WARM pnpm metadata
111+
# cache, on a developer box and not a runner: 22.8s / 22.9s / 23.2s, all
112+
# exit 0. Spread 0.4s, so the command itself is not variable.
113+
# - ⚠️ That population is the wrong one for a ceiling and is known to be:
114+
# this workflow has no run history yet, and a runner starts with a COLD
115+
# metadata cache, which is the dominant term. So the max is not measured
116+
# but BOUNDED, pessimistically, at 5 minutes for checkout + Node + the
117+
# Corepack fetch + a cold resolve of ~1,767 identities.
118+
#
119+
# Ceiling = the smallest round number that is both >= 3x that bound (15min)
120+
# and >= bound + 15min (20min); the second leg binds => 20.
121+
#
122+
# ⚠️ Re-derive this from real runs once this workflow has a history — the
123+
# instrument is the Actions jobs endpoint (`completed_at` minus
124+
# `started_at`, per job, never the run total), the same one
125+
# `performance-budget.yml` names. ⛔ Do not copy the number above forward as
126+
# if it were a measurement of this job in CI; it is a bound on one.
127+
timeout-minutes: 20
128+
129+
steps:
130+
# No `fetch-depth: 0` here, unlike its neighbour: this gate's subject is a
131+
# single tree, not a delta, so it needs no merge base and no history.
132+
- name: Checkout code
133+
uses: actions/checkout@v7
134+
135+
- name: Setup Node.js
136+
uses: actions/setup-node@v7
137+
with:
138+
node-version: '22.x'
139+
# No `cache: 'pnpm'` — that action's store probe shells out to pnpm
140+
# before the step below has put it on PATH (objectui#8099 documents
141+
# that exact ordering trap), and this job runs no `pnpm install`, so
142+
# there is no node_modules for a cache to pay for.
143+
144+
- name: Enable Corepack and download the pinned pnpm
145+
run: bash scripts/ci-setup-pnpm.sh
146+
147+
- name: Verify pnpm version
148+
run: pnpm --version
149+
150+
# The checker's own cases, before the checker is trusted to judge anything.
151+
- name: Self-test the checker
152+
run: node scripts/check-lockfile-dedupe.mjs --self-test
153+
154+
# No `pnpm install`: `pnpm dedupe --check` resolves and reports without
155+
# writing a lockfile or a node_modules tree (verified on objectui#8333 —
156+
# the lockfile's sha256 is unchanged across repeated runs).
157+
- name: Check the committed lockfile is deduped
158+
run: node scripts/check-lockfile-dedupe.mjs

‎content/docs/guide/ci-cd-pipeline.md‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ one has its own section below.
4646
| `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, and so is any merge group whose queued pull requests still carry `needs:contract-review`; on the pull request itself it is deliberately green and prints an early warning |
4747
| `performance-budget.yml` | Bundle Analysis | Push / PR touching `packages/**`, `apps/console/**`, `pnpm-lock.yaml` | **Yes** — the console entry gzip budget |
4848
| `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` |
49+
| `lockfile-dedupe.yml` | Lockfile Dedupe Check | PR to `main`, `develop` touching `pnpm-lock.yaml` or the gate's own runtime closure; manual | **Yes, when it runs** — classified `OPTIONAL_CONTEXTS`, so a red stops a Dependabot auto-merge ([#8333](https://github.com/objectstack-ai/objectui/issues/8333)) |
4950
| `live-e2e.yml` | Live E2E (informational) | PR to `main`, `develop` (code paths); nightly cron `30 6 * * *`; manual | No — informational lane: not in the required-check set, and it declares no `merge_group` trigger |
5051
| `labeler.yml` | Auto Label PRs | PR `opened`, `synchronize`, `reopened` | No |
5152
| `dependabot-auto-merge.yml` | Dependabot Auto-merge | PR to `main`/`develop` authored by `dependabot[bot]` | No — but it gates *its own* merge, and goes red instead of merging when the check set is not green |
@@ -1877,6 +1878,60 @@ build-tooling churn. And it says nothing about bytes; `Bundle Analysis` measures
18771878
that filter stands. Enrolling it is a maintainer decision with its own cost, written up on #8326's
18781879
pull request as input.
18791880

1881+
## Lockfile Dedupe (`lockfile-dedupe.yml`)
1882+
1883+
**Trigger:** Pull requests to `main` and `develop` that touch `pnpm-lock.yaml`, this gate's own
1884+
runtime closure (`scripts/check-lockfile-dedupe.mjs`, `scripts/invoked-as.mjs`,
1885+
`scripts/ci-setup-pnpm.sh`) or the workflow file itself, plus manual dispatch. It appears in the
1886+
checks list as **Lockfile Dedupe Check**.
1887+
1888+
Runs `scripts/check-lockfile-dedupe.mjs`, which shells out to `pnpm dedupe --check` and requires the
1889+
committed lockfile to be **already deduped** — that is, `pnpm dedupe` must have nothing left to
1890+
collapse.
1891+
1892+
**How it differs from its neighbour.** `Lockfile Integrity Check` reports a **delta** against the
1893+
merge base ("did *this* change duplicate something?") and needs two revisions of one file.
1894+
This gate reports a **property of one tree** ("would `pnpm dedupe` still have work to do here?") and
1895+
needs no base — but it does need pnpm and the registry. The two are independent: a tree can be
1896+
delta-clean and still carry years of accumulated duplication, which is the state `main` was in until
1897+
[#9215](https://github.com/objectstack-ai/objectui/issues/9215) collapsed 47 identities out of it.
1898+
1899+
**Why it exists.** [#8333](https://github.com/objectstack-ai/objectui/issues/8333) measured the
1900+
sequence: a dependency bump re-resolves part of the peer graph and forks a package that was
1901+
single-copy — no declaration, range or override anywhere in the workspace changes — and
1902+
`Bundle Analysis` then reads a bundle that grew and attributes the growth to the bump. The remedy is
1903+
`pnpm dedupe`, but `pnpm dedupe` is **not surgical**: run on a tree carrying old duplication it
1904+
collapses all of it, and the reviewer reads the combined delta as the bump's — the same
1905+
misattribution, aimed at a different pull request. So the remedy is only honest once the tree is
1906+
already deduped, which is why #8333's ruling was **B then A**: pay the accumulated debt down in its
1907+
own dedicated pull request first (#9215), then require the remedy in bump pull requests. This gate is
1908+
that second half, and it is also what keeps the first half true.
1909+
1910+
**It IS a blocking context**, and that is a decision rather than a default.
1911+
`scripts/dependabot-merge-gate.mjs` classifies it in `OPTIONAL_CONTEXTS`, so a red stops a Dependabot
1912+
auto-merge; its path filter makes it unrequirable under
1913+
[#3523](https://github.com/objectstack-ai/objectui/issues/3523)'s rule, the same terms
1914+
`Bundle Analysis` is enrolled on. It blocks where `Lockfile Integrity Check` deliberately does not
1915+
because the two differ in **remedy**: #8326's gate names a duplication and leaves the answer open
1916+
(re-lock, pin, or accept), a judgement call its header reserves for the maintainer, while this gate
1917+
has exactly one mechanical remedy and pnpm prints it — run `pnpm dedupe` and commit the lockfile,
1918+
changing no declaration, range or override. To stop it blocking, move the name to `NOT_A_GATE`;
1919+
`scripts/__tests__/check-lockfile-dedupe.test.ts` fails on that demotion so it has to be taken
1920+
deliberately.
1921+
1922+
**⛔ What its green does not mean.** It does not say the lockfile is *minimal* — packages whose
1923+
ranges genuinely do not overlap keep their separate copies and are not findings. It does not measure
1924+
bytes; `Bundle Analysis` does. And it is not a check that drifts with the registry: `pnpm dedupe`
1925+
collapses copies already in the tree rather than chasing the newest version a range admits, which
1926+
#8333 measured directly (`better-auth` declared `^1.7.2`, locked at `1.7.2`, with `1.7.4` published
1927+
and admitted by that range — and this gate green on that tree).
1928+
1929+
**⛔ What it does not do.** It does not run `pnpm dedupe` for you, and it never edits the lockfile —
1930+
`--check` reports without writing. A finding is fixed in the pull request that caused it, by running
1931+
the command and committing the result. ⛔ Pinning a version, adding a `pnpm.overrides` entry or
1932+
widening a range are **not** acceptable ways to satisfy it: #8333 rejected all three, on the grounds
1933+
that they spend a declaration to fix a resolution artefact.
1934+
18801935
## Link Checking (`check-links.yml`)
18811936

18821937
**Trigger:** Weekly cron (`17 4 * * 0` — Sundays, off the top of the hour, when the scheduled-run

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
"check:merge-queue-head": "node scripts/check-merge-queue-head.mjs --self-test",
9090
"check:required-check-set": "node scripts/check-required-check-set.mjs --self-test",
9191
"check:lockfile-integrity": "node scripts/check-lockfile-integrity.mjs",
92+
"check:lockfile-dedupe": "node scripts/check-lockfile-dedupe.mjs",
9293
"merge-queue-head": "node scripts/check-merge-queue-head.mjs",
9394
"check:pre-install-import-graph": "node scripts/check-pre-install-import-graph.mjs",
9495
"check:test-path-roots": "node scripts/check-test-path-roots.mjs",

0 commit comments

Comments
 (0)