@rightkit/release 0.6.81 → 0.6.83

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.
Binary file
@@ -5763,6 +5763,9 @@ export async function main(argv, io = {}) {
5763
5763
  return forecast;
5764
5764
  };
5765
5765
  }
5766
+ // Each Class B result this run stores is recorded in the history as it is stored, so a run stopped part way leaves no cache entry the
5767
+ // next forecast does not know (NN05 then stops every later run; Legion and Pulse, 2026-11-25). The end-of-run record below still runs.
5768
+ if (historyByClass.B) scanOptions.onClassBStored = ({ decision, entry }) => historyByClass.B.record({ fingerprints: decision.fingerprints, retained: [entry], mismatches: [] });
5766
5769
  scanResult = await runScans(plan, scanOptions);
5767
5770
  let blocked = false;
5768
5771
  for (const cls of activeHistories) {
@@ -144,7 +144,7 @@ function acquire(root, { expectedCommit, expectedTree, commit: selectedCommit, r
144
144
  const rows = parseTree(runGit(root, ["ls-tree", "-r", "-z", "--full-tree", tree], { encoding: "buffer", maxBuffer: MAX_TREE_BYTES, timeout: COMMAND_TIMEOUT_MS, runner, env }), objectFormat);
145
145
  const wanted = new Set(requiredPaths.filter(validatePath));
146
146
  const shouldRead = (row) => row.type === "blob" && row.mode !== "120000" && (
147
- wanted.has(row.rel) || ["Cargo.toml", "package.json", "Package.swift", "Package.resolved", "ownership-exceptions.json", "pnpm-workspace.yaml", "Cargo.lock", "pnpm-lock.yaml", "package-lock.json", "npm-shrinkwrap.json", "yarn.lock"].includes(path.posix.basename(row.rel)) ||
147
+ wanted.has(row.rel) || ["Cargo.toml", "package.json", "Package.swift", "Package.resolved", "ownership-exceptions.json", "fixture-files.json", "pnpm-workspace.yaml", "Cargo.lock", "pnpm-lock.yaml", "package-lock.json", "npm-shrinkwrap.json", "yarn.lock"].includes(path.posix.basename(row.rel)) ||
148
148
  /\.(?:rs|ts|tsx|js|mjs|cjs|jsx|swift|m|mm|c|cc|cpp|h|py|go|kt|java|cs)$/i.test(row.rel)
149
149
  );
150
150
  const candidates = rows.filter(shouldRead);
@@ -4349,7 +4349,14 @@ export async function runScans(plan, options = {}) {
4349
4349
  const proven = memberProofs.length > 0 && (groupCrates < 2 || memberProofs.some((proof) => proof.context.kind !== "targets")) && (groupTargets < 2 || memberProofs.some((proof) => proof.context.kind === "targets"));
4350
4350
  if (!admitted.invocationScan.coverageKey && !admitted.invocationScan.provesPublisher && member?.retainedSourceEligible && member.featureContext && member.key && signed && proven && usableStoredPass(stored, admitted.invocationScan, { cacheKey: key, viaSeam: row.seam === true })) source = { schema: "rightkit.retained-invocation/1", key, rowDigest: cacheEntryIdentity(stored.row), memberKey: member.key, memberCrate, featureContext: member.featureContext, scan: admitted.invocationScan, equivalence: memberProofs };
4351
4351
  }
4352
- decision.retained.push({ id, key: row.status === "fail" ? failureKey : key, status: row.status, ...(source ? { source } : {}) });
4352
+ const entry = { id, key: row.status === "fail" ? failureKey : key, status: row.status, ...(source ? { source } : {}) };
4353
+ decision.retained.push(entry);
4354
+ // A result this run stored is recorded in the history at once, not only when the run completes: a run stopped after some rows passed
4355
+ // left their cache entries with no history, and every later run forecast "run", found the entry, and stopped (NN05) for good
4356
+ // (Legion and Pulse on the Dell, 2026-11-25). Best effort: the end-of-run record still runs.
4357
+ if (decision === classBCacheDecision && admitted.stored && !row.cached) {
4358
+ try { options.onClassBStored?.({ decision, entry }); } catch { /* the end-of-run record covers it */ }
4359
+ }
4353
4360
  }
4354
4361
  }
4355
4362
  const out = { ...row, timing: { ...admitted.timing, elapsedMs: performance.now() - admitted.started } };
@@ -47,6 +47,7 @@
47
47
  "cargo:http-body-util",
48
48
  "cargo:hyper-util",
49
49
  "cargo:ignore",
50
+ "cargo:image",
50
51
  "cargo:insta",
51
52
  "cargo:itertools",
52
53
  "cargo:jsonschema",
@@ -54,6 +55,7 @@
54
55
  "cargo:lancedb",
55
56
  "cargo:libc",
56
57
  "cargo:libsqlite3-sys",
58
+ "cargo:mdns-sd",
57
59
  "cargo:mockito",
58
60
  "cargo:objc2-app-kit",
59
61
  "cargo:objc2-foundation",
@@ -874,6 +876,7 @@
874
876
  "cargo:brotli",
875
877
  "cargo:clap",
876
878
  "cargo:directories-next",
879
+ "cargo:ed25519-dalek",
877
880
  "cargo:flate2",
878
881
  "cargo:futures-util",
879
882
  "cargo:headless_chrome",
@@ -894,6 +897,7 @@
894
897
  "cargo:serde",
895
898
  "cargo:serde_json",
896
899
  "cargo:serde_yaml",
900
+ "cargo:sha1",
897
901
  "cargo:sha2",
898
902
  "cargo:subtle",
899
903
  "cargo:tar",
package/ownership.mjs CHANGED
@@ -238,7 +238,7 @@ function fileInventory(appRoot, trust, pathPrefix = "", repositoryRoot = appRoot
238
238
  const inventory = gitListedInventory(appRoot, {
239
239
  repositoryRoot,
240
240
  protectedPaths: [...protectedPaths],
241
- relevant: (rel) => ["Cargo.toml", "package.json", "Package.swift", "Package.resolved", "pnpm-workspace.yaml", ...OWNERSHIP_LOCKFILES].includes(path.posix.basename(rel)) || CODE_EXT.has(path.posix.extname(rel).toLowerCase()),
241
+ relevant: (rel) => ["Cargo.toml", "package.json", "Package.swift", "Package.resolved", "pnpm-workspace.yaml", "fixture-files.json", ...OWNERSHIP_LOCKFILES].includes(path.posix.basename(rel)) || CODE_EXT.has(path.posix.extname(rel).toLowerCase()),
242
242
  maxFileBytes: (rel) => CODE_EXT.has(path.posix.extname(rel).toLowerCase()) || protectedPaths.has(rel) ? 2 * 1024 * 1024 : 64 * 1024 * 1024,
243
243
  });
244
244
  for (const item of inventory.coverage) if (item.reason === "file-over-size-limit") item.reason = protectedPaths.has(item.path) ? "protected-provenance-file-over-2MiB" : CODE_EXT.has(path.posix.extname(item.path).toLowerCase()) ? "source-file-over-2MiB" : "manifest-file-over-64MiB";
@@ -284,7 +284,7 @@ function committedFileInventory(appRoot, trust, pathPrefix, committed, scope = n
284
284
  if (entry.mode === "120000") { coverage.push({ path: rel, status: "unscanned", reason: "committed-symlink" }); continue; }
285
285
  if (entry.mode === "160000" || entry.type === "commit") { coverage.push({ path: rel, status: "unscanned", reason: "committed-gitlink" }); continue; }
286
286
  if (entry.type !== "blob") { coverage.push({ path: rel, status: "unscanned", reason: "committed-unsupported-entry" }); continue; }
287
- const relevant = protectedPaths.has(entry.rel) || ["Cargo.toml", "package.json", "Package.swift", "Package.resolved", "ownership-exceptions.json", "pnpm-workspace.yaml", ...OWNERSHIP_LOCKFILES].includes(path.posix.basename(rel)) || CODE_EXT.has(path.posix.extname(rel).toLowerCase());
287
+ const relevant = protectedPaths.has(entry.rel) || ["Cargo.toml", "package.json", "Package.swift", "Package.resolved", "ownership-exceptions.json", "pnpm-workspace.yaml", "fixture-files.json", ...OWNERSHIP_LOCKFILES].includes(path.posix.basename(rel)) || CODE_EXT.has(path.posix.extname(rel).toLowerCase());
288
288
  const bytes = relevant ? entry.bytes : undefined;
289
289
  if (relevant && !bytes) coverage.push({ path: rel, status: "unscanned", reason: "committed-blob-unavailable" });
290
290
  const isExceptionFile = path.posix.basename(rel) === "ownership-exceptions.json";
@@ -440,11 +440,31 @@ function resolveDependencyVersions(appRoot, inventory, deps, coverage, contentDi
440
440
  }
441
441
  }
442
442
 
443
+ /** Declared fixture files and their sha256 from every `.rightkit/fixture-files.json` in the inventory, keyed by app-relative path (each file's
444
+ * paths are relative to the folder holding its `.rightkit`). An unreadable declaration declares nothing. */
445
+ export function declaredFixtureDigests(inventory) {
446
+ const out = new Map();
447
+ for (const x of inventory.files ?? []) {
448
+ if (!x.bytes || !(x.rel === ".rightkit/fixture-files.json" || x.rel.endsWith("/.rightkit/fixture-files.json"))) continue;
449
+ const base = path.posix.dirname(path.posix.dirname(x.rel));
450
+ let declared;
451
+ try { declared = JSON.parse(x.bytes.toString("utf8")).files; } catch { continue; }
452
+ for (const [file, entry] of Object.entries(declared ?? {})) {
453
+ if (typeof entry?.sha256 === "string" && /^[0-9a-f]{64}$/.test(entry.sha256)) out.set(base === "." ? file : path.posix.join(base, file), entry.sha256);
454
+ }
455
+ }
456
+ return out;
457
+ }
458
+
443
459
  function dependenciesFromInventory(appRoot, inventory) {
444
460
  const deps = [], coverage = [], contentDigests = [], covered = [];
445
461
  // Workspace inheritance is loaded before member manifests.
446
462
  const manifestNames = new Set(["Cargo.toml", "package.json", "Package.swift"]);
447
- const manifests = inventory.files.filter((x) => manifestNames.has(path.posix.basename(x.rel)));
463
+ // A manifest the repository declares as a test fixture (`.rightkit/fixture-files.json`, rightkit#1291: { files: { "<path>": { sha256, note } } },
464
+ // the declaration the Class A scans honour) is a known-answer input, not one of the app's dependencies, while its bytes are still the declared
465
+ // ones. Legion's Audit fixtures (upstream cargo-geiger, node-outdated package.json files) were refused as 68 un-allowlisted dependencies.
466
+ const fixtures = declaredFixtureDigests(inventory);
467
+ const manifests = inventory.files.filter((x) => manifestNames.has(path.posix.basename(x.rel)) && !(x.bytes && fixtures.get(x.rel) === byteDigest(x.bytes)));
448
468
  const primaryFiles = manifests.filter((x) => !x.inNodeModules);
449
469
  // Follow only explicitly declared local package roots into installed layouts. Their own
450
470
  // manifests are first-party inputs; unrelated installed transitive manifests stay opaque.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.6.81",
3
+ "version": "0.6.83",
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",
@@ -105,7 +105,7 @@
105
105
  "smol-toml": "1.9.1"
106
106
  },
107
107
  "scripts": {
108
- "test": "node --test acceptance-admission.test.mjs acceptance-lines.test.mjs acceptance-cases.test.mjs rule-verdict-cache.test.mjs class-b-dispatch.test.mjs remember-reads.test.mjs sidecar-source.test.mjs caller-levers.test.mjs class-a-cache-history.test.mjs gate-fixed-levers.test.mjs broker-toolchain.test.mjs snapshot-changes.test.mjs gate-serve-changes.test.mjs gate-serve-helper.test.mjs resident-answers.test.mjs probe-memo-kept.test.mjs class-a-lanes.test.mjs feature-partition-targets.test.mjs class-b-target-groups.test.mjs unit-list-lock.test.mjs cargo-profile-check.test.mjs cargo-home-real-path.test.mjs class-a-cache-admission.test.mjs class-b-cache-admission.test.mjs shellcheck-cache-inputs.test.mjs implicit-features.test.mjs test-group-failure-cache.test.mjs sealed-listing-store.test.mjs gate/gate.test.mjs package-files.test.mjs host-gate.test.mjs publish-local-cargo.test.mjs publish-local-npm.test.mjs shell-contract-hub-window.test.mjs cargo-license-notices-paths.test.mjs rightkit-freshness-direct.test.mjs swap-helper-committed.test.mjs affected-units.test.mjs batch-workspace.test.mjs unit-list-plan.test.mjs compile-inputs.test.mjs snapshot-dependency-reuse.test.mjs publisher-requirement-scan.test.mjs node-check-cache.test.mjs preparation-diagnostics.test.mjs gate-coverage-timing.test.mjs ci-compile-admission.test.mjs qualification-verify.test.mjs test-run-output.test.mjs feature-partition.test.mjs feature-sets.test.mjs gate-seam.test.mjs serial-row.test.mjs seam-repairs.test.mjs snapshot-lock.test.mjs lock-identity.test.mjs stamp-relay.test.mjs install-tauri-authenticode.test.mjs gate-stage-binding.test.mjs tool-output.test.mjs publication-gate.test.mjs gate-release-admission.test.mjs cache-key-explain.test.mjs external-inputs.test.mjs built-bins.test.mjs probe-memo.test.mjs gate-serve-ask.test.mjs double-pass.test.mjs tool-version-memo.test.mjs workspace-manifests.test.mjs test-failure-cache.test.mjs served-metadata.test.mjs windows-pnpm-identity.test.mjs",
108
+ "test": "node --test acceptance-admission.test.mjs acceptance-lines.test.mjs acceptance-cases.test.mjs rule-verdict-cache.test.mjs class-b-dispatch.test.mjs remember-reads.test.mjs sidecar-source.test.mjs caller-levers.test.mjs class-a-cache-history.test.mjs gate-fixed-levers.test.mjs broker-toolchain.test.mjs snapshot-changes.test.mjs gate-serve-changes.test.mjs gate-serve-helper.test.mjs resident-answers.test.mjs probe-memo-kept.test.mjs class-a-lanes.test.mjs feature-partition-targets.test.mjs class-b-target-groups.test.mjs unit-list-lock.test.mjs cargo-profile-check.test.mjs cargo-home-real-path.test.mjs class-a-cache-admission.test.mjs class-b-cache-admission.test.mjs shellcheck-cache-inputs.test.mjs implicit-features.test.mjs test-group-failure-cache.test.mjs sealed-listing-store.test.mjs gate/gate.test.mjs package-files.test.mjs host-gate.test.mjs publish-local-cargo.test.mjs publish-local-npm.test.mjs shell-contract-hub-window.test.mjs cargo-license-notices-paths.test.mjs rightkit-freshness-direct.test.mjs class-b-history-per-row.test.mjs ownership-declared-fixtures.test.mjs swap-helper-committed.test.mjs affected-units.test.mjs batch-workspace.test.mjs unit-list-plan.test.mjs compile-inputs.test.mjs snapshot-dependency-reuse.test.mjs publisher-requirement-scan.test.mjs node-check-cache.test.mjs preparation-diagnostics.test.mjs gate-coverage-timing.test.mjs ci-compile-admission.test.mjs qualification-verify.test.mjs test-run-output.test.mjs feature-partition.test.mjs feature-sets.test.mjs gate-seam.test.mjs serial-row.test.mjs seam-repairs.test.mjs snapshot-lock.test.mjs lock-identity.test.mjs stamp-relay.test.mjs install-tauri-authenticode.test.mjs gate-stage-binding.test.mjs tool-output.test.mjs publication-gate.test.mjs gate-release-admission.test.mjs cache-key-explain.test.mjs external-inputs.test.mjs built-bins.test.mjs probe-memo.test.mjs gate-serve-ask.test.mjs double-pass.test.mjs tool-version-memo.test.mjs workspace-manifests.test.mjs test-failure-cache.test.mjs served-metadata.test.mjs windows-pnpm-identity.test.mjs",
109
109
  "test:registry-parity": "node registry-parity.mjs --allow-unpublished",
110
110
  "test:signer:windows": "node sign-release-manifest.integration.mjs",
111
111
  "verify:standalone": "node standalone-clone-verify.mjs"
@@ -0,0 +1,69 @@
1
+ // The committed file listing a QA journeys run reads when its root is the door's git-less snapshot.
2
+ //
3
+ // `rightkit-qa journeys run` binds its build record and the scenario files it reads to committed source. In a checkout it asks git; in
4
+ // the door's snapshot there is no git, and `.rightkit-source-identity.json` names only the commit and tree ids, which cannot prove one
5
+ // file. So the qualify stage writes, OUTSIDE the snapshot (a file inside it would be an extra the snapshot verify refuses), the exact
6
+ // list of the commit's committed files with the sha256 of their committed bytes, and hands its path to the runner as
7
+ // RIGHTKIT_QA_SOURCE_LISTING. The runner treats a file as committed only when it is listed and its bytes match; anything else fails
8
+ // closed. The listing is computed from the checkout's object database for the selected commit (never from the snapshot's files).
9
+ import { createHash } from "node:crypto";
10
+ import { mkdirSync, renameSync, writeFileSync } from "node:fs";
11
+ import path from "node:path";
12
+ import { spawnSync } from "./background-process.mjs";
13
+
14
+ export const QA_SOURCE_LISTING_ENV = "RIGHTKIT_QA_SOURCE_LISTING";
15
+ export const QA_SOURCE_LISTING_SCHEMA = "rightkit.qa-source-listing/1";
16
+
17
+ const HEX40 = /^[0-9a-f]{40}$/;
18
+
19
+ function gitBytes(git, cwd, args, input) {
20
+ const r = git("git", ["-C", cwd, ...args], { input, maxBuffer: 1024 * 1024 * 1024, windowsHide: true });
21
+ if (r.status !== 0) throw new Error(`git ${args.join(" ")} failed: ${String(r.stderr ?? "").trim().slice(0, 400)}`);
22
+ return Buffer.isBuffer(r.stdout) ? r.stdout : Buffer.from(String(r.stdout ?? ""), "utf8");
23
+ }
24
+
25
+ /**
26
+ * `{ path: sha256 }` for every regular file (mode 100644 or 100755) of `commit`'s tree, read from the object database of `checkout`.
27
+ * Symlinks and submodules are not regular committed files and are left out, so the runner never counts them as committed source.
28
+ */
29
+ export function committedFileDigests({ checkout, commit, git = spawnSync }) {
30
+ if (!HEX40.test(String(commit))) throw new Error(`a QA source listing needs a full commit id, got ${commit}`);
31
+ const listed = gitBytes(git, checkout, ["ls-tree", "-r", "-z", "--full-tree", commit]).toString("utf8").split("\0").filter(Boolean);
32
+ const entries = [];
33
+ for (const row of listed) {
34
+ const tab = row.indexOf("\t");
35
+ const [mode, type, oid] = row.slice(0, tab).split(" ");
36
+ if (type === "blob" && (mode === "100644" || mode === "100755")) entries.push({ path: row.slice(tab + 1), oid });
37
+ }
38
+ const files = {};
39
+ if (!entries.length) return files;
40
+ const out = gitBytes(git, checkout, ["cat-file", "--batch"], `${entries.map((e) => e.oid).join("\n")}\n`);
41
+ let at = 0;
42
+ for (const entry of entries) {
43
+ const nl = out.indexOf(0x0a, at);
44
+ if (nl < 0) throw new Error(`git cat-file ended before ${entry.path}`);
45
+ const [oid, type, size] = out.subarray(at, nl).toString("utf8").split(" ");
46
+ if (oid !== entry.oid || type !== "blob") throw new Error(`git cat-file answered ${oid} ${type} for ${entry.path} (${entry.oid})`);
47
+ const start = nl + 1;
48
+ const end = start + Number(size);
49
+ files[entry.path] = createHash("sha256").update(out.subarray(start, end)).digest("hex");
50
+ at = end + 1;
51
+ }
52
+ return files;
53
+ }
54
+
55
+ /**
56
+ * Writes the listing for a door source split and returns its path. `source` is release-source-identity's snapshot source
57
+ * (`commit`, `tree`, `checkout`, `snapshot`); `dir` is a directory outside the snapshot.
58
+ */
59
+ export function writeQaSourceListing({ source, dir, git = spawnSync }) {
60
+ if (!source?.snapshot || !source?.checkout) throw new Error("a QA source listing is written only for a door source split");
61
+ const files = committedFileDigests({ checkout: source.checkout, commit: source.commit, git });
62
+ const body = { schema: QA_SOURCE_LISTING_SCHEMA, commit: source.commit, tree: source.tree, root: path.resolve(source.snapshot), files };
63
+ mkdirSync(dir, { recursive: true });
64
+ const file = path.join(dir, `${source.commit}.json`);
65
+ const tmp = `${file}.${process.pid}.tmp`;
66
+ writeFileSync(tmp, `${JSON.stringify(body)}\n`);
67
+ renameSync(tmp, file);
68
+ return file;
69
+ }
@@ -34,6 +34,7 @@ import { verifySealedRelease } from "./release-state.mjs";
34
34
  import { auditMain } from "./release-qa-audit.mjs";
35
35
  import { journeyRequiredItem, QA_RUN_ENV, relativePosix, validateJourneysReceipt } from "./release-qa-hardening.mjs";
36
36
  import { prepareInstalledArtifacts } from "./release-qa-installed.mjs";
37
+ import { QA_SOURCE_LISTING_ENV, writeQaSourceListing } from "./qa-source-listing.mjs";
37
38
  import { main as policyMain } from "./release-qa-policy.mjs";
38
39
  import { darwinKeyFile, PROTECTED_SECRETS } from "./protected-credentials.mjs";
39
40
  import {
@@ -195,8 +196,13 @@ export async function runQa({ stage, platform, releaseIdArg, configPath, deps =
195
196
  const expand = (value) => String(value).replaceAll("{sealedDir}", sealed?.sealedDir ?? "").replaceAll("{releaseId}", releaseId)
196
197
  .replaceAll("{installedApp}", installedQa?.installedApp ?? "").replaceAll("{installedDir}", installedQa?.installedDir ?? "").replaceAll("{qaRoot}", installedQa?.qaRoot ?? "");
197
198
  const installedDirs = installedDirNames(config, deps.env ?? process.env);
199
+ // In a door source split the journeys runner's root is the git-less snapshot: it binds its build record and scenario files to the
200
+ // commit's committed bytes through this listing, written outside the snapshot from the checkout's object database (qa-source-listing.mjs).
201
+ const sourceListing = split && journeysConfig && !journeysConfig.receipt
202
+ ? (deps.writeSourceListing ?? writeQaSourceListing)({ source: release, dir: path.join(repoRoot, ".right-release", "qa-source"), git: gitRunner })
203
+ : null;
198
204
  const runEnv = {
199
- ...process.env, RIGHT_RELEASE_QA_STAGE: stage, RIGHT_RELEASE_QA_COMMIT: source.commit, RIGHT_RELEASE_QA_RELEASE_ID: releaseId,
205
+ ...process.env, ...(sourceListing ? { [QA_SOURCE_LISTING_ENV]: sourceListing } : {}), RIGHT_RELEASE_QA_STAGE: stage, RIGHT_RELEASE_QA_COMMIT: source.commit, RIGHT_RELEASE_QA_RELEASE_ID: releaseId,
200
206
  ...(sealed ? { RIGHT_RELEASE_QA_SEALED_DIR: sealed.sealedDir } : {}), ...(installedDirs.length ? { RIGHTKIT_QA_INSTALLED_DIRS: installedDirs.join(";") } : {}), ...(installedQa?.env ?? {}),
201
207
  };
202
208
  const runCwd = appRoot;
@@ -187,27 +187,68 @@ function manifestRoots(root, extraLocks) {
187
187
  /** RightKit dependencies the manifests under root declare (Cargo.toml, package.json): the inputs that need lock proof. */
188
188
  export function declaredRightKitDependencies(root, owned, extraLocks = []) {
189
189
  const found = [];
190
- const take = (ecosystem, name, file, local = false) => {
191
- if (owned[ecosystem].has(name)) found.push({ ecosystem, name, file });
192
- else if (prefixed(ecosystem, name) && !local) found.push({ ecosystem, name, file });
190
+ const take = (ecosystem, name, file, local = false, requirement = null) => {
191
+ if (owned[ecosystem].has(name)) found.push({ ecosystem, name, file, requirement });
192
+ else if (prefixed(ecosystem, name) && !local) found.push({ ecosystem, name, file, requirement });
193
193
  };
194
194
  for (const file of manifestRoots(root, extraLocks).flatMap((dir) => scanFiles(dir, new Set(["Cargo.toml", "package.json"])))) {
195
195
  try {
196
196
  if (path.basename(file) === "package.json") {
197
197
  const pkg = JSON.parse(readFileSync(file, "utf8"));
198
198
  // A git/file/link/workspace specifier never resolves from the registry; the package-contract validator refuses it by name.
199
- for (const section of NPM_DEP_SECTIONS) for (const [name, spec] of Object.entries(pkg[section] ?? {})) if (!/[:/]/.test(String(spec))) take("npm", name, file);
199
+ for (const section of NPM_DEP_SECTIONS) for (const [name, spec] of Object.entries(pkg[section] ?? {})) if (!/[:/]/.test(String(spec))) take("npm", name, file, false, String(spec));
200
200
  } else {
201
201
  const doc = parseToml(readFileSync(file, "utf8"));
202
202
  const tables = [...MANIFEST_DEP_TABLES.map((t) => doc[t]), doc.workspace?.dependencies, ...Object.values(doc.target ?? {}).flatMap((target) => MANIFEST_DEP_TABLES.map((t) => target?.[t]))];
203
203
  // A path or workspace dependency on an unowned prefixed name is app-local (see collectLockedRightKit).
204
- for (const table of tables) for (const [key, spec] of Object.entries(table ?? {})) take("cargo", typeof spec === "object" && spec && typeof spec.package === "string" ? spec.package : key, file, typeof spec === "object" && spec !== null && (typeof spec.path === "string" || spec.workspace === true));
204
+ for (const table of tables) for (const [key, spec] of Object.entries(table ?? {})) take("cargo", typeof spec === "object" && spec && typeof spec.package === "string" ? spec.package : key, file, typeof spec === "object" && spec !== null && (typeof spec.path === "string" || spec.workspace === true), typeof spec === "string" ? spec : typeof spec?.version === "string" ? spec.version : null);
205
205
  }
206
206
  } catch { /* an unreadable manifest is the manifest validators' finding */ }
207
207
  }
208
208
  return found;
209
209
  }
210
210
 
211
+
212
+ /**
213
+ * Whether `version` satisfies a declared requirement, read as the ecosystem reads it: Cargo's bare "0.5.0" is "^0.5.0", npm's is exact;
214
+ * "=", "^", "~", ">=", ">", "<=", "<" and Cargo's comma-joined sets are understood. Returns null when the requirement is not one of these
215
+ * (a tag, a range with spaces or "||", a wildcard), so the caller can stay conservative.
216
+ */
217
+ export function satisfiesRequirement(version, requirement, ecosystem) {
218
+ const parse = (v) => { const m = /^(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-[0-9A-Za-z.-]+)?$/.exec(String(v).trim()); return m ? { parts: [Number(m[1]), m[2] === undefined ? null : Number(m[2]), m[3] === undefined ? null : Number(m[3])] } : null; };
219
+ const full = parse(version);
220
+ if (!full || full.parts.includes(null)) return null;
221
+ const [a, b, c] = full.parts;
222
+ const cmp = (x) => { const p = x.parts.map((n) => n ?? 0); return a !== p[0] ? (a < p[0] ? -1 : 1) : b !== p[1] ? (b < p[1] ? -1 : 1) : c !== p[2] ? (c < p[2] ? -1 : 1) : 0; };
223
+ const one = (text) => {
224
+ const m = /^(=|\^|~|>=|<=|>|<)?\s*v?(\S+)$/.exec(text.trim());
225
+ if (!m) return null;
226
+ const op = m[1] ?? (ecosystem === "cargo" ? "^" : "=");
227
+ const req = parse(m[2]);
228
+ if (!req) return null;
229
+ const [x, y, z] = req.parts;
230
+ if (op === "=") return a === x && (y === null || b === y) && (z === null || c === z);
231
+ if (op === ">=") return cmp(req) >= 0;
232
+ if (op === ">") return cmp(req) > 0;
233
+ if (op === "<=") return cmp(req) <= 0;
234
+ if (op === "<") return cmp(req) < 0;
235
+ if (op === "~") return cmp(req) >= 0 && a === x && (y === null || b === y);
236
+ // Caret: the left-most non-zero part is fixed.
237
+ if (cmp(req) < 0) return false;
238
+ if (x !== 0) return a === x;
239
+ if (y === null) return a === 0;
240
+ if (y !== 0) return a === 0 && b === y;
241
+ if (z === null) return a === 0 && b === 0;
242
+ return a === 0 && b === 0 && c === z;
243
+ };
244
+ const text = String(requirement ?? "").trim();
245
+ if (!text || /\|\||\*|\bx\b/.test(text)) return null;
246
+ const parts = ecosystem === "cargo" ? text.split(",") : [text];
247
+ if (ecosystem !== "cargo" && /\s/.test(text)) return null;
248
+ const results = parts.map(one);
249
+ return results.includes(null) ? null : results.every(Boolean);
250
+ }
251
+
211
252
  /** Declared RightKit dependencies that no lock entry proves: no bundled-only fallback. */
212
253
  export function coverageProblems(declared, lockedEntries) {
213
254
  const have = new Set(lockedEntries.map((e) => `${e.ecosystem}\0${e.name}`));
@@ -665,7 +706,16 @@ export function evaluateRightKitFreshness(snapshot, holds, { enforce = false, de
665
706
  // `declared`: the RightKit names the app's own manifests declare (`${ecosystem}\0${name}`). A stale entry the app does not declare is a
666
707
  // transitive lock entry: only the RightKit units that depend on it can move it, so it is reported, never refused (Pulse 0.6.80: rightkit-fs
667
708
  // 0.4.19, required ^0.4 by the latest rightkit-http, -pdf and others). With no set given every entry is judged as before.
668
- const isDirect = (entry) => !declared || declared.has(`${entry.ecosystem}\0${entry.name}`);
709
+ const isDirect = (entry) => {
710
+ if (!declared) return true;
711
+ const reqs = declared.get(`${entry.ecosystem}\0${entry.name}`);
712
+ if (!reqs) return false;
713
+ // Declared by name: direct only when its version meets one of the app's own requirements for that name (Pulse 0.6.81: it declares
714
+ // rightkit-fs =0.5.0, and the 0.4.19 the latest rightkit-http still pulls in is transitive). A name declared with no readable
715
+ // requirement (a workspace-inherited entry, an unparsed range) stays direct.
716
+ const verdicts = reqs.map((r) => (r === null ? null : satisfiesRequirement(entry.version, r, entry.ecosystem)));
717
+ return verdicts.includes(true) || verdicts.every((v) => v === null);
718
+ };
669
719
  const refusals = [];
670
720
  const newer = [];
671
721
  const tasks = [];
@@ -730,7 +780,13 @@ export async function prepareRightKitResolution({ root, snapshotFile = null, bou
730
780
  // so a publication after admission neither mutates nor restarts an admitted build.
731
781
  const enforce = admission && source === "resolved";
732
782
  let declared = null;
733
- try { declared = new Set(declaredRightKitDependencies(root, ownedRightKitNames(versions, ownership), options.extraLocks ?? []).map((d) => `${d.ecosystem}\0${d.name}`)); } catch { declared = null; }
783
+ try {
784
+ declared = new Map();
785
+ for (const d of declaredRightKitDependencies(root, ownedRightKitNames(versions, ownership), options.extraLocks ?? [])) {
786
+ const key = `${d.ecosystem}\0${d.name}`;
787
+ declared.set(key, [...(declared.get(key) ?? []), d.requirement ?? null]);
788
+ }
789
+ } catch { declared = null; }
734
790
  const freshness = evaluateRightKitFreshness(snapshot, readUpdateHolds(root), { enforce, declared });
735
791
  if (freshness.refusals.length) {
736
792
  throw new RightKitRegistryError("stale-pin", `RightKit pins are behind the latest published version (build admission refused):\n${freshness.refusals.map((p) => `- ${p}`).join("\n")}`, { problems: freshness.refusals });
@@ -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.81",
52
+ "@rightkit/release": "0.6.83",
53
53
  "@rightkit/send-ui": "0.1.0",
54
54
  "@rightkit/settings-ui": "0.7.7",
55
55
  "@rightkit/social-ui": "0.2.1",
@@ -446,7 +446,9 @@
446
446
  "0.6.77",
447
447
  "0.6.78",
448
448
  "0.6.79",
449
- "0.6.80"
449
+ "0.6.80",
450
+ "0.6.81",
451
+ "0.6.82"
450
452
  ],
451
453
  "@rightkit/settings-ui": [
452
454
  "0.1.0",
@@ -536,14 +538,14 @@
536
538
  "rightkit-tauri": "0.1.0"
537
539
  },
538
540
  "stagedCargo": {
539
- "rightkit-adapt": "0.2.0",
541
+ "rightkit-adapt": "0.2.1",
540
542
  "rightkit-adapt-taste": "0.1.3",
541
543
  "rightkit-agent-coding-tools": "0.1.9",
542
544
  "rightkit-agent-config": "0.1.3",
543
545
  "rightkit-agent-daemon": "0.2.0",
544
546
  "rightkit-agent-demo": "0.2.0",
545
547
  "rightkit-agent-engine": "0.2.0",
546
- "rightkit-agent-engine-api-integrations": "0.1.5",
548
+ "rightkit-agent-engine-api-integrations": "0.1.6",
547
549
  "rightkit-agent-engine-api-platform": "0.1.3",
548
550
  "rightkit-agent-engine-api-sessions": "0.1.1",
549
551
  "rightkit-agent-engine-api-workflows": "0.2.2",
@@ -560,26 +562,26 @@
560
562
  "rightkit-agent-gateway": "0.3.0",
561
563
  "rightkit-agent-host-traits": "0.1.3",
562
564
  "rightkit-agent-learning": "0.1.2",
563
- "rightkit-agent-local-models": "0.1.2",
565
+ "rightkit-agent-local-models": "0.1.3",
564
566
  "rightkit-agent-orchestration": "0.1.6",
565
567
  "rightkit-agent-orchestration-handoff": "0.1.2",
566
- "rightkit-agent-plugins": "0.1.3",
568
+ "rightkit-agent-plugins": "0.1.4",
567
569
  "rightkit-agent-policy": "0.2.4",
568
- "rightkit-agent-recipes": "0.1.2",
570
+ "rightkit-agent-recipes": "0.1.3",
569
571
  "rightkit-agent-server": "0.2.0",
570
572
  "rightkit-agent-skills": "0.1.0",
571
573
  "rightkit-agent-task-contract": "0.1.2",
572
574
  "rightkit-agent-task-journal": "0.1.1",
573
575
  "rightkit-agent-telemetry": "0.1.0",
574
576
  "rightkit-agent-tools": "0.4.4",
575
- "rightkit-agent-transcript": "0.1.3",
577
+ "rightkit-agent-transcript": "0.1.4",
576
578
  "rightkit-agents": "0.2.8",
577
579
  "rightkit-ai-accounts": "0.1.3",
578
580
  "rightkit-ai-keys": "0.1.1",
579
- "rightkit-android": "0.3.2",
581
+ "rightkit-android": "0.3.3",
580
582
  "rightkit-app-host": "0.1.3",
581
583
  "rightkit-app-icon": "0.1.0",
582
- "rightkit-app-lock": "0.1.0",
584
+ "rightkit-app-lock": "0.1.1",
583
585
  "rightkit-app-manager": "0.2.5",
584
586
  "rightkit-app-settings": "0.4.4",
585
587
  "rightkit-app-update": "0.2.0",
@@ -598,7 +600,7 @@
598
600
  "rightkit-captions": "0.1.1",
599
601
  "rightkit-catalog": "0.1.0",
600
602
  "rightkit-channel-memory": "0.2.3",
601
- "rightkit-chat-bridge": "0.2.4",
603
+ "rightkit-chat-bridge": "0.2.5",
602
604
  "rightkit-child-process": "0.5.17",
603
605
  "rightkit-clipboard": "0.1.0",
604
606
  "rightkit-clipboard-history": "0.4.0",
@@ -616,7 +618,7 @@
616
618
  "rightkit-context-client": "0.2.0",
617
619
  "rightkit-context-core": "0.2.0",
618
620
  "rightkit-context-federation": "0.2.1",
619
- "rightkit-context-protocol": "0.2.0",
621
+ "rightkit-context-protocol": "0.2.1",
620
622
  "rightkit-context-provider-sdk": "0.2.0",
621
623
  "rightkit-context-runtime": "0.1.5",
622
624
  "rightkit-contracts": "0.1.11",
@@ -650,7 +652,7 @@
650
652
  "rightkit-docs": "0.1.6",
651
653
  "rightkit-doctor": "0.2.0",
652
654
  "rightkit-document-workspace": "0.2.0",
653
- "rightkit-embed": "0.7.0",
655
+ "rightkit-embed": "0.7.1",
654
656
  "rightkit-engine-host": "0.2.1",
655
657
  "rightkit-evidence": "0.1.1",
656
658
  "rightkit-evidence-application": "0.2.0",
@@ -661,7 +663,7 @@
661
663
  "rightkit-evidence-governance": "0.1.1",
662
664
  "rightkit-evidence-report": "0.1.1",
663
665
  "rightkit-feed": "0.1.0",
664
- "rightkit-ffmpeg": "0.3.2",
666
+ "rightkit-ffmpeg": "0.3.3",
665
667
  "rightkit-file-watch": "0.4.4",
666
668
  "rightkit-fs": "0.5.2",
667
669
  "rightkit-fsindex": "0.6.3",
@@ -671,11 +673,11 @@
671
673
  "rightkit-gpu": "0.1.0",
672
674
  "rightkit-hooks": "0.3.0",
673
675
  "rightkit-hotkeys": "0.1.8",
674
- "rightkit-http": "0.4.0",
676
+ "rightkit-http": "0.4.1",
675
677
  "rightkit-i18n": "0.1.0",
676
- "rightkit-identity": "0.1.2",
678
+ "rightkit-identity": "0.1.3",
677
679
  "rightkit-instance": "0.2.0",
678
- "rightkit-job-queue": "0.6.1",
680
+ "rightkit-job-queue": "0.6.2",
679
681
  "rightkit-launcher": "0.2.2",
680
682
  "rightkit-launcher-win": "0.2.1",
681
683
  "rightkit-library": "0.3.0",
@@ -696,10 +698,10 @@
696
698
  "rightkit-media-pipeline": "0.2.2",
697
699
  "rightkit-memory": "0.3.1",
698
700
  "rightkit-memory-client": "0.1.1",
699
- "rightkit-memory-core": "0.2.0",
701
+ "rightkit-memory-core": "0.2.1",
700
702
  "rightkit-memory-store": "0.2.2",
701
703
  "rightkit-mesh": "0.2.3",
702
- "rightkit-models": "0.7.2",
704
+ "rightkit-models": "0.7.3",
703
705
  "rightkit-motion": "0.4.0",
704
706
  "rightkit-notch-ui": "0.2.3",
705
707
  "rightkit-notifications": "0.1.2",
@@ -712,7 +714,7 @@
712
714
  "rightkit-owner-approvals": "0.1.3",
713
715
  "rightkit-ownership": "0.4.6",
714
716
  "rightkit-passkeys": "0.1.0",
715
- "rightkit-pdf": "0.3.5",
717
+ "rightkit-pdf": "0.3.6",
716
718
  "rightkit-pipeline": "0.2.0",
717
719
  "rightkit-platform-rules": "0.1.1",
718
720
  "rightkit-playback": "0.3.1",
@@ -723,12 +725,12 @@
723
725
  "rightkit-profile": "0.1.0",
724
726
  "rightkit-prompt-recipes": "0.2.1",
725
727
  "rightkit-pty": "0.1.3",
726
- "rightkit-qa": "0.10.12",
728
+ "rightkit-qa": "0.10.14",
727
729
  "rightkit-record": "0.4.1",
728
730
  "rightkit-reframe": "0.2.0",
729
731
  "rightkit-remote-compute": "0.2.1",
730
732
  "rightkit-remote-gateway": "0.1.5",
731
- "rightkit-repo-graph": "0.3.2",
733
+ "rightkit-repo-graph": "0.3.3",
732
734
  "rightkit-repo-graph-grammars": "0.1.1",
733
735
  "rightkit-research": "0.1.2",
734
736
  "rightkit-review": "0.6.0",
@@ -914,7 +916,7 @@
914
916
  "@rightkit/qa": "0.7.0",
915
917
  "@rightkit/qa-chrome": "0.1.12",
916
918
  "@rightkit/react-shell": "0.7.7",
917
- "@rightkit/release": "0.6.80",
919
+ "@rightkit/release": "0.6.82",
918
920
  "@rightkit/settings-ui": "0.7.4",
919
921
  "@rightkit/shell": "0.1.1",
920
922
  "@rightkit/tauri": "0.4.3",
@@ -925,6 +927,9 @@
925
927
  }
926
928
  },
927
929
  "legacyCargo": {
930
+ "rightkit-agent-engine-api-integrations": [
931
+ "0.1.5"
932
+ ],
928
933
  "rightkit-agent-engine-attention": [
929
934
  "0.1.3",
930
935
  "0.2.0"
@@ -933,14 +938,19 @@
933
938
  "0.1.3"
934
939
  ],
935
940
  "rightkit-agent-local-models": [
936
- "0.1.1"
941
+ "0.1.1",
942
+ "0.1.2"
937
943
  ],
938
944
  "rightkit-agent-plugins": [
939
- "0.1.2"
945
+ "0.1.2",
946
+ "0.1.3"
940
947
  ],
941
948
  "rightkit-agent-policy": [
942
949
  "0.2.3"
943
950
  ],
951
+ "rightkit-agent-recipes": [
952
+ "0.1.2"
953
+ ],
944
954
  "rightkit-agent-task-contract": [
945
955
  "0.1.1"
946
956
  ],
@@ -968,7 +978,8 @@
968
978
  "rightkit-android": [
969
979
  "0.2.0",
970
980
  "0.3.0",
971
- "0.3.1"
981
+ "0.3.1",
982
+ "0.3.2"
972
983
  ],
973
984
  "rightkit-app-manager": [
974
985
  "0.2.2",
@@ -1047,7 +1058,8 @@
1047
1058
  "0.2.0",
1048
1059
  "0.2.1",
1049
1060
  "0.2.2",
1050
- "0.2.3"
1061
+ "0.2.3",
1062
+ "0.2.4"
1051
1063
  ],
1052
1064
  "rightkit-child-process": [
1053
1065
  "0.4.0",
@@ -1208,12 +1220,14 @@
1208
1220
  "0.4.0",
1209
1221
  "0.5.0",
1210
1222
  "0.6.0",
1211
- "0.6.1"
1223
+ "0.6.1",
1224
+ "0.7.0"
1212
1225
  ],
1213
1226
  "rightkit-ffmpeg": [
1214
1227
  "0.2.6",
1215
1228
  "0.2.9",
1216
- "0.2.10"
1229
+ "0.2.10",
1230
+ "0.3.2"
1217
1231
  ],
1218
1232
  "rightkit-file-watch": [
1219
1233
  "0.4.0",
@@ -1278,10 +1292,12 @@
1278
1292
  "0.3.5",
1279
1293
  "0.3.6",
1280
1294
  "0.3.7",
1281
- "0.3.8"
1295
+ "0.3.8",
1296
+ "0.4.0"
1282
1297
  ],
1283
1298
  "rightkit-identity": [
1284
- "0.1.0"
1299
+ "0.1.0",
1300
+ "0.1.2"
1285
1301
  ],
1286
1302
  "rightkit-job-queue": [
1287
1303
  "0.3.0",
@@ -1290,7 +1306,8 @@
1290
1306
  "0.4.0",
1291
1307
  "0.5.0",
1292
1308
  "0.5.1",
1293
- "0.6.0"
1309
+ "0.6.0",
1310
+ "0.6.1"
1294
1311
  ],
1295
1312
  "rightkit-jobs": [
1296
1313
  "0.2.1",
@@ -1383,7 +1400,8 @@
1383
1400
  "0.3.1",
1384
1401
  "0.3.2",
1385
1402
  "0.4.4",
1386
- "0.5.1"
1403
+ "0.5.1",
1404
+ "0.7.2"
1387
1405
  ],
1388
1406
  "rightkit-motion": [
1389
1407
  "0.1.0",
@@ -1447,7 +1465,8 @@
1447
1465
  "0.1.0",
1448
1466
  "0.3.0",
1449
1467
  "0.3.2",
1450
- "0.3.3"
1468
+ "0.3.3",
1469
+ "0.3.5"
1451
1470
  ],
1452
1471
  "rightkit-platform-rules": [
1453
1472
  "0.1.0"
@@ -1495,7 +1514,9 @@
1495
1514
  "0.9.1",
1496
1515
  "0.10.8",
1497
1516
  "0.10.10",
1498
- "0.10.11"
1517
+ "0.10.11",
1518
+ "0.10.12",
1519
+ "0.10.13"
1499
1520
  ],
1500
1521
  "rightkit-qa-driver": [
1501
1522
  "0.3.0",
@@ -1739,6 +1760,24 @@
1739
1760
  ],
1740
1761
  "rightkit-privileged-helper": [
1741
1762
  "0.2.0"
1763
+ ],
1764
+ "rightkit-app-lock": [
1765
+ "0.1.0"
1766
+ ],
1767
+ "rightkit-adapt": [
1768
+ "0.2.0"
1769
+ ],
1770
+ "rightkit-agent-transcript": [
1771
+ "0.1.3"
1772
+ ],
1773
+ "rightkit-context-protocol": [
1774
+ "0.2.0"
1775
+ ],
1776
+ "rightkit-memory-core": [
1777
+ "0.2.0"
1778
+ ],
1779
+ "rightkit-repo-graph": [
1780
+ "0.3.2"
1742
1781
  ]
1743
1782
  }
1744
1783
  }