universal-dev-standards 5.1.0-beta.6 → 5.1.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/README.md +6 -0
- package/bin/uds.js +14 -0
- package/bundled/ai/standards/agent-communication-protocol.ai.yaml +34 -0
- package/bundled/ai/standards/anti-sycophancy-prompting.ai.yaml +111 -0
- package/bundled/ai/standards/capability-declaration.ai.yaml +113 -0
- package/bundled/ai/standards/circuit-breaker.ai.yaml +93 -0
- package/bundled/ai/standards/developer-memory.ai.yaml +13 -0
- package/bundled/ai/standards/dual-phase-output.ai.yaml +108 -0
- package/bundled/ai/standards/failure-source-taxonomy.ai.yaml +115 -0
- package/bundled/ai/standards/frontend-design-standards.ai.yaml +305 -0
- package/bundled/ai/standards/health-check-standards.ai.yaml +140 -0
- package/bundled/ai/standards/immutability-first.ai.yaml +112 -0
- package/bundled/ai/standards/model-selection.ai.yaml +111 -3
- package/bundled/ai/standards/packaging-standards.ai.yaml +142 -0
- package/bundled/ai/standards/recovery-recipe-registry.ai.yaml +200 -0
- package/bundled/ai/standards/retry-standards.ai.yaml +134 -0
- package/bundled/ai/standards/security-decision.ai.yaml +87 -0
- package/bundled/ai/standards/skill-standard-alignment-check.ai.yaml +119 -0
- package/bundled/ai/standards/standard-admission-criteria.ai.yaml +107 -0
- package/bundled/ai/standards/standard-lifecycle-management.ai.yaml +144 -0
- package/bundled/ai/standards/timeout-standards.ai.yaml +104 -0
- package/bundled/ai/standards/token-budget.ai.yaml +108 -0
- package/bundled/ai/standards/translation-lifecycle-standards.ai.yaml +145 -0
- package/bundled/core/anti-sycophancy-prompting.md +184 -0
- package/bundled/core/capability-declaration.md +59 -0
- package/bundled/core/circuit-breaker.md +58 -0
- package/bundled/core/developer-memory.md +29 -1
- package/bundled/core/dual-phase-output.md +56 -0
- package/bundled/core/failure-source-taxonomy.md +72 -0
- package/bundled/core/frontend-design-standards.md +474 -0
- package/bundled/core/health-check-standards.md +72 -0
- package/bundled/core/immutability-first.md +105 -0
- package/bundled/core/model-selection.md +80 -0
- package/bundled/core/packaging-standards.md +216 -0
- package/bundled/core/recovery-recipe-registry.md +69 -0
- package/bundled/core/retry-standards.md +62 -0
- package/bundled/core/security-decision.md +65 -0
- package/bundled/core/skill-standard-alignment-check.md +79 -0
- package/bundled/core/standard-admission-criteria.md +84 -0
- package/bundled/core/standard-lifecycle-management.md +94 -0
- package/bundled/core/timeout-standards.md +63 -0
- package/bundled/core/token-budget.md +58 -0
- package/bundled/core/translation-lifecycle-standards.md +162 -0
- package/bundled/locales/zh-CN/CHANGELOG.md +51 -3
- package/bundled/locales/zh-CN/README.md +1 -1
- package/bundled/locales/zh-CN/core/anti-hallucination.md +22 -3
- package/bundled/locales/zh-CN/core/anti-sycophancy-prompting.md +192 -0
- package/bundled/locales/zh-CN/core/capability-declaration.md +123 -0
- package/bundled/locales/zh-CN/core/circuit-breaker.md +106 -0
- package/bundled/locales/zh-CN/core/dual-phase-output.md +103 -0
- package/bundled/locales/zh-CN/core/failure-source-taxonomy.md +99 -0
- package/bundled/locales/zh-CN/core/frontend-design-standards.md +289 -0
- package/bundled/locales/zh-CN/core/health-check-standards.md +144 -0
- package/bundled/locales/zh-CN/core/immutability-first.md +96 -0
- package/bundled/locales/zh-CN/core/packaging-standards.md +224 -0
- package/bundled/locales/zh-CN/core/recovery-recipe-registry.md +146 -0
- package/bundled/locales/zh-CN/core/retry-standards.md +131 -0
- package/bundled/locales/zh-CN/core/security-decision.md +104 -0
- package/bundled/locales/zh-CN/core/skill-standard-alignment-check.md +112 -0
- package/bundled/locales/zh-CN/core/standard-admission-criteria.md +104 -0
- package/bundled/locales/zh-CN/core/standard-lifecycle-management.md +116 -0
- package/bundled/locales/zh-CN/core/timeout-standards.md +117 -0
- package/bundled/locales/zh-CN/core/token-budget.md +108 -0
- package/bundled/locales/zh-CN/core/translation-lifecycle-standards.md +159 -0
- package/bundled/locales/zh-TW/CHANGELOG.md +51 -3
- package/bundled/locales/zh-TW/README.md +1 -1
- package/bundled/locales/zh-TW/core/anti-sycophancy-prompting.md +192 -0
- package/bundled/locales/zh-TW/core/capability-declaration.md +111 -0
- package/bundled/locales/zh-TW/core/circuit-breaker.md +111 -0
- package/bundled/locales/zh-TW/core/dual-phase-output.md +132 -0
- package/bundled/locales/zh-TW/core/failure-source-taxonomy.md +146 -0
- package/bundled/locales/zh-TW/core/frontend-design-standards.md +460 -0
- package/bundled/locales/zh-TW/core/health-check-standards.md +144 -0
- package/bundled/locales/zh-TW/core/immutability-first.md +159 -0
- package/bundled/locales/zh-TW/core/packaging-standards.md +224 -0
- package/bundled/locales/zh-TW/core/recovery-recipe-registry.md +146 -0
- package/bundled/locales/zh-TW/core/retry-standards.md +140 -0
- package/bundled/locales/zh-TW/core/security-decision.md +120 -0
- package/bundled/locales/zh-TW/core/skill-standard-alignment-check.md +112 -0
- package/bundled/locales/zh-TW/core/standard-admission-criteria.md +104 -0
- package/bundled/locales/zh-TW/core/standard-lifecycle-management.md +116 -0
- package/bundled/locales/zh-TW/core/timeout-standards.md +117 -0
- package/bundled/locales/zh-TW/core/token-budget.md +143 -0
- package/bundled/locales/zh-TW/core/translation-lifecycle-standards.md +159 -0
- package/bundled/skills/e2e-assistant/SKILL.md +19 -5
- package/bundled/skills/testing-guide/SKILL.md +5 -0
- package/bundled/skills/testing-guide/test-skeleton-templates.md +316 -0
- package/package.json +2 -1
- package/src/commands/check.js +6 -0
- package/src/commands/config.js +9 -0
- package/src/commands/init.js +97 -46
- package/src/commands/mcp.js +26 -0
- package/src/commands/run-intent.js +66 -0
- package/src/commands/update.js +41 -4
- package/src/core/command-router.js +85 -0
- package/src/core/project-config.js +91 -0
- package/src/flows/init-flow.js +6 -1
- package/src/i18n/messages.js +6 -6
- package/src/mcp/__tests__/server.test.js +251 -0
- package/src/mcp/server.js +352 -0
- package/src/prompts/init.js +157 -1
- package/src/reconciler/actual-state-scanner.js +24 -0
- package/src/uninstallers/hook-uninstaller.js +32 -1
- package/src/utils/detect-self-adoption.js +173 -0
- package/src/utils/e2e-analyzer.js +88 -5
- package/src/utils/e2e-detector.js +73 -1
- package/src/utils/integration-generator.js +22 -3
- package/standards-registry.json +203 -4
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Standard Lifecycle Management
|
|
2
|
+
|
|
3
|
+
> **Source**: XSPEC-070 | **Driven by**: DEC-043 Wave 1 Governance Meta Pack | **Status**: Trial (2026-04-17 ~ 2026-10-17)
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
UDS 標準生命週期狀態機。既有 66 個標準無明確狀態管理:新增標準沒有試驗期、過時標準無棄用路徑、廢棄標準仍被引用。本標準建立五狀態機(Proposed / Trial / Active / Deprecated / Archived)與合法轉移規則,並規範所有 `.ai.yaml` 標準必須在 frontmatter 標示 `status` / `since` / `expires` / `supersedes`。
|
|
8
|
+
|
|
9
|
+
## Key Principles
|
|
10
|
+
|
|
11
|
+
- **所有標準必有狀態**:frontmatter 必須包含 `status` 和 `since`
|
|
12
|
+
- **Trial 必有期限**:`expires` 預設 since + 6 months
|
|
13
|
+
- **Deprecated 必有替代**:`supersedes` 指向替代標準 id 或遷移文件
|
|
14
|
+
- **禁止反向轉移**:Active → Proposed、Archived → Active 均無意義
|
|
15
|
+
- **逾期自動 Archived**:Trial 到期未決則自動歸檔
|
|
16
|
+
|
|
17
|
+
## States
|
|
18
|
+
|
|
19
|
+
| State | Description | Skill-referenceable? |
|
|
20
|
+
|-------|-------------|----------------------|
|
|
21
|
+
| **Proposed** | 草案階段,未通過 admission | No |
|
|
22
|
+
| **Trial** | 批准但試驗中(預設 6 個月)| Yes(標註 trial)|
|
|
23
|
+
| **Active** | 全面採用,standard-of-truth | Yes |
|
|
24
|
+
| **Deprecated** | 標記棄用,必須提供 `supersedes` | Yes(Skill 應警示)|
|
|
25
|
+
| **Archived** | 已移除,僅保留歷史 | No |
|
|
26
|
+
|
|
27
|
+
## Legal Transitions
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
Proposed ──(admission passed)──→ Trial
|
|
31
|
+
Trial ──(validated)──────────→ Active
|
|
32
|
+
Trial ──(expired/rejected)───→ Archived
|
|
33
|
+
Active ──(superseded)─────────→ Deprecated
|
|
34
|
+
Deprecated ──(migration done)───→ Archived
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**禁止的轉移**:
|
|
38
|
+
|
|
39
|
+
- Active → Proposed(無意義)
|
|
40
|
+
- Archived → Active(應重新申請 admission)
|
|
41
|
+
- Deprecated → Active(應重新 Trial)
|
|
42
|
+
- Proposed → Active(須先 Trial)
|
|
43
|
+
|
|
44
|
+
## Frontmatter Required Fields
|
|
45
|
+
|
|
46
|
+
### Always Required
|
|
47
|
+
|
|
48
|
+
- `status`: proposed | trial | active | deprecated | archived
|
|
49
|
+
- `since`: ISO-8601(進入當前狀態的日期)
|
|
50
|
+
- `version`: semver 字串
|
|
51
|
+
|
|
52
|
+
### Conditional
|
|
53
|
+
|
|
54
|
+
| Field | When |
|
|
55
|
+
|-------|------|
|
|
56
|
+
| `expires` | `status = trial`(預設 since + 6 months)|
|
|
57
|
+
| `supersedes` | `status = deprecated`(替代標準 id 或遷移文件路徑)|
|
|
58
|
+
| `migration_guide` | `status = deprecated`(相對路徑,選填但強烈建議)|
|
|
59
|
+
|
|
60
|
+
## Usage Examples
|
|
61
|
+
|
|
62
|
+
- **Scenario 1 — Trial → Active**:`retry-standards` 處於 trial。2026-08-01 審視發現 DevAP Fix Loop 和 VibeOps Builder 均採用且無重大缺陷 → 轉 Active,`since=2026-08-01`,移除 `expires`
|
|
63
|
+
- **Scenario 2 — Trial 逾期自動 Archived**:某標準 trial 期限 2026-10-17 到期未通過驗證 → 狀態轉 Archived,記錄原因
|
|
64
|
+
- **Scenario 3 — Deprecated 帶遷移**:`legacy-retry-logic` 被 `retry-standards` 取代 → `status=deprecated, supersedes=retry-standards, migration_guide=docs/migrations/retry-v1-to-v2.md`;Skill 使用時顯示警告
|
|
65
|
+
|
|
66
|
+
## Telemetry Event
|
|
67
|
+
|
|
68
|
+
`standard_state_change`:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
{
|
|
72
|
+
standard_id: string,
|
|
73
|
+
from_state: proposed|trial|active|deprecated|archived,
|
|
74
|
+
to_state: proposed|trial|active|deprecated|archived,
|
|
75
|
+
reason: string,
|
|
76
|
+
timestamp: ISO-8601
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Error Codes
|
|
81
|
+
|
|
82
|
+
- `LIFECYCLE-001` — `MISSING_STATUS`
|
|
83
|
+
- `LIFECYCLE-002` — `MISSING_EXPIRES`(trial 狀態)
|
|
84
|
+
- `LIFECYCLE-003` — `MISSING_SUPERSEDES`(deprecated 狀態)
|
|
85
|
+
- `LIFECYCLE-004` — `FORBIDDEN_TRANSITION`
|
|
86
|
+
- `LIFECYCLE-005` — `TRIAL_EXPIRED`(期限已過但未決策)
|
|
87
|
+
|
|
88
|
+
## References
|
|
89
|
+
|
|
90
|
+
- AI-optimized: [ai/standards/standard-lifecycle-management.ai.yaml](../ai/standards/standard-lifecycle-management.ai.yaml)
|
|
91
|
+
- XSPEC-070: DEC-043 Wave 1 Governance Meta Pack 跨專案規格
|
|
92
|
+
- DEC-043: UDS 覆蓋完整性路線圖(驅動來源)
|
|
93
|
+
- Related: `standard-admission-criteria`, `skill-standard-alignment-check`, `adr-standards`
|
|
94
|
+
- Industry: IETF RFC lifecycle (Proposed → Draft → Internet Standard), Python PEP states, W3C Recommendation Track
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Timeout Standards
|
|
2
|
+
|
|
3
|
+
> **Source**: XSPEC-067 | **Driven by**: DEC-043 Wave 1 Reliability Pack | **Status**: Trial (2026-04-17 ~ 2026-10-17)
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Timeout 標準 — 避免多層呼叫鏈中下層 timeout 大於上層(導致上層先 timeout 而下層仍在執行的資源浪費)。透過 cascading 預算規則(每層 ≤ 0.8× 上層)與 deadline propagation(傳 absolute timestamp)讓整條呼叫鏈精準 fail-fast。與 `circuit-breaker` 整合,timeout 計入 failure count。
|
|
8
|
+
|
|
9
|
+
## Key Principles
|
|
10
|
+
|
|
11
|
+
- **Cascading 預算**:多層呼叫的 timeout 必須逐層遞減,每下一層 ≤ `0.8 × 上層`(預留 20% buffer)
|
|
12
|
+
- **Deadline Propagation**:跨服務呼叫必須傳遞 deadline(absolute timestamp),不得只傳 relative duration
|
|
13
|
+
- **Fail-fast on Expired**:收到請求後若 `now > deadline`,立即 fail-fast,禁止發起下游呼叫
|
|
14
|
+
- **Breaker 整合**:timeout 觸發計入對應 circuit-breaker 的 failure count
|
|
15
|
+
- **禁止倒置**:下層 timeout 大於上層 timeout 等同沒設 timeout,配置違規
|
|
16
|
+
|
|
17
|
+
## Cascading Budget Example
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Client timeout = 10000 ms
|
|
21
|
+
Gateway timeout = 8000 ms (10000 × 0.8)
|
|
22
|
+
Service A timeout = 6400 ms (8000 × 0.8)
|
|
23
|
+
Downstream DB timeout = 5120 ms (6400 × 0.8)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
0.8 為業界經驗值(gRPC / Envoy 常用 0.7~0.85),預留 20% buffer 給序列化、網路傳輸、重試開銷。
|
|
27
|
+
|
|
28
|
+
## Deadline Propagation
|
|
29
|
+
|
|
30
|
+
- Header: `X-Deadline`
|
|
31
|
+
- Format: absolute ISO-8601 timestamp(不是 relative duration)
|
|
32
|
+
- 發起呼叫前:`deadline = now + timeout`,寫入 header
|
|
33
|
+
- 收到請求後:立即檢查 `now > deadline_header`,若是則回 `DEADLINE_EXCEEDED`
|
|
34
|
+
- 向下游呼叫:`timeout = min(cascading_budget, deadline - now)`
|
|
35
|
+
|
|
36
|
+
## Timeout Categories
|
|
37
|
+
|
|
38
|
+
| Category | Default ms | Purpose |
|
|
39
|
+
|----------|------------|---------|
|
|
40
|
+
| `connect_timeout` | 5000 | 建立 TCP / TLS 連線 |
|
|
41
|
+
| `request_timeout` | 30000 | 發送請求到收到完整回應 |
|
|
42
|
+
| `idle_timeout` | 60000 | 連線閒置多久後關閉 |
|
|
43
|
+
| `total_deadline` | 60000 | 含所有重試的整體上限 |
|
|
44
|
+
|
|
45
|
+
## Usage Examples
|
|
46
|
+
|
|
47
|
+
- **Scenario 1 — Cascading 預算**:Client 10s → Gateway 8s → Service A 6.4s → DB 5.12s,確保下層先 timeout,上層有機會 fallback
|
|
48
|
+
- **Scenario 2 — Deadline 過期**:請求抵達 Service A 時 `X-Deadline` 已過期,立即回 `DEADLINE_EXCEEDED`,不呼叫 DB
|
|
49
|
+
- **Scenario 3 — Timeout 觸發 breaker**:連續 3 次下游呼叫皆 timeout(failureThreshold=3),第 4 次 breaker 進入 OPEN
|
|
50
|
+
|
|
51
|
+
## Error Codes
|
|
52
|
+
|
|
53
|
+
- `TIMEOUT-001` — `REQUEST_TIMEOUT`(單次請求超時)
|
|
54
|
+
- `TIMEOUT-002` — `DEADLINE_EXCEEDED`(整體 deadline 已過)
|
|
55
|
+
- `TIMEOUT-003` — `CASCADING_BUDGET_VIOLATION`(下層 > 上層,配置錯誤)
|
|
56
|
+
|
|
57
|
+
## References
|
|
58
|
+
|
|
59
|
+
- AI-optimized: [ai/standards/timeout-standards.ai.yaml](../ai/standards/timeout-standards.ai.yaml)
|
|
60
|
+
- XSPEC-067: DEC-043 Wave 1 Reliability Pack 跨專案規格
|
|
61
|
+
- DEC-043: UDS 覆蓋完整性路線圖(驅動來源)
|
|
62
|
+
- Related: `circuit-breaker`, `retry-standards`, `failure-source-taxonomy`
|
|
63
|
+
- Industry: gRPC deadline propagation, Envoy timeout budgeting, Google SRE Book Ch.22
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Token Budget Zone Standard
|
|
2
|
+
|
|
3
|
+
> **Source**: XSPEC-036 | **Borrowed from**: claude-code-book Ch.7
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The Token Budget Zone model divides token usage into four progressive zones, each triggering increasingly aggressive protection strategies. This prevents the "works fine until sudden crash" failure mode and gives systems time to gracefully degrade before hitting hard limits.
|
|
8
|
+
|
|
9
|
+
## Zones
|
|
10
|
+
|
|
11
|
+
| Zone | Range | Action | Log Level |
|
|
12
|
+
|------|-------|--------|-----------|
|
|
13
|
+
| **SAFE** | 0–84% | Normal operation | — |
|
|
14
|
+
| **WARNING** | 85–89% | Emit event, notify coordinator | info |
|
|
15
|
+
| **DANGER** | 90–94% | Trigger lightweight compression (Snip) | warn |
|
|
16
|
+
| **BLOCKING** | 95–100% | Reject new requests, return error | error |
|
|
17
|
+
|
|
18
|
+
## Constants
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
const TOKEN_BUDGET_ZONE = {
|
|
22
|
+
WARNING_THRESHOLD: 0.85,
|
|
23
|
+
DANGER_THRESHOLD: 0.90,
|
|
24
|
+
BLOCKING_THRESHOLD: 0.95,
|
|
25
|
+
} as const;
|
|
26
|
+
|
|
27
|
+
type TokenBudgetZone = "safe" | "warning" | "danger" | "blocking";
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## DANGER Zone Actions
|
|
31
|
+
|
|
32
|
+
When entering DANGER zone (90–94%):
|
|
33
|
+
1. **Tool Result Snip**: Truncate large tool outputs, keep summaries
|
|
34
|
+
2. **Reduce maxToolRounds**: Cut by 20% for remaining agents
|
|
35
|
+
3. **Persist to disk**: Move important outputs out of context
|
|
36
|
+
|
|
37
|
+
## Post-Compact Budget
|
|
38
|
+
|
|
39
|
+
Compression operations need output space to succeed. Reserve constants:
|
|
40
|
+
|
|
41
|
+
| Constant | Value | Purpose |
|
|
42
|
+
|----------|-------|---------|
|
|
43
|
+
| `MAX_FILES_TO_RESTORE` | 5 | Max files to restore after compaction |
|
|
44
|
+
| `TOTAL_TOKEN_BUDGET` | 50,000 | Total post-compact token budget |
|
|
45
|
+
| `MAX_TOKENS_PER_FILE` | 5,000 | Per-file token limit |
|
|
46
|
+
|
|
47
|
+
## Applicable Scenarios
|
|
48
|
+
|
|
49
|
+
- DevAP task execution token monitoring
|
|
50
|
+
- VibeOps 9-Agent pipeline cumulative context management
|
|
51
|
+
- VibeOps PipelineMemory Snip trigger condition
|
|
52
|
+
- Any environment with `maxTotalTokens` limit
|
|
53
|
+
|
|
54
|
+
## References
|
|
55
|
+
|
|
56
|
+
- AI-optimized: [ai/standards/token-budget.ai.yaml](../ai/standards/token-budget.ai.yaml)
|
|
57
|
+
- XSPEC-036: Cross-project specification
|
|
58
|
+
- Borrowed from: [claude-code-book](https://github.com/lintsinghua/claude-code-book) Ch.7 four-zone context management
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Translation Lifecycle Standards
|
|
2
|
+
|
|
3
|
+
> **Language**: English | [繁體中文](../locales/zh-TW/core/translation-lifecycle-standards.md)
|
|
4
|
+
|
|
5
|
+
**Version**: 1.0.0
|
|
6
|
+
**Last Updated**: 2026-04-20
|
|
7
|
+
**Status**: Trial (expires 2026-10-20)
|
|
8
|
+
**Applicability**: All projects with multi-language documentation
|
|
9
|
+
**Scope**: universal
|
|
10
|
+
**Source**: Derived from UDS BUG-A06 post-mortem (2026-04-20)
|
|
11
|
+
**Parent Standard**: [documentation-lifecycle](documentation-lifecycle.md)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Purpose
|
|
16
|
+
|
|
17
|
+
Translation lifecycle standards: MISSING vs OUTDATED distinction, semver-aware severity classification, and automation integration (pre-commit hook, release gate).
|
|
18
|
+
|
|
19
|
+
The `documentation-lifecycle` standard mentions translation sync as a release-gate check, but does not define how to classify or respond to different degrees of drift. This standard fills that gap: a translation that is absent is fundamentally different from one that is slightly stale, and a major-version gap is fundamentally different from a patch bump. Without this distinction, teams either over-block (failing on any staleness) or under-block (ignoring all staleness until it becomes a user-visible defect).
|
|
20
|
+
|
|
21
|
+
**Evidence (BUG-A06 post-mortem)**:
|
|
22
|
+
1. UDS accumulated 32 missing translations over 3 months of adding new standards without a MISSING gate — only discovered during a Q2 audit.
|
|
23
|
+
2. `anti-hallucination.md` zh-CN was at 1.5.0 while the source shipped 1.5.1 — a new Agent Epistemic Calibration framework section was completely absent in the zh-CN edition, invisible to users.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Core Rules
|
|
28
|
+
|
|
29
|
+
- `MISSING` (translation file does not exist) is always a release blocker — `exit 1`
|
|
30
|
+
- `MAJOR` version gap (source X vs translation x where X > x) is a release blocker — `exit 1`
|
|
31
|
+
- `MINOR` version gap is advisory — warn prominently, do not block
|
|
32
|
+
- `PATCH` version gap is advisory — warn softly, do not block
|
|
33
|
+
- Severity is determined by semver comparison of `source_version` in translation frontmatter vs current source file version
|
|
34
|
+
- Every translation file MUST have YAML frontmatter with `source`, `source_version`, `translation_version`, `last_synced`, `status`
|
|
35
|
+
- When a source standard is modified, the translation's `source_version` becomes stale immediately — this drift is detectable at commit time via pre-commit hook
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Severity Classification
|
|
40
|
+
|
|
41
|
+
| Level | Condition | Exit Code | Action |
|
|
42
|
+
|-------|-----------|-----------|--------|
|
|
43
|
+
| `MISSING` | Translation file does not exist | 1 | Create before release |
|
|
44
|
+
| `MAJOR` | source MAJOR > translation MAJOR | 1 | Update before stable release |
|
|
45
|
+
| `MINOR` | source MINOR > translation MINOR | 0 | Update before next release (advisory) |
|
|
46
|
+
| `PATCH` | source PATCH > translation PATCH | 0 | Update when convenient (advisory) |
|
|
47
|
+
| `CURRENT` | source_version == translation source_version | 0 | No action needed |
|
|
48
|
+
|
|
49
|
+
### Semver Diff Formula
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
diff_level = compare(
|
|
53
|
+
strip_prerelease(current_source_version),
|
|
54
|
+
strip_prerelease(translation.source_version)
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
where: MAJOR if maj differs, MINOR if min differs, else PATCH
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Trigger Conditions
|
|
63
|
+
|
|
64
|
+
| Event | Required Action |
|
|
65
|
+
|-------|----------------|
|
|
66
|
+
| New standard added to `core/` | Create translation in all supported locales (MISSING check blocks release) |
|
|
67
|
+
| Standard version bumped (PATCH) | Update translation's `source_version` + `last_synced` when convenient |
|
|
68
|
+
| Standard version bumped (MINOR) | Update translation content + frontmatter before next release |
|
|
69
|
+
| Standard version bumped (MAJOR) | Update translation content + frontmatter before current release (blocker) |
|
|
70
|
+
| Translation file manually updated | Bump `translation_version` + `last_synced` in frontmatter |
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Translation Frontmatter Protocol
|
|
75
|
+
|
|
76
|
+
Every translation file MUST begin with:
|
|
77
|
+
|
|
78
|
+
```yaml
|
|
79
|
+
---
|
|
80
|
+
source: ../../../core/<filename>.md # relative path to source
|
|
81
|
+
source_version: <X.Y.Z> # source version at last sync
|
|
82
|
+
translation_version: <X.Y.Z> # translation's own version
|
|
83
|
+
last_synced: <YYYY-MM-DD> # date of last sync
|
|
84
|
+
status: current | outdated | draft # human-readable status
|
|
85
|
+
---
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
When updating a translation after a source change:
|
|
89
|
+
1. Translate the new/changed content
|
|
90
|
+
2. Set `source_version` = new source version
|
|
91
|
+
3. Set `translation_version` = same as `source_version` (or bump independently)
|
|
92
|
+
4. Set `last_synced` = today's date
|
|
93
|
+
5. Set `status: current`
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Automation Integration
|
|
98
|
+
|
|
99
|
+
### Pre-Commit Hook
|
|
100
|
+
|
|
101
|
+
When `core/*.md` files are staged, the pre-commit hook runs `check-translation-sync.sh` and shows OUTDATED warnings. The hook **never blocks** the commit (blocking at commit time is too disruptive) — it is a reminder only.
|
|
102
|
+
|
|
103
|
+
Setup: `./scripts/install-hooks.sh` (one-time, after clone)
|
|
104
|
+
|
|
105
|
+
### Release Gate (`check-translation-sync.sh`)
|
|
106
|
+
|
|
107
|
+
Run before `npm publish` or as part of `pre-release-check.sh`:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
bash scripts/check-translation-sync.sh
|
|
111
|
+
# exit 1 if MISSING or MAJOR gap found
|
|
112
|
+
# exit 0 if only MINOR/PATCH gaps (with advisory output)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Version Bump Integration (`bump-version.sh`)
|
|
116
|
+
|
|
117
|
+
`bump-version.sh` automatically runs `check-translation-sync.sh` after version files are updated, showing the translation health snapshot at the moment of bump — giving the author immediate feedback on what needs updating before publish.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Scenarios
|
|
122
|
+
|
|
123
|
+
**Scenario 1 — Standard patch bump (1.0.0 → 1.0.1)**
|
|
124
|
+
- Translation `source_version: 1.0.0`, source now at `1.0.1`
|
|
125
|
+
- Severity: `PATCH` — advisory, exit 0
|
|
126
|
+
- Action: Update at next opportunity, no release block
|
|
127
|
+
|
|
128
|
+
**Scenario 2 — Standard minor bump with new section (1.0.0 → 1.1.0)**
|
|
129
|
+
- Translation `source_version: 1.0.0`, source now at `1.1.0`
|
|
130
|
+
- Severity: `MINOR` — advisory, exit 0
|
|
131
|
+
- Action: Update before next release; zh-CN users missing new content
|
|
132
|
+
|
|
133
|
+
**Scenario 3 — Standard major rewrite (1.x.x → 2.0.0)**
|
|
134
|
+
- Translation `source_version: 1.5.0`, source now at `2.0.0`
|
|
135
|
+
- Severity: `MAJOR` — blocker, exit 1
|
|
136
|
+
- Action: Must update before stable release
|
|
137
|
+
|
|
138
|
+
**Scenario 4 — New standard, no translation file**
|
|
139
|
+
- No `locales/zh-TW/core/new-standard.md` exists
|
|
140
|
+
- Severity: `MISSING` — blocker, exit 1
|
|
141
|
+
- Action: Create translation file before release
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Error Codes
|
|
146
|
+
|
|
147
|
+
| Code | Description |
|
|
148
|
+
|------|-------------|
|
|
149
|
+
| `TRANS-001` | `MISSING_TRANSLATION` — Translation file does not exist for a source standard |
|
|
150
|
+
| `TRANS-002` | `MAJOR_VERSION_GAP` — Translation source_version is MAJOR behind current source |
|
|
151
|
+
| `TRANS-003` | `MISSING_FRONTMATTER` — Translation file lacks required YAML frontmatter |
|
|
152
|
+
| `TRANS-004` | `STALE_SOURCE_REF` — `source` path in frontmatter points to non-existent file |
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## References
|
|
157
|
+
|
|
158
|
+
- [documentation-lifecycle.md](documentation-lifecycle.md) — Parent standard; trigger matrix and check pyramid
|
|
159
|
+
- [standard-admission-criteria.md](standard-admission-criteria.md) — How new standards are admitted (triggers TRANS-001)
|
|
160
|
+
- `scripts/check-translation-sync.sh` — Implementation of this standard's automation rules
|
|
161
|
+
- `.githooks/pre-commit` — Pre-commit integration
|
|
162
|
+
- `scripts/install-hooks.sh` — Hook installation
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: ../../CHANGELOG.md
|
|
3
|
-
source_version: 5.1.0
|
|
4
|
-
translation_version: 5.1.0
|
|
5
|
-
last_synced: 2026-04-
|
|
3
|
+
source_version: 5.1.0
|
|
4
|
+
translation_version: 5.1.0
|
|
5
|
+
last_synced: 2026-04-20
|
|
6
6
|
status: current
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -17,6 +17,54 @@ status: current
|
|
|
17
17
|
|
|
18
18
|
## [Unreleased]
|
|
19
19
|
|
|
20
|
+
## [5.1.0] - 2026-04-20
|
|
21
|
+
|
|
22
|
+
> **正式版**:BUG-A06 i18n 完整性 — 新增 32 份缺失翻译、Semver 感知翻译闸门、新增 `translation-lifecycle-standards` UDS 标准。BUG-A07 Shell 测试覆盖 — 20+ 脚本的 bats smoke tests。BUG-A08 假通过测试审计 — 修正 22 个测试。Pre-release Batch 0:6 个标准从 Trial 升至 Adopt(DEC-021/025/031/035/038/040)。标准总数:106 个。
|
|
23
|
+
|
|
24
|
+
### 新增
|
|
25
|
+
- **`translation-lifecycle-standards`**(Trial,到期 2026-10-20):新 UDS 标准,定义 MISSING 与 OUTDATED 的区别、Semver 严重度分级(MISSING/MAJOR = 发布阻塞器,MINOR/PATCH = advisory),以及自动化集成(pre-commit hook、release gate、bump-version 集成)。来源:BUG-A06 事后分析。
|
|
26
|
+
- **`.githooks/pre-commit`** + **`scripts/install-hooks.sh`**:commit 时若暂存 `core/*.md` 文件则显示 OUTDATED 警告,永不阻塞 commit。通过 `./scripts/install-hooks.sh` 启用。
|
|
27
|
+
- **32 份 zh-TW 与 zh-CN 翻译**(BUG-A06):所有核心标准现已有完整 zh-TW 和 zh-CN 翻译,包含 `circuit-breaker`、`token-budget`、`dual-phase-output`、`failure-source-taxonomy`、`immutability-first`、`security-decision`、`capability-declaration`、`recovery-recipe-registry`、`retry-standards`、`health-check-standards`、`timeout-standards`、`skill-standard-alignment-check`、`standard-admission-criteria`、`standard-lifecycle-management`、`packaging-standards`、`frontend-design-standards`、`translation-lifecycle-standards` 等。
|
|
28
|
+
- **bats smoke tests**(BUG-A07):`tests/scripts/` — 20+ 个 Shell 脚本的 smoke tests,涵盖 `check-translation-sync.sh`、`check-version-sync.sh`、`bump-version.sh`、`install-hooks.sh` 等。
|
|
29
|
+
|
|
30
|
+
### 变更
|
|
31
|
+
- **`check-translation-sync.sh`**:Semver 感知严重度 — MAJOR 版本落差现在 exit 1(发布阻塞器);MINOR/PATCH 落差 exit 0 附 advisory 警告。新增 `semver_diff()` 函数与 `[MAJOR]`/`[MINOR]`/`[PATCH]` 严重度标签。
|
|
32
|
+
- **`bump-version.sh`**:更新版本文件后自动执行 `check-translation-sync.sh`,在升版时提供翻译健康状态快照。
|
|
33
|
+
- **`scripts/pre-release-check.sh`**:更新为将 `check-translation-sync.sh` 作为硬闸门(MISSING + MAJOR = exit 1)。
|
|
34
|
+
|
|
35
|
+
### 修正
|
|
36
|
+
- **zh-CN `anti-hallucination.md`**(BUG-A06):从 1.5.0 更新至 1.5.1 — 补上缺失的「Agent 认识论校准」章节(Answer/Ask/Abstain 框架,XSPEC-008)。该章节自 2026-04-13 起在 zh-CN 中完全缺失。
|
|
37
|
+
- **22 个假通过测试**(BUG-A08):修正未正确验证行为的测试,加入真实断言。
|
|
38
|
+
|
|
39
|
+
### 升至 Adopt(Pre-release Batch 0)
|
|
40
|
+
- `circuit-breaker`(DEC-021):Trial 6 个月后升至 Adopt
|
|
41
|
+
- `token-budget`(DEC-025):Trial 6 个月后升至 Adopt
|
|
42
|
+
- `dual-phase-output`(DEC-031):Trial 6 个月后升至 Adopt
|
|
43
|
+
- `security-decision`(DEC-035):Trial 6 个月后升至 Adopt
|
|
44
|
+
- `immutability-first`(DEC-038):Trial 6 个月后升至 Adopt
|
|
45
|
+
- `failure-source-taxonomy`(DEC-040):Trial 6 个月后升至 Adopt
|
|
46
|
+
|
|
47
|
+
[5.1.0]: https://github.com/AsiaOstrich/universal-dev-standards/compare/v5.1.0-beta.7...v5.1.0
|
|
48
|
+
|
|
49
|
+
## [5.1.0-beta.7] - 2026-04-17
|
|
50
|
+
|
|
51
|
+
> **Beta Release**:DEC-043 Wave 1 — 六个 Trial 状态标准,涵盖可靠性模式与治理 Meta 框架。
|
|
52
|
+
|
|
53
|
+
### 新增
|
|
54
|
+
- **Reliability 包(XSPEC-067)**:三个 Trial 状态的韧性模式标准。
|
|
55
|
+
- `retry-standards`:重试策略(指数退避、Jitter、幂等性保护)。
|
|
56
|
+
- `timeout-standards`:分层 timeout 预算(call / request / end-to-end)与传递规则。
|
|
57
|
+
- `health-check-standards`:Liveness / Readiness / Startup probe 语义。
|
|
58
|
+
- **治理 Meta 包(XSPEC-070,Wave 1 前置)**:三个定义「标准如何被纳入、管理、与 Skill 对齐」的 Trial 标准。
|
|
59
|
+
- `standard-admission-criteria`:新标准提案的入场门槛。
|
|
60
|
+
- `standard-lifecycle-management`:Trial → Stable → Deprecated → Archived 状态流转。
|
|
61
|
+
- `skill-standard-alignment-check`:Skill 与其引用标准之间的对齐稽核。
|
|
62
|
+
- 六份标准皆遵循 UDS 三方同步要求:`.ai.yaml`(机器)+ `.md`(人类)+ `cli/standards-registry.json` entry(+66 行)。
|
|
63
|
+
|
|
64
|
+
### 背景
|
|
65
|
+
- 由 **DEC-043**(UDS 覆盖完整性路线图)驱动。治理 Meta 包为 Wave 1 前置条件,解锁 Wave 2–4(八个主题标准包:SRE / CI-CD / IaC / 合规 / Reliability / 资料工程 / 产品 / 治理 — XSPEC-063~070)。
|
|
66
|
+
- PR:#77
|
|
67
|
+
|
|
20
68
|
## [5.1.0-beta.6] - 2026-04-13
|
|
21
69
|
|
|
22
70
|
> **Beta 版本**:修复 `uds init` 崩溃问题、E2E 测试隔离问题,以及 macOS 显示语言检测失效问题。
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
> **语言**: [English](../../README.md) | [繁體中文](../zh-TW/README.md) | 简体中文
|
|
8
8
|
|
|
9
|
-
**版本**: 5.1.0
|
|
9
|
+
**版本**: 5.1.0 | **发布日期**: 2026-04-13 | **授权**: [双重授权](../../LICENSE) (CC BY 4.0 + MIT)
|
|
10
10
|
|
|
11
11
|
语言无关、框架无关的软件项目文档标准。通过 AI 原生工作流,确保不同技术栈之间的一致性、质量和可维护性。
|
|
12
12
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: ../../../core/anti-hallucination.md
|
|
3
|
-
source_version: 1.5.
|
|
4
|
-
translation_version: 1.5.
|
|
5
|
-
last_synced: 2026-
|
|
3
|
+
source_version: 1.5.1
|
|
4
|
+
translation_version: 1.5.1
|
|
5
|
+
last_synced: 2026-04-20
|
|
6
6
|
status: current
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -742,6 +742,24 @@ Redis 是最佳选择。如果这是单实例应用程序且有
|
|
|
742
742
|
|
|
743
743
|
---
|
|
744
744
|
|
|
745
|
+
## Agent 认识论校准(v1.4.0,XSPEC-008)
|
|
746
|
+
|
|
747
|
+
Agent 必须使用 Answer / Ask / Abstain 框架声明其认识论状态:
|
|
748
|
+
|
|
749
|
+
| 动作 | 使用时机 | 必填字段 |
|
|
750
|
+
|------|---------|---------|
|
|
751
|
+
| `answer` | 拥有足够信息 | 无(completeness/confidence 为选填)|
|
|
752
|
+
| `ask` | 缺少关键信息 | `missing_variables` 列表 |
|
|
753
|
+
| `abstain` | 真正超出能力范围 | `abstain_reason` |
|
|
754
|
+
|
|
755
|
+
**Fail-closed Agent**(必须始终回答):`evaluator`、`guardian`
|
|
756
|
+
|
|
757
|
+
**向后兼容**:缺少 `epistemic` 字段时默认为 `action_type: "answer"`。
|
|
758
|
+
|
|
759
|
+
参见:XSPEC-008、DEC-014(PassiveQA)
|
|
760
|
+
|
|
761
|
+
---
|
|
762
|
+
|
|
745
763
|
## 相关标准
|
|
746
764
|
|
|
747
765
|
- [测试标准](testing-standards.md) - 确保验证 AI 分析结果(或使用 `/testing-guide` 技能)
|
|
@@ -754,6 +772,7 @@ Redis 是最佳选择。如果这是单实例应用程序且有
|
|
|
754
772
|
|
|
755
773
|
| 版本 | 日期 | 变更 |
|
|
756
774
|
|------|------|------|
|
|
775
|
+
| 1.5.1 | 2026-04-13 | 新增: Agent 认识论校准(Answer/Ask/Abstain)框架(XSPEC-008)|
|
|
757
776
|
| 1.4.0 | 2026-01-19 | 新增: 副作用分析规则(第 7 条禁止行为)、工作流程步骤及检查清单项目 |
|
|
758
777
|
| 1.3.1 | 2025-12-24 | 新增: 相关标准章节 |
|
|
759
778
|
| 1.3.0 | 2025-12-22 | 增强: 禁止行为章节,新增详细对比范例 |
|