@rightkit/release 0.6.40 → 0.6.43

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.
Files changed (88) hide show
  1. package/README.md +110 -11
  2. package/admission-files.mjs +40 -0
  3. package/admission-host.mjs +2 -1
  4. package/app-check.mjs +303 -16
  5. package/app-closure.mjs +6 -4
  6. package/bin/rightkit-gate.mjs +180 -32
  7. package/cargo-contract.mjs +17 -31
  8. package/cargo-license-notices.mjs +129 -19
  9. package/cargo-target-shim.mjs +14 -0
  10. package/carried-cargo.mjs +2 -4
  11. package/cli/right-release.mjs +24 -2
  12. package/cross-targets.mjs +24 -0
  13. package/deterministic-scans.mjs +150 -58
  14. package/development-signing.mjs +25 -2
  15. package/development.mjs +34 -1
  16. package/direct-release-command.mjs +154 -0
  17. package/disk-policy.mjs +16 -0
  18. package/feature-coverage.mjs +134 -0
  19. package/gate-coverage.mjs +38 -0
  20. package/gate-stages.mjs +1 -0
  21. package/ghsa-audit.mjs +95 -0
  22. package/install-app.mjs +33 -5
  23. package/install-channels.mjs +301 -0
  24. package/interactive-session-run.mjs +105 -0
  25. package/legal-contract.mjs +10 -1
  26. package/legion-freeze-consumer.mjs +241 -0
  27. package/linux-publish.mjs +136 -0
  28. package/local-publish.mjs +31 -8
  29. package/nsis-pack.mjs +95 -0
  30. package/nsis-upgrade-template.mjs +93 -0
  31. package/outdated-command.mjs +19 -0
  32. package/ownership-class-rules.mjs +32 -10
  33. package/ownership-mandatory-set.json +23 -0
  34. package/ownership-mandatory-set.mjs +66 -8
  35. package/package-recipe-targets.mjs +54 -19
  36. package/package.json +1 -1
  37. package/payload-root-install.mjs +123 -0
  38. package/plugin-delivery.mjs +141 -0
  39. package/prebuild-gates.mjs +8 -4
  40. package/preflight.mjs +6 -1
  41. package/provision-model-bundle.mjs +172 -0
  42. package/pub-upload.mjs +1 -1
  43. package/publish-local-npm.mjs +34 -9
  44. package/publish-retention.mjs +106 -0
  45. package/publish-update.mjs +15 -8
  46. package/qa-build-features.mjs +24 -15
  47. package/qa-contract.mjs +5 -6
  48. package/qa-control-scan.mjs +14 -0
  49. package/qa-web-pairing.mjs +76 -0
  50. package/r2-s3-multipart.mjs +190 -0
  51. package/r2-verified-upload.mjs +28 -16
  52. package/recipe-build.mjs +53 -3
  53. package/release-checks.mjs +53 -2
  54. package/release-config.mjs +8 -3
  55. package/release-invocation.mjs +12 -2
  56. package/release-pin-floor.mjs +44 -0
  57. package/release-qa-audit.mjs +18 -2
  58. package/release-qa-command.mjs +17 -1
  59. package/release-qa-policy.mjs +30 -3
  60. package/release-switch-cfg.mjs +271 -0
  61. package/release-switch-registry.json +60 -1
  62. package/release-switch-scan.mjs +398 -23
  63. package/release.mjs +97 -6
  64. package/render-views.mjs +141 -0
  65. package/rightkit-registry-resolver.mjs +1 -1
  66. package/rightkit-versions.json +140 -103
  67. package/runtime-artifact-manifest.mjs +9 -0
  68. package/runtime-manifest-refresh.mjs +88 -0
  69. package/rustright-stage.mjs +197 -0
  70. package/scan-digest.mjs +15 -9
  71. package/scan-tool-enrolment.mjs +1 -1
  72. package/security-policy.mjs +196 -0
  73. package/shell-contract.mjs +32 -0
  74. package/snapshot-broker.mjs +8 -1
  75. package/snapshot-check.mjs +59 -1
  76. package/snapshot-identity.mjs +48 -0
  77. package/snapshot-request.mjs +25 -2
  78. package/snapshot.mjs +69 -9
  79. package/stage-commands.mjs +33 -4
  80. package/stage-ledger.mjs +5 -0
  81. package/stage-receipt.mjs +115 -0
  82. package/stage-sidecar.mjs +188 -17
  83. package/stage-xcframework.mjs +118 -0
  84. package/suite-api.generated.mjs +16 -1
  85. package/unit-gate.mjs +14 -2
  86. package/upload-large.mjs +4 -4
  87. package/upload-release.mjs +6 -0
  88. package/win-package-recipe.mjs +26 -4
