docguard-cli 0.12.0__tar.gz → 0.13.0__tar.gz

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 (286) hide show
  1. {docguard_cli-0.12.0/extensions/spec-kit-docguard → docguard_cli-0.13.0/.agent}/skills/docguard-fix/SKILL.md +2 -2
  2. {docguard_cli-0.12.0/extensions/spec-kit-docguard → docguard_cli-0.13.0/.agent}/skills/docguard-guard/SKILL.md +3 -3
  3. {docguard_cli-0.12.0/extensions/spec-kit-docguard → docguard_cli-0.13.0/.agent}/skills/docguard-review/SKILL.md +2 -2
  4. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/skills/docguard-score/SKILL.md +2 -2
  5. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/skills/docguard-sync/SKILL.md +1 -1
  6. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/AGENTS.md +1 -1
  7. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/CHANGELOG.md +36 -0
  8. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/PKG-INFO +3 -3
  9. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/README.md +2 -2
  10. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/fix.mjs +55 -0
  11. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/guard.mjs +20 -3
  12. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/sync.mjs +50 -0
  13. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/trace.mjs +105 -0
  14. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/docguard.mjs +9 -0
  15. docguard_cli-0.13.0/cli/shared-git.mjs +0 -0
  16. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/cross-reference.mjs +9 -1
  17. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/docs-sync.mjs +15 -0
  18. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/freshness.mjs +5 -10
  19. docguard_cli-0.13.0/cli/validators/generated-staleness.mjs +97 -0
  20. docguard_cli-0.13.0/cli/writers/fix-memory.mjs +133 -0
  21. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/writers/mechanical.mjs +22 -0
  22. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/commands/docguard.guard.md +2 -2
  23. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/docs/quickstart.md +1 -1
  24. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/docs-canonical/CI-RECIPES.md +2 -2
  25. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/commands/guard.md +1 -1
  26. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/extension.yml +1 -1
  27. {docguard_cli-0.12.0/.agent → docguard_cli-0.13.0/extensions/spec-kit-docguard}/skills/docguard-fix/SKILL.md +2 -2
  28. {docguard_cli-0.12.0/.agent → docguard_cli-0.13.0/extensions/spec-kit-docguard}/skills/docguard-guard/SKILL.md +3 -3
  29. {docguard_cli-0.12.0/.agent → docguard_cli-0.13.0/extensions/spec-kit-docguard}/skills/docguard-review/SKILL.md +2 -2
  30. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/skills/docguard-score/SKILL.md +2 -2
  31. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/skills/docguard-sync/SKILL.md +1 -1
  32. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/package.json +1 -1
  33. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/pyproject.toml +1 -1
  34. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/commands/docguard.guard.md +2 -2
  35. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/changed-only.test.mjs +4 -1
  36. docguard_cli-0.13.0/tests/fix-memory.test.mjs +141 -0
  37. docguard_cli-0.13.0/tests/generated-staleness.test.mjs +97 -0
  38. docguard_cli-0.13.0/tests/shared-git.test.mjs +190 -0
  39. docguard_cli-0.13.0/tests/sync-since.test.mjs +99 -0
  40. docguard_cli-0.13.0/tests/trace-reverse.test.mjs +96 -0
  41. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/commands/speckit.analyze.md +0 -0
  42. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/commands/speckit.checklist.md +0 -0
  43. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/commands/speckit.clarify.md +0 -0
  44. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/commands/speckit.constitution.md +0 -0
  45. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/commands/speckit.implement.md +0 -0
  46. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/commands/speckit.plan.md +0 -0
  47. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/commands/speckit.specify.md +0 -0
  48. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/commands/speckit.tasks.md +0 -0
  49. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/commands/speckit.taskstoissues.md +0 -0
  50. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/skills/speckit-analyze/SKILL.md +0 -0
  51. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/skills/speckit-checklist/SKILL.md +0 -0
  52. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/skills/speckit-clarify/SKILL.md +0 -0
  53. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/skills/speckit-constitution/SKILL.md +0 -0
  54. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/skills/speckit-implement/SKILL.md +0 -0
  55. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/skills/speckit-plan/SKILL.md +0 -0
  56. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/skills/speckit-specify/SKILL.md +0 -0
  57. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/skills/speckit-tasks/SKILL.md +0 -0
  58. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.agent/skills/speckit-taskstoissues/SKILL.md +0 -0
  59. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.docguard.json +0 -0
  60. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.docguardignore +0 -0
  61. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  62. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  63. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.github/dependabot.yml +0 -0
  64. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.github/scripts/patch-catalog.py +0 -0
  65. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.github/workflows/ci.yml +0 -0
  66. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.github/workflows/release.yml +0 -0
  67. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.github/workflows/supply-chain.yml +0 -0
  68. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.github/workflows/sync-speckit-catalog.yml +0 -0
  69. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.gitignore +0 -0
  70. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.jules/bolt.md +0 -0
  71. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.jules/palette.md +0 -0
  72. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.jules/sentinel.md +0 -0
  73. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.npmignore +0 -0
  74. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.npmrc +0 -0
  75. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/extensions/.cache/catalog-ebf165086500aab1-metadata.json +0 -0
  76. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/extensions/.cache/catalog-ebf165086500aab1.json +0 -0
  77. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/extensions/.cache/catalog-metadata.json +0 -0
  78. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/extensions/.cache/catalog.json +0 -0
  79. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/init-options.json +0 -0
  80. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/memory/constitution.md +0 -0
  81. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/scripts/bash/check-prerequisites.sh +0 -0
  82. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/scripts/bash/common.sh +0 -0
  83. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/scripts/bash/create-new-feature.sh +0 -0
  84. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/scripts/bash/setup-plan.sh +0 -0
  85. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/scripts/bash/update-agent-context.sh +0 -0
  86. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/templates/agent-file-template.md +0 -0
  87. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/templates/checklist-template.md +0 -0
  88. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/templates/constitution-template.md +0 -0
  89. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/templates/plan-template.md +0 -0
  90. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/templates/spec-template.md +0 -0
  91. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/.specify/templates/tasks-template.md +0 -0
  92. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/CODE_OF_CONDUCT.md +0 -0
  93. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/COMPARISONS.md +0 -0
  94. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/CONTRIBUTING.md +0 -0
  95. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/DRIFT-LOG.md +0 -0
  96. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/LICENSE +0 -0
  97. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/PHILOSOPHY.md +0 -0
  98. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/ROADMAP.md +0 -0
  99. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/SECURITY.md +0 -0
  100. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/STANDARD.md +0 -0
  101. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/SUPPLY-CHAIN-AUDIT.md +0 -0
  102. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/SUPPORT.md +0 -0
  103. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/action.yml +0 -0
  104. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/agents.mjs +0 -0
  105. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/badge.mjs +0 -0
  106. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/ci.mjs +0 -0
  107. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/diagnose.mjs +0 -0
  108. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/diff.mjs +0 -0
  109. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/generate.mjs +0 -0
  110. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/hooks.mjs +0 -0
  111. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/init.mjs +0 -0
  112. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/llms.mjs +0 -0
  113. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/publish.mjs +0 -0
  114. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/score.mjs +0 -0
  115. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/setup.mjs +0 -0
  116. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/upgrade.mjs +0 -0
  117. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/commands/watch.mjs +0 -0
  118. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/ensure-skills.mjs +0 -0
  119. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/scanners/api-doc.mjs +0 -0
  120. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/scanners/cdk.mjs +0 -0
  121. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/scanners/doc-tools.mjs +0 -0
  122. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/scanners/frontend.mjs +0 -0
  123. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/scanners/iac.mjs +0 -0
  124. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/scanners/integrations.mjs +0 -0
  125. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/scanners/memory-plan.mjs +0 -0
  126. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/scanners/project-type.mjs +0 -0
  127. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/scanners/routes.mjs +0 -0
  128. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/scanners/schemas.mjs +0 -0
  129. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/scanners/speckit.mjs +0 -0
  130. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/shared-ignore.mjs +0 -0
  131. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/shared-source.mjs +0 -0
  132. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/shared.mjs +0 -0
  133. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/api-surface.mjs +0 -0
  134. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/architecture.mjs +0 -0
  135. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/changelog.mjs +0 -0
  136. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/doc-quality.mjs +0 -0
  137. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/docs-coverage.mjs +0 -0
  138. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/docs-diff.mjs +0 -0
  139. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/drift.mjs +0 -0
  140. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/environment.mjs +0 -0
  141. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/metadata-sync.mjs +0 -0
  142. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/metrics-consistency.mjs +0 -0
  143. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/schema-sync.mjs +0 -0
  144. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/security.mjs +0 -0
  145. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/structure.mjs +0 -0
  146. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/test-spec.mjs +0 -0
  147. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/todo-tracking.mjs +0 -0
  148. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/validators/traceability.mjs +0 -0
  149. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/writers/api-reference.mjs +0 -0
  150. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/cli/writers/sections.mjs +0 -0
  151. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/commands/docguard.fix.md +0 -0
  152. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/commands/docguard.review.md +0 -0
  153. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/commands/docguard.score.md +0 -0
  154. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/configs/fastify.json +0 -0
  155. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/configs/generic.json +0 -0
  156. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/configs/nextjs.json +0 -0
  157. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/configs/python.json +0 -0
  158. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/docguard_cli/__init__.py +0 -0
  159. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/docguard_cli/wrapper.py +0 -0
  160. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/docs/ai-integration.md +0 -0
  161. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/docs/commands.md +0 -0
  162. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/docs/configuration.md +0 -0
  163. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/docs/doc-sections.md +0 -0
  164. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/docs/faq.md +0 -0
  165. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/docs/installation.md +0 -0
  166. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/docs/profiles.md +0 -0
  167. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/docs-canonical/ARCHITECTURE.md +0 -0
  168. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/docs-canonical/DATA-MODEL.md +0 -0
  169. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/docs-canonical/ENVIRONMENT.md +0 -0
  170. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/docs-canonical/SECURITY.md +0 -0
  171. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/docs-canonical/TEST-SPEC.md +0 -0
  172. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/examples/01-express-api/README.md +0 -0
  173. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/examples/01-express-api/package.json +0 -0
  174. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/examples/01-express-api/server.js +0 -0
  175. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/examples/02-python-flask/README.md +0 -0
  176. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/examples/02-python-flask/app.py +0 -0
  177. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/examples/02-python-flask/docs-canonical/ARCHITECTURE.md +0 -0
  178. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/examples/02-python-flask/requirements.txt +0 -0
  179. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/examples/03-spec-kit-project/CHANGELOG.md +0 -0
  180. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/examples/03-spec-kit-project/README.md +0 -0
  181. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/examples/03-spec-kit-project/docs-canonical/ARCHITECTURE.md +0 -0
  182. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/examples/03-spec-kit-project/docs-canonical/TEST-SPEC.md +0 -0
  183. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/examples/03-spec-kit-project/package.json +0 -0
  184. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/examples/03-spec-kit-project/src/index.js +0 -0
  185. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/examples/03-spec-kit-project/tests/basic.test.js +0 -0
  186. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/examples/README.md +0 -0
  187. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/LICENSE +0 -0
  188. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/README.md +0 -0
  189. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/commands/diagnose.md +0 -0
  190. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/commands/fix.md +0 -0
  191. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/commands/generate.md +0 -0
  192. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/commands/init.md +0 -0
  193. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/commands/score.md +0 -0
  194. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/commands/sync.md +0 -0
  195. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/commands/trace.md +0 -0
  196. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/scripts/bash/common.sh +0 -0
  197. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/scripts/bash/docguard-check-docs.sh +0 -0
  198. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/scripts/bash/docguard-init-doc.sh +0 -0
  199. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/scripts/bash/docguard-suggest-fix.sh +0 -0
  200. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/templates/extensions.yml +0 -0
  201. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/templates/github-workflows/docguard-autofix.yml +0 -0
  202. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/extensions/spec-kit-docguard/templates/github-workflows/docguard-guard.yml +0 -0
  203. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/pr_description.md +0 -0
  204. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/specs/001-fix-ignore-validators/plan.md +0 -0
  205. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/specs/001-fix-ignore-validators/spec.md +0 -0
  206. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/specs/001-fix-ignore-validators/tasks.md +0 -0
  207. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/specs/002-fix-test-discovery/plan.md +0 -0
  208. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/specs/002-fix-test-discovery/spec.md +0 -0
  209. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/specs/002-fix-test-discovery/tasks.md +0 -0
  210. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/specs/003-v011-false-positives/plan.md +0 -0
  211. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/specs/003-v011-false-positives/spec.md +0 -0
  212. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/specs/003-v011-false-positives/tasks.md +0 -0
  213. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/ADR.md.template +0 -0
  214. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/AGENTS.md.template +0 -0
  215. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/ARCHITECTURE.md.template +0 -0
  216. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/CHANGELOG.md.template +0 -0
  217. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/CURRENT-STATE.md.template +0 -0
  218. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/DATA-MODEL.md.template +0 -0
  219. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/DEPLOYMENT.md.template +0 -0
  220. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/DRIFT-LOG.md.template +0 -0
  221. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/ENVIRONMENT.md.template +0 -0
  222. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/KNOWN-GOTCHAS.md.template +0 -0
  223. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/REQUIREMENTS.md.template +0 -0
  224. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/ROADMAP.md.template +0 -0
  225. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/RUNBOOKS.md.template +0 -0
  226. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/SECURITY.md.template +0 -0
  227. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/TEST-SPEC.md.template +0 -0
  228. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/TROUBLESHOOTING.md.template +0 -0
  229. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/VENDOR-BUGS.md.template +0 -0
  230. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/ci/github-actions.yml +0 -0
  231. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/commands/docguard.fix.md +0 -0
  232. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/commands/docguard.init.md +0 -0
  233. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/commands/docguard.review.md +0 -0
  234. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/templates/commands/docguard.update.md +0 -0
  235. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/test-draft.js +0 -0
  236. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/test-metrics.js +0 -0
  237. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/api-doc.test.mjs +0 -0
  238. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/api-surface.test.mjs +0 -0
  239. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/api-write.test.mjs +0 -0
  240. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/architecture.test.mjs +0 -0
  241. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/backup-failure.test.mjs +0 -0
  242. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/cdk-detection.test.mjs +0 -0
  243. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/changelog.test.mjs +0 -0
  244. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/commands.test.mjs +0 -0
  245. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/cross-reference.test.mjs +0 -0
  246. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/doc-quality.test.mjs +0 -0
  247. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/docguardignore.test.mjs +0 -0
  248. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/docs-coverage.test.mjs +0 -0
  249. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/docs-diff.test.mjs +0 -0
  250. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/docs-sync.test.mjs +0 -0
  251. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/drift.test.mjs +0 -0
  252. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/environment.test.mjs +0 -0
  253. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/freshness.test.mjs +0 -0
  254. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/frontend-deep.test.mjs +0 -0
  255. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/frontend.test.mjs +0 -0
  256. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/guard-classify.test.mjs +0 -0
  257. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/hooks.test.mjs +0 -0
  258. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/i18n.test.mjs +0 -0
  259. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/integrations.test.mjs +0 -0
  260. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/mechanical.test.mjs +0 -0
  261. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/memory-plan.test.mjs +0 -0
  262. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/metadata-sync.test.mjs +0 -0
  263. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/metrics-consistency.test.mjs +0 -0
  264. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/monorepo-scanning.test.mjs +0 -0
  265. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/multi-spec.test.mjs +0 -0
  266. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/patch-0.11.2.test.mjs +0 -0
  267. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/project-type.test.mjs +0 -0
  268. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/routes-multilang.test.mjs +0 -0
  269. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/schema-sync.test.mjs +0 -0
  270. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/schemas-multilang.test.mjs +0 -0
  271. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/schemas.test.mjs +0 -0
  272. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/sections.test.mjs +0 -0
  273. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/security.test.mjs +0 -0
  274. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/severity.test.mjs +0 -0
  275. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/shared-source.test.mjs +0 -0
  276. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/structure.test.mjs +0 -0
  277. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/sweep-nudge.test.mjs +0 -0
  278. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/sync.test.mjs +0 -0
  279. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/test-spec.test.mjs +0 -0
  280. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/todo-tracking.test.mjs +0 -0
  281. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/traceability.test.mjs +0 -0
  282. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/tests/upgrade.test.mjs +0 -0
  283. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/vscode-extension/.vscodeignore +0 -0
  284. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/vscode-extension/README.md +0 -0
  285. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/vscode-extension/extension.js +0 -0
  286. {docguard_cli-0.12.0 → docguard_cli-0.13.0}/vscode-extension/package.json +0 -0
