universal-dev-standards 6.3.3 → 6.3.4

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.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  source: ../../CHANGELOG.md
3
- source_version: 6.3.3
4
- translation_version: 6.3.3
3
+ source_version: 6.3.4
4
+ translation_version: 6.3.4
5
5
  last_synced: 2026-08-07
6
6
  status: current
7
7
  ---
@@ -17,6 +17,13 @@ status: current
17
17
 
18
18
  ## [Unreleased]
19
19
 
20
+ ## [6.3.4] - 2026-08-07
21
+
22
+ ### Fixed
23
+
24
+ - **`uds deps` 指名了一个 npm 不会安装的版本。** 解析字段原本取「所有已发布版本中满足声明范围的最高版本」。那是 semver 的规则,不是 npm 的:`npm-pick-manifest` 在 `latest` dist-tag 满足范围时优先采用它,存在的目的正是不让带着普通版本号的 `next` 或 `beta` 发布落到只要了一个 caret 的人身上。以 `@anthropic-ai/claude-agent-sdk` 实测(`latest = 0.3.223`、`next = 0.3.224`):命令回报 0.3.224,而 `npm install …@^0.3` 实际装 0.3.223。**那个字段存在的全部目的就是说出「安装会拿到什么」,而它指名了没有任何安装会拿到的东西。** 现改为单次 `npm view` 同时取版本清单与 dist-tags,套用 npm 自己的优先顺序;`latest` 落在范围外时退回「范围内最高版本」——锁在旧 major 的项目仍得到诚实的答案。两个分支各有测试覆盖。
25
+ - 前两个版本修的是这个命令的**措辞**,这一版修的是它的**算术**。值得直说:先前那些修正只是让一个错的数字变得更好读。
26
+
20
27
  ## [6.3.3] - 2026-08-07
21
28
 
22
29
  ### Fixed
@@ -15,7 +15,7 @@ status: current
15
15
 
16
16
  > **语言**: [English](../../README.md) | [繁體中文](../zh-TW/README.md) | 简体中文
17
17
 
18
- **版本**: 6.3.3 | **发布日期**: 2026-07-31 | **授权**: [双重授权](../../LICENSE) (CC BY 4.0 + MIT)
18
+ **版本**: 6.3.4 | **发布日期**: 2026-07-31 | **授权**: [双重授权](../../LICENSE) (CC BY 4.0 + MIT)
19
19
 
20
20
  语言无关、框架无关的软件项目文档标准。通过 AI 原生工作流,确保不同技术栈之间的一致性、质量和可维护性。
21
21
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  source: ../../CHANGELOG.md
3
- source_version: 6.3.3
4
- translation_version: 6.3.3
3
+ source_version: 6.3.4
4
+ translation_version: 6.3.4
5
5
  last_synced: 2026-08-07
6
6
  status: current
7
7
  ---
@@ -17,6 +17,13 @@ status: current
17
17
 
18
18
  ## [Unreleased]
19
19
 
20
+ ## [6.3.4] - 2026-08-07
21
+
22
+ ### Fixed
23
+
24
+ - **`uds deps` 指名了一個 npm 不會安裝的版本。** 解析欄位原本取「所有已發布版本中滿足宣告範圍的最高版本」。那是 semver 的規則,不是 npm 的:`npm-pick-manifest` 在 `latest` dist-tag 滿足範圍時優先採用它,存在的目的正是不讓帶著普通版本號的 `next` 或 `beta` 發布落到只要了一個 caret 的人身上。以 `@anthropic-ai/claude-agent-sdk` 實測(`latest = 0.3.223`、`next = 0.3.224`):指令回報 0.3.224,而 `npm install …@^0.3` 實際裝 0.3.223。**那個欄位存在的全部目的就是說出「安裝會拿到什麼」,而它指名了沒有任何安裝會拿到的東西。** 現改為單次 `npm view` 同時取版本清單與 dist-tags,套用 npm 自己的優先順序;`latest` 落在範圍外時退回「範圍內最高版本」——鎖在舊 major 的專案仍得到誠實的答案。兩個分支各有測試覆蓋。
25
+ - 前兩個版本修的是這個指令的**措辭**,這一版修的是它的**算術**。值得直說:先前那些修正只是讓一個錯的數字變得更好讀。
26
+
20
27
  ## [6.3.3] - 2026-08-07
21
28
 
22
29
  ### Fixed
