feat(overview-artifact): 產生可預覽總覽與截圖 fallback

This commit is contained in:
2026-09-18 15:59:34 +08:00
parent c545f11ec1
commit 867a23497f
16 changed files with 605 additions and 324 deletions
+7 -10
View File
@@ -99,14 +99,11 @@ test('關聯段落必須指回來源需求議題', () => {
assert.match(phase2, /需求議題:#/);
});
test('架構圖依性質三選一,並釘住節點與字數上限', () => {
for (const kind of ['sequenceDiagram', 'flowchart', 'stateDiagram-v2']) {
assert.match(prompt, new RegExp(kind));
}
const limits = prompt.slice(prompt.indexOf('## 架構圖的限制'));
assert.match(limits, /12/);
assert.match(limits, /8\s*字/);
assert.match(limits, /拆成多張圖|不畫/);
test('架構圖使用抽象資料並釘住節點與字數上限', () => {
assert.match(prompt, /抽象.*kind|抽象.*nodes/);
assert.match(prompt, /12/);
assert.match(prompt, /8\s*字/);
assert.match(prompt, /拆圖|omitted/);
});
test('寫入前先試跑,且試跑的價值有被說明', () => {
@@ -132,7 +129,7 @@ test('第二段明列它「不做」的事,避免搶走後續流程的工作',
assert.match(boundary, /不寫人天估算/);
});
test('「不畫圖」是有條件的退路,不是免死金牌', () => {
test('缺少圖表資料時必須留下可追蹤原因', () => {
const limits = prompt.slice(prompt.indexOf('## 架構圖的限制'));
assert.match(limits, /只在超過上限拆不開、或畫了不會比文字更清楚時/);
assert.match(limits, /拆圖|omitted/);
});