@rightkit/release 0.2.143 → 0.2.145

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/rightkit-sync.mjs CHANGED
@@ -185,8 +185,11 @@ export function syncConsumerCopies(root = rightkitRoot) {
185
185
  ["rightkit-ownership.json", path.join(root, "packages", "build-control-policy", "src", "ownership-session-catalog.json")],
186
186
  ["rightkit-ownership.json", path.join(root, "packages", "build-control-policy", "src", "ownership-fingerprints.json")],
187
187
  ["rightkit-versions.json", path.join(root, "packages", "build-control-policy", "src", "ownership-session-versions.json")],
188
+ ["ownership-repositories.json", path.join(root, "packages", "build-control-policy", "src", "ownership-repositories.json")],
188
189
  ["rightkit-drift.mjs", path.join(root, "packages", "build-control-policy", "src", "rightkit-drift.mjs")],
189
190
  ["background-process.mjs", path.join(root, "packages", "build-control-policy", "src", "background-process.mjs")],
191
+ ["ownership-dependency-allowlist.json", path.join(root, "packages", "build-control-policy", "src", "ownership-dependency-allowlist.json")],
192
+ ["ownership-dependency-allowlist.mjs", path.join(root, "packages", "build-control-policy", "src", "ownership-dependency-allowlist.mjs")],
190
193
  ["ownership-source.mjs", path.join(root, "packages", "build-control-policy", "src", "ownership-source.mjs")],
191
194
  ["ownership-availability.mjs", path.join(root, "packages", "build-control-policy", "src", "ownership-availability.mjs")],
192
195
  ];
@@ -29,7 +29,7 @@
29
29
  "@rightkit/platform-ui": "0.2.0",
30
30
  "@rightkit/qa": "0.4.0",
31
31
  "@rightkit/qa-chrome": "0.1.3",
32
- "@rightkit/release": "0.2.143",
32
+ "@rightkit/release": "0.2.145",
33
33
  "@rightkit/settings-ui": "0.3.0",
34
34
  "@rightkit/shell": "0.1.0",
35
35
  "@rightkit/tauri": "0.2.0",
@@ -175,7 +175,9 @@
175
175
  "0.2.139",
176
176
  "0.2.140",
177
177
  "0.2.141",
178
- "0.2.142"
178
+ "0.2.142",
179
+ "0.2.143",
180
+ "0.2.144"
179
181
  ],
