universal-dev-standards 5.1.0-beta.7 → 5.1.1

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 (116) hide show
  1. package/README.md +6 -0
  2. package/bin/uds.js +2 -0
  3. package/bundled/ai/standards/checkin-standards.ai.yaml +18 -0
  4. package/bundled/ai/standards/test-governance.ai.yaml +12 -0
  5. package/bundled/ai/standards/testing.ai.yaml +14 -0
  6. package/bundled/ai/standards/translation-lifecycle-standards.ai.yaml +145 -0
  7. package/bundled/core/checkin-standards.md +21 -2
  8. package/bundled/core/test-governance.md +3 -0
  9. package/bundled/core/testing-standards.md +25 -2
  10. package/bundled/core/translation-lifecycle-standards.md +162 -0
  11. package/bundled/locales/zh-CN/CHANGELOG.md +50 -3
  12. package/bundled/locales/zh-CN/README.md +1 -1
  13. package/bundled/locales/zh-CN/core/anti-hallucination.md +22 -3
  14. package/bundled/locales/zh-CN/core/anti-sycophancy-prompting.md +192 -0
  15. package/bundled/locales/zh-CN/core/capability-declaration.md +123 -0
  16. package/bundled/locales/zh-CN/core/checkin-standards.md +22 -3
  17. package/bundled/locales/zh-CN/core/circuit-breaker.md +106 -0
  18. package/bundled/locales/zh-CN/core/dual-phase-output.md +103 -0
  19. package/bundled/locales/zh-CN/core/failure-source-taxonomy.md +99 -0
  20. package/bundled/locales/zh-CN/core/frontend-design-standards.md +289 -0
  21. package/bundled/locales/zh-CN/core/health-check-standards.md +144 -0
  22. package/bundled/locales/zh-CN/core/immutability-first.md +96 -0
  23. package/bundled/locales/zh-CN/core/packaging-standards.md +224 -0
  24. package/bundled/locales/zh-CN/core/recovery-recipe-registry.md +146 -0
  25. package/bundled/locales/zh-CN/core/retry-standards.md +131 -0
  26. package/bundled/locales/zh-CN/core/security-decision.md +104 -0
  27. package/bundled/locales/zh-CN/core/skill-standard-alignment-check.md +112 -0
  28. package/bundled/locales/zh-CN/core/standard-admission-criteria.md +104 -0
  29. package/bundled/locales/zh-CN/core/standard-lifecycle-management.md +116 -0
  30. package/bundled/locales/zh-CN/core/test-governance.md +14 -3
  31. package/bundled/locales/zh-CN/core/testing-standards.md +26 -3
  32. package/bundled/locales/zh-CN/core/timeout-standards.md +117 -0
  33. package/bundled/locales/zh-CN/core/token-budget.md +108 -0
  34. package/bundled/locales/zh-CN/core/translation-lifecycle-standards.md +159 -0
  35. package/bundled/locales/zh-TW/CHANGELOG.md +50 -3
  36. package/bundled/locales/zh-TW/README.md +1 -1
  37. package/bundled/locales/zh-TW/core/anti-sycophancy-prompting.md +8 -0
  38. package/bundled/locales/zh-TW/core/capability-declaration.md +111 -0
  39. package/bundled/locales/zh-TW/core/checkin-standards.md +24 -3
  40. package/bundled/locales/zh-TW/core/circuit-breaker.md +111 -0
  41. package/bundled/locales/zh-TW/core/dual-phase-output.md +132 -0
  42. package/bundled/locales/zh-TW/core/failure-source-taxonomy.md +146 -0
  43. package/bundled/locales/zh-TW/core/frontend-design-standards.md +460 -0
  44. package/bundled/locales/zh-TW/core/health-check-standards.md +144 -0
  45. package/bundled/locales/zh-TW/core/immutability-first.md +159 -0
  46. package/bundled/locales/zh-TW/core/recovery-recipe-registry.md +146 -0
  47. package/bundled/locales/zh-TW/core/retry-standards.md +140 -0
  48. package/bundled/locales/zh-TW/core/security-decision.md +120 -0
  49. package/bundled/locales/zh-TW/core/skill-standard-alignment-check.md +112 -0
  50. package/bundled/locales/zh-TW/core/standard-admission-criteria.md +104 -0
  51. package/bundled/locales/zh-TW/core/standard-lifecycle-management.md +116 -0
  52. package/bundled/locales/zh-TW/core/test-governance.md +14 -3
  53. package/bundled/locales/zh-TW/core/testing-standards.md +31 -0
  54. package/bundled/locales/zh-TW/core/timeout-standards.md +117 -0
  55. package/bundled/locales/zh-TW/core/token-budget.md +143 -0
  56. package/bundled/locales/zh-TW/core/translation-lifecycle-standards.md +159 -0
  57. package/bundled/locales/zh-TW/skills/ac-coverage-assistant/SKILL.md +1 -0
  58. package/bundled/locales/zh-TW/skills/adr-assistant/SKILL.md +1 -0
  59. package/bundled/locales/zh-TW/skills/ai-collaboration-standards/SKILL.md +1 -0
  60. package/bundled/locales/zh-TW/skills/ai-friendly-architecture/SKILL.md +1 -0
  61. package/bundled/locales/zh-TW/skills/ai-instruction-standards/SKILL.md +1 -0
  62. package/bundled/locales/zh-TW/skills/api-design-assistant/SKILL.md +1 -0
  63. package/bundled/locales/zh-TW/skills/atdd-assistant/SKILL.md +1 -0
  64. package/bundled/locales/zh-TW/skills/audit-assistant/SKILL.md +1 -0
  65. package/bundled/locales/zh-TW/skills/bdd-assistant/SKILL.md +1 -0
  66. package/bundled/locales/zh-TW/skills/brainstorm-assistant/SKILL.md +1 -0
  67. package/bundled/locales/zh-TW/skills/changelog-guide/SKILL.md +1 -0
  68. package/bundled/locales/zh-TW/skills/checkin-assistant/SKILL.md +1 -0
  69. package/bundled/locales/zh-TW/skills/ci-cd-assistant/SKILL.md +1 -0
  70. package/bundled/locales/zh-TW/skills/code-review-assistant/SKILL.md +1 -0
  71. package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +1 -0
  72. package/bundled/locales/zh-TW/skills/contract-test-assistant/SKILL.md +1 -0
  73. package/bundled/locales/zh-TW/skills/database-assistant/SKILL.md +1 -0
  74. package/bundled/locales/zh-TW/skills/dev-workflow-guide/SKILL.md +1 -0
  75. package/bundled/locales/zh-TW/skills/docs-generator/SKILL.md +1 -0
  76. package/bundled/locales/zh-TW/skills/documentation-guide/SKILL.md +1 -0
  77. package/bundled/locales/zh-TW/skills/durable-execution-assistant/SKILL.md +1 -0
  78. package/bundled/locales/zh-TW/skills/e2e-assistant/SKILL.md +1 -0
  79. package/bundled/locales/zh-TW/skills/forward-derivation/SKILL.md +1 -0
  80. package/bundled/locales/zh-TW/skills/incident-response-assistant/SKILL.md +1 -0
  81. package/bundled/locales/zh-TW/skills/methodology-system/SKILL.md +1 -0
  82. package/bundled/locales/zh-TW/skills/metrics-dashboard-assistant/SKILL.md +1 -0
  83. package/bundled/locales/zh-TW/skills/migration-assistant/SKILL.md +1 -0
  84. package/bundled/locales/zh-TW/skills/observability-assistant/SKILL.md +1 -0
  85. package/bundled/locales/zh-TW/skills/pr-automation-assistant/SKILL.md +1 -0
  86. package/bundled/locales/zh-TW/skills/process-automation/SKILL.md +1 -0
  87. package/bundled/locales/zh-TW/skills/project-discovery/SKILL.md +1 -0
  88. package/bundled/locales/zh-TW/skills/project-structure-guide/SKILL.md +1 -0
  89. package/bundled/locales/zh-TW/skills/refactoring-assistant/SKILL.md +1 -0
  90. package/bundled/locales/zh-TW/skills/release-standards/SKILL.md +1 -0
  91. package/bundled/locales/zh-TW/skills/requirement-assistant/SKILL.md +1 -0
  92. package/bundled/locales/zh-TW/skills/retrospective-assistant/SKILL.md +1 -0
  93. package/bundled/locales/zh-TW/skills/reverse-engineer/SKILL.md +1 -0
  94. package/bundled/locales/zh-TW/skills/runbook-assistant/SKILL.md +1 -0
  95. package/bundled/locales/zh-TW/skills/security-assistant/SKILL.md +1 -0
  96. package/bundled/locales/zh-TW/skills/security-scan-assistant/SKILL.md +1 -0
  97. package/bundled/locales/zh-TW/skills/slo-assistant/SKILL.md +1 -0
  98. package/bundled/locales/zh-TW/skills/spec-driven-dev/SKILL.md +1 -0
  99. package/bundled/locales/zh-TW/skills/tdd-assistant/SKILL.md +1 -0
  100. package/bundled/locales/zh-TW/skills/test-coverage-assistant/SKILL.md +1 -0
  101. package/bundled/skills/ai-collaboration-standards/SKILL.md +1 -0
  102. package/bundled/skills/ai-friendly-architecture/SKILL.md +1 -0
  103. package/bundled/skills/ai-instruction-standards/SKILL.md +1 -0
  104. package/bundled/skills/documentation-guide/SKILL.md +1 -0
  105. package/bundled/skills/error-code-guide/SKILL.md +1 -0
  106. package/bundled/skills/git-workflow-guide/SKILL.md +1 -0
  107. package/bundled/skills/logging-guide/SKILL.md +1 -0
  108. package/bundled/skills/project-structure-guide/SKILL.md +1 -0
  109. package/bundled/skills/testing-guide/SKILL.md +1 -0
  110. package/package.json +5 -4
  111. package/src/commands/check.js +6 -0
  112. package/src/commands/init.js +6 -0
  113. package/src/commands/update.js +6 -0
  114. package/src/utils/detect-self-adoption.js +173 -0
  115. package/src/utils/directory-mapper.js +2 -2
  116. package/standards-registry.json +15 -4