@@ -7,6 +7,7 @@ import { defaultReleaseConfigFile } from "./release-config.mjs";
7
7
  import { authorizeGitHubUpload } from "./github-upload-gate.mjs";
8
8
  import { recordPublishedVersion } from "./artifact-storage.mjs";
9
9
  import { admitInstalledQa } from "./release-qa-audit.mjs";
10
+ import { retainAfterPublish } from "./publish-retention.mjs";
10
11
 
11
12
  const args = process.argv.slice(2);
12
13
  let platform = process.platform === "win32" ? "win" : process.platform === "darwin" ? "mac" : process.platform;
@@ -81,6 +82,11 @@ if (!dryRun) writeJson(verifiedMarker, {
81
82
  // Candidate builds never enter published.json.
82
83
  if (!dryRun) recordPublishedVersion({ app: sealed.manifest.app, version: sealed.manifest.version, platform });
83
84
  console.log(`right-release upload: ${dryRun ? "dry-run " : ""}${result.status} ${releaseId} tier=${tier} repo=${repo}`);
85
+ // Only after the remote bytes were verified: bound what the sealed and state folders keep by count and age, and fail loudly above the size limit (rightkit#763).
86
+ if (!dryRun) {
87
+ try { retainAfterPublish({ root: repoRoot, keep: { releaseId }, log: (line) => console.log(line) }); }
88
+ catch (error) { console.error(`right-release upload: published, but ${error.message}`); process.exitCode = 1; }
89
+ }
84
90
 
85
91
  function writeJson(file, value) {
86
92
  mkdirSync(path.dirname(file), { recursive: true });
@@ -25,6 +25,7 @@ import { resolveCommand } from "./development.mjs";
25
25
  import { verifyNsisEmbeddedBinary } from "./nsis-payload.mjs";
26
26
  import { resolveArtifactPath, splitArtifactContext } from "./release-artifact-path.mjs";
27
27
  import { signingReceiptPath } from "./signing-receipts.mjs";
28
+ import { defaultManagedRoots, isUnderManagedRoot } from "./managed-target-stage.mjs";
28
29
  import { patchTauriBundleType } from "./tauri-bundle-marker.mjs";
29
30
 
30
31
  const TOOL_ROOT = path.dirname(fileURLToPath(import.meta.url));
@@ -81,11 +82,25 @@ function relativeInside(appRoot, value, label, issues) {
81
82
  return resolved;
82
83
  }
83
84
 
85
+ /**
86
+ * An artifact path under a broker-managed root (the RustRight data root, .rightkit-managed, rightkit-build-control) may be absolute
87
+ * (rightkit#717): the raw EXE and the NSIS installer of a managed Cargo target live there, and the Authenticode-before-NSIS contract
88
+ * must address them where Tauri writes them. Anything absolute outside a managed root, or with a `..` segment, is still refused.
89
+ */
90
+ function managedAbsolute(value, label, issues, managedRoots) {
91
+ if (typeof value !== "string" || value.trim() === "" || value !== value.trim() || value.includes("\0")) return undefined;
92
+ if (!(path.win32.isAbsolute(value) || path.posix.isAbsolute(value))) return undefined;
93
+ if (value.replaceAll("\\", "/").split("/").includes("..")) { issues.push(`${label} must not contain .., received ${JSON.stringify(value)}`); return null; }
94
+ if (!path.isAbsolute(value)) return undefined;
95
+ if (!isUnderManagedRoot(path.dirname(value), managedRoots)) return undefined;
96
+ return path.resolve(value);
97
+ }
98
+
84
99
  /**
85
100
  * Validate `target.winPackage` strictly and return the normalised plan. Throws WinPackageConfigError listing
86
101
  * every problem. Unknown keys are refused so a typo cannot silently drop a sidecar or the updater step.
87
102
  */
88
- export function validateWinPackage({ appRoot, config = {}, target } = {}) {
103
+ export function validateWinPackage({ appRoot, config = {}, target, env = process.env, managedRoots = defaultManagedRoots(env) } = {}) {
89
104
  const issues = [];
90
105
  if (typeof appRoot !== "string" || appRoot === "") issues.push("appRoot must be a non-empty string");
91
106
  if (!isPlainObject(target)) throw new WinPackageConfigError([...issues, "target must be an object"]);
@@ -109,8 +124,14 @@ export function validateWinPackage({ appRoot, config = {}, target } = {}) {
109
124
  const installerDeclared = spec.installerFile ?? (Array.isArray(target.sign?.files) && target.sign.files.length === 1 ? target.sign.files[0] : undefined);
110
125
  if (rawDeclared === undefined) issues.push("the raw EXE path is unknown: set winPackage.rawExe or exactly one target.sign.prePackageFiles entry");
111
126
  if (installerDeclared === undefined) issues.push("the installer path is unknown: set winPackage.installerFile or exactly one target.sign.files entry");
112
- const rawExe = rawDeclared === undefined ? null : relativeInside(appRoot, rawDeclared, "rawExe", issues);
113
- const installerFile = installerDeclared === undefined ? null : relativeInside(appRoot, installerDeclared, "installerFile", issues);
127
+ const artifactPath = (declared, label) => {
128
+ if (declared === undefined) return { file: null, managed: false };
129
+ const absolute = managedAbsolute(declared, label, issues, managedRoots);
130
+ if (absolute === null) return { file: null, managed: false };
131
+ return absolute ? { file: absolute, managed: true } : { file: relativeInside(appRoot, declared, label, issues), managed: false };
132
+ };
133
+ const { file: rawExe, managed: rawExeManaged } = artifactPath(rawDeclared, "rawExe");
134
+ const { file: installerFile, managed: installerFileManaged } = artifactPath(installerDeclared, "installerFile");
114
135
  if (rawExe && !/\.exe$/i.test(rawExe)) issues.push(`rawExe must be an .exe, received ${rawDeclared}`);
115
136
  if (installerFile && !/\.exe$/i.test(installerFile)) issues.push(`installerFile must be an .exe, received ${installerDeclared}`);
116
137
  if (rawExe && installerFile && rawExe.toLowerCase() === installerFile.toLowerCase()) issues.push("rawExe and installerFile must be different files");
@@ -147,6 +168,7 @@ export function validateWinPackage({ appRoot, config = {}, target } = {}) {
147
168
  triple,
148
169
  rawExe,
149
170
  installerFile,
171
+ managed: Object.freeze({ rawExe: rawExeManaged, installerFile: installerFileManaged }),
150
172
  sidecars: Object.freeze(sidecars),
151
173
  tauriCwd,
152
174
  });
@@ -286,7 +308,7 @@ export function runWinPackageRecipe({ appRoot, config = {}, target, deps = {} }
286
308
 
287
309
  phase("build", () => {
288
310
  if (!dry) fs.rmSync(rawExe, { force: true });
289
- tauri(["build", "--no-bundle", "--target", plan.triple], quiet);
311
+ tauri(["build", "--no-bundle", "--target", plan.triple, "--", "--locked"], quiet); // the reviewed lockfile only (rightkit#725)
290
312
  if (dry) return;
291
313
  raw = locate(rawExe, { env, fs, split });
292
314
  if (!fs.existsSync(raw)) throw new Error(`tauri build did not produce the raw EXE: ${rawExe}`);