universal-dev-standards 6.15.0-beta.1 → 6.15.0-beta.2

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,9 +1,9 @@
1
1
  ---
2
2
  source: ../../CHANGELOG.md
3
- source_version: 6.15.0-beta.1
4
- translation_version: 6.15.0-beta.1
3
+ source_version: 6.15.0-beta.2
4
+ translation_version: 6.15.0-beta.2
5
5
  last_synced: 2026-11-04
6
- source_hash: edd0f49d4139
6
+ source_hash: 6241fbc376cf
7
7
  status: current
8
8
  ---
9
9
 
@@ -18,6 +18,14 @@ status: current
18
18
 
19
19
  ## [Unreleased]
20
20
 
21
+ ## [6.15.0-beta.2] - 2026-11-04
22
+
23
+ *预发布版,以 `npm install -g universal-dev-standards@beta` 安装。在 6.15.0-beta.1 之上的一个修正,由采用者在 Windows 测 beta.1 时发现:区块丢失 END 行时,`uds update` 拒绝写入,不再另加第二个区块。*
24
+
25
+ ### Fixed
26
+
27
+ - **`uds update` 不再在区块丢失 END 行的文件后面再加一个 UDS 区块,而是拒绝写入并指出没有收尾的那一行(issue #297)。** 集成文件(例如 `AGENTS.md`)有 `<!-- UDS:STANDARDS:START -->` 却没有 `<!-- UDS:STANDARDS:END -->`(复制时被截断,或那一行被手动删除)时,计划显示“missing UDS markers”,`--apply` 会在文件末尾再加一整个区块;同一次运行接着因 START 重复而失败,之后每次运行都一样失败,直到有人手动合并两个区块。现在只有一半的标记、或 END 在 START 之前,都与重复标记同样处理:计划显示 `UDS markers damaged, will not be written`,`--apply` 让文件逐字节保持原样、退出码为 1,并打印哪一行没有收尾。两个标记都没有的文件仍会照常在后面加上区块。
28
+
21
29
  ## [6.15.0-beta.1] - 2026-11-04
22
30
 
23
31
  > **测试版**——以 `npm install -g universal-dev-standards@beta` 安装。要测什么、如何退回正式版:[docs/PRE-RELEASE.md](../../docs/PRE-RELEASE.md)。**请先读:`uds check --ci` 现在对两种原本只印出来的发现以 1 结束**(集成文件指向不存在的路径,以及已安装、却没有任何哈希涵盖的斜线命令),所以采用者升级后 CI 可能变红;下方第一项说明谁受影响、怎么清掉。这个测试版另有:`uds update` 与 `uds update --apply` 现在会替换没人改过的旧 hook 脚本(先备份)、`uds init` 与 `uds update` 不再丢失或重复印出错误输出、`open-work-tracking` 改成选用技能 `open-work`、已安装的技能与斜线命令不再带着打不开的链接,以及 `check-anti-fake-tests` 与 `check-stubs` 在没看完整个项目时会明说「INCOMPLETE」。
@@ -15,7 +15,7 @@ status: current
15
15
 
16
16
  > **语言**: [English](../../README.md) | [繁體中文](../zh-TW/README.md) | 简体中文
17
17
 
18
- **版本**: 6.15.0-beta.1 (Pre-release) | **发布日期**: 2026-11-04 | **授权**: [双重授权](../../LICENSE) (CC BY 4.0 + MIT)
18
+ **版本**: 6.15.0-beta.2 (Pre-release) | **发布日期**: 2026-11-04 | **授权**: [双重授权](../../LICENSE) (CC BY 4.0 + MIT)
19
19
 
20
20
  语言无关、框架无关的软件项目文档标准。通过 AI 原生工作流,确保不同技术栈之间的一致性、质量和可维护性。
21
21
 
@@ -14,7 +14,7 @@ status: current
14
14
  <!-- UDS_SUPPORTED_VERSIONS_START -->
15
15
  | 版本 | 支持状态 |
16
16
  |------|--------|
17
- | 6.15.0-beta.1 | ✅ 预发布版本 |
17
+ | 6.15.0-beta.2 | ✅ 预发布版本 |
18
18
  | 6.14.1 | ✅ 最新正式版 |
19
19
  | < 6.0.0 | ❌ 已终止支持 |
20
20
  <!-- UDS_SUPPORTED_VERSIONS_END -->
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  source: ../../CHANGELOG.md
3
- source_version: 6.15.0-beta.1
4
- translation_version: 6.15.0-beta.1
3
+ source_version: 6.15.0-beta.2
4
+ translation_version: 6.15.0-beta.2
5
5
  last_synced: 2026-11-04
6
- source_hash: edd0f49d4139
6
+ source_hash: 6241fbc376cf
7
7
  status: current
8
8
  ---
9
9
 
@@ -18,6 +18,14 @@ status: current
18
18
 
19
19
  ## [Unreleased]
20
20
 
21
+ ## [6.15.0-beta.2] - 2026-11-04
22
+
23
+ *預發布版,以 `npm install -g universal-dev-standards@beta` 安裝。在 6.15.0-beta.1 之上的一個修正,由採用者在 Windows 測 beta.1 時發現:區塊遺失 END 行時,`uds update` 拒絕寫入,不再另加第二個區塊。*
24
+
25
+ ### Fixed
26
+
27
+ - **`uds update` 不再在區塊遺失 END 行的檔案後面再加一個 UDS 區塊,而是拒絕寫入並指出沒有收尾的那一行(issue #297)。** 整合檔(例如 `AGENTS.md`)有 `<!-- UDS:STANDARDS:START -->` 卻沒有 `<!-- UDS:STANDARDS:END -->`(複製時被截斷,或那一行被手動刪掉)時,計畫顯示「missing UDS markers」,`--apply` 會在檔尾再加一整個區塊;同一次執行接著因 START 重複而失敗,之後每次執行都一樣失敗,直到有人手動合併兩個區塊。現在只有一半的標記、或 END 在 START 之前,都與重複標記同樣處理:計畫顯示 `UDS markers damaged, will not be written`,`--apply` 讓檔案逐位元組維持原樣、結束碼為 1,並印出哪一行沒有收尾。兩個標記都沒有的檔案仍會照常在後面加上區塊。
28
+
21
29
  ## [6.15.0-beta.1] - 2026-11-04
22
30
 
23
31
  > **測試版**——以 `npm install -g universal-dev-standards@beta` 安裝。要測什麼、如何退回正式版:[docs/PRE-RELEASE.md](../../docs/PRE-RELEASE.md)。**請先讀:`uds check --ci` 現在對兩種原本只印出來的發現以 1 結束**(整合檔指向不存在的路徑,以及已安裝、卻沒有任何雜湊涵蓋的斜線指令),所以採用者升級後 CI 可能變紅;下方第一項說明誰受影響、怎麼清掉。這個測試版另有:`uds update` 與 `uds update --apply` 現在會替換沒人改過的舊 hook 腳本(先備份)、`uds init` 與 `uds update` 不再丟失或重複印出錯誤輸出、`open-work-tracking` 改成選用技能 `open-work`、已安裝的技能與斜線指令不再帶著打不開的連結,以及 `check-anti-fake-tests` 與 `check-stubs` 在沒看完整個專案時會明說「INCOMPLETE」。
@@ -15,7 +15,7 @@ status: current
15
15
 
16
16
  > **語言**: [English](../../README.md) | 繁體中文 | [简体中文](../zh-CN/README.md)
17
17
 
18
- **版本**: 6.15.0-beta.1 (Pre-release) | **發布日期**: 2026-11-04 | **授權**: [雙重授權](../../LICENSE) (CC BY 4.0 + MIT)
18
+ **版本**: 6.15.0-beta.2 (Pre-release) | **發布日期**: 2026-11-04 | **授權**: [雙重授權](../../LICENSE) (CC BY 4.0 + MIT)
19
19
 
20
20
  語言無關、框架無關的軟體專案文件標準。透過 AI 原生工作流,確保不同技術堆疊之間的一致性、品質和可維護性。
21
21
 
@@ -14,7 +14,7 @@ status: current
14
14
  <!-- UDS_SUPPORTED_VERSIONS_START -->
15
15
  | 版本 | 支援狀態 |
16
16
  |------|--------|
17
- | 6.15.0-beta.1 | ✅ 預發布版本 |
17
+ | 6.15.0-beta.2 | ✅ 預發布版本 |
18
18
  | 6.14.1 | ✅ 最新正式版 |
19
19
  | < 6.0.0 | ❌ 已終止支援 |
20
20
  <!-- UDS_SUPPORTED_VERSIONS_END -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "universal-dev-standards",
3
- "version": "6.15.0-beta.1",
3
+ "version": "6.15.0-beta.2",
4
4
  "description": "CLI tool for adopting Universal Development Standards",
5
5
  "keywords": [
6
6
  "documentation",
@@ -238,11 +238,16 @@ function scanIntegrations(state, projectPath) {
238
238
  // dedicated block-integrity pass is what surfaces the ambiguity to the
239
239
  // user explicitly, with line numbers; this scan just records "unknown".
240
240
  let blockHash;
241
+ let markerError = null;
241
242
  try {
242
243
  blockHash = computeIntegrationBlockHash(filePath);
243
244
  } catch (error) {
244
245
  if (error instanceof AmbiguousMarkerError) {
245
246
  blockHash = null;
247
+ // Issue #297: remember *why* there is no block hash. Without this the
248
+ // diff engine read "no hash" as "no markers" and planned an append,
249
+ // which turned one damaged block into two.
250
+ markerError = error.message;
246
251
  } else {
247
252
  throw error;
248
253
  }
@@ -258,7 +263,8 @@ function scanIntegrations(state, projectPath) {
258
263
  metadata: {
259
264
  toolName,
260
265
  format: toolConfig.format,
261
- hasMarkers: !!blockHash,
266
+ hasMarkers: !!blockHash || markerError !== null,
267
+ markerError,
262
268
  fullHash: fileHash?.hash || null,
263
269
  fullSize: fileHash?.size || null,
264
270
  blockHash: blockHash || null
@@ -258,7 +258,25 @@ function diffIntegrations(desiredMap, actualMap, actions, warnings, summary, for
258
258
  summary.create++;
259
259
  } else if (actualEntry.metadata?.hasMarkers) {
260
260
  // File exists with UDS markers → migrate_block (update just the block)
261
- if (force) {
261
+ if (actualEntry.metadata?.markerError) {
262
+ // Issue #297: the markers are present but damaged (unclosed, reversed
263
+ // or duplicated). Plan the block update so the plan names the file,
264
+ // but say why it will not be written — the write path refuses on the
265
+ // same AmbiguousMarkerError before touching the file.
266
+ actions.push({
267
+ type: 'migrate_block',
268
+ category: 'integration',
269
+ path: desiredEntry.relativePath,
270
+ reason: `UDS markers damaged, will not be written: ${actualEntry.metadata.markerError}`,
271
+ details: {
272
+ toolName: desiredEntry.metadata.toolName,
273
+ format: desiredEntry.metadata.format,
274
+ markerError: actualEntry.metadata.markerError,
275
+ metadata: desiredEntry.metadata
276
+ }
277
+ });
278
+ summary.migrate_block++;
279
+ } else if (force) {
262
280
  actions.push({
263
281
  type: 'migrate_block',
264
282
  category: 'integration',
@@ -84,16 +84,57 @@ export class AmbiguousMarkerError extends Error {
84
84
  }
85
85
  }
86
86
 
87
+ /**
88
+ * Thrown when a file has a START marker with no END after it (or an END with
89
+ * no START before it). Issue #297: `locateMarkerBlock` used to return `null`
90
+ * here — "this file has no UDS block" — so `uds update` appended a complete
91
+ * second block and every later run failed on the duplicate START. A
92
+ * half-present pair is a damaged block, not a missing one.
93
+ *
94
+ * It extends AmbiguousMarkerError on purpose: every caller that already
95
+ * refuses to write on an ambiguous pair (update's plan and apply paths,
96
+ * `uds check`, the state scanner) refuses here too, before writing anything.
97
+ */
98
+ export class UnclosedMarkerError extends AmbiguousMarkerError {
99
+ /**
100
+ * @param {{start: string, end: string}} markers
101
+ * @param {{line: number}[]} starts
102
+ * @param {{line: number}[]} ends
103
+ */
104
+ constructor(markers, starts, ends) {
105
+ const present = starts.length > 0 ? starts : ends;
106
+ super(starts.length > 0 ? markers.start : markers.end, present.map((m) => m.line));
107
+ if (starts.length > 0 && ends.length > 0) {
108
+ this.message =
109
+ `Marker "${markers.end}" on line ${ends[0].line} comes before "${markers.start}" ` +
110
+ `on line ${starts[0].line} — the UDS block is damaged. Refusing to write; ` +
111
+ 'put the END line after the START line (or delete both) and run again.';
112
+ } else if (starts.length > 0) {
113
+ this.message =
114
+ `Marker "${markers.start}" on line ${starts[0].line} has no matching "${markers.end}" — ` +
115
+ 'the UDS block is not closed. Refusing to write; add the END line where the block ' +
116
+ 'should stop (or delete the START line) and run again.';
117
+ } else {
118
+ this.message =
119
+ `Marker "${markers.end}" on line ${ends[0].line} has no matching "${markers.start}" before it — ` +
120
+ 'the UDS block is damaged. Refusing to write; add the START line or delete the END line and run again.';
121
+ }
122
+ this.name = 'UnclosedMarkerError';
123
+ }
124
+ }
125
+
87
126
  /**
88
127
  * Locate the single UDS marker block in `content`.
89
128
  *
90
129
  * @param {string} content
91
130
  * @param {{start: string, end: string}} markers
92
131
  * @returns {{startIdx: number, endIdx: number, startLine: number, endLine: number} | null}
93
- * `null` means "this file has no UDS block" — the same meaning the old
94
- * `startIdx === -1` check carried. This is not an error.
132
+ * `null` means "this file has no UDS block" — neither marker is present.
133
+ * This is not an error.
95
134
  * @throws {AmbiguousMarkerError} when more than one valid START or END line
96
135
  * exists — the file has two or more marker pairs, or a corrupted one.
136
+ * @throws {UnclosedMarkerError} (a subclass) when only one of the two markers
137
+ * is present, or END comes before START (issue #297).
97
138
  */
98
139
  export function locateMarkerBlock(content, markers) {
99
140
  const starts = findMarkerLines(content, markers.start);
@@ -105,14 +146,17 @@ export function locateMarkerBlock(content, markers) {
105
146
  if (ends.length > 1) {
106
147
  throw new AmbiguousMarkerError(markers.end, ends.map((e) => e.line));
107
148
  }
108
- if (starts.length === 0 || ends.length === 0) {
149
+ if (starts.length === 0 && ends.length === 0) {
109
150
  return null;
110
151
  }
152
+ if (starts.length === 0 || ends.length === 0) {
153
+ throw new UnclosedMarkerError(markers, starts, ends);
154
+ }
111
155
 
112
156
  const startIdx = starts[0].offset;
113
157
  const endIdx = ends[0].offset;
114
158
  if (endIdx <= startIdx) {
115
- return null;
159
+ throw new UnclosedMarkerError(markers, starts, ends);
116
160
  }
117
161
 
118
162
  return { startIdx, endIdx, startLine: starts[0].line, endLine: ends[0].line };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "version": "6.15.0-beta.1",
3
+ "version": "6.15.0-beta.2",
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.15.0-beta.1"
61
+ "version": "6.15.0-beta.2"
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.15.0-beta.1",
68
+ "version": "6.15.0-beta.2",
69
69
  "note": "Skills are now included in the main repository under skills/"
70
70
  }
71
71
  },
@@ -2327,7 +2327,7 @@
2327
2327
  "id": "license-compliance",
2328
2328
  "name": "License Compliance Standards",
2329
2329
  "nameZh": "授權合規標準",
2330
- "version": "6.15.0-beta.1",
2330
+ "version": "6.15.0-beta.2",
2331
2331
  "source": {
2332
2332
  "human": "core/license-compliance.md",
2333
2333
  "ai": "ai/standards/license-compliance.ai.yaml"
@@ -2339,7 +2339,7 @@
2339
2339
  "id": "verification-oracle",
2340
2340
  "name": "Verification Oracle Standards",
2341
2341
  "nameZh": "驗證 Oracle 標準",
2342
- "version": "6.15.0-beta.1",
2342
+ "version": "6.15.0-beta.2",
2343
2343
  "source": {
2344
2344
  "human": "core/verification-oracle.md",
2345
2345
  "ai": "ai/standards/verification-oracle.ai.yaml"
@@ -2351,7 +2351,7 @@
2351
2351
  "id": "model-provenance",
2352
2352
  "name": "Model Provenance Policy Standards",
2353
2353
  "nameZh": "模型來源政策標準",
2354
- "version": "6.15.0-beta.1",
2354
+ "version": "6.15.0-beta.2",
2355
2355
  "source": {
2356
2356
  "human": "core/model-provenance.md",
2357
2357
  "ai": "ai/standards/model-provenance.ai.yaml"
@@ -2363,7 +2363,7 @@
2363
2363
  "id": "resource-cost-boundary",
2364
2364
  "name": "Resource / Cost Boundary Declaration Standards",
2365
2365
  "nameZh": "資源/成本邊界宣告標準",
2366
- "version": "6.15.0-beta.1",
2366
+ "version": "6.15.0-beta.2",
2367
2367
  "source": {
2368
2368
  "human": "core/resource-cost-boundary.md",
2369
2369
  "ai": "ai/standards/resource-cost-boundary.ai.yaml"