package/README.md CHANGED
@@ -349,6 +349,12 @@ npm install
349
349
  npm link
350
350
  ```
351
351
 
352
+ ### Type Checking | 型別檢查
353
+
354
+ No `typecheck` script is provided — this CLI is pure ESM JavaScript (`.js` / `.mjs`), no TypeScript sources, and no `tsconfig.json`. Static analysis is handled by `npm run lint` (ESLint). Tracked under BUG-A04 (XSPEC-073).
355
+
356
+ 未提供 `typecheck` 腳本 —— 本 CLI 為純 ESM JavaScript(`.js` / `.mjs`),無 TypeScript 原始碼亦無 `tsconfig.json`。靜態分析由 `npm run lint`(ESLint)負責。追蹤於 BUG-A04(XSPEC-073)。
357
+
352
358
  ### Git Hooks | Git 鉤子
353
359
 
354
360
  Git hooks work through Git Bash, which is included with Git for Windows. No additional configuration needed.
package/bin/uds.js CHANGED
@@ -128,6 +128,7 @@ program
128
128
  .option('--content-layout <layout>', 'Content layout (flat, layered) [default: flat]')
129
129
  .option('-y, --yes', 'Use defaults, skip interactive prompts')
130
130
  .option('-E, --experimental', 'Enable experimental features (methodology)')
131
+ .option('--force', 'Bypass UDS source-repo self-adoption guard (DEC-044 / XSPEC-071)')
131
132
  .action(initCommand);
132
133
 
133
134
  program
@@ -173,6 +174,7 @@ program
173
174
  .option('--ci', 'CI mode: disable interactive prompts and set exit code on issues')
174
175
  .option('--migrate', 'Migrate legacy manifest to hash-based tracking')
175
176
  .option('--offline', 'Skip npm registry check for CLI updates')
177
+ .option('--force', 'Bypass UDS source-repo self-adoption guard (DEC-044 / XSPEC-071)')
176
178
  .action(checkCommand);
177
179
 
178
180
  program
@@ -147,6 +147,24 @@ standard:
147
147
  instruction: AI must NOT auto-execute git add/commit/push, wait for explicit user approval
148
148
  priority: required
149
149
 
150
+ - id: project-file-sync
151
+ trigger: adding a new source file to disk
152
+ instruction: >
153
+ For legacy project formats (e.g. .NET Framework .csproj, MSBuild), every
154
+ source file on disk must also be registered in the project manifest file.
155
+ Unregistered files are silently excluded from compilation without any error
156
+ or warning. Run a pre-build or pre-commit check comparing files on disk
157
+ against project manifest entries; fail fast on any unregistered file.
158
+ priority: required
159
+ applicability: legacy_project_formats
160
+ examples:
161
+ - ".NET Framework .csproj (ItemGroup/Compile Include)"
162
+ - "legacy MSBuild project files"
163
+ evidence: >
164
+ Real incident (2026-04): ADAccountManagerV2.aspx.cs added to disk but not
165
+ registered in MSPlatform.csproj — silently excluded from build, causing
166
+ production crash with "Cannot load type" error.
167
+
150
168
  physical_spec:
151
169
  type: custom_script
152
170
  validator:
@@ -146,3 +146,15 @@ standard:
146
146
  System tests should stub external dependencies but use real internal services.
147
147
  Use SIT environment for system-level validation.
148
148
  priority: recommended
149
+
150
+ - id: test-execution-continuity
151
+ trigger: adding or completing a test case
152
+ instruction: >
153
+ A test case must be wired to an automated execution trigger (CI gate, build
154
+ hook, or scheduled run). A test that exists but is never run provides false
155
+ confidence and is worse than no test at all. Verify that execution history
156
+ exists before marking test coverage as complete.
157
+ priority: required
158
+ evidence: >
159
+ BUG-A08 post-mortem (2026-04-20): 22 tests existed in UDS but were never
160
+ executed by any CI gate, passing silently and masking real failures.
@@ -113,6 +113,20 @@ standard:
113
113
  instruction: Use test doubles sparingly; prefer real implementations when fast enough
114
114
  priority: recommended
115
115
 
116
+ - id: e2e-precondition-scope
117
+ trigger: writing E2E globalSetup or environment pre-checks
118
+ instruction: >
119
+ E2E environment pre-checks must verify the health of ALL pages and endpoints
120
+ under test, not just the authentication entry point. A smoke check that only
121
+ validates the login page will silently pass even when feature pages return
122
+ HTTP 500. Maintain an explicit list of pages covered by the suite and verify
123
+ each returns a non-5xx response before running tests.
124
+ priority: recommended
125
+ evidence: >
126
+ Real incident (2026-04): E2E globalSetup only checked Login.aspx health;
127
+ feature page returned 500 silently — full E2E suite passed with false
128
+ confidence, masking a production crash.
129
+
116
130
  physical_spec:
117
131
  type: custom_script
118
132
  validator:
@@ -0,0 +1,145 @@
1
+ # Translation Lifecycle Standards - AI Optimized
2
+ # Source: core/translation-lifecycle-standards.md
3
+
4
+ id: translation-lifecycle-standards
5
+ meta:
6
+ version: "1.0.0"
7
+ updated: "2026-04-20"
8
+ status: trial
9
+ since: "2026-04-20"
10
+ expires: "2026-10-20"
11
+ source: core/translation-lifecycle-standards.md
12
+ description: >
13
+ MISSING vs OUTDATED distinction, semver-aware severity (PATCH/MINOR/MAJOR),
14
+ and automation integration for translation sync in multi-locale projects.
15
+ scope: universal
16
+ parent: documentation-lifecycle
17
+
18
+ severity_levels:
19
+ MISSING:
20
+ condition: Translation file does not exist
21
+ exit_code: 1
22
+ label: "[MISSING]"
23
+ action: Create before release
24
+ MAJOR:
25
+ condition: source major version ahead of translation source_version major
26
+ exit_code: 1
27
+ label: "[MAJOR]"
28
+ action: Update before stable release (blocker)
29
+ MINOR:
30
+ condition: source minor version ahead (same major)
31
+ exit_code: 0
32
+ label: "[MINOR]"
33
+ action: Update before next release (advisory)
34
+ PATCH:
35
+ condition: source patch version ahead (same major.minor)
36
+ exit_code: 0
37
+ label: "[PATCH]"
38
+ action: Update when convenient (advisory)
39
+ CURRENT:
40
+ condition: source_version == current source version
41
+ exit_code: 0
42
+ label: "[CURRENT]"
43
+ action: None
44
+
45
+ frontmatter_schema:
46
+ required:
47
+ - source # relative path to source file
48
+ - source_version # source version at last sync (semver)
49
+ - translation_version # translation's own version
50
+ - last_synced # YYYY-MM-DD
51
+ - status # current | outdated | draft
52
+
53
+ trigger_conditions:
54
+ - event: new_standard_added
55
+ action: Create translation in ALL supported locales
56
+ severity: MISSING (blocker if absent)
57
+ - event: standard_patch_bump
58
+ action: Update frontmatter source_version + last_synced
59
+ severity: PATCH (advisory)
60
+ - event: standard_minor_bump
61
+ action: Translate new content + update frontmatter
62
+ severity: MINOR (advisory, before next release)
63
+ - event: standard_major_bump
64
+ action: Full retranslation + update frontmatter
65
+ severity: MAJOR (blocker, before current release)
66
+
67
+ automation:
68
+ pre_commit_hook:
69
+ file: .githooks/pre-commit
70
+ trigger: core/*.md files staged
71
+ behavior: warn on OUTDATED, never block commit
72
+ setup: ./scripts/install-hooks.sh
73
+ release_gate:
74
+ command: bash scripts/check-translation-sync.sh
75
+ exit_1_conditions: [MISSING, MAJOR]
76
+ exit_0_conditions: [MINOR, PATCH, CURRENT]
77
+ bump_version_integration:
78
+ command: runs check-translation-sync.sh after version files updated
79
+ purpose: immediate feedback on translation health at bump time
80
+
81
+ rules:
82
+ - id: missing-is-blocker
83
+ trigger: running release gate check
84
+ instruction: >
85
+ Any translation file that does not exist is a release blocker.
86
+ The release gate must exit 1 if MISSING count > 0.
87
+ priority: required
88
+
89
+ - id: major-gap-is-blocker
90
+ trigger: running release gate check
91
+ instruction: >
92
+ If a translation's source_version MAJOR is behind the current source MAJOR,
93
+ the translation may be fundamentally incorrect. Exit 1.
94
+ priority: required
95
+
96
+ - id: minor-patch-advisory
97
+ trigger: running release gate check
98
+ instruction: >
99
+ MINOR and PATCH version gaps are advisory. Show warnings but exit 0.
100
+ Users can still read the translation; it is slightly stale, not wrong.
101
+ priority: required
102
+
103
+ - id: frontmatter-required
104
+ trigger: creating or updating a translation file
105
+ instruction: >
106
+ Every translation file MUST start with YAML frontmatter containing:
107
+ source, source_version, translation_version, last_synced, status.
108
+ Files without frontmatter are flagged as MISSING_FRONTMATTER.
109
+ priority: required
110
+
111
+ - id: update-on-source-change
112
+ trigger: modifying a source standard in core/
113
+ instruction: >
114
+ After modifying a core standard, check if translations need updating.
115
+ At minimum update frontmatter source_version + last_synced for PATCH changes.
116
+ For MINOR/MAJOR changes, update translated content too.
117
+ priority: recommended
118
+
119
+ scenarios:
120
+ - id: new-standard
121
+ given: A new standard is added to core/ with no translations
122
+ when: check-translation-sync.sh runs
123
+ then: Reports [MISSING] for each locale; exits 1
124
+ error_code: TRANS-001
125
+
126
+ - id: patch-bump
127
+ given: Source goes from 1.0.0 to 1.0.1; translation source_version=1.0.0
128
+ when: check-translation-sync.sh runs
129
+ then: Reports [PATCH] advisory; exits 0
130
+
131
+ - id: major-gap
132
+ given: Source is at 2.0.0; translation source_version=1.5.0
133
+ when: check-translation-sync.sh runs
134
+ then: Reports [MAJOR] blocker; exits 1
135
+ error_code: TRANS-002
136
+
137
+ integration_points:
138
+ - system: check-translation-sync.sh
139
+ role: primary automation; enforces severity levels
140
+ - system: .githooks/pre-commit
141
+ role: commit-time reminder when core/ files staged
142
+ - system: bump-version.sh
143
+ role: release-time advisory snapshot
144
+ - system: pre-release-check.sh
145
+ role: final gate before npm publish (calls check-translation-sync.sh)
@@ -2,8 +2,8 @@
2
2
 
3
3
  > **Language**: English | [繁體中文](../locales/zh-TW/core/checkin-standards.md)
4
4
 
5
- **Version**: 1.5.0
6
- **Last Updated**: 2026-03-18
5
+ **Version**: 1.6.0
6
+ **Last Updated**: 2026-04-20
7
7
  **Applicability**: All software projects using version control
8
8
  **Scope**: partial
9
9
  **Industry Standards**: SWEBOK v4.0 Chapter 6
@@ -906,6 +906,25 @@ obj/
906
906
  node_modules/
907
907
  ```
