fix(ci): point the main sync-spawn ratchet at the shared ratchet library (#28054)

#27756's script imported baseline helpers from check-focus-read-ratchet.mjs
after #27788 had moved them into ratchet-baseline.mjs, so it crashed on start
and failed every PR that merges main. Use the library's helpers, and record the
two daemon-process launches from #27769 that the broken check never saw.

Co-authored-by: Orca Worker <orca-worker@localhost>
This commit is contained in:
OrcaWin
2026-10-12 13:10:57 -07:00
committed by GitHub
co-authored by Orca Worker
parent 9efce92d91
commit 0ec645f2f0
2 changed files with 11 additions and 23 deletions
+2 -1
View File
@@ -24,6 +24,8 @@
1 src/main/daemon/daemon-process-identity-query.ts
1 src/main/daemon/daemon-process-start-time.ts
1 src/main/daemon/daemon-user-manager-lifetime.ts
1 src/main/daemon/pty-process-ceiling-runtime.ts
1 src/main/daemon/pty-process-ceiling.ts
1 src/main/daemon/pty-subprocess/shell-launch-plan.ts
1 src/main/emulator/serve-sim-runtime-materializer.ts
1 src/main/git/command-runner/git-exec-file.ts
@@ -57,7 +59,6 @@
1 src/main/pwsh.ts
3 src/main/runtime/device-registry.ts
1 src/main/runtime/e2ee-keypair.ts
1 src/main/runtime/mobile-notification-dismissal-store.ts
1 src/main/runtime/push/push-unregister-outbox.ts
1 src/main/runtime/relay/relay-region-preference.ts
1 src/main/runtime/relay/relay-revoke-outbox.ts
@@ -1,13 +1,13 @@
import { globSync, readFileSync, writeFileSync } from 'node:fs'
import { globSync, readFileSync } from 'node:fs'
import path from 'node:path'
import { pathToFileURL } from 'node:url'
import ts from 'typescript-api'
import {
diffCounts,
formatBaseline,
parseBaseline,
parseBaselineNotes
} from './check-focus-read-ratchet.mjs'
parseCountBaseline,
pruneCountBaseline,
totalCount
} from './ratchet-baseline.mjs'
import { literalString, propertyName, unwrap } from './static-module-specifiers.mjs'
import { isTestOnlySourcePath } from './test-only-source-path.mjs'
@@ -384,15 +384,11 @@ export function collectSyncSpawnSources(root = ROOT) {
)
}
function total(counts) {
return [...counts.values()].reduce((sum, count) => sum + count, 0)
}
export function main(root = ROOT) {
const { counts, symbols } = countSyncSpawnUses(collectSyncSpawnSources(root))
const { grown, shrunk } = diffCounts(
counts,
parseBaseline(readFileSync(path.join(root, BASELINE_PATH), 'utf8'))
parseCountBaseline(readFileSync(path.join(root, BASELINE_PATH), 'utf8'))
)
for (const { file, now, allowed } of grown) {
console.error(
@@ -408,24 +404,15 @@ export function main(root = ROOT) {
return 1
}
console.log(
`Main sync-spawn ratchet OK — ${total(counts)} use(s) in ${counts.size} legacy file(s).`
`Main sync-spawn ratchet OK — ${totalCount(counts)} use(s) in ${counts.size} legacy file(s).`
)
return 0
}
export function prune(root = ROOT) {
const baselineFile = path.join(root, BASELINE_PATH)
const text = readFileSync(baselineFile, 'utf8')
const { counts } = countSyncSpawnUses(collectSyncSpawnSources(root))
// Lowers entries only; growth still has to be fixed in the code.
const pruned = new Map(
[...parseBaseline(text)].map(([file, allowed]) => [
file,
Math.min(allowed, counts.get(file) ?? 0)
])
)
writeFileSync(baselineFile, formatBaseline(pruned, BASELINE_HEADER, parseBaselineNotes(text)))
console.log(`Pruned ${BASELINE_PATH} to ${total(pruned)} use(s).`)
const kept = pruneCountBaseline(root, BASELINE_PATH, BASELINE_HEADER, counts)
console.log(`Pruned ${BASELINE_PATH} to ${kept} use(s).`)
}
if (process.argv[1] && import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href) {