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
@@ -73,11 +73,11 @@ test('正本明令缺漏資訊要逐項問,不得自行編造', () => {
assert.match(prompt, /不得(自行|替使用者)?(編造|填入)/);
});
test('正本釘住 Mermaid flowchart 的節點上限與字數上限', () => {
assert.match(prompt, /flowchart/);
test('正本釘住抽象圖表的節點上限與字數上限', () => {
assert.match(prompt, /抽象節點與邊|抽象/);
assert.match(prompt, /12/);
assert.match(prompt, /8\s*字/);
assert.match(prompt, /拆(成多)?圖|不畫/);
assert.match(prompt, /拆圖|omitted/);
});
test('正本要求標籤只能從既有標籤挑,並指名用 labels-list 取得', () => {
@@ -95,13 +95,10 @@ test('正本逐一交代九個段落,且順序與模板一致', () => {
assertPromptListsSections(prompt, SECTIONS);
});
test('模板不把 mermaid 圍欄寫死:不畫圖時才不會留下渲染失敗的空區塊', () => {
assertDiagramPlaceholderOnly(template, '流程圖', '驗收標準');
});
test('正本交代了畫與不畫兩種情況各該填什麼', () => {
assert.match(prompt, /```mermaid/);
assert.match(prompt, /不要加圍欄|不加圍欄/);
test('正本交代圖表由 renderer 重新產生', () => {
assert.match(prompt, /overview-render\.js/);
assert.match(prompt, /重新產生 SVG/);
assert.match(prompt, /產生 Mermaid/);
});
// ── 計時 ───────────────────────────────────────────────────────────