release-skill 0.9.1 → 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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codebuddy-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +2 -2
- package/.kimi-plugin/plugin.json +1 -1
- package/CHANGELOG.md +49 -0
- package/INSTALL.md +2 -2
- package/INSTALL.zh-CN.md +2 -2
- package/README.md +24 -26
- package/README.zh-CN.md +20 -23
- package/adapters/claude/.claude-plugin/marketplace.json +1 -1
- package/adapters/claude/.claude-plugin/plugin.json +1 -1
- package/adapters/claude/bin/consumer-contract-vectors.json +7 -7
- package/adapters/claude/bin/error-codes.json +1 -1
- package/adapters/claude/bin/foundation-resource-binding.json +1 -1
- package/adapters/claude/bin/registry.json +22 -1
- package/adapters/claude/bin/release-skill.bundle.mjs +4068 -1962
- package/adapters/claude/bin/rules.json +1 -1
- package/adapters/claude/schemas/release-project.schema.json +4 -0
- package/adapters/claude/schemas/release-run.schema.json +41 -1
- package/adapters/claude/skills/release-config/SKILL.md +5 -3
- package/adapters/claude/skills/release-docs/SKILL.md +4 -2
- package/adapters/claude/skills/release-finish/SKILL.md +2 -0
- package/adapters/claude/skills/release-help/SKILL.md +11 -3
- package/adapters/claude/skills/release-marketplace/SKILL.md +3 -1
- package/adapters/claude/skills/release-prepare/SKILL.md +2 -0
- package/adapters/claude/skills/release-publish/SKILL.md +17 -10
- package/adapters/claude/skills/release-verify/SKILL.md +2 -0
- package/adapters/claude/src/schemas/executable-identity-observation.schema.json +162 -0
- package/adapters/claude/src/schemas/filesystem-tree-observation.schema.json +18 -2
- package/adapters/claude/src/schemas/plugin-verification-request.schema.json +147 -22
- package/adapters/claude/src/schemas/plugin-verification-result.schema.json +436 -18
- package/adapters/claude/src/schemas/skill-family-directory-verification-request.schema.json +100 -0
- package/adapters/claude/src/schemas/skill-family-directory-verification-result.schema.json +193 -0
- package/adapters/codex/.codex-plugin/plugin.json +2 -2
- package/adapters/codex/bin/consumer-contract-vectors.json +7 -7
- package/adapters/codex/bin/error-codes.json +1 -1
- package/adapters/codex/bin/foundation-resource-binding.json +1 -1
- package/adapters/codex/bin/registry.json +22 -1
- package/adapters/codex/bin/release-skill.bundle.mjs +4068 -1962
- package/adapters/codex/bin/rules.json +1 -1
- package/adapters/codex/schemas/release-project.schema.json +4 -0
- package/adapters/codex/schemas/release-run.schema.json +41 -1
- package/adapters/codex/skills/release-config/SKILL.md +5 -3
- package/adapters/codex/skills/release-docs/SKILL.md +4 -2
- package/adapters/codex/skills/release-finish/SKILL.md +2 -0
- package/adapters/codex/skills/release-help/SKILL.md +11 -3
- package/adapters/codex/skills/release-marketplace/SKILL.md +3 -1
- package/adapters/codex/skills/release-prepare/SKILL.md +2 -0
- package/adapters/codex/skills/release-publish/SKILL.md +17 -10
- package/adapters/codex/skills/release-verify/SKILL.md +2 -0
- package/adapters/codex/src/schemas/executable-identity-observation.schema.json +162 -0
- package/adapters/codex/src/schemas/filesystem-tree-observation.schema.json +18 -2
- package/adapters/codex/src/schemas/plugin-verification-request.schema.json +147 -22
- package/adapters/codex/src/schemas/plugin-verification-result.schema.json +436 -18
- package/adapters/codex/src/schemas/skill-family-directory-verification-request.schema.json +100 -0
- package/adapters/codex/src/schemas/skill-family-directory-verification-result.schema.json +193 -0
- package/adapters/kimi/.kimi-plugin/plugin.json +1 -1
- package/adapters/kimi/bin/consumer-contract-vectors.json +7 -7
- package/adapters/kimi/bin/error-codes.json +1 -1
- package/adapters/kimi/bin/foundation-resource-binding.json +1 -1
- package/adapters/kimi/bin/registry.json +22 -1
- package/adapters/kimi/bin/release-skill.bundle.mjs +4068 -1962
- package/adapters/kimi/bin/rules.json +1 -1
- package/adapters/kimi/schemas/release-project.schema.json +4 -0
- package/adapters/kimi/schemas/release-run.schema.json +41 -1
- package/adapters/kimi/skills/release-config/SKILL.md +5 -3
- package/adapters/kimi/skills/release-docs/SKILL.md +4 -2
- package/adapters/kimi/skills/release-finish/SKILL.md +2 -0
- package/adapters/kimi/skills/release-help/SKILL.md +11 -3
- package/adapters/kimi/skills/release-marketplace/SKILL.md +3 -1
- package/adapters/kimi/skills/release-prepare/SKILL.md +2 -0
- package/adapters/kimi/skills/release-publish/SKILL.md +17 -10
- package/adapters/kimi/skills/release-verify/SKILL.md +2 -0
- package/adapters/kimi/src/schemas/executable-identity-observation.schema.json +162 -0
- package/adapters/kimi/src/schemas/filesystem-tree-observation.schema.json +18 -2
- package/adapters/kimi/src/schemas/plugin-verification-request.schema.json +147 -22
- package/adapters/kimi/src/schemas/plugin-verification-result.schema.json +436 -18
- package/adapters/kimi/src/schemas/skill-family-directory-verification-request.schema.json +100 -0
- package/adapters/kimi/src/schemas/skill-family-directory-verification-result.schema.json +193 -0
- package/adapters/workbuddy/.codebuddy-plugin/plugin.json +1 -1
- package/adapters/workbuddy/bin/consumer-contract-vectors.json +7 -7
- package/adapters/workbuddy/bin/error-codes.json +1 -1
- package/adapters/workbuddy/bin/foundation-resource-binding.json +1 -1
- package/adapters/workbuddy/bin/registry.json +22 -1
- package/adapters/workbuddy/bin/release-skill.bundle.mjs +4068 -1962
- package/adapters/workbuddy/bin/rules.json +1 -1
- package/adapters/workbuddy/schemas/release-project.schema.json +4 -0
- package/adapters/workbuddy/schemas/release-run.schema.json +41 -1
- package/adapters/workbuddy/skills/release-config/SKILL.md +5 -3
- package/adapters/workbuddy/skills/release-docs/SKILL.md +4 -2
- package/adapters/workbuddy/skills/release-finish/SKILL.md +2 -0
- package/adapters/workbuddy/skills/release-help/SKILL.md +11 -3
- package/adapters/workbuddy/skills/release-marketplace/SKILL.md +3 -1
- package/adapters/workbuddy/skills/release-prepare/SKILL.md +2 -0
- package/adapters/workbuddy/skills/release-publish/SKILL.md +17 -10
- package/adapters/workbuddy/skills/release-verify/SKILL.md +2 -0
- package/adapters/workbuddy/src/schemas/executable-identity-observation.schema.json +162 -0
- package/adapters/workbuddy/src/schemas/filesystem-tree-observation.schema.json +18 -2
- package/adapters/workbuddy/src/schemas/plugin-verification-request.schema.json +147 -22
- package/adapters/workbuddy/src/schemas/plugin-verification-result.schema.json +436 -18
- package/adapters/workbuddy/src/schemas/skill-family-directory-verification-request.schema.json +100 -0
- package/adapters/workbuddy/src/schemas/skill-family-directory-verification-result.schema.json +193 -0
- package/bin/consumer-contract-vectors.json +7 -7
- package/bin/error-codes.json +1 -1
- package/bin/foundation-resource-binding.json +1 -1
- package/bin/registry.json +22 -1
- package/bin/release-skill-cli.mjs +32 -0
- package/bin/release-skill.bundle.mjs +4068 -1962
- package/bin/rules.json +1 -1
- package/package.json +5 -5
- package/platform-manifest.json +4 -4
- package/references/01-state-machine.md +16 -1
- package/references/05-evidence-and-errors.md +2 -2
- package/schemas/release-project.schema.json +4 -0
- package/schemas/release-run.schema.json +41 -1
- package/skills/release-config/SKILL.md +5 -3
- package/skills/release-docs/SKILL.md +4 -2
- package/skills/release-finish/SKILL.md +2 -0
- package/skills/release-help/SKILL.md +11 -3
- package/skills/release-marketplace/SKILL.md +3 -1
- package/skills/release-prepare/SKILL.md +2 -0
- package/skills/release-publish/SKILL.md +17 -10
- package/skills/release-verify/SKILL.md +2 -0
- package/skills-src/release-config/SKILL.md +5 -3
- package/skills-src/release-docs/SKILL.md +4 -2
- package/skills-src/release-finish/SKILL.md +2 -0
- package/skills-src/release-help/SKILL.md +11 -3
- package/skills-src/release-marketplace/SKILL.md +3 -1
- package/skills-src/release-prepare/SKILL.md +2 -0
- package/skills-src/release-publish/SKILL.md +17 -10
- package/skills-src/release-verify/SKILL.md +2 -0
- package/src/commands/prepare.mjs +139 -5
- package/src/commands/route.mjs +597 -18
- package/src/commands/setup.mjs +2 -0
- package/src/commands/ship.mjs +19 -0
- package/src/commands/verify.mjs +21 -0
- package/src/core/adoption-assessment.mjs +59 -0
- package/src/core/foundation-plugin-verification.mjs +213 -1
- package/src/core/hook-cache.mjs +318 -26
- package/src/core/hooks.mjs +8 -1
- package/src/producers/foundation-resource-projection.mjs +3 -3
- package/src/schemas/executable-identity-observation.schema.json +162 -0
- package/src/schemas/filesystem-tree-observation.schema.json +18 -2
- package/src/schemas/plugin-verification-request.schema.json +147 -22
- package/src/schemas/plugin-verification-result.schema.json +436 -18
- package/src/schemas/skill-family-directory-verification-request.schema.json +100 -0
- package/src/schemas/skill-family-directory-verification-result.schema.json +193 -0
package/src/commands/prepare.mjs
CHANGED
|
@@ -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';
|
|
@@ -323,9 +323,16 @@ export async function runDeclaredHooks(config, root, evidence, hookFn = runHook,
|
|
|
323
323
|
|
|
324
324
|
// --- Incremental cache lookup (opt-in only; default zero change) ---
|
|
325
325
|
let cacheKey;
|
|
326
|
+
let cacheReceipt;
|
|
327
|
+
let cacheRootBinding;
|
|
326
328
|
if (cacheEnabled && hook.cacheable === true) {
|
|
327
329
|
try {
|
|
328
|
-
({ 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
|
+
}));
|
|
329
336
|
} catch (err) {
|
|
330
337
|
await evidence.append({
|
|
331
338
|
phase: 'hooks',
|
|
@@ -336,7 +343,9 @@ export async function runDeclaredHooks(config, root, evidence, hookFn = runHook,
|
|
|
336
343
|
throw err;
|
|
337
344
|
}
|
|
338
345
|
|
|
339
|
-
const cached = await readHookCache(root, name, cacheKey
|
|
346
|
+
const cached = cacheKey ? await readHookCache(root, name, cacheKey, {
|
|
347
|
+
rootBinding: cacheRootBinding,
|
|
348
|
+
}) : null;
|
|
340
349
|
if (cached) {
|
|
341
350
|
// Cache hit: skip execution. The authorization gate already passed and
|
|
342
351
|
// no GATE is bypassed — ordering and failure semantics are untouched.
|
|
@@ -407,12 +416,13 @@ export async function runDeclaredHooks(config, root, evidence, hookFn = runHook,
|
|
|
407
416
|
}
|
|
408
417
|
|
|
409
418
|
// --- Write cache on success only; failures are never cached ---
|
|
410
|
-
if (cacheEnabled && hook.cacheable === true && cacheKey) {
|
|
419
|
+
if (cacheEnabled && hook.cacheable === true && cacheKey && cacheReceipt) {
|
|
411
420
|
const written = await writeHookCache(root, name, cacheKey, {
|
|
412
421
|
exitCode: 0,
|
|
413
422
|
stdoutTail: result.stdout.slice(-4000),
|
|
414
423
|
stderrTail: result.stderr.slice(-4000),
|
|
415
|
-
|
|
424
|
+
receipt: cacheReceipt,
|
|
425
|
+
}, { rootBinding: cacheRootBinding });
|
|
416
426
|
if (!written.ok) {
|
|
417
427
|
// The cache is an optimisation, not a gate: a write failure must not
|
|
418
428
|
// abort prepare. Surface it as a warning-level evidence event.
|
|
@@ -2794,6 +2804,119 @@ async function runPrepareSkillResourceClosureGate({
|
|
|
2794
2804
|
return skillResourceClosureResults;
|
|
2795
2805
|
}
|
|
2796
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
|
+
|
|
2797
2920
|
export async function prepareRelease(options) {
|
|
2798
2921
|
const {
|
|
2799
2922
|
root,
|
|
@@ -3309,6 +3432,17 @@ export async function prepareRelease(options) {
|
|
|
3309
3432
|
});
|
|
3310
3433
|
}
|
|
3311
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
|
+
|
|
3312
3446
|
// --- Step 3: Run declared hooks ---
|
|
3313
3447
|
let hookRecords = [];
|
|
3314
3448
|
if (skipDeclaredHooks) {
|