flow-comet 1.7.0 → 1.8.0
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/.flow-comet/skills/flow-comet/INSTALLED_VERSION +1 -1
- package/.flow-comet/skills/flow-comet/SKILL.md +16 -14
- package/.flow-comet/skills/flow-comet/reference/commit-discipline.md +1 -1
- package/.flow-comet/skills/flow-comet/reference/decision-points.md +5 -5
- package/.flow-comet/skills/flow-comet/reference/dirty-worktree.md +1 -1
- package/.flow-comet/skills/flow-comet/reference/entry-detail.md +9 -9
- package/.flow-comet/skills/flow-comet/reference/fix-loop.md +4 -4
- package/.flow-comet/skills/flow-comet/reference/init-detection.md +1 -1
- package/.flow-comet/skills/flow-comet/reference/platform-facts.md +2 -2
- package/.flow-comet/skills/flow-comet/reference/post-archive-handoff.md +264 -0
- package/.flow-comet/skills/flow-comet/reference/recovery.md +1 -1
- package/.flow-comet/skills/flow-comet/reference/replan.md +1 -1
- package/.flow-comet/skills/flow-comet/scripts/comet-check.mjs +1 -0
- package/.flow-comet/skills/flow-comet/scripts/comet-hook-guard.mjs +270 -30
- package/.flow-comet/skills/flow-comet/scripts/items/a.mjs +25 -8
- package/.flow-comet/skills/flow-comet/scripts/items/b.mjs +41 -38
- package/.flow-comet/skills/flow-comet/scripts/items/c.mjs +11 -9
- package/.flow-comet/skills/flow-comet/scripts/items/e.mjs +2 -2
- package/.flow-comet/skills/flow-comet/scripts/items/f.mjs +1 -1
- package/.flow-comet/skills/flow-comet/scripts/items/h.mjs +112 -53
- package/.flow-comet/skills/flow-comet/scripts/items/k.mjs +357 -3
- package/.flow-comet/skills/flow-comet/scripts/items/l.mjs +24 -1
- package/.flow-comet/skills/flow-comet/scripts/items/m.mjs +2 -2
- package/.flow-comet/skills/flow-comet/scripts/items/n.mjs +9 -10
- package/.flow-comet/skills/flow-comet/scripts/lib/ac-coverage.mjs +8 -8
- package/.flow-comet/skills/flow-comet/scripts/lib/fix-loop-node.mjs +4 -15
- package/.flow-comet/skills/flow-comet/scripts/lib/guard-evidence-gates.mjs +79 -107
- package/.flow-comet/skills/flow-comet/scripts/lib/guard-gates.mjs +183 -232
- package/.flow-comet/skills/flow-comet/scripts/lib/guard-routing.mjs +91 -14
- package/.flow-comet/skills/flow-comet/scripts/lib/guard-template-fidelity.mjs +20 -32
- package/.flow-comet/skills/flow-comet/scripts/lib/guard-uidesign.mjs +10 -19
- package/.flow-comet/skills/flow-comet/scripts/lib/state-commands-admin.mjs +27 -17
- package/.flow-comet/skills/flow-comet/scripts/lib/state-commands-flow.mjs +240 -87
- package/.flow-comet/skills/flow-comet/scripts/lib/state-commands-recovery.mjs +15 -22
- package/.flow-comet/skills/flow-comet/scripts/lib/state-determine.mjs +11 -4
- package/.flow-comet/skills/flow-comet/scripts/lib/state-io.mjs +192 -24
- package/.flow-comet/skills/flow-comet/scripts/lib/state-skillmarkers.mjs +55 -44
- package/.flow-comet/skills/flow-comet/scripts/lib/system-fixtures.mjs +2 -4
- package/.flow-comet/skills/flow-comet/scripts/lib/test-assertions.mjs +0 -3
- package/.flow-comet/skills/flow-comet/scripts/lib/test-fixtures.mjs +191 -17
- package/.flow-comet/skills/flow-comet/scripts/lib/test-helpers.mjs +3 -0
- package/.flow-comet/skills/flow-comet/scripts/lib/text-anchor-checks.mjs +23 -5
- package/.flow-comet/skills/flow-comet/scripts/lib/wave-projection.mjs +10 -11
- package/.flow-comet/skills/flow-comet/scripts/protocol-utils.mjs +40 -3
- package/.flow-comet/skills/flow-comet/scripts/route-node.mjs +12 -5
- package/.flow-comet/skills/flow-comet/scripts/scenarios/a.mjs +193 -111
- package/.flow-comet/skills/flow-comet/scripts/scenarios/b.mjs +314 -57
- package/.flow-comet/skills/flow-comet/scripts/scenarios/c.mjs +311 -216
- package/.flow-comet/skills/flow-comet/scripts/scenarios/d.mjs +33 -62
- package/.flow-comet/skills/flow-comet/scripts/scenarios/e.mjs +188 -91
- package/.flow-comet/skills/flow-comet/scripts/scenarios/f.mjs +94 -37
- package/.flow-comet/skills/flow-comet/scripts/scenarios/g.mjs +36 -27
- package/.flow-comet/skills/flow-comet/scripts/scenarios/h.mjs +285 -9
- package/.flow-comet/skills/flow-comet/scripts/scenarios/i.mjs +2 -6
- package/.flow-comet/skills/flow-comet/scripts/scenarios/j.mjs +5 -15
- package/.flow-comet/skills/flow-comet/scripts/scenarios/k.mjs +6 -5
- package/.flow-comet/skills/flow-comet/scripts/scenarios/l.mjs +40 -36
- package/.flow-comet/skills/flow-comet/scripts/scenarios/m.mjs +2 -2
- package/.flow-comet/skills/flow-comet/scripts/scenarios/n.mjs +346 -25
- package/.flow-comet/skills/flow-comet/scripts/state-schema.mjs +0 -2
- package/.flow-comet/skills/flow-comet/scripts/workflow-handoff.mjs +41 -54
- package/.flow-comet/skills/flow-comet-archive/SKILL.md +33 -11
- package/.flow-comet/skills/flow-comet-change/SKILL.md +1 -1
- package/.flow-comet/skills/flow-comet-design/SKILL.md +5 -3
- package/.flow-comet/skills/flow-comet-dev/SKILL.md +2 -2
- package/.flow-comet/skills/flow-comet-execute/SKILL.md +11 -11
- package/.flow-comet/skills/flow-comet-integration/SKILL.md +10 -4
- package/.flow-comet/skills/flow-comet-plan/GUIDANCE.md +1 -1
- package/.flow-comet/skills/flow-comet-plan/SKILL.md +8 -8
- package/.flow-comet/skills/flow-comet-review/SKILL.md +8 -8
- package/.flow-comet/skills/flow-comet-subagent-execute/GUIDANCE.md +1 -1
- package/.flow-comet/skills/flow-comet-subagent-execute/SKILL.md +14 -14
- package/.flow-comet/skills/flow-comet-task/SKILL.md +3 -2
- package/.flow-comet/skills/flow-comet-ui-design/SKILL.md +2 -2
- package/.flow-comet/skills/flow-comet-verify/SKILL.md +1 -1
- package/README.md +2 -2
- package/package.json +1 -1
- package/scripts/dsh-bridge.mjs +238 -21
|
@@ -20,13 +20,6 @@ import {
|
|
|
20
20
|
} from '../lib/test-helpers.mjs';
|
|
21
21
|
import {
|
|
22
22
|
CHANGE_ID,
|
|
23
|
-
PREPARE_ENV,
|
|
24
|
-
SCRIPTS_DIR,
|
|
25
|
-
TASK_DEP_CYCLE,
|
|
26
|
-
TASK_MISSING_DEP,
|
|
27
|
-
TASK_MIXED_PSP,
|
|
28
|
-
TASK_MIXED_SPS,
|
|
29
|
-
TASK_VALID_ALL_PARALLEL,
|
|
30
23
|
dropNamedImport,
|
|
31
24
|
engineCodeText,
|
|
32
25
|
engineConsumersOf,
|
|
@@ -34,9 +27,16 @@ import {
|
|
|
34
27
|
engineDefinitionModule,
|
|
35
28
|
engineScriptTexts,
|
|
36
29
|
makeTmp,
|
|
30
|
+
PREPARE_ENV,
|
|
37
31
|
renderMultiWaveTasks,
|
|
38
32
|
runPlanExit,
|
|
39
33
|
runPrepareEnv,
|
|
34
|
+
SCRIPTS_DIR,
|
|
35
|
+
TASK_DEP_CYCLE,
|
|
36
|
+
TASK_MISSING_DEP,
|
|
37
|
+
TASK_MIXED_PSP,
|
|
38
|
+
TASK_MIXED_SPS,
|
|
39
|
+
TASK_VALID_ALL_PARALLEL,
|
|
40
40
|
writeNodeDeclarationMarkers,
|
|
41
41
|
} from '../lib/test-fixtures.mjs';
|
|
42
42
|
import {
|
|
@@ -351,7 +351,6 @@ export const ENTRIES = [
|
|
|
351
351
|
run: async (dir) => {
|
|
352
352
|
const st = baseState('plan');
|
|
353
353
|
st.evidence.plan = { summary: 'plan done' };
|
|
354
|
-
st.newChange = true;
|
|
355
354
|
writeState(dir, st);
|
|
356
355
|
const res = runPlanExit(dir, TASK_DEP_CYCLE);
|
|
357
356
|
assertExit(res, 1);
|
|
@@ -545,21 +544,16 @@ export const ENTRIES = [
|
|
|
545
544
|
assertStateBytesUnchanged(dir, noWaveSectionBytes, 'replan 承载段缺席 BLOCK');
|
|
546
545
|
assertTrue(replanBackupFiles(dir).length === backupsBeforeNoWave,
|
|
547
546
|
'承载段缺席 BLOCK 不得新增重签前备份: ' + JSON.stringify(replanBackupFiles(dir)));
|
|
548
|
-
//
|
|
549
|
-
// 只是照常重签并产生备份。与上面那格共用同一夹具,唯一变量 = 有无 newChange 标记。
|
|
547
|
+
// 同一份删段任务集(无任何新旧标记字段)→ 同判 BLOCKED(单轨:replan 不做校验豁免)
|
|
550
548
|
const oldNoWaveState = replanExecuteState({ taskHash: REPLAN_STALE_SIGNATURE });
|
|
551
|
-
delete oldNoWaveState.newChange;
|
|
552
549
|
writeState(dir, oldNoWaveState);
|
|
553
550
|
const backupsBeforeOldWarn = replanBackupFiles(dir).length;
|
|
554
551
|
const replanNoWaveOld = runStateWithProtocol(dir, ['replan', '删段 + 改任务集的重校(旧 change)', '--authorized-by', 'user-approval']);
|
|
555
|
-
assertExit(replanNoWaveOld,
|
|
556
|
-
assertOut(replanNoWaveOld, '
|
|
552
|
+
assertExit(replanNoWaveOld, 1);
|
|
553
|
+
assertOut(replanNoWaveOld, 'BLOCKED: TASK.md 模板结构校验失败');
|
|
557
554
|
assertOut(replanNoWaveOld, '波次划分');
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
assertOut(replanNoWaveOld, 'REPLAN: execute');
|
|
561
|
-
assertTrue(replanBackupFiles(dir).length === backupsBeforeOldWarn + 1,
|
|
562
|
-
'旧 change 的段形 WARN 不应阻断重签(应新增 1 份备份): ' + JSON.stringify(replanBackupFiles(dir)));
|
|
555
|
+
assertTrue(replanBackupFiles(dir).length === backupsBeforeOldWarn,
|
|
556
|
+
'BLOCK 不得产生重签前备份: ' + JSON.stringify(replanBackupFiles(dir)));
|
|
563
557
|
// 两处措辞同源(plan 出口 / 重校段):同一份 TASK.md(模板在场、承载段缺席)必须给出**逐字相同**
|
|
564
558
|
// 的失败行——骨架取模板权威、片段取 guard-template-fidelity 的同一格式器、两阶段口径不变
|
|
565
559
|
// (escalate=false:首次只给类别计数)。现场适配只落在恢复行:replan 在那里点名缺的段(重校段
|
|
@@ -570,7 +564,6 @@ export const ENTRIES = [
|
|
|
570
564
|
'replan 的 TASK 段形失败行应报类别计数(与 plan 出口同一两阶段口径):\n' + replanNoWaveSection.output);
|
|
571
565
|
const planNoWaveState = baseState('plan');
|
|
572
566
|
planNoWaveState.evidence.plan = { summary: 'plan done' };
|
|
573
|
-
planNoWaveState.newChange = true;
|
|
574
567
|
writeState(dir, planNoWaveState);
|
|
575
568
|
const planNoWaveSection = runPlanWithTask(dir, '# TASK\n\n## 任务清单\n\n' + waveTask('T01'));
|
|
576
569
|
assertExit(planNoWaveSection, 1);
|
|
@@ -678,7 +671,6 @@ export const ENTRIES = [
|
|
|
678
671
|
const planWithSection = (markdown) => {
|
|
679
672
|
const planState = baseState('plan');
|
|
680
673
|
planState.evidence.plan = { summary: 'plan done' };
|
|
681
|
-
planState.newChange = true;
|
|
682
674
|
writeState(dir, planState);
|
|
683
675
|
return runPlanWithTask(dir, markdown);
|
|
684
676
|
};
|
|
@@ -904,7 +896,6 @@ export const ENTRIES = [
|
|
|
904
896
|
run: (dir) => {
|
|
905
897
|
const st = baseState('plan');
|
|
906
898
|
st.evidence.plan = { summary: 'plan done' };
|
|
907
|
-
st.newChange = true;
|
|
908
899
|
writeState(dir, st);
|
|
909
900
|
const res = runPlanExit(dir, TASK_MISSING_DEP);
|
|
910
901
|
assertExit(res, 1);
|
|
@@ -920,7 +911,6 @@ export const ENTRIES = [
|
|
|
920
911
|
run: (dir) => {
|
|
921
912
|
const st = baseState('plan');
|
|
922
913
|
st.evidence.plan = { summary: 'plan done' };
|
|
923
|
-
st.newChange = true;
|
|
924
914
|
writeState(dir, st);
|
|
925
915
|
const res = runPlanExit(dir, TASK_MIXED_SPS);
|
|
926
916
|
assertExit(res, 0);
|
|
@@ -934,7 +924,6 @@ export const ENTRIES = [
|
|
|
934
924
|
run: (dir) => {
|
|
935
925
|
const st = baseState('plan');
|
|
936
926
|
st.evidence.plan = { summary: 'plan done' };
|
|
937
|
-
st.newChange = true;
|
|
938
927
|
writeState(dir, st);
|
|
939
928
|
const res = runPlanExit(dir, TASK_MIXED_PSP);
|
|
940
929
|
assertExit(res, 0);
|
|
@@ -948,7 +937,6 @@ export const ENTRIES = [
|
|
|
948
937
|
run: (dir) => {
|
|
949
938
|
const st = baseState('plan');
|
|
950
939
|
st.evidence.plan = { summary: 'plan done' };
|
|
951
|
-
st.newChange = true;
|
|
952
940
|
writeState(dir, st);
|
|
953
941
|
const res = runPlanExit(dir, renderMultiWaveTasks());
|
|
954
942
|
assertExit(res, 0);
|
|
@@ -972,7 +960,6 @@ export const ENTRIES = [
|
|
|
972
960
|
run: (dir) => {
|
|
973
961
|
const st = baseState('plan');
|
|
974
962
|
st.evidence.plan = { summary: 'plan done' };
|
|
975
|
-
st.newChange = true;
|
|
976
963
|
writeState(dir, st);
|
|
977
964
|
const res = runPlanExit(dir, TASK_VALID_ALL_PARALLEL);
|
|
978
965
|
assertExit(res, 0);
|
|
@@ -980,75 +967,59 @@ export const ENTRIES = [
|
|
|
980
967
|
},
|
|
981
968
|
},
|
|
982
969
|
|
|
983
|
-
// 151
|
|
984
|
-
//
|
|
970
|
+
// 151(单轨对照):与 145 同一批夹具在**无任何新旧标记字段**的状态下同判——依赖图/波次投影/
|
|
971
|
+
// 同波漏标一律 BLOCKED(不再有「旧 change 渐进 WARN」这一侧);载体缺席仍只「未校验」。
|
|
985
972
|
{
|
|
986
|
-
name: '151 plan exit
|
|
973
|
+
name: '151 plan exit 单轨对照:依赖环/波次投影/同波漏标一律 BLOCKED(无字段状态同判)',
|
|
987
974
|
run: (dir) => {
|
|
988
975
|
const st = baseState('plan');
|
|
989
976
|
st.evidence.plan = { summary: 'plan done' };
|
|
990
|
-
// 无 newChange(旧 change)
|
|
991
977
|
writeState(dir, st);
|
|
992
978
|
const res = runPlanExit(dir, TASK_DEP_CYCLE);
|
|
993
|
-
assertExit(res,
|
|
994
|
-
|
|
995
|
-
assertOut(res, 'WARN');
|
|
979
|
+
assertExit(res, 1);
|
|
980
|
+
assertOut(res, 'BLOCKED');
|
|
996
981
|
assertOut(res, '依赖环');
|
|
997
|
-
// ⑤
|
|
998
|
-
// 退出码不因该判据改变(既有归档流程不被阻断),明细仍点名任务与应到波。
|
|
982
|
+
// ⑤ 同一输入(② 的同波依赖夹具):判据同源、明细同一措辞,判级同判 BLOCKED
|
|
999
983
|
const oldWaveWarn = runPlanWithTask(dir, sameWavePlan());
|
|
1000
|
-
assertExit(oldWaveWarn,
|
|
1001
|
-
|
|
984
|
+
assertExit(oldWaveWarn, 1);
|
|
985
|
+
assertOut(oldWaveWarn, 'BLOCKED');
|
|
1002
986
|
assertOut(oldWaveWarn, '波次划分与依赖层级不一致');
|
|
1003
987
|
assertOut(oldWaveWarn, 'T01');
|
|
1004
988
|
assertOut(oldWaveWarn, '应到波 1');
|
|
1005
|
-
// ⑥
|
|
1006
|
-
// 判据改变,明细仍点名未被波次覆盖的任务与应到波。
|
|
989
|
+
// ⑥ 未声明任务:同一明细、同一措辞(当前波 = 未声明),判级同判 BLOCKED
|
|
1007
990
|
const oldUndeclared = runPlanWithTask(dir, undeclaredWavePlan());
|
|
1008
|
-
assertExit(oldUndeclared,
|
|
1009
|
-
|
|
991
|
+
assertExit(oldUndeclared, 1);
|
|
992
|
+
assertOut(oldUndeclared, 'BLOCKED');
|
|
1010
993
|
assertOut(oldUndeclared, '未声明');
|
|
1011
994
|
assertOut(oldUndeclared, 'T02(依赖: T01)当前波 未声明 → 应到波 2');
|
|
1012
995
|
assertOut(oldUndeclared, '应到波 3');
|
|
1013
|
-
// ⑦
|
|
1014
|
-
// 「未校验」不再静默(此前这一类只打印未校验、不进 WARN 汇总,等于零反馈)。
|
|
996
|
+
// ⑦ 段在场而内容不可判(N/A 正文):内容不可判 = BLOCKED(与载体缺席的「未校验」二分不变)
|
|
1015
997
|
const oldUnjudgeable = runPlanWithTask(dir, naWavePlan());
|
|
1016
|
-
assertExit(oldUnjudgeable,
|
|
1017
|
-
|
|
998
|
+
assertExit(oldUnjudgeable, 1);
|
|
999
|
+
assertOut(oldUnjudgeable, 'BLOCKED');
|
|
1018
1000
|
assertOut(oldUnjudgeable, '波次划分段内容不可判');
|
|
1019
|
-
//
|
|
1020
|
-
// 内容不可判那一支必须使 WARN COUNT 恰好比它多 1(「未校验不再静默」的证据是计数差,不是
|
|
1021
|
-
// 「输出里有 WARN 字样」)。
|
|
1001
|
+
// 载体缺席只「未校验」并放行(同一任务集、唯一变量 = 波次段是否在场)
|
|
1022
1002
|
const noSectionSameTasks = runPlanWithTask(dir, '# TASK\n\n## 任务清单\n\n'
|
|
1023
1003
|
+ waveTask('T01') + waveTask('T02', 'T01'));
|
|
1024
1004
|
assertExit(noSectionSameTasks, 0);
|
|
1025
1005
|
assertOut(noSectionSameTasks, '未校验(无波次段)');
|
|
1026
|
-
|
|
1027
|
-
const match = /WARN COUNT: (\d+)/u.exec(res.output);
|
|
1028
|
-
return match === null ? 0 : Number(match[1]);
|
|
1029
|
-
};
|
|
1030
|
-
assertTrue(warnCountOf(oldUnjudgeable) === warnCountOf(noSectionSameTasks) + 1,
|
|
1031
|
-
'段在场而内容不可判未计入 WARN COUNT(未校验仍静默): N/A=' + warnCountOf(oldUnjudgeable)
|
|
1032
|
-
+ ' 无段=' + warnCountOf(noSectionSameTasks));
|
|
1033
|
-
// ⑧ 旧 change + 同波可并行却漏标 [P]:同一输入只 WARN 不阻断,且该行进入既有 WARN COUNT——
|
|
1034
|
-
// 计数差分(判别力):唯一变量(T02 的 parallel 标记)补上后该 WARN 消失,计数恰少 1。
|
|
1006
|
+
// ⑧ 同波可并行却漏标 [P]:同判 BLOCKED;补上标记后放行
|
|
1035
1007
|
const oldGap = runPlanWithTask(dir, parallelGapPlan());
|
|
1036
|
-
assertExit(oldGap,
|
|
1037
|
-
|
|
1008
|
+
assertExit(oldGap, 1);
|
|
1009
|
+
assertOut(oldGap, 'BLOCKED');
|
|
1038
1010
|
assertOut(oldGap, '同波任务可并行却未标 [P]');
|
|
1039
1011
|
assertOut(oldGap, 'T01 × T02');
|
|
1040
1012
|
const oldGapFixed = runPlanWithTask(dir, parallelGapPlan({ markAll: true }));
|
|
1041
1013
|
assertExit(oldGapFixed, 0);
|
|
1042
1014
|
assertNotOut(oldGapFixed, '可并行却未标 [P]');
|
|
1043
|
-
assertTrue(warnCountOf(oldGap) === warnCountOf(oldGapFixed) + 1,
|
|
1044
|
-
'同波漏标 [P] 的 WARN 未计入 WARN COUNT: 漏标=' + warnCountOf(oldGap)
|
|
1045
|
-
+ ' 全标=' + warnCountOf(oldGapFixed));
|
|
1046
1015
|
// ⑨ 补集等价:本判据的「写面不重叠」= task-graph 的 collectCrossTaskConflicts(写面重叠的唯一
|
|
1047
1016
|
// 入口,其实现就是 collectPathOverlaps + 已归一路径 + glob)返回集合的**补集**。夹具构造反面:
|
|
1048
1017
|
// 同波同层、都没标 parallel,但写同一个文件 → 写冲突族照常报,本判据必须沉默(否则同一对上
|
|
1049
1018
|
// 两条报文自相矛盾)。反向构造:抽掉该入口(M4)→ 这里同时冒出「可并行却未标 [P]」→ 判红。
|
|
1050
1019
|
const oldOverlap = runPlanWithTask(dir, overlapPairWavePlan());
|
|
1051
|
-
|
|
1020
|
+
// 单轨:同文件跨任务且无依赖路径 → BLOCKED(写冲突族照常报)
|
|
1021
|
+
assertExit(oldOverlap, 1);
|
|
1022
|
+
assertOut(oldOverlap, 'BLOCKED');
|
|
1052
1023
|
assertOut(oldOverlap, '同文件跨任务且无依赖路径');
|
|
1053
1024
|
assertTrue(!oldOverlap.output.includes('可并行却未标 [P]'),
|
|
1054
1025
|
'补集等价被破坏:写面重叠(collectCrossTaskConflicts 判为冲突)的一对不得被要求标 [P]('
|