@rightkit/release 0.6.87 → 0.6.89

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/app-check.mjs CHANGED
@@ -110,6 +110,7 @@ import { CONSUMER_CONTRACT_RULES } from "./consumer-contracts.mjs";
110
110
  import { OWNERSHIP_CLASS_RULES } from "./ownership-class-rules.mjs";
111
111
  import { SOURCE_CLOSURE_RULES } from "./source-closure-rules.mjs";
112
112
  import { SHELL_CONTRACT_RULES } from "./shell-contract.mjs";
113
+ import { neutralIgnored } from "./stage-ledger.mjs";
113
114
  import { CONSUMER_SOURCE_RULES } from "./consumer-source-contracts.mjs";
114
115
  import { CONSUMER_POLICY_RULES } from "./consumer-policy.mjs";
115
116
  import { engineRecordStore, suiteKeyLiteral, suiteUpdaterKey } from "./suite-trust-roots.mjs";
@@ -1307,8 +1308,33 @@ function trustPolicyExclude({ root, files }) {
1307
1308
  return out;
1308
1309
  }
1309
1310
 
1311
+ // G29: the QA runner keeps a stash of the app binary and a pointer file under the app root (rightkit-qa binary.rs STASH_DIR, POINTER_FILE;
1312
+ // `[ui] pointer_file` renames the pointer). Its first run of an installed-QA stage writes them into the snapshot. A commit that does not
1313
+ // ignore them then has a snapshot that is no longer its tree: the broker fails the journeys build on its post-check (the client exits 125),
1314
+ // and the stage ledger refuses the file at the end of qualify, after package, signing and notarization (Pulse 1386c633 and CodeRight
1315
+ // 7622df951, 2026-11-26). The app root is the directory that holds both a release config and the runner's rightkit-qa.toml.
1316
+ function qaStashIgnored({ root, files }) {
1317
+ const out = [];
1318
+ const configDirs = new Set(configFiles(files).map(dirOf));
1319
+ for (const file of files.filter((f) => /(^|\/)rightkit-qa\.toml$/.test(f) && scanned(f) && configDirs.has(dirOf(f)))) {
1320
+ const dir = dirOf(file);
1321
+ const text = readText(root, file) ?? "";
1322
+ const pointer = /^\s*pointer_file\s*=\s*"([^"]+)"/m.exec(text)?.[1] ?? ".rightkit-qa-app-binary";
1323
+ const under = (name) => (dir === "." ? name : `${dir}/${name}`);
1324
+ const wanted = [[under(".rightkit-qa-bin/host/app"), under(".rightkit-qa-bin/")], [under(pointer), under(pointer)]];
1325
+ let ignored;
1326
+ try { ignored = neutralIgnored({ dir: root, paths: wanted.map(([probe]) => probe) }); } catch { continue; } // git cannot answer here: the stage ledger still guards at the end
1327
+ for (const [probe, line] of wanted) {
1328
+ if (ignored.has(probe)) continue;
1329
+ out.push({ file, subject: line, problem: `${line} is not ignored by the commit's own ignore rules; the QA runner writes it under the app root during installed QA, so the snapshot stops being the commit's tree and qualification fails after the package stage`, fix: `add "${line}" to the commit's .gitignore` });
1330
+ }
1331
+ }
1332
+ return out;
1333
+ }
1334
+
1310
1335
  export const RULES = Object.freeze([
1311
1336
  { id: "eol-policy", gap: "G04", run: eolPolicy },
1337
+ { id: "qa-stash-ignored", gap: "G29", run: qaStashIgnored },
1312
1338
  { id: "file-url", gap: "G12", run: fileUrls },
1313
1339
  { id: "retired-alias", gap: "P11", run: retiredAlias },
1314
1340
  { id: "qa-platform", gap: "G13", run: qaPlatform },
@@ -2286,6 +2286,9 @@ async function runStages(o, args, root, git, io) {
2286
2286
  return releasePinFloorProblem({ packageJsonText, installedVersion, where: appDir === "." ? "package.json" : `${appDir}/package.json` });
2287
2287
  };
2288
2288
  const phaseTimings = [];
2289
+ // The registry verdict this door run took before its compile, as a file only this process knows: a later invocation on the same commit
2290
+ // has no such file and asks the registries itself (rightkit#1754; the binding is to the run, never to the commit).
2291
+ let doorRegistryAdmissionFile = null;
2289
2292
  for (const stage of stages) {
2290
2293
  if (stage === "check" && publisherUploadOnly && receipt.stages.check?.ok && tierAtLeast(receipt.stages.check.ruleTier ?? "compile", earlyTier)) { o.out(`${tag} [check] already passed (${receipt.stages.check.ruleTier ?? "compile"} tier) for this exact input (commit, tree, lockfiles, gate, toolchain)`); continue; }
2291
2294
  if (stage === "compile" && receipt.stages.compile?.ok) {
@@ -2319,7 +2322,23 @@ async function runStages(o, args, root, git, io) {
2319
2322
  let ok = false; const at = new Date().toISOString(); const stageStartedMs = Date.now(); let extra = {}; let directReceipt = null; let packageSigned = new Map();
2320
2323
  if (stage === "check") {
2321
2324
  { const problem = await pinFloor(false); if (problem) { o.err(`${tag} BLOCKED: ${problem.message}; no class A row ran and nothing compiled`); return 1; } }
2325
+ // An app pinned to an older @rightkit/release than this host gate: said once, never refused (release-pin-floor.mjs releasePinBehindHostNote).
2326
+ try {
2327
+ const packageJsonText = appPackageJson();
2328
+ if (packageJsonText !== null) {
2329
+ const { releasePinBehindHostNote } = await import("../release-pin-floor.mjs");
2330
+ const hostVersion = JSON.parse(fs.readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
2331
+ const note = releasePinBehindHostNote({ packageJsonText, hostVersion, where: appDir === "." ? "package.json" : `${appDir}/package.json` });
2332
+ if (note) o.out(`${tag} [check] note: ${note}`);
2333
+ }
2334
+ } catch { /* informational only */ }
2322
2335
  ok = (await (o.runCheck ?? (() => main(["check", "--commit", ds ? commit : "HEAD", "--full-a", ...(ds ? ["--snapshot", ds.path] : []), ...appScope, "--rule-tier", earlyTier], { ...io, cwd: root, ...(ds ? { snapshotLock: ds.lock } : {}) })))(earlyTier)) === 0;
2336
+ // A run that goes on to qualify: a journeys manifest whose release-critical journeys cannot pass one installed-QA run is refused here,
2337
+ // before anything compiles (release-qa-hardening.mjs criticalJourneySelectionProblems; CodeRight 2026-11-26: four adapters, found after notarization).
2338
+ if (ok && stages.includes("qualify") && !mobile && PLATFORMS.includes(platform)) {
2339
+ const shape = await journeysShapeProblems({ o, git, commit, appDir, base: ds ? ds.path : root, platform });
2340
+ if (shape.length) { for (const line of shape) o.err(`${tag} BLOCKED: [check] ${line}`); ok = false; }
2341
+ }
2323
2342
  extra = { ruleTier: earlyTier };
2324
2343
  }
2325
2344
  else if (stage === "compile") {
@@ -2344,6 +2363,14 @@ async function runStages(o, args, root, git, io) {
2344
2363
  };
2345
2364
  const admissionAfterStaging = wantsAdmission && executor.kind === "broker" && Boolean(ds);
2346
2365
  if (wantsAdmission && !admissionAfterStaging) ok = await admissionDryRun("before any compile");
2366
+ // On a broker host the full dry-run waits for a Cargo target; the registry rows (pin freshness) need none, so they run first.
2367
+ // A stale pin is then refused in seconds, before the sidecars and the app compile, and the verdict is kept for this run's package stage.
2368
+ if (ok && wantsAdmission && admissionAfterStaging) {
2369
+ const file = path.join(fs.mkdtempSync(path.join(os.tmpdir(), "rk-door-registry-")), "admission.json");
2370
+ o.out(`${tag} [compile] registry admission for ${platform} before any compile (right-release build --platform ${platform} --registry-admission-out)`);
2371
+ if (await rightRelease(stage, ["build", "--platform", platform, "--registry-admission-out", file])) doorRegistryAdmissionFile = file;
2372
+ else { o.err(`${tag} BLOCKED: [compile] the registry admission (pin freshness against the registries) refused ${platform}; nothing compiled`); ok = false; }
2373
+ }
2347
2374
  // On the snapshot route the sidecars are staged from the snapshot's own config and sources through right-release's source split
2348
2375
  // (the staged files and receipt land beside the sources the compile reads; the caches and build trees stay the checkout's), before
2349
2376
  // `main --all` compiles. A broker host's stage-sidecar child reaches Cargo through the stage's carrier (stage-seam.mjs).
@@ -2432,7 +2459,7 @@ async function runStages(o, args, root, git, io) {
2432
2459
  else if (packageMulti.note) o.out(`${tag} [package] ${packageMulti.note}`);
2433
2460
  }
2434
2461
  const packageEnv = packagePin.dir ? { CARGO_TARGET_DIR: packagePin.dir } : (packageMulti?.env ?? {});
2435
- ok = ok && await rightRelease(stage, ["build", "--platform", platform], packageEnv);
2462
+ ok = ok && await rightRelease(stage, ["build", "--platform", platform], { ...packageEnv, ...(doorRegistryAdmissionFile ? { RK_DOOR_REGISTRY_ADMISSION: doorRegistryAdmissionFile } : {}) });
2436
2463
  const sealed = ok ? (o.sealedFor ?? sealedFor)({ root: releaseRoot, commit, platform }) : null;
2437
2464
  if (ok && !sealed) { o.err(`${tag} [package] the build reported success but sealed nothing for ${commit.slice(0, 8)} on ${platform}`); ok = false; }
2438
2465
  if (sealed) extra = { platform, sealed: sealed.id, manifestSha256: sealed.digest };
@@ -2987,6 +3014,33 @@ export function qualifyOwedProblem({ o, git, commit, appDir = ".", base, owed })
2987
3014
  return owed.map((x) => `${x.id} (${x.kind}${x.dir ? ` ${x.dir}` : ""}) is owed to qualification (${x.reason}) but no release config under ${appDir} declares qa.journeys, so nothing would run it; declare qa.journeys with a journeys.toml that covers it`);
2988
3015
  }
2989
3016
 
3017
+ /**
3018
+ * Why the journeys manifests of the app's release configs cannot pass one installed-QA run on `platform`; empty when they can or when no
3019
+ * config declares `qa.journeys` with a manifest. Read from `base` (the commit's bytes): the manifest path is the config's
3020
+ * `qa.journeys.manifest`, relative to the config's directory. A manifest that cannot be read or parsed is left to the installed stage,
3021
+ * which names that failure itself.
3022
+ */
3023
+ export async function journeysShapeProblems({ o, git, commit, appDir = ".", base, platform }) {
3024
+ const listed = git("ls-tree", "-r", "--name-only", "-z", commit);
3025
+ const configs = (failed(listed) ? [] : text(listed).split("\0").filter((f) => /(^|\/)right-release\.config\.(json|mjs)$/.test(f)).filter((f) => appDir === "." || f.startsWith(`${appDir}/`)));
3026
+ const problems = [];
3027
+ let judge = null;
3028
+ for (const config of configs) {
3029
+ let body;
3030
+ try { body = String(o.readFile(path.join(base, config))); } catch { continue; }
3031
+ const m = /\bjourneys["']?\s*:\s*\{[^{}]*?\bmanifest["']?\s*:\s*["']([^"']+)["']/.exec(body);
3032
+ if (!m) continue;
3033
+ const manifestRel = path.posix.join(path.posix.dirname(config), m[1]);
3034
+ let manifestText;
3035
+ try { manifestText = String(o.readFile(path.join(base, manifestRel))); } catch { continue; }
3036
+ judge ??= (await import("../release-qa-hardening.mjs")).criticalJourneySelectionProblems;
3037
+ let found;
3038
+ try { found = judge(manifestText, platform); } catch { continue; }
3039
+ for (const line of found) problems.push(`${manifestRel}: ${line}`);
3040
+ }
3041
+ return problems;
3042
+ }
3043
+
2990
3044
  /** The release configs of `commit` (under `appDir`) that declare a `web` block (`web.build` steps), read from `base`: the commit's config decides, never the checkout's. */
2991
3045
  export function committedWebBuildConfigs({ o, git, commit, appDir = ".", base }) {
2992
3046
  const listedConfigs = git("ls-tree", "-r", "--name-only", "-z", commit);
@@ -4566,13 +4620,20 @@ export async function main(argv, io = {}) {
4566
4620
  // GC-A24: RightKit's own preflight and exports probe execute the commit's code with its installed dependencies; a pass is reused
4567
4621
  // for the same commit tree, installed-dependency bytes, node and platform (and scope), and only a pass.
4568
4622
  const effects = path.join(snapshotDir, "scripts", "ci", "exports-import-effects.mjs");
4623
+ // rightkit#1808: the exports probe imports every exported module from the snapshot, so it needs the snapshot's dependencies. Only a
4624
+ // full admission (--full-a) installs them; a content check installs nothing. The probe therefore runs only on a full admission, and
4625
+ // whether it ran is part of the cache key, so a content check's pass is never reused as a probed one.
4626
+ const probes = o.exists(effects) && scopeForward.length === 0 && fullAdmission;
4569
4627
  let selfKey = null;
4570
- if (ruleCache) { try { selfKey = ruleCache.key({ rule: "rightkit-self-rules", tree: snapshotCommit.tree, scope: scopeForward, installed: installedDependencyDigest({ root: snapshotDir, files: sc.commitFiles(snapshotCheckout, snapshotCommit.commit, o.spawn).files, includeCaches: false }), effects: o.exists(effects) }); } catch { selfKey = null; } }
4628
+ if (ruleCache) { try { selfKey = ruleCache.key({ rule: "rightkit-self-rules", tree: snapshotCommit.tree, scope: scopeForward, installed: installedDependencyDigest({ root: snapshotDir, files: sc.commitFiles(snapshotCheckout, snapshotCommit.commit, o.spawn).files, includeCaches: false }), effects: probes }); } catch { selfKey = null; } }
4571
4629
  const selfCached = Boolean(selfKey && ruleCache.passed(selfKey));
4572
4630
  if (selfCached) o.out(`preflight: ${snapshotCommit.commit.slice(0, 12)} cached pass (tree ${snapshotCommit.tree.slice(0, 12)}, same installed dependencies)`);
4573
4631
  const r = selfCached ? { status: 0 } : launch(process.execPath, [path.join(snapshotDir, "scripts", "preflight.mjs"), "--repo", root, "--commit", snapshotCommit.commit], { cwd: root, env: o.env });
4574
4632
  selfRules = r.status === 0 ? 0 : 1;
4575
- if (!selfCached && selfRules === 0 && o.exists(effects) && scopeForward.length === 0) {
4633
+ if (!selfCached && selfRules === 0 && o.exists(effects) && scopeForward.length === 0 && !fullAdmission) {
4634
+ o.out("exports-import-effects: not run by this content check (it installs no dependencies into the snapshot); run the check with --full-a, or any --to stage, to probe the exports");
4635
+ }
4636
+ if (!selfCached && selfRules === 0 && probes) {
4576
4637
  const common = o.spawn("git", ["rev-parse", "--path-format=absolute", "--git-common-dir"], { cwd: root });
4577
4638
  const report = path.join(failed(common) ? path.join(root, ".git") : text(common).trim(), "rightkit-gate", "import-effects", `snapshot-${snapshotCommit.commit}.json`);
4578
4639
  const e = launch(process.execPath, [effects, "--root", snapshotDir, "--no-export", "--report", report], { cwd: snapshotDir, env: o.env });
@@ -5899,7 +5960,14 @@ export async function main(argv, io = {}) {
5899
5960
  const outputWorkspaces = (snapshotBroker ? scanResult.scans.map((r) => r.snapshotEvidence?.outputDir) : Object.values(targetDirs ?? {})).filter(Boolean).map((dir) => [dir]);
5900
5961
  // Each broker row's output folder with its Cargo workspace (repository-relative), so a later stage of the same door run can resolve that workspace's
5901
5962
  // target before its own first Cargo call (a multi-workspace app's package admission, CodeRight on the Mac 0.6.80: RK_SPLIT_TARGET_UNRESOLVED).
5902
- const outputsByCargoDir = snapshotBroker ? scanResult.scans.flatMap((r) => { const unit = unitByName.get(rustUnitOfScanId(r.id, known)); const dir = r.snapshotEvidence?.outputDir; return typeof unit?.cargoDir === "string" && typeof dir === "string" && dir ? [[unit.cargoDir, dir]] : []; }) : [];
5963
+ const ranByCargoDir = snapshotBroker ? scanResult.scans.flatMap((r) => { const unit = unitByName.get(rustUnitOfScanId(r.id, known)); const dir = r.snapshotEvidence?.outputDir; return typeof unit?.cargoDir === "string" && typeof dir === "string" && dir ? [[unit.cargoDir, dir]] : []; }) : [];
5964
+ // rightkit#1800: a compile answered wholly from the cache asked the broker nothing, so no row names the workspace's folder and the package stage's admission
5965
+ // could not resolve its Cargo target (CodeRight on the Mac, 2026-11-26: RK_SPLIT_TARGET_UNRESOLVED after a cached compile). For a workspace none of whose rows
5966
+ // ran, the folder its cached rows' stored signed receipts name is handed on, when it still exists. It is only the first resolution of that stage: its own
5967
+ // build's receipt replaces it (stage-seam.mjs carriedOutputDir), and a folder the broker no longer uses is refused by the split's own target checks.
5968
+ const ranDirs = new Set(ranByCargoDir.map(([cargoDir]) => cargoDir));
5969
+ const cachedByCargoDir = snapshotBroker ? scanResult.scans.flatMap((r) => { const unit = unitByName.get(rustUnitOfScanId(r.id, known)); const dir = r.cachedOutputDir; return r.cached === true && typeof unit?.cargoDir === "string" && !ranDirs.has(unit.cargoDir) && typeof dir === "string" && dir && fs.existsSync(dir) ? [[unit.cargoDir, dir]] : []; }) : [];
5970
+ const outputsByCargoDir = [...ranByCargoDir, ...cachedByCargoDir];
5903
5971
  o.onCompileOutputs?.(outputWorkspaces.map(([dir]) => dir), builtBins, outputsByCargoDir);
5904
5972
  o.out(`${tag} class B keying: ${ROW_DIGEST_STATS.misses} row digest(s) computed in ${(ROW_DIGEST_STATS.ms / 1000).toFixed(1)} s, ${ROW_DIGEST_STATS.hits} reused`);
5905
5973
  if (snapshotBroker) o.out(`${tag} broker compile: ${new Set(scanResult.scans.map((r) => r.snapshotEvidence?.requestId).filter(Boolean)).size} carried request(s) with verified signed receipts (${scanResult.scans.filter((r) => r.snapshotEvidence).length} scan row(s)); no direct receipt on a broker host`);
package/build-release.mjs CHANGED
@@ -122,6 +122,7 @@ let platform = process.platform === "win32" ? "win" : process.platform === "darw
122
122
  let dryRun = false;
123
123
  let skipChecks = false;
124
124
  let resumeFrom = null;
125
+ let registryAdmissionOut = null;
125
126
 
126
127
  for (let i = 0; i < args.length; i += 1) {
127
128
  const arg = args[i];
@@ -130,6 +131,7 @@ for (let i = 0; i < args.length; i += 1) {
130
131
  else if (arg === "--dry-run") dryRun = true;
131
132
  else if (arg === "--skip-checks") skipChecks = true;
132
133
  else if (arg === "--resume-from") resumeFrom = args[++i];
134
+ else if (arg === "--registry-admission-out") registryAdmissionOut = args[++i];
133
135
  else if (arg === "--tier" || arg.startsWith("--tier=")) fail("build is tier-neutral; select patch or update only during upload");
134
136
  else if (arg === "-h" || arg === "--help") usage(0);
135
137
  else fail(`unknown argument: ${arg}`);
@@ -178,6 +180,13 @@ let requestActiveRunStop = null;
178
180
  // Admission (admission.mjs): every refusal the committed files, this host or the registries can decide is raised here, before the
179
181
  // dry-run exit, the clean-source gate, the release lock, any state file, the install, a slot or the worker. `right-release doctor`
180
182
  // runs the same rows with the same text, so the two cannot disagree (rightkit#946); a refused build leaves nothing behind.
183
+ // Declared before its first use below: both functions that read it are called from this top-level code (a const is not hoisted).
184
+ /** The schema of the registry admission a door run takes before any compile and hands to its own package stage. */
185
+ const DOOR_REGISTRY_ADMISSION_SCHEMA = "rightkit.door-registry-admission/1";
186
+
187
+ // The door asks for the registry rows alone, before any compile (rightkit#1754): pin freshness needs no Cargo target, while the full
188
+ // admission's recipe rows do. The verdict and its snapshot are written for the door run that asked; nothing else is read or started.
189
+ if (registryAdmissionOut) await registryAdmissionOnly();
181
190
  const admitted = await admit();
182
191
 
183
192
  // A dry-run is an inspection contract, not a partial build. It prints the admission rows and exits with their verdict, so it can
@@ -623,6 +632,50 @@ try {
623
632
  lock?.release();
624
633
  }
625
634
 
635
+ // `right-release build --registry-admission-out <file>`: resolve this app's RightKit pins against the registries, refuse a pin behind the
636
+ // settled latest exactly as the build admission does, and write the snapshot for the door run. No lock, state, cache or install.
637
+ // The lock inventory is the build's when it can be read without a Cargo target, else the app's own; the package stage checks the
638
+ // snapshot against its full inventory before it trusts it (prepareRightKitResolution with boundSnapshot), so a pin cannot be missed.
639
+ async function registryAdmissionOnly() {
640
+ const commit = releaseSource.commit;
641
+ let config;
642
+ try { config = await importReleaseConfig(configPath, { query: `commit=${commit}` }); }
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
+ let extraLocks;
645
+ try {
646
+ const inputs = resolveReleaseBuildInputs({ repoRoot: sourceRoot, appRoot, configPath, config, target: config.targets?.[platform] });
647
+ extraLocks = rightKitLockInventory({ requiredInputs: inputs.requiredInputs, cargoLockPaths: inputs.cargoLockPaths, nativeLayout: inputs.nativeLayout, config, root: appRoot });
648
+ } catch { extraLocks = rightKitLockInventory({ config, root: appRoot }); }
649
+ let resolution;
650
+ try {
651
+ resolution = await prepareRightKitResolution({
652
+ root: appRoot, extraLocks,
653
+ versions: JSON.parse(readFileSync(path.join(TOOL_ROOT, "rightkit-versions.json"), "utf8")),
654
+ ownership: JSON.parse(readFileSync(path.join(TOOL_ROOT, "rightkit-ownership.json"), "utf8")),
655
+ releaseVersion: RELEASE_TOOL_VERSION, admission: true, cacheDir: "",
656
+ });
657
+ } catch (error) {
658
+ if (!(error instanceof RightKitRegistryError)) throw error;
659
+ console.error(`right-release build: rightkit-registry: ${error.message}`);
660
+ console.error("right-release build: registry admission found a blocking problem; nothing was started");
661
+ process.exit(1);
662
+ }
663
+ for (const line of resolution.freshness.warnings) console.error(`[right-release] WARNING ${line}`);
664
+ writeFileSync(path.resolve(registryAdmissionOut), `${JSON.stringify({ schema: DOOR_REGISTRY_ADMISSION_SCHEMA, commit, platform, observedAt: new Date().toISOString(), snapshot: resolution.snapshot })}\n`);
665
+ console.log(`right-release build: rightkit-registry: ${resolution.summary}; admitted before any compile for this door run`);
666
+ process.exit(0);
667
+ }
668
+
669
+ /** The registry admission this door run took before its compile (RK_DOOR_REGISTRY_ADMISSION), when it is for this commit and platform; else null. */
670
+ function doorRegistryAdmission(commit) {
671
+ const file = process.env.RK_DOOR_REGISTRY_ADMISSION;
672
+ if (!file) return null;
673
+ try {
674
+ const record = JSON.parse(readFileSync(file, "utf8"));
675
+ return record?.schema === DOOR_REGISTRY_ADMISSION_SCHEMA && record.commit === commit && record.platform === platform && record.snapshot ? record : null;
676
+ } catch { return null; }
677
+ }
678
+
626
679
  // Read the config and run the admission rows (files, this host and, for a fresh build, the registries) with no side effect: no lock,
627
680
  // state directory, cache directory, install or snapshot file. A finding is printed with its row and the process exits 1, no stack.
628
681
  async function admit() {
@@ -648,12 +701,29 @@ async function admit() {
648
701
  registry: async (ctx) => {
649
702
  const inputs = ctx.buildInputs();
650
703
  if (!inputs.ok) return undefined; // the build-inputs row reports it
651
- return prepareRightKitResolution({
704
+ const common = {
652
705
  root: appRoot,
653
706
  extraLocks: rightKitLockInventory({ requiredInputs: inputs.value.requiredInputs, cargoLockPaths: inputs.value.cargoLockPaths, nativeLayout: inputs.value.nativeLayout, config, root: appRoot }),
654
707
  versions: JSON.parse(readFileSync(path.join(TOOL_ROOT, "rightkit-versions.json"), "utf8")),
655
708
  ownership: JSON.parse(readFileSync(path.join(TOOL_ROOT, "rightkit-ownership.json"), "utf8")),
656
709
  releaseVersion: RELEASE_TOOL_VERSION,
710
+ };
711
+ // The door run already took the registry verdict before its compile (--registry-admission-out). It is reused only when it covers
712
+ // this build's full lock inventory; otherwise it is dropped and the registries are asked now, as before. So the clock cannot turn
713
+ // a pin stale between an app's compile and its package (the 24-hour settle rule; Pulse 2026-11-26, admitted 15:31Z, refused 15:56Z).
714
+ const doorBound = doorRegistryAdmission(commit);
715
+ if (doorBound) {
716
+ try {
717
+ const bound = await prepareRightKitResolution({ ...common, boundSnapshot: doorBound.snapshot, reuse: true });
718
+ console.error(`right-release build: rightkit-registry: the verdict this door run took before its compile (${doorBound.observedAt}) covers this build; the registries are not asked again`);
719
+ return bound;
720
+ } catch (error) {
721
+ if (!(error instanceof RightKitRegistryError)) throw error;
722
+ console.error(`right-release build: rightkit-registry: the verdict taken before the compile does not cover this build's locks (${String(error.message).split("\n")[0]}); asking the registries now`);
723
+ }
724
+ }
725
+ return prepareRightKitResolution({
726
+ ...common,
657
727
  // Build admission: refuse every pin behind the registry's latest. A dry run asks, but keeps no cache on disk.
658
728
  admission: true,
659
729
  ...(dryRun ? { cacheDir: "" } : {}),
@@ -75,7 +75,12 @@ const WORKTREE_COMPILES = new Set(["dev", "test", "stage-sidecar", "stage-xcfram
75
75
  // commit's objects plus the door's verified snapshot, never the checkout's HEAD, status or branch (each re-proves it through
76
76
  // assertReleaseSource). `upload` does so for the mobile platforms (the host's store upload); a desktop upload, publish and the signing
77
77
  // commands still read the checkout's HEAD and refuse under a split rather than run on the wrong bytes.
78
- const SPLIT_COMMANDS = new Set(["dev", "test", "stage-sidecar", "stage-xcframework", "web-build", "build", "package", "release", "qa"]);
78
+ // assemble-app and create-mac-updater are steps an app's release config runs INSIDE a split build (targets.<p>.prePackage, package, postSign). They
79
+ // read no HEAD, status or branch: assemble-app works on the snapshot's files, the stage-sidecar receipt and the build number the gate hands down
80
+ // (assembled-app.mjs commitCount, GC-A28), and create-mac-updater resolves its paths through the split artifact context (loadSplitArtifactContext).
81
+ // They were missing here, so every app that assembles its payload with assemble-app was refused at its first package step on a snapshot
82
+ // (Pulse, 2026-11-26: RK_SOURCE_SPLIT_UNSUPPORTED), and a mac target's create-mac-updater post-sign step would have been refused the same way.
83
+ const SPLIT_COMMANDS = new Set(["dev", "test", "stage-sidecar", "stage-xcframework", "web-build", "build", "package", "release", "qa", "assemble-app", "create-mac-updater"]);
79
84
  const MOBILE_UPLOAD = (argv) => argv.some((a, i) => (a === "--platform" && ["ios", "android"].includes(argv[i + 1])) || a === "--platform=ios" || a === "--platform=android");
80
85
  async function requireGreenCheck() {
81
86
  const { guardCommand, checkedCommandOf, checkModeFor, appDirectory } = await import("../app-check.mjs");
@@ -436,8 +441,7 @@ Commands:
436
441
  Enroll one native key or create a signed-device request
437
442
  ownership approve-key <fingerprint|request.json> Approve one pending device key from an active host
438
443
  ownership revoke-key <fingerprint> Revoke one active device key
439
- ownership trust-sync Advance this host's protected trust to the committed key log
440
- ownership trust-sync --check Read-only: say whether a sync would ask for approval, and for what (exit 3 if so)
444
+ ownership trust-sync | trust-refresh Retired: no check needs the host's protected trust refreshed (prints why)
441
445
  ownership trust-compare [--json] Print this host's protected-trust digest (Mac is the reference)
442
446
  ownership-approval Retired no-op: exceptions are plain entries in the repo exceptions file, edited directly and reviewed through git
443
447
  ownership-report --workspace <dir> [--markdown <file>] [--json-out <file>]
@@ -4592,7 +4592,10 @@ export async function runScans(plan, options = {}) {
4592
4592
  // One predicate for every stored pass (usableStoredPass; rightkit#1538): the row's own id and command, written by the invocation that ran it, with
4593
4593
  // the evidence its kind needs; a test group's hit carries each member's own run, so the members are judged exactly as on the run that stored it.
4594
4594
  if (usableStoredPass(hit, s, { cacheKey, viaSeam })) {
4595
- cached = { ...row, status: "pass", cached: true, detail: `cached ${String(hit.at ?? "").slice(0, 10) || "earlier"}`, ...(s.kind === "test" || s.runOutside || s.coverageKey ? { results: hit.row.results } : {}), ...(s.coverageKey ? { snapshotEvidence: hit.row.snapshotEvidence ?? null, testRun: hit.row.testRun ?? null } : s.provesPublisher ? { snapshotEvidence: hit.row.snapshotEvidence ?? null, ...(hit.row.testRun ? { testRun: hit.row.testRun } : {}) } : hit.row.testRun ? { testRun: hit.row.testRun } : {}), ...(hit.row.memberRuns ? { memberRuns: hit.row.memberRuns } : {}), ...(hit.row.executableProof ? { executableProof: hit.row.executableProof } : {}), ...(row.seam ? { seamSettled: true } : {}) };
4595
+ cached = { ...row, status: "pass", cached: true, detail: `cached ${String(hit.at ?? "").slice(0, 10) || "earlier"}`, ...(s.kind === "test" || s.runOutside || s.coverageKey ? { results: hit.row.results } : {}), ...(s.coverageKey ? { snapshotEvidence: hit.row.snapshotEvidence ?? null, testRun: hit.row.testRun ?? null } : s.provesPublisher ? { snapshotEvidence: hit.row.snapshotEvidence ?? null, ...(hit.row.testRun ? { testRun: hit.row.testRun } : {}) } : hit.row.testRun ? { testRun: hit.row.testRun } : {}), ...(hit.row.memberRuns ? { memberRuns: hit.row.memberRuns } : {}), ...(hit.row.executableProof ? { executableProof: hit.row.executableProof } : {}), ...(row.seam ? { seamSettled: true } : {}),
4596
+ // rightkit#1800: the folder the stored row's signed receipt names, kept apart from `snapshotEvidence` (this run asked the broker nothing for
4597
+ // this row). The door uses it only to tell a later stage where this workspace's Cargo target is when no row of the workspace ran.
4598
+ ...(viaSeam && retainedReceiptValid(hit.row.snapshotEvidence) && typeof hit.row.snapshotEvidence.outputDir === "string" && hit.row.snapshotEvidence.outputDir ? { cachedOutputDir: hit.row.snapshotEvidence.outputDir } : {}) };
4596
4599
  }
4597
4600
  // NN41: the same inputs, toolchain and broker runtime already failed this compile deterministically: report that failure, marked cached, without running it.
4598
4601
  const failHit = cached ? null : readRowCache(failKey, admission);
package/gate-serve.mjs CHANGED
@@ -167,6 +167,10 @@ export async function serve({ root, idleMs = Number(process.env.RK_GATE_SERVE_ID
167
167
  lastRequest = Date.now();
168
168
  if (req?.schema !== SCHEMA) return { ok: false, why: "schema" };
169
169
  if (req.identity !== IDENTITY) { setTimeout(() => process.exit(0), 50); return { ok: false, why: "gate code changed; the server exits" }; }
170
+ // `stop`: end this server now, the same way the idle timer ends it. The server of a candidate gate runs from the candidate's own
171
+ // folder, and on Windows that keeps `trusted-gate promote` from renaming the folder (rightkit#1778: "Access is denied" until the
172
+ // process was ended by hand). `node gate-serve.mjs stop` is the supported way to end it before a promote.
173
+ if (req.op === "stop") { setTimeout(() => process.exit(0), 50); return { ok: true, stopping: true, pid: process.pid }; }
170
174
  if (req.op === "status") return { ok: true, healthy, changeSource, root: watchedRoot, proven: [...proven].map(([k, v]) => ({ key: k, tree: v.tree })), pid: process.pid, identity: IDENTITY };
171
175
  // Answers kept for later runs (resident-answers.mjs): an opaque string under a sha256 key. The caller stores each answer with the files it
172
176
  // depends on and checks them itself before it uses one; this process only holds the bytes, in memory, oldest out first.
@@ -415,5 +419,8 @@ if (isServeEntry) {
415
419
  ask(req ?? {}, Number(b) || 3000).then((res) => { process.stdout.write(`${JSON.stringify(res)}\n`, () => process.exit(0)); });
416
420
  } else if (cmd === "status") {
417
421
  ask({ op: "status" }, 3000).then((res) => { console.log(JSON.stringify(res, null, 2)); process.exit(res.ok ? 0 : 1); });
418
- } else { console.error("usage: gate-serve.mjs serve <snapshot-root> | status"); process.exit(2); }
422
+ } else if (cmd === "stop") {
423
+ // Exit 0 when a server answered and is stopping, or when none is listening (nothing to stop).
424
+ ask({ op: "stop" }, 3000).then((res) => { console.log(JSON.stringify(res)); process.exit(res.ok || res.unreachable === true ? 0 : 1); });
425
+ } else { console.error("usage: gate-serve.mjs serve <snapshot-root> | status | stop"); process.exit(2); }
419
426
  }
package/init-command.mjs CHANGED
@@ -256,7 +256,7 @@ export const NEXT_STEPS = Object.freeze([
256
256
  "pnpm install (installs the pinned packages and, through `prepare`, the agent hook; no git hook)",
257
257
  "right-release doctor (the build's own checks for this app, as rows)",
258
258
  "set the app's public legal host in legal-snapshot.config.json, replace legal/PRODUCT_SCHEDULE.md and legal/PRIVACY_NOTICE.md with reviewed text, then `pnpm exec legal-snapshot`",
259
- "register the repository on each host: add it to packages/release/ownership-repositories.json in RightKit (and its byte copy under packages/build-control-policy), then run `right-release ownership trust-refresh` on the Mac and the Dell (a person with administrator rights; an agent cannot)",
259
+ "register the repository on each host: add it to packages/release/ownership-repositories.json in RightKit (and its byte copy under packages/build-control-policy), and release RightKit; the gate reads that shipped list, so no host step and no administrator is needed",
260
260
  "README.md in the template: \"Create a new app (checklist)\"",
261
261
  ]);
262
262
 
@@ -359,6 +359,19 @@ export function installAssembledWindows({ root, config, descriptor: rawDescripto
359
359
  if (listFiles(fs, incoming).join("\n") !== before.join("\n")) abandon("the incoming payload changed its file list while signing");
360
360
  for (const [file, want] of unsigned) if (digest(fs, platformPath(incoming, file)) !== want) abandon(`${file} changed while signing`);
361
361
  try { verifyWindowsPayload({ spec, payload: incoming, profile: "dev", fs }); } catch (error) { removeOrAside(incoming); throw error; }
362
+ // The dev marker's `files` map is written at assembly, before signing, so for every signed executable it names bytes that are no longer on
363
+ // disk (Pulse 4e2f01b1, 2026-11-26: 8 of 14 hashes differed from the installed files). `files` keeps its meaning (the payload as
364
+ // assembled); `installed` is added here, after signing and verification, with the hash of each of those files as it will be installed.
365
+ // The marker is not part of a signature on Windows. A marker that cannot be rewritten is reported and the install goes on: it is no
366
+ // worse than before.
367
+ if (spec.devMarker) {
368
+ const markerFile = platformPath(incoming, spec.devMarker);
369
+ try {
370
+ const marker = JSON.parse(fs.readFileSync(markerFile, "utf8"));
371
+ marker.installed = Object.fromEntries(Object.keys(marker.files ?? {}).map((file) => [file, digest(fs, platformPath(incoming, file))]));
372
+ fs.writeFileSync(markerFile, `${JSON.stringify(marker, null, 2)}\n`);
373
+ } catch (error) { d.log(`right-release dev: ${spec.devMarker} could not record the installed hashes (${error.message}); its files map still lists the pre-signing hashes`); }
374
+ }
362
375
 
363
376
  // 2. Stop: the background task and everything that runs from the install folder.
364
377
  const exe = descriptor.stop.process ? path.join(dir, descriptor.stop.process) : null;
package/local-publish.mjs CHANGED
@@ -777,7 +777,7 @@ export async function compileLocalUnit(kind, argv, { env = process.env, source =
777
777
  if (step.done || step.value?.stage !== "compile") refuse("unit compile did not complete");
778
778
  assertUnitDoor(parsed.workspaceRoot, "compile", env, identity, source);
779
779
  const state = Object.freeze({});
780
- unitStages.set(state, { runner, parsed, identity, source, stage: "compile", compileRequests: [...(step.value.brokerRequests ?? [])] });
780
+ unitStages.set(state, { runner, parsed, identity, source, stage: "compile", compileRequests: [...(step.value.brokerRequests ?? [])], tests: step.value.tests ?? null });
781
781
  return state;
782
782
  } catch (error) { await runner.return(); throw error; }
783
783
  }
@@ -801,6 +801,8 @@ export const packageLocalUnit = (state, { env = process.env } = {}) => advanceLo
801
801
  export const qualifyLocalUnit = (state, { env = process.env } = {}) => advanceLocalUnit(state, "package", "qualify", env);
802
802
  /** The broker request ids of this process's completed compile stage (the package stage's ride on its result). */
803
803
  export const localUnitCompileRequests = (state) => [...(unitStages.get(state)?.compileRequests ?? [])];
804
+ /** The compile stage's test counts ({ executed, skipped, ignored, assetGated }), or null when the unit ran no test step that reported any. */
805
+ export const localUnitCompileTests = (state) => unitStages.get(state)?.tests ?? null;
804
806
  export async function closeLocalUnit(state) {
805
807
  const entry = unitStages.get(state);
806
808
  if (entry) { unitStages.delete(state); await entry.runner.return(); }
@@ -962,7 +964,9 @@ async function* publishUnitStages(parsed, deps, batch) {
962
964
  const verdict = judgeUnit({ name: unit, steps: steps.map((s) => ({ ...s, unit: plan.id })), allowNoTests: true, allowIgnored: ignoredAllowed ? [unit] : [], allowMissingAssets: isAssetGated ? [unit] : [] });
963
965
  if (verdict.status === "fail" || steps.some((s) => s.failed > 0)) refuse(`${plan.id} not qualified: ${verdict.problems.join("; ") || "failed tests reported"}`);
964
966
  log(`[right-release] ${plan.id}: ${verdict.executed} passed, 0 failed, ${verdict.skipped} skipped, ${verdict.ignored} ignored${isAssetGated ? " (asset-gated: RIGHTKIT_REQUIRE_ASSETS=0, skips recorded)" : ""}`);
965
- const packageEnv = yield { stage: "compile", kind, name: unit, version, commit: head, brokerRequests: brokerRequests.splice(0) };
967
+ // The test counts travel with the compile result (rightkit#1754): `skipped` counts SKIP marker lines, so a unit whose asset-gated tests
968
+ // returned early is told from one whose tests ran.
969
+ const packageEnv = yield { stage: "compile", kind, name: unit, version, commit: head, brokerRequests: brokerRequests.splice(0), tests: { executed: verdict.executed, skipped: verdict.skipped, ignored: verdict.ignored, assetGated: Boolean(isAssetGated) } };
966
970
  if (packageEnv) Object.assign(env, testEnv({ env: packageEnv }, isAssetGated));
967
971
 
968
972
  // Availability is a publication/qualification precondition, not a compile precondition.
@@ -228,6 +228,19 @@ export function planMacSigning({ entries, nestedCode = [], nestedSigning, root,
228
228
  const apps = entries.map((entry) => entry.file).filter((file) => /\.app\/?$/.test(file)).map((file) => file.replace(/\/+$/, ""));
229
229
  for (const app of apps) {
230
230
  const own = [...byPath.values()].filter((item) => item.file.startsWith(app + path.sep) || item.file.startsWith(`${app}/`));
231
+ // A per-path sign.entitlements entry reaches nested code only: the bundle and its main executable are signed by the bundle's own
232
+ // sign.prePackageFiles entry. A key naming either, or an exact key naming no nested code at all, used to be dropped in silence and the
233
+ // binary shipped hardened with no entitlements (HeardRight's macOS config, found by reading 2026-11-26). It is refused here, where the
234
+ // main executable's name is known, with the message sign.nestedCode already gives for the same mistake.
235
+ if (nestedSigning.entitlements && typeof nestedSigning.entitlements === "object" && !Array.isArray(nestedSigning.entitlements)) {
236
+ const mainRelative = `Contents/MacOS/${mainName(app)}`;
237
+ const nestedRelative = new Set(own.map((item) => path.relative(app, item.file).split(path.sep).join("/")));
238
+ for (const key of Object.keys(nestedSigning.entitlements)) {
239
+ const normalized = key.replace(/^\.\/+/, "").replace(/\/+$/, "");
240
+ if (normalized === "." || normalized === "" || normalized === mainRelative) throw invalid(`sign.entitlements[${JSON.stringify(key)}]: the bundle and its main executable are signed with the bundle; set entitlements on its sign.prePackageFiles entry ({ file, entitlements }). A per-path entry applies to nested code only`);
241
+ if (!/[*?]/.test(normalized) && !nestedRelative.has(normalized)) throw invalid(`sign.entitlements[${JSON.stringify(key)}]: names no nested code inside ${path.basename(app)}; the entry would be ignored and the file signed without entitlements`);
242
+ }
243
+ }
231
244
  let settings;
232
245
  try { settings = resolveSettings(own.map((item) => item.file), { app, sign: nestedSigning, root: root ?? process.cwd() }); }
233
246
  catch (error) { throw invalid(error.message); }
@@ -306,7 +306,8 @@ function versionAtLeast(actual, minimum) {
306
306
  // re-pin it, is retired (Adrian, decisions.md), so no check refuses on a missing or stale pinned bundle.
307
307
  export const TRUST_SYNC_RETIRED = "right-release ownership trust-sync is retired: no release, ownership or QA check needs a human-approved policy bundle any more. The bundle is still fingerprinted; `right-release ownership trust-compare` reports drift as a warning with a semantic diff.";
308
308
 
309
- export const POLICY_BUNDLE_DRIFT_WARNING = "ownership policy bundle (scanner source, catalog, registry or dependency allowlist) differs from the bundle pinned in protected trust (warning only; trust-sync is retired)";
309
+ export const TRUST_REFRESH_RETIRED = "right-release ownership trust-refresh is retired, like trust-sync: nothing needs an administrator or a refreshed host trust file. A repository registration or a dependency allowlist entry the host's protected copy lacks is read from the lists this gate ships (ownership-repositories.json, ownership-dependency-allowlist.json); add it there and release RightKit.";
310
+ export const POLICY_BUNDLE_DRIFT_WARNING ="ownership policy bundle (scanner source, catalog, registry or dependency allowlist) differs from the bundle pinned in protected trust (warning only; trust-sync is retired)";
310
311
  export const CATALOG_DIGEST_DRIFT_WARNING = "ownership catalog digest differs from the digest pinned in protected trust (warning only; the catalog version still meets the protected minimum; trust-sync is retired)";
311
312
  export function validateOwnershipFloor(trust, { scannerVersion, catalogVersion, catalogDigest, policyBundleDigest } = {}) {
312
313
  const problems = [];
@@ -20,7 +20,7 @@ import { spawnSync } from "./background-process.mjs";
20
20
  import { main as stagedMain } from "./ownership-staged.mjs";
21
21
  import { loadTrustedExternal } from "./ownership-approval.mjs";
22
22
  import { diffPolicyBundles, runningPolicyBundle, trustComparison } from "./ownership-policy-bundle.mjs";
23
- import { POLICY_BUNDLE_DRIFT_WARNING, TRUST_SYNC_RETIRED } from "./ownership-approval.mjs";
23
+ import { POLICY_BUNDLE_DRIFT_WARNING, TRUST_REFRESH_RETIRED, TRUST_SYNC_RETIRED } from "./ownership-approval.mjs";
24
24
  import { isBlockingFinding } from "./ownership-verdict.mjs";
25
25
 
26
26
  const packageRoot = path.dirname(fileURLToPath(import.meta.url));
@@ -76,7 +76,10 @@ export async function main(args, { evidenceFactory = createOwnershipEvidence, gi
76
76
  if (args[0] === "trust-compare") return trustCompare(args, { print, trustLoader });
77
77
  if (args.includes("--staged")) return stagedMain(args, { print });
78
78
  if (args[0] === "trust-sync") { print(`[right-release] ${TRUST_SYNC_RETIRED}`); return 0; }
79
- if (["enroll", "approve-key", "revoke-key", "trust-refresh"].includes(args[0])) {
79
+ // Retired with trust-sync: no check needs the host's protected copy refreshed. A repository or an allowlist entry the host copy
80
+ // lacks is taken from the lists this gate ships. It exits 2 so nobody is sent to an administrator step again (2026-11-26).
81
+ if (args[0] === "trust-refresh") { print(`[right-release] ${TRUST_REFRESH_RETIRED}`); return 2; }
82
+ if (["enroll", "approve-key", "revoke-key"].includes(args[0])) {
80
83
  const { main: keyMain } = await import("./ownership-key-command.mjs");
81
84
  return keyMain(args, { runner: gitRunner, print });
82
85
  }
@@ -5,7 +5,7 @@ import os from "node:os";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { spawnSync, spawnSyncInteractive, windowsPowerShellEnvironment } from "./background-process.mjs";
7
7
  import { createKeyEvent, keyFingerprint, verifyKeyLog, verifyKeyRequest } from "./ownership-key-log.mjs";
8
- import { canonicalRepositoryIdentity, DEFAULT_TRUST_PATH, TRUST_SYNC_RETIRED, loadTrustedExternal, resolveKeyLogTrust, __testOnly as approvalTestOnly } from "./ownership-approval.mjs";
8
+ import { canonicalRepositoryIdentity, DEFAULT_TRUST_PATH, TRUST_REFRESH_RETIRED, TRUST_SYNC_RETIRED, loadTrustedExternal, resolveKeyLogTrust, __testOnly as approvalTestOnly } from "./ownership-approval.mjs";
9
9
  import { readCommittedKeyAuthority } from "./ownership-key-authority.mjs";
10
10
  import { buildMacInvocation, hasTerminal } from "./ownership-key-elevation.mjs";
11
11
  import { mergeRepositoriesFromInstalledRelease, prepareTrustUpdate, REPOSITORY_REGISTRY_MALFORMED_CODE } from "./ownership-key-trust.mjs";
@@ -355,6 +355,7 @@ export async function main(args, deps = {}) {
355
355
  const app = path.resolve(flag(args, "--app") ?? process.cwd());
356
356
  const root = deps.root ?? repoRoot(app, run);
357
357
  if (args[0] === "trust-sync") { print(`[right-release] ${TRUST_SYNC_RETIRED}`); return 0; }
358
+ if (args[0] === "trust-refresh") { print(`[right-release] ${TRUST_REFRESH_RETIRED}`); return 2; }
358
359
  try {
359
360
  if (!platform) throw new Error(`ownership key management unsupported platform: ${process.platform}`);
360
361
  const refresh = args[0] === "trust-refresh";
package/ownership.mjs CHANGED
@@ -695,12 +695,26 @@ function shippedAllowlist() {
695
695
  * Which allowlist applies and how hard. The protected trust copy governs every repository
696
696
  * registered in trust and blocks. When no trust copy applies, or while approval enrollment is pending, the shipped proposal
697
697
  * is advisory and only for repositories it has a baseline for.
698
+ *
699
+ * The host's protected copy cannot be refreshed (trust-sync is retired), so an entry RightKit admitted after that copy was written
700
+ * was refused on that host for good (CodeRight, cargo:image and cargo:mdns-sd, admitted in rightkit#1752, refused on the Mac). The
701
+ * list a registered repository is judged against is therefore the union of the host copy and the list this gate ships: every
702
+ * entry either one admits is admitted. Nothing the host copy admits is lost, and the tier rules are unchanged.
698
703
  */
704
+ export function mergedAllowlist(host, shipped) {
705
+ if (!shipped) return host;
706
+ const union = (a = [], b = []) => [...new Set([...a, ...b])];
707
+ const byIdentity = new Map();
708
+ for (const entry of [...(host.repositories ?? []), ...(shipped.repositories ?? [])]) {
709
+ byIdentity.set(entry.repositoryIdentity, union(byIdentity.get(entry.repositoryIdentity), entry.dependencies));
710
+ }
711
+ return { schema: 1, global: union(host.global, shipped.global), repositories: [...byIdentity].map(([repositoryIdentity, dependencies]) => ({ repositoryIdentity, dependencies })) };
712
+ }
699
713
  export function dependencyAllowlistPolicy(trust, repositoryIdentity, { pending = false, shipped } = {}) {
700
714
  if (!repositoryIdentity) return null;
701
715
  const trusted = trust?.dependencyAllowlist && validateAllowlist(trust.dependencyAllowlist).ok ? trust.dependencyAllowlist : null;
702
- if (trusted && trust.repositories?.some((entry) => entry.repositoryIdentity === repositoryIdentity)) return { allowlist: trusted, tier: pending ? "advise" : "block", source: "protected-trust" };
703
716
  const proposal = shipped === undefined ? shippedAllowlist() : shipped;
717
+ if (trusted && trust.repositories?.some((entry) => entry.repositoryIdentity === repositoryIdentity)) return { allowlist: mergedAllowlist(trusted, proposal), tier: pending ? "advise" : "block", source: proposal ? "protected-trust+shipped" : "protected-trust" };
704
718
  if (proposal?.repositories?.some((entry) => entry.repositoryIdentity === repositoryIdentity)) return { allowlist: proposal, tier: "advise", source: "shipped-proposal" };
705
719
  return null;
706
720
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.6.87",
3
+ "version": "0.6.89",
4
4
  "description": "Portable release CLI/SDK with fail-closed public GitHub Releases and private R2 + RightApps distribution.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",
@@ -178,6 +178,9 @@ export async function publishLocalCargo(argv, { run = spawnSync, log = console.l
178
178
  const problems = compileReportProblems(report, { name, version, commit, tree });
179
179
  if (problems.length) fail(`the compile report does not prove cargo:${name} ${version} at ${commit}: ${problems.join("; ")}`);
180
180
  log(`publish-local: compile report ok for cargo:${name} ${version} at ${commit.slice(0, 12)} (executor ${report.executor ?? (report.schema === UNIT_LIST_COMPILE_SCHEMA ? `broker seam, unit-list run ${report.runId}` : report.schema === UNIT_RESULT_SCHEMA ? "broker seam, together compile" : "unknown")})`);
181
+ // What the unit's tests did, when the report carries it: a skipped asset-gated test (a SKIP marker line) is said, never counted as run.
182
+ const unitTests = report?.stages?.compile?.tests;
183
+ if (unitTests && Number.isInteger(unitTests.executed)) log(`publish-local: tests of cargo:${name}: ${unitTests.executed} passed, ${unitTests.skipped ?? 0} skipped${(unitTests.skipped ?? 0) > 0 ? " (a skipped test returned early and did not exercise what it needs)" : ""}, ${unitTests.ignored ?? 0} ignored`);
181
184
  // The broker's cargo, run directly: package and publish --no-verify compile nothing (GC-A11).
182
185
  const pathKey = platform === "win32" ? (Object.keys(env).find((k) => k.toUpperCase() === "PATH") ?? "Path") : "PATH";
183
186
  const direct = directCargoPath({ env: { ...env, PATH: env[pathKey] }, platform, gateWrappers: true });
package/qa-contract.mjs CHANGED
@@ -78,7 +78,9 @@ const NPM_QA = "@rightkit/qa";
78
78
  const NPM_QA_CHROME = "@rightkit/qa-chrome";
79
79
  const CARGO_QA = "rightkit-qa";
80
80
  const NPM_SECTIONS = ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"];
81
- const SKIP_DIRS = /^(node_modules(\..*)?|target|vendor|dist|build|\.git|\.cache|\.right-release)$/;
81
+ // `.build` is SwiftPM's build folder: its `checkouts/` hold the package.json files of fetched dependencies (a RightKit checkout among them), which are
82
+ // not the app's manifests. CodeRight's doctor read one there and refused the app's QA adoption (2026-11-26).
83
+ const SKIP_DIRS = /^(node_modules(\..*)?|target|vendor|dist|build|\.build|\.git|\.cache|\.right-release)$/;
82
84
  const MAX_DEPTH = 6;
83
85
  const EXEMPTION_KINDS = ["library", "tooling"];
84
86
 
@@ -42,3 +42,18 @@ export function releasePinFloorProblem({ packageJsonText, installedVersion = nul
42
42
  if (installedVersion !== null && compareVersions(installedVersion, floor) === -1) return { code: RELEASE_PIN_BELOW_FLOOR, message: `${RELEASE_PIN_BELOW_FLOOR}: the installed ${PACKAGE} is ${installedVersion} (${where} asks ${specs.join(", ")}), below the host gate's floor ${floor} for compile stages: its own right-release child would carry non-compiling cargo calls to the broker, which refuses them (GC-A11); ${fix}` };
43
43
  return null;
44
44
  }
45
+
46
+ /**
47
+ * One informational line, or null: the app pins an exact @rightkit/release older than the host gate that is running. Inside a gate stage
48
+ * the host gate's own copy runs whatever the app pins (build-launch.mjs runs this package's own right-release for `pnpm exec right-release`),
49
+ * so this is never a refusal. A command typed by hand in the app runs the pinned copy, which can judge a config by older rules
50
+ * (Pulse, 2026-11-26: its 0.6.82 copy refused a switch class the host gate 0.6.88 accepts). A range pin or no pin says nothing.
51
+ */
52
+ export function releasePinBehindHostNote({ packageJsonText, hostVersion, where = "package.json" }) {
53
+ let manifest;
54
+ try { manifest = JSON.parse(packageJsonText); } catch { return null; }
55
+ const pins = DEPENDENCY_TABLES.map((t) => manifest?.[t]?.[PACKAGE]).filter((v) => typeof v === "string").map(exactPinOf).filter((pin) => pin !== null);
56
+ const older = pins.filter((pin) => compareVersions(pin, hostVersion) === -1).sort((a, b) => compareVersions(a, b));
57
+ if (!older.length) return null;
58
+ return `${where} pins ${PACKAGE}@${older[0]}; the host gate is ${hostVersion}. The gate's stages run the host gate's copy; a command typed by hand in the app runs the pinned ${older[0]}, whose rules can differ`;
59
+ }
@@ -194,6 +194,7 @@ export async function runQa({ stage, platform, releaseIdArg, configPath, deps =
194
194
  });
195
195
  }
196
196
  let run, journeysRun = null;
197
+ let evidenceFile = null, evidence = null, evidenceSha256 = null;
197
198
  try {
198
199
  const expand = (value) => String(value).replaceAll("{sealedDir}", sealed?.sealedDir ?? "").replaceAll("{releaseId}", releaseId)
199
200
  .replaceAll("{installedApp}", installedQa?.installedApp ?? "").replaceAll("{installedDir}", installedQa?.installedDir ?? "").replaceAll("{qaRoot}", installedQa?.qaRoot ?? "");
@@ -219,6 +220,14 @@ export async function runQa({ stage, platform, releaseIdArg, configPath, deps =
219
220
  cwd: runCwd, encoding: "utf8", windowsHide: true, maxBuffer: 64 * 1024 * 1024,
220
221
  env: runEnv,
221
222
  });
223
+ // Read the run's evidence now: the journeys run that follows can remove this run's folder (HeardRight 0.1.237, 2026-11-26: the
224
+ // floor read `smoke.launch: missing` after `[qa] PASS app.launch`, because the evidence file was gone by the time it was read).
225
+ evidenceFile = evidencePathFromOutput(run.stdout);
226
+ if (evidenceFile && existsSync(evidenceFile)) {
227
+ const bytes = readFileSync(evidenceFile);
228
+ evidenceSha256 = createHash("sha256").update(bytes).digest("hex");
229
+ evidence = JSON.parse(bytes.toString("utf8"));
230
+ }
222
231
  // Journeys lane: the one release proof (ADR-0001 item 10). A receipt named in the config is read as is.
223
232
  if (journeysConfig && !journeysConfig.receipt) {
224
233
  journeysRun = (deps.spawnJourneys ?? deps.spawnRunner ?? spawnSync)(runnerFile, ["journeys", "run", "--root", runCwd, ...((journeysConfig.args?.[stage] ?? []).map(expand))], {
@@ -229,13 +238,6 @@ export async function runQa({ stage, platform, releaseIdArg, configPath, deps =
229
238
  installedQa?.cleanup();
230
239
  }
231
240
  if (!deps.quiet) { process.stdout.write(String(run.stdout ?? "")); process.stderr.write(String(run.stderr ?? "")); }
232
- const evidenceFile = evidencePathFromOutput(run.stdout);
233
- let evidence = null, evidenceSha256 = null;
234
- if (evidenceFile && existsSync(evidenceFile)) {
235
- const bytes = readFileSync(evidenceFile);
236
- evidenceSha256 = createHash("sha256").update(bytes).digest("hex");
237
- evidence = JSON.parse(bytes.toString("utf8"));
238
- }
239
241
  // The runner binary that produced the evidence is the one that was digested; a swap during the run is refused.
240
242
  if (sha256File(runnerFile) !== runnerSha) throw new Error("the rightkit-qa runner changed while QA was running; refusing to seal");
241
243
  let journeys = null;
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "journeys": {
9
9
  "floorId": "journey",
10
- "receiptSchema": "rightkit.journeys.receipt/1",
10
+ "receiptSchema": "rightkit.journeys.receipt/2",
11
11
  "rule": "all-release-critical-passed"
12
12
  }
13
13
  }
@@ -25,7 +25,10 @@ import { spawnSync } from "./background-process.mjs";
25
25
  import { approvedRunnerDigests } from "./release-qa-policy.mjs";
26
26
  import { QaAdmissionError, qaCommandFor } from "./release-qa-receipt.mjs";
27
27
 
28
- export const JOURNEYS_RECEIPT_SCHEMA = "rightkit.journeys.receipt/1";
28
+ // The runner writes rightkit.journeys.receipt/2 since rightkit-qa 0.10; /1 is still read from an older runner. Every field this file
29
+ // reads has the same name and meaning in both; the runner's own `journeys validate-receipt` re-checks the rest for its schema.
30
+ export const JOURNEYS_RECEIPT_SCHEMA = "rightkit.journeys.receipt/2";
31
+ export const JOURNEYS_RECEIPT_SCHEMAS = Object.freeze(new Set(["rightkit.journeys.receipt/1", JOURNEYS_RECEIPT_SCHEMA]));
29
32
  export const PLATFORM_OS = Object.freeze({ mac: "macos", win: "windows" });
30
33
  export const QA_RUN_ENV = "RIGHT_RELEASE_QA_STAGE";
31
34
  const CLOCK_SKEW_MS = 60_000;
@@ -43,6 +46,31 @@ export function criticalJourneyIds(manifestText, platform) {
43
46
  .map((journey) => String(journey.id)).sort();
44
47
  }
45
48
 
49
+ /**
50
+ * Why the release-critical journeys of `platform` cannot pass one installed-QA run, from the manifest alone; empty when they can.
51
+ * The runner builds once per run (rightkit-qa journeys/run.rs plan_build): the selection is scenario journeys only, or adapter journeys
52
+ * that all name one adapter; and the installed stage needs every release-critical journey of the platform in the one receipt and
53
+ * refuses zero. Asked at the check stage so a manifest that cannot pass is refused before anything compiles.
54
+ */
55
+ export function criticalJourneySelectionProblems(manifestText, platform) {
56
+ const os = PLATFORM_OS[platform];
57
+ if (!os) throw new Error(`unknown platform ${platform}`);
58
+ const journeys = parseToml(manifestText).journey;
59
+ const critical = (Array.isArray(journeys) ? journeys : []).filter((journey) => journey?.release_critical === true && Array.isArray(journey.platforms) && journey.platforms.includes(os));
60
+ if (!critical.length) return [`the journeys manifest declares no release-critical journey for ${os}; zero is never a pass`];
61
+ const problems = [];
62
+ const adapterJourneys = critical.filter((journey) => journey.runner === "adapter");
63
+ const scenarioJourneys = critical.filter((journey) => journey.runner !== "adapter");
64
+ if (adapterJourneys.length && scenarioJourneys.length) {
65
+ problems.push(`the release-critical journeys for ${os} mix adapter journeys (${adapterJourneys.map((j) => j.id).join(", ")}) and scenario journeys (${scenarioJourneys.map((j) => j.id).join(", ")}); one run builds once, so they cannot share the installed-QA run`);
66
+ }
67
+ const adapters = [...new Set(adapterJourneys.map((journey) => String(journey.adapter ?? "")))].sort();
68
+ if (adapters.length > 1) {
69
+ problems.push(`the release-critical journeys for ${os} name ${adapters.length} adapters (${adapters.join(", ")}); one run builds for exactly one adapter, and every release-critical journey must be in the one receipt: put them behind one adapter, or leave one journey release-critical`);
70
+ }
71
+ return problems;
72
+ }
73
+
46
74
  /**
47
75
  * Validate a journeys receipt through the runner and against the manifest. Never throws for a refusal.
48
76
  * Returns { ok, problems, block }; `block` is the `journeys` section for the QA receipt (null when nothing readable).
@@ -55,7 +83,7 @@ export function validateJourneysReceipt({ runnerFile, runnerSha256, receiptFile,
55
83
  try { manifestBytes = readFileSync(manifestFile); }
56
84
  catch (error) { return { ok: false, problems: [`journeys manifest is unreadable (${manifestFile}): ${error.message}`], block: null }; }
57
85
  const os = PLATFORM_OS[platform];
58
- if (receipt.schema !== JOURNEYS_RECEIPT_SCHEMA) problems.push(`journeys receipt schema is ${JSON.stringify(receipt.schema)}, expected ${JOURNEYS_RECEIPT_SCHEMA}`);
86
+ if (!JOURNEYS_RECEIPT_SCHEMAS.has(receipt.schema)) problems.push(`journeys receipt schema is ${JSON.stringify(receipt.schema)}, expected one of ${[...JOURNEYS_RECEIPT_SCHEMAS].join(", ")}`);
59
87
  if (receipt.runner !== "rightkit-qa") problems.push("journeys receipt was not produced by the rightkit-qa runner");
60
88
  if (receipt.host?.os !== os) problems.push(`journeys receipt ran on ${receipt.host?.os}, this release is ${os}`);
61
89
  if (receipt.selection?.platform !== os) problems.push(`journeys receipt selected platform ${receipt.selection?.platform}, this release is ${os}`);
@@ -82,7 +110,7 @@ export function validateJourneysReceipt({ runnerFile, runnerSha256, receiptFile,
82
110
  else if (journey.release_critical !== true) problems.push(`release-critical journey ${id} is not marked release_critical in the receipt`);
83
111
  }
84
112
  const block = {
85
- schema: JOURNEYS_RECEIPT_SCHEMA, receiptSha256: sha256Of(bytes), runId: String(receipt.run_id ?? ""), verdict: String(receipt.verdict ?? ""),
113
+ schema: JOURNEYS_RECEIPT_SCHEMAS.has(receipt.schema) ? receipt.schema : JOURNEYS_RECEIPT_SCHEMA, receiptSha256: sha256Of(bytes), runId: String(receipt.run_id ?? ""), verdict: String(receipt.verdict ?? ""),
86
114
  hostOs: String(receipt.host?.os ?? ""), selectionPlatform: String(receipt.selection?.platform ?? ""), tree: String(receipt.source?.tree ?? ""),
87
115
  startedAt: String(receipt.started_at ?? ""), endedAt: String(receipt.ended_at ?? ""), runnerVersion: String(receipt.runner_version ?? ""),
88
116
  validator: { runnerSha256, exitCode: run?.status ?? null, accepted },
@@ -137,7 +165,7 @@ export function hardenQaReceipt({
137
165
  const journeys = receipt.journeys;
138
166
  if (!journeys) refuse("receipt carries no journeys receipt block; run `rightkit-qa journeys run` through `right-release qa` (qa.journeys in the release config)");
139
167
  const os = PLATFORM_OS[platform];
140
- if (journeys.schema !== mapping.receiptSchema) refuse(`journeys receipt schema is ${journeys.schema}`);
168
+ if (!JOURNEYS_RECEIPT_SCHEMAS.has(journeys.schema)) refuse(`journeys receipt schema is ${journeys.schema}`);
141
169
  if (journeys.verdict !== "passed" || journeys.validator?.accepted !== true || journeys.validator?.exitCode !== 0) refuse("the journeys receipt was not accepted by rightkit-qa journeys validate-receipt");
142
170
  if (journeys.validator?.runnerSha256 !== receipt.runner?.sha256) refuse("the journeys receipt was validated by a different runner than the one pinned");
143
171
  if (journeys.hostOs !== os || journeys.selectionPlatform !== os) refuse(`journeys receipt is for ${journeys.hostOs}/${journeys.selectionPlatform}, this is ${os}`);
@@ -76,7 +76,7 @@ export function validateQaFloor(floor) {
76
76
  if (!journeys || typeof journeys !== "object" || Array.isArray(journeys)) problems.push("floor journeys must be an object");
77
77
  else {
78
78
  if (typeof journeys.floorId !== "string" || !QA_STAGES.every((stage) => floor.stages?.[stage]?.required?.includes?.(journeys.floorId))) problems.push("floor journeys.floorId must be a required id of every stage");
79
- if (journeys.receiptSchema !== "rightkit.journeys.receipt/1") problems.push("floor journeys.receiptSchema must be rightkit.journeys.receipt/1");
79
+ if (!["rightkit.journeys.receipt/1", "rightkit.journeys.receipt/2"].includes(journeys.receiptSchema)) problems.push("floor journeys.receiptSchema must be rightkit.journeys.receipt/1 or /2");
80
80
  if (journeys.rule !== "all-release-critical-passed") problems.push("floor journeys.rule must be all-release-critical-passed");
81
81
  }
82
82
  }
@@ -439,7 +439,32 @@ const DYNAMIC_READS = [
439
439
  // Builtins every JS runtime sets; they select nothing and are not part of the inventory.
440
440
  const JS_BUILTINS = new Set(["MODE", "DEV", "PROD", "BASE_URL", "SSR", "NODE_ENV"]);
441
441
 
442
+ // In a git checkout the walk reads what git knows: tracked files, and untracked files the checkout's ignore rules do not ignore (a new source
443
+ // file not yet committed is still judged). It does not descend into nested repositories, so the agent worktrees under `.claude/worktrees`
444
+ // (each a whole copy of the repository) and ignored backup folders are not read. A gate stage's snapshot has no git directory and is walked
445
+ // on disk as before; it holds only the commit's files. Before this, a doctor run in a primary checkout reported 228 findings where the
446
+ // snapshot had 2 (Pulse 0d781b61, 2026-11-26). Returns paths relative to `root` with `/`, or null when `root` is not in a git work tree.
447
+ function gitListedFiles(root) {
448
+ let r;
449
+ try { r = spawnSync("git", ["-C", root, "ls-files", "-z", "--cached", "--others", "--exclude-standard"], { encoding: "utf8", maxBuffer: 1 << 28, windowsHide: true }); } catch { return null; }
450
+ if (!r || r.error || r.status !== 0) return null;
451
+ return String(r.stdout ?? "").split("\0").filter(Boolean);
452
+ }
453
+ function* listedSource(root, skipAbs, listed, wanted) {
454
+ const skipped = [...skipAbs];
455
+ for (const rel of listed) {
456
+ const parts = rel.split("/");
457
+ const name = parts.pop();
458
+ if (parts.some(skipDir)) continue;
459
+ const full = path.join(root, ...parts, name);
460
+ if (skipped.some((dir) => full === dir || full.startsWith(dir + path.sep))) continue;
461
+ if (!wanted(name)) continue;
462
+ try { if (lstatSync(full).isFile()) yield full; } catch { /* listed by git and gone from disk: nothing to read */ }
463
+ }
464
+ }
442
465
  function* walkSource(root, skipAbs = new Set()) {
466
+ const listed = gitListedFiles(root);
467
+ if (listed) { yield* listedSource(root, skipAbs, listed, (name) => SOURCE_EXT.has(path.extname(name)) && !TEST_FILE.test(name)); return; }
443
468
  const stack = [root];
444
469
  while (stack.length) {
445
470
  const dir = stack.pop();
@@ -471,6 +496,8 @@ export function envHelperPatterns(envHelpers, problems = []) {
471
496
 
472
497
  // Xcode and SwiftPM project files, for the Swift Release-configuration check.
473
498
  function* walkProjectFiles(root, skipAbs = new Set()) {
499
+ const listed = gitListedFiles(root);
500
+ if (listed) { yield* listedSource(root, skipAbs, listed, (name) => name === "project.pbxproj" || name === "Package.swift" || /\.xcconfig$/.test(name)); return; }
474
501
  const stack = [root];
475
502
  while (stack.length) {
476
503
  const dir = stack.pop();
package/release.mjs CHANGED
@@ -67,6 +67,7 @@ import { runIosPackageRecipe } from "./ios-package-recipe.mjs";
67
67
  import { releaseSwitchInputs } from "./ios-build-context.mjs";
68
68
  import { productionBuildEnv, productionModeProblems } from "./production-mode.mjs";
69
69
  import { evaluatePrebuildGates } from "./prebuild-gates.mjs";
70
+ import { UNBOUND_ADVICE_CHECKS, UNBOUND_ADVICE_GATES, unboundRepository } from "./unbound-repository.mjs";
70
71
  import { defaultReleaseConfigFile, importReleaseConfig, releaseConfigFieldProblems } from "./release-config.mjs";
71
72
  import { describeRegistryError, formatNotRun, runAdmission } from "./admission.mjs";
72
73
  import { sccacheRefusal } from "./admission-host.mjs";
@@ -166,7 +167,15 @@ const failedChecks = new Set();
166
167
  // their id before the text. The doctor does, as it does for every admission row: `right-release: <row>: <text>`, the text the
167
168
  // build's controller prints after `right-release build: <row>: `.
168
169
  const DOCTOR_OWNED_ROWS = new Set(["rightkit-registry", "build-inputs", "dirty-inputs"]);
170
+ // The list entry when this release is for a repository RightKit does not bind (unbound-repository.mjs), else null. Read once, on first use.
171
+ let unboundMemo;
172
+ function unbound() {
173
+ if (unboundMemo === undefined) unboundMemo = unboundRepository({ root, source: workerSource });
174
+ return unboundMemo;
175
+ }
176
+ const adviceLine = (name, detail) => `right-release: ADVICE ${name} (this repository is not bound by RightKit's app contract; nothing is refused): ${detail}`;
169
177
  function reject(name, detail) {
178
+ if (UNBOUND_ADVICE_CHECKS.has(name) && unbound()) { console.error(adviceLine(name, detail)); return; }
170
179
  failedChecks.add(name);
171
180
  problems.push({ name, detail: opts.doctor && DOCTOR_OWNED_ROWS.has(name) ? `${name}: ${detail}` : detail });
172
181
  }
@@ -445,6 +454,13 @@ if (!rejectBlocked("target-checks", ["target"], "the target checks (signed, medi
445
454
  if (opts.platform === "mac") {
446
455
  if (target.signingContract !== MACOS_PORTABLE_SIGNING_CONTRACT) reject("mac-signing-contract", `${app} mac must declare signingContract: ${MACOS_PORTABLE_SIGNING_CONTRACT}`);
447
456
  if (!target.prePackage?.cmd) reject("mac-prepackage", `${app} mac must declare prePackage to materialize Developer ID signing files`);
457
+ // A string sign.entitlements is the development-signing form (development-signing.mjs reads it for the dev install). Release signing never
458
+ // reads it. With no sign.prePackageFiles entry carrying entitlements the app would be signed hardened with none and nothing would say so
459
+ // (CodeRight until 5603d8560). That combination is refused here, before anything builds; the string beside an entry that does carry
460
+ // entitlements is the dev route's setting and stays allowed.
461
+ if (typeof target.sign?.entitlements === "string" && !(target.sign.prePackageFiles ?? []).some((entry) => entry && typeof entry === "object" && typeof entry.entitlements === "string" && entry.entitlements.trim())) {
462
+ reject("mac-sign-entitlements-string", `${app} mac sign.entitlements is a string, which only development signing reads: release signing would sign the app with no entitlements. Set them on the bundle's sign.prePackageFiles entry ({ file, entitlements })`);
463
+ }
448
464
  if (!target.sign?.prePackageFiles?.length) reject("mac-sign-prepackage-files", `${app} mac must declare at least one sign.prePackageFiles`);
449
465
  else if (!rejectBlocked("mac-signing", ["media-sidecar", "external-bin"], `${app} mac signing config validation (it reads the sidecar and externalBin configs)`)) {
450
466
  await check("mac-signing", [], () => {
@@ -620,6 +636,11 @@ if (opts.doctor) {
620
636
  ? [{ name: "prebuild-gates", detail: `BLOCKED by ${blocker}` }]
621
637
  : evaluatePrebuildGates({ root, config, target, platform: opts.platform, iosSpec, nativeIos, nativeAssembly, nativeFinalizer, strict: !opts.dryRun }).findings;
622
638
  }
639
+ // The same rule as the build: the release-switch inventory gates are advice for an unbound repository.
640
+ if (unbound()) {
641
+ for (const finding of gateFindings.filter((entry) => UNBOUND_ADVICE_GATES.has(entry.name))) console.error(adviceLine(`gate ${finding.name}`, finding.detail));
642
+ gateFindings = gateFindings.filter((entry) => !UNBOUND_ADVICE_GATES.has(entry.name));
643
+ }
623
644
  const configProblems = problems.length;
624
645
  // The config findings (stderr, as every early refusal always was) and the gate rows (stdout) of this one run.
625
646
  printProblems();
@@ -643,9 +664,13 @@ let prePackScanned = false; // set once a pre-pack payload scan has seen a nativ
643
664
  // prebuild-gates.mjs so `doctor --gates` runs the exact same code in the same order. They read the expanded target (and the
644
665
  // iOS spec), so a failed one of those blocks them.
645
666
  const prebuildBlocker = ["target", ...(opts.platform === "ios" ? ["ios-target"] : [])].find((name) => failedChecks.has(name));
646
- const { findings: prebuildFindings, devtoolsAllowance, inventoryText: releaseSwitchInventoryText, presenceAccepted: releasePresenceAccepted } = prebuildBlocker
667
+ const { findings: allPrebuildFindings, devtoolsAllowance, inventoryText: releaseSwitchInventoryText, presenceAccepted: releasePresenceAccepted } = prebuildBlocker
647
668
  ? { findings: [{ name: "prebuild-gates", detail: `BLOCKED by ${prebuildBlocker}` }], devtoolsAllowance: { mode: "denied" }, inventoryText: null }
648
669
  : evaluatePrebuildGates({ root, config, target, platform: opts.platform, iosSpec, nativeIos, nativeAssembly, nativeFinalizer, strict: !opts.dryRun });
670
+ // The release-switch inventory gates are advice for an unbound repository; every other prebuild gate still refuses.
671
+ const prebuildAdvice = unbound() ? allPrebuildFindings.filter((finding) => UNBOUND_ADVICE_GATES.has(finding.name)) : [];
672
+ const prebuildFindings = allPrebuildFindings.filter((finding) => !prebuildAdvice.includes(finding));
673
+ for (const finding of prebuildAdvice) console.error(adviceLine(`gate ${finding.name}`, finding.detail));
649
674
  if (problems.length || prebuildFindings.length) {
650
675
  printProblems();
651
676
  for (const finding of prebuildFindings) console.error(`right-release: ${finding.detail.startsWith("BLOCKED by ") ? `gate ${finding.name}: ` : ""}${finding.detail}`);
@@ -869,6 +894,13 @@ if (opts.platform === "win" && target.signingContract === WINDOWS_NSIS_SIGNING_C
869
894
  if (updaterFiles.length) await run("node", [SIGN_UPDATER, ...(opts.dryRun ? ["--dry-run"] : []), ...updaterFiles.flatMap((file) => ["--file", file])], root);
870
895
  }
871
896
 
897
+ // The portable contract signs every executable before packaging (sign.prePackageFiles) and has no installer-signing block above, so its
898
+ // declared postSign steps were never run on Windows: the line below this one excludes win, and only the NSIS and payload blocks run them.
899
+ // An app that declares post-sign checks under this contract (Pulse: verify-staged and its candidate checks) had them skipped without a word.
900
+ if (opts.platform === "win" && target.signingContract === WINDOWS_PORTABLE_SIGNING_CONTRACT && target.postSign) {
901
+ await runCommands(target.postSign, root);
902
+ }
903
+
872
904
  if (target.postSign && opts.platform !== "win" && (opts.platform !== "mac" || runMacPhase("post-sign"))) {
873
905
  await runCommands(target.postSign, root);
874
906
  }
@@ -941,7 +973,10 @@ function assertNoQaControlBinaries(label, files, { requireBinary = false, prePac
941
973
  try {
942
974
  const stats = assertNoQaControl(files, label, { requireBinary, allowContentOnlyDevtools: devtoolsAllowance.mode === "content-only" });
943
975
  // D4 binary layer, same inputs: no test-mode marker and no S1-S4 selector name in any native binary.
944
- assertNoReleaseSwitches({ binaryPaths: files, devtools: devtoolsAllowance, inventoryText: releaseSwitchInventoryText ?? undefined, appForbid: config.releaseSwitches?.forbid ?? [], requireBinary: false, presenceAccepted: releasePresenceAccepted ?? [] }, `${label} (release switches)`);
976
+ // An unbound repository's own inventory is advice (unbound-repository.mjs), so its declared names are not denied in its binaries;
977
+ // the test-mode marker and the registry's own deny names are still refused.
978
+ const unboundHere = unbound();
979
+ assertNoReleaseSwitches({ binaryPaths: files, devtools: devtoolsAllowance, inventoryText: unboundHere ? undefined : releaseSwitchInventoryText ?? undefined, appForbid: unboundHere ? [] : config.releaseSwitches?.forbid ?? [], requireBinary: false, presenceAccepted: releasePresenceAccepted ?? [] }, `${label} (release switches)`);
945
980
  if (prePack && stats.binaries > 0) prePackScanned = true;
946
981
  for (const opaque of stats.opaque) {
947
982
  console.log(`right-release: ${label}: ${opaque.kind.toUpperCase()} payload is compressed and cannot be scanned (${opaque.file}); the raw payload was scanned before packing`);
@@ -23,7 +23,7 @@
23
23
  "@rightkit/app-update": "0.4.7",
24
24
  "@rightkit/ax": "0.3.2",
25
25
  "@rightkit/blender-worker": "0.1.1",
26
- "@rightkit/ci": "0.3.2",
26
+ "@rightkit/ci": "0.3.3",
27
27
  "@rightkit/config": "0.1.1",
28
28
  "@rightkit/doc-render": "0.2.2",
29
29
  "@rightkit/document-core": "0.2.0",
@@ -49,7 +49,7 @@
49
49
  "@rightkit/qa": "0.7.0",
50
50
  "@rightkit/qa-chrome": "0.1.12",
51
51
  "@rightkit/react-shell": "0.7.9",
52
- "@rightkit/release": "0.6.87",
52
+ "@rightkit/release": "0.6.89",
53
53
  "@rightkit/send-ui": "0.1.0",
54
54
  "@rightkit/settings-ui": "0.7.7",
55
55
  "@rightkit/social-ui": "0.2.1",
@@ -97,7 +97,8 @@
97
97
  "0.2.45",
98
98
  "0.2.49",
99
99
  "0.3.0",
100
- "0.3.1"
100
+ "0.3.1",
101
+ "0.3.2"
101
102
  ],
102
103
  "@rightkit/doc-render": [
103
104
  "0.1.0",
@@ -452,7 +453,9 @@
452
453
  "0.6.83",
453
454
  "0.6.84",
454
455
  "0.6.85",
455
- "0.6.86"
456
+ "0.6.86",
457
+ "0.6.87",
458
+ "0.6.88"
456
459
  ],
457
460
  "@rightkit/settings-ui": [
458
461
  "0.1.0",
@@ -593,13 +596,13 @@
593
596
  "rightkit-approvals": "0.2.2",
594
597
  "rightkit-asr": "0.5.2",
595
598
  "rightkit-assist": "0.1.1",
596
- "rightkit-audio": "0.4.4",
599
+ "rightkit-audio": "0.4.5",
597
600
  "rightkit-autoedit": "0.2.1",
598
601
  "rightkit-automation": "0.7.6",
599
602
  "rightkit-autostart": "0.1.1",
600
603
  "rightkit-bench": "0.2.1",
601
604
  "rightkit-bot-messaging": "0.3.2",
602
- "rightkit-browser": "0.3.12",
605
+ "rightkit-browser": "0.3.14",
603
606
  "rightkit-cache": "0.2.5",
604
607
  "rightkit-captions": "0.1.1",
605
608
  "rightkit-catalog": "0.1.0",
@@ -630,7 +633,7 @@
630
633
  "rightkit-crash": "0.4.3",
631
634
  "rightkit-credentials": "0.5.10",
632
635
  "rightkit-crypto": "0.1.4",
633
- "rightkit-daemon": "0.9.3",
636
+ "rightkit-daemon": "0.9.4",
634
637
  "rightkit-daemon-remote": "0.1.0",
635
638
  "rightkit-db": "0.5.11",
636
639
  "rightkit-decimal": "0.1.0",
@@ -686,7 +689,7 @@
686
689
  "rightkit-launcher-win": "0.2.1",
687
690
  "rightkit-library": "0.3.1",
688
691
  "rightkit-license": "0.3.5",
689
- "rightkit-llm": "0.7.1",
692
+ "rightkit-llm": "0.7.2",
690
693
  "rightkit-local-gen": "0.1.4",
691
694
  "rightkit-logs": "0.4.5",
692
695
  "rightkit-mail": "0.1.2",
@@ -729,11 +732,11 @@
729
732
  "rightkit-profile": "0.1.0",
730
733
  "rightkit-prompt-recipes": "0.2.1",
731
734
  "rightkit-pty": "0.1.3",
732
- "rightkit-qa": "0.10.14",
735
+ "rightkit-qa": "0.10.15",
733
736
  "rightkit-record": "0.4.1",
734
737
  "rightkit-reframe": "0.2.1",
735
738
  "rightkit-remote-compute": "0.2.2",
736
- "rightkit-remote-gateway": "0.1.5",
739
+ "rightkit-remote-gateway": "0.1.6",
737
740
  "rightkit-repo-graph": "0.3.3",
738
741
  "rightkit-repo-graph-grammars": "0.1.1",
739
742
  "rightkit-research": "0.1.2",
@@ -756,7 +759,7 @@
756
759
  "rightkit-sysmem": "0.1.0",
757
760
  "rightkit-system-monitor": "0.3.2",
758
761
  "rightkit-tauri-shell": "0.8.10",
759
- "rightkit-terminal-ui": "0.1.8",
762
+ "rightkit-terminal-ui": "0.1.9",
760
763
  "rightkit-text-polish": "0.1.4",
761
764
  "rightkit-theme": "0.1.1",
762
765
  "rightkit-time": "0.1.5",
@@ -901,7 +904,7 @@
901
904
  "@rightkit/app-shell": "0.6.2",
902
905
  "@rightkit/app-update": "0.4.4",
903
906
  "@rightkit/ax": "0.3.2",
904
- "@rightkit/ci": "0.3.1",
907
+ "@rightkit/ci": "0.3.2",
905
908
  "@rightkit/doc-render": "0.2.1",
906
909
  "@rightkit/git": "0.2.42",
907
910
  "@rightkit/hooks": "0.1.2",
@@ -920,7 +923,7 @@
920
923
  "@rightkit/qa": "0.7.0",
921
924
  "@rightkit/qa-chrome": "0.1.12",
922
925
  "@rightkit/react-shell": "0.7.7",
923
- "@rightkit/release": "0.6.86",
926
+ "@rightkit/release": "0.6.88",
924
927
  "@rightkit/settings-ui": "0.7.4",
925
928
  "@rightkit/shell": "0.1.1",
926
929
  "@rightkit/tauri": "0.4.3",
@@ -1022,7 +1025,8 @@
1022
1025
  "0.3.9",
1023
1026
  "0.4.0",
1024
1027
  "0.4.1",
1025
- "0.4.3"
1028
+ "0.4.3",
1029
+ "0.4.4"
1026
1030
  ],
1027
1031
  "rightkit-automation": [
1028
1032
  "0.3.0",
@@ -1050,7 +1054,9 @@
1050
1054
  "0.3.4",
1051
1055
  "0.3.5",
1052
1056
  "0.3.6",
1053
- "0.3.11"
1057
+ "0.3.11",
1058
+ "0.3.12",
1059
+ "0.3.13"
1054
1060
  ],
1055
1061
  "rightkit-cache": [
1056
1062
  "0.2.0",
@@ -1147,7 +1153,8 @@
1147
1153
  "0.4.0",
1148
1154
  "0.9.0",
1149
1155
  "0.9.1",
1150
- "0.9.2"
1156
+ "0.9.2",
1157
+ "0.9.3"
1151
1158
  ],
1152
1159
  "rightkit-db": [
1153
1160
  "0.2.1",
@@ -1351,7 +1358,8 @@
1351
1358
  "0.2.1",
1352
1359
  "0.3.0",
1353
1360
  "0.3.1",
1354
- "0.7.0"
1361
+ "0.7.0",
1362
+ "0.7.1"
1355
1363
  ],
1356
1364
  "rightkit-logs": [
1357
1365
  "0.2.0",
@@ -1530,7 +1538,8 @@
1530
1538
  "0.10.10",
1531
1539
  "0.10.11",
1532
1540
  "0.10.12",
1533
- "0.10.13"
1541
+ "0.10.13",
1542
+ "0.10.14"
1534
1543
  ],
1535
1544
  "rightkit-qa-driver": [
1536
1545
  "0.3.0",
@@ -1744,7 +1753,8 @@
1744
1753
  ],
1745
1754
  "rightkit-remote-gateway": [
1746
1755
  "0.1.3",
1747
- "0.1.4"
1756
+ "0.1.4",
1757
+ "0.1.5"
1748
1758
  ],
1749
1759
  "rightkit-web-session": [
1750
1760
  "0.1.1"
@@ -1891,7 +1901,8 @@
1891
1901
  "0.1.4",
1892
1902
  "0.1.5",
1893
1903
  "0.1.6",
1894
- "0.1.7"
1904
+ "0.1.7",
1905
+ "0.1.8"
1895
1906
  ],
1896
1907
  "rightkit-timeline": [
1897
1908
  "0.1.1"
package/seam-broker.mjs CHANGED
@@ -139,6 +139,19 @@ export function socketProblem(endpoint, o = {}) {
139
139
  } catch (error) { return `cannot connect to the broker at ${endpoint} (${error?.code ?? error?.message ?? error})`; }
140
140
  }
141
141
 
142
+ /**
143
+ * The absolute client path a RustRight POSIX agent shim starts, or null when `text` is not that shim. The shim is the installer's own
144
+ * file: it carries the marker line `# rustright.build-control.agent-shims.install.v<N>` and ends in `exec '<absolute path>' "$@"`.
145
+ * A native executable read as text, a file over 4 KiB, or a script without both lines is not a shim.
146
+ */
147
+ export function posixAgentShimTarget(text) {
148
+ if (typeof text !== "string" || text.length > 4096 || !text.startsWith("#!")) return null;
149
+ const lines = text.split(/\r?\n/);
150
+ if (!lines.some((line) => /^# rustright\.build-control\.agent-shims\.install\.v\d+$/.test(line.trim()))) return null;
151
+ const exec = lines.map((line) => /^exec '(\/[^']+)' "\$@"$/.exec(line.trim())).find(Boolean);
152
+ return exec ? exec[1] : null;
153
+ }
154
+
142
155
  export function brokerControlTarget(o, { client = o?.client } = {}) {
143
156
  const platform = o?.platform ?? process.platform;
144
157
  const env = o?.env ?? process.env;
@@ -148,6 +161,15 @@ export function brokerControlTarget(o, { client = o?.client } = {}) {
148
161
  try { exe = resolveBrokerClient(client, { platform, readFile: read }).file; } catch (error) { return { ok: false, problem: `the RustRight client cannot be resolved (${error.message})` }; }
149
162
  let real = exe;
150
163
  if (platform !== "win32") { try { real = (o?.realpath ?? fs.realpathSync.native)(exe); } catch { real = exe; } }
164
+ // The installer's POSIX agent shim (a short sh script in the managed agent-bin that execs the runtime's client) is not a symlink, so
165
+ // its real path is itself and the manifest was looked for in agent-bin, where there is none: no dead holder's snapshot lock could be
166
+ // reclaimed on the Mac (2026-11-26). Follow the shim to the client it starts; the manifest sits beside that.
167
+ if (platform !== "win32") {
168
+ let shimText = null;
169
+ try { shimText = read(real); } catch { shimText = null; }
170
+ const target = posixAgentShimTarget(shimText);
171
+ if (target) real = target;
172
+ }
151
173
  const paths = platform === "win32" ? path.win32 : path.posix;
152
174
  const manifest = paths.join(paths.dirname(real), RUNTIME_MANIFEST_FILE);
153
175
  let text;
@@ -452,7 +452,14 @@ export function verifySnapshotStore({ checkout, snapshot, commit, tree, ledger,
452
452
  const message = miss && missingName
453
453
  ? `root ${root}: ${missingName} is missing from the store ${storeDir} (offline, no network fallback); install the checkout's dependencies so the store holds it, then run the check again`
454
454
  : `root ${root}: the offline store check failed (store ${storeDir}): ${diagnostic.codes.join(", ") || `exit ${Number.isInteger(r?.status) ? r.status : "unknown"}`}`;
455
- throw new CheckError(`${message}; ${diagnostic.detail}`);
455
+ // pnpm's own text is never printed (it can carry registry addresses; rightkit#1505 keeps codes and a hash only). The two metadata codes
456
+ // say little on their own, so their meaning on an OFFLINE check is spelled out (Pulse, 2026-11-26: the cause behind them was pnpm's
457
+ // minimum-release-age rule holding back a package published an hour earlier, which this command's output never named).
458
+ const metadataMiss = !(miss && missingName) && diagnostic.codes.some((code) => code === "ERR_PNPM_NO_OFFLINE_META" || code === "ERR_PNPM_META_FETCH_FAIL");
459
+ const meaning = metadataMiss
460
+ ? "; on this offline check those codes mean the store has no metadata for a version the lockfile names: either the checkout's dependencies were not installed after the lockfile changed (install them, then run the check again), or pnpm's minimum-release-age rule is holding back a version published within its window (see minimumReleaseAge and minimumReleaseAgeExclude in the root's pnpm settings)"
461
+ : "";
462
+ throw new CheckError(`${message}${meaning}; ${diagnostic.detail}`);
456
463
  }
457
464
  records.push({ root, storeDir, storeSource: source, pnpm: version, pinned: pin, lockfileSha256: crypto.createHash("sha256").update(fs.readFileSync(path.join(dir, "pnpm-lock.yaml"))).digest("hex"), ms });
458
465
  }
@@ -0,0 +1,47 @@
1
+ // A repository RightKit does not bind: a tool that may use RightKit packages but owes none of the app contract.
2
+ //
3
+ // The list is the shipped ownership-advise-only.json (each entry carries the owner's ruling, quoted, in `ratifiedBy`). For such a
4
+ // repository the app-contract rules report what they find as advice and refuse nothing:
5
+ // - ownership findings (ownership.mjs adviseOnlyFindings, since 0.6.86);
6
+ // - the RightKit Cargo dependency and profile contracts, QA adoption, and the release-switch inventory and scans (release.mjs).
7
+ // Rules that protect the release itself are NOT in this set and bind every repository: the protected signing workflow shape, secret
8
+ // scans, licence notices, signing, the hosted-workflow checks, build admission, and the test-mode feature closure.
9
+ import { readFileSync } from "node:fs";
10
+ import { spawnSync } from "./background-process.mjs";
11
+ import { canonicalRepositoryIdentity } from "./ownership-approval.mjs";
12
+ import { isSnapshotSource } from "./release-source-identity.mjs";
13
+
14
+ /** The `check()` rows of release.mjs that are app-contract rules. */
15
+ export const UNBOUND_ADVICE_CHECKS = Object.freeze(new Set(["rightkit-cargo-contract", "cargo-profile-contract", "qa-adoption"]));
16
+ /** The prebuild gates (prebuild-gates.mjs) that are the release-switch inventory rule (M21/M23 source layer). */
17
+ export const UNBOUND_ADVICE_GATES = Object.freeze(new Set(["switch-inventory", "switch-inventory-missing", "source-switch-roots", "source-switch-prepare", "release-switches"]));
18
+
19
+ let shipped;
20
+ function shippedList() {
21
+ if (shipped === undefined) {
22
+ try { const data = JSON.parse(readFileSync(new URL("./ownership-advise-only.json", import.meta.url), "utf8")); shipped = Array.isArray(data?.repositories) ? data.repositories : []; }
23
+ catch { shipped = []; }
24
+ }
25
+ return shipped;
26
+ }
27
+
28
+ /** The entry of `repositoryIdentity` in the list (it needs a quoted ruling), or null. */
29
+ export function unboundEntry(repositoryIdentity, list = shippedList()) {
30
+ if (!repositoryIdentity) return null;
31
+ return list.find((entry) => entry?.repositoryIdentity === repositoryIdentity && typeof entry.ratifiedBy === "string" && entry.ratifiedBy.trim()) ?? null;
32
+ }
33
+
34
+ /**
35
+ * The list entry of the repository a release runs for, or null. `source` is the door source split (its checkout holds the origin;
36
+ * the snapshot has no git directory); without one the origin is read from `root`. An origin that cannot be read binds the repository.
37
+ */
38
+ export function unboundRepository({ root, source = null, git = spawnSync, list } = {}) {
39
+ const from = source && isSnapshotSource(source) ? source.checkout : root;
40
+ if (!from) return null;
41
+ const origin = git("git", ["-C", from, "remote", "get-url", "origin"], { encoding: "utf8", windowsHide: true, maxBuffer: 4 * 1024 * 1024 });
42
+ if (origin?.status !== 0) return null;
43
+ let identity;
44
+ try { identity = canonicalRepositoryIdentity(String(origin.stdout ?? "").trim()); } catch { return null; }
45
+ const entry = unboundEntry(identity, list);
46
+ return entry ? { ...entry, repositoryIdentity: identity } : null;
47
+ }
package/unit-gate.mjs CHANGED
@@ -394,7 +394,7 @@ export async function runUnitGate({ selector, to, root, commonDir, commit, tree,
394
394
  const runtime = hash(runtimeFiles.map((file) => `${path.relative(runtimeDir, file)}\0${hash(fs.readFileSync(file))}`).join("\n"));
395
395
  const report = { schema: "rightkit.unit-gate-report/1", unit, commit, tree, runtime, executor: executor.kind, stages: {} };
396
396
  const save = () => { if (writeReport) writeReport(report); };
397
- let state, owner, artifact, currentStage, checkTier = null;
397
+ let state, owner, artifact, currentStage, checkTier = null, compileTests = null;
398
398
  // A broker-host run that reaches the qualify stage (--to qualify, or --to release) has its compile and package jobs attested: a pnpm job
399
399
  // is sent the stage nonce, a carried Cargo call a nonce derived from it, both bound to this commit, tree, unit and stage, so each job's
400
400
  // signed receipt can be verified hosted for exactly that and nothing else. `--to qualify` is the sanctioned no-upload route to that
@@ -466,6 +466,7 @@ export async function runUnitGate({ selector, to, root, commonDir, commit, tree,
466
466
  const before = ledgerIds();
467
467
  state = await stageEnv(stage, (runEnv) => owner.compileLocalUnit(unit.kind, argv, { env: runEnv, ...(source ? { source } : {}) }));
468
468
  collectReceipts(stage, owner.localUnitCompileRequests?.(state), before);
469
+ compileTests = owner.localUnitCompileTests?.(state) ?? null;
469
470
  } else if (stage === "package") {
470
471
  const before = ledgerIds();
471
472
  artifact = await stageEnv(stage, (runEnv) => owner.packageLocalUnit(state, { env: runEnv }));
@@ -503,7 +504,7 @@ export async function runUnitGate({ selector, to, root, commonDir, commit, tree,
503
504
  try { command = (stageCommands({ unit, root, platform })[stage] ?? []).map(describeCommand).join("; ") || command; } catch { /* the stage name alone identifies the command */ }
504
505
  directStages[stage] = directStageEvidence({ stage, commit, tree, command, ...(stage === "package" ? { outputSha256: artifact.artifactSha256 } : {}) });
505
506
  }
506
- report.stages[stage] = { ok: true, ...(stage === "package" || stage === "qualify" ? { artifactFile: artifact.artifactFile, artifactSha256: artifact.artifactSha256, ...(artifact.contentSha256 ? { contentSha256: artifact.contentSha256 } : {}) } : {}), ...(receipts[stage] ? { receipts: receipts[stage] } : {}), ...(released ?? {}) };
507
+ report.stages[stage] = { ok: true, ...(stage === "compile" && compileTests ? { tests: compileTests } : {}), ...(stage === "package" || stage === "qualify" ? { artifactFile: artifact.artifactFile, artifactSha256: artifact.artifactSha256, ...(artifact.contentSha256 ? { contentSha256: artifact.contentSha256 } : {}) } : {}), ...(receipts[stage] ? { receipts: receipts[stage] } : {}), ...(released ?? {}) };
507
508
  save();
508
509
  out(`rightkit-gate: [${stage}] ${unit.kind}:${unit.name} passed`);
509
510
  }