release-skill 0.10.2 → 0.10.4
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/plugin.json +1 -1
- package/.codebuddy-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +2 -2
- package/.cursor-plugin/plugin.json +1 -1
- package/.kimi-plugin/plugin.json +1 -1
- package/.qoder-plugin/plugin.json +1 -1
- package/CHANGELOG.md +42 -0
- package/INSTALL.md +2 -2
- package/INSTALL.zh-CN.md +2 -2
- package/README.md +8 -12
- package/README.zh-CN.md +8 -12
- package/adapters/antigravity/bin/release-skill.bundle.mjs +298 -9
- package/adapters/antigravity/plugin.json +1 -1
- package/adapters/antigravity/skills/release-help/SKILL.md +3 -3
- package/adapters/claude/.claude-plugin/plugin.json +1 -1
- package/adapters/claude/bin/release-skill.bundle.mjs +298 -9
- package/adapters/claude/skills/release-help/SKILL.md +3 -3
- package/adapters/codex/.codex-plugin/plugin.json +2 -2
- package/adapters/codex/bin/release-skill.bundle.mjs +298 -9
- package/adapters/codex/skills/release-help/SKILL.md +3 -3
- package/adapters/cursor/.cursor-plugin/plugin.json +1 -1
- package/adapters/cursor/bin/release-skill.bundle.mjs +298 -9
- package/adapters/cursor/skills/release-help/SKILL.md +3 -3
- package/adapters/kimi/.kimi-plugin/plugin.json +1 -1
- package/adapters/kimi/bin/release-skill.bundle.mjs +298 -9
- package/adapters/kimi/skills/release-help/SKILL.md +3 -3
- package/adapters/qoder/.qoder-plugin/plugin.json +1 -1
- package/adapters/qoder/bin/release-skill.bundle.mjs +298 -9
- package/adapters/qoder/skills/release-help/SKILL.md +3 -3
- package/adapters/workbuddy/.codebuddy-plugin/plugin.json +1 -1
- package/adapters/workbuddy/bin/release-skill.bundle.mjs +298 -9
- package/adapters/workbuddy/skills/release-help/SKILL.md +3 -3
- package/bin/release-skill-cli.mjs +38 -1
- package/bin/release-skill.bundle.mjs +298 -9
- package/package.json +1 -1
- package/platform-manifest.json +4 -4
- package/plugin.json +1 -1
- package/skills/release-help/SKILL.md +3 -3
- package/skills-src/release-help/SKILL.md +3 -3
- package/src/commands/assess.mjs +61 -1
- package/src/commands/prepare.mjs +51 -0
- package/src/commands/professional-proof.mjs +179 -1
- package/src/commands/verify.mjs +1 -1
- package/src/core/pre-authority-failure.mjs +2 -2
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { readFileSync, realpathSync } from 'node:fs';
|
|
11
11
|
import { basename, dirname, isAbsolute, join, resolve } from 'node:path';
|
|
12
12
|
|
|
13
|
-
import { findSchemaByObject, validateDocument } from 'skill-family-contracts';
|
|
13
|
+
import { digestDocument, findSchemaByObject, validateDocument } from 'skill-family-contracts';
|
|
14
14
|
import {
|
|
15
15
|
HARNESS_ERROR_KINDS,
|
|
16
16
|
publishFileExclusive,
|
|
@@ -506,3 +506,181 @@ export async function readProfessionalProof({
|
|
|
506
506
|
conclusion: document,
|
|
507
507
|
};
|
|
508
508
|
}
|
|
509
|
+
|
|
510
|
+
export const AUDIT_PROVIDER_ID = 'skill-family-audit';
|
|
511
|
+
|
|
512
|
+
export const AUDIT_PASS_CODES = Object.freeze([
|
|
513
|
+
'AUDIT_RELEASE_GATE_CLEAR',
|
|
514
|
+
'BLUEPRINT_AUDIT_CLEAR',
|
|
515
|
+
'AUDIT_PASS',
|
|
516
|
+
'RELEASE_AUDIT_PASS',
|
|
517
|
+
'CONFORMANT',
|
|
518
|
+
'CLEAR',
|
|
519
|
+
]);
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* 单向消费核验 skill-family-audit 签发的 professional-conclusion(零子进程反向调用 audit)。
|
|
523
|
+
*/
|
|
524
|
+
export async function readAuditProfessionalProof({
|
|
525
|
+
proofRoot,
|
|
526
|
+
proofPath,
|
|
527
|
+
expectedSubjectRef = null,
|
|
528
|
+
expectedSubjectRevision = null,
|
|
529
|
+
expectedDigestSha256 = null,
|
|
530
|
+
requireDigest = false,
|
|
531
|
+
} = {}) {
|
|
532
|
+
if (
|
|
533
|
+
typeof proofRoot !== 'string' ||
|
|
534
|
+
proofRoot.length === 0 ||
|
|
535
|
+
typeof proofPath !== 'string' ||
|
|
536
|
+
proofPath.length === 0
|
|
537
|
+
) {
|
|
538
|
+
return unavailableRead('proofRoot 与 proofPath 均为必填');
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
let receipt;
|
|
542
|
+
try {
|
|
543
|
+
await resolveContained(proofRoot, proofPath);
|
|
544
|
+
receipt = await readFileStrict(proofRoot, proofPath, { encoding: 'utf8' });
|
|
545
|
+
} catch (cause) {
|
|
546
|
+
return unavailableRead(`无法读取审计专业结论: ${cause?.message ?? 'unknown'}`);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
let document;
|
|
550
|
+
try {
|
|
551
|
+
document = JSON.parse(receipt.content);
|
|
552
|
+
} catch {
|
|
553
|
+
return unavailableRead('审计专业结论不是合法 JSON');
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
const schema = validateProfessionalConclusion(document);
|
|
557
|
+
const provider = extractProvider(document);
|
|
558
|
+
if (!schema.valid) {
|
|
559
|
+
return unavailableRead(
|
|
560
|
+
`审计专业结论未通过 professional-conclusion 结构校验(${schema.errorCode ?? 'invalid'})`,
|
|
561
|
+
{ provider },
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
if (provider?.id !== AUDIT_PROVIDER_ID) {
|
|
566
|
+
return unavailableRead(`证明提供方不是 ${AUDIT_PROVIDER_ID}`, { provider, conclusion: document });
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
const digestSha256 = digestDocument(document);
|
|
570
|
+
if (requireDigest && (!expectedDigestSha256 || !/^[0-9a-f]{64}$/.test(expectedDigestSha256))) {
|
|
571
|
+
return {
|
|
572
|
+
status: 'not_pass',
|
|
573
|
+
reason: '缺少合法的 64 位审计结论摘要绑定(--audit-conclusion-sha256)',
|
|
574
|
+
provider,
|
|
575
|
+
digestSha256,
|
|
576
|
+
conclusion: document,
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
if (expectedDigestSha256 !== null && expectedDigestSha256 !== undefined) {
|
|
581
|
+
if (typeof expectedDigestSha256 !== 'string' || !/^[0-9a-f]{64}$/.test(expectedDigestSha256)) {
|
|
582
|
+
return {
|
|
583
|
+
status: 'not_pass',
|
|
584
|
+
reason: 'expectedDigestSha256 必须为 64 位小写十六进制 SHA-256 摘要',
|
|
585
|
+
provider,
|
|
586
|
+
digestSha256,
|
|
587
|
+
conclusion: document,
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
if (digestSha256 !== expectedDigestSha256) {
|
|
591
|
+
return {
|
|
592
|
+
status: 'not_pass',
|
|
593
|
+
reason: `审计结论规范化摘要失配:期望 ${expectedDigestSha256},实际 ${digestSha256}`,
|
|
594
|
+
provider,
|
|
595
|
+
digestSha256,
|
|
596
|
+
conclusion: document,
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
const actualSubjectRef = document.subject?.ref;
|
|
602
|
+
if (typeof actualSubjectRef !== 'string' || actualSubjectRef.trim().length === 0) {
|
|
603
|
+
return {
|
|
604
|
+
status: 'not_pass',
|
|
605
|
+
reason: '审计结论缺少合法的 subject.ref',
|
|
606
|
+
provider,
|
|
607
|
+
digestSha256,
|
|
608
|
+
conclusion: document,
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
if (expectedSubjectRef !== null && expectedSubjectRef !== undefined) {
|
|
613
|
+
const allowedRefs = Array.isArray(expectedSubjectRef)
|
|
614
|
+
? expectedSubjectRef.filter((item) => typeof item === 'string' && item.length > 0)
|
|
615
|
+
: [expectedSubjectRef];
|
|
616
|
+
if (allowedRefs.length === 0 || !allowedRefs.includes(actualSubjectRef)) {
|
|
617
|
+
return {
|
|
618
|
+
status: 'not_pass',
|
|
619
|
+
reason: `审计结论绑定目标不一致:期望 [${allowedRefs.join(', ')}],实际 ${actualSubjectRef}`,
|
|
620
|
+
provider,
|
|
621
|
+
digestSha256,
|
|
622
|
+
conclusion: document,
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
const actualRevision = document.subject?.revision;
|
|
628
|
+
if (typeof actualRevision !== 'string' || actualRevision.trim().length === 0) {
|
|
629
|
+
return {
|
|
630
|
+
status: 'not_pass',
|
|
631
|
+
reason: '审计结论缺少合法的 subject.revision',
|
|
632
|
+
provider,
|
|
633
|
+
digestSha256,
|
|
634
|
+
conclusion: document,
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
if (expectedSubjectRevision && actualRevision !== expectedSubjectRevision) {
|
|
639
|
+
return {
|
|
640
|
+
status: 'not_pass',
|
|
641
|
+
reason: `审计结论绑定版本摘要不一致:期望 ${expectedSubjectRevision},实际 ${actualRevision}`,
|
|
642
|
+
provider,
|
|
643
|
+
digestSha256,
|
|
644
|
+
conclusion: document,
|
|
645
|
+
};
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
if (document.outcome?.completion !== 'complete') {
|
|
649
|
+
return {
|
|
650
|
+
status: 'not_pass',
|
|
651
|
+
reason: `审计声明范围尚未完整执行(completion=${document.outcome?.completion}),不能作为完整通过依据`,
|
|
652
|
+
provider,
|
|
653
|
+
digestSha256,
|
|
654
|
+
conclusion: document,
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
const rawBlocking = document.details?.blockingFindingsCount;
|
|
659
|
+
if (!Number.isInteger(rawBlocking) || rawBlocking < 0) {
|
|
660
|
+
return {
|
|
661
|
+
status: 'not_pass',
|
|
662
|
+
reason: `审计结论缺少合法的非负整数 details.blockingFindingsCount(实际=${JSON.stringify(rawBlocking)})`,
|
|
663
|
+
provider,
|
|
664
|
+
digestSha256,
|
|
665
|
+
conclusion: document,
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
if (!AUDIT_PASS_CODES.includes(document.outcome?.code) || rawBlocking > 0) {
|
|
670
|
+
return {
|
|
671
|
+
status: 'not_pass',
|
|
672
|
+
reason: `静态审计未通过(code=${document.outcome?.code},阻断发现数=${rawBlocking})`,
|
|
673
|
+
provider,
|
|
674
|
+
digestSha256,
|
|
675
|
+
conclusion: document,
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
return {
|
|
680
|
+
status: 'pass',
|
|
681
|
+
reason: '已单向核验通过 skill-family-audit 静态合规专业结论。',
|
|
682
|
+
provider,
|
|
683
|
+
digestSha256,
|
|
684
|
+
conclusion: document,
|
|
685
|
+
};
|
|
686
|
+
}
|
package/src/commands/verify.mjs
CHANGED
|
@@ -2364,7 +2364,7 @@ export async function verifyRelease(options) {
|
|
|
2364
2364
|
const frozenDir = await resolveFrozenPath(root, frozenRel, 'frozen snapshot path');
|
|
2365
2365
|
const frozenClosure = await checkSkillResourceClosure({
|
|
2366
2366
|
snapshotDir: frozenDir,
|
|
2367
|
-
host:
|
|
2367
|
+
host: 'root',
|
|
2368
2368
|
surfaceHostBindings: [{ surfaceId: surface.surfaceId, host: surface.host }],
|
|
2369
2369
|
});
|
|
2370
2370
|
const frozenReceipt = createSkillResourceClosureReceipt(frozenClosure, {
|
|
@@ -93,7 +93,7 @@ export async function isProvenPreAuthorityFailure(runDir, runName, { strictHisto
|
|
|
93
93
|
if (legacyValid) return !strictHistory && await hasNoState(runDir);
|
|
94
94
|
|
|
95
95
|
const producerVersion = summary?.producer?.version;
|
|
96
|
-
const historical = ['0.9.3', '0.9.14', '0.9.17', '0.9.33', '0.9.37', '0.9.38', '0.10.0', '0.10.1'].includes(producerVersion);
|
|
96
|
+
const historical = ['0.9.3', '0.9.14', '0.9.17', '0.9.33', '0.9.37', '0.9.38', '0.10.0', '0.10.1', '0.10.2', '0.10.3'].includes(producerVersion);
|
|
97
97
|
if (!historical && producerVersion !== resolveProducerVersion()) return false;
|
|
98
98
|
const sameProducer = (value) => value && typeof value === 'object' && !Array.isArray(value)
|
|
99
99
|
&& Object.keys(value).length === 2
|
|
@@ -187,7 +187,7 @@ async function hasNoState(runDir) {
|
|
|
187
187
|
|
|
188
188
|
// A finite prefix of the audited publish writer, not a target inference.
|
|
189
189
|
function closedPublishPrefix(events, summary, version) {
|
|
190
|
-
const auditedCurrentPrefix = ['0.9.38', '0.10.0', '0.10.1'].includes(version)
|
|
190
|
+
const auditedCurrentPrefix = ['0.9.38', '0.10.0', '0.10.1', '0.10.2', '0.10.3'].includes(version)
|
|
191
191
|
|| version === resolveProducerVersion();
|
|
192
192
|
let i = 0;
|
|
193
193
|
const take = (phase, status, gate) => {
|