skill-family-studio 0.1.0 → 0.2.1
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/.agents/platform-manifest.json +1 -1
- package/.claude/platform-manifest.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codebuddy-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.kimi-plugin/plugin.json +1 -1
- package/.qoder-plugin/plugin.json +1 -1
- package/CHANGELOG.md +1 -1
- package/VERSION +1 -1
- package/package.json +5 -5
- package/plugin.json +1 -1
- package/src/lifecycle-inspector.mjs +250 -80
- package/src/server.mjs +44 -0
- package/src/stb-bridge.mjs +486 -0
- package/src/ui/app.mjs +60 -1
- package/src/ui/stb-ui.mjs +371 -0
- package/src/ui/studio.css +213 -0
- package/src/ui/tooltips.mjs +1 -0
package/.kimi-plugin/plugin.json
CHANGED
package/CHANGELOG.md
CHANGED
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1
|
|
1
|
+
0.2.1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skill-family-studio",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "单端口统一承载 artifact-graph 宽屏制品图谱审阅与 Foundation 运行态监控的本地离线研发控制台。",
|
|
6
6
|
"author": "广州市风荷科技有限公司",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"NOTICE"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"artifact-graph": "1.2.
|
|
43
|
-
"skill-family-contracts": "0.39.
|
|
44
|
-
"skill-family-harness-node": "0.39.
|
|
45
|
-
"skill-family-engineering-kit": "0.39.
|
|
42
|
+
"artifact-graph": "1.2.2",
|
|
43
|
+
"skill-family-contracts": "0.39.2",
|
|
44
|
+
"skill-family-harness-node": "0.39.2",
|
|
45
|
+
"skill-family-engineering-kit": "0.39.2",
|
|
46
46
|
"yaml": "2.9.0"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skill-family-studio",
|
|
3
3
|
"displayName": "Skill Family Studio",
|
|
4
|
-
"version": "0.1
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"description": "单端口统一承载 artifact-graph 宽屏制品图谱审阅与 Foundation 运行态监控的本地离线研发控制台。",
|
|
6
6
|
"author": "广州市风荷科技有限公司",
|
|
7
7
|
"repository": "https://github.com/ifoohoo/skill-family-studio"
|
|
@@ -6,6 +6,7 @@ import { lstat, readdir, realpath } from 'node:fs/promises';
|
|
|
6
6
|
import { basename, join, resolve } from 'node:path';
|
|
7
7
|
import { promisify } from 'node:util';
|
|
8
8
|
import { VERSION_LOCK_PATH } from 'artifact-graph';
|
|
9
|
+
import { findSchemaByObject, verifySessionTraceBundleSeal } from 'skill-family-contracts';
|
|
9
10
|
import { readFileContained, resolveContained } from 'skill-family-harness-node';
|
|
10
11
|
import { parse as parseYaml } from 'yaml';
|
|
11
12
|
import {
|
|
@@ -309,13 +310,47 @@ async function probeFoundationTrack(repoReal, repoEntry) {
|
|
|
309
310
|
for (const rel of extraPinPaths) {
|
|
310
311
|
const doc = await readJsonContainedSafe(repoReal, rel);
|
|
311
312
|
if (!doc) continue;
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
313
|
+
if (Array.isArray(doc.packages) && doc.packages.length > 0) {
|
|
314
|
+
for (const item of doc.packages) {
|
|
315
|
+
const tuple = parseSemverTuple(item?.version);
|
|
316
|
+
if (tuple) {
|
|
317
|
+
evidence.push({
|
|
318
|
+
pkgName: item?.name || 'foundation-pin',
|
|
319
|
+
version: formatSemverTuple(tuple),
|
|
320
|
+
tuple,
|
|
321
|
+
source: `${rel}#packages`,
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
continue;
|
|
326
|
+
}
|
|
327
|
+
const structuralCandidates = [
|
|
328
|
+
doc.pinnedVersion,
|
|
329
|
+
doc.foundationVersion,
|
|
330
|
+
doc.targetVersion,
|
|
331
|
+
doc.minimumFoundationVersion,
|
|
332
|
+
].filter(v => typeof v === 'string');
|
|
333
|
+
let matchedStructured = false;
|
|
334
|
+
for (const candidate of structuralCandidates) {
|
|
335
|
+
const tuple = parseSemverTuple(candidate);
|
|
336
|
+
if (tuple) {
|
|
337
|
+
evidence.push({ pkgName: 'foundation-pin', version: formatSemverTuple(tuple), tuple, source: rel });
|
|
338
|
+
matchedStructured = true;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if (!matchedStructured) {
|
|
342
|
+
const sanitized = { ...doc };
|
|
343
|
+
delete sanitized.note;
|
|
344
|
+
if (sanitized.source && typeof sanitized.source === 'object') {
|
|
345
|
+
sanitized.source = { ...sanitized.source, note: undefined };
|
|
346
|
+
}
|
|
347
|
+
const rawText = JSON.stringify(sanitized);
|
|
348
|
+
const m022 = /\b0\.22\.\d+\b/.exec(rawText);
|
|
349
|
+
const m039 = /\b0\.39\.\d+\b/.exec(rawText);
|
|
350
|
+
const tuple = parseSemverTuple(m022?.[0] || m039?.[0] || null);
|
|
351
|
+
if (tuple) {
|
|
352
|
+
evidence.push({ pkgName: 'foundation-pin', version: formatSemverTuple(tuple), tuple, source: rel });
|
|
353
|
+
}
|
|
319
354
|
}
|
|
320
355
|
}
|
|
321
356
|
|
|
@@ -606,14 +641,14 @@ async function probeHubActual(hubRepoReal, registryRepos) {
|
|
|
606
641
|
});
|
|
607
642
|
}
|
|
608
643
|
}
|
|
609
|
-
if (repo.publicName === 'skill-eval') {
|
|
644
|
+
if (repo.publicName === 'skill-eval' || repo.publicName === 'skill-family-eval') {
|
|
610
645
|
const legacyHeimdall = uniqueMatches.find(m => m.providerId === 'heimdall' && m.lifecycleState === 'active');
|
|
611
646
|
if (legacyHeimdall) {
|
|
612
647
|
drifts.push({
|
|
613
648
|
repoId: repo.id,
|
|
614
649
|
publicName: repo.publicName,
|
|
615
650
|
kind: 'legacy_heimdall_active_in_hub',
|
|
616
|
-
detail:
|
|
651
|
+
detail: `${repo.publicName} 在 Hub (${providerSource || marketSource}) 中仍以旧壳名 providerId="heimdall" 处于 active 状态,待重塑切换`,
|
|
617
652
|
});
|
|
618
653
|
}
|
|
619
654
|
}
|
|
@@ -632,28 +667,58 @@ async function probeHubActual(hubRepoReal, registryRepos) {
|
|
|
632
667
|
async function probeAuditReleaseCycle(auditRepoReal) {
|
|
633
668
|
if (!auditRepoReal) {
|
|
634
669
|
return {
|
|
635
|
-
detected:
|
|
636
|
-
|
|
670
|
+
detected: true,
|
|
671
|
+
pinnedCall: 'audit_repo_missing',
|
|
672
|
+
detail: '未定位到 Audit 仓库目录,按 fail-closed 判定解耦状态未核实',
|
|
637
673
|
probeSource: '未检出 Audit 仓库',
|
|
638
674
|
};
|
|
639
675
|
}
|
|
640
676
|
const subDirs = await listSubpackageNames(auditRepoReal);
|
|
641
|
-
const
|
|
677
|
+
const methodCandidates = [
|
|
642
678
|
'spec/methods/release-audit.json',
|
|
643
679
|
...subDirs.map(s => `packages/${s}/spec/methods/release-audit.json`),
|
|
644
|
-
'generated/platforms/claude-code/skills/skill-family-audit-conformance-audit/scripts/conformance_workflow.py',
|
|
645
|
-
...subDirs.map(s => `packages/${s}/generated/platforms/claude-code/skills/skill-family-audit-conformance-audit/scripts/conformance_workflow.py`),
|
|
646
680
|
];
|
|
681
|
+
let checkedMethodCount = 0;
|
|
682
|
+
let verifiedMethodSource = null;
|
|
683
|
+
for (const rel of methodCandidates) {
|
|
684
|
+
const methodDoc = await readJsonContainedSafe(auditRepoReal, rel);
|
|
685
|
+
if (!methodDoc) continue;
|
|
686
|
+
checkedMethodCount += 1;
|
|
687
|
+
verifiedMethodSource = rel;
|
|
688
|
+
const raw = JSON.stringify(methodDoc);
|
|
689
|
+
const procExec = methodDoc?.maximumSideEffects?.processExecution;
|
|
690
|
+
if ((raw.includes('verify-records') && raw.includes('release-skill')) || (procExec && procExec !== 'none')) {
|
|
691
|
+
const pinMatch = /release-skill@([0-9A-Za-z._-]+):verify-records/.exec(raw);
|
|
692
|
+
return {
|
|
693
|
+
detected: true,
|
|
694
|
+
pinnedCall: pinMatch ? `release-skill@${pinMatch[1]}:verify-records` : `processExecution:${procExec || 'verify-records'}`,
|
|
695
|
+
detail: `检出 Audit release-audit 方法仍声明反向进程执行或 verify-records 耦合(${procExec || 'verify-records'}),与发布门禁消费形成双向耦合环`,
|
|
696
|
+
probeSource: rel,
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
if (checkedMethodCount === 0) {
|
|
701
|
+
return {
|
|
702
|
+
detected: true,
|
|
703
|
+
pinnedCall: 'release_audit_contract_missing',
|
|
704
|
+
detail: 'Audit 仓库未检出 spec/methods/release-audit.json 方法合同,按 fail-closed 判定未完成单向解耦核实',
|
|
705
|
+
probeSource: 'spec/methods/release-audit.json(缺失)',
|
|
706
|
+
};
|
|
707
|
+
}
|
|
647
708
|
|
|
648
|
-
|
|
709
|
+
const receiptHelperCandidates = [
|
|
710
|
+
'plugin-src/skills/skill-family-audit-release/scripts/release_receipts.py',
|
|
711
|
+
...subDirs.map(s => `packages/${s}/plugin-src/skills/skill-family-audit-release/scripts/release_receipts.py`),
|
|
712
|
+
'generated/platforms/claude-code/skills/skill-family-audit-release-audit/scripts/release_receipts.py',
|
|
713
|
+
...subDirs.map(s => `packages/${s}/generated/platforms/claude-code/skills/skill-family-audit-release-audit/scripts/release_receipts.py`),
|
|
714
|
+
];
|
|
715
|
+
for (const rel of receiptHelperCandidates) {
|
|
649
716
|
const raw = await readTextContainedSafe(auditRepoReal, rel);
|
|
650
|
-
if (
|
|
651
|
-
if (raw.includes('verify-records') && raw.includes('release-skill')) {
|
|
652
|
-
const pinMatch = /release-skill@([0-9A-Za-z._-]+):verify-records/.exec(raw);
|
|
717
|
+
if (raw) {
|
|
653
718
|
return {
|
|
654
719
|
detected: true,
|
|
655
|
-
pinnedCall:
|
|
656
|
-
detail:
|
|
720
|
+
pinnedCall: 'release_receipts_bridge_present',
|
|
721
|
+
detail: `检出残留反向桥接脚本 ${rel}`,
|
|
657
722
|
probeSource: rel,
|
|
658
723
|
};
|
|
659
724
|
}
|
|
@@ -663,7 +728,7 @@ async function probeAuditReleaseCycle(auditRepoReal) {
|
|
|
663
728
|
detected: false,
|
|
664
729
|
pinnedCall: null,
|
|
665
730
|
detail: '未检出 Audit 对 release-skill verify-records 的反向调用,单向解耦已成立',
|
|
666
|
-
probeSource:
|
|
731
|
+
probeSource: `${verifiedMethodSource}(processExecution=none 且零 verify-records 反向调用)`,
|
|
667
732
|
};
|
|
668
733
|
}
|
|
669
734
|
|
|
@@ -839,8 +904,22 @@ function lookupProbedRepo(probedByKey, key) {
|
|
|
839
904
|
return probedByKey.get(key) || probedByKey.get(basename(String(key))) || null;
|
|
840
905
|
}
|
|
841
906
|
|
|
842
|
-
function
|
|
843
|
-
|
|
907
|
+
async function checkAnyFileInTargets(targets, relCandidates) {
|
|
908
|
+
const hits = [];
|
|
909
|
+
for (const t of targets) {
|
|
910
|
+
if (!t.live?.realPath) continue;
|
|
911
|
+
for (const rel of relCandidates) {
|
|
912
|
+
if (await existsContainedFile(t.live.realPath, rel)) {
|
|
913
|
+
hits.push(`${t.publicName}/${rel}`);
|
|
914
|
+
break;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
return hits;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
async function evaluateArchitecturalRisks(rawRisks, probedRepos, probedByKey, hubActual, auditCycle) {
|
|
922
|
+
return Promise.all((rawRisks || []).map(async risk => {
|
|
844
923
|
let detected = false;
|
|
845
924
|
let liveEvidence = '';
|
|
846
925
|
let probeSource = '';
|
|
@@ -876,16 +955,30 @@ function evaluateArchitecturalRisks(rawRisks, probedRepos, probedByKey, hubActua
|
|
|
876
955
|
: 'Hub 台账状态与生命周期三环注册表完全一致,无退役/旧壳残留。';
|
|
877
956
|
probeSource = hubActual.probeSource;
|
|
878
957
|
} else if (risk.probeKind === 'eval_shell_reshape') {
|
|
879
|
-
const evalRepo = lookupProbedRepo(probedByKey, 'skill-eval')
|
|
880
|
-
||
|
|
958
|
+
const evalRepo = lookupProbedRepo(probedByKey, 'skill-family-eval')
|
|
959
|
+
|| lookupProbedRepo(probedByKey, 'skill-eval')
|
|
960
|
+
|| probedRepos.find(r => r.publicName === 'skill-family-eval' || r.publicName === 'skill-eval');
|
|
881
961
|
const ver = evalRepo?.live?.sourceVersion?.version || null;
|
|
882
962
|
const fndAligned = Boolean(evalRepo?.live?.foundation?.alignedWithExpected && evalRepo?.live?.foundation?.foundationTrackActual === '0.39.x');
|
|
883
|
-
|
|
963
|
+
const requiredEngineModules = evalRepo ? await Promise.all([
|
|
964
|
+
'packages/skill-eval/src/oracle-vault.mjs',
|
|
965
|
+
'packages/skill-eval/src/judge-calibration.mjs',
|
|
966
|
+
'packages/skill-eval/src/sfa-hard-gate.mjs',
|
|
967
|
+
'packages/skill-eval/src/scorecard-engine.mjs',
|
|
968
|
+
'packages/skill-eval/src/eval-conclusion.mjs',
|
|
969
|
+
'packages/skill-eval/schemas/scorecard.schema.json',
|
|
970
|
+
].map(rel => checkAnyFileInTargets([evalRepo], [rel]).then(hits => hits.length > 0))) : [];
|
|
971
|
+
const allModulesPresent = requiredEngineModules.length === 6 && requiredEngineModules.every(Boolean);
|
|
972
|
+
const hasLegacyHeimdallDir = evalRepo?.live?.realPath
|
|
973
|
+
? await existsDir(join(evalRepo.live.realPath, 'heimdall'))
|
|
974
|
+
: false;
|
|
975
|
+
const receiptReady = Boolean(evalRepo?.live?.locksAndReceipt?.receiptPassed && evalRepo?.live?.locksAndReceipt?.lockPresent);
|
|
976
|
+
detected = !evalRepo?.live?.existsOnDisk || isPlaceholderVersion(ver) || !fndAligned || !allModulesPresent || hasLegacyHeimdallDir || !receiptReady;
|
|
884
977
|
liveEvidence = evalRepo?.live?.existsOnDisk
|
|
885
|
-
? `当前版本=${ver || '未声明'},底座=${evalRepo.live.foundation?.foundationTrackActual || 'not-applicable'},锁与收据=${evalRepo.live.locksAndReceipt?.badgeLabel || '未建'}`
|
|
978
|
+
? `当前版本=${ver || '未声明'},底座=${evalRepo.live.foundation?.foundationTrackActual || 'not-applicable'},核心模块=${allModulesPresent ? '6/6 就绪' : '缺失'},heimdall残留=${hasLegacyHeimdallDir ? '存在' : '已清理'},锁与收据=${evalRepo.live.locksAndReceipt?.badgeLabel || '未建'}`
|
|
886
979
|
: '本地未检出已重塑的计分卡引擎包';
|
|
887
980
|
probeSource = evalRepo?.live?.existsOnDisk
|
|
888
|
-
? `skill-eval/${evalRepo.live.sourceVersion?.probeSource || 'package.json'} +
|
|
981
|
+
? `skill-eval/${evalRepo.live.sourceVersion?.probeSource || 'package.json'} + packages/skill-eval/src/* + sft-runs.json`
|
|
889
982
|
: 'skill-eval 目录探针';
|
|
890
983
|
}
|
|
891
984
|
|
|
@@ -898,7 +991,7 @@ function evaluateArchitecturalRisks(rawRisks, probedRepos, probedByKey, hubActua
|
|
|
898
991
|
liveEvidence,
|
|
899
992
|
probeSource,
|
|
900
993
|
};
|
|
901
|
-
});
|
|
994
|
+
}));
|
|
902
995
|
}
|
|
903
996
|
|
|
904
997
|
function evaluateCapabilityCatalog(rawCatalog, probedByKey) {
|
|
@@ -940,20 +1033,6 @@ async function evaluateRoadmapMilestones(rawRoadmap, ctx) {
|
|
|
940
1033
|
return explicit.length > 0 ? explicit : probedRepos.filter(fallbackPred);
|
|
941
1034
|
};
|
|
942
1035
|
|
|
943
|
-
const checkAnyFileInTargets = async (targets, relCandidates) => {
|
|
944
|
-
const hits = [];
|
|
945
|
-
for (const t of targets) {
|
|
946
|
-
if (!t.live?.realPath) continue;
|
|
947
|
-
for (const rel of relCandidates) {
|
|
948
|
-
if (await existsContainedFile(t.live.realPath, rel)) {
|
|
949
|
-
hits.push(`${t.publicName}/${rel}`);
|
|
950
|
-
break;
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
return hits;
|
|
955
|
-
};
|
|
956
|
-
|
|
957
1036
|
const outStages = [];
|
|
958
1037
|
for (const stage of rawRoadmap || []) {
|
|
959
1038
|
const milestones = [];
|
|
@@ -1087,70 +1166,161 @@ async function evaluateRoadmapMilestones(rawRoadmap, ctx) {
|
|
|
1087
1166
|
probeSource = `skill-family-audit/${auditCycle.probeSource} + ${hubActual.probeSource}`;
|
|
1088
1167
|
} else if (ms.probeCheck === 'acp_dsh_driver_and_stb') {
|
|
1089
1168
|
const targets = resolveMilestoneTargets(ms.ownerRepos, r => r.ring === 'core' && r.live?.existsOnDisk);
|
|
1090
|
-
const
|
|
1169
|
+
const driverPkgHits = await checkAnyFileInTargets(targets, [
|
|
1091
1170
|
'packages/execution-driver/package.json',
|
|
1092
|
-
'src/execution-driver.mjs',
|
|
1093
1171
|
]);
|
|
1172
|
+
const driverEntryHits = await checkAnyFileInTargets(targets, [
|
|
1173
|
+
'packages/execution-driver/src/index.mjs',
|
|
1174
|
+
]);
|
|
1175
|
+
const driverReady = driverPkgHits.length > 0 && driverEntryHits.length > 0;
|
|
1176
|
+
const stbContractRegistered = Boolean(findSchemaByObject('session-trace-bundle'));
|
|
1094
1177
|
const stbHits = await checkAnyFileInTargets(targets, [
|
|
1095
|
-
'packages/skill-family-contracts/schemas/session-
|
|
1096
|
-
'schemas/session-
|
|
1097
|
-
'
|
|
1178
|
+
'packages/skill-family-contracts/src/schemas/session-trace-bundle.schema.json',
|
|
1179
|
+
'packages/skill-family-contracts/schemas/session-trace-bundle.schema.json',
|
|
1180
|
+
'schemas/session-trace-bundle.schema.json',
|
|
1098
1181
|
]);
|
|
1099
|
-
|
|
1182
|
+
let verifiedSampleReady = false;
|
|
1183
|
+
for (const repo of targets) {
|
|
1184
|
+
if (!repo?.live?.realPath) continue;
|
|
1185
|
+
const sampleStb = await readJsonContainedSafe(repo.live.realPath, 'packages/execution-driver/fixtures/verified-stb-bundle.json')
|
|
1186
|
+
|| await readJsonContainedSafe(repo.live.realPath, '.skill-family-studio/traces/latest-stb.json');
|
|
1187
|
+
const samplePc = await readJsonContainedSafe(repo.live.realPath, 'packages/execution-driver/fixtures/verified-stb-conclusion.json')
|
|
1188
|
+
|| await readJsonContainedSafe(repo.live.realPath, '.skill-family-studio/traces/latest-stb-conclusion.json');
|
|
1189
|
+
if (!sampleStb || !samplePc) continue;
|
|
1190
|
+
const sealVerify = verifySessionTraceBundleSeal(sampleStb);
|
|
1191
|
+
const digest = sealVerify.valid ? sealVerify.bundleDigestSha256 : null;
|
|
1192
|
+
if (
|
|
1193
|
+
sealVerify.valid
|
|
1194
|
+
&& typeof digest === 'string'
|
|
1195
|
+
&& samplePc?.kind === 'skill-family.professional-conclusion'
|
|
1196
|
+
&& samplePc?.provider?.id === 'skill-failure-auditor'
|
|
1197
|
+
&& samplePc?.outcome?.code === 'FAILURE_DIAGNOSIS_CLEAR'
|
|
1198
|
+
&& samplePc?.details?.verdict === 'PASS'
|
|
1199
|
+
&& samplePc?.subject?.revision === `sha256:${digest}`
|
|
1200
|
+
) {
|
|
1201
|
+
verifiedSampleReady = true;
|
|
1202
|
+
break;
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
if (driverReady && stbContractRegistered && stbHits.length > 0 && verifiedSampleReady) {
|
|
1100
1206
|
status = 'passed';
|
|
1101
|
-
badgeLabel = '✅ 已达成';
|
|
1207
|
+
badgeLabel = '✅ 已达成 (Driver + STB + SFA 核验闭环)';
|
|
1102
1208
|
badgeTone = 'emerald';
|
|
1103
|
-
} else if (
|
|
1209
|
+
} else if (driverReady || stbHits.length > 0) {
|
|
1104
1210
|
status = 'partial';
|
|
1105
1211
|
badgeLabel = '🔵 部分落盘';
|
|
1106
1212
|
badgeTone = 'indigo';
|
|
1107
1213
|
}
|
|
1108
|
-
liveDetail = `ACP Driver 包:${
|
|
1109
|
-
probeSource = 'packages/execution-driver + session-
|
|
1214
|
+
liveDetail = `ACP Driver 包:${driverReady ? driverPkgHits[0] : '待建'} · STB Schema:${stbHits[0] || '待建'} · SFA 封存对账实证:${verifiedSampleReady ? '已就绪' : '待核验'}`;
|
|
1215
|
+
probeSource = 'packages/execution-driver + session-trace-bundle.schema.json + SFA 封存对账结论探针';
|
|
1110
1216
|
} else if (ms.probeCheck === 'blueprint_canvas_and_mocks') {
|
|
1111
|
-
const
|
|
1112
|
-
|
|
1217
|
+
const studioRepo = lookupProbedRepo(probedByKey, 'skill-family-studio')
|
|
1218
|
+
|| probedRepos.find(r => r.publicName === 'skill-family-studio');
|
|
1219
|
+
const sftRepo = lookupProbedRepo(probedByKey, 'skill-family-test')
|
|
1220
|
+
|| probedRepos.find(r => r.publicName === 'skill-family-test');
|
|
1221
|
+
const bpHits = studioRepo ? await checkAnyFileInTargets([studioRepo], [
|
|
1113
1222
|
'packages/skill-family-studio/src/ui/blueprint-canvas.mjs',
|
|
1114
1223
|
'src/ui/blueprint-canvas.mjs',
|
|
1115
|
-
|
|
1116
|
-
]
|
|
1117
|
-
|
|
1118
|
-
'
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
if (bpHits.length > 0 && mockHits.length > 0) {
|
|
1224
|
+
]) : [];
|
|
1225
|
+
const replayHits = sftRepo ? await checkAnyFileInTargets([sftRepo], [
|
|
1226
|
+
'packages/skill-family-test/src/tool-mock-replay.mjs',
|
|
1227
|
+
'src/tool-mock-replay.mjs',
|
|
1228
|
+
]) : [];
|
|
1229
|
+
if (bpHits.length > 0 && replayHits.length > 0) {
|
|
1122
1230
|
status = 'passed';
|
|
1123
1231
|
badgeLabel = '✅ 已达成';
|
|
1124
1232
|
badgeTone = 'emerald';
|
|
1125
|
-
} else if (bpHits.length > 0 ||
|
|
1233
|
+
} else if (bpHits.length > 0 || replayHits.length > 0) {
|
|
1126
1234
|
status = 'partial';
|
|
1127
1235
|
badgeLabel = '🔵 部分落盘';
|
|
1128
1236
|
badgeTone = 'indigo';
|
|
1129
1237
|
}
|
|
1130
|
-
liveDetail = `编排蓝图画布:${bpHits[0] || '
|
|
1131
|
-
probeSource = 'blueprint-canvas.mjs +
|
|
1238
|
+
liveDetail = `编排蓝图画布:${bpHits[0] || '待 Wave 4D 按实战摩擦建设'} · sft 工具替身回放:${replayHits[0] || '待 Wave 4D 建设'}`;
|
|
1239
|
+
probeSource = 'skill-family-studio/blueprint-canvas.mjs + skill-family-test/tool-mock-replay.mjs 探针';
|
|
1132
1240
|
} else if (ms.probeCheck === 'skill_eval_scorecard_engine') {
|
|
1133
|
-
const evalRepo = lookupProbedRepo(probedByKey, 'skill-eval')
|
|
1134
|
-
||
|
|
1135
|
-
|
|
1241
|
+
const evalRepo = lookupProbedRepo(probedByKey, 'skill-family-eval')
|
|
1242
|
+
|| lookupProbedRepo(probedByKey, 'skill-eval')
|
|
1243
|
+
|| probedRepos.find(r => r.publicName === 'skill-family-eval' || r.publicName === 'skill-eval');
|
|
1244
|
+
const rsRepo = lookupProbedRepo(probedByKey, 'release-skill')
|
|
1245
|
+
|| probedRepos.find(r => r.publicName === 'release-skill');
|
|
1246
|
+
const sfaRepo = lookupProbedRepo(probedByKey, 'skill-failure-auditor')
|
|
1247
|
+
|| probedRepos.find(r => r.publicName === 'skill-failure-auditor');
|
|
1248
|
+
const requiredModules = [
|
|
1136
1249
|
'packages/skill-eval/package.json',
|
|
1137
|
-
'src/
|
|
1138
|
-
'src/
|
|
1139
|
-
'
|
|
1140
|
-
|
|
1250
|
+
'packages/skill-eval/src/oracle-vault.mjs',
|
|
1251
|
+
'packages/skill-eval/src/judge-calibration.mjs',
|
|
1252
|
+
'packages/skill-eval/src/sfa-hard-gate.mjs',
|
|
1253
|
+
'packages/skill-eval/src/scorecard-engine.mjs',
|
|
1254
|
+
'packages/skill-eval/src/eval-conclusion.mjs',
|
|
1255
|
+
'packages/skill-eval/schemas/scorecard.schema.json',
|
|
1256
|
+
];
|
|
1257
|
+
const moduleChecks = evalRepo ? await Promise.all(
|
|
1258
|
+
requiredModules.map(rel => checkAnyFileInTargets([evalRepo], [rel]).then(hits => hits[0] || null)),
|
|
1259
|
+
) : [];
|
|
1260
|
+
const presentCount = moduleChecks.filter(Boolean).length;
|
|
1261
|
+
let adversarialReady = false;
|
|
1262
|
+
if (evalRepo?.live?.realPath) {
|
|
1263
|
+
const advSrc = await readTextContainedSafe(
|
|
1264
|
+
evalRepo.live.realPath,
|
|
1265
|
+
'packages/skill-eval/src/adversarial-suite.mjs',
|
|
1266
|
+
);
|
|
1267
|
+
adversarialReady = Boolean(
|
|
1268
|
+
advSrc &&
|
|
1269
|
+
advSrc.includes('ADVERSARIAL_SUITE_ID') &&
|
|
1270
|
+
advSrc.includes('evaluateAdversarialRun'),
|
|
1271
|
+
);
|
|
1272
|
+
}
|
|
1273
|
+
let rsEvalProofReady = false;
|
|
1274
|
+
if (rsRepo?.live?.realPath) {
|
|
1275
|
+
const rsProofSrc = await readTextContainedSafe(
|
|
1276
|
+
rsRepo.live.realPath,
|
|
1277
|
+
'packages/release-skill/src/commands/professional-proof.mjs',
|
|
1278
|
+
);
|
|
1279
|
+
rsEvalProofReady = Boolean(
|
|
1280
|
+
rsProofSrc &&
|
|
1281
|
+
/export\s+async\s+function\s+readEvalProfessionalProof\b/.test(rsProofSrc),
|
|
1282
|
+
);
|
|
1283
|
+
}
|
|
1284
|
+
const sfaAligned = sfaRepo?.live?.existsOnDisk
|
|
1285
|
+
? Boolean(sfaRepo.live.foundation?.alignedWithExpected && sfaRepo.live.foundation?.foundationTrackActual === '0.39.x')
|
|
1286
|
+
: true;
|
|
1287
|
+
const hubEvalActive = (hubActual.providers || []).some(
|
|
1288
|
+
p =>
|
|
1289
|
+
p.capabilityId === 'quality-evaluation' &&
|
|
1290
|
+
(p.providerId === 'skill-family-eval' || p.providerId === 'skill-eval') &&
|
|
1291
|
+
p.lifecycleState === 'active' &&
|
|
1292
|
+
p.integrationStatus === 'published-verified',
|
|
1293
|
+
);
|
|
1141
1294
|
const verReady = evalRepo?.live?.existsOnDisk && !isPlaceholderVersion(evalRepo.live.sourceVersion?.version);
|
|
1142
|
-
const fndReady =
|
|
1143
|
-
|
|
1295
|
+
const fndReady = Boolean(
|
|
1296
|
+
evalRepo?.live?.foundation?.alignedWithExpected &&
|
|
1297
|
+
evalRepo?.live?.foundation?.foundationTrackActual === '0.39.x' &&
|
|
1298
|
+
sfaAligned,
|
|
1299
|
+
);
|
|
1300
|
+
const siteReady = Boolean(evalRepo?.live?.docSite?.isIndependentSite);
|
|
1301
|
+
const receiptReady = Boolean(evalRepo?.live?.locksAndReceipt?.receiptPassed);
|
|
1302
|
+
if (
|
|
1303
|
+
verReady &&
|
|
1304
|
+
fndReady &&
|
|
1305
|
+
presentCount === requiredModules.length &&
|
|
1306
|
+
siteReady &&
|
|
1307
|
+
receiptReady &&
|
|
1308
|
+
rsEvalProofReady &&
|
|
1309
|
+
hubEvalActive &&
|
|
1310
|
+
adversarialReady
|
|
1311
|
+
) {
|
|
1144
1312
|
status = 'passed';
|
|
1145
|
-
badgeLabel = '✅ 已达成';
|
|
1313
|
+
badgeLabel = '✅ 已达成 (含对抗评测与 P7 门禁闭环)';
|
|
1146
1314
|
badgeTone = 'emerald';
|
|
1147
|
-
} else if (
|
|
1315
|
+
} else if (presentCount > 0 || fndReady) {
|
|
1148
1316
|
status = 'partial';
|
|
1149
|
-
badgeLabel =
|
|
1317
|
+
badgeLabel = adversarialReady
|
|
1318
|
+
? '🔵 引擎与对抗包已落盘(待上下游门禁串联)'
|
|
1319
|
+
: '🔵 0.1.0 引擎就绪(待 4B-2 安全对抗套件)';
|
|
1150
1320
|
badgeTone = 'indigo';
|
|
1151
1321
|
}
|
|
1152
|
-
liveDetail = `skill-eval
|
|
1153
|
-
probeSource = 'skill-eval/
|
|
1322
|
+
liveDetail = `skill-family-eval v${evalRepo?.live?.sourceVersion?.version || '0.0.0'},核心模块=${presentCount}/${requiredModules.length},P7门禁=${rsEvalProofReady ? '已接线' : '待接线'},Hub槽位=${hubEvalActive ? 'active' : '待切换'},对抗套件=${adversarialReady ? '已就绪' : '待 4B-2'}`;
|
|
1323
|
+
probeSource = 'skill-eval/src/* + release-skill/professional-proof.mjs + Hub lifecycle-providers.mjs';
|
|
1154
1324
|
} else if (ms.probeCheck === 'studio_server_otel_dengbao') {
|
|
1155
1325
|
const targets = resolveMilestoneTargets(ms.ownerRepos, r => r.ring === 'core' && r.live?.existsOnDisk);
|
|
1156
1326
|
const srvHits = await checkAnyFileInTargets(targets, [
|
|
@@ -1305,7 +1475,7 @@ export async function inspectLifecycleCollaboration({ root = '.', catalog = null
|
|
|
1305
1475
|
}
|
|
1306
1476
|
}
|
|
1307
1477
|
|
|
1308
|
-
const architecturalRisks = evaluateArchitecturalRisks(
|
|
1478
|
+
const architecturalRisks = await evaluateArchitecturalRisks(
|
|
1309
1479
|
registry.architecturalRisks,
|
|
1310
1480
|
probedRepos,
|
|
1311
1481
|
probedByKey,
|
package/src/server.mjs
CHANGED
|
@@ -43,6 +43,12 @@ import {
|
|
|
43
43
|
runSandboxExercise,
|
|
44
44
|
} from './runtime-bridge.mjs';
|
|
45
45
|
import { collectSessionFleet } from './session-fleet.mjs';
|
|
46
|
+
import {
|
|
47
|
+
collectStudioStbView,
|
|
48
|
+
consumeDriverCsrfToken,
|
|
49
|
+
issueDriverCsrfToken,
|
|
50
|
+
runLiveStbAuditDemo,
|
|
51
|
+
} from './stb-bridge.mjs';
|
|
46
52
|
import { computePathDigest } from './setup-advisor.mjs';
|
|
47
53
|
import { inspectLifecycleCollaboration, loadLifecycleSummary } from './lifecycle-inspector.mjs';
|
|
48
54
|
|
|
@@ -567,6 +573,23 @@ export async function createStudioServer({
|
|
|
567
573
|
return;
|
|
568
574
|
}
|
|
569
575
|
|
|
576
|
+
if (pathname === '/api/studio/stb') {
|
|
577
|
+
if (req.method !== 'GET') { sendJson(res, 405, { ok: false, error: '仅支持 GET 请求。' }); return; }
|
|
578
|
+
const stbPayload = await collectStudioStbView({ root: resolvedRoot });
|
|
579
|
+
sendJson(res, 200, stbPayload);
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
if (pathname === '/api/studio/driver/csrf') {
|
|
584
|
+
if (req.method !== 'GET') { sendJson(res, 405, { ok: false, error: '仅支持 GET 请求。' }); return; }
|
|
585
|
+
if (String(req.headers['x-studio-request'] ?? '').trim() !== '1') {
|
|
586
|
+
sendJson(res, 403, { ok: false, error: 'CSRF 签发接口必须携带 X-Studio-Request: 1。' });
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
sendJson(res, 200, { ok: true, ...issueDriverCsrfToken() });
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
|
|
570
593
|
if (req.method === 'POST' || req.method === 'DELETE') {
|
|
571
594
|
const expectedPort = server.address()?.port ?? (Number.isInteger(port) && port > 0 ? port : null);
|
|
572
595
|
if (!isSafeLoopbackOrigin(req, expectedPort)) {
|
|
@@ -757,6 +780,26 @@ export async function createStudioServer({
|
|
|
757
780
|
});
|
|
758
781
|
return;
|
|
759
782
|
}
|
|
783
|
+
|
|
784
|
+
if (pathname === '/api/studio/driver/run-demo') {
|
|
785
|
+
if (!consumeDriverCsrfToken(body.csrfToken)) {
|
|
786
|
+
sendJson(res, 403, { ok: false, error: '一次性 CSRF 令牌无效或已过期,请重新确认后发起。' });
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
if (body.hitlConfirmed !== true) {
|
|
790
|
+
sendJson(res, 400, { ok: false, error: '缺少人工显式确认(hitlConfirmed: true),已拒绝启动执行驱动进程。' });
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
const mode = body.mode === 'clean' ? 'clean' : 'fabricated';
|
|
794
|
+
const entry = await enqueueWrite(async () => runLiveStbAuditDemo({
|
|
795
|
+
root: resolvedRoot,
|
|
796
|
+
mode,
|
|
797
|
+
hitlConfirmed: true,
|
|
798
|
+
}));
|
|
799
|
+
broadcast('runtime-change', { action: 'stb-demo', bundleId: entry.bundleId, at: new Date().toISOString() });
|
|
800
|
+
sendJson(res, 200, { ok: true, entry });
|
|
801
|
+
return;
|
|
802
|
+
}
|
|
760
803
|
}
|
|
761
804
|
|
|
762
805
|
if (!['GET', 'HEAD'].includes(req.method ?? 'GET')) {
|
|
@@ -772,6 +815,7 @@ export async function createStudioServer({
|
|
|
772
815
|
'/assets/tooltips.mjs': { file: join(UI_DIR, 'tooltips.mjs'), type: MIME_TYPES['.mjs'] },
|
|
773
816
|
'/assets/diagram-svg.mjs': { file: join(UI_DIR, 'diagram-svg.mjs'), type: MIME_TYPES['.mjs'] },
|
|
774
817
|
'/assets/fleet-ui.mjs': { file: join(UI_DIR, 'fleet-ui.mjs'), type: MIME_TYPES['.mjs'] },
|
|
818
|
+
'/assets/stb-ui.mjs': { file: join(UI_DIR, 'stb-ui.mjs'), type: MIME_TYPES['.mjs'] },
|
|
775
819
|
'/assets/lifecycle-ui.mjs': { file: join(UI_DIR, 'lifecycle-ui.mjs'), type: MIME_TYPES['.mjs'] },
|
|
776
820
|
'/graph-layout.mjs': { file: join(PKG_SRC_DIR, 'graph-layout.mjs'), type: MIME_TYPES['.mjs'] },
|
|
777
821
|
'/assets/graph-layout.mjs': { file: join(PKG_SRC_DIR, 'graph-layout.mjs'), type: MIME_TYPES['.mjs'] },
|