universal-dev-standards 6.14.0-beta.4 → 6.14.0-beta.5

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 (41) hide show
  1. package/bin/uds.js +7 -1
  2. package/bundled/ai/standards/full-coverage-testing.ai.yaml +46 -5
  3. package/bundled/core/full-coverage-testing.md +57 -3
  4. package/bundled/locales/zh-CN/CHANGELOG.md +29 -2
  5. package/bundled/locales/zh-CN/README.md +1 -1
  6. package/bundled/locales/zh-CN/SECURITY.md +1 -1
  7. package/bundled/locales/zh-CN/core/full-coverage-testing.md +61 -7
  8. package/bundled/locales/zh-CN/docs/CHEATSHEET.md +3 -1
  9. package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +8 -5
  10. package/bundled/locales/zh-TW/CHANGELOG.md +29 -2
  11. package/bundled/locales/zh-TW/README.md +1 -1
  12. package/bundled/locales/zh-TW/SECURITY.md +1 -1
  13. package/bundled/locales/zh-TW/core/full-coverage-testing.md +61 -7
  14. package/bundled/locales/zh-TW/docs/CHEATSHEET.md +3 -1
  15. package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +8 -5
  16. package/bundled/templates/gates/check-anti-fake-tests.mjs +991 -0
  17. package/bundled/templates/gates/check-stubs.mjs +644 -0
  18. package/package.json +2 -2
  19. package/src/commands/audit.js +11 -0
  20. package/src/commands/check.js +124 -24
  21. package/src/commands/init.js +16 -0
  22. package/src/commands/update.js +180 -19
  23. package/src/core/install-records.js +2 -1
  24. package/src/i18n/messages.js +50 -9
  25. package/src/reconciler/backup-manager.js +418 -82
  26. package/src/reconciler/index.js +27 -5
  27. package/src/reconciler/install-roots.js +90 -0
  28. package/src/reconciler/plan-executor.js +23 -2
  29. package/src/uninstallers/hook-uninstaller.js +2 -1
  30. package/src/utils/command-hash-ownership.js +103 -0
  31. package/src/utils/copier.js +21 -1
  32. package/src/utils/gate-scripts.js +141 -0
  33. package/src/utils/health-scorer.js +10 -7
  34. package/src/utils/skill-hash-ownership.js +64 -0
  35. package/src/utils/skills-installer.js +12 -1
  36. package/src/utils/test-change-check.js +160 -0
  37. package/src/utils/test-policy.js +214 -0
  38. package/src/utils/update-summary.js +29 -0
  39. package/standards-registry.json +7 -7
  40. package/bundled/extensions/languages/php/fat-free-patterns.md +0 -915
  41. package/bundled/extensions/languages/php/php-style.md +0 -693
@@ -26,7 +26,7 @@
26
26
  * }
27
27
  *
28
28
  * `kind` selects what `hash` covers:
29
- * 'hook-script', 'git-hook' → whole file (line endings normalized)
29
+ * 'hook-script', 'gate-script', 'git-hook' → whole file (line endings normalized)
30
30
  * 'integration-file' → everything outside the UDS marker block
31
31
  *
32
32
  * @module core/install-records
@@ -41,6 +41,7 @@ export const RECORDS_KEY = 'installedArtifacts';
41
41
 
42
42
  export const RECORD_KINDS = Object.freeze({
43
43
  HOOK_SCRIPT: 'hook-script',
44
+ GATE_SCRIPT: 'gate-script',
44
45
  GIT_HOOK: 'git-hook',
45
46
  INTEGRATION_FILE: 'integration-file'
46
47
  });