@@ -6,10 +6,10 @@ description: AI-driven documentation repair with structured research workflow, t
6
6
  compatibility: Requires DocGuard CLI installed (npm i -g docguard-cli or npx docguard-cli)
7
7
  metadata:
8
8
  author: docguard
9
- version: 0.12.0
9
+ version: 0.13.0
10
10
  source: extensions/spec-kit-docguard/skills/docguard-fix
11
11
  ---
12
- <!-- docguard:version: 0.12.0 -->
12
+ <!-- docguard:version: 0.13.0 -->
13
13
 
14
14
  # DocGuard Fix Skill
15
15
 
@@ -7,10 +7,10 @@ description: Run DocGuard guard validation against Canonical-Driven Development
7
7
  compatibility: Requires DocGuard CLI installed (npm i -g docguard-cli or npx docguard-cli)
8
8
  metadata:
9
9
  author: docguard
10
- version: 0.12.0
10
+ version: 0.13.0
11
11
  source: extensions/spec-kit-docguard/skills/docguard-guard
12
12
  ---
13
- <!-- docguard:version: 0.12.0 -->
13
+ <!-- docguard:version: 0.13.0 -->
14
14
 
15
15
  # DocGuard Guard Skill
16
16
 
@@ -139,7 +139,7 @@ For each finding, provide a **specific, actionable fix** — not "fix the issue"
139
139
 