180
182
  "@rightkit/qa": [
181
183
  "0.1.0",
@@ -275,7 +277,7 @@
275
277
  "rightkit-browser": "0.2.3",
276
278
  "rightkit-cache": "0.1.0",
277
279
  "rightkit-contracts": "0.1.2",
278
- "rightkit-control": "0.1.9",
280
+ "rightkit-control": "0.1.11",
279
281
  "rightkit-crash": "0.2.0",
280
282
  "rightkit-db": "0.3.2",
281
283
  "rightkit-embed": "0.3.1",
@@ -332,7 +334,7 @@
332
334
  "rightkit-audio": "0.2.0",
333
335
  "rightkit-browser": "0.2.2",
334
336
  "rightkit-cache": "0.1.0",
335
- "rightkit-control": "0.1.9",
337
+ "rightkit-control": "0.1.11",
336
338
  "rightkit-crash": "0.2.0",
337
339
  "rightkit-db": "0.3.2",
338
340
  "rightkit-embed": "0.3.1",
@@ -387,7 +389,7 @@
387
389
  "@rightkit/platform-ui": "0.2.0",
388
390
  "@rightkit/qa": "0.4.0",
389
391
  "@rightkit/qa-chrome": "0.1.3",
390
- "@rightkit/release": "0.2.143",
392
+ "@rightkit/release": "0.2.145",
391
393
  "@rightkit/settings-ui": "0.3.0",
392
394
  "@rightkit/shell": "0.1.0",
393
395
  "@rightkit/tauri": "0.2.0",
@@ -503,7 +505,9 @@
503
505
  "rightkit-control": [
504
506
  "0.1.6",
505
507
  "0.1.7",
506
- "0.1.8"
508
+ "0.1.8",
509
+ "0.1.9",
510
+ "0.1.10"
507
511
  ],
508
512
  "rightkit-secrets": [
509
513
  "0.1.0",
@@ -29,7 +29,7 @@ export function windowsStageOptions({ config, base }) {
29
29
  const w = config.windows;
30
30
  if (!w?.exe || !w?.out) throw fail("SWIFT_PACKAGE_CONFIG", "windows.exe and windows.out are required");
31
31
  return { exe: rel(base, w.exe), out: rel(base, w.stageDir ?? `${w.out}.stage`), searchDirs: relList(base, w.searchDirs),
32
- include: relList(base, w.include), systemDlls: w.systemDlls, dependencies: w.dependencies, architecture: w.architecture };
32
+ include: relList(base, w.include), systemDlls: w.systemDlls, dependencies: w.dependencies, architecture: w.architecture, subsystem: w.subsystem };
33
33
  }
34
34
 
35
35
  export function msixOptions({ config, base }, staged) {
@@ -41,7 +41,9 @@ function findInDirs(name, dirs) {
41
41
  * systemDlls[] (extra allowed), dependencies[{ name, provides[] }], architecture }
42
42
  * Returns a manifest; throws SWIFT_STAGE_UNRESOLVED listing every missing DLL.
43
43
  */
44
- export function stageSwiftWindows({ exe, out, searchDirs = [], include = [], systemDlls = [], dependencies = [], architecture, clean = true } = {}) {
44
+ const PE_SUBSYSTEMS = { gui: 2, console: 3 };
45
+
46
+ export function stageSwiftWindows({ exe, out, searchDirs = [], include = [], systemDlls = [], dependencies = [], architecture, subsystem, clean = true } = {}) {
45
47
  if (!exe || !out) throw fail("SWIFT_STAGE_OPTIONS", "exe and out are required");
46
48
  exe = path.resolve(exe); out = path.resolve(out);
47
49
  if (!/\.exe$/i.test(exe) || !existsSync(exe) || !statSync(exe).isFile()) throw fail("SWIFT_STAGE_OPTIONS", `exe must be an existing .exe: ${exe}`);
@@ -71,6 +73,14 @@ export function stageSwiftWindows({ exe, out, searchDirs = [], include = [], sys
71
73
  const info = readPeImports(readFileSync(item.source));
72
74
  if (!["x64", "arm64"].includes(info.architecture)) throw fail("SWIFT_STAGE_ARCH", `${item.source} is ${info.architecture}; only x64 and arm64 are supported`);
73
75
  arch ??= info.architecture;
76
+ if (item.from === "<root>" && subsystem) {
77
+ const want = PE_SUBSYSTEMS[subsystem];
78
+ if (!want) throw fail("SWIFT_STAGE_OPTIONS", `windows.subsystem must be "gui" or "console", got ${JSON.stringify(subsystem)}`);
79
+ if (info.subsystem !== want) {
80
+ throw fail("SWIFT_STAGE_SUBSYSTEM", `${item.source} has PE subsystem ${info.subsystem}, expected ${want} (${subsystem})` +
81
+ (subsystem === "gui" ? "; link with -Xlinker /SUBSYSTEM:WINDOWS -Xlinker /ENTRY:mainCRTStartup so launching it opens no console window" : ""));
82
+ }
83
+ }
74
84
  if (info.architecture !== arch) throw fail("SWIFT_STAGE_ARCH", `${item.source} is ${info.architecture} but package architecture is ${arch}`);
75
85
  for (const dep of [...info.imports, ...info.delayImports]) {
76
86
  const dk = lower(dep);
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { existsSync, mkdirSync, writeFileSync } from "node:fs";
2
+ import { createHash } from "node:crypto";
3
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
4
  import path from "node:path";
4
5
  import { spawnSync } from "./background-process.mjs";
5
6
  import { pathToFileURL } from "node:url";
@@ -9,6 +10,7 @@ import { verifySealedRelease } from "./release-state.mjs";
9
10
  import { assertCleanSource } from "./source-gate.mjs";
10
11
  import { verifyOwnershipEvidence } from "./ownership-evidence.mjs";
11
12
  import { recordPublishedVersion } from "./artifact-storage.mjs";
13
+ import { assertInstalledQaAdmission } from "./release-qa-receipt.mjs";
12
14
 
13
15
  const args = process.argv.slice(2);
14
16
  let platform = process.platform === "win32" ? "win" : process.platform === "darwin" ? "mac" : process.platform;
@@ -58,6 +60,11 @@ if (!configuredRepo) fail("release config distribution.repository is required fo
58
60
  if (repo && repo !== configuredRepo) fail(`--repo must match configured distribution.repository (${configuredRepo})`);
59
61
  repo = configuredRepo;
60
62
 
63
+ // Hardening step 4: installed QA on these exact artifact hashes and commit must have passed before any upload.
64
+ if (!dryRun) {
65
+ try { assertInstalledQaAdmission({ repoRoot, manifest: sealed.manifest, platform, configName: path.relative(process.cwd(), configPath) || configName, releaseConfigSha256: createHash("sha256").update(readFileSync(configPath)).digest("hex") }); }
66
+ catch (error) { if (error?.code !== "QA_ADMISSION_REFUSED") throw error; fail(error.message); }
67
+ }
61
68
  const stateRoot = path.join(repoRoot, ".right-release", "state", releaseId, platformDir);
62
69
  const verifiedMarker = path.join(stateRoot, `verified-${tier}-github-releases.json`);
63
70
  if (existsSync(verifiedMarker)) {