@rightkit/release 0.6.93 → 0.6.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/acceptance-cases.mjs +19 -3
- package/bin/rightkit-gate.mjs +10 -4
- package/build-release.mjs +14 -1
- package/deterministic-scans.mjs +27 -4
- package/package.json +1 -1
- package/rightkit-versions.json +45 -32
- package/smoke-run.mjs +107 -0
- package/snapshot.mjs +28 -5
package/acceptance-cases.mjs
CHANGED
|
@@ -54,6 +54,19 @@ export function isDenyPreparation(start) {
|
|
|
54
54
|
}
|
|
55
55
|
/** NN03's view of Class A work: a row's own program, or the deny row's preparation, which starts the row on time though cargo deny starts after it. */
|
|
56
56
|
const isClassAWork = (start) => isClassAProgram(start) || isDenyPreparation(start);
|
|
57
|
+
/**
|
|
58
|
+
* A deny row's later programs: its `cargo metadata`, the `cargo deny` it then starts and the cargo-deny executable that one starts. The row itself began at its
|
|
59
|
+
* `cargo fetch --locked` (deterministic-scans.mjs, the deny row: fetch, then metadata, then deny, always in that order), so these are the row going on, not a
|
|
60
|
+
* row starting. 0.6.94 acceptance, 29 Nov: one row's fetch took 4.5 s; its `cargo deny` started 2225 ms after the last program of the five rows beside it and
|
|
61
|
+
* NN03 read the last row of the run as waiting beside a free lane.
|
|
62
|
+
*/
|
|
63
|
+
export function isDenyContinuation(start) {
|
|
64
|
+
const name = programName(start.program);
|
|
65
|
+
if (name === "cargo-deny") return true;
|
|
66
|
+
if (name !== "cargo") return false;
|
|
67
|
+
const args = (start.args ?? []).map(String).filter((a, i) => !(i === 0 && a.startsWith("+")));
|
|
68
|
+
return cargoVerb(args) === "deny" || (args[0] === "metadata" && isDenyPreparation(start));
|
|
69
|
+
}
|
|
57
70
|
/** The workspace, verb, feature flags and targets of a broker job: what NN09 holds against the cases file's exact list. A command that names no --target builds for the host. */
|
|
58
71
|
export function groupOf(job, hostTarget) {
|
|
59
72
|
const args = job.args ?? []; const snap = plain(job.gate?.snapshot); const cwd = plain(job.cwd);
|
|
@@ -239,10 +252,13 @@ const LINES = {
|
|
|
239
252
|
const need = Math.min(lanes, progs.length);
|
|
240
253
|
// A later program is a row that was still waiting at the earlier start. If a lane was free after that earlier start and the waiting row started more than
|
|
241
254
|
// `slackMs` later, a row waited beside an idle lane.
|
|
255
|
+
// The gap is measured between ROW starts: a deny row's later programs (isDenyContinuation) are that row going on. They still count as running (runningAt),
|
|
256
|
+
// so a lane they hold is not read as free.
|
|
242
257
|
const slackMs = cases.nn03SlackMs ?? 2000; let idle = 0; let worst = null;
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
258
|
+
const rowStarts = progs.filter((p) => !isDenyContinuation(p));
|
|
259
|
+
for (let i = 1; i < rowStarts.length; i += 1) {
|
|
260
|
+
const gap = rowStarts[i].at - rowStarts[i - 1].at; const free = runningAt(rowStarts[i - 1].at) < lanes;
|
|
261
|
+
if (free && gap > slackMs) { idle += 1; if (!worst || gap > worst.gap) worst = { gap, name: programName(rowStarts[i].program) }; }
|
|
246
262
|
}
|
|
247
263
|
if (idle) fails.push(`${idle} Class A program(s) started more than ${slackMs} ms after the one before while a lane was free (longest: ${programName(worst.name)} after ${worst.gap} ms)`);
|
|
248
264
|
if (peak < Math.min(need, 2)) fails.push(`at most ${peak} Class A program(s) ran at a time on ${lanes} lanes`);
|
package/bin/rightkit-gate.mjs
CHANGED
|
@@ -63,7 +63,8 @@
|
|
|
63
63
|
// statically) are all identical. Stored in <git common dir>/rightkit-gate-cache; a hit prints
|
|
64
64
|
// `cached` and is listed in the result's cacheHits. A deterministic failure (NN41: a compile's authenticated or diagnosed failure, a file-only rule's violations) is cached too and prints `cached-fail`; timeouts, aborts, refusals, infrastructure errors and test runs never are.
|
|
65
65
|
// Class A scan concurrency is the host's core count; no caller sets it. Class B on a broker host (rightkit#1367 step 2): the gate does not count builds; every
|
|
66
|
-
// component's broker-carried scans (cargo, rustright, carried Swift, and npm suites that declare a broker call)
|
|
66
|
+
// component's broker-carried scans (cargo, rustright, carried Swift, and npm suites that declare a broker call) are filed in plan order, at most BROKER_CLASS_B_WINDOW
|
|
67
|
+
// requests at the broker at once (0.6.94: a request the broker holds QUEUED past its queue deadline is ended, so the gate files the next when one ends),
|
|
67
68
|
// and the broker queues and orders them. A carried scan's run limit is a stopwatch that stops while the broker holds all its requests QUEUED (broker-admission.mjs),
|
|
68
69
|
// so queue time is neither charged to the scan nor bounded by a gate allowance. Only class B suites the broker never sees (npm or node tests run on this host)
|
|
69
70
|
// keep a local limit of 3, one slot per suite. On a host with no broker 3 components' class B scans run at once; one
|
|
@@ -86,7 +87,7 @@ import { FOREIGN_PRE_COMMIT, retireHooksIn } from "../hook-retirement.mjs";
|
|
|
86
87
|
import { fileURLToPath } from "node:url";
|
|
87
88
|
import { installIdentity, installStateBytes } from "../dependency-identity.mjs";
|
|
88
89
|
import { pnpmVersionAnswer } from "../snapshot-dependency-reuse.mjs";
|
|
89
|
-
import { BIOME_CONFIG_FILES, CHECKER_IDENTITY, OXLINT_CONFIG_FILES, ESLINT_CONFIG_FILES, LOCAL_CLASS_B_JOBS, WORKSPACE_RUST_FILE, ancestorConfigChanged, ancestorDirsOf, canonicalJson, defaultSpawn, defaultSpawnAsync, rememberReads, judgeUnitList, blockedUnitsOf, digestScanSet, fileScanCache, findRustfmt, metadataArgs, planScans, planUnitListScans, publisherRequirementScan, runScans, sidecarBoundCrate, scanToolPolicyFromPipeline, scanDeferrals, scanFailures, seamRunState } from "../deterministic-scans.mjs";
|
|
90
|
+
import { BIOME_CONFIG_FILES, CHECKER_IDENTITY, OXLINT_CONFIG_FILES, ESLINT_CONFIG_FILES, LOCAL_CLASS_B_JOBS, BROKER_CLASS_B_WINDOW, WORKSPACE_RUST_FILE, ancestorConfigChanged, ancestorDirsOf, canonicalJson, defaultSpawn, defaultSpawnAsync, rememberReads, judgeUnitList, blockedUnitsOf, digestScanSet, fileScanCache, findRustfmt, metadataArgs, planScans, planUnitListScans, publisherRequirementScan, runScans, sidecarBoundCrate, scanToolPolicyFromPipeline, scanDeferrals, scanFailures, seamRunState } from "../deterministic-scans.mjs";
|
|
90
91
|
import { changedLockNames, parseLock, reach } from "../lock-graph.mjs";
|
|
91
92
|
import { resolveExecutor } from "../gate-executor.mjs";
|
|
92
93
|
// The gate's own executor: an outer gate's cargo wrapper on PATH is never this gate's cargo (gate-executor.mjs `gateWrappers`).
|
|
@@ -2395,7 +2396,7 @@ async function runStages(o, args, root, git, io) {
|
|
|
2395
2396
|
const file = path.join(fs.mkdtempSync(path.join(os.tmpdir(), "rk-door-registry-")), "admission.json");
|
|
2396
2397
|
o.out(`${tag} [compile] registry admission for ${platform} before any compile (right-release build --platform ${platform} --registry-admission-out)`);
|
|
2397
2398
|
if (await rightRelease(stage, ["build", "--platform", platform, "--registry-admission-out", file])) doorRegistryAdmissionFile = file;
|
|
2398
|
-
else { o.err(`${tag} BLOCKED: [compile] the registry admission (pin freshness against the registries) refused ${platform}; nothing compiled`); ok = false; }
|
|
2399
|
+
else { o.err(`${tag} BLOCKED: [compile] the registry admission (pin freshness against the registries; signing secrets in the environment) refused ${platform}; nothing compiled`); ok = false; }
|
|
2399
2400
|
}
|
|
2400
2401
|
// On the snapshot route the sidecars are staged from the snapshot's own config and sources through right-release's source split
|
|
2401
2402
|
// (the staged files and receipt land beside the sources the compile reads; the caches and build trees stay the checkout's), before
|
|
@@ -5623,6 +5624,11 @@ export async function main(argv, io = {}) {
|
|
|
5623
5624
|
live = sc.commitFiles(checkout, ct.commit, o.spawn);
|
|
5624
5625
|
// Dependencies for the checks that execute repository code: installed into the snapshot from the commit's lockfile and the
|
|
5625
5626
|
// primary checkout's existing store (coordinator decision A, rightkit#1257). A store miss stops here, naming the package.
|
|
5627
|
+
// 0.6.94: a scoped check installs only its scope's roots, and the compile stage installs every root of the commit; a root outside the scope that the store could
|
|
5628
|
+
// not serve showed only there, after the sidecars were staged (CodeRight 44af35273 on the Dell, 2026-11-29: apps/coderight-web, 75 minutes in). Those roots are
|
|
5629
|
+
// proved against the store here, with no install (the same `pnpm fetch --offline` proof a content check runs), before anything is installed or compiled.
|
|
5630
|
+
const unscopedRoots = npmRoots.filter((r) => !installRoots.includes(r));
|
|
5631
|
+
if (unscopedRoots.length) for (const r of sc.verifySnapshotStore({ checkout, snapshot: snapshotA, ...ct, roots: unscopedRoots, tmpRoot: gateTmpRoot({ env: o.env, platform: o.platform, exists: o.exists }), env: o.env, spawn: o.spawn })) o.out(`${tag} ${sc.describeStoreCheck(r)}`);
|
|
5626
5632
|
const installed = sc.installSnapshotDependencies({ checkout, snapshot: snapshotA, ...ct, roots: installRoots, ...(closure ? { packageDirs: npm.filter((u) => closure.npm.has(u.name)).map((u) => u.dir) } : {}), env: o.env, spawn: o.spawn });
|
|
5627
5633
|
for (const r of installed) o.out(`${tag} ${sc.describeInstall(r)}`);
|
|
5628
5634
|
} catch (error) { o.err(`${tag} ${error.code === "RK_CHECK_ERROR" ? "RK_CHECK_ERROR" : "BLOCKED"}: ${error.message}`); return error.code === "RK_CHECK_ERROR" ? 2 : 1; }
|
|
@@ -5811,7 +5817,7 @@ export async function main(argv, io = {}) {
|
|
|
5811
5817
|
// GC-A27 NN09 (Adrian, 2026-11-25: "I'm not relaxing NN09"): every carried command is handed to the broker as soon as it is ready. The broker holds one job of a
|
|
5812
5818
|
// repository at a time (its `exclusive:workspace:<repo>` blocker, seen on every receipt of the 0.6.64 run), so commands of one workspace never run side by
|
|
5813
5819
|
// side. 0.6.66 held them back on a misreading: the "two Cargo processes" seen then were one clippy job's own tree (cargo clippy, cargo-clippy, cargo check).
|
|
5814
|
-
classBPipeline: Number.POSITIVE_INFINITY, ...(brokerHost ? { brokerHost: true } : {}), ...(brokerLive ? { brokerLive } : {}), signal: ac.signal, ...(cache ? { cache } : {}),
|
|
5820
|
+
classBPipeline: Number.POSITIVE_INFINITY, classBWindow: BROKER_CLASS_B_WINDOW, ...(brokerHost ? { brokerHost: true } : {}), ...(brokerLive ? { brokerLive } : {}), signal: ac.signal, ...(cache ? { cache } : {}),
|
|
5815
5821
|
// NN41: the installed broker runtime's identity keys every cached compile failure; null (a direct host, an unreadable manifest) means no failure is cached.
|
|
5816
5822
|
...(brokerHost && cache ? (() => { const identity = brokerRuntimeIdentityText({ clients: [brokerClient, executor?.client, cargoCommand[0]], env: { ...o.env, ...(executor.env ?? {}) }, platform: o.platform }); return identity ? { failureIdentity: identity } : {}; })() : {}),
|
|
5817
5823
|
// The declared Linux broker route: the scans are planned with the logical `rustright`, which this spawn (and scanSpawn's pass-through below) starts as the
|
package/build-release.mjs
CHANGED
|
@@ -23,7 +23,7 @@ import { preflightOwnershipScope } from "./ownership-scope.mjs";
|
|
|
23
23
|
import { spawn, spawnSync } from "./background-process.mjs";
|
|
24
24
|
import { RightKitRegistryError, SNAPSHOT_ENV, SNAPSHOT_FILE, assertManifestRegistryEvidence, loadAdmittedSnapshot, prepareRightKitResolution, registryManifestFields, rightKitLockInventory, writeAdmissionRecord, writeSnapshot } from "./rightkit-registry-resolver.mjs";
|
|
25
25
|
import { formatAdmission, formatNotRun, runAdmission } from "./admission.mjs";
|
|
26
|
-
import { sccacheRefusal } from "./admission-host.mjs";
|
|
26
|
+
import { HOST_ROWS, sccacheRefusal } from "./admission-host.mjs";
|
|
27
27
|
import { defaultReleaseConfigFile, importReleaseConfig } from "./release-config.mjs";
|
|
28
28
|
import { fileURLToPath } from "node:url";
|
|
29
29
|
import { dirtyBuildInputs, resolveReleaseBuildInputs } from "./release-invocation.mjs";
|
|
@@ -641,6 +641,19 @@ async function registryAdmissionOnly() {
|
|
|
641
641
|
let config;
|
|
642
642
|
try { config = await importReleaseConfig(configPath, { query: `commit=${commit}` }); }
|
|
643
643
|
catch (error) { console.error(`right-release build: release config could not be loaded (${configPath}): ${error instanceof Error ? error.message : String(error)}`); process.exit(1); }
|
|
644
|
+
// 0.6.94: the host-secret-env row reads the environment and the declared target only, so it is judged here too, before any compile of the door run (Pulse 48127453
|
|
645
|
+
// on the Mac, 2026-11-29: a shell that exported APPLE_API_* was refused at the package stage, after the compile). The same row, the same words; the package stage
|
|
646
|
+
// judges it again. Where the target cannot be expanded yet the row is not judged here, and the package stage's admission is the one that refuses.
|
|
647
|
+
let secretEnv = [];
|
|
648
|
+
try {
|
|
649
|
+
const early = await runAdmission({ root: appRoot, repoRoot: sourceRoot, releaseSource, configPath, config: config ?? {}, platform, commit, tiers: ["host"], rows: HOST_ROWS.filter((row) => row.id === "host-secret-env") });
|
|
650
|
+
secretEnv = early.findings.filter((finding) => finding.row === "host-secret-env");
|
|
651
|
+
} catch { secretEnv = []; }
|
|
652
|
+
if (secretEnv.length) {
|
|
653
|
+
for (const finding of secretEnv) console.error(`right-release build: host-secret-env: ${finding.detail}`);
|
|
654
|
+
console.error(`right-release build: admission found ${secretEnv.length} blocking problem(s); nothing was started`);
|
|
655
|
+
process.exit(1);
|
|
656
|
+
}
|
|
644
657
|
let extraLocks;
|
|
645
658
|
try {
|
|
646
659
|
const inputs = resolveReleaseBuildInputs({ repoRoot: sourceRoot, appRoot, configPath, config, target: config.targets?.[platform] });
|
package/deterministic-scans.mjs
CHANGED
|
@@ -2827,6 +2827,14 @@ export function isBrokerCarriedScan(scan, { brokerHost = false, seam = false } =
|
|
|
2827
2827
|
|
|
2828
2828
|
/** Class B processes the broker never sees (npm or node test suites run on this host) are bounded here, one slot per suite; the broker bounds everything it carries (rightkit#1367 step 2). */
|
|
2829
2829
|
export const LOCAL_CLASS_B_JOBS = 3;
|
|
2830
|
+
/**
|
|
2831
|
+
* How many broker-carried class B requests the gate keeps at the broker at once (rightkit-gate 0.6.94). The broker runs one build of a repository at a time and ends a
|
|
2832
|
+
* request that is still QUEUED after `limits.queueDeadlineMs` (two hours by default): with every row filed at once, a cold run whose rows take longer than that in total
|
|
2833
|
+
* lost every row still waiting (CodeRight 44af35273 on the Dell, 2026-11-29: 61 of 87 rows, then 29, "reason queue-deadline"). With a window the next row is filed when one
|
|
2834
|
+
* ends, so a row waits at the broker for at most the rows filed before it in the window, and the broker always holds a queued row to start next. The broker's status
|
|
2835
|
+
* answer reports no concurrency, so this is a constant and no caller sets it.
|
|
2836
|
+
*/
|
|
2837
|
+
export const BROKER_CLASS_B_WINDOW = 4;
|
|
2830
2838
|
|
|
2831
2839
|
/**
|
|
2832
2840
|
* Whether a class B scan is the BROKER's to queue for scheduling: a cargo or rustright scan and a carried Swift build (isBrokerCarriedScan). An npm or node suite that merely makes broker
|
|
@@ -2855,10 +2863,12 @@ export function classBChainKey(scan, carried) {
|
|
|
2855
2863
|
|
|
2856
2864
|
/**
|
|
2857
2865
|
* Class B on a broker host (rightkit#1367 step 2): one chain per component, its scans in plan order (compile, doc, tests: they share the component's output directory),
|
|
2858
|
-
* every chain started at once. A broker-carried scan
|
|
2859
|
-
*
|
|
2866
|
+
* every chain started at once. A broker-carried scan is filed in plan order while fewer than `window` carried requests are in flight (no bound when `window` is not
|
|
2867
|
+
* given), and the broker queues and orders what it holds; a row that joins an invocation already filed (`joins(index)`: a later member of a batch) is no new request
|
|
2868
|
+
* and takes no place in the window. A scan the broker never sees (an npm or node suite) holds one of `localJobs` local slots while it runs. `run(index)` runs one scan
|
|
2869
|
+
* and never rejects.
|
|
2860
2870
|
*/
|
|
2861
|
-
export async function scheduleBrokerHostClassB({ scans, lanes, carried, localJobs, run, pipeline = 1 }) {
|
|
2871
|
+
export async function scheduleBrokerHostClassB({ scans, lanes, carried, localJobs, run, pipeline = 1, window = Number.POSITIVE_INFINITY, joins = () => false }) {
|
|
2862
2872
|
const chains = new Map();
|
|
2863
2873
|
for (const lane of ["compile", "doc", "tests"]) {
|
|
2864
2874
|
for (const i of lanes[lane] ?? []) { const key = classBChainKey(scans[i], carried(scans[i])); if (!chains.has(key)) chains.set(key, []); chains.get(key).push(i); }
|
|
@@ -2867,6 +2877,18 @@ export async function scheduleBrokerHostClassB({ scans, lanes, carried, localJob
|
|
|
2867
2877
|
let held = 0; const waiters = [];
|
|
2868
2878
|
const take = async () => { while (held >= limit) await new Promise((resolve) => waiters.push(resolve)); held += 1; };
|
|
2869
2879
|
const free = () => { held -= 1; waiters.shift()?.(); };
|
|
2880
|
+
// The carried window: a place is handed straight to the row that has waited longest, so rows are filed in the order they asked.
|
|
2881
|
+
const width = Number.isFinite(Number(window)) ? Math.max(1, Math.trunc(Number(window)) || 1) : Number.POSITIVE_INFINITY;
|
|
2882
|
+
let filed = 0; const queued = [];
|
|
2883
|
+
const enter = () => { if (filed < width) { filed += 1; return Promise.resolve(); } return new Promise((resolve) => queued.push(resolve)); };
|
|
2884
|
+
const leave = () => { const next = queued.shift(); if (next) next(); else filed -= 1; };
|
|
2885
|
+
const carry = async (i) => {
|
|
2886
|
+
if (joins(i)) return run(i);
|
|
2887
|
+
await enter();
|
|
2888
|
+
// Its invocation was filed while it waited (the first member of its batch got a place): it gives its place back and reads that invocation's row.
|
|
2889
|
+
if (joins(i)) { leave(); return run(i); }
|
|
2890
|
+
try { return await run(i); } finally { leave(); }
|
|
2891
|
+
};
|
|
2870
2892
|
// B4 (rightkit#1458 audit): with `pipeline` 1 a chain runs one scan at a time, so the gate's work after one job (receipt read, signed-evidence
|
|
2871
2893
|
// verification, ledger check) and before the next (cache key, request file) was dead time at the broker (about 10.6 s a job on the Dell). With
|
|
2872
2894
|
// `pipeline` n, up to n carried scans of one chain are in flight: the next is submitted while the previous is still running or being verified, and the
|
|
@@ -2885,7 +2907,7 @@ export async function scheduleBrokerHostClassB({ scans, lanes, carried, localJob
|
|
|
2885
2907
|
}
|
|
2886
2908
|
const scanDepth = scans[i].executionWorkspace ? 1 : depth;
|
|
2887
2909
|
while (flight.size >= scanDepth) await Promise.race(flight);
|
|
2888
|
-
const job =
|
|
2910
|
+
const job = carry(i).finally(() => flight.delete(job));
|
|
2889
2911
|
flight.add(job);
|
|
2890
2912
|
}
|
|
2891
2913
|
await Promise.all(flight);
|
|
@@ -4116,6 +4138,7 @@ export async function runScans(plan, options = {}) {
|
|
|
4116
4138
|
} else if (brokerHost) {
|
|
4117
4139
|
await scheduleBrokerHostClassB({
|
|
4118
4140
|
scans: bScans, lanes, localJobs: bJobs, carried: (scan) => isBrokerScheduledScan(scan, carriedCtx), pipeline: options.classBPipeline ?? 1,
|
|
4141
|
+
window: options.classBWindow ?? Number.POSITIVE_INFINITY, joins: (i) => Boolean(groupOf.get(i)?.promise),
|
|
4119
4142
|
run: async (i) => { try { slots[i] = await runB(i); } catch (error) { slots[i] = failedRow(i, error); } },
|
|
4120
4143
|
});
|
|
4121
4144
|
} else {
|
package/package.json
CHANGED
package/rightkit-versions.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@rightkit/agent-ui-settings": "0.1.1",
|
|
21
21
|
"@rightkit/agent-ui-web": "0.1.0",
|
|
22
22
|
"@rightkit/agent-ui-workbench": "0.1.1",
|
|
23
|
-
"@rightkit/app-update": "0.4.
|
|
23
|
+
"@rightkit/app-update": "0.4.8",
|
|
24
24
|
"@rightkit/ax": "0.3.2",
|
|
25
25
|
"@rightkit/blender-worker": "0.1.1",
|
|
26
26
|
"@rightkit/ci": "0.3.3",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@rightkit/legal": "0.6.4",
|
|
37
37
|
"@rightkit/legal-ui": "0.4.2",
|
|
38
38
|
"@rightkit/library-ui": "0.2.6",
|
|
39
|
-
"@rightkit/license": "0.3.
|
|
39
|
+
"@rightkit/license": "0.3.6",
|
|
40
40
|
"@rightkit/logs": "0.1.7",
|
|
41
41
|
"@rightkit/mail-ui": "0.2.2",
|
|
42
42
|
"@rightkit/markdown-editor": "0.2.0",
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
"@rightkit/platform-ui": "0.4.5",
|
|
49
49
|
"@rightkit/qa": "0.7.0",
|
|
50
50
|
"@rightkit/qa-chrome": "0.1.12",
|
|
51
|
-
"@rightkit/react-shell": "0.7.
|
|
52
|
-
"@rightkit/release": "0.6.
|
|
51
|
+
"@rightkit/react-shell": "0.7.10",
|
|
52
|
+
"@rightkit/release": "0.6.94",
|
|
53
53
|
"@rightkit/send-ui": "0.1.0",
|
|
54
|
-
"@rightkit/settings-ui": "0.7.
|
|
54
|
+
"@rightkit/settings-ui": "0.7.8",
|
|
55
55
|
"@rightkit/social-ui": "0.2.1",
|
|
56
56
|
"@rightkit/system-ui": "0.2.2",
|
|
57
|
-
"@rightkit/tauri": "0.4.
|
|
57
|
+
"@rightkit/tauri": "0.4.7",
|
|
58
58
|
"@rightkit/tauri-shell": "0.1.4",
|
|
59
59
|
"@rightkit/terminal-ui": "0.1.0",
|
|
60
60
|
"@rightkit/theme": "0.3.4",
|
|
@@ -459,7 +459,8 @@
|
|
|
459
459
|
"0.6.89",
|
|
460
460
|
"0.6.90",
|
|
461
461
|
"0.6.91",
|
|
462
|
-
"0.6.92"
|
|
462
|
+
"0.6.92",
|
|
463
|
+
"0.6.93"
|
|
463
464
|
],
|
|
464
465
|
"@rightkit/settings-ui": [
|
|
465
466
|
"0.1.0",
|
|
@@ -579,7 +580,7 @@
|
|
|
579
580
|
"rightkit-agent-plugins": "0.1.4",
|
|
580
581
|
"rightkit-agent-policy": "0.2.4",
|
|
581
582
|
"rightkit-agent-recipes": "0.1.3",
|
|
582
|
-
"rightkit-agent-server": "0.2
|
|
583
|
+
"rightkit-agent-server": "0.3.2",
|
|
583
584
|
"rightkit-agent-skills": "0.2.0",
|
|
584
585
|
"rightkit-agent-task-contract": "0.1.2",
|
|
585
586
|
"rightkit-agent-task-journal": "0.1.1",
|
|
@@ -587,7 +588,7 @@
|
|
|
587
588
|
"rightkit-agent-tools": "0.4.4",
|
|
588
589
|
"rightkit-agent-transcript": "0.1.4",
|
|
589
590
|
"rightkit-agents": "0.3.0",
|
|
590
|
-
"rightkit-ai-accounts": "0.1.
|
|
591
|
+
"rightkit-ai-accounts": "0.1.6",
|
|
591
592
|
"rightkit-ai-keys": "0.1.1",
|
|
592
593
|
"rightkit-android": "0.3.3",
|
|
593
594
|
"rightkit-app-host": "0.1.3",
|
|
@@ -598,7 +599,7 @@
|
|
|
598
599
|
"rightkit-app-update": "0.2.1",
|
|
599
600
|
"rightkit-apple-ops": "0.2.0",
|
|
600
601
|
"rightkit-approvals": "0.2.2",
|
|
601
|
-
"rightkit-asr": "0.5.
|
|
602
|
+
"rightkit-asr": "0.5.3",
|
|
602
603
|
"rightkit-assist": "0.1.1",
|
|
603
604
|
"rightkit-audio": "0.4.6",
|
|
604
605
|
"rightkit-autoedit": "0.2.1",
|
|
@@ -611,7 +612,7 @@
|
|
|
611
612
|
"rightkit-captions": "0.1.1",
|
|
612
613
|
"rightkit-catalog": "0.1.0",
|
|
613
614
|
"rightkit-channel-memory": "0.2.3",
|
|
614
|
-
"rightkit-chat-bridge": "0.2.
|
|
615
|
+
"rightkit-chat-bridge": "0.2.6",
|
|
615
616
|
"rightkit-child-process": "0.5.17",
|
|
616
617
|
"rightkit-clipboard": "0.1.0",
|
|
617
618
|
"rightkit-clipboard-history": "0.4.0",
|
|
@@ -634,8 +635,8 @@
|
|
|
634
635
|
"rightkit-context-runtime": "0.1.5",
|
|
635
636
|
"rightkit-contracts": "0.1.11",
|
|
636
637
|
"rightkit-contrast": "0.1.0",
|
|
637
|
-
"rightkit-crash": "0.4.
|
|
638
|
-
"rightkit-credentials": "0.5.
|
|
638
|
+
"rightkit-crash": "0.4.4",
|
|
639
|
+
"rightkit-credentials": "0.5.11",
|
|
639
640
|
"rightkit-crypto": "0.1.4",
|
|
640
641
|
"rightkit-daemon": "0.9.4",
|
|
641
642
|
"rightkit-daemon-remote": "0.1.0",
|
|
@@ -653,13 +654,13 @@
|
|
|
653
654
|
"rightkit-dictation-engine": "0.2.1",
|
|
654
655
|
"rightkit-dictation-ffi": "0.2.1",
|
|
655
656
|
"rightkit-dictation-inference": "0.2.5",
|
|
656
|
-
"rightkit-dictation-models": "0.3.
|
|
657
|
+
"rightkit-dictation-models": "0.3.4",
|
|
657
658
|
"rightkit-dictation-pill": "0.1.2",
|
|
658
659
|
"rightkit-dictation-runtime": "0.2.7",
|
|
659
|
-
"rightkit-dictation-tauri": "0.3.
|
|
660
|
+
"rightkit-dictation-tauri": "0.3.5",
|
|
660
661
|
"rightkit-dictation-telemetry": "0.2.4",
|
|
661
662
|
"rightkit-dictation-text-pipeline": "0.2.8",
|
|
662
|
-
"rightkit-disk-cleanup": "0.2.
|
|
663
|
+
"rightkit-disk-cleanup": "0.2.3",
|
|
663
664
|
"rightkit-docs": "0.1.6",
|
|
664
665
|
"rightkit-doctor": "0.2.0",
|
|
665
666
|
"rightkit-document-workspace": "0.2.1",
|
|
@@ -674,7 +675,7 @@
|
|
|
674
675
|
"rightkit-evidence-governance": "0.1.1",
|
|
675
676
|
"rightkit-evidence-report": "0.1.1",
|
|
676
677
|
"rightkit-feed": "0.1.0",
|
|
677
|
-
"rightkit-ffmpeg": "0.3.
|
|
678
|
+
"rightkit-ffmpeg": "0.3.4",
|
|
678
679
|
"rightkit-file-watch": "0.4.4",
|
|
679
680
|
"rightkit-fs": "0.5.2",
|
|
680
681
|
"rightkit-fsindex": "0.6.3",
|
|
@@ -708,7 +709,7 @@
|
|
|
708
709
|
"rightkit-media-gen-models": "0.1.1",
|
|
709
710
|
"rightkit-media-pipeline": "0.2.2",
|
|
710
711
|
"rightkit-memory": "0.3.1",
|
|
711
|
-
"rightkit-memory-client": "0.1.
|
|
712
|
+
"rightkit-memory-client": "0.1.2",
|
|
712
713
|
"rightkit-memory-core": "0.2.1",
|
|
713
714
|
"rightkit-memory-store": "0.2.2",
|
|
714
715
|
"rightkit-mesh": "0.2.3",
|
|
@@ -736,7 +737,7 @@
|
|
|
736
737
|
"rightkit-profile": "0.1.0",
|
|
737
738
|
"rightkit-prompt-recipes": "0.2.1",
|
|
738
739
|
"rightkit-pty": "0.1.3",
|
|
739
|
-
"rightkit-qa": "0.10.
|
|
740
|
+
"rightkit-qa": "0.10.17",
|
|
740
741
|
"rightkit-record": "0.4.1",
|
|
741
742
|
"rightkit-reframe": "0.2.1",
|
|
742
743
|
"rightkit-remote-compute": "0.2.2",
|
|
@@ -761,7 +762,7 @@
|
|
|
761
762
|
"rightkit-sync": "0.4.4",
|
|
762
763
|
"rightkit-sync-keys": "0.1.0",
|
|
763
764
|
"rightkit-sysmem": "0.1.0",
|
|
764
|
-
"rightkit-system-monitor": "0.3.
|
|
765
|
+
"rightkit-system-monitor": "0.3.3",
|
|
765
766
|
"rightkit-tauri-shell": "0.8.12",
|
|
766
767
|
"rightkit-terminal-ui": "0.2.0",
|
|
767
768
|
"rightkit-text-polish": "0.1.4",
|
|
@@ -927,7 +928,7 @@
|
|
|
927
928
|
"@rightkit/qa": "0.7.0",
|
|
928
929
|
"@rightkit/qa-chrome": "0.1.12",
|
|
929
930
|
"@rightkit/react-shell": "0.7.7",
|
|
930
|
-
"@rightkit/release": "0.6.
|
|
931
|
+
"@rightkit/release": "0.6.93",
|
|
931
932
|
"@rightkit/settings-ui": "0.7.4",
|
|
932
933
|
"@rightkit/shell": "0.1.1",
|
|
933
934
|
"@rightkit/tauri": "0.4.3",
|
|
@@ -986,7 +987,9 @@
|
|
|
986
987
|
"rightkit-ai-accounts": [
|
|
987
988
|
"0.1.1",
|
|
988
989
|
"0.1.2",
|
|
989
|
-
"0.1.3"
|
|
990
|
+
"0.1.3",
|
|
991
|
+
"0.1.4",
|
|
992
|
+
"0.1.5"
|
|
990
993
|
],
|
|
991
994
|
"rightkit-ai-keys": [
|
|
992
995
|
"0.1.0"
|
|
@@ -1017,7 +1020,8 @@
|
|
|
1017
1020
|
"0.2.0",
|
|
1018
1021
|
"0.2.1",
|
|
1019
1022
|
"0.2.4",
|
|
1020
|
-
"0.3.0"
|
|
1023
|
+
"0.3.0",
|
|
1024
|
+
"0.5.2"
|
|
1021
1025
|
],
|
|
1022
1026
|
"rightkit-audio": [
|
|
1023
1027
|
"0.1.0",
|
|
@@ -1084,7 +1088,8 @@
|
|
|
1084
1088
|
"0.2.1",
|
|
1085
1089
|
"0.2.2",
|
|
1086
1090
|
"0.2.3",
|
|
1087
|
-
"0.2.4"
|
|
1091
|
+
"0.2.4",
|
|
1092
|
+
"0.2.5"
|
|
1088
1093
|
],
|
|
1089
1094
|
"rightkit-child-process": [
|
|
1090
1095
|
"0.4.0",
|
|
@@ -1137,7 +1142,8 @@
|
|
|
1137
1142
|
"0.3.5",
|
|
1138
1143
|
"0.3.6",
|
|
1139
1144
|
"0.4.1",
|
|
1140
|
-
"0.4.2"
|
|
1145
|
+
"0.4.2",
|
|
1146
|
+
"0.4.3"
|
|
1141
1147
|
],
|
|
1142
1148
|
"rightkit-credentials": [
|
|
1143
1149
|
"0.2.0",
|
|
@@ -1148,7 +1154,8 @@
|
|
|
1148
1154
|
"0.4.2",
|
|
1149
1155
|
"0.5.5",
|
|
1150
1156
|
"0.5.7",
|
|
1151
|
-
"0.5.8"
|
|
1157
|
+
"0.5.8",
|
|
1158
|
+
"0.5.10"
|
|
1152
1159
|
],
|
|
1153
1160
|
"rightkit-crypto": [
|
|
1154
1161
|
"0.1.0",
|
|
@@ -1213,7 +1220,8 @@
|
|
|
1213
1220
|
],
|
|
1214
1221
|
"rightkit-dictation-models": [
|
|
1215
1222
|
"0.3.0",
|
|
1216
|
-
"0.3.1"
|
|
1223
|
+
"0.3.1",
|
|
1224
|
+
"0.3.3"
|
|
1217
1225
|
],
|
|
1218
1226
|
"rightkit-dictation-pill": [
|
|
1219
1227
|
"0.1.0",
|
|
@@ -1224,7 +1232,8 @@
|
|
|
1224
1232
|
],
|
|
1225
1233
|
"rightkit-dictation-tauri": [
|
|
1226
1234
|
"0.3.1",
|
|
1227
|
-
"0.3.3"
|
|
1235
|
+
"0.3.3",
|
|
1236
|
+
"0.3.4"
|
|
1228
1237
|
],
|
|
1229
1238
|
"rightkit-dictation-telemetry": [
|
|
1230
1239
|
"0.2.0",
|
|
@@ -1257,7 +1266,8 @@
|
|
|
1257
1266
|
"0.2.6",
|
|
1258
1267
|
"0.2.9",
|
|
1259
1268
|
"0.2.10",
|
|
1260
|
-
"0.3.2"
|
|
1269
|
+
"0.3.2",
|
|
1270
|
+
"0.3.3"
|
|
1261
1271
|
],
|
|
1262
1272
|
"rightkit-file-watch": [
|
|
1263
1273
|
"0.4.0",
|
|
@@ -1554,7 +1564,8 @@
|
|
|
1554
1564
|
"0.10.12",
|
|
1555
1565
|
"0.10.13",
|
|
1556
1566
|
"0.10.14",
|
|
1557
|
-
"0.10.15"
|
|
1567
|
+
"0.10.15",
|
|
1568
|
+
"0.10.16"
|
|
1558
1569
|
],
|
|
1559
1570
|
"rightkit-qa-driver": [
|
|
1560
1571
|
"0.3.0",
|
|
@@ -1678,7 +1689,8 @@
|
|
|
1678
1689
|
],
|
|
1679
1690
|
"rightkit-system-monitor": [
|
|
1680
1691
|
"0.3.0",
|
|
1681
|
-
"0.3.1"
|
|
1692
|
+
"0.3.1",
|
|
1693
|
+
"0.3.2"
|
|
1682
1694
|
],
|
|
1683
1695
|
"rightkit-tauri": [
|
|
1684
1696
|
"0.1.1"
|
|
@@ -1784,7 +1796,8 @@
|
|
|
1784
1796
|
],
|
|
1785
1797
|
"rightkit-disk-cleanup": [
|
|
1786
1798
|
"0.2.0",
|
|
1787
|
-
"0.2.1"
|
|
1799
|
+
"0.2.1",
|
|
1800
|
+
"0.2.2"
|
|
1788
1801
|
],
|
|
1789
1802
|
"rightkit-agent-task-journal": [
|
|
1790
1803
|
"0.1.0"
|
package/smoke-run.mjs
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// The host smoke for a peer promote (rustright-install `trusted-gate promote --peer-result --smoke`; rightkit#1848; Adrian, 27 Nov 2026: "yes promote mac").
|
|
3
|
+
// A host that cannot run the GC-A27 acceptance (the Mac: no process record, a Windows cases file) trusts a candidate gate on a pinned peer's passing result for
|
|
4
|
+
// the same archive bytes, plus this smoke, written here and verified by the installer:
|
|
5
|
+
// - the candidate's gate prints the archive's version;
|
|
6
|
+
// - the runtime manifest read through the agent shim names the broker running here;
|
|
7
|
+
// - one real compile through this host's broker with the candidate gate, every broker job tagged with the contract-run nonce
|
|
8
|
+
// (RK_GATE_CONTRACT_*: each job's signed nonce is contractJobNonce(runId, sealed, "smoke", call), the definition RustRight's job_nonce shares), so the
|
|
9
|
+
// installer can bind each signed claim to this candidate and a smoke for another candidate (or an earlier one) does not verify.
|
|
10
|
+
// It writes rightkit.host-smoke/1 and its job-claims/ beside it. Exit 0 when the smoke is written, whether or not it passed: the verdict is in the record.
|
|
11
|
+
//
|
|
12
|
+
// node smoke-run.mjs --sealed <candidate sha256> --managed <managed root> --repo <primary checkout> --out <dir> [--host mac] [--commit <sha>] [--unit cargo:rightkit-<name> | --unit none]
|
|
13
|
+
// --unit none compiles the whole repository (`--to compile`): a repository without a committed .rightkit-local-build.json, such as rk-witness-fixture,
|
|
14
|
+
// takes no unit (the gate refuses a unit there). --commit defaults to the repository's HEAD.
|
|
15
|
+
import fs from "node:fs";
|
|
16
|
+
import path from "node:path";
|
|
17
|
+
import crypto from "node:crypto";
|
|
18
|
+
import { spawnSync } from "node:child_process";
|
|
19
|
+
import { pathToFileURL } from "node:url";
|
|
20
|
+
import { CONTRACT_JOBS_ENV, CONTRACT_RUN_ID_ENV, CONTRACT_SEALED_ENV, CONTRACT_STEP_ENV } from "./gate-seam.mjs";
|
|
21
|
+
import { claimOf } from "./acceptance-result.mjs";
|
|
22
|
+
|
|
23
|
+
export const SMOKE_SCHEMA = "rightkit.host-smoke/1";
|
|
24
|
+
export const SMOKE_STEP = "smoke";
|
|
25
|
+
const HEX64 = /^[0-9a-f]{64}$/;
|
|
26
|
+
|
|
27
|
+
/** The `rustright` client on PATH (the agent shim on the Mac), or null. */
|
|
28
|
+
export function rustrightOnPath({ env = process.env, platform = process.platform, exists = fs.existsSync } = {}) {
|
|
29
|
+
const names = platform === "win32" ? ["rustright.exe", "rustright.cmd"] : ["rustright"];
|
|
30
|
+
for (const dir of String(env.PATH ?? env.Path ?? "").split(path.delimiter).filter(Boolean)) for (const name of names) { const file = path.join(dir, name); if (exists(file)) return file; }
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** The claims of the tagged jobs a gate launch filed in `jobsFile`: { id, bytes, sha256, call } each, read from the broker receipt each job names. */
|
|
35
|
+
export function claimsOfJobs(jobsFile, { read = (f) => fs.readFileSync(f, "utf8") } = {}) {
|
|
36
|
+
let text = ""; try { text = read(jobsFile); } catch { return { claims: [], problems: [`no tagged job was filed (${jobsFile} is missing)`] }; }
|
|
37
|
+
const claims = []; const problems = [];
|
|
38
|
+
for (const line of text.split(/\r?\n/).filter(Boolean)) {
|
|
39
|
+
let job; try { job = JSON.parse(line); } catch { problems.push("a filed job is not JSON"); continue; }
|
|
40
|
+
let receipt = job.receipt;
|
|
41
|
+
if (typeof receipt === "string") { try { receipt = JSON.parse(read(receipt)); } catch { problems.push(`job ${job.requestId}: its receipt ${job.receipt} cannot be read`); continue; } }
|
|
42
|
+
const claim = receipt && typeof receipt === "object" ? claimOf(receipt) : null;
|
|
43
|
+
if (!claim) { problems.push(`job ${job.requestId ?? "(no id)"}: no broker claim in its receipt`); continue; }
|
|
44
|
+
if (job.requestId && claim.id !== job.requestId) { problems.push(`job ${job.requestId}: its receipt is for job ${claim.id}`); continue; }
|
|
45
|
+
claims.push({ ...claim, call: String(job.call ?? "") });
|
|
46
|
+
}
|
|
47
|
+
return { claims, problems };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Builds the smoke record from what was observed. `pass` holds only when every observation is present and the compile passed with at least one signed job. */
|
|
51
|
+
export function buildSmoke({ runId, host, sealed, archive, versionPrinted, runtimeBrokerDigest, commit, tree, compileExit, claims, problems }) {
|
|
52
|
+
const all = [...problems];
|
|
53
|
+
if (versionPrinted !== archive.version) all.push(`the candidate's gate printed ${JSON.stringify(versionPrinted)}, the archive is ${archive.version}`);
|
|
54
|
+
if (!HEX64.test(String(runtimeBrokerDigest ?? ""))) all.push("the runtime manifest names no broker digest");
|
|
55
|
+
if (compileExit !== 0) all.push(`the compile through the broker exited ${compileExit}`);
|
|
56
|
+
if (!claims.length) all.push("no signed broker job: nothing in the smoke is signed");
|
|
57
|
+
return {
|
|
58
|
+
schema: SMOKE_SCHEMA, runId, host, pass: all.length === 0, problems: all,
|
|
59
|
+
gate: { sealedSha256: sealed, archiveIntegrity: archive.integrity, archiveVersion: archive.version },
|
|
60
|
+
versionPrinted, runtimeBrokerDigest, commit, tree,
|
|
61
|
+
jobs: claims.map((c) => ({ requestId: c.id, claimSha256: c.sha256, call: c.call })), jobClaims: "job-claims",
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export async function main(argv = process.argv.slice(2), { out = console.log } = {}) {
|
|
66
|
+
const opt = (name) => { const i = argv.indexOf(name); return i < 0 ? null : argv[i + 1]; };
|
|
67
|
+
const sealed = opt("--sealed"); const managed = opt("--managed"); const repo = opt("--repo"); const outDir = opt("--out");
|
|
68
|
+
const host = opt("--host") ?? (process.platform === "darwin" ? "mac" : process.platform === "win32" ? "dell" : "linux"); const unit = opt("--unit") ?? "cargo:rightkit-time"; const wantCommit = opt("--commit");
|
|
69
|
+
if (!HEX64.test(String(sealed)) || !managed || !repo || !outDir) { out("usage: smoke-run.mjs --sealed <candidate sha256> --managed <root> --repo <primary RightKit checkout> --out <dir> [--host mac] [--unit cargo:rightkit-time]"); return 2; }
|
|
70
|
+
const candidate = path.join(managed, "trusted-gates", "candidates", sealed);
|
|
71
|
+
const release = path.join(candidate, "node_modules", "@rightkit", "release");
|
|
72
|
+
const gate = path.join(release, "bin", "rightkit-gate.mjs");
|
|
73
|
+
const source = JSON.parse(fs.readFileSync(path.join(candidate, "trusted-gate-source.json"), "utf8"));
|
|
74
|
+
const archive = { version: String(source.version ?? ""), integrity: String(source.integrity ?? "") };
|
|
75
|
+
fs.mkdirSync(path.join(outDir, "job-claims"), { recursive: true });
|
|
76
|
+
const problems = [];
|
|
77
|
+
const printed = spawnSync(process.execPath, [gate, "--version"], { encoding: "utf8", windowsHide: true });
|
|
78
|
+
const versionPrinted = String(printed.stdout ?? "").trim().split(/\r?\n/).pop() ?? "";
|
|
79
|
+
// The candidate's own runtimeManifestPathOf (follows the agent shim to the client it starts), so the smoke reads the manifest the way that gate will.
|
|
80
|
+
let runtimeBrokerDigest = null;
|
|
81
|
+
const client = rustrightOnPath();
|
|
82
|
+
if (!client) problems.push("no rustright client on PATH");
|
|
83
|
+
else {
|
|
84
|
+
try {
|
|
85
|
+
const { runtimeManifestPathOf } = await import(pathToFileURL(path.join(release, "seam-broker.mjs")).href);
|
|
86
|
+
runtimeBrokerDigest = JSON.parse(fs.readFileSync(runtimeManifestPathOf(client), "utf8")).brokerDigest ?? null;
|
|
87
|
+
} catch (error) { problems.push(`the runtime manifest beside ${client} cannot be read: ${error.message}`); }
|
|
88
|
+
}
|
|
89
|
+
const git = (args) => String(spawnSync("git", ["-C", repo, ...args], { encoding: "utf8", windowsHide: true }).stdout ?? "").trim();
|
|
90
|
+
const commit = git(["rev-parse", wantCommit ?? "HEAD"]); const tree = git(["rev-parse", `${commit}^{tree}`]);
|
|
91
|
+
const runId = crypto.randomBytes(32).toString("hex");
|
|
92
|
+
const jobsFile = path.join(path.resolve(outDir), "jobs.jsonl");
|
|
93
|
+
const log = fs.openSync(path.join(outDir, "compile.log"), "w");
|
|
94
|
+
const compiled = spawnSync(process.execPath, [gate, "--to", "compile", ...(unit === "none" ? [] : ["--unit", unit]), "--commit", commit], {
|
|
95
|
+
cwd: repo, windowsHide: true, stdio: ["ignore", log, log],
|
|
96
|
+
env: { ...process.env, [CONTRACT_RUN_ID_ENV]: runId, [CONTRACT_SEALED_ENV]: sealed, [CONTRACT_STEP_ENV]: SMOKE_STEP, [CONTRACT_JOBS_ENV]: jobsFile },
|
|
97
|
+
});
|
|
98
|
+
fs.closeSync(log);
|
|
99
|
+
const { claims, problems: jobProblems } = claimsOfJobs(jobsFile);
|
|
100
|
+
for (const c of claims) fs.writeFileSync(path.join(outDir, "job-claims", `${c.id}.json`), c.bytes);
|
|
101
|
+
const smoke = buildSmoke({ runId, host, sealed, archive, versionPrinted, runtimeBrokerDigest, commit, tree, compileExit: compiled.status, claims, problems: [...problems, ...jobProblems] });
|
|
102
|
+
fs.writeFileSync(path.join(outDir, "smoke.json"), `${JSON.stringify(smoke, null, 2)}\n`);
|
|
103
|
+
out(`smoke written: ${path.join(outDir, "smoke.json")} (pass ${smoke.pass}, ${claims.length} signed job(s)${smoke.problems.length ? `; ${smoke.problems.join("; ")}` : ""})`);
|
|
104
|
+
return 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) process.exitCode = await main();
|
package/snapshot.mjs
CHANGED
|
@@ -491,7 +491,7 @@ function sha256File(file) {
|
|
|
491
491
|
return h.digest("hex");
|
|
492
492
|
}
|
|
493
493
|
|
|
494
|
-
function inspectSnapshot({ dir, entries, checkout, commit, platform = process.platform, originUrl, ledger, admitNew = false }) {
|
|
494
|
+
function inspectSnapshot({ dir, entries, checkout, commit, platform = process.platform, originUrl, ledger, admitNew = false, staleDeps = null }) {
|
|
495
495
|
const problem = (message) => ({ problem: message, admitted: [] });
|
|
496
496
|
const ledgerMode = ledger !== undefined || admitNew === true;
|
|
497
497
|
const fold = foldFor(platform);
|
|
@@ -505,6 +505,7 @@ function inspectSnapshot({ dir, entries, checkout, commit, platform = process.pl
|
|
|
505
505
|
let realDir; let realCheckout = checkout;
|
|
506
506
|
try { realDir = fs.realpathSync.native(dir); } catch (e) { return problem(`${dir} cannot be resolved: ${e.message}`); }
|
|
507
507
|
try { realCheckout = fs.realpathSync.native(checkout); } catch { /* the path as given */ }
|
|
508
|
+
const resolves = (p) => { try { fs.realpathSync.native(p); return true; } catch { return false; } };
|
|
508
509
|
const linkProblem = (rel, p) => {
|
|
509
510
|
let real;
|
|
510
511
|
try { real = fs.realpathSync.native(p); } catch { return `${rel} is a link that does not resolve (dangling or looping); it cannot be proven to stay inside the snapshot`; }
|
|
@@ -606,10 +607,15 @@ function inspectSnapshot({ dir, entries, checkout, commit, platform = process.pl
|
|
|
606
607
|
if (e.isSymbolicLink()) {
|
|
607
608
|
// The landing is named first when it is the worse news (into the checkout, out of the snapshot); a link the commit lacks is refused either way.
|
|
608
609
|
found = linkProblem(r, p);
|
|
610
|
+
// 0.6.94, the sync only (`staleDeps`): a link inside an installed dependency directory that resolves nowhere is what an install of an earlier commit left
|
|
611
|
+
// (a workspace package the commit no longer has; the Mac, 2026-11-29: node_modules/.pnpm/node_modules/@rightkit/lint). It is no refusal there: the
|
|
612
|
+
// dependency directory that holds it is named, the sync removes that directory and the next install writes it again. A link that lands in the checkout
|
|
613
|
+
// or outside the snapshot stays a refusal, and so does every unresolved link for every other caller.
|
|
614
|
+
if (found && inDeps && staleDeps && !resolves(p)) { staleDeps.push(inDeps); found = null; }
|
|
609
615
|
if (!found && !inDeps) found = !byKey.has(key) ? (ledgerMode ? `${r} is a link the commit does not have: a link is never admitted to the stage-output ledger` : `${r} is not in the commit's tree (a link the commit does not have)`) : fileProblem(r, p, byKey.get(key));
|
|
610
616
|
} else if (e.isDirectory()) {
|
|
611
|
-
if (inDeps) found = walk(p, r,
|
|
612
|
-
else if (deps.has(key)) { depRoots.push(p); found = walk(p, r,
|
|
617
|
+
if (inDeps) found = walk(p, r, inDeps);
|
|
618
|
+
else if (deps.has(key)) { depRoots.push(p); found = walk(p, r, p); }
|
|
613
619
|
else if (dirs.has(key)) found = walk(p, r, false);
|
|
614
620
|
else if (key === ".git") found = gitConfigProblem(r, p);
|
|
615
621
|
else found = ledgerMode ? candidateDir(p, r) : `${r} is not in the commit's tree (a directory the commit does not have)`;
|
|
@@ -1361,8 +1367,25 @@ export function syncSnapshot({ checkout, rev = "HEAD", root = snapshotRoot(), ma
|
|
|
1361
1367
|
// NN11: this walk and hash are a proof like any other, and the first of the run. The open gate process is told (its change generation is
|
|
1362
1368
|
// taken before the walk, so a change during the proof refuses the record), and every later proof of this run starts from it instead of
|
|
1363
1369
|
// hashing the tree again. On a host's managed root only: a test's temporary root has no such process (`resident` is the transport, for tests).
|
|
1364
|
-
|
|
1365
|
-
|
|
1370
|
+
let residentGeneration = resident ? beginResidentProof(dir, { ask: resident }) : null;
|
|
1371
|
+
// 0.6.94: installed dependency directories the sync kept that hold a link resolving nowhere are removed here (not followed: rmSync unlinks a link itself), and the
|
|
1372
|
+
// proof starts again; removing one can leave a member's links without a landing, so it repeats until a walk names none. The walk that ends it names none, so it
|
|
1373
|
+
// is the same proof as before; the install that follows finds the directory gone and installs (GC-A24, snapshot-check.mjs).
|
|
1374
|
+
const staleDeps = [];
|
|
1375
|
+
let extra = snapshotProblem({ dir, entries, checkout: repo.checkout, commit, staleDeps });
|
|
1376
|
+
for (let round = 0; !extra && staleDeps.length && round < 64; round += 1) {
|
|
1377
|
+
for (const depDir of new Set(staleDeps.splice(0))) {
|
|
1378
|
+
const st = fs.lstatSync(depDir, { throwIfNoEntry: false });
|
|
1379
|
+
if (!st) continue;
|
|
1380
|
+
if (!st.isDirectory() || !inside(depDir, dir)) throw new SnapshotError("mismatch", `snapshot ${dir}: the dependency directory ${depDir} holds a link that does not resolve and is not a real directory inside the snapshot`);
|
|
1381
|
+
fs.rmSync(depDir, { recursive: true, force: true });
|
|
1382
|
+
// NN22: named first, so the sync line shows it whatever else the sync removed.
|
|
1383
|
+
removed += 1; removedPaths.unshift(`${path.relative(dir, depDir).split(path.sep).join("/")}/ (an installed dependency directory holding a link that resolves nowhere)`);
|
|
1384
|
+
}
|
|
1385
|
+
residentGeneration = resident ? beginResidentProof(dir, { ask: resident }) : null;
|
|
1386
|
+
extra = snapshotProblem({ dir, entries, checkout: repo.checkout, commit, staleDeps });
|
|
1387
|
+
}
|
|
1388
|
+
if (!extra && staleDeps.length) extra = snapshotProblem({ dir, entries, checkout: repo.checkout, commit });
|
|
1366
1389
|
if (extra) throw new SnapshotError("mismatch", `snapshot ${dir} is not exactly commit ${commit} after sync: ${extra}`);
|
|
1367
1390
|
const actual = snapshotTree({ checkout: repo.checkout, dir, baseTree: tree, repo });
|
|
1368
1391
|
if (actual !== tree) throw new SnapshotError("mismatch", `snapshot ${dir} is tree ${actual} after sync, not tree ${tree} of commit ${commit}`);
|