@@ -781,9 +781,12 @@ export const messages = {
781
781
  // Diff display
782
782
  couldNotReadFile: 'Could not read current file.',
783
783
  couldNotDetermineSource2: 'Could not determine original source path.',
784
- fetchingOriginal: 'Fetching original from GitHub...',
785
- couldNotFetchOriginal: 'Could not fetch original content.',
786
- rateLimited: 'GitHub API rate limit exceeded. Please wait a few minutes and try again.',
784
+ // XSPEC-453 R1: the original is the copy inside the installed package; nothing is downloaded.
785
+ diffBaseline: 'Comparing against the original files in the installed UDS package (version {version}); no network is used. To see what UDS itself changed since, run `uds update --plan`.',
786
+ diffBaselineVersionDiffers: 'Note: these standards were installed from UDS {installed}, but the package now installed is {version}. A file UDS changed between the two shows up below as a difference even if you did not touch it; `uds update --plan` lists those.',
787
+ diffNone: 'No modified files, so there is nothing to diff.',
788
+ noOriginalInPackage: 'This version of the package has no original for {file} (expected {source} in UDS {version}), so it cannot be compared. Nothing was downloaded; reinstall or upgrade universal-dev-standards.',
789
+ couldNotReadOriginal: 'Could not read the packaged original of {file}.',
787
790
  diffOriginal: '--- Original',
788
791
  diffCurrent: '+++ Current',
789
792
  diffTruncated: '... (diff truncated, showing first 20 changes)',
@@ -862,6 +865,11 @@ export const messages = {
862
865
  // Final status
863
866
  projectCompliant: '✓ Project is compliant with standards',
864
867
  issuesDetected: '⚠ Some issues detected. Review above for details.',
868
+ skillsIntegrityFix: ' Skill files listed above are missing or were changed: run `uds update --apply --skills` to reinstall them.',
869
+ commandsIntegrityFix: ' Command files listed above are missing or were changed: run `uds update --apply --commands` to reinstall them.',
870
+ commandsStaleRecordsIgnored: ' {count} command record(s) ignored: they describe commands UDS does not ship.',
871
+ commandsElsewhereIgnored: ' {count} command record(s) ignored: those commands are installed at user level, shared by every project, so this project\'s check does not vouch for them.',
872
+ skillsStaleRecordsIgnored: ' {count} skill record(s) ignored: they describe files UDS did not install (e.g. your own skills, or folders an old UDS copied in and later removed).',
865
873
  // Installation prompts
866
874
  offerSkillsInstallation: 'Skills Installation',
867
875
  offerCommandsInstallation: 'Commands Installation',
@@ -920,6 +928,8 @@ export const messages = {
920
928
  userCommentsPrompt: 'Additional comments (optional):',
921
929
  reportTitle: 'UDS Audit Feedback',
922
930
  dryRunNotice: 'Dry run — no issue created',
931
+ offlineNoSubmit: 'Offline mode: the report is not submitted.',
932
+ offlineDryRunHint: ' Use --dry-run to preview it, or run again without --offline to submit.',
923
933
  ghNotFound: 'gh CLI not found, using browser deeplink',
924
934
  copiedToClipboard: 'Full report copied to clipboard',
925
935
  urlTruncated: 'Report too long for URL, summary used. Full report on clipboard.',
@@ -1059,6 +1069,8 @@ export const messages = {
1059
1069
  syncedIntegrations: 'Synced {count} integration files',
1060
1070
  prunedOrphanedBlockHashes: 'Pruned {count} orphaned integration hash(es): {files}',
1061
1071
  droppedRetiredHashes: 'Dropped {count} manifest record(s) for files UDS no longer ships and that are already gone:',
1072
+ droppedForeignSkillHashes: 'Dropped {count} skill record(s) that do not describe files UDS installed.',
1073
+ droppedForeignCommandHashes: 'Dropped {count} command record(s) for commands UDS does not ship.',
1062
1074
  // Success
1063
1075
  updateSuccess: '✓ Standards updated successfully!',
1064
1076
  versionUpdated: 'Version: {current} → {latest}',
@@ -1136,6 +1148,9 @@ export const messages = {
1136
1148
  skillsUpdatedWithErrors: 'Updated Skills with {errors} errors',
1137
1149
  updatingCommands: 'Updating Commands...',
1138
1150
  commandsUpdated: 'Updated Commands for {count} AI tools',
1151
+ // XSPEC-454 R4: the number of tools and the number of commands are different numbers and need different slots.
1152
+ // `commandsUpdated` above counts TOOLS; feeding it the command count printed "51 AI tools" for one tool.
1153
+ commandsUpdatedCounts: 'Updated {commands} commands for {tools} AI tool(s): {locations}',
1139
1154
  commandsUpdatedWithErrors: 'Updated Commands with {errors} errors',
1140
1155
  // New standards detection
1141
1156
  newStandardsFound: '{count} new standard(s) available for your level:',
@@ -2053,9 +2068,12 @@ export const messages = {
2053
2068
  // Diff display
2054
2069
  couldNotReadFile: '無法讀取目前檔案。',
2055
2070
  couldNotDetermineSource2: '無法判斷原始來源路徑。',
2056
- fetchingOriginal: '從 GitHub 取得原始檔案...',
2057
- couldNotFetchOriginal: '無法取得原始內容。',
2058
- rateLimited: 'GitHub API 請求頻率超過限制,請稍候幾分鐘後再試。',
2071
+ // XSPEC-453 R1:原稿取自所裝套件內的檔,不下載。
2072
+ diffBaseline: '比對基準:已安裝的 UDS 套件內的原始檔(版本 {version}),不連網。要看 UDS 之後改了什麼,請執行 `uds update --plan`。',
2073
+ diffBaselineVersionDiffers: '注意:這些標準是從 UDS {installed} 安裝的,但目前安裝的套件是 {version}。兩版之間 UDS 自己改過的檔,即使你沒動,也會在下方列成差異;`uds update --plan` 可列出這些。',
2074
+ diffNone: '沒有被修改的檔案,因此沒有差異可顯示。',
2075
+ noOriginalInPackage: '此版本的套件沒有 {file} 的原稿(預期是 UDS {version} 內的 {source}),因此無法比對。未下載任何東西;請重新安裝或升級 universal-dev-standards。',
2076
+ couldNotReadOriginal: '無法讀取 {file} 的套件內原稿。',
2059
2077
  diffOriginal: '--- 原始',
2060
2078
  diffCurrent: '+++ 目前',
2061
2079
  diffTruncated: '...(差異已截斷,僅顯示前 20 個變更)',
@@ -2134,6 +2152,11 @@ export const messages = {
2134
2152
  // Final status
2135
2153
  projectCompliant: '✓ 專案符合標準',
2136
2154
  issuesDetected: '⚠ 偵測到一些問題。請檢視上方詳情。',
2155
+ skillsIntegrityFix: ' 上方列出的技能檔遺失或被改過:執行 `uds update --apply --skills` 重新安裝。',
2156
+ commandsIntegrityFix: ' 上方列出的斜線命令檔遺失或被改過:執行 `uds update --apply --commands` 重新安裝。',
2157
+ commandsStaleRecordsIgnored: ' 已忽略 {count} 筆命令紀錄:它們描述的是 UDS 不出貨的命令。',
2158
+ commandsElsewhereIgnored: ' 已忽略 {count} 筆命令紀錄:這些命令裝在使用者層級(所有專案共用),本專案的檢查不為它們背書。',
2159
+ skillsStaleRecordsIgnored: ' 已忽略 {count} 筆技能紀錄:它們描述的不是 UDS 安裝的檔案(例如你自己的技能,或舊版 UDS 誤拷入、後來已移除的資料夾)。',
2137
2160
  // Installation prompts
2138
2161
  offerSkillsInstallation: 'Skills 安裝',
2139
2162
  offerCommandsInstallation: '斜線命令安裝',
@@ -2190,6 +2213,8 @@ export const messages = {
2190
2213
  userCommentsPrompt: '補充說明(選填):',
2191
2214
  reportTitle: 'UDS 審計回饋',
2192
2215
  dryRunNotice: '預覽模式 — 未建立 issue',
2216
+ offlineNoSubmit: '離線模式:不提交回報。',
2217
+ offlineDryRunHint: ' 要預覽內容請加 --dry-run;要提交請拿掉 --offline 再執行。',
2193
2218
  ghNotFound: '未找到 gh CLI,使用瀏覽器連結',
2194
2219
  copiedToClipboard: '完整報告已複製至剪貼簿',
2195
2220
  urlTruncated: '報告過長無法放入 URL,已使用摘要。完整報告已複製至剪貼簿。',
@@ -2326,6 +2351,8 @@ export const messages = {
2326
2351
  syncedIntegrations: '已同步 {count} 個整合檔案',
2327
2352
  prunedOrphanedBlockHashes: '已清除 {count} 個孤兒整合雜湊:{files}',
2328
2353
  droppedRetiredHashes: '已清掉 {count} 筆 manifest 紀錄——這些檔案 UDS 已不再出貨,而且本來就已經不在了:',
2354
+ droppedForeignSkillHashes: '已清掉 {count} 筆技能紀錄——它們描述的不是 UDS 安裝的檔案。',
2355
+ droppedForeignCommandHashes: '已清掉 {count} 筆命令紀錄——UDS 不出貨這些命令。',
2329
2356
  // Success
2330
2357
  updateSuccess: '✓ 標準更新成功!',
2331
2358
  versionUpdated: '版本:{current} → {latest}',
@@ -2403,6 +2430,7 @@ export const messages = {
2403
2430
  skillsUpdatedWithErrors: '更新 Skills 時發生 {errors} 個錯誤',
2404
2431
  updatingCommands: '更新斜線命令中...',
2405
2432
  commandsUpdated: '已為 {count} 個 AI 工具更新斜線命令',
2433
+ commandsUpdatedCounts: '已為 {tools} 個 AI 工具更新 {commands} 個斜線命令:{locations}',
2406
2434
  commandsUpdatedWithErrors: '更新斜線命令時發生 {errors} 個錯誤',
2407
2435
  // New standards detection
2408
2436
  newStandardsFound: '有 {count} 個新標準可供您的等級使用:',
@@ -3336,9 +3364,12 @@ export const messages = {
3336
3364
  // Diff display
3337
3365
  couldNotReadFile: '无法读取当前文件。',
3338
3366
  couldNotDetermineSource2: '无法确定原始源路径。',
3339
- fetchingOriginal: '从 GitHub 获取原始文件...',
3340
- couldNotFetchOriginal: '无法获取原始内容。',
3341
- rateLimited: 'GitHub API 请求频率超过限制,请稍候几分钟后再试。',
3367
+ // XSPEC-453 R1:原稿取自所装包内的文件,不下载。
3368
+ diffBaseline: '比对基准:已安装的 UDS 包内的原始文件(版本 {version}),不联网。要查看 UDS 之后改了什么,请执行 `uds update --plan`。',
3369
+ diffBaselineVersionDiffers: '注意:这些标准是从 UDS {installed} 安装的,但当前安装的包是 {version}。两个版本之间 UDS 自己改过的文件,即使你没动,也会在下方列为差异;`uds update --plan` 可列出这些。',
3370
+ diffNone: '没有被修改的文件,因此没有差异可显示。',
3371
+ noOriginalInPackage: '此版本的包没有 {file} 的原稿(预期是 UDS {version} 内的 {source}),因此无法比对。未下载任何内容;请重新安装或升级 universal-dev-standards。',
3372
+ couldNotReadOriginal: '无法读取 {file} 的包内原稿。',
3342
3373
  diffOriginal: '--- 原始',
3343
3374
  diffCurrent: '+++ 当前',
3344
3375
  diffTruncated: '...(差异已截断,显示前 20 处更改)',
@@ -3417,6 +3448,11 @@ export const messages = {
3417
3448
  // Final status
3418
3449
  projectCompliant: '✓ 项目符合标准',
3419
3450
  issuesDetected: '⚠ 检测到一些问题。详情请查看上文。',
3451
+ skillsIntegrityFix: ' 上方列出的技能文件缺失或被改过:运行 `uds update --apply --skills` 重新安装。',
3452
+ commandsIntegrityFix: ' 上方列出的斜杠命令文件缺失或被改过:运行 `uds update --apply --commands` 重新安装。',
3453
+ commandsStaleRecordsIgnored: ' 已忽略 {count} 条命令记录:它们描述的是 UDS 不发布的命令。',
3454
+ commandsElsewhereIgnored: ' 已忽略 {count} 条命令记录:这些命令装在用户级(所有项目共用),本项目的检查不为它们背书。',
3455
+ skillsStaleRecordsIgnored: ' 已忽略 {count} 条技能记录:它们描述的不是 UDS 安装的文件(例如你自己的技能,或旧版 UDS 误拷入、后来已移除的文件夹)。',
3420
3456
  // Installation prompts
3421
3457
  offerSkillsInstallation: 'Skills 安装',
3422
3458
  offerCommandsInstallation: '斜线命令安装',
@@ -3469,6 +3505,8 @@ export const messages = {
3469
3505
  userCommentsPrompt: '补充说明(选填):',
3470
3506
  reportTitle: 'UDS 审计反馈',
3471
3507
  dryRunNotice: '预览模式 — 未创建 issue',
3508
+ offlineNoSubmit: '离线模式:不提交回报。',
3509
+ offlineDryRunHint: ' 要预览内容请加 --dry-run;要提交请去掉 --offline 再运行。',
3472
3510
  ghNotFound: '未找到 gh CLI,使用浏览器链接',
3473
3511
  copiedToClipboard: '完整报告已复制到剪贴板',
3474
3512
  urlTruncated: '报告过长无法放入 URL,已使用摘要。完整报告已复制到剪贴板。',
@@ -3517,6 +3555,8 @@ export const messages = {
3517
3555
  syncedIntegrations: '已同步 {count} 个集成文件',
3518
3556
  prunedOrphanedBlockHashes: '已清除 {count} 个孤儿集成哈希:{files}',
3519
3557
  droppedRetiredHashes: '已清掉 {count} 笔 manifest 记录——这些文件 UDS 已不再发布,而且本来就已经不在了:',
3558
+ droppedForeignSkillHashes: '已清掉 {count} 条技能记录——它们描述的不是 UDS 安装的文件。',
3559
+ droppedForeignCommandHashes: '已清掉 {count} 条命令记录——UDS 不发布这些命令。',
3520
3560
  // Success
3521
3561
  updateSuccess: '✓ 标准更新成功!',
3522
3562
  versionUpdated: '版本:{current} → {latest}',
@@ -3594,6 +3634,7 @@ export const messages = {
3594
3634
  skillsUpdatedWithErrors: '更新 Skills 时发生 {errors} 个错误',
3595
3635
  updatingCommands: '正在更新斜线命令...',
3596
3636
  commandsUpdated: '已为 {count} 个 AI 工具更新斜线命令',
3637
+ commandsUpdatedCounts: '已为 {tools} 个 AI 工具更新 {commands} 个斜线命令:{locations}',
3597
3638
  commandsUpdatedWithErrors: '更新斜线命令时发生 {errors} 个错误',
3598
3639
  // New standards detection
3599
3640
  newStandardsFound: '有 {count} 个新标准可用于您的级别:',