140
140
  Based on the triage results:
141
141
 
142
- - **If all PASS**: "All 21 validators passed. Project is CDD-compliant. Ready to commit."
142
+ - **If all PASS**: "All 22 validators passed. Project is CDD-compliant. Ready to commit."
143
143
  - **If only MEDIUM/LOW warnings**: "Non-blocking warnings found. Safe to commit, but consider running `/docguard.fix` for automated remediation."
144
144
  - **If HIGH or CRITICAL failures**: "Blocking issues found. Fix these before committing. Suggest running `/docguard.fix --doc [most impactful doc]` next."
145
145
 
@@ -6,10 +6,10 @@ description: Cross-document consistency analysis and quality assessment. Perform
6
6
  compatibility: Requires DocGuard CLI installed (npm i -g docguard-cli or npx docguard-cli)
7
7
  metadata:
8
8
  author: docguard
9
- version: 0.12.0
9
+ version: 0.13.0
10
10
  source: extensions/spec-kit-docguard/skills/docguard-review
11
11
  ---
12
- <!-- docguard:version: 0.12.0 -->
12
+ <!-- docguard:version: 0.13.0 -->
13
13
 
14
14
  # DocGuard Review Skill
15
15
 
@@ -6,10 +6,10 @@ description: CDD maturity assessment with category-aware improvement roadmap. Ru
6
6
  compatibility: Requires DocGuard CLI installed (npm i -g docguard-cli or npx docguard-cli)
7
7
  metadata:
8
8
  author: docguard
9
- version: 0.12.0
9
+ version: 0.13.0
10
10
  source: extensions/spec-kit-docguard/skills/docguard-score
11
11
  ---
12
- <!-- docguard:version: 0.12.0 -->
12
+ <!-- docguard:version: 0.13.0 -->
13
13
 
