@rightkit/release 0.6.51 → 0.6.54

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 (89) hide show
  1. package/README.md +1 -1
  2. package/adapter-env.mjs +16 -105
  3. package/admission-host.mjs +14 -1
  4. package/bin/darwin/rightkit-swap +0 -0
  5. package/bin/rightkit-gate.mjs +609 -404
  6. package/broker-admission.mjs +122 -2
  7. package/build-launch.mjs +52 -58
  8. package/build-release.mjs +2 -2
  9. package/cargo-ledger.mjs +24 -5
  10. package/cargo-target-shim.mjs +54 -23
  11. package/cargo-target.mjs +2 -2
  12. package/carried-adapter-run.mjs +7 -8
  13. package/carried-cargo-run.mjs +1 -1
  14. package/ci-compile-admission.mjs +1 -1
  15. package/clippy-route.mjs +65 -18
  16. package/compile-inputs.mjs +91 -15
  17. package/cross-targets.mjs +5 -3
  18. package/deps-cargo-lock.mjs +1 -1
  19. package/deterministic-scans.mjs +789 -259
  20. package/development.mjs +33 -7
  21. package/direct-receipt.mjs +3 -5
  22. package/feature-coverage.mjs +45 -9
  23. package/feature-partition.mjs +204 -0
  24. package/feature-sets.mjs +113 -0
  25. package/gate-acceptance.mjs +187 -115
  26. package/gate-seam.mjs +352 -0
  27. package/gate-serve.mjs +34 -2
  28. package/gate-stages.mjs +6 -2
  29. package/ghsa-audit.mjs +19 -4
  30. package/heavy-command.mjs +5 -4
  31. package/install-tauri-authenticode.mjs +73 -4
  32. package/ios-dev.mjs +3 -3
  33. package/ios-package-recipe.mjs +6 -6
  34. package/linux-setup.mjs +3 -2
  35. package/local-publish.mjs +113 -17
  36. package/lock-identity.mjs +24 -100
  37. package/managed-cargo.mjs +3 -3
  38. package/managed-root-guard.mjs +2 -2
  39. package/managed-roots.mjs +3 -3
  40. package/native-adapters.mjs +41 -244
  41. package/native-helpers.mjs +1 -1
  42. package/pack-digest.mjs +1 -1
  43. package/package-recipe-targets.mjs +3 -3
  44. package/package.json +2 -2
  45. package/publication-gate.mjs +29 -6
  46. package/publish-cargo.mjs +4 -5
  47. package/publish-local-cargo.mjs +77 -1
  48. package/qualification-verify.mjs +76 -49
  49. package/receipt-signature.mjs +104 -0
  50. package/release-switch-registry.json +4 -0
  51. package/release-switch-scan.mjs +13 -10
  52. package/rightkit-versions.json +126 -113
  53. package/scan-digest.mjs +43 -14
  54. package/seam-broker.mjs +168 -0
  55. package/snapshot-check.mjs +4 -1
  56. package/snapshot-dependency-reuse.mjs +1 -1
  57. package/snapshot-metadata.mjs +24 -35
  58. package/snapshot.mjs +328 -49
  59. package/stage-commands.mjs +59 -5
  60. package/stage-ledger.mjs +2 -2
  61. package/{carried-cargo.mjs → stage-seam.mjs} +118 -70
  62. package/stage-sidecar.mjs +3 -3
  63. package/tauri-bundle-marker.mjs +5 -2
  64. package/tauri-locked.mjs +1 -1
  65. package/tool-build.mjs +8 -6
  66. package/unit-gate.mjs +40 -10
  67. package/web-build.mjs +6 -0
  68. package/broker-handshake.mjs +0 -160
  69. package/broker-wire.mjs +0 -278
  70. package/build-ownership.mjs +0 -1578
  71. package/cargo-shapes.mjs +0 -332
  72. package/cargo-width.mjs +0 -49
  73. package/carrier-census.mjs +0 -124
  74. package/clippy-equivalence.mjs +0 -202
  75. package/freshness-census.mjs +0 -405
  76. package/handle-revocation.mjs +0 -100
  77. package/handle-revocation.rust-vector.json +0 -1
  78. package/handle-revocation.vectors.json +0 -53
  79. package/legion-freeze-consumer.mjs +0 -241
  80. package/linux-qualifier.mjs +0 -83
  81. package/native-tool-planning.mjs +0 -94
  82. package/owner-process-proof.mjs +0 -14
  83. package/ownership-mark.mjs +0 -191
  84. package/ownership-recover.mjs +0 -78
  85. package/pnpm-adapter-grammar.mjs +0 -226
  86. package/provenance-verify.mjs +0 -413
  87. package/snapshot-broker.mjs +0 -808
  88. package/snapshot-request.mjs +0 -722
  89. package/unit-list-compile.mjs +0 -356
