universal-dev-standards 5.14.0 → 5.16.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.
Files changed (134) hide show
  1. package/bin/uds.js +2 -0
  2. package/bundled/ai/standards/acceptance-criteria-traceability.ai.yaml +31 -0
  3. package/bundled/ai/standards/ai-instruction-standards.ai.yaml +190 -3
  4. package/bundled/ai/standards/forward-derivation-standards.ai.yaml +23 -0
  5. package/bundled/ai/standards/knowledge-graph-memory.ai.yaml +83 -0
  6. package/bundled/core/acceptance-criteria-traceability.md +46 -0
  7. package/bundled/core/ai-instruction-standards.md +136 -11
  8. package/bundled/core/forward-derivation-standards.md +19 -0
  9. package/bundled/core/knowledge-graph-memory.md +119 -0
  10. package/bundled/locales/COVERAGE.md +226 -0
  11. package/bundled/locales/zh-CN/CHANGELOG.md +42 -3
  12. package/bundled/locales/zh-CN/README.md +1 -1
  13. package/bundled/locales/zh-CN/SECURITY.md +1 -1
  14. package/bundled/locales/zh-CN/core/acceptance-criteria-traceability.md +46 -0
  15. package/bundled/locales/zh-CN/core/ai-instruction-standards.md +111 -5
  16. package/bundled/locales/zh-CN/core/forward-derivation-standards.md +19 -0
  17. package/bundled/locales/zh-CN/skills/ac-coverage/SKILL.md +194 -0
  18. package/bundled/locales/zh-CN/skills/adr-assistant/SKILL.md +135 -40
  19. package/bundled/locales/zh-CN/skills/brainstorm-assistant/SKILL.md +217 -63
  20. package/bundled/locales/zh-CN/skills/brainstorm-assistant/guide.md +599 -0
  21. package/bundled/locales/zh-CN/skills/commands/brainstorm.md +92 -25
  22. package/bundled/locales/zh-CN/skills/commit-standards/SKILL.md +78 -16
  23. package/bundled/locales/zh-CN/skills/contract-test-assistant/SKILL.md +85 -26
  24. package/bundled/locales/zh-CN/skills/deploy-assistant/SKILL.md +189 -0
  25. package/bundled/locales/zh-CN/skills/dev-methodology/SKILL.md +110 -0
  26. package/bundled/locales/zh-CN/skills/dev-methodology/guide.md +255 -0
  27. package/bundled/locales/zh-CN/skills/dev-workflow-guide/SKILL.md +70 -11
  28. package/bundled/locales/zh-CN/skills/journey-test-assistant/SKILL.md +209 -0
  29. package/bundled/locales/zh-CN/skills/knowledge-graph/SKILL.md +58 -0
  30. package/bundled/locales/zh-CN/skills/knowledge-graph/guide.md +74 -0
  31. package/bundled/locales/zh-CN/skills/migration-assistant/SKILL.md +125 -8
  32. package/bundled/locales/zh-CN/skills/observability-assistant/guide.md +188 -0
  33. package/bundled/locales/zh-CN/skills/orchestrate/SKILL.md +173 -0
  34. package/bundled/locales/zh-CN/skills/plan/SKILL.md +240 -0
  35. package/bundled/locales/zh-CN/skills/push/SKILL.md +242 -0
  36. package/bundled/locales/zh-CN/skills/retrospective-assistant/SKILL.md +104 -36
  37. package/bundled/locales/zh-CN/skills/reverse-engineer/SKILL.md +88 -32
  38. package/bundled/locales/zh-CN/skills/runbook-assistant/guide.md +216 -0
  39. package/bundled/locales/zh-CN/skills/skill-builder/SKILL.md +149 -0
  40. package/bundled/locales/zh-CN/skills/slo-assistant/guide.md +188 -0
  41. package/bundled/locales/zh-CN/skills/spec-derivation/SKILL.md +86 -0
  42. package/bundled/locales/zh-CN/skills/spec-derivation/guide.md +476 -0
  43. package/bundled/locales/zh-CN/skills/spec-driven-dev/SKILL.md +155 -81
  44. package/bundled/locales/zh-CN/skills/sweep/SKILL.md +151 -0
  45. package/bundled/locales/zh-CN/skills/testing-guide/SKILL.md +207 -110
  46. package/bundled/locales/zh-TW/CHANGELOG.md +46 -3
  47. package/bundled/locales/zh-TW/README.md +1 -1
  48. package/bundled/locales/zh-TW/SECURITY.md +1 -1
  49. package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +46 -0
  50. package/bundled/locales/zh-TW/core/ai-instruction-standards.md +130 -5
  51. package/bundled/locales/zh-TW/core/browser-compatibility-standards.md +222 -5
  52. package/bundled/locales/zh-TW/core/contract-testing-standards.md +184 -5
  53. package/bundled/locales/zh-TW/core/cross-flow-regression.md +192 -5
  54. package/bundled/locales/zh-TW/core/forward-derivation-standards.md +19 -0
  55. package/bundled/locales/zh-TW/core/knowledge-graph-memory.md +127 -0
  56. package/bundled/locales/zh-TW/core/release-readiness-gate.md +186 -5
  57. package/bundled/locales/zh-TW/core/self-review-protocol.md +9 -1
  58. package/bundled/locales/zh-TW/skills/ac-coverage/SKILL.md +192 -0
  59. package/bundled/locales/zh-TW/skills/adr-assistant/SKILL.md +21 -42
  60. package/bundled/locales/zh-TW/skills/ai-collaboration-standards/SKILL.md +5 -1
  61. package/bundled/locales/zh-TW/skills/brainstorm-assistant/SKILL.md +212 -59
  62. package/bundled/locales/zh-TW/skills/brainstorm-assistant/guide.md +266 -579
  63. package/bundled/locales/zh-TW/skills/commands/brainstorm.md +91 -26
  64. package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +77 -15
  65. package/bundled/locales/zh-TW/skills/contract-test-assistant/SKILL.md +75 -16
  66. package/bundled/locales/zh-TW/skills/deploy-assistant/SKILL.md +187 -0
  67. package/bundled/locales/zh-TW/skills/dev-methodology/SKILL.md +108 -0
  68. package/bundled/locales/zh-TW/skills/dev-methodology/guide.md +255 -0
  69. package/bundled/locales/zh-TW/skills/dev-workflow-guide/SKILL.md +125 -64
  70. package/bundled/locales/zh-TW/skills/journey-test-assistant/SKILL.md +222 -0
  71. package/bundled/locales/zh-TW/skills/knowledge-graph/SKILL.md +56 -0
  72. package/bundled/locales/zh-TW/skills/knowledge-graph/guide.md +74 -0
  73. package/bundled/locales/zh-TW/skills/migration-assistant/SKILL.md +128 -11
  74. package/bundled/locales/zh-TW/skills/observability-assistant/guide.md +188 -0
  75. package/bundled/locales/zh-TW/skills/orchestrate/SKILL.md +173 -0
  76. package/bundled/locales/zh-TW/skills/plan/SKILL.md +240 -0
  77. package/bundled/locales/zh-TW/skills/project-structure-guide/SKILL.md +5 -1
  78. package/bundled/locales/zh-TW/skills/push/SKILL.md +242 -0
  79. package/bundled/locales/zh-TW/skills/retrospective-assistant/SKILL.md +94 -28
  80. package/bundled/locales/zh-TW/skills/reverse-engineer/SKILL.md +84 -28
  81. package/bundled/locales/zh-TW/skills/runbook-assistant/guide.md +216 -0
  82. package/bundled/locales/zh-TW/skills/skill-builder/SKILL.md +165 -0
  83. package/bundled/locales/zh-TW/skills/slo-assistant/guide.md +188 -0
  84. package/bundled/locales/zh-TW/skills/spec-derivation/SKILL.md +83 -0
  85. package/bundled/locales/zh-TW/skills/spec-derivation/guide.md +476 -0
  86. package/bundled/locales/zh-TW/skills/spec-driven-dev/SKILL.md +148 -77
  87. package/bundled/locales/zh-TW/skills/sweep/SKILL.md +149 -0
  88. package/bundled/locales/zh-TW/skills/testing-guide/SKILL.md +141 -44
  89. package/bundled/skills/adr-assistant/SKILL.md +1 -1
  90. package/bundled/skills/ai-collaboration-standards/SKILL.md +1 -1
  91. package/bundled/skills/ai-friendly-architecture/SKILL.md +1 -1
  92. package/bundled/skills/ai-instruction-standards/SKILL.md +1 -1
  93. package/bundled/skills/api-design-assistant/SKILL.md +1 -1
  94. package/bundled/skills/audit-assistant/SKILL.md +1 -1
  95. package/bundled/skills/brainstorm-assistant/SKILL.md +142 -106
  96. package/bundled/skills/brainstorm-assistant/guide.md +256 -661
  97. package/bundled/skills/ci-cd-assistant/SKILL.md +1 -1
  98. package/bundled/skills/commands/brainstorm.md +51 -30
  99. package/bundled/skills/contract-test-assistant/SKILL.md +1 -1
  100. package/bundled/skills/database-assistant/SKILL.md +1 -1
  101. package/bundled/skills/deploy-assistant/SKILL.md +1 -1
  102. package/bundled/skills/documentation-guide/SKILL.md +1 -1
  103. package/bundled/skills/error-code-guide/SKILL.md +1 -1
  104. package/bundled/skills/git-workflow-guide/SKILL.md +1 -1
  105. package/bundled/skills/incident-response-assistant/SKILL.md +1 -1
  106. package/bundled/skills/journey-test-assistant/SKILL.md +1 -1
  107. package/bundled/skills/knowledge-graph/SKILL.md +58 -0
  108. package/bundled/skills/knowledge-graph/guide.md +69 -0
  109. package/bundled/skills/logging-guide/SKILL.md +1 -1
  110. package/bundled/skills/observability-assistant/SKILL.md +1 -1
  111. package/bundled/skills/orchestrate/SKILL.md +1 -1
  112. package/bundled/skills/plan/SKILL.md +1 -1
  113. package/bundled/skills/pr-automation-assistant/SKILL.md +1 -1
  114. package/bundled/skills/project-structure-guide/SKILL.md +1 -1
  115. package/bundled/skills/push/SKILL.md +1 -1
  116. package/bundled/skills/retrospective-assistant/SKILL.md +1 -1
  117. package/bundled/skills/reverse-engineer/SKILL.md +1 -1
  118. package/bundled/skills/runbook-assistant/SKILL.md +1 -1
  119. package/bundled/skills/security-assistant/SKILL.md +1 -1
  120. package/bundled/skills/security-scan-assistant/SKILL.md +1 -1
  121. package/bundled/skills/slo-assistant/SKILL.md +1 -1
  122. package/bundled/skills/sweep/SKILL.md +1 -1
  123. package/bundled/skills/testing-guide/SKILL.md +1 -1
  124. package/package.json +2 -2
  125. package/src/commands/check.js +80 -0
  126. package/src/commands/init.js +8 -1
  127. package/src/commands/update.js +49 -14
  128. package/src/i18n/messages.js +32 -5
  129. package/src/installers/skills-installer.js +49 -0
  130. package/src/lint/i18n.js +424 -0
  131. package/src/utils/config-manager.js +39 -0
  132. package/src/utils/skills-installer.js +39 -7
  133. package/standards-registry.json +16 -4
  134. package/bundled/locales/zh-TW/docs/SKILL-FALLBACK-GUIDE.md +0 -407