14
14
  # DocGuard Score Skill
15
15
 
@@ -4,7 +4,7 @@ description: Keep canonical documentation ALWAYS UP TO DATE. Refreshes code-trut
4
4
  compatibility: Requires DocGuard CLI installed (npm i -g docguard-cli or npx docguard-cli)
5
5
  metadata:
6
6
  author: docguard
7
- version: 0.12.0
7
+ version: 0.13.0
8
8
  source: extensions/spec-kit-docguard/skills/docguard-sync
9
9
  ---
10
10
 
@@ -41,7 +41,7 @@
41
41
  | Command | Purpose |
42
42
  |---------|---------|
43
43
  | `diagnose` | **Primary** — identify issues + generate AI fix prompts |
44
- | `guard` | Validate project (CI gate) — 21 validators |
44
+ | `guard` | Validate project (CI gate) — 22 validators |
45
45
  | `generate` | Reverse-engineer docs from code |
46
46
  | `fix --doc <name>` | AI prompt for specific document |
47
47
  | `score` | CDD maturity score (0-100) |
@@ -7,6 +7,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.13.0] - 2026-05-26
11
+
12
+ Feature release — full backlog cleanup. **Phase L** (sync intelligence: 3 features), **Phase M** (bigger validators: 2 features), **Phase N** (polish: 2 fixes), and a new `shared-git.mjs` module that gives every git-touching validator rename-aware history. **22 validators total** (was 21). 434 tests, +34 from v0.12.
13
+
14
+ ### Added
15
+
16
+ - **L-1 / S-1: `sync --since <ref>` surgical refresh.** `sync` now uses the git diff against the given ref to decide which code-truth doc sections actually need refreshing. Sections whose underlying source files weren't in the diff are explicitly skipped (with a `skipped` entry naming the section). When the diff contains no code files at all (e.g. PRs that touch only markdown), sync is a fast no-op. Saves wall-clock time on large monorepos.
17
+ - **L-2 / S-3: `trace --reverse <code-path>`.** Mirror of the forward trace — given a code file path, finds every canonical doc that references it. Three match strategies (direct path, basename, backticked module name) with a per-doc summary in text mode or full match list in JSON mode. Surfaces "is this file documented anywhere?" in one command.
18
+ - **L-3 / S-4: Rename detection via `git log --follow`.** New `cli/shared-git.mjs` module centralises every git-log call. All file-scoped queries now pass `--follow` so a `git mv` no longer resets the file's history. Freshness, Test-Spec, Traceability — anything that asks git "when was this file last touched?" — now answers correctly across renames.
19
+ - **M-1 / S-7: Generated-Doc Staleness validator** (22nd validator). New validator re-runs the memory-plan scanner and compares each `source=code` section's expected body against on-disk content. Flags sections where the doc and the scanner disagree — i.e. either code changed without `sync --write` running, or someone hand-edited a machine-owned section. Warning includes a "first drift at line N" hint that names the diff site.
20
+ - **M-2 / S-10: `.docguard/fixed.json` fix-history audit log.** Every mechanical fix `fix --write` applies is appended to a small JSON log under `.docguard/`. Entries are fingerprinted by `type+file+summary` and deduped (re-applying the same fix updates the timestamp instead of growing the file). Rolls over at 500 entries. New `docguard fix --history` command pretty-prints the log grouped by day. Also recorded: `appliedBy` (so K-1's `docguard-bot` auto-commits are distinguishable from human runs).
21
+ - **N-1: Per-file scoping of `--changed-only`.** The `--changed-only` lite mode now computes the actually-changed files (`git diff --name-only HEAD~1 HEAD`, configurable with `--since`) and passes them as `config.changedFiles` to validators that opt in. Docs-Sync is the first opt-in: routes and services outside the changed set are skipped entirely. On wu-whatsappinbox the Docs-Sync check count went from 101 → 21 in `--changed-only` mode.
22
+ - **N-2: 4 broken README anchors fixed** (caught by K-7's Cross-Reference validator). `[Commands](#-commands)` → `[Usage](#usage)`. `CONTRIBUTING.md` added to the validator's standard-docs lookup list (along with CODE_OF_CONDUCT.md, SECURITY.md, PHILOSOPHY.md, STANDARD.md, COMPARISONS.md) so cross-doc refs to those resolve.
23
+
24
+ ### Changed
25
+
26
+ - **22 validators total** (was 21). Auto-fix bumped 6 doc references from "21 validators" → "22 validators" during the version bump.
27
+ - **Trace command** (existing) now honors `--reverse` to switch to the new reverse mode; the forward mode is unchanged.
28
+ - **`docguard guard` JSON output** for `--format json` no longer prints the banner or `ensureSkills` line — same headless fix as v0.12, extended to `trace --reverse --format json` and other JSON-mode commands.
29
+
30
+ ### Internal
31
+
32
+ - **6 new test files**: `tests/shared-git.test.mjs` (11), `tests/sync-since.test.mjs` (3), `tests/trace-reverse.test.mjs` (5), `tests/generated-staleness.test.mjs` (4), `tests/fix-memory.test.mjs` (11), plus updates to `tests/changed-only.test.mjs`. **Total: 434 tests passing (was 400, +34 new).**
33
+ - **New modules**: `cli/shared-git.mjs` (centralized git plumbing with --follow), `cli/validators/generated-staleness.mjs` (M-1), `cli/writers/fix-memory.mjs` (M-2). New helpers exported from sync.mjs: section→file matcher table for surgical refresh.
34
+ - **Action / CLI dual-fix from v0.12** is now coordinated: K-1's auto-fix Action records to `.docguard/fixed.json` via `appliedBy: 'docguard-bot'`, giving teams a permanent record of which fixes the bot applied without diving into git history.
35
+ - **Dry-run on wu-whatsappinbox before push** (read-only): 670/674 PASS in 1.82s with all 22 validators. 4 warnings are stale "21 validators" references in wu's local docguard skill files — those auto-fix on the next `fix --write`.
36
+ - Bumped extension files via auto-fix (6 files: extension.yml + 5 SKILL.md).
37
+ - No new NPM dependencies. Still zero deps.
38
+
39
+ ### Out of scope (deferred to v0.14)
40
+
41
+ - **Fix-history suppression**: M-2 currently records but doesn't suppress. v0.14 will let `fix --write` skip fixes that were applied + reverted (avoiding ping-pong loops).
42
+ - **More validators opt-into `config.changedFiles`**: N-1 only wires Docs-Sync. Environment and API-Surface could also benefit from path-level scoping.
43
+ - **`generate-staleness` per-section auto-fix**: M-1 only warns; a future enhancement could emit structured fixes that `sync --write` consumes.
44
+ - **`docguard upgrade --apply` for cross-machine teams**: currently in-place; could grow a "team-wide" mode that opens a PR.
45
+
10
46
  ## [0.12.0] - 2026-05-26
11
47
 
12
48
  Feature release — Phase K (7 features). Schema bump to **0.5**. Adds the
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: docguard-cli
3
- Version: 0.12.0
3
+ Version: 0.13.0
4
4
  Summary: The enforcement tool for Canonical-Driven Development (CDD). Audit, generate, and guard your project documentation. Zero dependencies.
5
5
  Project-URL: Homepage, https://github.com/raccioly/docguard
6
6
  Project-URL: Documentation, https://github.com/raccioly/docguard#readme
@@ -41,7 +41,7 @@ Description-Content-Type: text/markdown
41
41
  - [What is DocGuard?](#what-is-docguard)
42
42
  - [Quick Start](#-quick-start)
43
43
  - [Spec Kit Integration](#-spec-kit-integration)
44
- - [Commands](#-commands)
44
+ - [Usage](#usage)
45
45
  - [Validators](#-validators)
46
46
  - [Templates](#-templates)
47
47
  - [AI Agent Support](#-ai-agent-support)
@@ -367,7 +367,7 @@ DocGuard provides AI agent slash commands for integrated workflows. Installed au
367
367
 
368
368
  | Command | What It Does |
369
369
  |:--------|:-------------|
370
- | `/docguard.guard` | Run quality validation — check all 21 validators |
370
+ | `/docguard.guard` | Run quality validation — check all 22 validators |
371
371
  | `/docguard.review` | Analyze doc quality and suggest improvements |
372
372
  | `/docguard.fix` | Generate targeted fix prompts for specific issues |
373
373
  | `/docguard.score` | Show CDD maturity score with category breakdown |
@@ -17,7 +17,7 @@
17
17
  - [What is DocGuard?](#what-is-docguard)
18
18
  - [Quick Start](#-quick-start)
19
19
  - [Spec Kit Integration](#-spec-kit-integration)
20
- - [Commands](#-commands)
20
+ - [Usage](#usage)
21
21
  - [Validators](#-validators)
22
22
  - [Templates](#-templates)
23
23
  - [AI Agent Support](#-ai-agent-support)
@@ -343,7 +343,7 @@ DocGuard provides AI agent slash commands for integrated workflows. Installed au
343
343
 
344
344
  | Command | What It Does |
345
345
  |:--------|:-------------|
346
- | `/docguard.guard` | Run quality validation — check all 21 validators |
346
+ | `/docguard.guard` | Run quality validation — check all 22 validators |
347
347
  | `/docguard.review` | Analyze doc quality and suggest improvements |
348
348
  | `/docguard.fix` | Generate targeted fix prompts for specific issues |
349
349
  | `/docguard.score` | Show CDD maturity score with category breakdown |
@@ -21,6 +21,7 @@ import { c } from '../shared.mjs';
21
21
  import { computeApiSurfaceDrift } from '../validators/api-surface.mjs';
22
22
  import { removeEndpoints, hasGeneratedMarker } from '../writers/api-reference.mjs';
23
23
  import { applyMechanicalFixes } from '../writers/mechanical.mjs';
24
+ import { loadFixMemory } from '../writers/fix-memory.mjs';
24
25
  import { runGuardInternal } from './guard.mjs';
25
26
 
26
27
  const API_DOC = 'docs-canonical/API-REFERENCE.md';
@@ -281,6 +282,55 @@ export function applyAllMechanicalFixes(projectDir, config, { force = false } =
281
282
  return { applied, skipped, total: fixes.length };
282
283
  }
283
284
 
285
+ /**
286
+ * M-2 — `docguard fix --history` shows the audit log of mechanical fixes
287
+ * that have been applied to this project. Reads `.docguard/fixed.json`
288
+ * and pretty-prints (or emits JSON when --format json).
289
+ */
290
+ function runHistoryMode(projectDir, flags) {
291
+ const mem = loadFixMemory(projectDir);
292
+ const isJson = flags.format === 'json';
293
+
294
+ if (isJson) {
295
+ console.log(JSON.stringify(mem, null, 2));
296
+ return;
297
+ }
298
+
299
+ if (mem.entries.length === 0) {
300
+ console.log(`${c.bold}🗂 DocGuard Fix History${c.reset}`);
301
+ console.log(`${c.dim} No fixes recorded yet. Run \`docguard fix --write\` to start the audit log.${c.reset}`);
302
+ return;
303
+ }
304
+
305
+ console.log(`${c.bold}🗂 DocGuard Fix History${c.reset} ${c.dim}(${mem.entries.length} entries, newest first)${c.reset}\n`);
306
+
307
+ // Group by date for readability
308
+ const byDate = new Map();
309
+ for (const e of mem.entries) {
310
+ const day = (e.appliedAt || '').slice(0, 10);
311
+ if (!byDate.has(day)) byDate.set(day, []);
312
+ byDate.get(day).push(e);
313
+ }
314
+
315
+ // Show the most recent N days (cap output at 20 entries)
316
+ let printed = 0;
317
+ for (const [day, dayEntries] of byDate) {
318
+ if (printed >= 20) break;
319
+ console.log(` ${c.cyan}${day}${c.reset} ${c.dim}(${dayEntries.length} fix${dayEntries.length > 1 ? 'es' : ''})${c.reset}`);
320
+ for (const e of dayEntries.slice(0, 5)) {
321
+ if (printed >= 20) break;
322
+ const time = (e.appliedAt || '').slice(11, 16);
323
+ console.log(` ${c.dim}${time}${c.reset} ${e.type} → ${c.cyan}${e.file}${c.reset} ${c.dim}${e.summary || ''}${c.reset}`);
324
+ printed++;
325
+ }
326
+ if (dayEntries.length > 5) console.log(` ${c.dim}... ${dayEntries.length - 5} more on this day${c.reset}`);
327
+ }
328
+
329
+ if (mem.entries.length > 20) {
330
+ console.log(`\n ${c.dim}... ${mem.entries.length - 20} older entries. Use ${c.cyan}--format json${c.dim} for the full log.${c.reset}`);
331
+ }
332
+ }
333
+
284
334
  function runWriteMode(projectDir, config, flags) {
285
335
  const isJson = flags.format === 'json';
286
336
  const { applied, skipped, total } = applyAllMechanicalFixes(projectDir, config, { force: flags.force });
@@ -321,6 +371,11 @@ export function runFix(projectDir, config, flags) {
321
371
  const autoFix = flags.auto || false;
322
372
  const specificDoc = flags.doc || null;
323
373
 
374
+ // M-2: --history shows the audit trail of past mechanical fixes.
375
+ if (flags.history) {
376
+ return runHistoryMode(projectDir, flags);
377
+ }
378
+
324
379
  // --write: deterministically APPLY mechanical fixes (no LLM). Currently:
325
380
  // remove API-REFERENCE.md endpoints the OpenAPI spec confirms no longer exist.
326
381
  if (flags.write) {
@@ -10,6 +10,7 @@
10
10
  import { c, resolveSeverity } from '../shared.mjs';
11
11
  import { detectAgentMode, isSpecKitInitialized } from '../ensure-skills.mjs';
12
12
  import { checkUpgradeStatus } from './upgrade.mjs';
13
+ import { changedFilesSince, isGitRepo } from '../shared-git.mjs';
13
14
  import { validateStructure, validateDocSections } from '../validators/structure.mjs';
14
15
  import { validateDrift } from '../validators/drift.mjs';
15
16
  import { validateChangelog } from '../validators/changelog.mjs';
@@ -27,6 +28,7 @@ import { validateMetricsConsistency } from '../validators/metrics-consistency.mj
27
28
  import { validateDocsCoverage } from '../validators/docs-coverage.mjs';
28
29
  import { validateDocQuality } from '../validators/doc-quality.mjs';
29
30
  import { validateCrossReferences } from '../validators/cross-reference.mjs';
31
+ import { validateGeneratedStaleness } from '../validators/generated-staleness.mjs';
30
32
  import { validateTodoTracking } from '../validators/todo-tracking.mjs';
31
33
  import { validateSchemaSync } from '../validators/schema-sync.mjs';
32
34
  import { validateSpecKitIntegration } from '../scanners/speckit.mjs';
@@ -103,6 +105,7 @@ export function runGuardInternal(projectDir, config) {
103
105
  { key: 'schemaSync', name: 'Schema-Sync', fn: () => validateSchemaSync(projectDir, config) },
104
106
  { key: 'specKit', name: 'Spec-Kit', fn: () => validateSpecKitIntegration(projectDir, config) },
105
107
  { key: 'crossReference', name: 'Cross-Reference', fn: () => validateCrossReferences(projectDir, config) },
108
+ { key: 'generatedStaleness', name: 'Generated-Staleness', fn: () => validateGeneratedStaleness(projectDir, config) },
106
109
  // Metrics-Consistency runs post-loop (needs guard results)
107
110
  ];
108
111
 
@@ -197,7 +200,7 @@ function liteValidatorsConfig() {
197
200
  'structure', 'docsSync', 'drift', 'changelog', 'testSpec', 'environment',
198
201
  'security', 'architecture', 'freshness', 'traceability', 'docsDiff',
199
202
  'apiSurface', 'metadataSync', 'docsCoverage', 'docQuality', 'todoTracking',
200
- 'schemaSync', 'specKit', 'crossReference', 'metricsConsistency',
203
+ 'schemaSync', 'specKit', 'crossReference', 'generatedStaleness', 'metricsConsistency',
201
204
  ];
202
205
  const out = {};
203
206
  for (const k of all) out[k] = CHANGED_ONLY_VALIDATORS.includes(k);
@@ -212,8 +215,22 @@ export function runGuard(projectDir, config, flags) {
212
215
  // fast subset (Docs-Sync, Environment, API-Surface). Designed for husky/
213
216
  // lefthook hooks; expects to finish in under 2 seconds.
214
217
  if (flags.changedOnly) {
215
- config = { ...config, validators: liteValidatorsConfig() };
216
- console.log(`${c.cyan}⚡ docguard guard --changed-only${c.reset} ${c.dim}(running ${CHANGED_ONLY_VALIDATORS.length} fast validators only pre-commit lite mode)${c.reset}\n`);
218
+ // Compute the set of changed files since the given ref (default HEAD~1 —
219
+ // the pre-commit common case: "files changed in this commit vs the last
220
+ // committed state"). Validators that opt into `config.changedFiles` can
221
+ // scope to this list; others run normally over the whole tree.
222
+ const ref = flags.since || 'HEAD~1';
223
+ const changed = isGitRepo(projectDir) ? changedFilesSince(projectDir, ref) : [];
224
+ config = {
225
+ ...config,
226
+ validators: liteValidatorsConfig(),
227
+ changedFiles: changed,
228
+ changedSinceRef: ref,
229
+ };
230
+ const label = changed.length > 0
231
+ ? `${changed.length} file(s) changed since ${ref}`
232
+ : `no changes since ${ref} — running all ${CHANGED_ONLY_VALIDATORS.length} lite validators on full tree`;
233
+ console.log(`${c.cyan}⚡ docguard guard --changed-only${c.reset} ${c.dim}(${label})${c.reset}\n`);
217
234
  }
218
235
 
219
236
  const data = runGuardInternal(projectDir, config);
@@ -34,6 +34,48 @@ function gitChangedFiles(projectDir, since) {
34
34
  return [...new Set([...committed, ...working])];
35
35
  }
36
36
 
37
+ /**
38
+ * L-1: Map each `source: 'code'` section ID to a predicate that returns true
39
+ * when one of the changed file paths could plausibly affect it. Conservative
40
+ * by design — when in doubt we run the section's sync, never skip it.
41
+ *
42
+ * The predicates are matched against project-relative POSIX paths (the form
43
+ * `git diff --name-only` returns).
44
+ */
45
+ const SECTION_FILE_MATCHERS = {
46
+ 'tech-stack': (p) => /package\.json$|pyproject\.toml$|Cargo\.toml$|go\.mod$|pom\.xml$|Gemfile$/.test(p),
47
+ 'frontend-modules': (p) => /(^|\/)(src\/)?(stores|hooks|contexts|features)\//.test(p),
48
+ 'endpoints-table': (p) => /(^|\/)(routes|controllers|handlers|app\/api)\//.test(p)
49
+ || /\.(yaml|yml|json)$/i.test(p) && /openapi|swagger/i.test(p),
50
+ 'entities-table': (p) => /(^|\/)(models|schemas|entities)\//.test(p)
51
+ || /\.prisma$/.test(p),
52
+ 'relationships': (p) => /(^|\/)(models|schemas|entities)\//.test(p)
53
+ || /\.prisma$/.test(p),
54
+ 'screens-table': (p) => /(^|\/)(screens|pages|app)\//.test(p)
55
+ || /\.(tsx|jsx)$/.test(p),
56
+ 'flows': (p) => /(^|\/)(screens|pages|app|routes)\//.test(p),
57
+ 'integrations-table':(p) => /package\.json$|pyproject\.toml$|requirements.*\.txt$|Cargo\.toml$/.test(p),
58
+ 'features-table': (p) => /(^|\/)(features|domains)\//.test(p),
59
+ 'features': (p) => /(^|\/)(features|domains)\//.test(p),
60
+ 'env-vars-table': (p) => /\.env(\..+)?$|(^|\/)config\//.test(p)
61
+ || /\.(ts|tsx|js|jsx|mjs|py|go|rs|java|kt|rb)$/.test(p), // any code may use env
62
+ 'setup': (p) => /\.env(\..+)?$|(^|\/)config\//.test(p),
63
+ };
64
+
65
+ /**
66
+ * Decide whether a given code-truth section should be re-synced based on the
67
+ * set of changed files. Returns true when:
68
+ * - changedFiles is null/empty (no scope info → sync everything), OR
69
+ * - any changed file matches the section's known source patterns, OR
70
+ * - the section has no matcher registered (unknown → conservative: sync)
71
+ */
72
+ function sectionTouchedByChanges(sectionId, changedFiles) {
73
+ if (!changedFiles || changedFiles.length === 0) return true;
74
+ const matcher = SECTION_FILE_MATCHERS[sectionId];
75
+ if (!matcher) return true; // unknown section → don't accidentally skip it
76
+ return changedFiles.some(matcher);
77
+ }
78
+
37
79
  export function runSync(projectDir, config, flags) {
38
80
  const plan = buildMemoryPlan(projectDir, config);
39
81
  const apply = !!flags.write;
@@ -63,6 +105,14 @@ export function runSync(projectDir, config, flags) {
63
105
  const existing = getSection(content, sec.id);
64
106
  if (!existing) continue; // sync refreshes sections that already exist
65
107
  if (existing.body.trim() === String(sec.body).trim()) continue; // already current
108
+ // L-1: when --since is provided, only update sections whose underlying
109
+ // source files appear in the changed set. Avoids spurious updates when
110
+ // the section's CONTENT would naturally drift (e.g. timestamp-driven
111
+ // counters) but no real source file changed.
112
+ if (changed !== null && !sectionTouchedByChanges(sec.id, changed)) {
113
+ skipped.push({ doc: doc.path, reason: `section ${sec.id} unchanged since ${flags.since} (no underlying source files in diff)` });
114
+ continue;
115
+ }
66
116
  codeSectionChanged = true;
67
117
  updates.push({ doc: doc.path, section: sec.id, status: apply ? 'updated' : 'stale' });
68
118
  if (apply) { content = replaceSection(content, sec.id, sec.body).content; docChanged = true; }
@@ -84,7 +84,112 @@ const TRACE_MAP = {
84
84
  },
85
85
  };
86
86
 
87
+ /**
88
+ * L-2 / S-3 — Reverse trace: given a code file, find which canonical doc
89
+ * sections mention it. Mirror of the forward trace (doc → code).
90
+ *
91
+ * Match strategies (each yields a hit):
92
+ * 1. Direct path match: full project-relative path appears in doc text.
93
+ * 2. Basename match: e.g. `users.ts` appears (covers cases where the doc
94
+ * refers to the file by name without the full path).
95
+ * 3. Module name match: file stem (e.g. `users`) appears as a fenced
96
+ * `code` reference. Tighter than 2 — avoids matching common nouns.
97
+ *
98
+ * Output: one line per (doc, match-line) pair, with the surrounding context.
99
+ */
100
+ export function runTraceReverse(projectDir, config, flags) {
101
+ const target = flags.args && flags.args[0];
102
+ if (!target) {
103
+ console.error(`${c.red}Error: trace --reverse requires a target path${c.reset}`);
104
+ console.log(`Usage: ${c.cyan}docguard trace --reverse <code-path>${c.reset}`);
105
+ console.log(`Example: ${c.cyan}docguard trace --reverse src/routes/users.ts${c.reset}`);
106
+ process.exit(1);
107
+ }
108
+
109
+ // Suppress chrome in JSON mode so stdout stays parseable.
110
+ const isJson = flags.format === 'json';
111
+ if (!isJson) {
112
+ console.log(`${c.bold}🔄 DocGuard Trace (reverse) — ${target}${c.reset}`);
113
+ console.log(`${c.dim} Finding canonical doc sections that reference this file...${c.reset}\n`);
114
+ }
115
+
116
+ const docsDir = resolve(projectDir, 'docs-canonical');
117
+ if (!existsSync(docsDir)) {
118
+ if (isJson) {
119
+ console.log(JSON.stringify({ target, matches: [], error: 'no docs-canonical/ directory' }, null, 2));
120
+ } else {
121
+ console.log(` ${c.yellow}No docs-canonical/ directory found.${c.reset}`);
122
+ }
123
+ return;
124
+ }
125
+
126
+ // Normalize the target path: strip leading ./
127
+ const normalized = target.replace(/^\.\//, '');
128
+ const base = basename(normalized);
129
+ const stem = base.replace(/\.[^.]+$/, '');
130
+
131
+ const matches = []; // { doc, line, content, kind }
132
+ for (const f of readdirSync(docsDir)) {
133
+ if (!f.endsWith('.md')) continue;
134
+ const docPath = resolve(docsDir, f);
135
+ let content;
136
+ try { content = readFileSync(docPath, 'utf-8'); } catch { continue; }
137
+ const lines = content.split('\n');
138
+ for (let i = 0; i < lines.length; i++) {
139
+ const line = lines[i];
140
+ let kind = null;
141
+ if (line.includes(normalized)) kind = 'path';
142
+ else if (line.includes(base)) kind = 'basename';
143
+ else if (new RegExp(`\`${escapeRegex(stem)}\``).test(line)) kind = 'module';
144
+ if (kind) {
145
+ matches.push({ doc: f, line: i + 1, content: line.trim(), kind });
146
+ }
147
+ }
148
+ }
149
+
150
+ if (flags.format === 'json') {
151
+ console.log(JSON.stringify({
152
+ target: normalized,
153
+ matches,
154
+ timestamp: new Date().toISOString(),
155
+ }, null, 2));
156
+ return;
157
+ }
158
+
159
+ if (matches.length === 0) {
160
+ console.log(` ${c.yellow}⚠️ No canonical doc references "${normalized}"${c.reset}`);
161
+ console.log(` ${c.dim}Consider documenting this file in docs-canonical/ARCHITECTURE.md or DATA-MODEL.md${c.reset}`);
162
+ return;
163
+ }
164
+
165
+ // Group by doc for readable output
166
+ const byDoc = new Map();
167
+ for (const m of matches) {
168
+ if (!byDoc.has(m.doc)) byDoc.set(m.doc, []);
169
+ byDoc.get(m.doc).push(m);
170
+ }
171
+
172
+ console.log(` ${c.green}✅ ${matches.length} reference(s) across ${byDoc.size} doc(s):${c.reset}\n`);
173
+ for (const [doc, hits] of byDoc) {
174
+ console.log(` ${c.cyan}${doc}${c.reset} ${c.dim}(${hits.length} hit${hits.length > 1 ? 's' : ''})${c.reset}`);
175
+ for (const h of hits.slice(0, 5)) {
176
+ const trimmed = h.content.length > 80 ? h.content.slice(0, 77) + '…' : h.content;
177
+ console.log(` ${c.dim}L${h.line} [${h.kind}]${c.reset} ${trimmed}`);
178
+ }
179
+ if (hits.length > 5) console.log(` ${c.dim}... ${hits.length - 5} more${c.reset}`);
180
+ }
181
+ }
182
+
183
+ function escapeRegex(s) {
184
+ return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
185
+ }
186
+
87
187
  export function runTrace(projectDir, config, flags) {
188
+ // L-2: dispatch to reverse mode when --reverse is set.
189
+ if (flags.reverse) {
190
+ return runTraceReverse(projectDir, config, flags);
191
+ }
192
+
88
193
  console.log(`${c.bold}🔗 DocGuard Trace — ${config.projectName}${c.reset}`);
89
194
  console.log(`${c.dim} Directory: ${projectDir}${c.reset}`);
90
195
  console.log(`${c.dim} Generating requirements traceability matrix...${c.reset}\n`);
@@ -381,6 +381,15 @@ async function main() {
381
381
  flags.apply = true;
382
382
  } else if (args[i] === '--changed-only') {
383
383
  flags.changedOnly = true;
384
+ } else if (args[i] === '--reverse') {
385
+ flags.reverse = true;
386
+ } else if (args[i] === '--history') {
387
+ flags.history = true;
388
+ } else if (!args[i].startsWith('--') && i > 0) {
389
+ // Positional args go into flags.args for commands that take them (e.g.
390
+ // `docguard trace --reverse <path>`). Skip the command itself (i === 0).
391
+ flags.args = flags.args || [];
392
+ flags.args.push(args[i]);
384
393
  } else if (args[i] === '--doc' && args[i + 1]) {
385
394
  flags.doc = args[i + 1];
386
395
  i++;
Binary file
@@ -183,7 +183,15 @@ function collectCanonicalDocs(projectDir) {
183
183
  }
184
184
  } catch {}
185
185
  }
186
- for (const f of ['AGENTS.md', 'CHANGELOG.md', 'DRIFT-LOG.md', 'ROADMAP.md', 'README.md']) {
186
+ // Standard root-level docs that are commonly cross-referenced. We index
187
+ // them so links like [CONTRIBUTING.md](CONTRIBUTING.md#some-section) can
188
+ // resolve. The list is conservative — adding everything would pull in
189
+ // boilerplate (LICENSE, NOTICE) that doesn't have meaningful headings.
190
+ for (const f of [
191
+ 'README.md', 'AGENTS.md', 'CHANGELOG.md', 'DRIFT-LOG.md', 'ROADMAP.md',
192
+ 'CONTRIBUTING.md', 'CODE_OF_CONDUCT.md', 'SECURITY.md',
193
+ 'PHILOSOPHY.md', 'STANDARD.md', 'COMPARISONS.md',
194
+ ]) {
187
195
  const p = resolve(projectDir, f);
188
196
  if (existsSync(p)) docs.push(p);
189
197
  }
@@ -80,6 +80,17 @@ export function validateDocsSync(projectDir, config) {
80
80
  return results; // No canonical docs to check against
81
81
  }
82
82
 
83
+ // N-1: When the guard runs in --changed-only mode, config.changedFiles is
84
+ // populated with paths that changed since the given ref. We use it to scope
85
+ // route/service checks to ONLY the files actually changed — turning a
86
+ // whole-tree scan into a surgical check. If the list is empty (no changes,
87
+ // or git unavailable), we fall back to scanning everything.
88
+ const changedSet = config && Array.isArray(config.changedFiles) && config.changedFiles.length > 0
89
+ ? new Set(config.changedFiles)
90
+ : null;
91
+ // Closure: true if the given relative path should be considered.
92
+ const inScope = (relPath) => !changedSet || changedSet.has(relPath);
93
+
83
94
  // Find route/API files (monorepo-aware) and check they're mentioned in docs.
84
95
  // Note: bare 'api' is intentionally excluded — it collides with frontend
85
96
  // API client conventions (src/api/client.ts). Backend routes use
@@ -95,6 +106,8 @@ export function validateDocsSync(projectDir, config) {
95
106
  const relPath = file.replace(projectDir + '/', '');
96
107
  if (isTestFile(relPath)) continue;
97
108
  if (!isValidRouteFile(relPath)) continue;
109
+ // N-1: skip files outside the --changed-only scope.
110
+ if (!inScope(relPath)) continue;
98
111
 
99
112
  results.total++;
100
113
  const name = basename(file, ext);
@@ -118,6 +131,8 @@ export function validateDocsSync(projectDir, config) {
118
131
 
119
132
  const relPath = file.replace(projectDir + '/', '');
120
133
  if (isTestFile(relPath)) continue;
134
+ // N-1: skip files outside the --changed-only scope.
135
+ if (!inScope(relPath)) continue;
121
136
 
122
137
  results.total++;
123
138
  const name = basename(file, ext);
@@ -9,6 +9,7 @@
9
9
  import { existsSync, readdirSync, statSync } from 'node:fs';
10
10
  import { resolve, join, extname } from 'node:path';
11
11
  import { execSync, execFileSync } from 'node:child_process';
12
+ import { getLastCommitDate } from '../shared-git.mjs';
12
13
 
13
14
  const IGNORE_DIRS = new Set([
14
15
  'node_modules', '.git', '.next', 'dist', 'build',
@@ -21,16 +22,10 @@ const IGNORE_DIRS = new Set([
21
22
  * Returns null if the file isn't tracked or git isn't available.
22
23
  */
23
24
  function getLastGitDate(filePath, dir) {
24
- try {
25
- const result = execFileSync(
26
- 'git',
27
- ['log', '-1', '--format=%aI', '--', filePath],
28
- { cwd: dir, encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] }
29
- ).trim();
30
- return result ? new Date(result) : null;
31
- } catch {
32
- return null;
33
- }
25
+ // Delegate to shared-git so rename history (--follow) is preserved.
26
+ // Without --follow, a `git mv` resets the file's "last commit date" and
27
+ // the Freshness counter silently misses drift introduced by the rename.
28
+ return getLastCommitDate(dir, filePath);
34
29
  }
35
30
 
36
31
  /**