release-skill 0.9.0 → 0.9.3

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 (165) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codebuddy-plugin/plugin.json +1 -1
  4. package/.codex-plugin/plugin.json +2 -2
  5. package/.kimi-plugin/plugin.json +1 -1
  6. package/CHANGELOG.md +81 -0
  7. package/INSTALL.md +22 -9
  8. package/INSTALL.zh-CN.md +15 -8
  9. package/README.md +40 -35
  10. package/README.zh-CN.md +31 -29
  11. package/adapters/claude/.claude-plugin/marketplace.json +1 -1
  12. package/adapters/claude/.claude-plugin/plugin.json +1 -1
  13. package/adapters/claude/bin/consumer-contract-vectors.json +110 -0
  14. package/adapters/claude/bin/error-codes.json +8 -1
  15. package/adapters/claude/bin/foundation-resource-binding.json +1 -1
  16. package/adapters/claude/bin/registry.json +22 -1
  17. package/adapters/claude/bin/release-skill.bundle.mjs +4772 -2238
  18. package/adapters/claude/bin/rules.json +1 -1
  19. package/adapters/claude/bin/schemas/consumer-contract-vector.schema.json +149 -0
  20. package/adapters/claude/schemas/release-project.schema.json +4 -0
  21. package/adapters/claude/schemas/release-run.schema.json +41 -1
  22. package/adapters/claude/skills/release-config/SKILL.md +5 -3
  23. package/adapters/claude/skills/release-docs/SKILL.md +4 -2
  24. package/adapters/claude/skills/release-finish/SKILL.md +6 -4
  25. package/adapters/claude/skills/release-help/SKILL.md +14 -5
  26. package/adapters/claude/skills/release-marketplace/SKILL.md +3 -1
  27. package/adapters/claude/skills/release-prepare/SKILL.md +4 -2
  28. package/adapters/claude/skills/release-publish/SKILL.md +19 -10
  29. package/adapters/claude/skills/release-verify/SKILL.md +2 -0
  30. package/adapters/claude/src/schemas/executable-identity-observation.schema.json +162 -0
  31. package/adapters/claude/src/schemas/filesystem-tree-observation.schema.json +18 -2
  32. package/adapters/claude/src/schemas/migration-manifest.schema.json +271 -7
  33. package/adapters/claude/src/schemas/plugin-verification-request.schema.json +147 -22
  34. package/adapters/claude/src/schemas/plugin-verification-result.schema.json +436 -18
  35. package/adapters/claude/src/schemas/profile-adoption-declaration.schema.json +8 -0
  36. package/adapters/claude/src/schemas/skill-family-directory-verification-request.schema.json +100 -0
  37. package/adapters/claude/src/schemas/skill-family-directory-verification-result.schema.json +193 -0
  38. package/adapters/codex/.codex-plugin/plugin.json +2 -2
  39. package/adapters/codex/bin/consumer-contract-vectors.json +110 -0
  40. package/adapters/codex/bin/error-codes.json +8 -1
  41. package/adapters/codex/bin/foundation-resource-binding.json +1 -1
  42. package/adapters/codex/bin/registry.json +22 -1
  43. package/adapters/codex/bin/release-skill.bundle.mjs +4772 -2238
  44. package/adapters/codex/bin/rules.json +1 -1
  45. package/adapters/codex/bin/schemas/consumer-contract-vector.schema.json +149 -0
  46. package/adapters/codex/schemas/release-project.schema.json +4 -0
  47. package/adapters/codex/schemas/release-run.schema.json +41 -1
  48. package/adapters/codex/skills/release-config/SKILL.md +5 -3
  49. package/adapters/codex/skills/release-docs/SKILL.md +4 -2
  50. package/adapters/codex/skills/release-finish/SKILL.md +6 -4
  51. package/adapters/codex/skills/release-help/SKILL.md +14 -5
  52. package/adapters/codex/skills/release-marketplace/SKILL.md +3 -1
  53. package/adapters/codex/skills/release-prepare/SKILL.md +4 -2
  54. package/adapters/codex/skills/release-publish/SKILL.md +19 -10
  55. package/adapters/codex/skills/release-verify/SKILL.md +2 -0
  56. package/adapters/codex/src/schemas/executable-identity-observation.schema.json +162 -0
  57. package/adapters/codex/src/schemas/filesystem-tree-observation.schema.json +18 -2
  58. package/adapters/codex/src/schemas/migration-manifest.schema.json +271 -7
  59. package/adapters/codex/src/schemas/plugin-verification-request.schema.json +147 -22
  60. package/adapters/codex/src/schemas/plugin-verification-result.schema.json +436 -18
  61. package/adapters/codex/src/schemas/profile-adoption-declaration.schema.json +8 -0
  62. package/adapters/codex/src/schemas/skill-family-directory-verification-request.schema.json +100 -0
  63. package/adapters/codex/src/schemas/skill-family-directory-verification-result.schema.json +193 -0
  64. package/adapters/kimi/.kimi-plugin/plugin.json +1 -1
  65. package/adapters/kimi/bin/consumer-contract-vectors.json +110 -0
  66. package/adapters/kimi/bin/error-codes.json +8 -1
  67. package/adapters/kimi/bin/foundation-resource-binding.json +1 -1
  68. package/adapters/kimi/bin/registry.json +22 -1
  69. package/adapters/kimi/bin/release-skill.bundle.mjs +4772 -2238
  70. package/adapters/kimi/bin/rules.json +1 -1
  71. package/adapters/kimi/bin/schemas/consumer-contract-vector.schema.json +149 -0
  72. package/adapters/kimi/schemas/release-project.schema.json +4 -0
  73. package/adapters/kimi/schemas/release-run.schema.json +41 -1
  74. package/adapters/kimi/skills/release-config/SKILL.md +5 -3
  75. package/adapters/kimi/skills/release-docs/SKILL.md +4 -2
  76. package/adapters/kimi/skills/release-finish/SKILL.md +6 -4
  77. package/adapters/kimi/skills/release-help/SKILL.md +14 -5
  78. package/adapters/kimi/skills/release-marketplace/SKILL.md +3 -1
  79. package/adapters/kimi/skills/release-prepare/SKILL.md +4 -2
  80. package/adapters/kimi/skills/release-publish/SKILL.md +19 -10
  81. package/adapters/kimi/skills/release-verify/SKILL.md +2 -0
  82. package/adapters/kimi/src/schemas/executable-identity-observation.schema.json +162 -0
  83. package/adapters/kimi/src/schemas/filesystem-tree-observation.schema.json +18 -2
  84. package/adapters/kimi/src/schemas/migration-manifest.schema.json +271 -7
  85. package/adapters/kimi/src/schemas/plugin-verification-request.schema.json +147 -22
  86. package/adapters/kimi/src/schemas/plugin-verification-result.schema.json +436 -18
  87. package/adapters/kimi/src/schemas/profile-adoption-declaration.schema.json +8 -0
  88. package/adapters/kimi/src/schemas/skill-family-directory-verification-request.schema.json +100 -0
  89. package/adapters/kimi/src/schemas/skill-family-directory-verification-result.schema.json +193 -0
  90. package/adapters/workbuddy/.codebuddy-plugin/plugin.json +1 -1
  91. package/adapters/workbuddy/bin/consumer-contract-vectors.json +110 -0
  92. package/adapters/workbuddy/bin/error-codes.json +8 -1
  93. package/adapters/workbuddy/bin/foundation-resource-binding.json +1 -1
  94. package/adapters/workbuddy/bin/registry.json +22 -1
  95. package/adapters/workbuddy/bin/release-skill.bundle.mjs +4772 -2238
  96. package/adapters/workbuddy/bin/rules.json +1 -1
  97. package/adapters/workbuddy/bin/schemas/consumer-contract-vector.schema.json +149 -0
  98. package/adapters/workbuddy/schemas/release-project.schema.json +4 -0
  99. package/adapters/workbuddy/schemas/release-run.schema.json +41 -1
  100. package/adapters/workbuddy/skills/release-config/SKILL.md +5 -3
  101. package/adapters/workbuddy/skills/release-docs/SKILL.md +4 -2
  102. package/adapters/workbuddy/skills/release-finish/SKILL.md +6 -4
  103. package/adapters/workbuddy/skills/release-help/SKILL.md +14 -5
  104. package/adapters/workbuddy/skills/release-marketplace/SKILL.md +3 -1
  105. package/adapters/workbuddy/skills/release-prepare/SKILL.md +4 -2
  106. package/adapters/workbuddy/skills/release-publish/SKILL.md +19 -10
  107. package/adapters/workbuddy/skills/release-verify/SKILL.md +2 -0
  108. package/adapters/workbuddy/src/schemas/executable-identity-observation.schema.json +162 -0
  109. package/adapters/workbuddy/src/schemas/filesystem-tree-observation.schema.json +18 -2
  110. package/adapters/workbuddy/src/schemas/migration-manifest.schema.json +271 -7
  111. package/adapters/workbuddy/src/schemas/plugin-verification-request.schema.json +147 -22
  112. package/adapters/workbuddy/src/schemas/plugin-verification-result.schema.json +436 -18
  113. package/adapters/workbuddy/src/schemas/profile-adoption-declaration.schema.json +8 -0
  114. package/adapters/workbuddy/src/schemas/skill-family-directory-verification-request.schema.json +100 -0
  115. package/adapters/workbuddy/src/schemas/skill-family-directory-verification-result.schema.json +193 -0
  116. package/bin/consumer-contract-vectors.json +110 -0
  117. package/bin/error-codes.json +8 -1
  118. package/bin/foundation-resource-binding.json +1 -1
  119. package/bin/registry.json +22 -1
  120. package/bin/release-skill-cli.mjs +72 -4
  121. package/bin/release-skill.bundle.mjs +4772 -2238
  122. package/bin/rules.json +1 -1
  123. package/bin/schemas/consumer-contract-vector.schema.json +149 -0
  124. package/package.json +5 -5
  125. package/platform-manifest.json +5 -5
  126. package/references/01-state-machine.md +16 -1
  127. package/references/05-evidence-and-errors.md +2 -2
  128. package/schemas/release-project.schema.json +4 -0
  129. package/schemas/release-run.schema.json +41 -1
  130. package/skills/release-config/SKILL.md +5 -3
  131. package/skills/release-docs/SKILL.md +4 -2
  132. package/skills/release-finish/SKILL.md +6 -4
  133. package/skills/release-help/SKILL.md +14 -5
  134. package/skills/release-marketplace/SKILL.md +3 -1
  135. package/skills/release-prepare/SKILL.md +4 -2
  136. package/skills/release-publish/SKILL.md +19 -10
  137. package/skills/release-verify/SKILL.md +2 -0
  138. package/skills-src/release-config/SKILL.md +5 -3
  139. package/skills-src/release-docs/SKILL.md +4 -2
  140. package/skills-src/release-finish/SKILL.md +6 -4
  141. package/skills-src/release-help/SKILL.md +14 -5
  142. package/skills-src/release-marketplace/SKILL.md +3 -1
  143. package/skills-src/release-prepare/SKILL.md +4 -2
  144. package/skills-src/release-publish/SKILL.md +19 -10
  145. package/skills-src/release-verify/SKILL.md +2 -0
  146. package/src/commands/post-release-local.mjs +249 -58
  147. package/src/commands/prepare.mjs +178 -9
  148. package/src/commands/route.mjs +597 -18
  149. package/src/commands/setup.mjs +2 -0
  150. package/src/commands/ship.mjs +143 -16
  151. package/src/commands/verify.mjs +21 -0
  152. package/src/core/adoption-assessment.mjs +59 -0
  153. package/src/core/derived-artifact-gates.mjs +32 -5
  154. package/src/core/foundation-plugin-verification.mjs +213 -1
  155. package/src/core/hook-cache.mjs +318 -26
  156. package/src/core/hooks.mjs +8 -1
  157. package/src/producers/foundation-resource-projection.mjs +16 -3
  158. package/src/schemas/executable-identity-observation.schema.json +162 -0
  159. package/src/schemas/filesystem-tree-observation.schema.json +18 -2
  160. package/src/schemas/migration-manifest.schema.json +271 -7
  161. package/src/schemas/plugin-verification-request.schema.json +147 -22
  162. package/src/schemas/plugin-verification-result.schema.json +436 -18
  163. package/src/schemas/profile-adoption-declaration.schema.json +8 -0
  164. package/src/schemas/skill-family-directory-verification-request.schema.json +100 -0
  165. package/src/schemas/skill-family-directory-verification-result.schema.json +193 -0