908
908
 
909
+ ### Legacy Project File Sync (project-file-sync)
910
+
911
+ > **Applicability**: .NET Framework, MSBuild `.csproj`, and any legacy format that requires explicit file registration.
912
+
913
+ Legacy project formats (e.g. `.NET Framework .csproj`) do **not** auto-include source files on disk — every file must be explicitly listed in the project manifest. Unregistered files are **silently excluded from compilation** with no error or warning.
914
+
915
+ **Risk**: You add a new `.cs`/`.aspx.cs` file, rebuild the DLL — the file is excluded. Tests pass (they're testing the old DLL). Production crashes with "Cannot load type".
916
+
917
+ **Pre-commit check**:
918
+
919
+ ```bash
920
+ # Find .cs files on disk not registered in .csproj
921
+ comm -23 \
922
+ <(find . -name "*.cs" | sort) \
923
+ <(grep -oP '(?<=Include=")[^"]+\.cs' MyProject.csproj | sort)
924
+ ```
925
+
926
+ **Rule**: If your project uses a legacy format, run a disk-vs-manifest comparison before every commit. Fail fast on any unregistered file.
927
+
909
928
  ---
910
929
 
911
930
  ## Common Violations and Solutions
@@ -2,6 +2,8 @@
2
2
 
3
3
  > **Language**: English | [繁體中文](../locales/zh-TW/core/test-governance.md)
4
4
 
5
+ **Version**: 1.1.0
6
+ **Last Updated**: 2026-04-20
5
7
  **Applicability**: All software projects
6
8
  **Scope**: universal
7
9
 
@@ -121,6 +123,7 @@ Release completion criteria (checked before release):
121
123
  | enforce-completion-criteria | Completing a task or feature | Verify all required completion criteria are met before marking task/feature as done | Required |
122
124
  | pyramid-compliance | Planning test strategy | Follow the 70/20/7/3 pyramid ratio as a guideline. Deviation is acceptable with documented justification | Required |
123
125
  | sit-isolation | Running system tests | System tests should stub external dependencies but use real internal services. Use SIT environment for system-level validation | Recommended |
126
+ | test-execution-continuity | Adding or completing a test case | A test case must be wired to an automated execution trigger (CI gate, build hook, or scheduled run). A test that exists but is never run provides false confidence and is worse than no test at all. Verify that execution history exists before marking test coverage as complete. | Required |
124
127
 
125
128
  ---
126
129
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  > **Language**: English | [繁體中文](../locales/zh-TW/core/testing-standards.md)
4
4
 
5
- **Version**: 3.1.0
6
- **Last Updated**: 2026-03-24
5
+ **Version**: 3.2.0
6
+ **Last Updated**: 2026-04-20
7
7
  **Applicability**: All software projects
8
8
  **Scope**: universal
9
9
  **Industry Standards**: ISTQB CTFL v4.0, ISO/IEC/IEEE 29119
@@ -231,6 +231,29 @@ This standard defines actionable testing rules and conventions for AI agents and
231
231
  e2e/[feature]/[scenario].[ext]
232
232
  ```
233
233
 
234
+ #### E2E Precondition Scope (e2e-precondition-scope)
235
+
236
+ E2E environment pre-checks (`globalSetup`, `beforeAll`) must verify the health of **all pages and endpoints under test**, not just the authentication entry point.
237
+
238
+ **Anti-pattern** — login-only health check:
239
+ ```ts
240
+ // ❌ Passes even when feature pages return 500
241
+ await page.goto('/login');
242
+ expect(response.status()).toBe(200);
243
+ ```
244
+
245
+ **Required pattern** — explicit coverage list:
246
+ ```ts
247
+ // ✅ Verify all pages covered by the suite
248
+ const PAGES_UNDER_TEST = ['/login', '/dashboard', '/feature-x'];
249
+ for (const path of PAGES_UNDER_TEST) {
250
+ const res = await fetch(`${BASE_URL}${path}`);
251
+ expect(res.status).toBeLessThan(500); // fail fast on 5xx
252
+ }
253
+ ```
254
+
255
+ > **Evidence**: Real incident — E2E `globalSetup` only checked `Login.aspx`; a feature page returned HTTP 500 silently. The full E2E suite passed with false confidence, masking a production crash.
256
+
234
257
  ---
235
258
 
236
259
  ## Test Doubles
@@ -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-beta.7
4
- translation_version: 5.1.0-beta.7
5
- last_synced: 2026-04-17
3
+ source_version: 5.1.1
4
+ translation_version: 5.1.1
5
+ last_synced: 2026-04-20
6
6
  status: current
7
7
  ---
8
8
 
@@ -17,6 +17,53 @@ status: current
17
17
 
18
18
  ## [Unreleased]
19
19
 
20
+ ## [5.1.1] - 2026-04-20
21
+
22
+ > **补丁版本**:Windows CI 修正、53 个 SKILL.md 补 `name` 字段、三份 `.md` 源文件依 BUG-A08 事后分析新增规则、zh-TW/zh-CN 翻译同步。
23
+
24
+ ### 修正
25
+ - **`cli/src/utils/directory-mapper.js`**:以 `path.basename(dir)` 取代 `dir.split('/').pop()`,修正 Windows CI 路径分隔符兼容性问题(修复 Windows CI runner 上 `directory-mapper.test.js` 测试失败)。
26
+
27
+ ### 新增
28
+ - **`name` 字段** 补齐至 9 个源目录 `skills/*/SKILL.md` 及 44 个 `locales/zh-TW/skills/*/SKILL.md`,符合 Skill 验证工具需求。
29
+
30
+ ### 变更
31
+ - **`core/test-governance.md`** 1.0.0 → 1.1.0:新增 `test-execution-continuity` 规则(BUG-A08 事后分析 — 22 个测试存在但未连接任何 CI 执行触发器)。
32
+ - **`core/checkin-standards.md`** 1.5.0 → 1.6.0:新增旧版项目文件同步(`project-file-sync`)章节 — 磁盘上的每个源文件必须注册于旧版项目 manifest 中。
33
+ - **`core/testing-standards.md`** 3.1.0 → 3.2.0:新增 E2E 前置条件范围(`e2e-precondition-scope`)章节 — E2E 前置检查必须验证所有受测页面/端点,而非仅验证认证入口。
34
+ - **zh-TW 与 zh-CN 翻译** 已同步 `test-governance.md`、`checkin-standards.md`、`testing-standards.md` 三份文件。
35
+
36
+ [5.1.1]: https://github.com/AsiaOstrich/universal-dev-standards/compare/v5.1.0...v5.1.1
37
+
38
+ ## [5.1.0] - 2026-04-20
39
+
40
+ > **正式版**: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 个。
41
+
42
+ ### 新增
43
+ - **`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 事后分析。
44
+ - **`.githooks/pre-commit`** + **`scripts/install-hooks.sh`**:commit 时若暂存 `core/*.md` 文件则显示 OUTDATED 警告,永不阻塞 commit。通过 `./scripts/install-hooks.sh` 启用。
45
+ - **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` 等。
46
+ - **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` 等。
47
+
48
+ ### 变更
49
+ - **`check-translation-sync.sh`**:Semver 感知严重度 — MAJOR 版本落差现在 exit 1(发布阻塞器);MINOR/PATCH 落差 exit 0 附 advisory 警告。新增 `semver_diff()` 函数与 `[MAJOR]`/`[MINOR]`/`[PATCH]` 严重度标签。
50
+ - **`bump-version.sh`**:更新版本文件后自动执行 `check-translation-sync.sh`,在升版时提供翻译健康状态快照。
51
+ - **`scripts/pre-release-check.sh`**:更新为将 `check-translation-sync.sh` 作为硬闸门(MISSING + MAJOR = exit 1)。
52
+
53
+ ### 修正
54
+ - **zh-CN `anti-hallucination.md`**(BUG-A06):从 1.5.0 更新至 1.5.1 — 补上缺失的「Agent 认识论校准」章节(Answer/Ask/Abstain 框架,XSPEC-008)。该章节自 2026-04-13 起在 zh-CN 中完全缺失。
55
+ - **22 个假通过测试**(BUG-A08):修正未正确验证行为的测试,加入真实断言。
56
+
57
+ ### 升至 Adopt(Pre-release Batch 0)
58
+ - `circuit-breaker`(DEC-021):Trial 6 个月后升至 Adopt
59
+ - `token-budget`(DEC-025):Trial 6 个月后升至 Adopt
60
+ - `dual-phase-output`(DEC-031):Trial 6 个月后升至 Adopt
61
+ - `security-decision`(DEC-035):Trial 6 个月后升至 Adopt
62
+ - `immutability-first`(DEC-038):Trial 6 个月后升至 Adopt
63
+ - `failure-source-taxonomy`(DEC-040):Trial 6 个月后升至 Adopt
64
+
65
+ [5.1.0]: https://github.com/AsiaOstrich/universal-dev-standards/compare/v5.1.0-beta.7...v5.1.0
66
+
20
67
  ## [5.1.0-beta.7] - 2026-04-17
21
68
 
22
69
  > **Beta Release**:DEC-043 Wave 1 — 六个 Trial 状态标准,涵盖可靠性模式与治理 Meta 框架。
@@ -6,7 +6,7 @@
6
6
 
7
7
  > **语言**: [English](../../README.md) | [繁體中文](../zh-TW/README.md) | 简体中文
8
8
 
9
- **版本**: 5.1.0-beta.7 (Pre-release) | **发布日期**: 2026-04-13 | **授权**: [双重授权](../../LICENSE) (CC BY 4.0 + MIT)
9
+ **版本**: 5.1.1 | **发布日期**: 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.0
4
- translation_version: 1.5.0
5
- last_synced: 2026-02-10
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 | 增强: 禁止行为章节,新增详细对比范例 |