@sebastienrousseau/dotfiles 0.2.520 → 0.2.522

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 (323) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/LICENSE-APACHE +190 -0
  3. package/LICENSE-MIT +21 -0
  4. package/README.md +43 -37
  5. package/install.sh +76 -10
  6. package/package.json +7 -7
  7. package/tools/README.md +49 -0
  8. package/tools/ci/install-chezmoi-verified.sh +68 -0
  9. package/docs/.vitepress/reports/localization-readability-audit.md +0 -73
  10. package/docs/AI.md +0 -179
  11. package/docs/ARCHITECTURE.md +0 -117
  12. package/docs/CNAME +0 -1
  13. package/docs/CONFIG_STRATEGY.md +0 -124
  14. package/docs/COPYRIGHT +0 -7
  15. package/docs/ECOSYSTEM.md +0 -220
  16. package/docs/GOLD-STANDARD-AUDIT.md +0 -352
  17. package/docs/GOVERNANCE.md +0 -98
  18. package/docs/MAINTAINERS.md +0 -41
  19. package/docs/MINIMUM-TOOLCHAIN.md +0 -100
  20. package/docs/NAMING_CONVENTIONS.md +0 -102
  21. package/docs/OPENCODE.md +0 -127
  22. package/docs/README.md +0 -84
  23. package/docs/STRUCTURE.md +0 -102
  24. package/docs/adr/ADR-001-ci-cd-pipeline.md +0 -118
  25. package/docs/adr/ADR-002-shell-performance.md +0 -130
  26. package/docs/adr/ADR-003-security-first.md +0 -158
  27. package/docs/adr/ADR-004-cli-architecture.md +0 -171
  28. package/docs/adr/ADR-005-chezmoi-choice.md +0 -99
  29. package/docs/adr/ADR-006-shell-selection.md +0 -124
  30. package/docs/adr/ADR-007-multi-shell-parity.md +0 -62
  31. package/docs/adr/ADR-008-alias-system-architecture.md +0 -95
  32. package/docs/adr/ADR-009-wallpaper-driven-theming.md +0 -131
  33. package/docs/adr/ADR-010-starship-transient-prompt.md +0 -144
  34. package/docs/adr/ADR-011-nushell-tier3-keep.md +0 -144
  35. package/docs/adr/ADR-012-ai-fleet-local-proxy.md +0 -79
  36. package/docs/adr/README.md +0 -40
  37. package/docs/architecture/AI_COST_OPTIMIZATION.md +0 -144
  38. package/docs/architecture/ARCHITECTURE.md +0 -20
  39. package/docs/architecture/INTEROP.md +0 -44
  40. package/docs/architecture/REPO_LAYOUT.md +0 -241
  41. package/docs/architecture/WALKTHROUGH.md +0 -86
  42. package/docs/architecture/fleet-deployment.md +0 -77
  43. package/docs/archive/EUXIS_2026_REVIEW.md +0 -127
  44. package/docs/archive/LEGACY_ROADMAP.md +0 -6
  45. package/docs/archive/MILESTONE_v0.2.493.md +0 -47
  46. package/docs/archive/PLAN.md +0 -199
  47. package/docs/archive/REPO_AUDIT.md +0 -31
  48. package/docs/articles/.pages +0 -6
  49. package/docs/articles/2026-07-05-custom-mkdocs-material-dark-theme.md +0 -216
  50. package/docs/articles/2026-07-05-fish-startup-abbr.md +0 -153
  51. package/docs/articles/2026-07-05-master-to-main-rename-runbook.md +0 -128
  52. package/docs/articles/index.md +0 -36
  53. package/docs/guides/INSTALL.md +0 -144
  54. package/docs/guides/MACOS_ICLOUD_SYMLINKS.md +0 -121
  55. package/docs/guides/NEOVIM_IDE_GUIDE.md +0 -61
  56. package/docs/guides/THEMING.md +0 -230
  57. package/docs/guides/TROUBLESHOOTING.md +0 -176
  58. package/docs/guides/WSL2_NIX_TROUBLESHOOTING.md +0 -792
  59. package/docs/index.md +0 -132
  60. package/docs/interop/A2A.md +0 -39
  61. package/docs/interop/POWERSHELL.md +0 -102
  62. package/docs/manual/00-introduction.md +0 -89
  63. package/docs/manual/01-concepts/01-architecture.md +0 -138
  64. package/docs/manual/01-concepts/02-trust-model.md +0 -183
  65. package/docs/manual/01-concepts/03-theme-engine.md +0 -186
  66. package/docs/manual/01-concepts/04-fleet.md +0 -148
  67. package/docs/manual/01-concepts/05-self-healing.md +0 -204
  68. package/docs/manual/02-tutorials/01-first-install.md +0 -197
  69. package/docs/manual/02-tutorials/02-add-wallpaper.md +0 -216
  70. package/docs/manual/02-tutorials/03-create-profile.md +0 -244
  71. package/docs/manual/02-tutorials/04-encrypt-secret.md +0 -281
  72. package/docs/manual/02-tutorials/05-deploy-fleet.md +0 -283
  73. package/docs/manual/03-reference/01-dot-cli.md +0 -475
  74. package/docs/manual/03-reference/02-config-files.md +0 -265
  75. package/docs/manual/03-reference/03-environment.md +0 -124
  76. package/docs/manual/03-reference/04-templates.md +0 -190
  77. package/docs/manual/03-reference/05-feature-flags.md +0 -187
  78. package/docs/manual/04-cookbook/01-recipes.md +0 -285
  79. package/docs/manual/04-cookbook/02-troubleshooting.md +0 -351
  80. package/docs/manual/04-cookbook/03-faq.md +0 -175
  81. package/docs/manual/05-appendices/A-platform-matrix.md +0 -101
  82. package/docs/manual/05-appendices/B-security-checklist.md +0 -85
  83. package/docs/manual/05-appendices/C-glossary.md +0 -40
  84. package/docs/manual/05-appendices/D-bibliography.md +0 -58
  85. package/docs/manual/05-appendices/E-license.md +0 -38
  86. package/docs/manual/_toc.yml +0 -58
  87. package/docs/manual/command-index.md +0 -175
  88. package/docs/manual/concept-index.md +0 -170
  89. package/docs/manual/index.md +0 -66
  90. package/docs/migration/README.md +0 -81
  91. package/docs/migration/from-bare-git-repo.md +0 -156
  92. package/docs/migration/from-gnu-stow.md +0 -165
  93. package/docs/migration/from-plain-chezmoi.md +0 -148
  94. package/docs/migration/from-yadm.md +0 -187
  95. package/docs/operations/ARCHITECTURE_ROADMAP.md +0 -7
  96. package/docs/operations/ATTESTATION.md +0 -44
  97. package/docs/operations/CI_CADENCE.md +0 -107
  98. package/docs/operations/CI_COMPOSITES.md +0 -156
  99. package/docs/operations/COMPLETIONS.md +0 -123
  100. package/docs/operations/COVERAGE.md +0 -204
  101. package/docs/operations/DRIFT.md +0 -107
  102. package/docs/operations/HARD_AUDIT_2026.md +0 -631
  103. package/docs/operations/MAINTENANCE.md +0 -63
  104. package/docs/operations/MANIFEST.md +0 -127
  105. package/docs/operations/MIGRATION.md +0 -109
  106. package/docs/operations/OPERATIONS.md +0 -188
  107. package/docs/operations/PERFORMANCE.md +0 -133
  108. package/docs/operations/PERFORMANCE_BUDGETS.md +0 -196
  109. package/docs/operations/REGISTRY.md +0 -90
  110. package/docs/operations/RELEASE_PIPELINE.md +0 -128
  111. package/docs/operations/RELIABILITY.md +0 -122
  112. package/docs/operations/RFC_v0_2_503_reorganization.md +0 -280
  113. package/docs/operations/ROADMAP.md +0 -10
  114. package/docs/operations/ROADMAP_2026.md +0 -7
  115. package/docs/operations/ROADMAP_V0_2_503.md +0 -10
  116. package/docs/operations/TESTING.md +0 -216
  117. package/docs/operations/TRACEABILITY.md +0 -44
  118. package/docs/operations/TRUSTED_AGENT_WORKSTATION.md +0 -65
  119. package/docs/operations/VERSION_SYNC.md +0 -393
  120. package/docs/packaging.md +0 -222
  121. package/docs/reference/ALIASES.md +0 -131
  122. package/docs/reference/ALIASES_CHEATSHEET.md +0 -32
  123. package/docs/reference/ALIASES_DEPRECATIONS.md +0 -13
  124. package/docs/reference/FEATURE-MATRIX.md +0 -646
  125. package/docs/reference/FEATURES.md +0 -66
  126. package/docs/reference/FONTS.md +0 -112
  127. package/docs/reference/POWERSHELL_PARITY.md +0 -82
  128. package/docs/reference/PROFILES.md +0 -69
  129. package/docs/reference/SCREENSHOTS.md +0 -121
  130. package/docs/reference/SCRIPTS.md +0 -71
  131. package/docs/reference/SUPPORT_MATRIX.md +0 -80
  132. package/docs/reference/THEMES.md +0 -117
  133. package/docs/reference/TOOLS.md +0 -110
  134. package/docs/reference/UTILS.md +0 -243
  135. package/docs/registry.json +0 -6
  136. package/docs/schema/dot-env-v1.json +0 -110
  137. package/docs/schema/dot-registry-v1.json +0 -33
  138. package/docs/security/AI_ACT_COMPLIANCE.md +0 -94
  139. package/docs/security/AUDIT_BYPASS.md +0 -103
  140. package/docs/security/AUTOMATION_SECRETS.md +0 -26
  141. package/docs/security/CI_EGRESS_ALLOWLIST.md +0 -127
  142. package/docs/security/CI_PINNING.md +0 -129
  143. package/docs/security/COMMIT_SIGNING.md +0 -138
  144. package/docs/security/COMPLIANCE.md +0 -458
  145. package/docs/security/DEPS_DEV_EXCEPTIONS.md +0 -86
  146. package/docs/security/DISCLOSURE.md +0 -130
  147. package/docs/security/ENCRYPTION.md +0 -57
  148. package/docs/security/FMEA.md +0 -159
  149. package/docs/security/FUZZING.md +0 -209
  150. package/docs/security/HISTORY_FILTERING.md +0 -132
  151. package/docs/security/INCIDENT_RESPONSE.md +0 -579
  152. package/docs/security/INSTALL_VERIFICATION.md +0 -122
  153. package/docs/security/KEYS.md +0 -49
  154. package/docs/security/KEY_ROTATION.md +0 -303
  155. package/docs/security/MCP_POLICY.md +0 -78
  156. package/docs/security/POLICY_RELEASES.md +0 -37
  157. package/docs/security/README.md +0 -28
  158. package/docs/security/SCORECARD.md +0 -195
  159. package/docs/security/SECRETS.md +0 -158
  160. package/docs/security/SECURITY.md +0 -45
  161. package/docs/security/SECURITY_CHECKLIST.md +0 -55
  162. package/docs/security/SHELL_EXEMPTIONS.md +0 -145
  163. package/docs/security/SOUP_REGISTER.md +0 -36
  164. package/docs/security/THREAT_MODEL.md +0 -130
  165. package/docs/security/VERIFICATION_VALIDATION.md +0 -228
  166. package/docs/security/VERIFY_RELEASE.md +0 -201
  167. package/docs/security/security-pubkey.asc +0 -15
  168. package/docs/stylesheets/extra.css +0 -444
  169. package/docs/themes/README.md +0 -10
  170. package/docs/themes/VISUAL_INTEGRITY_REPORT.md +0 -30
  171. package/docs/themes/hero-shot.svg +0 -78
  172. package/scripts/README.md +0 -123
  173. package/scripts/ci/check-copyright-headers.sh +0 -8
  174. package/scripts/ci/check-shell-preamble.sh +0 -8
  175. package/scripts/ci/guard-gitleaks-checkout.sh +0 -8
  176. package/scripts/demo/record.sh +0 -43
  177. package/scripts/diagnostics/a2a-conformance.sh +0 -163
  178. package/scripts/diagnostics/alias-governance.sh +0 -165
  179. package/scripts/diagnostics/aliases-cheatsheet.sh +0 -74
  180. package/scripts/diagnostics/aliases-manifest.sh +0 -77
  181. package/scripts/diagnostics/attest-verify.sh +0 -147
  182. package/scripts/diagnostics/benchmark.sh +0 -408
  183. package/scripts/diagnostics/conflicts.sh +0 -73
  184. package/scripts/diagnostics/doctor-unified.sh +0 -43
  185. package/scripts/diagnostics/doctor.sh +0 -797
  186. package/scripts/diagnostics/drift-dashboard.sh +0 -203
  187. package/scripts/diagnostics/health.sh +0 -656
  188. package/scripts/diagnostics/history-analysis.sh +0 -86
  189. package/scripts/diagnostics/mcp-doctor.sh +0 -582
  190. package/scripts/diagnostics/perf.sh +0 -453
  191. package/scripts/diagnostics/scorecard.sh +0 -120
  192. package/scripts/diagnostics/secret-governance.sh +0 -65
  193. package/scripts/diagnostics/security-score.sh +0 -467
  194. package/scripts/diagnostics/smoke-test.sh +0 -88
  195. package/scripts/diagnostics/snapshot.sh +0 -90
  196. package/scripts/diagnostics/verify.sh +0 -108
  197. package/scripts/diagnostics/verify_state.sh +0 -73
  198. package/scripts/diagnostics/version-locks.sh +0 -94
  199. package/scripts/diagnostics/workstation-attestation.sh +0 -212
  200. package/scripts/dot/commands/agent.sh +0 -535
  201. package/scripts/dot/commands/agents.sh +0 -352
  202. package/scripts/dot/commands/ai.sh +0 -600
  203. package/scripts/dot/commands/aliases.sh +0 -277
  204. package/scripts/dot/commands/appearance.sh +0 -110
  205. package/scripts/dot/commands/completion.sh +0 -171
  206. package/scripts/dot/commands/core.sh +0 -217
  207. package/scripts/dot/commands/diagnostics.sh +0 -265
  208. package/scripts/dot/commands/env-emit.sh +0 -203
  209. package/scripts/dot/commands/fleet.sh +0 -711
  210. package/scripts/dot/commands/init.sh +0 -185
  211. package/scripts/dot/commands/lint.sh +0 -208
  212. package/scripts/dot/commands/manual.sh +0 -169
  213. package/scripts/dot/commands/meta.sh +0 -438
  214. package/scripts/dot/commands/patterns.sh +0 -55
  215. package/scripts/dot/commands/registry.sh +0 -455
  216. package/scripts/dot/commands/restore.sh +0 -232
  217. package/scripts/dot/commands/secrets.sh +0 -296
  218. package/scripts/dot/commands/security.sh +0 -102
  219. package/scripts/dot/commands/tools.sh +0 -570
  220. package/scripts/dot/data/alias-deprecations.tsv +0 -2
  221. package/scripts/dot/powershell/Dot.psm1 +0 -319
  222. package/scripts/fonts/install-nerd-fonts.sh +0 -75
  223. package/scripts/fonts/patch-fonts.sh +0 -36
  224. package/scripts/git-hooks/install.sh +0 -12
  225. package/scripts/git-hooks/pre-commit +0 -12
  226. package/scripts/git-hooks/pre-commit-audit.sh +0 -146
  227. package/scripts/git-hooks/pre-push +0 -105
  228. package/scripts/git-hooks/prepare-commit-msg +0 -29
  229. package/scripts/lib/secrets_provider.sh +0 -200
  230. package/scripts/nvim/headless-upgrade.lua +0 -81
  231. package/scripts/ops/ai-setup.sh +0 -71
  232. package/scripts/ops/bundle.sh +0 -104
  233. package/scripts/ops/chaos.sh +0 -50
  234. package/scripts/ops/chezmoi-apply.sh +0 -333
  235. package/scripts/ops/chezmoi-diff.sh +0 -16
  236. package/scripts/ops/chezmoi-remove.sh +0 -46
  237. package/scripts/ops/chezmoi-update.sh +0 -67
  238. package/scripts/ops/heal-chezmoi.sh +0 -87
  239. package/scripts/ops/heal-system.sh +0 -129
  240. package/scripts/ops/heal-tools.sh +0 -297
  241. package/scripts/ops/heal.sh +0 -223
  242. package/scripts/ops/post-apply-repair.sh +0 -107
  243. package/scripts/ops/prewarm.sh +0 -128
  244. package/scripts/ops/release.sh +0 -262
  245. package/scripts/ops/rollback.sh +0 -613
  246. package/scripts/ops/setup.sh +0 -138
  247. package/scripts/ops/teleport.sh +0 -34
  248. package/scripts/qa/check-feature-matrix.sh +0 -296
  249. package/scripts/qa/check-version-consistency.sh +0 -12
  250. package/scripts/qa/coverage-baseline.sh +0 -61
  251. package/scripts/qa/docs-coverage.sh +0 -118
  252. package/scripts/qa/examples-coverage.sh +0 -94
  253. package/scripts/qa/powershell-contract.ps1 +0 -95
  254. package/scripts/qa/reliability-audit.sh +0 -139
  255. package/scripts/qa/scorecard-snapshot.sh +0 -128
  256. package/scripts/qa/traceability-coverage.sh +0 -124
  257. package/scripts/qa/validate-examples.sh +0 -90
  258. package/scripts/qa/wsl-contract.sh +0 -12
  259. package/scripts/secrets/age-init.sh +0 -82
  260. package/scripts/secrets/create-secrets-file.sh +0 -46
  261. package/scripts/secrets/encrypt-ssh-key.sh +0 -44
  262. package/scripts/security/backup.sh +0 -58
  263. package/scripts/security/check-disclosure-key-expiry.sh +0 -111
  264. package/scripts/security/dns-doh.sh +0 -52
  265. package/scripts/security/encryption-check.sh +0 -55
  266. package/scripts/security/enforce-policies.sh +0 -552
  267. package/scripts/security/firewall.sh +0 -91
  268. package/scripts/security/lock-configs.sh +0 -67
  269. package/scripts/security/lock-screen.sh +0 -56
  270. package/scripts/security/manage-secrets.sh +0 -429
  271. package/scripts/security/ssh-cert.sh +0 -204
  272. package/scripts/security/telemetry-kill.sh +0 -51
  273. package/scripts/security/usb-safety.sh +0 -52
  274. package/scripts/theme/apply-gnome-theme.sh +0 -333
  275. package/scripts/theme/extract-heic-frames.sh +0 -115
  276. package/scripts/theme/extract-theme.py +0 -1020
  277. package/scripts/theme/install-boot-logo.sh +0 -63
  278. package/scripts/theme/install-catppuccin-themes.sh +0 -371
  279. package/scripts/theme/install-cursors.sh +0 -26
  280. package/scripts/theme/install-file-icons.sh +0 -27
  281. package/scripts/theme/install-grub-theme.sh +0 -62
  282. package/scripts/theme/install-lock-icon.sh +0 -31
  283. package/scripts/theme/merge-wallpaper.sh +0 -146
  284. package/scripts/theme/rebuild-themes.sh +0 -603
  285. package/scripts/theme/switch.sh +0 -476
  286. package/scripts/theme/wallpaper-rotate.sh +0 -137
  287. package/scripts/theme/wallpaper-sync.sh +0 -690
  288. package/scripts/tools/cmatrix.sh +0 -22
  289. package/scripts/tools/detect-collisions.py +0 -103
  290. package/scripts/tools/emoji-picker.sh +0 -49
  291. package/scripts/tools/figlet-banner.sh +0 -19
  292. package/scripts/tools/log-rotate.sh +0 -31
  293. package/scripts/tools/lolcat-wrap.sh +0 -20
  294. package/scripts/tools/pipes.sh +0 -49
  295. package/scripts/tuning/linux.sh +0 -186
  296. package/scripts/tuning/macos.sh +0 -56
  297. package/scripts/uninstall.sh +0 -86
  298. package/scripts/verify-release-versions +0 -156
  299. package/scripts/version-sync.sh +0 -714
  300. package/templates/chezmoi-data/geekom-a9.toml.example +0 -21
  301. package/templates/chezmoi-data/mac-m1.toml.example +0 -16
  302. package/templates/chezmoi-data/mac-t2-linux.toml.example +0 -21
  303. package/templates/chezmoi-data/surface-pro-7p.toml.example +0 -21
  304. package/templates/projects/go/.github/workflows/ci.yml +0 -31
  305. package/templates/projects/go/README.md +0 -7
  306. package/templates/projects/go/cmd/__PROJECT_NAME__/main.go +0 -8
  307. package/templates/projects/go/go.mod +0 -3
  308. package/templates/projects/go/go.sum +0 -0
  309. package/templates/projects/molecule/README.md +0 -7
  310. package/templates/projects/molecule/converge.yml +0 -7
  311. package/templates/projects/molecule/molecule.yml +0 -16
  312. package/templates/projects/node/.github/workflows/ci.yml +0 -30
  313. package/templates/projects/node/README.md +0 -7
  314. package/templates/projects/node/package-lock.json +0 -12
  315. package/templates/projects/node/package.json +0 -10
  316. package/templates/projects/node/src/index.js +0 -3
  317. package/templates/projects/packer/README.md +0 -15
  318. package/templates/projects/packer/main.pkr.hcl +0 -15
  319. package/templates/projects/python/.github/workflows/ci.yml +0 -34
  320. package/templates/projects/python/README.md +0 -7
  321. package/templates/projects/python/pyproject.toml +0 -25
  322. package/templates/projects/python/src/__PROJECT_NAME__/__init__.py +0 -2
  323. package/templates/projects/python/tests/test_basic.py +0 -3