@@ -25,7 +25,7 @@ import { promisify } from 'node:util';
25
25
 
26
26
  const execFile = promisify(execFileCb);
27
27
 
28
- import { classifyPathInput, writeFileAtomic } from 'skill-family-harness-node';
28
+ import { classifyPathInput, writeFileAtomic, withTemporaryWorkspace } from 'skill-family-harness-node';
29
29
  import { loadProjectConfig } from '../core/config.mjs';
30
30
  import { captureBaseline } from '../core/baseline.mjs';
31
31
  import { runHook } from '../core/hooks.mjs';
@@ -57,7 +57,11 @@ import {
57
57
  } from '../snapshot/frozen.mjs';
58
58
  import { ReleaseError, GATE_FAILED, CONFIG_INVALID, CONFIG_MISSING, FORBIDDEN_CONTENT_DETECTED, RELEASE_DOCS_STALE, DIRTY_SOURCE_INPUT, BUNDLE_STALE } from '../core/errors.mjs';
59
59
  import { assertBundleFreshness } from '../core/bundle-freshness.mjs';
60
- import { assertAdapterFreshness, assertSelfBootstrapFacts } from '../core/derived-artifact-gates.mjs';
60
+ import {
61
+ assertAdapterFreshness,
62
+ assertPlatformManifestFreshness,
63
+ assertSelfBootstrapFacts,
64
+ } from '../core/derived-artifact-gates.mjs';
61
65
  import { isFoundationPluginVerificationEligible } from '../core/foundation-plugin-verification.mjs';
