Skip to content

Commit cd1da85

Browse files
thecodedriftclaude
andcommitted
docs(vale): correct the workflow header that still contradicted the gate
The PR that added the gate amended design.md D5 to distinguish a stamped-version check (impossible) from a base-version check (the gate), specifically so nobody would later delete the gate for disagreeing with the design — and left the near-identical paragraph in the workflow's own header, a few dozen lines above the job it describes, still asserting that such a check "could never suppress anything". Fix the header to draw the same distinction, and list `gate` in the TWO PHASES summary alongside prepare and publish. Also run the six registry lookups concurrently. They are independent, and the job's whole justification is deciding cheaply before prepare downloads ~60 MB; sequential awaits made the gate six round trips deep for no reason. Order is unaffected — `missing` is built by filtering manifest.platforms, not by completion order. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jwc9FFroR3mTZ4hLiSkkX3
1 parent 5937436 commit cd1da85

2 files changed

Lines changed: 29 additions & 10 deletions

File tree

.github/scripts/vale-gate.cjs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,17 @@ async function main({
114114
JSON.parse(readFileSync(MANIFEST_PATH, "utf8"))
115115
);
116116

117-
const publishedByPackage = {};
118-
for (const platform of manifest.platforms) {
119-
publishedByPackage[platform.package] = await published(platform.package);
120-
}
117+
// Concurrent, not sequential: the six lookups are independent, and this job
118+
// exists to decide cheaply BEFORE prepare downloads ~60 MB. Sequential awaits
119+
// would make the gate six round trips deep for no reason.
120+
const publishedByPackage = Object.fromEntries(
121+
await Promise.all(
122+
manifest.platforms.map(async (platform) => [
123+
platform.package,
124+
await published(platform.package),
125+
])
126+
)
127+
);
121128

122129
const plan = planPublish({ manifest, publishedByPackage, forced });
123130

.github/workflows/vale-binaries.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,31 @@
1616
# It publishes nothing.
1717
#
1818
# publish Runs on the push to main that merges that pull request — i.e. once
19-
# a human has reviewed the digests. Split further into `prepare` and
20-
# `publish` below.
19+
# a human has reviewed the digests. Split further into `gate`,
20+
# `prepare`, and `publish` below, where `gate` decides whether the
21+
# pinned version still needs publishing at all.
2122
#
2223
# A single job that discovered a digest and then verified downloads against the
2324
# digest it had just discovered would verify nothing. Splitting the phases is
2425
# what makes the automation trustworthy: nothing is published on bytes nobody
2526
# signed off on, and nobody has to notice a Vale release for the process to run.
2627
#
27-
# WHAT BOUNDS A RUN is the upstream-version comparison, and only that. A "is
28-
# this version already on npm?" check — the thing release.yml uses — cannot work
28+
# WHAT BOUNDS A RUN is the upstream-version comparison plus the `gate` job, and
29+
# the distinction between them is worth stating precisely because half of it is
30+
# a trap (design D5).
31+
#
32+
# A check against the STAMPED version — the thing release.yml uses — cannot work
2933
# here: every publish stamps <valeVersion>-<yyyymmddhhmmss>, a version npm has
30-
# never seen, so such a check would answer "not published" every time and could
31-
# never suppress anything (design D5).
34+
# never seen, so it would answer "not published" every time and could never
35+
# suppress anything.
36+
#
37+
# A check against the BASE version is a different question and does work. "Has
38+
# anything been published for Vale 3.17.1?" is satisfied by a published 3.17.1
39+
# or any 3.17.1-* stamp, which is exactly the set this workflow can mint for it.
40+
# `gate` runs that check, because the push trigger below fires on ANY edit to
41+
# vale-manifest.json and a `paths:` filter cannot see why the file changed — a
42+
# reworded comment would otherwise publish six packages. An explicit dispatch
43+
# passes --force and is never suppressed.
3244
#
3345
# WHY prepare AND publish ARE SEPARATE JOBS: `prepare` downloads third-party
3446
# bytes off the internet. It holds `contents: read`, no environment, and no

0 commit comments

Comments
 (0)