flow-comet 1.6.5 → 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 +32 -18
- package/.flow-comet/skills/flow-comet/reference/commit-discipline.md +2 -2
- 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 +30 -11
- 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/context-init.mjs +26 -23
- package/.flow-comet/skills/flow-comet/scripts/guard-self-test.mjs +14 -94
- package/.flow-comet/skills/flow-comet/scripts/items/a.mjs +122 -11
- package/.flow-comet/skills/flow-comet/scripts/items/b.mjs +79 -40
- package/.flow-comet/skills/flow-comet/scripts/items/c.mjs +11 -9
- package/.flow-comet/skills/flow-comet/scripts/items/e.mjs +52 -10
- package/.flow-comet/skills/flow-comet/scripts/items/f.mjs +1 -1
- package/.flow-comet/skills/flow-comet/scripts/items/h.mjs +128 -56
- package/.flow-comet/skills/flow-comet/scripts/items/k.mjs +357 -3
- package/.flow-comet/skills/flow-comet/scripts/items/l.mjs +26 -1
- package/.flow-comet/skills/flow-comet/scripts/items/m.mjs +6 -2
- package/.flow-comet/skills/flow-comet/scripts/items/n.mjs +29 -21
- package/.flow-comet/skills/flow-comet/scripts/lib/ac-coverage.mjs +317 -0
- package/.flow-comet/skills/flow-comet/scripts/lib/fix-loop-node.mjs +4 -15
- package/.flow-comet/skills/flow-comet/scripts/lib/guard-artifact-skeleton.mjs +47 -5
- package/.flow-comet/skills/flow-comet/scripts/lib/guard-evidence-gates.mjs +357 -219
- package/.flow-comet/skills/flow-comet/scripts/lib/guard-gates.mjs +725 -309
- package/.flow-comet/skills/flow-comet/scripts/lib/guard-routing.mjs +182 -54
- package/.flow-comet/skills/flow-comet/scripts/lib/guard-state-io.mjs +8 -6
- package/.flow-comet/skills/flow-comet/scripts/lib/guard-template-fidelity.mjs +224 -83
- package/.flow-comet/skills/flow-comet/scripts/lib/guard-uidesign.mjs +17 -28
- package/.flow-comet/skills/flow-comet/scripts/lib/lessons-hits.mjs +160 -0
- package/.flow-comet/skills/flow-comet/scripts/lib/run-root.mjs +21 -0
- package/.flow-comet/skills/flow-comet/scripts/lib/section-body.mjs +92 -0
- package/.flow-comet/skills/flow-comet/scripts/lib/state-commands-admin.mjs +61 -33
- package/.flow-comet/skills/flow-comet/scripts/lib/state-commands-flow.mjs +663 -205
- package/.flow-comet/skills/flow-comet/scripts/lib/state-commands-recovery.mjs +68 -9
- package/.flow-comet/skills/flow-comet/scripts/lib/state-determine.mjs +11 -4
- package/.flow-comet/skills/flow-comet/scripts/lib/state-explain.mjs +92 -13
- package/.flow-comet/skills/flow-comet/scripts/lib/state-io.mjs +232 -11
- package/.flow-comet/skills/flow-comet/scripts/lib/state-skillmarkers.mjs +140 -74
- package/.flow-comet/skills/flow-comet/scripts/lib/system-fixtures.mjs +8 -4
- package/.flow-comet/skills/flow-comet/scripts/lib/task-graph.mjs +84 -31
- package/.flow-comet/skills/flow-comet/scripts/lib/test-assertions.mjs +0 -3
- package/.flow-comet/skills/flow-comet/scripts/lib/test-fixtures.mjs +248 -24
- package/.flow-comet/skills/flow-comet/scripts/lib/test-helpers.mjs +63 -3
- package/.flow-comet/skills/flow-comet/scripts/lib/text-anchor-checks.mjs +181 -8
- package/.flow-comet/skills/flow-comet/scripts/lib/wave-projection.mjs +340 -0
- package/.flow-comet/skills/flow-comet/scripts/protocol-utils.mjs +132 -20
- package/.flow-comet/skills/flow-comet/scripts/route-node.mjs +12 -5
- package/.flow-comet/skills/flow-comet/scripts/scenarios/a.mjs +1564 -54
- package/.flow-comet/skills/flow-comet/scripts/scenarios/b.mjs +1489 -38
- package/.flow-comet/skills/flow-comet/scripts/scenarios/c.mjs +1466 -243
- package/.flow-comet/skills/flow-comet/scripts/scenarios/d.mjs +743 -24
- package/.flow-comet/skills/flow-comet/scripts/scenarios/e.mjs +220 -92
- package/.flow-comet/skills/flow-comet/scripts/scenarios/f.mjs +657 -21
- package/.flow-comet/skills/flow-comet/scripts/scenarios/g.mjs +41 -27
- package/.flow-comet/skills/flow-comet/scripts/scenarios/h.mjs +285 -9
- package/.flow-comet/skills/flow-comet/scripts/scenarios/i.mjs +7 -6
- package/.flow-comet/skills/flow-comet/scripts/scenarios/j.mjs +21 -15
- package/.flow-comet/skills/flow-comet/scripts/scenarios/k.mjs +8 -5
- package/.flow-comet/skills/flow-comet/scripts/scenarios/l.mjs +45 -36
- package/.flow-comet/skills/flow-comet/scripts/scenarios/m.mjs +2 -2
- package/.flow-comet/skills/flow-comet/scripts/scenarios/n.mjs +2381 -85
- package/.flow-comet/skills/flow-comet/scripts/state-schema.mjs +135 -2
- package/.flow-comet/skills/flow-comet/scripts/workflow-guard.mjs +143 -16
- package/.flow-comet/skills/flow-comet/scripts/workflow-handoff.mjs +339 -103
- package/.flow-comet/skills/flow-comet/scripts/workflow-state.mjs +5 -2
- 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 +37 -13
- 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 +13 -6
- package/.flow-comet/skills/flow-comet-review/SKILL.md +21 -12
- package/.flow-comet/skills/flow-comet-subagent-execute/GUIDANCE.md +1 -1
- package/.flow-comet/skills/flow-comet-subagent-execute/SKILL.md +43 -18
- package/.flow-comet/skills/flow-comet-task/SKILL.md +4 -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
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
// 模板整份缺失(derived=false,含登记表缺失 registry-missing,C13)→ 模板派生判据全部跳过并输出
|
|
8
8
|
// 「未校验(模板缺失)」;标题形态与首部字段来自登记表而非模板正文,照常校验(既有语义)。
|
|
9
|
-
//
|
|
9
|
+
// 段形不符一律 BLOCKED(单轨,无分级旁路)。
|
|
10
10
|
//
|
|
11
11
|
// 两阶段报错(AC-15):首次只给「模板路径 + 类别与数量」,不列「缺段」的段名;同一工件再次
|
|
12
12
|
// 失败时读 .specs/<change>/.template-hints.json 并列段名;该工件通过后清除其键(C5)。其它类别
|
|
@@ -17,15 +17,18 @@ import { promises as fs } from 'fs';
|
|
|
17
17
|
import path from 'path';
|
|
18
18
|
import { EXECUTE_FAMILY_NODE_IDS, normalizeHeading } from '../route-node.mjs';
|
|
19
19
|
import { taskOpeningAttrs, taskBlocks as extractTaskBlocks } from '../task-parsing.mjs';
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
nodeTemplateDeclaration,
|
|
22
|
+
readProtocolFile,
|
|
23
|
+
templateKeyFromArtifactName,
|
|
24
|
+
templateKeyOf,
|
|
25
|
+
} from '../protocol-utils.mjs';
|
|
21
26
|
import { runRoot, fileExists, protocolPath } from './guard-state-io.mjs';
|
|
22
|
-
import { isNewChange } from './guard-routing.mjs';
|
|
23
27
|
import { buildSkeleton, LEGACY_SUMMARY_ORDER } from './guard-artifact-skeleton.mjs';
|
|
28
|
+
import { scanHeadings } from './section-body.mjs';
|
|
24
29
|
import { TASK7_REQUIRED } from './task-graph.mjs';
|
|
25
30
|
|
|
26
31
|
const HINT_FILE_NAME = '.template-hints.json';
|
|
27
|
-
const H2_LINE = /^##\s+(.+?)\s*$/u;
|
|
28
|
-
const H3_LINE = /^###\s+(.+?)\s*$/u;
|
|
29
32
|
const FRONTMATTER_KEY_LINE = /^([A-Za-z][\w-]*)\s*:\s*(.*)$/u;
|
|
30
33
|
|
|
31
34
|
// 空正文白名单(AC-5):判据是**整段取值**而非子串——词后必须是行尾 / 空白 / 标点 / 括注,
|
|
@@ -33,6 +36,43 @@ const FRONTMATTER_KEY_LINE = /^([A-Za-z][\w-]*)\s*:\s*(.*)$/u;
|
|
|
33
36
|
const NOT_APPLICABLE_BODY =
|
|
34
37
|
/^(?:无变更|不适用|未涉及|N\/A|无|—)(?=$|[\s,。;、,;.::!!??…—()()【】「」『』“”"'])/iu;
|
|
35
38
|
|
|
39
|
+
// 包裹符号(AC-8):粗体 / 下划线 / 引用 / 列表 / 有序列表 / 括号 / 反引号只是同一个词的写法,
|
|
40
|
+
// 不改变「整段只有一个白名单词」这一事实。剥离只用于本判据,**剥离后仍须以白名单词开头**
|
|
41
|
+
// (AC-9:「**见 N/A**」「(说明:N/A)」剥掉包装后开头是实词,仍是已填);只剥包装、不扩词表。
|
|
42
|
+
// 同族的另一种合法写法是「词 + 闭合标记 + 为什么」(`**N/A**(理由)`):说明紧跟闭合标记时
|
|
43
|
+
// 剥离只剥得掉尾部裸标记,词后不再紧邻边界——由 isNotApplicableBody 的第二条判据接住。
|
|
44
|
+
const NOT_APPLICABLE_WRAPPER_LEAD = /^(?:\*\*|__|>|[-*+]|\d+[.)、.]|[((]|`)\s*/u;
|
|
45
|
+
const NOT_APPLICABLE_WRAPPER_TAIL = /\s*(?:\*\*|__|`)$/u;
|
|
46
|
+
|
|
47
|
+
// 「N/A 意图痕迹」只喂补充提示,不参与缺子段判定:父段正文去掉子段标题行后,第一条非空内容行的
|
|
48
|
+
// **开头若干字符**内出现白名单词,才算当事人真想写「整段不适用」。「(说明:N/A)」「见 N/A」这类
|
|
49
|
+
// 带前置说明词 / 包裹的形态落在这个窗口里;普通正文(无白名单词)不落入——把提示挂在与 N/A 无关的
|
|
50
|
+
// 工件上,只会让当事人去改一个它本来没打算写的段落。
|
|
51
|
+
const NOT_APPLICABLE_INTENT = /(?:N\/A|不适用|无变更)/iu;
|
|
52
|
+
const NOT_APPLICABLE_INTENT_WINDOW = 24;
|
|
53
|
+
|
|
54
|
+
function bareNotApplicableBody(text) {
|
|
55
|
+
let stripped = text;
|
|
56
|
+
for (;;) {
|
|
57
|
+
const next = stripped.replace(NOT_APPLICABLE_WRAPPER_LEAD, '').replace(NOT_APPLICABLE_WRAPPER_TAIL, '');
|
|
58
|
+
if (next === stripped) return stripped;
|
|
59
|
+
stripped = next;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 整段「不适用」判定(唯一消费点):裸文本以白名单词开头即成立;另接受**闭合标记之后紧跟说明**的
|
|
64
|
+
// 形态——`**N/A**(本轮无变更)` 剥完是 `N/A**(本轮无变更)`,词后紧跟的是闭合标记而不是边界。
|
|
65
|
+
// 说明文字是「为什么不适用」,不改变「整段不适用」这一事实(旧实现据此判已填,于是同一份工件
|
|
66
|
+
// 既被判「写了 N/A」又被要求补子段)。前提仍是白名单词开头:`**见 N/A**` 剥完是 `见 N/A`,
|
|
67
|
+
// 开头是实词 ⇒ 仍是已填(否定式 / 指向式的句子不得吞成整段豁免)。
|
|
68
|
+
const NOT_APPLICABLE_CLOSE_THEN_NOTE = /\s*(?:\*\*|__|`)[\s\S]*$/u;
|
|
69
|
+
function isNotApplicableBody(text) {
|
|
70
|
+
const bare = bareNotApplicableBody(text);
|
|
71
|
+
if (NOT_APPLICABLE_BODY.test(bare)) return true;
|
|
72
|
+
const closed = bare.replace(NOT_APPLICABLE_CLOSE_THEN_NOTE, '');
|
|
73
|
+
return closed !== bare && NOT_APPLICABLE_BODY.test(closed);
|
|
74
|
+
}
|
|
75
|
+
|
|
36
76
|
function literalRegExp(text) {
|
|
37
77
|
return String(text ?? '').replace(/[.*+?^${}()|[\]\\]/gu, '\\$&');
|
|
38
78
|
}
|
|
@@ -48,8 +88,12 @@ function qualifiedHeading(raw) {
|
|
|
48
88
|
// 工件文本 → 行锚定轮廓(L-128:只认行首标题,正文里引用段名不劫持)。frontmatter 仅做顶层键
|
|
49
89
|
// 行级解析(不引入 YAML 库):一个键的值区 = 行内余下文本 + 到下一个顶层键之前的非空行
|
|
50
90
|
// (嵌套映射是缩进行,而「值另起一行且不缩进」也同样是已填——两种书写形态都不判空)。
|
|
91
|
+
// 段结构(哪些标题行真的开一段、段到哪里结束、哪些 H3 属于本段)一律取 lib/section-body.mjs 的
|
|
92
|
+
// 围栏感知扫描(scanHeadings):围栏代码块里的 `## ` / `### ` 是正文示例,不开段、也不算子段。
|
|
93
|
+
// 旧实现自带一份按行扫 `^##` 的循环(围栏盲),段序 / 缺段 / 空正文 / 增量段位置四个判据因此共用
|
|
94
|
+
// 同一处盲区:示例里贴一行段标题,那段就被读成「在场」——删段换到放行的写法。
|
|
51
95
|
function parseOutline(text) {
|
|
52
|
-
const lines =
|
|
96
|
+
const { lines, headings } = scanHeadings(text);
|
|
53
97
|
const outline = { frontmatter: { present: false, keys: [] }, titleLine: '', headerLines: [], sections: [] };
|
|
54
98
|
let cursor = 0;
|
|
55
99
|
if (lines[0] !== undefined && lines[0].trim() === '---') {
|
|
@@ -71,38 +115,43 @@ function parseOutline(text) {
|
|
|
71
115
|
cursor = end + 1;
|
|
72
116
|
}
|
|
73
117
|
}
|
|
118
|
+
const sectionHeadings = headings.filter((heading) => heading.level === 2);
|
|
119
|
+
const subsectionHeadings = headings.filter((heading) => heading.level === 3);
|
|
74
120
|
while (cursor < lines.length && lines[cursor].trim() === '') cursor += 1;
|
|
75
121
|
outline.titleLine = lines[cursor] ?? '';
|
|
76
122
|
cursor += 1;
|
|
77
|
-
|
|
123
|
+
const firstSection = sectionHeadings.length > 0 ? sectionHeadings[0].index : lines.length;
|
|
124
|
+
while (cursor < lines.length && cursor < firstSection) {
|
|
78
125
|
outline.headerLines.push(lines[cursor]);
|
|
79
126
|
cursor += 1;
|
|
80
127
|
}
|
|
81
|
-
let
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
norm: normalizeHeading(sub[1]),
|
|
102
|
-
qualified: qualifiedHeading(sub[1]),
|
|
128
|
+
for (let index = 0; index < sectionHeadings.length; index += 1) {
|
|
129
|
+
const heading = sectionHeadings[index];
|
|
130
|
+
const end = index + 1 < sectionHeadings.length ? sectionHeadings[index + 1].index : lines.length;
|
|
131
|
+
const section = {
|
|
132
|
+
raw: heading.text.trim(),
|
|
133
|
+
norm: normalizeHeading(heading.text),
|
|
134
|
+
qualified: qualifiedHeading(heading.text),
|
|
135
|
+
bodyLines: lines.slice(heading.index + 1, end),
|
|
136
|
+
// 直系正文(不含子段标题行)由同一次扫描给出:子段标题行的行下标在扫描里就是已知的,
|
|
137
|
+
// 不必回头对 bodyLines 再做一次文本匹配(那会重新掉进围栏盲区)。
|
|
138
|
+
directLines: [],
|
|
139
|
+
subsections: [],
|
|
140
|
+
};
|
|
141
|
+
const subsectionIndexes = new Set();
|
|
142
|
+
for (const sub of subsectionHeadings) {
|
|
143
|
+
if (sub.index <= heading.index || sub.index >= end) continue;
|
|
144
|
+
section.subsections.push({
|
|
145
|
+
raw: sub.text.trim(),
|
|
146
|
+
norm: normalizeHeading(sub.text),
|
|
147
|
+
qualified: qualifiedHeading(sub.text),
|
|
103
148
|
});
|
|
149
|
+
subsectionIndexes.add(sub.index);
|
|
104
150
|
}
|
|
105
|
-
|
|
151
|
+
for (let at = heading.index + 1; at < end; at += 1) {
|
|
152
|
+
if (!subsectionIndexes.has(at)) section.directLines.push(lines[at]);
|
|
153
|
+
}
|
|
154
|
+
outline.sections.push(section);
|
|
106
155
|
}
|
|
107
156
|
return outline;
|
|
108
157
|
}
|
|
@@ -117,6 +166,34 @@ function bodyText(lines) {
|
|
|
117
166
|
return trimmed.slice(start, end).join('\n');
|
|
118
167
|
}
|
|
119
168
|
|
|
169
|
+
// 父段的**直系正文**:parseOutline 在扫描时就把子段标题行记了下标(bodyLines 仍含它们,子段归属与
|
|
170
|
+
// 逐字比对要靠那份行序),directLines 是同一份 bodyLines 减去**围栏外**的子段标题行——不剥掉的话
|
|
171
|
+
// 「父段只要写了任一子段」就等同于「父段有正文」,补充提示随即对从未想写 N/A 的工件发声。
|
|
172
|
+
// 只剥标题行,子段的正文内容原样保留(它仍是父段正文的一部分)。
|
|
173
|
+
function directBodyLines(section) {
|
|
174
|
+
return section?.directLines ?? [];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// 父段正文是否留下 N/A 意图痕迹:第一条非空内容行的开头若干字符里找白名单词——包裹符号
|
|
178
|
+
// (**N/A** / > N/A / (N/A))与前置说明词((说明:N/A)、见 N/A)都落在这个窗口内。
|
|
179
|
+
function hasNotApplicableIntent(lines) {
|
|
180
|
+
const first = (lines ?? []).map((line) => String(line)).find((line) => line.trim() !== '');
|
|
181
|
+
if (first === undefined) return false;
|
|
182
|
+
return NOT_APPLICABLE_INTENT.test(first.trim().slice(0, NOT_APPLICABLE_INTENT_WINDOW));
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// 父段名:报文里必须是**真实段名**。骨架里的段名(模板标题,同一份工件不管怎么改写都显示同一个
|
|
186
|
+
// 名字)优先;骨架未派生该段时退到文档段自己的标题行(parseOutline 的 raw 已剥离开栏井号,这里再
|
|
187
|
+
// 去编号)。两条都取不到才用兜底常量——「父段「」」既没有定位价值,也掩盖了「父段没被识别」。
|
|
188
|
+
const PARENT_NAME_FALLBACK = '(该父段名未派生)';
|
|
189
|
+
|
|
190
|
+
function parentSectionName(skeleton, parentNorm, docSection) {
|
|
191
|
+
const fromSkeleton = String(skeleton.sections.find((section) => section.norm === parentNorm)?.name ?? '').trim();
|
|
192
|
+
if (fromSkeleton !== '') return fromSkeleton;
|
|
193
|
+
const fromHeading = String(docSection?.raw ?? '').replace(/^\d+(?:\.\d+)*\.?\s*/u, '').trim();
|
|
194
|
+
return fromHeading === '' ? PARENT_NAME_FALLBACK : fromHeading;
|
|
195
|
+
}
|
|
196
|
+
|
|
120
197
|
// 模板轮廓缓存(键 = 模板绝对路径):逐字比对要模板该段正文,路径来自骨架(不在此推导模板位置)。
|
|
121
198
|
const templateOutlineCache = new Map();
|
|
122
199
|
|
|
@@ -145,6 +222,7 @@ function emptyIssues() {
|
|
|
145
222
|
empty: [],
|
|
146
223
|
verbatim: [],
|
|
147
224
|
structure: [],
|
|
225
|
+
structureAdvice: [],
|
|
148
226
|
increments: [],
|
|
149
227
|
};
|
|
150
228
|
}
|
|
@@ -186,6 +264,34 @@ function templateBodyIsFinishedForm(body) {
|
|
|
186
264
|
return templateBodyHasFillInSlot(body) || tableHasExampleRow(body);
|
|
187
265
|
}
|
|
188
266
|
|
|
267
|
+
// 结构子段的键:unique=false 的(如 Button (Primary)/(Secondary))按带括号的精确名,其余按
|
|
268
|
+
// 归一名——「在场判定」与「实际挂在哪的诊断」共用这一份键,避免同一口径写两处。
|
|
269
|
+
function structureSubsectionMatches(docSub, sub) {
|
|
270
|
+
return sub.unique === false
|
|
271
|
+
? docSub.qualified === qualifiedHeading(sub.name)
|
|
272
|
+
: docSub.norm === sub.norm;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// 缺结构子段时的定位诊断:同名 H3 若实际写在别的骨架父段下、或落在模板骨架之外(文末的模板外
|
|
276
|
+
// 段落),报错点名它真正的位置。这里只读地找「同名 H3 出现在哪」——归属判定仍是
|
|
277
|
+
// 上面的 subsectionsByParent 一份,本函数不改归属、也不参与豁免。
|
|
278
|
+
function locateStructureSubsection(occurrences, lastSkeletonIndex, sub) {
|
|
279
|
+
for (const occurrence of occurrences) {
|
|
280
|
+
if (!structureSubsectionMatches(occurrence, sub)) continue;
|
|
281
|
+
if (occurrence.index > lastSkeletonIndex) return { kind: 'tail' };
|
|
282
|
+
if (occurrence.registered) {
|
|
283
|
+
// 挂在本父段下的同名 H3 已在候选集里(found 为真)——走到这里只可能是重复骨架段,
|
|
284
|
+
// 不给指向自己的误导性定位。
|
|
285
|
+
return occurrence.section.norm === sub.parentNorm
|
|
286
|
+
? null
|
|
287
|
+
: { kind: 'parent', heading: occurrence.section.raw };
|
|
288
|
+
}
|
|
289
|
+
// 模板外 H2 下的 H3:按「其上最近的骨架 H2」归因(与归属算法同口径)。
|
|
290
|
+
return { kind: 'parent', heading: occurrence.enclosing.raw };
|
|
291
|
+
}
|
|
292
|
+
return null;
|
|
293
|
+
}
|
|
294
|
+
|
|
189
295
|
function collectSectionIssues({ text, skeleton, template, issues }) {
|
|
190
296
|
const outline = parseOutline(text);
|
|
191
297
|
const indexByNorm = new Map();
|
|
@@ -221,15 +327,33 @@ function collectSectionIssues({ text, skeleton, template, issues }) {
|
|
|
221
327
|
if (sub.parentNorm !== null) parentNorms.add(sub.parentNorm);
|
|
222
328
|
}
|
|
223
329
|
// 结构子段归属到「其上最近的骨架 H2」:模板外多余段(如工具输出贴入的 `## Findings`)夹在父段与
|
|
224
|
-
// 子段之间时不切断归属(AC-10:多余段不参与骨架判定)。
|
|
330
|
+
// 子段之间时不切断归属(AC-10:多余段不参与骨架判定)。occurrences 是同一份归属数据的旁路记录
|
|
331
|
+
// (H3 所在的 H2 + 最近的骨架 H2),只供「缺子段时它实际挂在哪」的诊断使用,不参与归属判定。
|
|
225
332
|
const subsectionsByParent = new Map();
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
333
|
+
const subsectionOccurrences = [];
|
|
334
|
+
let enclosing = null;
|
|
335
|
+
for (let index = 0; index < outline.sections.length; index += 1) {
|
|
336
|
+
const section = outline.sections[index];
|
|
337
|
+
const registered = indexByNorm.has(section.norm);
|
|
338
|
+
if (registered) enclosing = section;
|
|
339
|
+
if (enclosing === null) continue;
|
|
340
|
+
if (!subsectionsByParent.has(enclosing.norm)) subsectionsByParent.set(enclosing.norm, []);
|
|
341
|
+
subsectionsByParent.get(enclosing.norm).push(...section.subsections);
|
|
342
|
+
for (const docSub of section.subsections) {
|
|
343
|
+
subsectionOccurrences.push({
|
|
344
|
+
index,
|
|
345
|
+
registered,
|
|
346
|
+
section,
|
|
347
|
+
enclosing,
|
|
348
|
+
norm: docSub.norm,
|
|
349
|
+
qualified: docSub.qualified,
|
|
350
|
+
});
|
|
351
|
+
}
|
|
232
352
|
}
|
|
353
|
+
const lastSkeletonIndex = outline.sections.reduce(
|
|
354
|
+
(last, section, index) => (indexByNorm.has(section.norm) ? index : last),
|
|
355
|
+
-1,
|
|
356
|
+
);
|
|
233
357
|
for (const section of skeleton.sections) {
|
|
234
358
|
const docSection = matched.get(section.norm);
|
|
235
359
|
if (!docSection) continue;
|
|
@@ -245,16 +369,27 @@ function collectSectionIssues({ text, skeleton, template, issues }) {
|
|
|
245
369
|
issues.verbatim.push(section.name);
|
|
246
370
|
}
|
|
247
371
|
}
|
|
248
|
-
// 结构子段:父段在场才要求;父段整段 N/A → 子段不要求(AC-8
|
|
372
|
+
// 结构子段:父段在场才要求;父段整段 N/A → 子段不要求(AC-8 ②)。父段的「整段不适用」接受
|
|
373
|
+
// 包裹符号(含「闭合标记 + 说明」形态),但剥掉包装后仍要以白名单词开头(AC-8 / AC-9)。
|
|
249
374
|
for (const sub of skeleton.structureSubsections) {
|
|
250
375
|
const parent = sub.parentNorm === null ? null : matched.get(sub.parentNorm);
|
|
251
376
|
if (!parent) continue;
|
|
252
|
-
|
|
377
|
+
const parentBody = bodyText(parent.bodyLines);
|
|
378
|
+
if (isNotApplicableBody(parentBody)) continue;
|
|
253
379
|
const candidates = subsectionsByParent.get(sub.parentNorm) ?? parent.subsections;
|
|
254
|
-
const found = candidates.some((docSub) => (sub
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
380
|
+
const found = candidates.some((docSub) => structureSubsectionMatches(docSub, sub));
|
|
381
|
+
if (found) continue;
|
|
382
|
+
issues.structure.push({
|
|
383
|
+
name: sub.name,
|
|
384
|
+
placement: locateStructureSubsection(subsectionOccurrences, lastSkeletonIndex, sub),
|
|
385
|
+
});
|
|
386
|
+
// 父段正文留下 N/A 意图痕迹(如「(说明:N/A)」/「见 N/A」)却写不进白名单:子段仍要求,并
|
|
387
|
+
// 给出可照抄的写法(AC-10)。触发条件是**意图痕迹**而不是「正文非空」——普通正文漏写子段时当事人
|
|
388
|
+
// 根本没想写整段不适用,这条提示只会把注意力引到无关段落上;空正文同理(父段正文由子段承载时
|
|
389
|
+
// 它本就是空的)。父段名用真实名,文案里的「父段「」」没有定位价值。
|
|
390
|
+
if (!hasNotApplicableIntent(directBodyLines(parent))) continue;
|
|
391
|
+
const parentName = parentSectionName(skeleton, sub.parentNorm, parent);
|
|
392
|
+
if (!issues.structureAdvice.includes(parentName)) issues.structureAdvice.push(parentName);
|
|
258
393
|
}
|
|
259
394
|
// 增量段:只校验在场者的位置(必填与否由登记表 required + 各自门禁决定,本模块不做存在性兜底)
|
|
260
395
|
for (const increment of skeleton.increments) {
|
|
@@ -346,7 +481,16 @@ function hintCategories(issues) {
|
|
|
346
481
|
return [...categories];
|
|
347
482
|
}
|
|
348
483
|
|
|
349
|
-
|
|
484
|
+
// 缺子段定位的人读文本:挂在另一个骨架父段下 / 落在模板骨架之外(文末)。
|
|
485
|
+
function placementText(placement) {
|
|
486
|
+
return placement.kind === 'tail' ? '实际在文末' : '实际挂在 ' + placement.heading + ' 段下';
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// 结构问题清单 → 人读片段(唯一实现):末尾的完整出口报告行与只读的结构预检共用这一个格式器,
|
|
490
|
+
// 两种模式的措辞因此不会各自漂移。escalate 只控制「缺段是否列出段名」(该工件上一轮也失败过才列);
|
|
491
|
+
// 预检不读提示账本,一律以 false 调用。本函数只拼文本——账本由 reportArtifactStructure 写,所以
|
|
492
|
+
// 调用方拿到同形报文不需要复制一份实现。
|
|
493
|
+
export function formatIssueParts(issues, { escalate }) {
|
|
350
494
|
const parts = [];
|
|
351
495
|
if (issues.title !== null) parts.push('标题形态不符(模板首行: `' + issues.title.expected + '`)');
|
|
352
496
|
if (issues.headerMissing.length > 0) parts.push('首部缺字段: ' + issues.headerMissing.join('、'));
|
|
@@ -366,7 +510,18 @@ function formatIssueParts(issues, { escalate }) {
|
|
|
366
510
|
parts.push('与模板该段正文逐字相同(判未填)' + issues.verbatim.length + ' 项: ' + issues.verbatim.join('、'));
|
|
367
511
|
}
|
|
368
512
|
if (issues.structure.length > 0) {
|
|
369
|
-
|
|
513
|
+
const entries = issues.structure.map((entry) => (entry.placement === null
|
|
514
|
+
? entry.name
|
|
515
|
+
: entry.name + '(' + placementText(entry.placement) + ')'));
|
|
516
|
+
parts.push('缺结构子段 ' + issues.structure.length + ' 项: ' + entries.join('、'));
|
|
517
|
+
}
|
|
518
|
+
if (issues.structureAdvice.length > 0) {
|
|
519
|
+
// 报文必须与判据一致:包裹符号(粗体 / 引用 / 括号)**本身就被接受**,旧措辞「不要加粗或引用」
|
|
520
|
+
// 与判据相反,会把人推去改一个本来能通过的写法;真正要的是「白名单词开头」,以及带说明时的
|
|
521
|
+
// 正确位置(闭合标记之后,见 isNotApplicableBody)。
|
|
522
|
+
parts.push('父段「' + issues.structureAdvice.join('」「') + '」正文不在「整段不适用」白名单——'
|
|
523
|
+
+ '若要整段不适用,请让整段以 N/A 开头(包裹符号本身就被接受:粗体 / 引用 / 括号都算);'
|
|
524
|
+
+ '闭合标记之后要跟说明,写成 `**N/A**(理由)` 这种形态');
|
|
370
525
|
}
|
|
371
526
|
if (issues.increments.length > 0) parts.push('增量段位置非法: ' + issues.increments.join('、'));
|
|
372
527
|
return parts;
|
|
@@ -484,17 +639,12 @@ export async function reportArtifactStructure({ changeDir, state, assessments })
|
|
|
484
639
|
if (failing.length > 0) {
|
|
485
640
|
const lines = planFailureLines(hints, failing);
|
|
486
641
|
await writeHints(hintsFile, hints);
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
process.exit(1);
|
|
494
|
-
}
|
|
495
|
-
for (const line of lines) {
|
|
496
|
-
console.error('TEMPLATE-STRUCTURE WARN: ' + line + '(旧 change 渐进,不阻断;新 change 将强制)');
|
|
497
|
-
}
|
|
642
|
+
for (const line of lines) console.error('BLOCKED: ' + line);
|
|
643
|
+
const templatePaths = [...new Set(failing.map((item) => item.skeleton.file ?? '(未登记模板路径)'))];
|
|
644
|
+
console.error('恢复: 对照 ' + templatePaths.join(' / ') + ' 修正标题 / 首部字段 / 段序,并按模板补齐缺失的 H2 与结构型 H3 标题'
|
|
645
|
+
+ '(条件段与无内容段正文可写 N/A;可选段按模板自述可整段删除)后重试 exit;同一工件再次失败时会列出具体段名'
|
|
646
|
+
+ '(已记录在 .specs/' + (state.activeChange ?? '<change>') + '/' + HINT_FILE_NAME + ')');
|
|
647
|
+
process.exit(1);
|
|
498
648
|
} else if (released) {
|
|
499
649
|
await writeHints(hintsFile, hints);
|
|
500
650
|
}
|
|
@@ -523,7 +673,7 @@ function addLegacySummaryIssues(text, issues) {
|
|
|
523
673
|
|
|
524
674
|
// SUMMARY 结构门禁(execute / subagent-execute):标题形态 / 首部四字段 / 全骨架(H2 + 结构型 H3,
|
|
525
675
|
// 条件段允许正文 N/A)/ 段序 / 空正文 / 逐字占位 / 增量段位置(自检方法 紧随越界检查或文末;
|
|
526
|
-
// LESSONS 扫描
|
|
676
|
+
// LESSONS 扫描 紧随自检方法或在自检方法之后),违反一律 BLOCKED(单轨判级);模板缺席时
|
|
527
677
|
// 只保留既有兜底段序判据并显式输出「未校验(模板缺失)」。
|
|
528
678
|
export async function runSummaryTemplateFidelityGate({ node, state }) {
|
|
529
679
|
if (!EXECUTE_FAMILY_NODE_IDS.has(node.id)) return;
|
|
@@ -563,15 +713,10 @@ export async function runSummaryTemplateFidelityGate({ node, state }) {
|
|
|
563
713
|
// 节点 → 待校验工件:单一来源 = 协议。**该节点是否受模板门禁**由 protocol-utils 的
|
|
564
714
|
// nodeTemplateDeclaration 决定(内置节点取引擎映射、自定义节点取协议 node.templates,未声明 =
|
|
565
715
|
// 零模板 ⇒ 不校验,ADR-002 特化层);**产出哪份工件**取该节点 outputSchemas 的 artifacts[].paths
|
|
566
|
-
// (`<change-id>/…`
|
|
567
|
-
//
|
|
716
|
+
// (`<change-id>/…` 基),工件名 → 模板键的派生取 protocol-utils 的 templateKeyFromArtifactName
|
|
717
|
+
// (与结构预检的模板指针**同一实现**:口径只有一处,本模块不再持副本)——本模块不另写节点→工件映射。
|
|
568
718
|
// SUMMARY 由 execute 家族的专用门负责(它还要消费无模板时的兜底段序),此处跳过以免同一工件被
|
|
569
719
|
// 两条门重复判定。
|
|
570
|
-
function templateKeyFromArtifactName(namePattern) {
|
|
571
|
-
const base = String(namePattern ?? '').split('*').pop().replace(/^[^A-Za-z0-9]+/u, '');
|
|
572
|
-
return base === '' ? null : templateKeyOf(base);
|
|
573
|
-
}
|
|
574
|
-
|
|
575
720
|
async function nodeArtifactTargets(node) {
|
|
576
721
|
let protocol = null;
|
|
577
722
|
try {
|
|
@@ -587,7 +732,9 @@ async function nodeArtifactTargets(node) {
|
|
|
587
732
|
for (const pattern of artifact.paths ?? []) {
|
|
588
733
|
const segments = String(pattern ?? '').replaceAll('\\', '/').split('/');
|
|
589
734
|
if (segments.length !== 2 || segments[0] !== '<change-id>') continue;
|
|
590
|
-
|
|
735
|
+
// 传整条声明路径:路径归一(取末段、通配取末个 `*` 之后)由共享派生统一承担,
|
|
736
|
+
// 两处消费面因此走的是同一段归一逻辑,而不是各自先切一刀再交给共用的键归一。
|
|
737
|
+
const key = templateKeyFromArtifactName(pattern);
|
|
591
738
|
if (key === null) continue;
|
|
592
739
|
targets.push({ key, namePattern: segments[1] });
|
|
593
740
|
}
|
|
@@ -667,19 +814,16 @@ async function legacyDesignLiteTitle(changeDir, state) {
|
|
|
667
814
|
const firstLine = (text.replace(/^\uFEFF/u, '').split('\n').find((line) => line.trim() !== '') ?? '').trim();
|
|
668
815
|
if (/^#\s*design\b/iu.test(firstLine)) return;
|
|
669
816
|
const message = 'DESIGN-lite.md 标题应以 # DESIGN 开头(如 `# DESIGN: <标题>`,大小写不敏感、冒号可省)';
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
process.exit(1);
|
|
674
|
-
}
|
|
675
|
-
console.error('INTAKE-DOC WARN: ' + message + '(旧 change 渐进,不阻断;新 change 将强制)');
|
|
817
|
+
console.error('BLOCKED: ' + message);
|
|
818
|
+
console.error('恢复: 修正 DESIGN-lite.md 首行标题后重试 exit design');
|
|
819
|
+
process.exit(1);
|
|
676
820
|
}
|
|
677
821
|
|
|
678
822
|
// TASK 7 字段完整性门禁(plan 出口):每个 <task> 块须含
|
|
679
|
-
// name/read_files/write_files/action/verify/done/depends_on;缺任一 →
|
|
680
|
-
//
|
|
681
|
-
//
|
|
682
|
-
//
|
|
823
|
+
// name/read_files/write_files/action/verify/done/depends_on;缺任一 → BLOCKED / WARN,分级依据是
|
|
824
|
+
// **模板形态**(不是 change 新旧)。开标签解析/整块提取沿用 task-parsing.mjs(属性序无关)。宽容:
|
|
825
|
+
// 任务块采用旧式一字段形态(无 <name> 标记)的 TASK 视为旧格式 → 仅 WARN(不误拦既有波次/路由回
|
|
826
|
+
// 归载体);采用新模板形态(含 <name>)则按 7 字段强校验。字段集从 `task-graph.mjs` 的单一权威常量取用(执行期
|
|
683
827
|
// `replan` 判据同源)——本模块不得再写一份字面集合,否则两侧会在规则演进时分叉。
|
|
684
828
|
export async function runTaskSevenFieldGate({ node, state }) {
|
|
685
829
|
if (node.id !== 'plan' || !state.activeChange) return;
|
|
@@ -697,14 +841,11 @@ export async function runTaskSevenFieldGate({ node, state }) {
|
|
|
697
841
|
}
|
|
698
842
|
if (broken.length > 0) {
|
|
699
843
|
if (planNewFormat) {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
process.exit(1);
|
|
706
|
-
}
|
|
707
|
-
console.error('TASK-7FIELD WARN: TASK.md ' + broken.join('; ') + '(旧 change 渐进,不阻断;新 change 将强制补齐 7 字段)');
|
|
844
|
+
// 文案的集合字符串**从判据常量派生**(不得在此再写一遍字面集合——第二处同口径表达会在
|
|
845
|
+
// 判据演进时静默落后于实现;构造方式不改变渲染结果)。
|
|
846
|
+
console.error('BLOCKED: TASK.md 任务缺 7 字段(' + TASK7_REQUIRED.join('/') + '): ' + broken.join('; '));
|
|
847
|
+
console.error('恢复: 对照 flow-kit/templates/TASK.md 补齐每个 <task> 的缺字段后重试 exit');
|
|
848
|
+
process.exit(1);
|
|
708
849
|
} else {
|
|
709
850
|
console.error('TASK-7FIELD WARN: TASK.md 任务为旧式一字段模板形态(' + broken.join('; ') +
|
|
710
851
|
')——建议按 flow-kit/templates/TASK.md 补全 7 字段(渐进不阻断)');
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// 按 `<nodeId>.<skill>` 键控,工件门与出口自动补写共用 applicabilityGatedBinding 查询。
|
|
11
11
|
//
|
|
12
12
|
// 判据必须结构性可判:CHANGE.md 的「视觉调性」段在场且段内不含**结构形态**的「不适用」标记 ⇒
|
|
13
|
-
// 前端;段内以结构形态标注 ⇒
|
|
14
|
-
//
|
|
13
|
+
// 前端;段内以结构形态标注 ⇒ 非前端。段**缺席**一律拦——与 open 出口的模板条件段同判(标题必须
|
|
14
|
+
// 在场),不再默认判非前端
|
|
15
15
|
// (否则「漏写段」会被静默翻译成一个更弱的门)。
|
|
16
16
|
//
|
|
17
17
|
// UI-DESIGN.md 在场时,其模板结构(frontmatter 8 键 / H2 骨架 / 结构型 H3)由产出物模板结构门禁
|
|
@@ -20,8 +20,10 @@
|
|
|
20
20
|
import { promises as fs } from 'fs';
|
|
21
21
|
import path from 'path';
|
|
22
22
|
import { runRoot, fileExists } from './guard-state-io.mjs';
|
|
23
|
-
import {
|
|
23
|
+
import { templateSectionPatterns, TEMPLATE_FALLBACK_SECTION_PATTERNS } from './guard-routing.mjs';
|
|
24
24
|
import { assessArtifact, evaluateArtifact, reportArtifactStructure } from './guard-template-fidelity.mjs';
|
|
25
|
+
// 段界(下一个二级标题 / 文末)取 lib/section-body.mjs 的唯一实现:围栏代码块里的 `## ` 是正文示例。
|
|
26
|
+
import { sectionBody } from './section-body.mjs';
|
|
25
27
|
|
|
26
28
|
export const UI_DESIGN_SKILL = 'flow-comet-ui-design';
|
|
27
29
|
const APPLICABILITY_GATED_BINDINGS = new Set(['design.' + UI_DESIGN_SKILL]);
|
|
@@ -47,7 +49,7 @@ const TONE_MARKER_FIELD_VALUE = new RegExp(String.raw`(?:^|[\s|])(?:\*\*)?(?:`
|
|
|
47
49
|
|
|
48
50
|
// 「视觉调性」段读取四态(区分「CHANGE.md 不存在」「模板整份缺失」「段缺席」「段在场」——四者判据
|
|
49
51
|
// 不同:文件不存在时本门没有输入,交给其余门禁处理;模板整份缺失时段名无从派生(no-basis,按
|
|
50
|
-
//
|
|
52
|
+
// 「未校验」显式跳过);段缺席由适用性门控按「未显式标注」拦下)。
|
|
51
53
|
async function visualToneSectionState(changeName) {
|
|
52
54
|
if (!changeName) return { state: 'file-missing', body: null };
|
|
53
55
|
let text;
|
|
@@ -65,15 +67,11 @@ async function visualToneSectionState(changeName) {
|
|
|
65
67
|
if (headingPattern !== null && typeof headingPattern === 'object' && headingPattern.skip === true) {
|
|
66
68
|
return { state: 'no-basis', body: null };
|
|
67
69
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
if (body !== null) body += line + '\n';
|
|
76
|
-
}
|
|
70
|
+
// 段界由 lib/section-body.mjs 单点决定(围栏代码块里的 `## ` 不结束本段)。此前这里是一份围栏盲
|
|
71
|
+
// 的按行扫描:段内贴一段 Markdown 示例后,示例之后的「不适用」声明整段消失,非前端 change 被误判
|
|
72
|
+
// 成前端(要求一份本不该存在的 UI-DESIGN.md)。本判据自己的语义保留:只认二级标题(level: 2)、
|
|
73
|
+
// 分隔线不结束本段(endOnSeparator: false)——「视觉调性」段以 `---` 分隔清单是既有书写形态。
|
|
74
|
+
const body = sectionBody(text, headingPattern, { level: 2, endOnSeparator: false });
|
|
77
75
|
return body === null ? { state: 'section-missing', body: null } : { state: 'present', body };
|
|
78
76
|
}
|
|
79
77
|
|
|
@@ -137,8 +135,7 @@ export async function frontendCriterion(changeName) {
|
|
|
137
135
|
}
|
|
138
136
|
|
|
139
137
|
// design 出口 ui-design 工件门(按协议绑定键控:登记 ∧ 等级 = guarded ∧ 判据成立)——判据成立 ⇒
|
|
140
|
-
// 要求 UI-DESIGN.md
|
|
141
|
-
// 放行);判据不成立(非前端)⇒ 可见跳过行(含命中片段)后照常放行;协议删掉该绑定或等级非
|
|
138
|
+
// 要求 UI-DESIGN.md 在场:缺件 BLOCKED + 恢复指引(不静默放行);判据不成立(非前端)⇒ 可见跳过行(含命中片段)后照常放行;协议删掉该绑定或等级非
|
|
142
139
|
// guarded ⇒ 门未启用(同样可见输出),行为回到未登记绑定的原语义——闸门开关由协议表达。
|
|
143
140
|
export async function checkUiDesignArtifact(node, state) {
|
|
144
141
|
if (!state.activeChange || !isRegisteredApplicabilityBinding(node, UI_DESIGN_SKILL)) return;
|
|
@@ -161,13 +158,9 @@ export async function checkUiDesignArtifact(node, state) {
|
|
|
161
158
|
// 要求执行者显式写「不适用」(缺席与声明不适用是两件事,只有后者是决策)。
|
|
162
159
|
const toneRecovery = '在 .specs/' + state.activeChange + '/CHANGE.md 的「视觉调性」段填写选定调性,'
|
|
163
160
|
+ '或以结构形态标注「不适用」(非前端项目),然后重试 exit design';
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
process.exit(1);
|
|
168
|
-
}
|
|
169
|
-
console.error('UI-DESIGN: skipped(旧 change 兼容)——「视觉调性」段缺席,沿用旧口径判非前端');
|
|
170
|
-
return;
|
|
161
|
+
console.error('BLOCKED: CHANGE.md 的「视觉调性」段缺席——须显式标注「不适用」或填写调性(段缺席不默认判非前端)');
|
|
162
|
+
console.error('恢复: ' + toneRecovery);
|
|
163
|
+
process.exit(1);
|
|
171
164
|
}
|
|
172
165
|
if (!frontend.applicable) {
|
|
173
166
|
console.error('UI-DESIGN: skipped(非前端)——' + frontend.reason + ',不要求 UI-DESIGN.md');
|
|
@@ -194,11 +187,7 @@ export async function checkUiDesignArtifact(node, state) {
|
|
|
194
187
|
}
|
|
195
188
|
const recovery = '补 .specs/' + state.activeChange + '/UI-DESIGN.md(加载 ' + UI_DESIGN_SKILL + ' 并按其协议产出 design token / 反 AI-slop 自检),'
|
|
196
189
|
+ '或在 .specs/' + state.activeChange + '/CHANGE.md 的「视觉调性」段以结构形态标注「不适用」(非前端项目)后重试 exit design';
|
|
197
|
-
|
|
198
|
-
console.error('BLOCKED: design 出口缺 UI-DESIGN.md——' + frontend.reason + ',前端项目须产出 UI-DESIGN.md');
|
|
199
|
-
console.error('恢复: ' + recovery);
|
|
200
|
-
process.exit(1);
|
|
201
|
-
}
|
|
202
|
-
console.error('UI-DESIGN WARN: 缺 .specs/' + state.activeChange + '/UI-DESIGN.md——' + frontend.reason + '(旧 change 渐进不阻断;新 change 将强制)');
|
|
190
|
+
console.error('BLOCKED: design 出口缺 UI-DESIGN.md——' + frontend.reason + ',前端项目须产出 UI-DESIGN.md');
|
|
203
191
|
console.error('恢复: ' + recovery);
|
|
192
|
+
process.exit(1);
|
|
204
193
|
}
|