@@ -1,11 +1,198 @@
1
1
  ---
2
2
  source: ../../../core/cross-flow-regression.md
3
3
  source_version: 1.0.0
4
- translation_version: 0.0.0
5
- last_synced: 2026-05-05
4
+ translation_version: 1.0.0
5
+ last_synced: 2026-06-02
6
+ source_hash: 2f7bdbe6dc36
6
7
  ---
7
8
 
8
- <!-- TODO: 待完整繁體中文翻譯 — Translation pending -->
9
- <!-- See source: core/cross-flow-regression.md -->
9
+ # 跨流程回歸(Cross-Flow Regression)
10
10
 
11
- > 此標準尚未完整翻譯。請參閱英文原文:[English](../../../core/cross-flow-regression.md)
11
+ > **語言**:[English](../../../core/cross-flow-regression.md) | 繁體中文
12
+
13
+ **版本**:1.0.0
14
+ **最後更新**:2026-05-05
15
+ **適用範圍**:所有具有多個 user flow 或業務流程的軟體專案
16
+ **Scope**:universal
17
+ **業界標準**:ISTQB Advanced Test Analyst(Regression Test Strategy)
18
+ **參考資料**:`core/flow-based-testing.md`、`core/testing-standards.md`
19
+
20
+ ---
21
+
22
+ ## 目的
23
+
24
+ 本標準定義跨流程回歸測試(cross-flow regression testing)——驗證對某一個 flow 的修改不會破壞其他 flow,並確保**多個 flow 的組合**在依序執行時行為正確。
25
+
26
+ ### 與 `flow-based-testing.md` 的界線
27
+
28
+ | 標準 | 範圍 | 它能捕捉的問題 |
29
+ |----------|-------|----------------|
30
+ | `flow-based-testing.md`(Multi-Gate Model) | 單一 flow:Decision Points、Terminal States、Decision Table | flow 內部的分支覆蓋缺口 |
31
+ | **本標準** | 多個 flow:互動、共享狀態、依序組合 | flow 之間的污染、累積狀態 bug、跨 flow 的回歸 |
32
+
33
+ 這兩者是互補而非重疊的關係。一個專案兩者都需要。
34
+
35
+ ---
36
+
37
+ ## 為何跨流程 bug 與眾不同
38
+
39
+ flow 內部測試(Multi-Gate)能證明「Login」處理了全部 7 種 terminal state。但它無法偵測:
40
+
41
+ - **狀態污染(State contamination)**:在一次失敗的「Create Order」(FAIL_QUOTA_EXCEEDED)之後,quota 計數器遭到破壞 → 即使 quota 已重置,下一次「Create Order」嘗試仍然失敗
42
+ - **共享資源衝突(Shared resource conflicts)**:「Report Generation」與「Data Export」同時執行時,破壞了共用的暫存目錄
43
+ - **依序相依(Sequential dependency)**:「Cancel Subscription」成功,但後續的「Reactivate」flow 假設訂閱仍然存在 → NullPointerException
44
+
45
+ ---
46
+
47
+ ## 跨流程 Test Suite 定義
48
+
49
+ ### Tier-1:Critical User Journeys(CUJ,關鍵使用者旅程)
50
+
51
+ Critical User Journeys 是橫跨 ≥ 2 個 flow 的端到端序列,代表核心業務價值路徑。每一次 release 都必須包含一套 CUJ regression suite。
52
+
53
+ **CUJ 識別**:
54
+ 1. 列出所有 flow(來自 requirement-template §2.4)
55
+ 2. 找出共享狀態或常被依序執行的 pair/triple(成對/三組組合)
56
+ 3. 標記業務關鍵的組合(purchase、onboarding、authentication + 下游流程)
57
+
58
+ **CUJ 覆蓋率要求**:
59
+
60
+ | 指標 | Tier-2 門檻(預設) | Tier-1 關鍵路徑 |
61
+ |--------|--------------------------|---------------------|
62
+ | CUJ 通過率 | ≥ 95% | 100% |
63
+ | 業務關鍵 flow 組合 | 100% | 100% |
64
+
65
+ ### Tier-2:flow 變更時的回歸
66
+
67
+ 當任何 flow 的 §2.4(Decision Points、Terminal States)被修改時,整套 CUJ suite 必須重新執行——而不只是執行被修改 flow 的測試。觸發邏輯:
68
+
69
+ ```bash
70
+ # In CI: detect flow spec changes
71
+ changed_flows=$(git diff origin/main... --name-only | grep -E "requirement-template|SPEC.*\.md")
72
+ if [ -n "$changed_flows" ]; then
73
+ npm run test:cross-flow-regression
74
+ fi
75
+ ```
76
+
77
+ ### Tier-3:並行與共享資源測試
78
+
79
+ 針對具有並行使用者操作的專案:
80
+ - 兩位使用者同時執行相同的 flow
81
+ - Flow A 與 Flow B 共用一個寫入資源
82
+ - 長時間執行的 flow(非同步)與短 flow 的結果互動
83
+
84
+ ---
85
+
86
+ ## 測試結構
87
+
88
+ 跨流程回歸測試採用跨 flow 的**依序狀態穿引(sequential state threading)**(延伸自 `flow-based-testing.md` 的 `ctx` 模式):
89
+
90
+ ```typescript
91
+ describe("CUJ: Register → Verify Email → Create First Order", () => {
92
+ const ctx: {
93
+ userId?: string
94
+ token?: string
95
+ orderId?: string
96
+ } = {}
97
+
98
+ // Flow 1: Register
99
+ it("Flow-1 Step 1: Register new user", async () => {
100
+ ctx.userId = await registerUser({ email: testEmail, plan: "trial" })
101
+ expect(ctx.userId).toBeDefined()
102
+ })
103
+
104
+ // Flow 2: Email Verification (depends on Flow 1 output)
105
+ it("Flow-2 Step 1: Verify email token", async () => {
106
+ const token = await getEmailToken(ctx.userId!)
107
+ ctx.token = await verifyEmail(token)
108
+ expect(ctx.token).toBeDefined()
109
+ })
110
+
111
+ // Flow 3: Create Order (depends on Flow 2 auth token)
112
+ it("Flow-3 Step 1: Create first order", async () => {
113
+ ctx.orderId = await createOrder(ctx.token!, orderPayload)
114
+ expect(ctx.orderId).toMatch(/^ord-/)
115
+ })
116
+
117
+ // Cross-flow verification: order state reflects trial plan limits
118
+ it("Cross-flow: Trial plan quota enforced on first order", async () => {
119
+ const order = await getOrder(ctx.token!, ctx.orderId!)
120
+ expect(order.quota_applied).toBe("trial")
121
+ })
122
+ })
123
+ ```
124
+
125
+ ### 跨流程失敗隔離
126
+
127
+ 當一個跨流程測試失敗時,失敗訊息必須指出是**哪一個 flow** 引入了狀態破壞:
128
+
129
+ ```typescript
130
+ // BAD: generic assertion
131
+ expect(result).toBe("success")
132
+
133
+ // GOOD: includes flow context
134
+ expect(result).toBe("success") // Flow-3 depends on Flow-2 token being valid
135
+ // If this fails, check Flow-2 email verification output
136
+ ```
137
+
138
+ ---
139
+
140
+ ## 與 Release Gate 的整合
141
+
142
+ 跨流程回歸是 `release-readiness-gate.md` 中的 **Dimension 6**(Tier-2)。
143
+
144
+ ### 觸發條件
145
+
146
+ | 觸發時機 | 範圍 |
147
+ |---------|-------|
148
+ | 每一個 release candidate | 整套 CUJ suite |
149
+ | 修改任何 flow §2.4 的 PR | 整套 CUJ suite(merge 前) |
150
+ | 部署至 staging 後 | CUJ 的 smoke 子集 |
151
+ | 部署至 production 後 | 僅關鍵路徑 CUJ(canary) |
152
+
153
+ ### Sign-off 的證據
154
+
155
+ ```
156
+ | 6 | Cross-flow Regression | PASS | CUJ suite: 47/47 passed; 0 flow-interaction failures | QA Lead |
157
+ ```
158
+
159
+ ### WARN 門檻
160
+
161
+ - CUJ 通過率 ≥ 95% 但 < 100% → WARN,並需記錄具體失敗的 CUJ 並完成 root-cause(根因分析)
162
+ - CUJ 通過率 < 95% → FAIL(release 被封鎖)
163
+ - 業務關鍵組合失敗 → FAIL,無論整體通過率如何
164
+
165
+ ---
166
+
167
+ ## 反模式(Anti-Patterns)
168
+
169
+ - **只在 CI 緩慢時才跑跨流程測試**——依定義,它們必須在每一個 release candidate 上執行
170
+ - **孤立地測試每個 flow 卻稱之為「regression」**——flow 的孤立測試已由 Multi-Gate 涵蓋;跨流程測試必須具備 flow 之間的狀態相依關係
171
+ - **在不相關的 `describe` 區塊間重複使用同一個 `ctx` 物件**——每個 CUJ 都需要乾淨、隔離的 `ctx`;CUJ 之間的污染會掩蓋 bug
172
+ - **失敗訊息中缺乏 flow 歸屬(attribution)**——跨流程失敗難以除錯;務必指出是哪個上游 flow 產生了被破壞的狀態
173
+ - **把 CUJ 失敗當成 flaky(不穩定)**——跨流程狀態 bug 是確定性的;「flaky」的跨流程測試幾乎都是共享狀態破壞的徵兆
174
+
175
+ ---
176
+
177
+ ## 與其他標準的關係
178
+
179
+ - **`flow-based-testing.md`** —— flow 內部的 gate(跨流程的前置條件)
180
+ - **`testing-standards.md`** —— testing pyramid 中的 regression 層
181
+ - **`release-readiness-gate.md`** —— Dimension 6(Tier-2)
182
+ - **`e2e-testing.md`** —— CUJ 測試通常在 E2E 或 System Test 層級執行
183
+
184
+ ---
185
+
186
+ ## 版本歷史
187
+
188
+ | 版本 | 日期 | 變更 |
189
+ |---------|------|---------|
190
+ | 1.0.0 | 2026-05-05 | 初版發布:CUJ 定義、依序狀態穿引、release gate 標準、Tier-1/2/3 分類 |
191
+
192
+ ---
193
+
194
+ ## 授權
195
+
196
+ 本標準依 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授權發布。
197
+
198
+ **來源**:[universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
@@ -333,6 +333,25 @@ spec-review → forward-derivation → discovery
333
333
 
334
334
  ---
335
335
 
336
+ ## 終端投影:使用者指南
337
+
338
+ 推演鏈不止於測試。**使用者指南是同一條鏈的終端投影**——E2E/旅程測試以機器驗證的那條作業流程,其供人閱讀的視圖。「使用者讀到的操作步驟」與「E2E 實際驗證的行為」因此成為一個被維持的不變量。
339
+
340
+ - **單一真實來源**:SPEC 的驗收條件(AC)。所有下游產物——BDD 場景、TDD/IT/E2E 骨架、ATDD 表格、契約,**以及使用者指南**——都是同一條 AC 主幹的投影。使用者指南不是另一個要互相對照的來源,而是又一個投影。
341
+ - **僅限 user-facing AC**:唯有**終端使用者可直接觀察或操作**的 AC(UI 流程、CLI 指令、對外 API 的使用者語意)才需要使用者指南步驟。純內部 AC(重構、內部模組契約、效能門檻、安全內控)無使用者指南義務。**判不準時一律歸 user-facing**——保守預設;必須明確標記才能排除。
342
+ - **共用編號(`T-NNN`)**:每個使用者指南步驟標 `T-NNN`,且該 `T-NNN` 必須是某個真實 journey/E2E 測試的 id。使用者指南與 E2E 套件是同一作業流程的兩個投影、共用一把尺。模稜兩可或未標記一律報為**未覆蓋**(寧可冗餘不要遺漏)。
343
+ - ✅ 使用者指南步驟 `T-012「建立專案」` ↔ journey spec 中的 E2E 測試 `T-012`。
344
+ - ❌ 使用者指南自造 `UG-3` 卻無對應測試 → drift,報為未覆蓋。
345
+ - **Drift 反例**:使用者指南寫「2-click checkout」、E2E 卻仍驗「3-step payment」——沒有共用編號就無人察覺。共用 `T-NNN` 把這種 drift 變成被報出的覆蓋缺口。
346
+
347
+ ### 單一主幹原則(非平行對照)
348
+
349
+ 測試與文件來源是**同一條 AC 主幹的多層投影**,不是互相對照的獨立真實來源。TDD/IT/E2E 是同一主幹的金字塔**層級**(依 AC 性質分層),非彼此競爭的來源。兩兩對照 N 個來源(N×N)會滋生 drift;把每個產物投影回單一 AC 主幹(N×1)則消除它。
350
+
351
+ > **規則**:每個測試或文件產物都必須回溯到某個 AC。另立**平行編號體系**——一條脫離 AC 主幹的第二套 `T-NNN` 系列——即為違規。只有一把尺:AC 主幹,且 `T-NNN` 由 journey/E2E 測試與使用者指南共用。
352
+
353
+ ---
354
+
336
355
  ## 命令
337
356
 
338
357
  ### 命令參考
@@ -0,0 +1,127 @@
1
+ ---
2
+ source: ../../../core/knowledge-graph-memory.md
3
+ source_version: 1.0.0
4
+ translation_version: 1.0.0
5
+ last_synced: 2026-05-30
6
+ status: current
7
+ ---
8
+
9
+ # Knowledge Graph Memory Standards(知識圖記憶標準)
10
+
11
+ > **語言**: [English](../../../core/knowledge-graph-memory.md) | 繁體中文
12
+
13
+ **版本**: 1.0.0
14
+ **最後更新**: 2026-05-30
15
+ **適用範圍**: 在「程式碼 + 規格/決策」語料上使用 AI 助手的專案
16
+ **Scope**: uds-specific
17
+
18
+ ---
19
+
20
+ ## 目的
21
+
22
+ 本標準定義一套**關係 schema**,讓規格、決策與程式碼能以圖的方式遍歷——回答如*「我若修改 `execute()`,會影響哪些規格與決策?」*的問題。它與向量/語意記憶(找出*相似*的產物)互補,提供**結構遍歷**(找出*有關聯*的產物)。
23
+
24
+ 此 schema 與引擎無關:以純 Markdown front-matter 表達,AI 助手可直接讀取(降級模式),亦可由可選的圖引擎(如 [EngramGraph](https://github.com/AsiaOstrich/EngramGraph))索引以進行多跳查詢(服務模式)。
25
+
26
+ ---
27
+
28
+ ## 快速參考
29
+
30
+ ### 關係 Front-Matter Schema
31
+
32
+ 在規格/決策文件的 YAML front-matter 中加入以下可選欄位:
33
+
34
+ | 欄位 | 型別 | 方向 | 意義 |
35
+ |------|------|------|------|
36
+ | `related` | id 列表 | 無向 | 鬆散關聯的產物 |
37
+ | `impacts` | spec id 列表 | this → spec | 此決策改動那些規格 |
38
+ | `impacted_by` | decision id 列表 | decision → this | 那些決策改動此規格 |
39
+ | `supersedes` | decision id 列表 | this → decision | 此決策取代那些決策 |
40
+ | `implements` | spec id 列表 | code/spec → spec | 此產物實作那些規格 |
41
+
42
+ id 為產物識別碼(如 `XSPEC-205`、`DEC-062`、`ADR-001`)。內文的 `[[XSPEC-NNN]]` wiki 連結是等效但較低保真度的訊號。
43
+
44
+ ### 節點種類
45
+
46
+ | 前綴 | 節點種類 |
47
+ |------|---------|
48
+ | `XSPEC-*` / `SPEC-*` | Spec |
49
+ | `DEC-*` / `ADR-*` | Decision |
50
+ | 函式/類別/模組(來自程式碼)| Code 節點 |
51
+
52
+ ---
53
+
54
+ ## 1. Schema
55
+
56
+ ### 1.1 Front-Matter 範例
57
+
58
+ ```markdown
59
+ ---
60
+ id: XSPEC-205
61
+ title: Agent/Role Spec SDD Variant
62
+ status: Implemented
63
+ impacted_by: [DEC-062]
64
+ related: [XSPEC-204]
65
+ ---
66
+ ```
67
+
68
+ ```markdown
69
+ ---
70
+ id: DEC-069
71
+ title: EngramGraph Architecture
72
+ date: 2026-05-27
73
+ supersedes: [DEC-057]
74
+ impacts: [XSPEC-237]
75
+ ---
76
+ ```
77
+
78
+ ### 1.2 邊的推導
79
+
80
+ | 文件上的 front-matter | 推導出的邊 |
81
+ |----------------------|-----------|
82
+ | Decision `impacts: [SPEC]` | `IMPACTS`(Decision → Spec)|
83
+ | Spec `impacted_by: [DEC]` | `IMPACTS`(Decision → Spec)|
84
+ | Decision `supersedes: [DEC]` | `SUPERSEDES`(Decision → Decision)|
85
+ | Decision 內文 `[[XSPEC-NNN]]` 連結 | `IMPACTS`(Decision → Spec)|
86
+
87
+ 邊是**冪等**的:同一關係從兩端宣告(決策的 `impacts` 與規格的 `impacted_by`)只產生一條邊,不會重複。
88
+
89
+ ---
90
+
91
+ ## 2. 兩種運作模式
92
+
93
+ 本標準的消費者**必須**同時支援兩種模式:
94
+
95
+ ### 2.1 降級模式(無引擎)
96
+
97
+ AI 助手讀取目標文件,沿其 front-matter/`[[ref]]` 連結讀取被連結檔案,手動組出影響鏈。隨時可用;受限於助手能讀取的檔案數。
98
+
99
+ ### 2.2 服務模式(有圖引擎)
100
+
101
+ 語料被索引進圖引擎;助手送出單一多跳查詢(如 `impact-analysis { nodeId, maxHops }`)取得完整鏈——包含降級模式會漏掉的跨域連結(code → spec → decision)。
102
+
103
+ > 正確實作在兩種模式下產生**相同形狀的答案**;服務模式只是更快更完整,並非本質不同。
104
+
105
+ ---
106
+
107
+ ## 3. Confidence(可選)
108
+
109
+ 節點**可**帶 `confidence`,範圍 `[0.1, 1.0]`。回饋訊號(測試通過/失敗、人工修正、狀態變更)演化 confidence,讓讀取時優先浮現最被強化的產物。confidence 有下限(永不歸零),使連續失敗無法抹除重要節點。此為自我演化圖記憶(SAGE)的基礎。
110
+
111
+ ---
112
+
113
+ ## 4. 規則
114
+
115
+ 1. 關係欄位**可選**且**附加**——缺少永不破壞工具。
116
+ 2. 允許參照尚不存在的 id;它們成為 stub 節點,待目標文件出現時解析。
117
+ 3. 從*擁有*該關係的一端宣告(決策擁有 `impacts`/`supersedes`;規格擁有 `impacted_by`),但兩端皆接受。
118
+ 4. 圖引擎為 **opt-in**。未設定引擎時工具**必須**優雅降級為 Markdown 讀取。
119
+ 5. 向量/語意記憶為**互補**而非取代——結構用圖遍歷,相似用向量。
120
+
121
+ ---
122
+
123
+ ## 相關標準
124
+
125
+ - [Project Context Memory](project-context-memory.md) — 每專案長期事實
126
+ - [Developer Memory](developer-memory.md) — 通用、可攜偏好
127
+ - [ADR Standards](adr-standards.md) — 餵入 Decision 節點的決策紀錄格式
@@ -1,11 +1,192 @@
1
1
  ---
2
2
  source: ../../../core/release-readiness-gate.md
3
3
  source_version: 1.0.0
4
- translation_version: 0.0.0
5
- last_synced: 2026-05-05
4
+ translation_version: 1.0.0
5
+ last_synced: 2026-06-02
6
+ source_hash: 3d156e19680e
6
7
  ---
7
8
 
8
- <!-- TODO: 待完整繁體中文翻譯 — Translation pending -->
9
- <!-- See source: core/release-readiness-gate.md -->
9
+ # 發布就緒閘門(Release Readiness Gate)
10
10
 
11
- > 此標準尚未完整翻譯。請參閱英文原文:[English](../../../core/release-readiness-gate.md)
11
+ > **語言**:[English](../../../core/release-readiness-gate.md) | 繁體中文
12
+
13
+ **版本**:1.0.0
14
+ **最後更新**:2026-05-05
15
+ **適用範圍**:所有準備進行生產環境發布的軟體專案
16
+ **Scope**:universal
17
+ **業界標準**:ISO/IEC 25010(產品品質)、ISTQB Advanced Test Manager
18
+ **參考文件**:`core/release-quality-manifest.md`、`core/flow-based-testing.md`
19
+
20
+ ---
21
+
22
+ ## 目的
23
+
24
+ 本標準定義一個**單一、彙整式的發布就緒閘門(Release Readiness Gate)**,將所有品質維度統一成生產部署前一個明確的 go/no-go 決策。
25
+
26
+ 若沒有這個閘門,品質證據會散落在 16 個以上的獨立標準中。團隊雖然通過了個別檢查,卻在未驗證某些維度的情況下出貨,因為沒有任何一份文件明說「你必須在發布前通過*所有這些項目*」。
27
+
28
+ 發布就緒閘門:
29
+ - **彙整(Aggregates)** 16 個品質維度成為一份分級 checklist
30
+ - **連結(Connects)** 人工 sign-off(本文件)與機器可讀的證據(`release-quality-manifest.md`)
31
+ - **區分(Distinguishes)** 阻擋性條件與建議性警告
32
+ - **可伸縮(Scales)** 透過 Tier-1 / Tier-2 / Tier-3 分級,以適應不同類型與風險等級的專案
33
+
34
+ ---
35
+
36
+ ## 與發布品質清單(Release Quality Manifest, RQM)的關係
37
+
38
+ | 產物 | 格式 | 對象 | 目的 |
39
+ |----------|--------|----------|---------|
40
+ | **發布就緒 Sign-off**(本文件的範本) | Markdown checklist | 人類(PM、QA、Eng Lead、Business) | Go/no-go 決策、責任歸屬、稽核軌跡 |
41
+ | **發布品質清單**(`release-quality-manifest.md`) | YAML/JSON | CI、工具、客戶 | 機器可讀的彙整、自動化閘門強制執行 |
42
+
43
+ 這兩份產物在每次發布時**並行(in parallel)**產生。Sign-off 涵蓋人工驗證的維度;RQM 涵蓋自動化的維度。兩者在生產部署前都必須為 `PASS` / `WARN`(絕不可為 `FAIL`)。
44
+
45
+ ---
46
+
47
+ ## Tier 分級
48
+
49
+ | Tier | 要求 | 未達標 = ? | 適用對象 |
50
+ |------|-------------|---------|-------------|
51
+ | **Tier-1** | 必須通過;若 `FAIL` 則阻擋發布 | 硬性阻擋(Hard block) | 所有專案 |
52
+ | **Tier-2** | 應通過;`WARN` 須記錄理由;不阻擋 | 記錄在案的 WARN | 所有專案 |
53
+ | **Tier-3** | 當功能集或領域需要時才適用;`N/A` 為有效狀態 | 接受 N/A | 取決於專案類型 |
54
+
55
+ ---
56
+
57
+ ## 16 維度發布就緒矩陣
58
+
59
+ | # | 維度 | Tier | 閘門類型 | 阻擋條件 | 證據 | 標準 | 負責人 |
60
+ |---|-----------|------|-----------|-------------------|----------|---------|-------------|
61
+ | 1 | **效能 / 負載(Performance / Load)** | 2 | 自動化 | p95 latency 退化 > 10%;headroom < 20% | 負載測試報告 | `performance-standards.md` | Eng Lead + SRE |
62
+ | 2 | **安全性(Security)**(SAST/DAST/SCA/secrets) | 1 | 自動化 | 任何 Critical/High CVE、SAST High 未修、diff 中含 secret | SARIF、Trivy、SBOM | `pipeline-security-gates.md` | SecEng / Eng Lead |
63
+ | 3 | **無障礙(Accessibility, a11y)** | 2 | 自動化 + 人工 | axe-core critical > 0;鍵盤導覽路徑中斷 | axe 報告、screen reader 紀錄 | `accessibility-standards.md` §Release-Blocking Threshold | QA + UX |
64
+ | 4 | **API / 合約測試(Contract Testing)** | 3 | 自動化 | 上游 consumer contract 為紅;N-1 相容性中斷 | Pact broker 報告 | `contract-testing-standards.md` | API owner |
65
+ | 5 | **資料庫遷移(Database Migration)** | 1 | 自動化 | up/rollback/idempotency 測試失敗;資料保存測試失敗 | `data-migration-testing.md` 閘門結果 | `data-migration-testing.md` | DB Lead |
66
+ | 6 | **跨流程回歸(Cross-flow Regression)** | 2 | 自動化 | 關鍵 user journey 通過率 < 95%;business-critical flow 組合失敗 | 跨流程回歸報告 | `cross-flow-regression.md` | QA Lead |
67
+ | 7 | **營運就緒(Operational Readiness)** | 1 | 人工 | 缺少 Runbook;alerting 未設定;無 rollback 程序 | Runbook 連結、alert rule 審查 | `runbook-standards.md`、`alerting-standards.md` | SRE / Ops |
68
+ | 8 | **在地化 / i18n(Localization)** | 2 | 自動化 | 發布中有 MISSING 或 MAJOR i18n 落差(semver 落差) | `check-translation-sync.sh` 輸出 | `translation-lifecycle-standards.md` | i18n Lead |
69
+ | 9 | **瀏覽器 / 裝置相容性(Browser / Device Compatibility)** | 3 | 自動化 | Tier-1 瀏覽器/裝置通過率 < 100% | Playwright matrix 報告 | `browser-compatibility-standards.md` | Frontend QA |
70
+ | 10 | **容量 Sign-off(Capacity Sign-off)** | 3 | 人工 | 預估尖峰時 headroom < 30%;無 Eng+SRE sign-off | 容量預測 + sign-off | `performance-standards.md` §Per-Release Capacity Sign-off | SRE + Eng Lead |
71
+ | 11 | **合規 / 隱私(Compliance / Privacy)** | 3 | 人工 | GDPR/CCPA 違規;缺少 audit log;保存政策中斷 | 隱私審查 checklist | `privacy-standards.md` | DPO / Legal |
72
+ | 12 | **文件完整性(Documentation Completeness)** | 2 | 人工 | 此次發布缺少 CHANGELOG;面向客戶的文件未更新 | CHANGELOG diff、文件審查 | `changelog-standards.md`、`documentation-lifecycle.md` | Tech Writer / PM |
73
+ | 13 | **回滾 / 災難復原(Rollback / Disaster Recovery)** | 1 | 人工 | 此次發布無經測試的 rollback 程序;RTO > 門檻 | DR 演練紀錄;rollback script | `rollback-standards.md`、`disaster-recovery-drill.md` | SRE |
74
+ | 14 | **生產 Smoke / Canary(Production Smoke / Canary)** | 1 | 自動化 | 部署後 smoke 失敗;canary error rate > SLO | Smoke 測試結果;canary 儀表板 | `smoke-test.md`、`cd-deployment-strategies.md` | SRE / DevOps |
75
+ | 15 | **Feature Flag 治理(Feature Flag Governance)** | 2 | 人工 | 預設狀態未審查;kill-switch 未測試 | Flag 稽核 checklist | `feature-flag-standards.md` | PM + Eng Lead |
76
+ | 16 | **多閘門流程驗證(Multi-Gate Flow Verification)** | 2 | 自動化 + 人工 | 任何 ≥ 3 步驟的流程缺少 Gate 0;Gate 3 CI 失敗;缺少 Gate 4 UAT sign-off | `flow_gate_report.json`;UAT sign-off 表 | `flow-based-testing.md` §Multi-Gate | QA Lead + Business |
77
+
78
+ > **關於 Tier-3 的說明**:不適用時標記為 `N/A`(例如:CLI 工具的瀏覽器 matrix;無 API consumer 的獨立服務的合約測試)。`N/A` 在 sign-off 中需附上理由註解。
79
+
80
+ ---
81
+
82
+ ## 發布就緒 Sign-off 範本
83
+
84
+ > 每次發布時複製此範本。在 repo 根目錄存為 `.release-readiness/<version>.md`,或附加於發布產物上。
85
+
86
+ ```markdown
87
+ # Release Readiness Sign-off
88
+
89
+ **Release**: [tag/version]
90
+ **Date**: [YYYY-MM-DD]
91
+ **Environment**: Pre-Production → Production
92
+ **RQM Artifact**: [link or commit SHA]
93
+
94
+ ## Tier-1 Gates (ALL must be PASS)
95
+
96
+ | # | Dimension | Status | Evidence | Sign-off |
97
+ |---|-----------|--------|----------|---------|
98
+ | 2 | Security (SAST/DAST/SCA) | PASS / FAIL | [link] | [name] |
99
+ | 5 | Database Migration | PASS / FAIL | [link] | [name] |
100
+ | 7 | Operational Readiness | PASS / FAIL | [link] | [name] |
101
+ | 13 | Rollback / DR | PASS / FAIL | [link] | [name] |
102
+ | 14 | Production Smoke/Canary | PASS / FAIL | [link] | [name] |
103
+
104
+ ## Tier-2 Gates (WARN must have rationale)
105
+
106
+ | # | Dimension | Status | Evidence | Rationale (if WARN) | Sign-off |
107
+ |---|-----------|--------|----------|---------------------|---------|
108
+ | 1 | Performance / Load | PASS / WARN / FAIL | [link] | | [name] |
109
+ | 3 | Accessibility | PASS / WARN / FAIL | [link] | | [name] |
110
+ | 6 | Cross-flow Regression | PASS / WARN / FAIL | [link] | | [name] |
111
+ | 8 | Localization / i18n | PASS / WARN / FAIL | [link] | | [name] |
112
+ | 12 | Documentation | PASS / WARN / FAIL | [link] | | [name] |
113
+ | 15 | Feature Flag Governance | PASS / WARN / FAIL | [link] | | [name] |
114
+ | 16 | Multi-Gate Flow Verification | PASS / WARN / FAIL | [link] | | [name] |
115
+
116
+ ## Tier-3 Gates (N/A with rationale allowed)
117
+
118
+ | # | Dimension | Status | Evidence | Rationale (if N/A) | Sign-off |
119
+ |---|-----------|--------|----------|---------------------|---------|
120
+ | 4 | API / Contract Testing | PASS / WARN / N/A | [link] | | [name] |
121
+ | 9 | Browser / Device Compat | PASS / WARN / N/A | [link] | | [name] |
122
+ | 10 | Capacity Sign-off | PASS / WARN / N/A | [link] | | [name] |
123
+ | 11 | Compliance / Privacy | PASS / WARN / N/A | [link] | | [name] |
124
+
125
+ ## Overall Decision
126
+
127
+ - [ ] **GO** — All Tier-1 PASS; all WARN documented; all N/A have rationale
128
+ - [ ] **NO-GO** — One or more Tier-1 FAIL, or undocumented WARN
129
+
130
+ **Decision made by**: [name, role]
131
+ **Date**: [YYYY-MM-DD]
132
+ ```
133
+
134
+ ---
135
+
136
+ ## 狀態語意(Status Semantics)
137
+
138
+ | 狀態 | 意義 | 對發布的影響 |
139
+ |--------|---------|----------------|
140
+ | `PASS` | 符合或超越所有條件 | 無 |
141
+ | `WARN` | 低於目標但高於硬性最低標;已記錄理由 | 允許;記錄在案 |
142
+ | `FAIL` | 低於硬性最低標;尚未解決 | **阻擋發布** |
143
+ | `N/A` | 此維度不適用於本專案/本次發布;已記錄理由 | 允許 |
144
+
145
+ ---
146
+
147
+ ## 何時建立 Sign-off
148
+
149
+ | 里程碑 | 動作 |
150
+ |-----------|--------|
151
+ | Release candidate 已 tag | 依範本建立 `.release-readiness/<version>.md`;填入證據連結 |
152
+ | Pre-UAT 部署 | 填入 Gate 3 CI 結果;驗證 Tier-1 自動化閘門 |
153
+ | UAT sign-off(Gate 4) | 完成 Tier-3 人工閘門;定案 Multi-Gate Flow 列 |
154
+ | 生產部署決策 | 由 release owner 簽署整體 GO/NO-GO 決策 |
155
+
156
+ Sign-off **不是**事後補做的——Gate 0(PRD 完整性)與 Gate 1(PR 層級測試)必須在 sign-off 文件建立之前很久就已滿足。Sign-off 彙整的是整個發布週期中持續蒐集的證據。
157
+
158
+ ---
159
+
160
+ ## 反模式(Anti-Patterns)
161
+
162
+ - **在部署當天才建立 sign-off** — 證據應在整個發布週期中漸進蒐集
163
+ - **未附理由就標記 WARN** — 沒有記錄理由的 WARN,在功能上等同於無視該閘門
164
+ - **完全略過 Tier-3 而未附 N/A 理由** — 若 web app 省略瀏覽器測試,必須明確說明理由
165
+ - **把 Sign-off 當成橡皮圖章** — 每一列都需要一位具名的 sign-off 負責人;匿名的集體所有權代表沒有真正的責任歸屬
166
+ - **多個發布共用一份 sign-off** — 每個發布 tag 一份 sign-off;不可跨版本重複使用
167
+
168
+ ---
169
+
170
+ ## 另請參閱(See Also)
171
+
172
+ - `release-quality-manifest.md` — 機器可讀的 RQM(本 sign-off 的自動化對應物)
173
+ - `flow-based-testing.md` — Multi-Gate Flow Model(維度 16)
174
+ - `branch-completion.md` — 分支層級閘門(前置條件;不等同於發布就緒)
175
+ - `verification-evidence.md` — 證據標準(所有證據連結都必須符合此標準)
176
+ - `deployment-standards.md` — 部署後閘門整合
177
+
178
+ ---
179
+
180
+ ## 版本歷史(Version History)
181
+
182
+ | 版本 | 日期 | 變更 |
183
+ |---------|------|---------|
184
+ | 1.0.0 | 2026-05-05 | 首次發布:16 維度矩陣、分級 sign-off 範本、RQM 整合 |
185
+
186
+ ---
187
+
188
+ ## 授權(License)
189
+
190
+ 本標準以 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授權發布。
191
+
192
+ **來源(Source)**:[universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
@@ -1,6 +1,14 @@
1
+ ---
2
+ source: ../../../core/self-review-protocol.md
3
+ source_version: 1.0.0
4
+ translation_version: 1.0.0
5
+ last_synced: 2026-05-28
6
+ status: current
7
+ ---
8
+
1
9
  # Self-Review Protocol(自我審查協議)
2
10
 
3
- > [English](../../../core/self-review-protocol.md) | **繁體中文**
11
+ > **語言**: [English](../../../core/self-review-protocol.md) | 繁體中文
4
12
 
5
13
  **版本**: 1.0.0
6
14
  **最後更新**: 2026-05-26