package/README.md CHANGED
@@ -38,7 +38,7 @@ The module imports node builtins only (preflight runs with no `node_modules`), r
38
38
 
39
39
  `release-switch-scan.mjs` proves that release code cannot use an environment variable, argument, settings key or build flag to select a test mode, data root, executable, library, model or identity. The runtime half is `rightkit_daemon::mode`: a build without the `test-mode` cargo feature reads no override selector at all. Registry: `release-switch-registry.json` (forbidden features, the `RIGHTKIT-TEST-MODE-COMPILED` marker, deny names with their class). Apps add their own deny names under `releaseSwitches.forbid`. Selector classes: S1 test activation, S2 authority or identity override, S3 executable/library/model, S4 internal state or data root (S1-S4: forbidden, no allow-list), S5 user-content location (allowed, user gesture), S6 diagnostics/tuning (allowed, bounded value).
40
40
 
41
- 1. **Feature closure (authoritative)** - `release.mjs` runs `cargo tree -e features,no-dev --locked --target <triple>` in the app repository (`resolveFeatureClosure`; forwards the build command's `--features`/`--no-default-features`; manifest resolves `targets.<os>.cargoManifest` -> `releaseSwitches.manifest` -> `src-tauri/Cargo.toml` -> `Cargo.toml` and must exist; features are also read from package.json scripts the hooks run (up to three levels) plus `releaseSwitches.features`; no manifest fails with `release-switch-manifest-missing` unless the app sets `releaseSwitches.rust: false` (the only skip); a cargo failure fails a real release, a dry run reports it) and passes it to `featureClosureFindings(...)` and `commandSwitchFindings(argv)` refuse `test-mode`, `qa-native`, `dev-native`, `qa-control`, `dev-inspect` anywhere in the resolved graph (finding id `forbidden-feature <name>`). The binary marker below is secondary evidence only. `qa-build-features.mjs` also lists `test-mode` as a forbidden feature, including on a non-optional `rightkit-daemon` dependency. Two daemon host features are declarations rather than bans: `rightkit-daemon` `remote` is refused (`remote-feature-undeclared`) unless the app sets `releaseSwitches.remoteHost: true`, and the loopback feature `remote-loopback` (CodeRight's loopback HTTP + bearer host) is refused (`remote-loopback-undeclared`) unless the app sets `releaseSwitches.remoteLoopback: true`. Neither declaration covers the other; a `remote` reached only through `remote-loopback` in the `cargo tree` indentation is judged by the loopback rule, any other path to `remote` (a direct request, `testing`) still needs `remoteHost`, and a tree without indentation counts every `remote` as direct. Both values must be booleans.
41
+ 1. **Feature closure (authoritative)** - `release.mjs` runs `cargo tree -e features,no-dev --locked --target <triple>` in the app repository (`resolveFeatureClosure`; forwards the build command's `--features`/`--no-default-features`; manifest resolves `targets.<os>.cargoManifest` -> `releaseSwitches.manifest` -> `src-tauri/Cargo.toml` -> `Cargo.toml` and must exist; features are also read from package.json scripts the hooks run (up to three levels) plus `releaseSwitches.features`; no manifest fails with `release-switch-manifest-missing` unless the app sets `releaseSwitches.rust: false` (the only skip); a cargo failure fails a real release, a dry run reports it) and passes it to `featureClosureFindings(...)` and `commandSwitchFindings(argv)` refuse `test-mode`, `qa-native`, `dev-native`, `qa-control`, `dev-inspect` anywhere in the resolved graph (finding id `forbidden-feature <name>`). The binary marker below is secondary evidence only. `qa-build-features.mjs` also lists `test-mode` as a forbidden feature, including on a non-optional `rightkit-daemon` dependency. Two daemon host features are declarations rather than bans: `rightkit-daemon-remote` `remote` (rightkit-daemon's own `remote` until rightkit-daemon 0.7.0; its `link` and `relay` features are no host) is refused (`remote-feature-undeclared`) unless the app sets `releaseSwitches.remoteHost: true`, and the `rightkit-daemon` loopback feature `remote-loopback` (CodeRight's loopback HTTP + bearer host) is refused (`remote-loopback-undeclared`) unless the app sets `releaseSwitches.remoteLoopback: true`. Neither declaration covers the other; a `remote` reached only through `remote-loopback` in the `cargo tree` indentation is judged by the loopback rule, any other path to `remote` (a direct request, `testing`) still needs `remoteHost`, and a tree without indentation counts every `remote` as direct. Both values must be booleans.
42
42
  2. **Inventory completeness** - `sourceSwitchFindings` walks app source (Rust, TS/JS, Swift, C; not tests, fixtures, `node_modules`, `target`) and rejects an environment read whose name is not in `switches.json` (`unregistered-read`), a non-literal read in a file not listed under `dynamicReads` (`dynamic-read`), an S1-S4 entry without `compiledOut` (`not-compiled-out`), and a malformed inventory (`inventory-invalid`). Argument flags are enforced for deny-listed flags only.
43
43
  3. **Binary** - `scanSwitchPaths` / `bufferSwitchFindings` over Mach-O, PE and ELF files: the marker (`test-mode-capability`) and any deny name from S1-S4 (`release-switch-names`), each as Latin-1 and UTF-16LE. The receipt holds the sha256 and size of every scanned file; the caller adds source commit, target triple and resolved features.
44
44
 
package/adapter-env.mjs CHANGED
@@ -1,108 +1,44 @@
1
1
  // The request environment of a carried adapter call (rustright#190; rustright-cli shims.rs adapter_environment, rustright-policy adapter.rs
2
2
  // check_environment). A `rustright run <adapter> -- <args>` request carries exactly the variables named by RUSTRIGHT_ADAPTER_ENV (a comma
3
- // list), each set in the client's own environment; the broker accepts a name only when the adapter's registration lists it in `env` and it is
4
- // not reserved. The forwarded map is the request core's `env` (rustright-protocol attestation.rs request_core), so its values are bound into the
5
- // attested request digest the gate recomputes (snapshot-request.mjs snapshotRequestCore).
3
+ // list), each set in the client's own environment. The door (build-launch.mjs) sets RUSTRIGHT_ADAPTER_ENV for a step from the env the step itself declares
4
+ // (`adapterEnvLaunch`); the seam sends the step's environment to the client unchanged (stage-seam.mjs runStageAdapter).
6
5
  //
7
- // The door (build-launch.mjs) sets RUSTRIGHT_ADAPTER_ENV for a step from the env the step itself declares (`adapterEnvLaunch`); the carrier
8
- // (snapshot-broker.mjs carryBrokerAdapter) reads back what the client will forward (`forwardedAdapterEnv`), with the client's own refusals.
9
- import path from "node:path";
10
-
6
+ // What the gate no longer judges (plan section 4, "no adapter grammar"): whether a name is reserved or registered. The client refuses a reserved name before it
7
+ // sends (shims.rs adapter_environment, `is_reserved_env_key`), and the broker refuses a reserved or unregistered key, a signing-material key and a handoff path
8
+ // that is not absolute (RK_ADAPTER_ENV_DENIED, admission_impl.rs `admit_adapter` -> adapter.rs `check_environment`). What stays here is what no one else refuses:
9
+ // signing material and the signing-file path never ride the request, and the comma list the gate builds itself must be able to carry what it names.
11
10
  export const ADAPTER_ENV_VAR = "RUSTRIGHT_ADAPTER_ENV";
12
11
 
13
12
  /**
14
13
  * RA-08: the path of the transient Android signing-properties file (android-release.mjs ANDROID_SIGNING_PROPERTIES_ENV). It is a typed FILE handoff of the provisioned signer session (native-adapters.mjs
15
- * `signingFileProblem`, `nativeSigningFileRefusal`), never an adapter request environment: no adapter registers it (it is `RIGHTKIT_`-prefixed, so reserved), the door refuses a step that declares it, the
16
- * carrier's client never receives it, and `RUSTRIGHT_ADAPTER_ENV` never names it. Only the path exists in the environment of a direct host's own Gradle; the file holds the secrets.
14
+ * `signingFileProblem`, `nativeSigningFileRefusal`), never an adapter request environment: the door refuses a step that declares it, the carrier's client never receives it, and
15
+ * `RUSTRIGHT_ADAPTER_ENV` never names it. Only the path exists in the environment of a direct host's own Gradle; the file holds the secrets.
17
16
  */
18
17
  export const SIGNING_FILE_ENV = "RIGHTKIT_ANDROID_SIGNING_PROPERTIES";
19
18
  export const ADAPTER_ENV_SIGNING_FILE = "RK_ADAPTER_ENV_SIGNING_FILE";
20
19
  /** Whether `key` names the signing-properties file handoff (case-insensitive, as RustRight compares). */
21
20
  export const isSigningFileEnvKey = (key) => String(key).toUpperCase() === SIGNING_FILE_ENV;
22
21
 
23
- export const ADAPTER_ENV_RESERVED = "RK_ADAPTER_ENV_RESERVED";
24
22
  export const ADAPTER_ENV_UNSET = "RK_ADAPTER_ENV_UNSET";
25
23
  export const ADAPTER_ENV_INVALID = "RK_ADAPTER_ENV_INVALID";
26
24
 
27
- // rustright-policy adapter.rs RESERVED_ENV_KEYS and RESERVED_ENV_PREFIXES at rustright 7b24288, compared upper-case. The prefix list still holds
28
- // RIGHTKIT_ (marked legacy, "removed by task L-1"): until RustRight drops it, a RIGHTKIT_* name is refused by the broker and cannot be registered.
29
- const RESERVED_EXACT = new Set([
30
- "PATH", "PATHEXT", "HOME", "USERPROFILE", "TMPDIR", "TMP", "TEMP", "SYSTEMROOT", "COMSPEC", "SHELL", "BASH_ENV", "ENV", "PYTHONPATH", "PYTHONHOME",
31
- "PYTHONSTARTUP", "PYTHONUSERBASE", "PYTHONEXECUTABLE", "PYTHONINSPECT", "PYTHONSAFEPATH", "NODE_OPTIONS", "NODE_PATH", "RUBYOPT", "RUBYLIB", "GEM_HOME",
32
- "GEM_PATH", "PERL5LIB", "PERL5OPT", "PERLLIB", "JAVA_TOOL_OPTIONS", "_JAVA_OPTIONS", "JDK_JAVA_OPTIONS", "CLASSPATH", "GOFLAGS", "GOROOT", "DOTNET_ROOT",
33
- "DOTNET_STARTUP_HOOKS", "DOTNET_ADDITIONAL_DEPS", "ERL_FLAGS", "ERL_AFLAGS", "ERL_ZFLAGS", "ELIXIR_ERL_OPTIONS",
34
- ]);
35
- const RESERVED_PREFIXES = ["RUSTRIGHT_", "RIGHTKIT_", "LD_", "DYLD_", "CARGO", "RUST", "SCCACHE", "COR_", "CORECLR_", "DOTNET_HOST"];
36
-
37
25
  /**
38
26
  * GB-06 (BROKER-CONTRACT section 16): signing material never rides an adapter request. RustRight reserves `TAURI_SIGNING_*` (the empty value that suppresses signing included), the legacy
39
- * `TAURI_PRIVATE_KEY` and `TAURI_KEY_PASSWORD` (adapter.rs RESERVED_ENV_PREFIXES): they cannot be registered under an adapter's `env` and a request that names one is refused
40
- * (RK_ADAPTER_ENV_DENIED). Signing, the updater seal and their read-back stay in the provisioned signer session, so a carried Tauri build runs unsigned and RightKit seals outside the broker.
41
- * `TAURI_DEBUG` and the other Tauri variables are not signing material.
27
+ * `TAURI_PRIVATE_KEY` and `TAURI_KEY_PASSWORD` (adapter.rs RESERVED_ENV_PREFIXES), so the client and the broker refuse a request that names one. The gate refuses a step that declares one WITH a value
28
+ * before anything is launched, so the secret is never in a process environment the gate hands to the client, and a name the recipe sets EMPTY (it only suppresses signing in a direct session) is not
29
+ * forwarded rather than refused. Signing, the updater seal and their read-back stay in the provisioned signer session, so a carried Tauri build runs unsigned and RightKit seals outside the broker.
42
30
  */
43
31
  export const SIGNING_ENV_PREFIXES = Object.freeze(["TAURI_SIGNING_", "TAURI_PRIVATE_KEY", "TAURI_KEY_PASSWORD"]);
44
32
  export const ADAPTER_ENV_SIGNING = "RK_ADAPTER_ENV_SIGNING";
45
33
  /** Whether `key` is signing material (case-insensitive, as RustRight compares). */
46
34
  export const isSigningEnvKey = (key) => { const upper = String(key).toUpperCase(); return SIGNING_ENV_PREFIXES.some((prefix) => upper.startsWith(prefix)); };
47
- /** `env` without any signing variable: what a carried call's client process receives (the client forwards only what RUSTRIGHT_ADAPTER_ENV names, but it never needs these to exist). */
48
- export function withoutSigningEnv(env) {
49
- const out = { ...env };
50
- for (const key of Object.keys(out)) if (isSigningEnvKey(key) || isSigningFileEnvKey(key)) delete out[key];
51
- return out;
52
- }
53
35
 
54
36
  /**
55
37
  * The signed-artifact handoff (GB-05; adapter.rs QA_HANDOFF_ENV): the sign step's two outputs reach a consumer under exactly these two names. They are
56
- * not secrets and not broker-owned, so the broker exempts exactly these two from the reserved RIGHTKIT_ prefix; they must be registered in the adapter's
57
- * `env` and carry an absolute path with no `..`.
38
+ * not secrets and not broker-owned; the broker exempts exactly these two from the reserved RIGHTKIT_ prefix, requires them registered in the adapter's `env`
39
+ * and requires an absolute path with no `..` (adapter.rs check_environment).
58
40
  */
59
41
  export const QA_HANDOFF_ENV = Object.freeze(["RIGHTKIT_QA_APP_BINARY", "RIGHTKIT_QA_SIGNING_EVIDENCE"]);
60
- export const isQaHandoffKey = (key) => QA_HANDOFF_ENV.includes(String(key).toUpperCase());
61
- export const ADAPTER_ENV_UNREGISTERED = "RK_ADAPTER_ENV_UNREGISTERED";
62
- export const ADAPTER_ENV_HANDOFF_PATH = "RK_ADAPTER_ENV_HANDOFF_PATH";
63
-
64
- /** Whether the broker refuses `key` in a request environment (adapter.rs is_reserved_env_key, case-insensitive; the QA handoff names are exempt). */
65
- export function isReservedAdapterEnvKey(key) {
66
- const upper = String(key).toUpperCase();
67
- if (isQaHandoffKey(upper)) return false;
68
- return upper === "" || upper.includes("=") || RESERVED_EXACT.has(upper) || RESERVED_PREFIXES.some((prefix) => upper.startsWith(prefix)) || isSigningEnvKey(upper);
69
- }
70
-
71
- /**
72
- * The candidate registration manifest of the request-environment keys, per adapter (GB-04): the inventory of every non-reserved key the gate's planners
73
- * send, by step. Each adapter's registration must list exactly these in its `env`; the installed registration must equal this manifest, and a key outside
74
- * it refuses at planning, before any process. `pnpm` is the reference registration RustRight published (docs/contracts/adapter-argv.fixtures.json
75
- * `adapter.env`); `node` takes the same keys (a step script reads the test knob and the signed handoff); `swift` takes none (the gate sends no environment
76
- * to a SwiftPM job).
77
- * RK_ISOLATED_CHECKOUT test knob of a broker-admitted test row (right-suite-contract.test.mjs, release-exports.test.mjs): "1" runs it from an isolated checkout
78
- * RIGHTKIT_QA_APP_BINARY / RIGHTKIT_QA_SIGNING_EVIDENCE the signed-artifact handoff (GB-05), set by the sign step only
79
- */
80
- export const ADAPTER_ENV_MANIFEST = Object.freeze({
81
- "rightkit-pnpm": Object.freeze(["RK_ISOLATED_CHECKOUT", ...QA_HANDOFF_ENV]),
82
- "rightkit-node": Object.freeze(["RK_ISOLATED_CHECKOUT", ...QA_HANDOFF_ENV]),
83
- "rightkit-swift": Object.freeze([]),
84
- // GB-51: the native-tool adapters take no request environment (a step's own environment is refused before launch, naming the key).
85
- "rightkit-xcodegen": Object.freeze([]), "rightkit-xcodebuild": Object.freeze([]), "rightkit-gradle": Object.freeze([]), "rightkit-cmake": Object.freeze([]),
86
- });
87
-
88
- /**
89
- * Why the broker would refuse this request environment for an adapter whose registration lists `registered` (adapter.rs `check_environment`), or null: a
90
- * reserved key (broker-controlled, loader or interpreter path), a signed-artifact handoff key whose value is not an absolute path with no `..`, and any key the
91
- * registration does not list. One refusal names every unregistered key and the registered set; nothing is dropped silently.
92
- */
93
- export function adapterEnvRefusal(env, registered) {
94
- const keys = Object.keys(env ?? {});
95
- const reserved = keys.find((key) => isReservedAdapterEnvKey(key));
96
- if (reserved !== undefined) return { code: ADAPTER_ENV_RESERVED, message: `environment key ${JSON.stringify(reserved)} is broker-controlled or redirects code loading, so no adapter request may carry it (reserved: RUSTRIGHT_*, RIGHTKIT_* except the two signed-artifact handoff names, CARGO*, RUST*, PATH, loader and interpreter-path variables)` };
97
- const listed = new Set((registered ?? []).map(String));
98
- for (const key of keys) {
99
- const value = String(env[key]);
100
- if (isQaHandoffKey(key) && listed.has(key) && !(isAbsolutePath(value) && !value.split(/[\\/]/).includes(".."))) return { code: ADAPTER_ENV_HANDOFF_PATH, message: `environment key ${JSON.stringify(key)} must be an absolute path with no '..' (the signed artifact's exact path)` };
101
- }
102
- const unregistered = keys.filter((key) => !listed.has(key));
103
- if (unregistered.length === 0) return null;
104
- return { code: ADAPTER_ENV_UNREGISTERED, message: `environment key(s) ${unregistered.map((k) => JSON.stringify(k)).join(", ")} are not registered for this adapter (registered: ${[...listed].sort().join(", ") || "none"}); register the key in the adapter's \`env\` (the candidate manifest is ADAPTER_ENV_MANIFEST) or remove it from the step; nothing is dropped to make the call pass` };
105
- }
106
42
 
107
43
  function fail(code, message) {
108
44
  const error = new Error(`${code}: ${message}`);
@@ -110,16 +46,15 @@ function fail(code, message) {
110
46
  throw error;
111
47
  }
112
48
 
113
- const isAbsolutePath = (value) => path.isAbsolute(value) || path.posix.isAbsolute(value) || path.win32.isAbsolute(value);
114
49
  const validName = (name) => typeof name === "string" && name !== "" && !/[,=\0\s]/.test(name);
115
50
  const validValue = (value) => typeof value === "string" && !value.includes("\0");
116
51
 
117
52
  /**
118
53
  * What the door adds to a carried adapter step's launch environment for the env the step declares: `{}` for none (no RUSTRIGHT_ADAPTER_ENV at
119
- * all), else RUSTRIGHT_ADAPTER_ENV naming exactly the step's variables, plus those variables with their values. A reserved name, a name that
120
- * cannot ride a comma list, a declared name with no value, or a value that is not a string is refused with a coded error.
54
+ * all), else RUSTRIGHT_ADAPTER_ENV naming exactly the step's variables, plus those variables with their values. A signing-material name with a value, the signing-file handoff, a name that
55
+ * cannot ride a comma list, a declared name with no value, or a value that is not a string is refused with a coded error. Reserved and unregistered names are the client's and the broker's to refuse.
121
56
  */
122
- export function adapterEnvLaunch(stepEnv, { registered = null } = {}) {
57
+ export function adapterEnvLaunch(stepEnv) {
123
58
  // GB-06: signing material is never forwarded. A signing variable the step declares with a value is material and refuses the step at planning (the name, never the value, is reported); one the
124
59
  // recipe sets EMPTY only suppresses signing in a direct session, carries nothing, and is not forwarded (the carried build runs unsigned; the seal is made outside the broker).
125
60
  const declared = Object.keys(stepEnv ?? {});
@@ -132,34 +67,10 @@ export function adapterEnvLaunch(stepEnv, { registered = null } = {}) {
132
67
  const launch = (value) => { if (droppedSigning.length) Object.defineProperty(value, "signingEnvDropped", { value: droppedSigning, enumerable: false }); return value; };
133
68
  if (names.length === 0) return launch({});
134
69
  for (const name of names) {
135
- if (isReservedAdapterEnvKey(name)) fail(ADAPTER_ENV_RESERVED, `step env ${JSON.stringify(name)} is broker-controlled or redirects code loading, so no adapter request may carry it (reserved: RUSTRIGHT_*, RIGHTKIT_* except the two signed-artifact handoff names, CARGO*, RUST*, loader and interpreter-path variables)`);
136
70
  if (!validName(name)) fail(ADAPTER_ENV_INVALID, `step env name ${JSON.stringify(name)} cannot be forwarded to an adapter`);
137
71
  const value = stepEnv[name];
138
72
  if (value === undefined || value === null) fail(ADAPTER_ENV_UNSET, `step env ${name} is declared but has no value`);
139
73
  if (!validValue(String(value))) fail(ADAPTER_ENV_INVALID, `step env ${name} has a value that cannot be forwarded`);
140
74
  }
141
- // GB-04: judged against the adapter's registration (its `env`) before anything is launched; one refusal names every unregistered key.
142
- if (registered !== null) {
143
- const refusal = adapterEnvRefusal(Object.fromEntries(names.map((name) => [name, String(stepEnv[name])])), registered);
144
- if (refusal) fail(refusal.code, refusal.message);
145
- }
146
75
  return launch({ [ADAPTER_ENV_VAR]: names.join(","), ...Object.fromEntries(names.map((name) => [name, String(stepEnv[name])])) });
147
76
  }
148
-
149
- /**
150
- * The map the RustRight client forwards for a call run with `env` (shims.rs adapter_environment): each name in RUSTRIGHT_ADAPTER_ENV, its value
151
- * from `env`. A reserved name, or a named variable that is not set, is refused (the client refuses the same two ways).
152
- */
153
- export function forwardedAdapterEnv(env) {
154
- const raw = env?.[ADAPTER_ENV_VAR] ?? "";
155
- const forwarded = {};
156
- for (const name of String(raw).split(",").map((part) => part.trim()).filter(Boolean)) {
157
- if (isSigningFileEnvKey(name)) fail(ADAPTER_ENV_SIGNING_FILE, `${ADAPTER_ENV_VAR} names ${name}, the signing-properties file handoff: its path is never forwarded as an adapter request environment`);
158
- if (isSigningEnvKey(name)) fail(ADAPTER_ENV_SIGNING, `${ADAPTER_ENV_VAR} names ${name}, which is signing material and is never forwarded to an adapter (signing stays in the provisioned signer session)`);
159
- if (isReservedAdapterEnvKey(name)) fail(ADAPTER_ENV_RESERVED, `${ADAPTER_ENV_VAR} names ${name}, which is broker-controlled and cannot be forwarded to an adapter`);
160
- const value = env[name];
161
- if (value === undefined) fail(ADAPTER_ENV_UNSET, `${ADAPTER_ENV_VAR} names ${name}, which is not set`);
162
- forwarded[name] = String(value);
163
- }
164
- return forwarded;
165
- }
@@ -3,7 +3,9 @@
3
3
  // env, spawn and file system, and says NOT RUN with its reason when the probe cannot run on this host (a Windows probe on a Mac).
4
4
  // NOT RUN is never a pass. Real-credential acceptance runs on the Mac and the Dell; the unit tests use fakes.
5
5
  import { readFileSync } from "node:fs";
6
+ import os from "node:os";
6
7
  import path from "node:path";
8
+ import { PROTECTED_SECRETS, protectedSecretStoreCommand } from "./protected-credentials.mjs";
7
9
  import { brokerManagedHost } from "./cargo-contract.mjs";
8
10
  import { CredentialProviderError, providerPlatformOf, updaterCredentialProvider } from "./credential-provider.mjs";
9
11
  import { ManagedHostEnvSecretError, isManagedHost } from "./managed-host-secrets.mjs";
@@ -227,10 +229,21 @@ export const HOST_ROWS = Object.freeze([
227
229
  run(ctx) {
228
230
  if (!signsUpdater(ctx)) return { na: "the target does not sign updater artifacts" };
229
231
  if (providerPlatformOf(ctx.hostPlatform) !== ctx.platform) return { notRun: `the updater credential provider is resolved on the ${ctx.platform === "win" ? "Windows" : "Mac"} host that signs` };
230
- try { updaterCredentialProvider({ env: ctx.env, hostPlatform: ctx.hostPlatform }); } catch (error) {
232
+ let provider;
233
+ try { provider = updaterCredentialProvider({ env: ctx.env, hostPlatform: ctx.hostPlatform }).file; } catch (error) {
231
234
  if (error instanceof CredentialProviderError) return [error.message];
232
235
  throw error;
233
236
  }
237
+ // The key itself, not only the provider: a Windows host with the provider enrolled and no key stored passed this row and failed after the whole build,
238
+ // at sign-updater ("invalid credential: not found"; HeardRight on the Dell, 2026-11-10). `status` reports presence only and never reads the secret.
239
+ if (ctx.hostPlatform === "win32") {
240
+ const account = os.userInfo().username;
241
+ const asked = ctx.spawn(provider, ["status", "--namespace", PROTECTED_SECRETS["updater-signing-key"].keychain, "--account", account], { encoding: "utf8", windowsHide: true, shell: false });
242
+ let present = null;
243
+ try { present = JSON.parse(String(asked.stdout ?? "")).present; } catch { present = null; }
244
+ if (present === false) return [`the updater signing key is not in this host's credential store (account ${account}); store it once with: ${protectedSecretStoreCommand("updater-signing-key", "win32", { provider, env: ctx.env })}`];
245
+ if (present !== true) return [`the credential provider could not report whether the updater signing key is stored (exit ${asked.status ?? "unavailable"})`];
246
+ }
234
247
  return undefined;
235
248
  },
236
249
  },
Binary file