@@ -15,7 +15,7 @@ status: current
15
15
 
16
16
  > **語言**: [English](../../README.md) | 繁體中文 | [简体中文](../zh-CN/README.md)
17
17
 
18
- **版本**: 6.3.3 | **發布日期**: 2026-07-31 | **授權**: [雙重授權](../../LICENSE) (CC BY 4.0 + MIT)
18
+ **版本**: 6.3.4 | **發布日期**: 2026-07-31 | **授權**: [雙重授權](../../LICENSE) (CC BY 4.0 + MIT)
19
19
 
20
20
  語言無關、框架無關的軟體專案文件標準。透過 AI 原生工作流,確保不同技術堆疊之間的一致性、品質和可維護性。
21
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "universal-dev-standards",
3
- "version": "6.3.3",
3
+ "version": "6.3.4",
4
4
  "description": "CLI tool for adopting Universal Development Standards",
5
5
  "keywords": [
6
6
  "documentation",
@@ -38,6 +38,12 @@
38
38
  * silently answer a different question for anyone who does not install from
39
39
  * the public registry, and would answer it confidently.
40
40
  *
41
+ * **And it applies npm's resolution rule, not semver's.** The highest version
42
+ * satisfying a range is *not* what npm installs: npm prefers the `latest`
43
+ * dist-tag whenever it satisfies, so a `next` or `beta` publish carrying an
44
+ * ordinary version number does not land on people. Getting this wrong made the
45
+ * tool name a version no consumer receives — see `resolveViaNpm`.
46
+ *
41
47
  * **A registry lookup that fails is never folded into "consistent".** It
42
48
  * becomes `unverifiable` and makes the whole check non-zero. A tool whose
43
49
  * "everything is fine" and "I could not find out" look the same is worse than
@@ -68,18 +74,30 @@ import semver from 'semver';
68
74
  const DEFAULT_CONCURRENCY = 8;
69
75
 
70
76
  /**
71
- * Run `npm view <name>@<range> version --json` and return the highest version
72
- * that satisfies the range.
77
+ * Return the version an install of `range` would actually receive.
78
+ *
79
+ * **This deliberately reproduces npm's rule, not semver's.** The obvious
80
+ * implementation — take the highest published version satisfying the range —
81
+ * is wrong, and wrong in the direction this module exists to catch. npm's
82
+ * resolver (`npm-pick-manifest`) prefers the `latest` dist-tag whenever it
83
+ * satisfies the range, and only falls back to the maximum otherwise. That rule
84
+ * exists so a `next` or `beta` publish does not land on people who asked for a
85
+ * caret.
86
+ *
87
+ * Measured on 2026-08-07: `@anthropic-ai/claude-agent-sdk` published
88
+ * `latest = 0.3.223` and `next = 0.3.224`, both ordinary semver strings, both
89
+ * satisfying `^0.3`. The maximum-satisfying rule named 0.3.224;
90
+ * `npm install @anthropic-ai/claude-agent-sdk@^0.3` installs 0.3.223. **The
91
+ * earlier implementation reported a version no consumer receives** — in the one
92
+ * column whose entire purpose is to say what they receive.
73
93
  *
74
- * npm prints a bare JSON string when exactly one version matches and a JSON
75
- * array when several do. The array is in publish order, **not** semver order —
76
- * a backport released after a major bump appears last while being the lowest
77
- * version — so the maximum is computed with semver rather than by taking the
78
- * final element. Guessing here would produce a confident wrong answer, which
79
- * is the failure mode this whole module exists to detect.
94
+ * Versions and tags are read in a single `npm view` call. The version list is
95
+ * in publish order, **not** semver order — a backport released after a major
96
+ * bump appears last while being the lowest version — so the fallback maximum is
97
+ * computed with semver rather than by taking the final element.
80
98
  */
81
99
  async function resolveViaNpm(name, range, run) {
82
- const { code, stdout, stderr } = await run(['view', `${name}@${range}`, 'version', '--json']);
100
+ const { code, stdout, stderr } = await run(['view', name, 'versions', 'dist-tags', '--json']);
83
101
 
84
102
  if (code !== 0) {
85
103
  const detail = (stderr || stdout || '').split('\n').find((l) => l.trim()) ?? '';
@@ -93,13 +111,30 @@ async function resolveViaNpm(name, range, run) {
93
111
  throw new Error(`npm view returned output that is not JSON: ${stdout.slice(0, 120)}`);
94
112
  }
95
113
 
96
- if (typeof parsed === 'string') return parsed;
97
- if (Array.isArray(parsed) && parsed.length > 0) {
98
- const max = semver.maxSatisfying(parsed, range);
99
- if (max) return max;
100
- throw new Error(`no version in [${parsed.join(', ')}] satisfies ${range}`);
114
+ // npm flattens the response when only one of the requested fields exists on
115
+ // the package, so neither key can be assumed present. A package with exactly
116
+ // one published version reports `versions` as a bare string.
117
+ const versions = Array.isArray(parsed?.versions)
118
+ ? parsed.versions
119
+ : typeof parsed?.versions === 'string'
120
+ ? [parsed.versions]
121
+ : Array.isArray(parsed)
122
+ ? parsed
123
+ : typeof parsed === 'string'
124
+ ? [parsed]
125
+ : [];
126
+ const tags = parsed?.['dist-tags'] ?? {};
127
+
128
+ if (versions.length === 0) throw new Error('npm view returned no versions');
129
+
130
+ const latest = tags.latest;
131
+ if (typeof latest === 'string' && semver.valid(latest) && semver.satisfies(latest, range)) {
132
+ return latest;
101
133
  }
102
- throw new Error('npm view returned no version');
134
+
135
+ const max = semver.maxSatisfying(versions, range);
136
+ if (max) return max;
137
+ throw new Error(`no published version of ${name} satisfies ${range}`);
103
138
  }
104
139
 
105
140
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "version": "6.3.3",
3
+ "version": "6.3.4",
4
4
  "lastUpdated": "2026-05-13",
5
5
  "description": "Standards registry for universal-dev-standards with integrated skills and AI-optimized formats",
6
6
  "formats": {
@@ -58,14 +58,14 @@
58
58
  "standards": {
59
59
  "name": "universal-dev-standards",
60
60
  "url": "https://github.com/AsiaOstrich/universal-dev-standards",
61
- "version": "6.3.3"
61
+ "version": "6.3.4"
62
62
  },
63
63
  "skills": {
64
64
  "name": "universal-dev-standards",
65
65
  "url": "https://github.com/AsiaOstrich/universal-dev-standards",
66
66
  "localPath": "skills",
67
67
  "rawUrl": "https://raw.githubusercontent.com/AsiaOstrich/universal-dev-standards/main/skills",
68
- "version": "6.3.3",
68
+ "version": "6.3.4",
69
69
  "note": "Skills are now included in the main repository under skills/"
70
70
  }
71
71
  },
@@ -2236,7 +2236,7 @@
2236
2236
  "id": "license-compliance",
2237
2237
  "name": "License Compliance Standards",
2238
2238
  "nameZh": "授權合規標準",
2239
- "version": "6.3.3",
2239
+ "version": "6.3.4",
2240
2240
  "source": {
2241
2241
  "human": "core/license-compliance.md",
2242
2242
  "ai": "ai/standards/license-compliance.ai.yaml"
@@ -2248,7 +2248,7 @@
2248
2248
  "id": "verification-oracle",
2249
2249
  "name": "Verification Oracle Standards",
2250
2250
  "nameZh": "驗證 Oracle 標準",
2251
- "version": "6.3.3",
2251
+ "version": "6.3.4",
2252
2252
  "source": {
2253
2253
  "human": "core/verification-oracle.md",
2254
2254
  "ai": "ai/standards/verification-oracle.ai.yaml"
@@ -2260,7 +2260,7 @@
2260
2260
  "id": "model-provenance",
2261
2261
  "name": "Model Provenance Policy Standards",
2262
2262
  "nameZh": "模型來源政策標準",
2263
- "version": "6.3.3",
2263
+ "version": "6.3.4",
2264
2264
  "source": {
2265
2265
  "human": "core/model-provenance.md",
2266
2266
  "ai": "ai/standards/model-provenance.ai.yaml"
@@ -2272,7 +2272,7 @@
2272
2272
  "id": "resource-cost-boundary",
2273
2273
  "name": "Resource / Cost Boundary Declaration Standards",
2274
2274
  "nameZh": "資源/成本邊界宣告標準",
2275
- "version": "6.3.3",
2275
+ "version": "6.3.4",
2276
2276
  "source": {
2277
2277
  "human": "core/resource-cost-boundary.md",
2278
2278
  "ai": "ai/standards/resource-cost-boundary.ai.yaml"