62
66
  import { PKG_ROOT } from '../core/pkg-root.mjs';
63
67
  import { writeFrozenMarker, FROZEN_MARKER_FILENAME } from '../core/frozen-marker.mjs';
@@ -319,9 +323,16 @@ export async function runDeclaredHooks(config, root, evidence, hookFn = runHook,
319
323
 
320
324
  // --- Incremental cache lookup (opt-in only; default zero change) ---
321
325
  let cacheKey;
326
+ let cacheReceipt;
327
+ let cacheRootBinding;
322
328
  if (cacheEnabled && hook.cacheable === true) {
323
329
  try {
324
- ({ cacheKey } = await computeHookCacheKey(hook, root));
330
+ ({ cacheKey, receipt: cacheReceipt, projectRootBinding: cacheRootBinding } = await computeHookCacheKey(hook, root, {
331
+ env: options.env ?? process.env,
332
+ ...(typeof options.observeExecutableIdentityFn === 'function'
333
+ ? { observeExecutableIdentityFn: options.observeExecutableIdentityFn }
334
+ : {}),
335
+ }));
325
336
  } catch (err) {
326
337
  await evidence.append({
327
338
  phase: 'hooks',
@@ -332,7 +343,9 @@ export async function runDeclaredHooks(config, root, evidence, hookFn = runHook,
332
343
  throw err;
333
344
  }
334
345
 
335
- const cached = await readHookCache(root, name, cacheKey);
346
+ const cached = cacheKey ? await readHookCache(root, name, cacheKey, {
347
+ rootBinding: cacheRootBinding,
348
+ }) : null;
336
349
  if (cached) {
337
350
  // Cache hit: skip execution. The authorization gate already passed and
338
351
  // no GATE is bypassed — ordering and failure semantics are untouched.
@@ -403,12 +416,13 @@ export async function runDeclaredHooks(config, root, evidence, hookFn = runHook,
403
416
  }
404
417
 
405
418
  // --- Write cache on success only; failures are never cached ---
406
- if (cacheEnabled && hook.cacheable === true && cacheKey) {
419
+ if (cacheEnabled && hook.cacheable === true && cacheKey && cacheReceipt) {
407
420
  const written = await writeHookCache(root, name, cacheKey, {
408
421
  exitCode: 0,
409
422
  stdoutTail: result.stdout.slice(-4000),
410
423
  stderrTail: result.stderr.slice(-4000),
411
- });
424
+ receipt: cacheReceipt,
425
+ }, { rootBinding: cacheRootBinding });
412
426
  if (!written.ok) {
413
427
  // The cache is an optimisation, not a gate: a write failure must not
414
428
  // abort prepare. Surface it as a warning-level evidence event.
@@ -2790,6 +2804,119 @@ async function runPrepareSkillResourceClosureGate({
2790
2804
  return skillResourceClosureResults;
2791
2805
  }
2792
2806
 
2807
+ /**
2808
+ * R93-01: optionally inspect the public surface before the first declared
2809
+ * hook. The staging and closure checks are deliberately ephemeral: their
2810
+ * result is an execution gate, not a plan/approval/publish receipt. The
2811
+ * normal post-hook snapshot and closure gate remains authoritative.
2812
+ */
2813
+ async function runPreHookPublicSurfaceGate({
2814
+ config,
2815
+ root,
2816
+ resolvedVersions,
2817
+ evidence,
2818
+ skipDeclaredHooks,
2819
+ workflow,
2820
+ }) {
2821
+ if (config.policy?.preHookPublicSurfaceCheck !== true) return;
2822
+
2823
+ const declaredHookCount = Object.values(config.hooks ?? {})
2824
+ .filter((hook) => hook && hook.command).length;
2825
+ if (skipDeclaredHooks || declaredHookCount === 0) {
2826
+ await evidence.append({
2827
+ phase: 'pre-hook-public-surface',
2828
+ status: 'skipped',
2829
+ reason: skipDeclaredHooks
2830
+ ? `workflow "${workflow}" trims code-class hooks`
2831
+ : 'no declared hooks',
2832
+ });
2833
+ return;
2834
+ }
2835
+
2836
+ await evidence.append({ phase: 'pre-hook-public-surface', status: 'started' });
2837
+ let currentUnitId = null;
2838
+ let unitCount = 0;
2839
+ try {
2840
+ await withTemporaryWorkspace(async (workspace) => {
2841
+ const stagingRoot = workspace.root;
2842
+ const unitResults = [];
2843
+ for (const unit of config.releaseUnits ?? []) {
2844
+ currentUnitId = unit.id;
2845
+ const outputDir = resolveUnitScopedPath(stagingRoot, unit.id);
2846
+ const publicManifest = await buildPublicStaging({
2847
+ sourceRoot: root,
2848
+ unit,
2849
+ outputDir,
2850
+ });
2851
+ unitResults.push({
2852
+ unit,
2853
+ manifest: {
2854
+ entries: publicManifest.entries,
2855
+ files: publicManifest.entries.map((entry) => entry.path).sort(),
2856
+ totalSize: publicManifest.totalSize,
2857
+ fileCount: publicManifest.fileCount,
2858
+ contentHash: publicManifest.contentHash,
2859
+ snapshotDigest: publicManifest.contentHash,
2860
+ source: unit.source,
2861
+ outputDir: publicManifest.outputDir,
2862
+ },
2863
+ });
2864
+ }
2865
+
2866
+ const { frozenManifestByDist } = await resolveDistributionManifestFacts(
2867
+ unitResults,
2868
+ resolvedVersions,
2869
+ );
2870
+ unitCount = unitResults.length;
2871
+ // Reuse the production closure/host-surface implementation, but do not
2872
+ // append its ordinary phase events or retain its receipt in the plan.
2873
+ await runPrepareSkillResourceClosureGate({
2874
+ unitResults,
2875
+ frozenManifestByDist,
2876
+ freezeTimestamp: null,
2877
+ evidence: { append: async () => undefined },
2878
+ skipSkillResourceClosure: false,
2879
+ workflow: 'pre-hook-public-surface',
2880
+ });
2881
+ });
2882
+ await evidence.append({
2883
+ phase: 'pre-hook-public-surface',
2884
+ status: 'passed',
2885
+ unitCount,
2886
+ });
2887
+ } catch (error) {
2888
+ const details = {
2889
+ ...(error instanceof ReleaseError ? error.details : {}),
2890
+ phase: 'pre-hook-public-surface',
2891
+ unitId: error?.details?.unitId ?? currentUnitId,
2892
+ };
2893
+ if (Array.isArray(details.findings)) {
2894
+ details.findings = details.findings.slice(0, 50);
2895
+ }
2896
+ await evidence.append({
2897
+ phase: 'pre-hook-public-surface',
2898
+ status: 'failed',
2899
+ error: { code: error.code ?? GATE_FAILED, message: error.message },
2900
+ });
2901
+ if (error instanceof ReleaseError) {
2902
+ throw new ReleaseError(
2903
+ error.code,
2904
+ `pre-hook public surface check failed before hooks: ${error.message}`,
2905
+ details,
2906
+ error.exitCode,
2907
+ );
2908
+ }
2909
+ throw new ReleaseError(
2910
+ GATE_FAILED,
2911
+ `pre-hook public surface check failed before hooks: ${error.message}`,
2912
+ details,
2913
+ );
2914
+ } finally {
2915
+ // withTemporaryWorkspace disposes the Foundation-managed staging root on
2916
+ // both success and failure; no project run artifact is retained.
2917
+ }
2918
+ }
2919
+
2793
2920
  export async function prepareRelease(options) {
2794
2921
  const {
2795
2922
  root,
@@ -3025,8 +3152,9 @@ export async function prepareRelease(options) {
3025
3152
  // --- Step 1b-fast: version-sensitive derived-artifact fast pre-gates (O1) ---
3026
3153
  // 2026-08-18 investigation §3.2: adapter drift and stale self-bootstrap
3027
3154
  // fact pins used to surface only deep inside the ~80s full test hook.
3028
- // Promote the two exact canonical checks (build-adapters --check and the
3029
- // release-docs-self-bootstrap single-file test) to prepare's earliest
3155
+ // Promote the three exact canonical checks (build-adapters --check,
3156
+ // generate-platform-manifest --check, and the release-docs-self-bootstrap
3157
+ // single-file test) to prepare's earliest
3030
3158
  // stage so the same drift fails closed in seconds, before any hook. Like
3031
3159
  // the bundle freshness gate this is artifact-integrity class: workflow
3032
3160
  // trimming never exempts it. Installed layouts record not-applicable.
@@ -3034,7 +3162,8 @@ export async function prepareRelease(options) {
3034
3162
  // the CLI, plain function calls, and the node:test harness — no
3035
3163
  // environment variable may exempt them (a test seam is never a
3036
3164
  // production switch). Tests that need lightweight fixtures inject the
3037
- // adapterFreshnessFn/selfBootstrapFactsFn seams explicitly in-process.
3165
+ // adapterFreshnessFn/platformManifestFreshnessFn/selfBootstrapFactsFn
3166
+ // seams explicitly in-process.
3038
3167
  await evidence.append({ phase: 'adapter-freshness', status: 'started' });
3039
3168
  const adapterFreshnessFn = options.adapterFreshnessFn ?? assertAdapterFreshness;
3040
3169
  let adapterFreshness;
@@ -3063,6 +3192,35 @@ export async function prepareRelease(options) {
3063
3192
  });
3064
3193
  }
3065
3194
 
3195
+ await evidence.append({ phase: 'platform-manifest-freshness', status: 'started' });
3196
+ const platformManifestFreshnessFn = options.platformManifestFreshnessFn
3197
+ ?? assertPlatformManifestFreshness;
3198
+ let platformManifestFreshness;
3199
+ try {
3200
+ platformManifestFreshness = await platformManifestFreshnessFn(PKG_ROOT);
3201
+ } catch (err) {
3202
+ await evidence.append({
3203
+ phase: 'platform-manifest-freshness',
3204
+ status: 'blocking',
3205
+ reason: err.details?.reason ?? null,
3206
+ error: { code: err.code, message: err.message },
3207
+ });
3208
+ throw err;
3209
+ }
3210
+ if (platformManifestFreshness?.applicable === false) {
3211
+ await evidence.append({
3212
+ phase: 'platform-manifest-freshness',
3213
+ status: 'not-applicable',
3214
+ reason: platformManifestFreshness.reason,
3215
+ });
3216
+ } else {
3217
+ await evidence.append({
3218
+ phase: 'platform-manifest-freshness',
3219
+ status: 'completed',
3220
+ durationMs: platformManifestFreshness?.durationMs ?? null,
3221
+ });
3222
+ }
3223
+
3066
3224
  await evidence.append({ phase: 'self-bootstrap-facts', status: 'started' });
3067
3225
  const selfBootstrapFactsFn = options.selfBootstrapFactsFn ?? assertSelfBootstrapFacts;
3068
3226
  let selfBootstrapFacts;
@@ -3274,6 +3432,17 @@ export async function prepareRelease(options) {
3274
3432
  });
3275
3433
  }
3276
3434
 
3435
+ // R93-01: optional ephemeral public-surface check immediately before the
3436
+ // first hook. Its staging and closure receipt never enter the plan.
3437
+ await runPreHookPublicSurfaceGate({
3438
+ config,
3439
+ root: realRoot,
3440
+ resolvedVersions,
3441
+ evidence,
3442
+ skipDeclaredHooks,
3443
+ workflow,
3444
+ });
3445
+
3277
3446
  // --- Step 3: Run declared hooks ---
3278
3447
  let hookRecords = [];
3279
3448
  if (skipDeclaredHooks) {