@@ -1,714 +0,0 @@
1
- #!/usr/bin/env bash
2
- # SPDX-License-Identifier: Apache-2.0 OR MIT
3
- # Copyright (c) 2015-2026 Sebastien Rousseau
4
- # Version Synchronization Script
5
- # Synchronizes version numbers across all markdown files with package.json
6
- # Used by CI/CD and available for local testing
7
-
8
- set -euo pipefail
9
-
10
- _cleanup_files=()
11
- trap 'set +u; rm -f "${_cleanup_files[@]}" 2>/dev/null; set -u' EXIT
12
-
13
- # Configuration
14
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
15
- PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
16
- VERSION_PATTERN='[0-9]+\.[0-9]+\.[0-9]+'
17
- SED_VERSION_PATTERN='[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*'
18
- BACKUP_DIR="$PROJECT_ROOT/.version-sync-backup"
19
- EXCLUDE_FILES=(
20
- # Historical / referential docs — version refs inside are intentional
21
- # pointers at prior versions, not "this is the current version" claims.
22
- "CHANGELOG.md"
23
- "docs/security/COMPLIANCE.md"
24
- "docs/reference/FONTS.md"
25
- "docs/archive/LEGACY_ROADMAP.md"
26
- "docs/archive/PLAN.md"
27
- "ROADMAP.md"
28
-
29
- # Roadmap + audit narratives — describe per-version work; refs to
30
- # prior versions are intentional and historical.
31
- "docs/operations/ROADMAP_V0_2_503.md"
32
- "docs/operations/VERSION_SYNC.md"
33
- "docs/operations/RFC_v0_2_503_reorganization.md"
34
- "docs/operations/HARD_AUDIT_2026.md"
35
- "docs/operations/COVERAGE.md"
36
- "docs/reference/ALIASES_DEPRECATIONS.md"
37
-
38
- # Security docs — INSTALL_VERIFICATION + CI_PINNING + SCORECARD
39
- # carry per-release hash tables / closed-cycle logs. The "current"
40
- # version inside these is tracked by hand, not by version-sync.
41
- "docs/security/CI_PINNING.md"
42
- # Same reason: supply-chain/README.md pins the SLSA generator at its
43
- # required tag (v2.1.0). That is a third-party version, not ours.
44
- "supply-chain/README.md"
45
- "docs/security/INSTALL_VERIFICATION.md"
46
- "docs/security/SCORECARD.md"
47
-
48
- # Release-verification recipes use an example pinned tag
49
- # that intentionally stays at a known-published release.
50
- "docs/security/VERIFY_RELEASE.md"
51
- # Same category: pkg/VERIFY.md's "coverage by release" table names
52
- # the release each attestation first appeared in, which is history.
53
- "pkg/VERIFY.md"
54
-
55
- # Example bundles — version refs in README'd examples are illustrative.
56
- "examples/mise-plugin-dot/README.md"
57
-
58
- # MANIFEST + MIGRATION docs — describe per-version manifests &
59
- # cross-version migration paths; intentional references to other tags.
60
- "docs/operations/MANIFEST.md"
61
- "docs/operations/MIGRATION.md"
62
-
63
- # ADR + architecture + manual + operations narratives — every
64
- # version reference inside is dated context, not a "current version"
65
- # claim. The single source-of-truth is .chezmoidata.toml (plus
66
- # README, package.json — which version-sync DOES rewrite).
67
- "docs/adr/ADR-007-multi-shell-parity.md"
68
- "docs/architecture/REPO_LAYOUT.md"
69
- "docs/manual/01-concepts/04-fleet.md"
70
- "docs/manual/01-concepts/05-self-healing.md"
71
- "docs/manual/02-tutorials/05-deploy-fleet.md"
72
- "docs/manual/05-appendices/D-bibliography.md"
73
- "docs/operations/MAINTENANCE.md"
74
-
75
- # Release-process / structural docs that reference *historical* dotfiles
76
- # versions (the repo reorg, past release tags, migration scenarios).
77
- # Bumping these each release would corrupt accurate history.
78
- "docs/operations/RELEASE_PIPELINE.md"
79
- "docs/operations/TESTING.md"
80
- "docs/STRUCTURE.md"
81
- "install/migrate/README.md"
82
- "install/README.md"
83
- "tools/README.md"
84
- "defaults/README.md"
85
-
86
- # CI_COMPOSITES.md cites third-party action versions (e.g. v5.0.5),
87
- # not dotfiles_version. False-positive pattern match.
88
- "docs/operations/CI_COMPOSITES.md"
89
-
90
- # Living roadmap: references branch names / target versions
91
- # (e.g. feature-branch names like feat/v0.2.X, phase milestones)
92
- # that are NOT the current dotfiles_version. Auto-syncing
93
- # rewrites them incorrectly.
94
- "docs/operations/ARCHITECTURE_ROADMAP.md"
95
-
96
- # Dated release write-ups: each article records the release it
97
- # shipped in (e.g. "shipped in vX.Y.Z" + a link to that release
98
- # tag). Those refs are historical fact, not current-version claims —
99
- # bumping them would falsify the history.
100
- "docs/articles/2026-07-05-fish-startup-abbr.md"
101
- "docs/articles/2026-07-05-master-to-main-rename-runbook.md"
102
- )
103
-
104
- # shellcheck source=../lib/dot/ui.sh
105
- # shellcheck disable=SC1091
106
- source "$SCRIPT_DIR/../lib/dot/ui.sh"
107
- ui_init
108
-
109
- # Functions — delegate to shared ui.sh (redirect to stderr for script output)
110
- log_info() { ui_info "$@" >&2; }
111
- log_success() { ui_ok "$@" >&2; }
112
- log_warning() { ui_warn "$@" >&2; }
113
- log_error() { ui_err "$@" >&2; }
114
-
115
- show_help() {
116
- cat <<EOF
117
- Version Synchronization Script
118
-
119
- USAGE:
120
- $0 [OPTIONS] [VERSION]
121
-
122
- OPTIONS:
123
- -h, --help Show this help message
124
- -d, --dry-run Show what would be changed without making changes
125
- -v, --verify Verify version consistency without updating
126
- -b, --backup Create backup before changes (default: true)
127
- --no-backup Skip creating backup
128
- -f, --force Force sync even if no changes detected
129
-
130
- ARGUMENTS:
131
- VERSION Target version to sync to (defaults to package.json version)
132
-
133
- EXAMPLES:
134
- $0 # Sync to current package.json version
135
- $0 1.2.3 # Sync all files to version 1.2.3
136
- $0 --dry-run # Preview changes without applying
137
- $0 --verify # Check current version consistency
138
-
139
- DESCRIPTION:
140
- This script synchronizes version numbers across all markdown files in the
141
- repository with the version specified in package.json. It updates various
142
- version reference patterns including badges, documentation headers, and
143
- feature version stamps.
144
-
145
- EOF
146
- }
147
-
148
- is_excluded_file() {
149
- local file="$1"
150
- local excluded
151
- for excluded in "${EXCLUDE_FILES[@]}"; do
152
- if [[ "$file" == "$excluded" ]]; then
153
- return 0
154
- fi
155
- done
156
- return 1
157
- }
158
-
159
- get_package_version() {
160
- local package_file="$PROJECT_ROOT/package.json"
161
- if [[ ! -f "$package_file" ]]; then
162
- log_error "package.json not found at $package_file"
163
- exit 1
164
- fi
165
-
166
- local version
167
- if command -v jq &>/dev/null; then
168
- version=$(jq -r '.version' "$package_file" 2>/dev/null)
169
- else
170
- version=$(sed -nE 's/^[[:space:]]*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/p' "$package_file" | head -n 1)
171
- fi
172
- if [[ "$version" == "null" || -z "$version" ]]; then
173
- log_error "Could not extract version from package.json"
174
- exit 1
175
- fi
176
-
177
- echo "$version"
178
- }
179
-
180
- validate_version() {
181
- local version="$1"
182
- if [[ ! $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
183
- log_error "Invalid version format: $version (expected: x.y.z)"
184
- exit 1
185
- fi
186
- }
187
-
188
- find_version_files() {
189
- local temp_file
190
- temp_file=$(umask 077 && mktemp)
191
-
192
- log_info "Scanning for markdown files with version references..."
193
-
194
- # Find all markdown files with version patterns.
195
- # The "." path is required: with no path and a non-TTY stdin (CI, pipes,
196
- # background jobs) rg reads from stdin instead of searching the tree, so
197
- # the whole script hangs forever. The `sed` strips rg's leading "./" so
198
- # the paths match the EXCLUDE_FILES entries (which have no "./"),
199
- # otherwise excluded historical docs get rewritten.
200
- cd "$PROJECT_ROOT"
201
- if command -v rg &>/dev/null; then
202
- rg -l "v?$VERSION_PATTERN" --type md . 2>/dev/null | sed 's|^\./||' >"$temp_file" || true
203
- else
204
- {
205
- while IFS= read -r file; do
206
- if grep -Eq "v?$VERSION_PATTERN" "$file" 2>/dev/null; then
207
- printf '%s\n' "${file#./}"
208
- fi
209
- done < <(find . -type f -name '*.md' -print)
210
- } >"$temp_file"
211
- fi
212
-
213
- # Add known files that should be checked even if they don't have versions yet
214
- # Non-markdown and hidden-directory surfaces rg's `--type md` scan above
215
- # cannot reach: a shell script, and READMEs under the dotfile-hidden
216
- # `.chezmoitemplates/` tree (rg skips dot-dirs without --hidden). These
217
- # carry "current version" stamps that check-version-consistency.sh and
218
- # the test_version_consistency unit test enforce, so keep them in sync.
219
- printf '%s\n' \
220
- "README.md" \
221
- "docs/reference/FEATURES.md" \
222
- "docs/COPYRIGHT" \
223
- "scripts/git-hooks/pre-commit-audit.sh" \
224
- "defaults/.chezmoitemplates/README.md" \
225
- "defaults/.chezmoitemplates/functions/README.md" \
226
- "defaults/.chezmoitemplates/aliases/README.md" >>"$temp_file"
227
-
228
- # Remove duplicates and filter existing files
229
- sort -u "$temp_file" | while IFS= read -r file; do
230
- if [[ -f "$file" ]]; then
231
- if is_excluded_file "$file"; then
232
- continue
233
- fi
234
- echo "$file"
235
- fi
236
- done
237
-
238
- rm -f "$temp_file"
239
- }
240
-
241
- sed_in_place() {
242
- local file="$1"
243
- shift
244
-
245
- if sed --version >/dev/null 2>&1; then
246
- sed -E -i "$@" "$file"
247
- else
248
- sed -E -i '' "$@" "$file"
249
- fi
250
- }
251
-
252
- # LCOV_EXCL_START — rm -rf BACKUP_DIR + cp of real release files;
253
- # only run during a real release flow, not safe under coverage.
254
- create_backup() {
255
- local files=("$@")
256
-
257
- if [[ ${#files[@]} -eq 0 ]]; then
258
- log_warning "No files to backup"
259
- return
260
- fi
261
-
262
- log_info "Creating backup in $BACKUP_DIR"
263
- rm -rf "$BACKUP_DIR"
264
- mkdir -p "$BACKUP_DIR"
265
-
266
- local backup_count=0
267
- for file in "${files[@]}"; do
268
- if [[ -f "$file" ]]; then
269
- local backup_name
270
- backup_name="$(basename "$file").$(date +%Y%m%d_%H%M%S).backup"
271
- cp "$file" "$BACKUP_DIR/$backup_name"
272
- backup_count=$((backup_count + 1))
273
- fi
274
- done
275
-
276
- log_success "Backed up $backup_count files"
277
- }
278
- # LCOV_EXCL_STOP
279
-
280
- update_version_references() {
281
- local target_version="$1"
282
- local dry_run="$2"
283
- local files=("${@:3}")
284
-
285
- local changes_made=0
286
- local files_processed=0
287
-
288
- for file in "${files[@]}"; do
289
- if [[ ! -f "$file" ]]; then
290
- log_warning "File not found: $file"
291
- continue
292
- fi
293
- files_processed=$((files_processed + 1))
294
-
295
- # Skip milestone and other historical files
296
- if _is_historical_record "$file"; then
297
- log_info "Skipping historical file: $file"
298
- continue
299
- fi
300
-
301
- # Create temporary file for changes
302
- local temp_file
303
- temp_file=$(umask 077 && mktemp)
304
- cp "$file" "$temp_file"
305
-
306
- # Update various version reference patterns. Match on the full repo
307
- # path (not basename) so the root README's badge rules don't also
308
- # capture other README.md files (e.g. the .chezmoitemplates READMEs),
309
- # which carry a `(vX.Y.Z)` stamp handled by the generic case below.
310
- case "$file" in
311
- "README.md")
312
- # Update badge and release link versions.
313
- sed_in_place "$temp_file" \
314
- -e "s|Version-v$SED_VERSION_PATTERN|Version-v$target_version|g" \
315
- -e "s|/releases/tag/v$SED_VERSION_PATTERN|/releases/tag/v$target_version|g" \
316
- -e "s|/dotfiles/v$SED_VERSION_PATTERN/|/dotfiles/v$target_version/|g"
317
- ;;
318
- "scripts/git-hooks/pre-commit-audit.sh")
319
- # "vX.Y.Z standards maintained" banner. Matched explicitly with a
320
- # portable pattern — the generic `\bvX.Y.Z\b` rule below relies on
321
- # GNU `\b`, which BSD/macOS sed does not support, so a local
322
- # `version-sync` run would otherwise leave this script stale.
323
- sed_in_place "$temp_file" \
324
- -e "s|v$SED_VERSION_PATTERN standards maintained|v$target_version standards maintained|g"
325
- ;;
326
- "docs/manual/00-introduction.md")
327
- sed_in_place "$temp_file" \
328
- -e "s|\.dotfiles\` v$SED_VERSION_PATTERN|.dotfiles\` v$target_version|g"
329
- ;;
330
- *)
331
- # Update explicit markdown version labels, backticks, and parentheses.
332
- # Skip lines containing MILESTONE.
333
- sed_in_place "$temp_file" \
334
- -e "/MILESTONE/!s|(\*\*Version\*\*:[[:space:]]*)v?$SED_VERSION_PATTERN|\\1v$target_version|g" \
335
- -e "/MILESTONE/!s|(\*\*Dotfiles Version\*\*:[[:space:]]*)v?$SED_VERSION_PATTERN|\\1v$target_version|g" \
336
- -e "/MILESTONE/!s|(Version:[[:space:]]*)v?$SED_VERSION_PATTERN|\\1v$target_version|g" \
337
- -e "/MILESTONE/!s|(Dotfiles Version:[[:space:]]*)v?$SED_VERSION_PATTERN|\\1v$target_version|g" \
338
- -e "/MILESTONE/!s|Version[[:space:]]*\`v?$SED_VERSION_PATTERN\`|Version \`$target_version\`|g" \
339
- -e "/MILESTONE/!s|\(v$SED_VERSION_PATTERN\)|\(v$target_version\)|g" \
340
- -e "/MILESTONE/!s|/v$SED_VERSION_PATTERN/|/v$target_version/|g" \
341
- -e "/MILESTONE/!s|\bv$SED_VERSION_PATTERN\b|v$target_version|g" \
342
- -e "/MILESTONE/!s|dotfiles:v?$SED_VERSION_PATTERN|dotfiles:$target_version|g" \
343
- -e "/MILESTONE/!s|notes — v$SED_VERSION_PATTERN|notes — v$target_version|g"
344
- ;;
345
- esac
346
-
347
- # Check if file was changed
348
- if ! cmp -s "$file" "$temp_file"; then
349
- if [[ "$dry_run" == "true" ]]; then
350
- log_info "Would update: $file"
351
- # Show diff preview
352
- diff -u "$file" "$temp_file" | head -20 >&2 || true
353
- else
354
- # Use cat to preserve permissions and ownership
355
- cat "$temp_file" >"$file"
356
- log_success "Updated: $file"
357
- fi
358
- rm -f "$temp_file"
359
- changes_made=$((changes_made + 1))
360
- else
361
- log_info "No changes needed: $file"
362
- rm -f "$temp_file"
363
- fi
364
- done
365
-
366
- if [[ "$dry_run" == "true" ]]; then
367
- log_info "Dry run complete - $changes_made files would be updated out of $files_processed processed"
368
- else
369
- log_success "Updated $changes_made files out of $files_processed processed"
370
- fi
371
-
372
- echo "$changes_made"
373
- }
374
-
375
- # A version reference is only drift if it is meant to track the release. In a
376
- # historical record it is evidence: GOLD-STANDARD-AUDIT.md records which tag
377
- # `git tag -v` was run against and what it printed, and MILESTONE_* files
378
- # describe releases that already happened. Rewriting either to the version
379
- # being prepared would claim a verification nobody performed against a tag
380
- # that does not exist yet, which is a worse outcome than a stale-looking
381
- # string. Both the updater and the verifier consult this, so they cannot
382
- # disagree about which files are in scope.
383
- _is_historical_record() {
384
- case "$(basename "$1")" in
385
- MILESTONE_*) return 0 ;;
386
- GOLD-STANDARD-AUDIT.md) return 0 ;;
387
- *) return 1 ;;
388
- esac
389
- }
390
-
391
- verify_version_consistency() {
392
- local expected_version="$1"
393
- local files=("${@:2}")
394
-
395
- log_info "Verifying version consistency (expected: v$expected_version)"
396
-
397
- local inconsistencies=0
398
- local total_checked=0
399
-
400
- for file in "${files[@]}"; do
401
- if [[ ! -f "$file" ]]; then
402
- continue
403
- fi
404
-
405
- if _is_historical_record "$file"; then
406
- log_info "Skipping historical file: $file"
407
- continue
408
- fi
409
-
410
- total_checked=$((total_checked + 1))
411
-
412
- # Extract only dotfiles-targeted version references (ignore unrelated tool versions).
413
- local versions_in_file=()
414
- if command -v rg &>/dev/null; then
415
- while IFS= read -r match; do
416
- while IFS= read -r version; do
417
- versions_in_file+=("$version")
418
- done < <(printf "%s\n" "$match" | rg -o "v?$VERSION_PATTERN" || true)
419
- done < <(
420
- rg -v "MILESTONE" "$file" 2>/dev/null | rg -o \
421
- -e "Version-v$VERSION_PATTERN" \
422
- -e "/releases/tag/v$VERSION_PATTERN" \
423
- -e "/dotfiles/v$VERSION_PATTERN/" \
424
- -e "\\*\\*Version\\*\\*:[[:space:]]*v?$VERSION_PATTERN" \
425
- -e "\\*\\*Dotfiles Version\\*\\*:[[:space:]]*v?$VERSION_PATTERN" \
426
- -e "(^|[[:space:]])Version:[[:space:]]*v?$VERSION_PATTERN" \
427
- -e "(^|[[:space:]])Dotfiles Version:[[:space:]]*v?$VERSION_PATTERN" \
428
- -e "Version[[:space:]]*\`v?$VERSION_PATTERN\`" \
429
- -e "\\(v$VERSION_PATTERN\\)" \
430
- -e "/v$VERSION_PATTERN/" \
431
- -e "v$VERSION_PATTERN\\b" \
432
- -e "dotfiles:v?$VERSION_PATTERN" \
433
- -e "notes — v$VERSION_PATTERN" || true
434
- )
435
- else
436
- while IFS= read -r match; do
437
- while IFS= read -r version; do
438
- versions_in_file+=("$version")
439
- done < <(printf "%s\n" "$match" | grep -Eo "v?$VERSION_PATTERN" || true)
440
- done < <(
441
- grep -Ev "MILESTONE" "$file" 2>/dev/null | grep -Eo \
442
- -e "Version-v$VERSION_PATTERN" \
443
- -e "/releases/tag/v$VERSION_PATTERN" \
444
- -e "/dotfiles/v$VERSION_PATTERN/" \
445
- -e "\\*\\*Version\\*\\*:[[:space:]]*v?$VERSION_PATTERN" \
446
- -e "\\*\\*Dotfiles Version\\*\\*:[[:space:]]*v?$VERSION_PATTERN" \
447
- -e "(^|[[:space:]])Version:[[:space:]]*v?$VERSION_PATTERN" \
448
- -e "(^|[[:space:]])Dotfiles Version:[[:space:]]*v?$VERSION_PATTERN" \
449
- -e "Version[[:space:]]*\`v?$VERSION_PATTERN\`" \
450
- -e "\\(v$VERSION_PATTERN\\)" \
451
- -e "/v$VERSION_PATTERN/" \
452
- -e "v$VERSION_PATTERN([^0-9.]|$)" \
453
- -e "dotfiles:v?$VERSION_PATTERN" \
454
- -e "notes — v$VERSION_PATTERN" || true
455
- )
456
- fi
457
-
458
- if [[ ${#versions_in_file[@]} -eq 0 ]]; then
459
- continue
460
- fi
461
-
462
- for version in "${versions_in_file[@]}"; do
463
- # Remove 'v' prefix if present for comparison
464
- local clean_version="${version#v}"
465
- if [[ "$clean_version" != "$expected_version" ]]; then
466
- log_error "Inconsistent version in $file: $version (expected: v$expected_version)"
467
- inconsistencies=$((inconsistencies + 1))
468
- fi
469
- done
470
- done
471
-
472
- if [[ $inconsistencies -eq 0 ]]; then
473
- log_success "All version references are consistent: v$expected_version (checked $total_checked files)"
474
- return 0
475
- else
476
- log_error "Found $inconsistencies inconsistent version references"
477
- return 1
478
- fi
479
- }
480
-
481
- main() {
482
- local target_version=""
483
- local dry_run="false"
484
- local verify_only="false"
485
- local create_backup_flag="true"
486
- local force_sync="false"
487
-
488
- # Parse arguments
489
- while [[ $# -gt 0 ]]; do
490
- case $1 in
491
- -h | --help)
492
- show_help
493
- exit 0
494
- ;;
495
- -d | --dry-run)
496
- dry_run="true"
497
- shift
498
- ;;
499
- -v | --verify)
500
- verify_only="true"
501
- shift
502
- ;;
503
- -b | --backup)
504
- create_backup_flag="true"
505
- shift
506
- ;;
507
- --no-backup)
508
- create_backup_flag="false"
509
- shift
510
- ;;
511
- -f | --force)
512
- force_sync="true"
513
- shift
514
- ;;
515
- -*)
516
- log_error "Unknown option: $1"
517
- show_help
518
- exit 1
519
- ;;
520
- *)
521
- target_version="$1"
522
- shift
523
- ;;
524
- esac
525
- done
526
-
527
- if [[ -n "${DOTFILES_COV_TMPDIR:-}" && "${DOTFILES_ALLOW_COVERAGE_WRITES:-0}" != "1" ]]; then
528
- dry_run="true"
529
- create_backup_flag="false"
530
- log_info "Coverage sandbox detected; forcing --dry-run"
531
- fi
532
-
533
- # Change to project root
534
- cd "$PROJECT_ROOT"
535
-
536
- # Determine target version
537
- if [[ -z "$target_version" ]]; then
538
- target_version=$(get_package_version)
539
- log_info "Using package.json version: $target_version"
540
- else
541
- validate_version "$target_version"
542
- log_info "Using specified version: $target_version"
543
- fi
544
-
545
- # Find files with version references
546
- local version_files=()
547
- local version_file
548
- while IFS= read -r version_file; do
549
- version_files+=("$version_file")
550
- done < <(find_version_files)
551
-
552
- if [[ ${#version_files[@]} -eq 0 ]]; then
553
- log_warning "No files with version references found"
554
- exit 0
555
- fi
556
-
557
- log_info "Found ${#version_files[@]} files with version references"
558
-
559
- # Verify mode - just check consistency
560
- if [[ "$verify_only" == "true" ]]; then
561
- if verify_version_consistency "$target_version" "${version_files[@]}"; then
562
- exit 0
563
- else
564
- exit 1
565
- fi
566
- fi
567
-
568
- # Create backup if requested and not dry run
569
- if [[ "$create_backup_flag" == "true" && "$dry_run" == "false" ]]; then
570
- create_backup "${version_files[@]}"
571
- fi
572
-
573
- # Sync chezmoidata.toml (single source of truth for template files).
574
- # Post-Phase-4b lives under defaults/ — kept old root location as a
575
- # fallback so this script is forward- and backward-compatible.
576
- local chezmoidata="$PROJECT_ROOT/defaults/.chezmoidata.toml"
577
- [[ -f "$chezmoidata" ]] || chezmoidata="$PROJECT_ROOT/.chezmoidata.toml"
578
- if [[ -f "$chezmoidata" ]]; then
579
- if [[ "$dry_run" == "true" ]]; then
580
- log_info "Would update ${chezmoidata#"$PROJECT_ROOT/"}: dotfiles_version = \"$target_version\""
581
- else
582
- sed_in_place "$chezmoidata" \
583
- "s|^dotfiles_version = \"$SED_VERSION_PATTERN\"|dotfiles_version = \"$target_version\"|"
584
- log_success "Updated ${chezmoidata#"$PROJECT_ROOT/"}"
585
- fi
586
- fi
587
-
588
- # package.json is the release-tooling source used when VERSION is omitted.
589
- # A caller-supplied target must update it atomically before downstream
590
- # verification, otherwise the repository immediately contains two versions.
591
- local package_json="$PROJECT_ROOT/package.json"
592
- if [[ "$dry_run" == "true" ]]; then
593
- log_info "Would update package.json: version = \"$target_version\""
594
- else
595
- local package_tmp
596
- package_tmp=$(umask 077 && mktemp)
597
- if command -v jq >/dev/null 2>&1; then
598
- jq --arg version "$target_version" '.version = $version' "$package_json" >"$package_tmp"
599
- else
600
- cp "$package_json" "$package_tmp"
601
- sed_in_place "$package_tmp" "s|\"version\": \"$SED_VERSION_PATTERN\"|\"version\": \"$target_version\"|"
602
- fi
603
- cat "$package_tmp" >"$package_json"
604
- rm -f "$package_tmp"
605
- log_success "Updated package.json"
606
- fi
607
-
608
- # Sync non-template script files that embed the version
609
- local script_files=(
610
- "bin/dot"
611
- "dot_local/bin/executable_tour"
612
- "install.sh"
613
- "lib/dot/bento.sh"
614
- "share/man/man1/dot.1"
615
- # The MCP server reports this string as serverInfo.version in the
616
- # `initialize` handshake, and it must equal the version in
617
- # .well-known/mcp/server-card.json — a client compares them.
618
- # TestVersionMatchesServerCard fails the build if this drifts.
619
- "defaults/dot_local/share/dot-mcp/main.go"
620
- )
621
- for script_file in "${script_files[@]}"; do
622
- local full_path="$PROJECT_ROOT/$script_file"
623
- if [[ -f "$full_path" ]]; then
624
- local temp_file
625
- temp_file=$(umask 077 && mktemp)
626
- cp "$full_path" "$temp_file"
627
- sed_in_place "$temp_file" "s|v$SED_VERSION_PATTERN|v$target_version|g"
628
- sed_in_place "$temp_file" "s|\"$SED_VERSION_PATTERN\"|\"$target_version\"|g"
629
- if ! cmp -s "$full_path" "$temp_file"; then
630
- if [[ "$dry_run" == "true" ]]; then
631
- log_info "Would update: $script_file"
632
- else
633
- # Use cat to preserve permissions and ownership
634
- cat "$temp_file" >"$full_path"
635
- log_success "Updated: $script_file"
636
- fi
637
- else
638
- rm -f "$temp_file"
639
- fi
640
- fi
641
- done
642
-
643
- # Machine-readable discovery cards. These are JSON with a bare
644
- # `"version"` key, so the `v$VERSION` substitution above does not
645
- # reach them — which is exactly why the MCP card sat at 0.2.501
646
- # while the project shipped 0.2.519. Agents fetch these over the
647
- # network, so a stale version here misroutes tooling rather than
648
- # merely reading wrong. Gated by scripts/verify-release-versions.
649
- local card_files=(
650
- ".well-known/mcp/server-card.json"
651
- ".well-known/agent-card.json"
652
- )
653
- for card_file in "${card_files[@]}"; do
654
- local card_path="$PROJECT_ROOT/$card_file"
655
- [[ -f "$card_path" ]] || continue
656
- # Deliberately sed, not jq: jq re-serialises the whole document and
657
- # would reflow the hand-formatted arrays in these cards, producing a
658
- # large diff for a one-token change. Only the top-level "version"
659
- # key is rewritten (it is the first such key in both files).
660
- local card_tmp
661
- card_tmp=$(umask 077 && mktemp)
662
- cp "$card_path" "$card_tmp"
663
- sed_in_place "$card_tmp" \
664
- "1,6s|\"version\": \"$SED_VERSION_PATTERN\"|\"version\": \"$target_version\"|"
665
- if ! cmp -s "$card_path" "$card_tmp"; then
666
- if [[ "$dry_run" == "true" ]]; then
667
- log_info "Would update: $card_file"
668
- else
669
- cat "$card_tmp" >"$card_path"
670
- log_success "Updated: $card_file"
671
- fi
672
- fi
673
- rm -f "$card_tmp"
674
- done
675
-
676
- # Update version references
677
- local changes_made
678
- changes_made="$(update_version_references "$target_version" "$dry_run" "${version_files[@]}")"
679
- if [[ "$changes_made" =~ ^[0-9]+$ ]]; then
680
-
681
- if [[ $changes_made -gt 0 || "$force_sync" == "true" ]]; then
682
- if [[ "$dry_run" == "false" ]]; then
683
- # Verify the changes
684
- if verify_version_consistency "$target_version" "${version_files[@]}"; then
685
- log_success "Version synchronization completed successfully"
686
-
687
- # Show summary
688
- cat <<EOF
689
-
690
- ═══════════════════════════════════════
691
- Version Sync Summary
692
- ═══════════════════════════════════════
693
- Target Version: v$target_version
694
- Files Updated: $changes_made
695
- Backup Created: $create_backup_flag
696
- Verification: ✅ Passed
697
-
698
- EOF
699
- else
700
- log_error "Version synchronization failed verification"
701
- exit 1
702
- fi
703
- fi
704
- else
705
- log_info "No changes needed - all versions are already synchronized"
706
- fi
707
- else
708
- log_error "Version synchronization failed"
709
- exit 1
710
- fi
711
- }
712
-
713
- # Run main function
714
- main "$@"