@sebastienrousseau/dotfiles 0.2.520 โ†’ 0.2.521

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 +18 -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,319 +0,0 @@
1
- # Dot โ€” native PowerShell module for the dotfiles framework.
2
- #
3
- # This module provides native PowerShell cmdlets for the daily `dot`
4
- # workflow. Commands with Unix-specific orchestration remain available
5
- # through the dispatcher's explicit bash bridge.
6
- #
7
- # Loaded by bin/dot.ps1 dispatcher; cmdlets are also callable
8
- # directly:
9
- # Import-Module ./scripts/dot/powershell/Dot.psm1
10
- # Get-DotVersion
11
- # Invoke-DotHelp
12
- # Test-DotAgentsSync -Verbose
13
- #
14
- # Tested via tools/ci/windows-smoke-test.ps1.
15
-
16
- #requires -Version 7.0
17
-
18
- Set-StrictMode -Version Latest
19
- $ErrorActionPreference = 'Stop'
20
-
21
- # Module-level constants -------------------------------------------------------
22
-
23
- $script:RepoRoot = if ($env:DOT_REPO_ROOT) {
24
- $env:DOT_REPO_ROOT
25
- }
26
- else {
27
- # When called from bin/dot.ps1 the dispatcher sets DOT_REPO_ROOT.
28
- # When imported directly, infer it from this file's path:
29
- # scripts/dot/powershell/Dot.psm1 โ†’ ../../..
30
- (Resolve-Path (Join-Path $PSScriptRoot '..\..\..')).Path
31
- }
32
-
33
- # Post-Phase-4b (v0.2.503) .chezmoidata.toml ships under defaults/.
34
- # Probe defaults/ first; fall back to legacy root location for older
35
- # deployments that pre-date the .chezmoiroot activation.
36
- $script:DataFile = Join-Path $script:RepoRoot 'defaults/.chezmoidata.toml'
37
- if (-not (Test-Path $script:DataFile)) {
38
- $script:DataFile = Join-Path $script:RepoRoot '.chezmoidata.toml'
39
- }
40
-
41
- # Helpers ---------------------------------------------------------------------
42
-
43
- function script:Get-DotfilesVersionFromData {
44
- if (-not (Test-Path $script:DataFile)) {
45
- throw "Cannot read $script:DataFile (set DOT_REPO_ROOT to override)"
46
- }
47
- $line = Get-Content $script:DataFile |
48
- Where-Object { $_ -match '^dotfiles_version\s*=\s*"([^"]+)"' } |
49
- Select-Object -First 1
50
- if (-not $line) {
51
- throw "dotfiles_version not found in $script:DataFile"
52
- }
53
- if ($line -notmatch '"([^"]+)"') {
54
- throw "Could not parse dotfiles_version from line: $line"
55
- }
56
- return $Matches[1]
57
- }
58
-
59
- function script:Write-DotBanner {
60
- param([string]$Section)
61
- if ($env:NO_COLOR) {
62
- Write-Host "Dot ยท $Section"
63
- return
64
- }
65
- $esc = [char]27
66
- Write-Host "$esc[1;38;5;212mDot ยท $Section$esc[0m"
67
- }
68
-
69
- function script:Assert-DotCommand {
70
- param([Parameter(Mandatory)][string]$Name)
71
- if (-not (Get-Command $Name -ErrorAction SilentlyContinue)) {
72
- throw "$Name is required but was not found on PATH"
73
- }
74
- }
75
-
76
- function script:Invoke-DotNativeCommand {
77
- param(
78
- [Parameter(Mandatory)][string]$Name,
79
- [Parameter(Mandatory)][string[]]$Arguments
80
- )
81
- Assert-DotCommand -Name $Name
82
- & $Name @Arguments
83
- if ($LASTEXITCODE -ne 0) {
84
- throw "$Name exited with status $LASTEXITCODE"
85
- }
86
- }
87
-
88
- # Public cmdlets --------------------------------------------------------------
89
-
90
- <#
91
- .SYNOPSIS
92
- Print the dotfiles framework version.
93
-
94
- .DESCRIPTION
95
- Native PowerShell implementation of `dot version`. Reads the
96
- canonical version from .chezmoidata.toml (the single source of
97
- truth) โ€” does NOT shell out to bash.
98
-
99
- .EXAMPLE
100
- Get-DotVersion
101
- 0.2.503
102
-
103
- .EXAMPLE
104
- Get-DotVersion -AsObject | ConvertTo-Json
105
- {
106
- "Version": "0.2.503",
107
- "Source": "...\\.chezmoidata.toml",
108
- "Native": true
109
- }
110
- #>
111
- function Get-DotVersion {
112
- [CmdletBinding()]
113
- param(
114
- [switch]$AsObject
115
- )
116
- $version = Get-DotfilesVersionFromData
117
- if ($AsObject) {
118
- return [pscustomobject]@{
119
- Version = $version
120
- Source = $script:DataFile
121
- Native = $true
122
- }
123
- }
124
- return $version
125
- }
126
-
127
- <#
128
- .SYNOPSIS
129
- Print the dot CLI help overview.
130
-
131
- .DESCRIPTION
132
- Native PowerShell implementation of `dot help`. Presents the
133
- native command surface without shelling out to bash.
134
-
135
- The full Linux-style help (every subcommand grouped by category)
136
- requires the bash dispatcher; this cmdlet shows the Windows-
137
- native subset.
138
- #>
139
- function Invoke-DotHelp {
140
- [CmdletBinding()]
141
- param()
142
- $version = Get-DotfilesVersionFromData
143
- Write-DotBanner -Section 'Help'
144
- Write-Host ''
145
- Write-Host " Version v$version"
146
- Write-Host " Repo https://github.com/sebastienrousseau/dotfiles"
147
- Write-Host " Docs https://github.com/sebastienrousseau/dotfiles/blob/main/docs/manual/"
148
- Write-Host ''
149
- Write-Host 'Native PowerShell commands (no bash required):'
150
- Write-Host ''
151
- Write-Host ' Get-DotVersion Print framework version'
152
- Write-Host ' Invoke-DotHelp This screen'
153
- Write-Host ' Test-DotAgentsSync Check AGENTS.md against CLAUDE.md'
154
- Write-Host ' Get-DotStatus Show chezmoi drift'
155
- Write-Host ' Invoke-DotChezmoi Run a core chezmoi operation'
156
- Write-Host ' Invoke-DotDoctor Audit the native Windows setup'
157
- Write-Host ' Get-DotEnvironment List mise-managed tools'
158
- Write-Host ' Get-DotAgents List agent harness targets'
159
- Write-Host ' Get-DotFleetStatus Show local fleet node status'
160
- Write-Host ''
161
- Write-Host 'Bash-bridged subcommands (require bash on PATH):'
162
- Write-Host ''
163
- Write-Host ' dot env emit Emit v1 environment manifest'
164
- Write-Host ' dot agents render Re-render every AGENTS.md harness'
165
- Write-Host ' dot registry ... Verified module registry operations'
166
- Write-Host ''
167
- Write-Host 'See: dot help all (via bash) โ€” full command index'
168
- }
169
-
170
- <#
171
- .SYNOPSIS
172
- Verify that AGENTS.md is in sync with CLAUDE.md.
173
-
174
- .DESCRIPTION
175
- Native PowerShell implementation of `dot agents check`. Both
176
- files share a "Project Overview" paragraph that is the canonical
177
- sync surface. If they diverge, AGENTS.md needs re-rendering
178
- (run `dot agents render` via bash; native PowerShell render is
179
- a separate ticket).
180
-
181
- .OUTPUTS
182
- [bool] โ€” $true when in sync, $false otherwise.
183
-
184
- .EXAMPLE
185
- if (-not (Test-DotAgentsSync)) {
186
- Write-Warning 'AGENTS.md is stale; run: bash dot_local/bin/executable_dot agents render'
187
- }
188
- #>
189
- function Test-DotAgentsSync {
190
- [CmdletBinding()]
191
- [OutputType([bool])]
192
- param()
193
- $claude = Join-Path $script:RepoRoot 'CLAUDE.md'
194
- $agents = Join-Path $script:RepoRoot 'AGENTS.md'
195
- foreach ($f in @($claude, $agents)) {
196
- if (-not (Test-Path $f)) {
197
- Write-Error "missing: $f"
198
- return $false
199
- }
200
- }
201
- $claudeBody = Get-Content -Raw $claude
202
- $agentsBody = Get-Content -Raw $agents
203
- foreach ($name in @('claudeBody', 'agentsBody')) {
204
- $value = Get-Variable -Name $name -ValueOnly
205
- $value = $value -replace '(?s)^\s*<!--.*?-->\s*', ''
206
- $value = $value -replace '(?m)^# (CLAUDE|AGENTS)\.md.*\r?\n', ''
207
- $value = $value -replace '(?s)\r?\n---\r?\n\r?\n\*\*Need richer context\?.*$', ''
208
- $value = ($value -replace "`r`n", "`n").Trim()
209
- Set-Variable -Name $name -Value $value
210
- }
211
- if ($claudeBody -cne $agentsBody) {
212
- Write-Verbose 'AGENTS.md content differs from the canonical CLAUDE.md body'
213
- return $false
214
- }
215
- Write-Verbose 'AGENTS.md content matches the canonical CLAUDE.md body'
216
- return $true
217
- }
218
-
219
- function Invoke-DotChezmoi {
220
- [CmdletBinding()]
221
- param(
222
- [Parameter(Mandatory)]
223
- [ValidateSet('apply', 'diff', 'update', 'add', 'remove', 'init')]
224
- [string]$Operation,
225
- [Parameter(ValueFromRemainingArguments = $true)]
226
- [string[]]$Arguments = @()
227
- )
228
- Invoke-DotNativeCommand -Name 'chezmoi' -Arguments (@($Operation) + $Arguments)
229
- }
230
-
231
- function Get-DotStatus {
232
- [CmdletBinding()]
233
- param([switch]$AsObject)
234
- Assert-DotCommand -Name 'chezmoi'
235
- $output = @(& chezmoi status 2>&1)
236
- if ($LASTEXITCODE -ne 0) {
237
- throw "chezmoi status exited with status $LASTEXITCODE`: $($output -join [Environment]::NewLine)"
238
- }
239
- $state = if ($output.Count -eq 0) { 'clean' } else { 'drifted' }
240
- if ($AsObject) {
241
- return [pscustomobject]@{ State = $state; Changes = $output; Native = $true }
242
- }
243
- Write-DotBanner -Section 'Status'
244
- if ($state -eq 'clean') { Write-Host '[OK] Clean - no local drift detected' }
245
- else { $output | Write-Output }
246
- }
247
-
248
- function Get-DotSourcePath {
249
- [CmdletBinding()]
250
- param()
251
- Assert-DotCommand -Name 'chezmoi'
252
- $path = (& chezmoi source-path 2>&1 | Out-String).Trim()
253
- if ($LASTEXITCODE -ne 0 -or -not $path) { throw 'chezmoi source-path failed' }
254
- return $path
255
- }
256
-
257
- function Invoke-DotDoctor {
258
- [CmdletBinding()]
259
- param([switch]$AsObject)
260
- $checks = @(
261
- [pscustomobject]@{ Name = 'PowerShell 7.4+'; Ok = ($PSVersionTable.PSVersion -ge [version]'7.4') }
262
- [pscustomobject]@{ Name = 'chezmoi'; Ok = [bool](Get-Command chezmoi -ErrorAction SilentlyContinue) }
263
- [pscustomobject]@{ Name = 'git'; Ok = [bool](Get-Command git -ErrorAction SilentlyContinue) }
264
- [pscustomobject]@{ Name = 'repository data'; Ok = (Test-Path $script:DataFile) }
265
- [pscustomobject]@{ Name = 'PowerShell module'; Ok = (Test-Path (Join-Path $PSScriptRoot 'Dot.psm1')) }
266
- )
267
- if ($AsObject) { return $checks }
268
- Write-DotBanner -Section 'Doctor'
269
- foreach ($check in $checks) {
270
- $prefix = if ($check.Ok) { '[OK]' } else { '[FAIL]' }
271
- Write-Host "$prefix $($check.Name)"
272
- }
273
- return -not ($checks.Ok -contains $false)
274
- }
275
-
276
- function Get-DotEnvironment {
277
- [CmdletBinding()]
278
- param([switch]$AsJson)
279
- Assert-DotCommand -Name 'mise'
280
- $arguments = if ($AsJson) { @('ls', '--json') } else { @('ls') }
281
- Invoke-DotNativeCommand -Name 'mise' -Arguments $arguments
282
- }
283
-
284
- function Get-DotAgents {
285
- [CmdletBinding()]
286
- param()
287
- $targets = [ordered]@{
288
- 'agents-md' = 'AGENTS.md'; 'cursor' = '.cursor/rules/dotfiles.mdc'
289
- 'codex' = '.codex/config.toml'; 'windsurf' = '.windsurf/rules.md'
290
- 'zed' = '.zed/agent-config.toml'; 'roo' = '.roo/rules.md'
291
- 'cline' = '.clinerules'; 'aider' = '.aider.conf.yml'
292
- 'continue' = '.continuerc.json'; 'jules' = '.jules/system.md'
293
- 'agy' = '.agy/AGY.md'
294
- }
295
- foreach ($entry in $targets.GetEnumerator()) {
296
- $path = Join-Path $script:RepoRoot $entry.Value
297
- [pscustomobject]@{ Harness = $entry.Key; Path = $path; Rendered = (Test-Path $path) }
298
- }
299
- }
300
-
301
- function Get-DotFleetStatus {
302
- [CmdletBinding()]
303
- param([switch]$AsJson)
304
- $status = Get-DotStatus -AsObject
305
- $record = [pscustomobject]@{
306
- NodeId = [Environment]::MachineName
307
- Namespace = 'default'
308
- Version = Get-DotfilesVersionFromData
309
- OS = [System.Runtime.InteropServices.RuntimeInformation]::OSDescription
310
- Architecture = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString()
311
- Drift = $status.State
312
- }
313
- if ($AsJson) { return $record | ConvertTo-Json -Compress }
314
- return $record
315
- }
316
-
317
- Export-ModuleMember -Function Get-DotVersion, Invoke-DotHelp, Test-DotAgentsSync, `
318
- Invoke-DotChezmoi, Get-DotStatus, Get-DotSourcePath, Invoke-DotDoctor, `
319
- Get-DotEnvironment, Get-DotAgents, Get-DotFleetStatus
@@ -1,75 +0,0 @@
1
- #!/usr/bin/env bash
2
- # SPDX-License-Identifier: Apache-2.0 OR MIT
3
- # Copyright (c) 2015-2026 Sebastien Rousseau
4
- set -euo pipefail
5
-
6
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
- # shellcheck source=../../lib/dot/ui.sh
8
- # shellcheck disable=SC1091
9
- source "$SCRIPT_DIR/../../lib/dot/ui.sh"
10
- # shellcheck source=../../lib/dot/verified-download.sh disable=SC1091
11
- source "$SCRIPT_DIR/../../lib/dot/verified-download.sh"
12
-
13
- ui_init
14
- ui_header "Nerd Fonts"
15
-
16
- DEFAULT_FONTS="JetBrainsMono FiraCode Iosevka"
17
- FONT_LIST="${*:-$DEFAULT_FONTS}"
18
- FONT_VERSION="v3.4.0"
19
- FONT_BASE_URL="https://github.com/ryanoasis/nerd-fonts/releases/download/${FONT_VERSION}"
20
- FONT_CHECKSUM_URL="${FONT_BASE_URL}/SHA-256.txt"
21
-
22
- install_linux() (
23
- local font_name="$1"
24
- local target_dir="$HOME/.local/share/fonts/${font_name}NerdFont"
25
- mkdir -p "$target_dir"
26
- local tmp_dir
27
- tmp_dir="$(umask 077 && mktemp -d)"
28
- trap 'rm -rf "$tmp_dir"' EXIT
29
- local asset="${font_name}.zip"
30
- local url="${FONT_BASE_URL}/${asset}"
31
- ui_info "Downloading" "$font_name Nerd Font"
32
- download_verified_asset "$url" "$FONT_CHECKSUM_URL" "$asset" "$tmp_dir/$asset" 104857600
33
- if ! unzip -o "$tmp_dir/$asset" -d "$target_dir" >/dev/null; then
34
- ui_err "Unzip failed" "$asset" >&2
35
- return 1
36
- fi
37
- if command -v fc-cache >/dev/null; then
38
- fc-cache -f "$target_dir"
39
- fi
40
- ui_ok "Installed" "$target_dir"
41
- )
42
-
43
- install_macos() {
44
- font_name="$1"
45
- if command -v brew >/dev/null; then
46
- brew tap homebrew/cask-fonts >/dev/null 2>&1 || true
47
- cask_name="$(printf "%s" "$font_name" | tr '[:upper:]' '[:lower:]')"
48
- case "$cask_name" in
49
- jetbrainsmono) cask_name="jetbrains-mono" ;;
50
- firacode) cask_name="fira-code" ;;
51
- iosevka) cask_name="iosevka" ;;
52
- esac
53
- brew install --cask "font-${cask_name}-nerd-font" || true
54
- else
55
- ui_err "Homebrew" "not found. Install font manually."
56
- exit 1
57
- fi
58
- }
59
-
60
- case "$(uname -s)" in
61
- Linux)
62
- for font in $FONT_LIST; do
63
- install_linux "$font"
64
- done
65
- ;;
66
- Darwin)
67
- for font in $FONT_LIST; do
68
- install_macos "$font"
69
- done
70
- ;;
71
- *)
72
- ui_err "Unsupported OS" "font install"
73
- exit 1
74
- ;;
75
- esac
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env bash
2
- # SPDX-License-Identifier: Apache-2.0 OR MIT
3
- # Copyright (c) 2015-2026 Sebastien Rousseau
4
- set -euo pipefail
5
-
6
- if [[ $# -lt 1 ]]; then
7
- echo "Usage: patch-fonts.sh <font-file> [output-dir]" >&2
8
- exit 1
9
- fi
10
-
11
- font_file="$1"
12
- out_dir="${2:-$PWD/patched-fonts}"
13
-
14
- if [[ ! -f "$font_file" ]]; then
15
- echo "Font not found: $font_file" >&2
16
- exit 1
17
- fi
18
-
19
- if ! command -v fontforge >/dev/null; then
20
- echo "fontforge not found. Install it first (brew install fontforge / apt install fontforge)." >&2
21
- exit 1
22
- fi
23
-
24
- patcher="${NERD_FONTS_PATCHER:-$HOME/.local/share/nerd-fonts/font-patcher}"
25
-
26
- if [[ ! -x "$patcher" ]]; then
27
- echo "Nerd Fonts patcher not found: $patcher" >&2
28
- echo "Set NERD_FONTS_PATCHER to the font-patcher path or clone nerd-fonts." >&2
29
- exit 1
30
- fi
31
-
32
- mkdir -p "$out_dir"
33
-
34
- fontforge -script "$patcher" --complete --outputdir "$out_dir" "$font_file"
35
-
36
- echo "Patched font written to: $out_dir"
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env bash
2
- # SPDX-License-Identifier: Apache-2.0 OR MIT
3
- # Copyright (c) 2015-2026 Sebastien Rousseau
4
- set -euo pipefail
5
-
6
- repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
7
- install -m 0755 "${repo_root}/scripts/git-hooks/pre-commit" "${repo_root}/.git/hooks/pre-commit"
8
- install -m 0755 "${repo_root}/scripts/git-hooks/pre-push" "${repo_root}/.git/hooks/pre-push"
9
- install -m 0755 "${repo_root}/scripts/git-hooks/prepare-commit-msg" "${repo_root}/.git/hooks/prepare-commit-msg"
10
- echo "Installed pre-commit hook at ${repo_root}/.git/hooks/pre-commit"
11
- echo "Installed pre-push hook at ${repo_root}/.git/hooks/pre-push"
12
- echo "Installed prepare-commit-msg hook at ${repo_root}/.git/hooks/prepare-commit-msg"
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
5
-
6
- if [[ -x "${repo_root}/scripts/diagnostics/secret-governance.sh" ]]; then
7
- "${repo_root}/scripts/diagnostics/secret-governance.sh"
8
- fi
9
-
10
- if [[ -x "${repo_root}/scripts/git-hooks/pre-commit-audit.sh" ]]; then
11
- "${repo_root}/scripts/git-hooks/pre-commit-audit.sh"
12
- fi
@@ -1,146 +0,0 @@
1
- #!/usr/bin/env bash
2
- # SPDX-License-Identifier: Apache-2.0 OR MIT
3
- # Copyright (c) 2015-2026 Sebastien Rousseau
4
- # Dotfiles Pre-Commit Sentinel (Audit Hook)
5
- # Prevents secrets, hardcoded paths, and shell hygiene violations.
6
-
7
- set -euo pipefail
8
-
9
- _cleanup_files=()
10
- trap 'set +u; rm -f "${_cleanup_files[@]}" 2>/dev/null; set -u' EXIT
11
-
12
- # ANSI Colors
13
- RED='\033[0;31m'
14
- GREEN='\033[0;32m'
15
- YELLOW='\033[0;33m'
16
- BOLD='\033[1m'
17
- NC='\033[0m'
18
-
19
- printf '%b\\n' "${BOLD}๐Ÿ•ต๏ธ Running Pre-Commit Audit...${NC}"
20
-
21
- # Get list of staged files
22
- STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM)
23
-
24
- if [[ -z "$STAGED_FILES" ]]; then
25
- printf '%b\\n' "${GREEN}โœ“ No files staged. Skipping.${NC}"
26
- exit 0
27
- fi
28
-
29
- FAILED=0
30
-
31
- # --- ๐Ÿ” 1. Secret Scanning ---
32
- echo -n " ๐Ÿ” Scanning for secrets... "
33
- # Refined patterns: require assignment-like syntax to reduce false positives on documentation
34
- # Exclude assignments to values containing common placeholder strings or within template expressions
35
- SENSITIVE_PATTERNS="(GITHUB_TOKEN|API_KEY|SECRET|password|private_key|AKIA[0-9A-Z]{16})[[:space:]]*[:=]"
36
- # Exclusions list for legitimate variable checks or documentation
37
- SECRET_EXCLUDES="test_|assertions.sh|.pre-commit|README|CHANGELOG|FEATURES.md|docs/|install/lib/|.chezmoitemplates/|mcp-doctor.sh|\.github/workflows/"
38
- # Also exclude .tmpl files from secret scanning as they contain many false positive markers
39
- if echo "$STAGED_FILES" | grep -v "\.tmpl" | xargs grep -EiE "$SENSITIVE_PATTERNS" /dev/null | grep -vE "$SECRET_EXCLUDES" | grep -viE "dummy|placeholder|example|test|sk-placeholder|\\{\\{" >/dev/null 2>&1; then
40
- printf '%b\\n' "${RED}FAILED${NC}"
41
- printf '%b\\n' " ${YELLOW}โš  Potential secret detected in staged files:${NC}"
42
- echo "$STAGED_FILES" | grep -v "\.tmpl" | xargs grep -EiE "$SENSITIVE_PATTERNS" /dev/null | grep -vE "$SECRET_EXCLUDES" | grep -viE "dummy|placeholder|example|test|sk-placeholder|\\{\\{" | sed 's/^/ /'
43
- FAILED=1
44
- else
45
- printf '%b\\n' "${GREEN}PASSED${NC}"
46
- fi
47
-
48
- # --- ๐Ÿ‘ป 2. Ghost Path Linter ---
49
- echo -n " ๐Ÿ‘ป Checking for hardcoded paths... "
50
- # Exclude test files, documentation, the hook itself, Nix files, and template backups
51
- GHOST_EXCLUDES="test_|assertions.sh|pre-commit|INTEROP.md|WSL2_NIX_TROUBLESHOOTING.md|\.nix|\.backup|\.github/workflows/"
52
- if echo "$STAGED_FILES" | xargs grep -rIE '"/home/(linuxbrew)?[^$]|/Users/[^$]' /dev/null | grep -v "linuxbrew" | grep -vE "$GHOST_EXCLUDES" >/dev/null 2>&1; then
53
- printf '%b\\n' "${RED}FAILED${NC}"
54
- printf '%b\\n' " ${YELLOW}โš  Literal home paths detected (use \$HOME or ~ instead):${NC}"
55
- echo "$STAGED_FILES" | xargs grep -rIE '"/home/(linuxbrew)?[^$]|/Users/[^$]' /dev/null | grep -v "linuxbrew" | grep -vE "$GHOST_EXCLUDES" | sed 's/^/ /'
56
- FAILED=1
57
- else
58
- printf '%b\\n' "${GREEN}PASSED${NC}"
59
- fi
60
-
61
- # --- ๐Ÿš 3. ShellCheck Hygiene ---
62
- if command -v shellcheck >/dev/null 2>&1; then
63
- echo -n " ๐Ÿš Running ShellCheck... "
64
- # ONLY run on actual .sh files, NOT .tmpl files (Go templates break shellcheck)
65
- # Also exclude files that contain Zsh-specific syntax that might trigger false positives in sh mode
66
- SHELL_FILES=$(echo "$STAGED_FILES" | grep -E '\.sh$' | grep -v "\.tmpl" || true)
67
- if [[ -n "$SHELL_FILES" ]]; then
68
- if ! echo "$SHELL_FILES" | xargs shellcheck -x --severity=error -e SC1091,SC2296,SC2142 >/dev/null 2>&1; then
69
- printf '%b\\n' "${RED}FAILED${NC}"
70
- printf '%b\\n' " ${YELLOW}โš  Shell syntax errors detected:${NC}"
71
- echo "$SHELL_FILES" | xargs shellcheck -x --severity=error -e SC1091,SC2296,SC2142 | sed 's/^/ /'
72
- FAILED=1
73
- else
74
- printf '%b\\n' "${GREEN}PASSED${NC}"
75
- fi
76
- else
77
- printf '%b\\n' "${YELLOW}SKIPPED${NC} (no .sh files)"
78
- fi
79
- fi
80
- # --- ๐Ÿงน 4. Formatting Audit ---
81
- echo -n " ๐Ÿงน Checking formatting... "
82
- # Find files with trailing whitespace, excluding SVGs and other formats where it might be intentional or harmless
83
- OFFENDING_WHITESPACE=$(echo "$STAGED_FILES" | grep -vE '\.(svg|md)$' | xargs grep -l '[[:space:]]$' /dev/null || true)
84
- # Use defused patterns to avoid self-detection
85
- MERGE_START="^<<<<<<< "
86
- MERGE_END="^>>>>>>> "
87
- MERGE_DIV="^=======$"
88
- if [[ -n "$OFFENDING_WHITESPACE" ]]; then
89
- printf '%b\\n' "${RED}FAILED${NC}"
90
- printf '%b\\n' " ${YELLOW}โš  Trailing whitespace found in staged files:${NC}"
91
- echo " ${OFFENDING_WHITESPACE//$'\n'/$'\n' }"
92
- FAILED=1
93
- elif echo "$STAGED_FILES" | xargs grep -lE "$MERGE_START|$MERGE_END|$MERGE_DIV" /dev/null >/dev/null 2>&1; then
94
- printf '%b\\n' "${RED}FAILED${NC}"
95
- printf '%b\\n' " ${YELLOW}โš  Unresolved merge markers found in staged files:${NC}"
96
- echo "$STAGED_FILES" | xargs grep -lE "$MERGE_START|$MERGE_END|$MERGE_DIV" /dev/null | sed 's/^/ /'
97
- FAILED=1
98
- else
99
- printf '%b\\n' "${GREEN}PASSED${NC}"
100
- fi
101
-
102
- # --- ๐Ÿ›๏ธ 5. Signature Guard ---
103
- if echo "$STAGED_FILES" | grep -q "^README.md$"; then
104
- echo -n " ๐Ÿ›๏ธ Checking README signature... "
105
- EXPECTED_ARCHITECT='**THE ARCHITECT** แ›ซ [Sebastien Rousseau](https://sebastienrousseau.com)'
106
- EXPECTED_ENGINE='**THE ENGINE** แ›ž [EUXIS](https://euxis.co) แ›ซ Enterprise Unified Execution Intelligence System'
107
- README_CONTENT=$(git show :README.md 2>/dev/null || cat README.md)
108
- if echo "$README_CONTENT" | grep -qF "$EXPECTED_ARCHITECT" && echo "$README_CONTENT" | grep -qF "$EXPECTED_ENGINE"; then
109
- printf '%b\\n' "${GREEN}PASSED${NC}"
110
- else
111
- # Auto-add the signature footer before ## License (or at EOF)
112
- tmp_footer=$(mktemp)
113
- _cleanup_files+=("$tmp_footer")
114
- if grep -qF '## License' README.md; then
115
- awk -v arch="$EXPECTED_ARCHITECT" -v eng="$EXPECTED_ENGINE" '
116
- /^## License/ {
117
- print "---"
118
- print ""
119
- print arch
120
- print eng
121
- print ""
122
- print "---"
123
- print ""
124
- }
125
- { print }
126
- ' README.md >"$tmp_footer" && mv "$tmp_footer" README.md
127
- else
128
- {
129
- printf '\n---\n\n%s\n%s\n\n---\n' "$EXPECTED_ARCHITECT" "$EXPECTED_ENGINE"
130
- } >>README.md
131
- fi
132
- rm -f "$tmp_footer"
133
- git add README.md
134
- printf '%b\\n' "${GREEN}FIXED${NC} (auto-added)"
135
- fi
136
- fi
137
-
138
- echo ""
139
- if [[ $FAILED -eq 1 ]]; then
140
- printf '%b\\n' "${RED}${BOLD}โŒ Audit failed.${NC} Please fix the issues above before committing."
141
- printf '%b\\n' " (Use --no-verify to bypass if absolutely necessary)"
142
- exit 1
143
- else
144
- printf '%b\n' "${GREEN}${BOLD}โœ… Audit passed.${NC} v0.2.520 standards maintained."
145
- exit 0
146
- fi