@amsterdamdatalabs/adl-agent-control-linux-x64 0.1.37 → 0.1.47

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 (249) hide show
  1. package/bin/adl +2 -2
  2. package/bin/reconcile +10 -13
  3. package/bin/setup +15 -15
  4. package/package.json +1 -1
  5. package/packages/agent-hooks/package.json +1 -1
  6. package/packages/agent-hooks/src/main.ts +23 -2
  7. package/packages/agent-hooks/src/rules/impl/adl-mcp-cli.ts +12 -8
  8. package/packages/agent-hooks/src/rules/impl/adl-run-required.ts +11 -5
  9. package/packages/agent-hooks/src/rules/impl/adl-workitem-role.ts +18 -5
  10. package/packages/agent-hooks/src/rules/impl/agent-tamper-protection.ts +30 -26
  11. package/packages/agent-hooks/src/rules/impl/git-branch.ts +1 -1
  12. package/packages/agent-hooks/src/rules/impl/git-target.ts +5 -0
  13. package/packages/agent-hooks/src/rules/impl/mcp-tool.ts +3 -1
  14. package/packages/agent-hooks/src/rules/impl/tool-frontend.ts +230 -11
  15. package/packages/agent-hooks/src/rules/shell/git-identity.ts +1 -1
  16. package/packages/agent-hooks/src/rules/shell/invocation.ts +14 -2
  17. package/packages/agent-hooks/src/rules/shell/protected-carriers.ts +10 -11
  18. package/packages/agent-settings/assets/TARUN-GLOBAL-AGENTS-INSTRUCTIONS.md +2 -2
  19. package/packages/agent-settings/package.json +1 -1
  20. package/packages/agent-settings/src/deploy/agents-deploy.ts +19 -1
  21. package/packages/agent-settings/src/deploy/index.ts +1 -0
  22. package/packages/agent-skills/assets/agent-search-tool-audit/SKILL.md +4 -6
  23. package/packages/agent-skills/assets/finalize-feature/SKILL.md +3 -3
  24. package/packages/agent-skills/assets/implement-feature/SKILL.md +17 -20
  25. package/packages/agent-skills/assets/implement-feature/references/briefs.md +3 -3
  26. package/packages/agent-skills/assets/implement-item/SKILL.md +3 -3
  27. package/packages/agent-skills/assets/mechanics/SKILL.md +1 -1
  28. package/packages/agent-skills/assets/plan-feature/SKILL.md +10 -10
  29. package/packages/agent-skills/assets/prepare-promotion/SKILL.md +3 -4
  30. package/packages/agent-skills/assets/report-bug/SKILL.md +2 -2
  31. package/packages/agent-skills/assets/review-change/SKILL.md +3 -3
  32. package/packages/agent-skills/assets/review-plan/SKILL.md +4 -4
  33. package/packages/agent-skills/assets/triage-workitems/SKILL.md +4 -4
  34. package/packages/agent-skills/assets/validate-design/SKILL.md +6 -12
  35. package/packages/agent-skills/assets/verify-item/SKILL.md +5 -5
  36. package/packages/agent-skills/assets/wayfinder/SKILL.md +1 -1
  37. package/packages/agent-skills/assets/workitems-process/SKILL.md +19 -21
  38. package/packages/agent-skills/assets/workitems-process/references/ado-and-git.md +36 -3
  39. package/packages/agent-skills/assets/workitems-process/references/evidence.md +4 -4
  40. package/packages/agent-skills/assets/write-feature/SKILL.md +15 -18
  41. package/packages/agent-skills/dist/deploy.d.ts +45 -0
  42. package/packages/agent-skills/dist/deploy.d.ts.map +1 -1
  43. package/packages/agent-skills/dist/deploy.js +167 -3
  44. package/packages/agent-skills/dist/deploy.js.map +1 -1
  45. package/packages/agent-skills/dist/index.d.ts +1 -1
  46. package/packages/agent-skills/dist/index.d.ts.map +1 -1
  47. package/packages/agent-skills/dist/index.js +1 -1
  48. package/packages/agent-skills/dist/index.js.map +1 -1
  49. package/packages/agent-skills/package.json +1 -1
  50. package/packages/agent-skills/src/deploy.ts +241 -3
  51. package/packages/agent-skills/src/index.ts +10 -1
  52. package/packages/azdo/README.md +13 -4
  53. package/packages/azdo/bunfig.toml +6 -0
  54. package/packages/azdo/package.json +1 -1
  55. package/packages/azdo/src/azdo-attachments.ts +2 -1
  56. package/packages/azdo/src/azdo-pr.ts +182 -6
  57. package/packages/azdo/src/azdo-wit.ts +290 -41
  58. package/packages/azdo/src/cli.ts +79 -12
  59. package/packages/azdo/src/lib/client.ts +88 -16
  60. package/packages/azdo/src/mcp-server.ts +75 -10
  61. package/packages/azdo/src/tool-dispatch.ts +61 -26
  62. package/packages/fleet/src/install-adl-package.ts +4 -3
  63. package/packages/repo-controls/assets/promote.ts +1 -0
  64. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-untyped/docs/research/no-type.md +1 -1
  65. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-untyped/docs/research/typed-experiment.md +1 -1
  66. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-untyped/docs/research/typed-research.md +1 -1
  67. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/extra-key.md +1 -1
  68. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/extra-keys.md +1 -1
  69. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/missing-created.md +1 -1
  70. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/missing-description.md +1 -1
  71. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/missing-last-update.md +1 -1
  72. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/missing-status.md +1 -1
  73. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/missing-title.md +1 -1
  74. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/optional-keys.md +1 -1
  75. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/research-ok.md +1 -1
  76. package/packages/repo-controls/package.json +1 -1
  77. package/packages/repo-controls/src/config.ts +21 -2
  78. package/packages/repo-controls/src/doctor.ts +9 -14
  79. package/packages/repo-controls/src/findings-ratchet.ts +12 -0
  80. package/packages/repo-controls/src/hook.ts +61 -4
  81. package/bin/lean-ctx-observe-strip +0 -434
  82. package/bin/lib/lean-ctx-observe-hooks.sh +0 -634
  83. package/bin/update-azure-agent-pool +0 -29
  84. package/packages/agent-hooks/src/hooks/lean-ctx/handler.ts +0 -22
  85. package/packages/agent-hooks/src/hooks/lean-ctx/index.ts +0 -173
  86. package/packages/agent-hooks/src/hooks/lean-ctx/mapping.ts +0 -121
  87. package/packages/agent-hooks/src/hooks/lean-ctx/scope-rewrite.ts +0 -207
  88. package/packages/agent-hooks/src/lean-ctx/env.ts +0 -123
  89. package/packages/agent-hooks/src/lean-ctx/mcp.ts +0 -142
  90. package/packages/agent-hooks/src/rules/impl/adl-build-run-denied.ts +0 -51
  91. package/packages/agent-hooks/src/rules/impl/adl-session-required.ts +0 -403
  92. package/packages/agent-hooks/src/rules/impl/tool-lean-ctx-global.ts +0 -594
  93. package/packages/agent-settings/assets/GLOBAL-AGENTS.md +0 -112
  94. package/packages/agent-settings/assets/lean-ctx/config.toml +0 -42
  95. package/packages/agent-settings/assets/lean-ctx/gitignore +0 -10
  96. package/packages/agent-settings/assets/lean-ctx/layout.toml +0 -7
  97. package/packages/agent-settings/src/deploy/lean-ctx-deploy.ts +0 -230
  98. package/packages/agent-settings/src/deploy/lean-ctx-merge.ts +0 -580
  99. package/packages/agent-skills/assets/adl-mechanics/SKILL.md +0 -38
  100. package/packages/agent-skills/assets/codebase-design/SKILL.md +0 -98
  101. package/packages/agent-skills/assets/codebase-design/references/DEEPENING.md +0 -37
  102. package/packages/agent-skills/assets/codebase-design/references/DESIGN-IT-TWICE.md +0 -44
  103. package/packages/agent-skills/assets/codebase-design/references/TESTABILITY.md +0 -29
  104. package/packages/agent-skills/assets/debug-issue/SKILL.md +0 -41
  105. package/packages/agent-skills/assets/domain-modeling/SKILL.md +0 -86
  106. package/packages/agent-skills/assets/domain-modeling/references/ADR-FORMAT.md +0 -47
  107. package/packages/agent-skills/assets/domain-modeling/references/CONTEXT-FORMAT.md +0 -60
  108. package/packages/agent-skills/assets/implement/SKILL.md +0 -28
  109. package/packages/agent-skills/assets/review-changes/SKILL.md +0 -45
  110. package/packages/agent-skills/assets/tdd/SKILL.md +0 -49
  111. package/packages/agent-skills/assets/tdd/references/mocking.md +0 -59
  112. package/packages/agent-skills/assets/tdd/references/tests.md +0 -77
  113. package/packages/agent-skills/assets/testing/SKILL.md +0 -54
  114. package/packages/agent-skills/assets/testing/references/e2e.md +0 -37
  115. package/packages/agent-skills/assets/testing/references/integration.md +0 -37
  116. package/packages/agent-skills/assets/testing/references/unit.md +0 -32
  117. package/packages/agent-skills/assets/to-feature/SKILL.md +0 -91
  118. package/packages/agent-skills/assets/to-feature/references/FEATURE-SPEC-TEMPLATE.md +0 -88
  119. package/packages/agent-skills/assets/to-workitems/SKILL.md +0 -90
  120. package/packages/agent-skills/assets/to-workitems/references/AZURE-DEVOPS-HIERARCHY.md +0 -121
  121. package/packages/agent-skills/assets/to-workitems/references/TICKET-TEMPLATES.md +0 -70
  122. package/packages/azdo/src/workflow-rules-matrix.csv +0 -85
  123. package/packages/fleet/src/launch-agents.ts +0 -649
  124. package/packages/repo-controls/assets/GLOBAL-INVARIANTS.md +0 -21
  125. package/packages/repo-controls/assets/enable-integration-auto-complete.mjs +0 -79
  126. package/packages/repo-controls/assets/scaffold/docs/notes.md +0 -20
  127. package/packages/repo-controls/assets/scaffold/plans/GAPS-AND-FINDINGS.md +0 -12
  128. package/packages/repo-controls/azure-pipelines.yml +0 -274
  129. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/notes.md +0 -1
  130. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/fixtures/excluded/frontend/mobile/src/i18n/locales/zh-CN/strings.ts +0 -1
  131. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-ledger-clean/docs/notes.md +0 -17
  132. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-ledger-no-lines/docs/notes.md +0 -13
  133. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/architecture/product/stable-delivery.md +0 -10
  134. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/architecture/product/stable-recommendation.md +0 -12
  135. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/architecture/product/target-narration.md +0 -10
  136. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-clean/frontend/packages/desktop/src/renderer/solo/item.ts +0 -1
  137. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-empty-register/frontend/packages/desktop/src/a.ts +0 -1
  138. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-empty-register/frontend/packages/desktop/src/b.ts +0 -1
  139. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/fresh/fresh.ts +0 -1
  140. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub1/only.ts +0 -1
  141. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub10/only.ts +0 -1
  142. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub11/only.ts +0 -1
  143. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub2/only.ts +0 -1
  144. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub3/only.ts +0 -1
  145. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub4/only.ts +0 -1
  146. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub5/only.ts +0 -1
  147. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub6/only.ts +0 -1
  148. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub7/only.ts +0 -1
  149. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub8/only.ts +0 -1
  150. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub9/only.ts +0 -1
  151. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/services/i18n/locales/de/common.json +0 -1
  152. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/solo/item.ts +0 -1
  153. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/vendored-crate/Cargo.toml +0 -2
  154. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-missing-tree/frontend/packages/desktop/src/renderer/solo/item.ts +0 -1
  155. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-no-ceilings/frontend/packages/desktop/src/a.ts +0 -1
  156. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-no-ceilings/frontend/packages/desktop/src/b.ts +0 -1
  157. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-no-ceilings/frontend/packages/desktop/src/c.ts +0 -1
  158. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-stale-entry/frontend/packages/desktop/src/renderer/solo/item.ts +0 -1
  159. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/fresh/fresh.ts +0 -1
  160. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub1/only.ts +0 -1
  161. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub10/only.ts +0 -1
  162. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub11/only.ts +0 -1
  163. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub2/only.ts +0 -1
  164. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub3/only.ts +0 -1
  165. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub4/only.ts +0 -1
  166. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub5/only.ts +0 -1
  167. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub6/only.ts +0 -1
  168. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub7/only.ts +0 -1
  169. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub8/only.ts +0 -1
  170. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub9/only.ts +0 -1
  171. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/solo/item.ts +0 -1
  172. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unusable-register/frontend/packages/desktop/src/renderer/solo/item.ts +0 -1
  173. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/open_work_cap/fixtures/open-work-cap-clean/plans/GAPS-AND-FINDINGS.md +0 -5
  174. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/open_work_cap/fixtures/open-work-cap-clean/plans/features/az601-clean/spec.md +0 -10
  175. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/agent/crates/enact-providers/src/snapshots/README.md +0 -1
  176. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/backend/crates/enact-app/assets/builtin-assistants/avatars/assistant.jpg +0 -1
  177. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/backend/crates/enact-assets/assets/logos/tools/coding/tool.png +0 -1
  178. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/backend/crates/enact-session/src/backend/codex_init_prompt.md +0 -1
  179. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/mobile/assets/images/icon.png +0 -1
  180. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/packages/desktop/src/renderer/assets/logos/brand/app.png +0 -1
  181. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/packages/desktop/src/renderer/assets/themes/default-theme.png +0 -1
  182. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/public/pwa/icon-192.png +0 -1
  183. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/resources/product.png +0 -1
  184. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-stray/backend/crates/enact-session/src/backend/README.md +0 -1
  185. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/fixtures/plans-layout-clean/plans/features/az347-test-coverage/spec.md +0 -12
  186. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/fixtures/plans-layout-violation/plans/features/az347-test-coverage/spec.md +0 -12
  187. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/__init__.py +0 -11
  188. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/check.py +0 -62
  189. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/NotAMigration.sql +0 -1
  190. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/0001_long_prefix.sql +0 -1
  191. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/001_init.sql +0 -1
  192. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/002_add_index.sql +0 -1
  193. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/003-dashed-slug.sql +0 -1
  194. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/004_MixedCase.sql +0 -1
  195. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/005_trailing space.sql +0 -1
  196. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/01_short_prefix.sql +0 -1
  197. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/not-a-migration.sql +0 -1
  198. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/test_check.py +0 -116
  199. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-broken/docs/architecture/product/links.md +0 -20
  200. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-broken/docs/architecture/product/route-target.md +0 -8
  201. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-clean/docs/architecture/product/links.md +0 -20
  202. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-clean/docs/architecture/product/route-target.md +0 -8
  203. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.changeset/declared.txt +0 -1
  204. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/INDEPENDENT-VERIFICATION.md +0 -3
  205. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/attribute-without-conversion/.gitattributes +0 -1
  206. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/attribute-without-conversion/large file.bin +0 -3
  207. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/clean/.gitattributes +0 -1
  208. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/clean/large file.bin +0 -3
  209. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/clean/small.txt +0 -1
  210. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/missing-filter/large file.bin +0 -0
  211. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/unmatched-extension/.gitattributes +0 -1
  212. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/unmatched-extension/payload.dat +0 -0
  213. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/__init__.py +0 -1
  214. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/__init__.py +0 -12
  215. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/check.py +0 -129
  216. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/fixtures/disjoint/gate-registry.yaml +0 -13
  217. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/fixtures/empty/gate-registry.yaml +0 -7
  218. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/fixtures/overlapping/gate-registry.yaml +0 -13
  219. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/test_check.py +0 -109
  220. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/__init__.py +0 -1
  221. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/__init__.py +0 -11
  222. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/check.py +0 -149
  223. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/fixtures/clean/docs/readme.md +0 -4
  224. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/fixtures/relevant/VERSION +0 -1
  225. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/test_check.py +0 -151
  226. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/__init__.py +0 -11
  227. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/check.py +0 -202
  228. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/aligned/.workflows/changesets/package.json +0 -5
  229. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/aligned/.workflows/package.json +0 -5
  230. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/aligned/CHANGELOG.md +0 -5
  231. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/aligned/VERSION +0 -1
  232. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/mismatched/.workflows/changesets/package.json +0 -5
  233. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/mismatched/.workflows/package.json +0 -5
  234. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/mismatched/CHANGELOG.md +0 -5
  235. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/mismatched/VERSION +0 -1
  236. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/test_check.py +0 -162
  237. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/check.py +0 -103
  238. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/backend/Cargo.lock +0 -7
  239. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/backend/Cargo.toml +0 -4
  240. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/backend/rust-toolchain.toml +0 -3
  241. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/backend/src/main.rs +0 -1
  242. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/frontend/bun.lock +0 -1
  243. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/backend/Cargo.lock +0 -7
  244. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/backend/Cargo.toml +0 -4
  245. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/backend/rust-toolchain.toml +0 -3
  246. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/backend/src/main.rs +0 -1
  247. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/frontend/bun.lock +0 -0
  248. package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/grants-registry.yaml +0 -112
  249. package/packages/repo-controls/workflows/scripts/release/verify-npm-artifact.ts +0 -119
@@ -1,12 +0,0 @@
1
- ---
2
- type: feature
3
- title: "Test coverage"
4
- status: New
5
- epic: https://dev.azure.com/org/proj/_workitems/edit/320
6
- work_item: https://dev.azure.com/org/proj/_workitems/edit/347
7
- last_update: 2026-09-15T03:20:00Z
8
- sources:
9
- - docs/architecture/workflow-automation.md
10
- ---
11
-
12
- # Test coverage
@@ -1,12 +0,0 @@
1
- ---
2
- type: feature
3
- title: "Test coverage"
4
- status: New
5
- epic: https://dev.azure.com/org/proj/_workitems/edit/320
6
- work_item: https://dev.azure.com/org/proj/_workitems/edit/999
7
- last_update: 2026-09-15T03:20:00Z
8
- sources:
9
- - docs/architecture/workflow-automation.md
10
- ---
11
-
12
- # Test coverage
@@ -1,11 +0,0 @@
1
- """The `layout.profile-data` gate.
2
-
3
- A folder rather than a bare module because the ported test carries its own
4
- fixture corpus beside the check, same as every other gate in this package.
5
- """
6
-
7
- from __future__ import annotations
8
-
9
- from .check import ProfileData
10
-
11
- __all__ = ["ProfileData"]
@@ -1,62 +0,0 @@
1
- """LAY-010 — every PostgreSQL migration under `ates` is named
2
- `NNN_slug.sql`.
3
-
4
- Ported from `compliance_new/checks/layout/profile-data/check.sh`, the
5
- `migration-filenames` branch retained from the old multi-mode
6
- `profile-data.sh` after its other three branches were superseded by their own
7
- engines (see that file's header). It takes no arguments and reads exactly the
8
- given set (already narrowed by the runner to the row's `engine.scope`,
9
- `<rust>/crates/**`, i.e. `<rust>/crates/**`); it performs no walk and no
10
- `git` call of its own.
11
-
12
- `RULE_ID` in check.sh is the literal `LAY-009`, not this row's own id
13
- (`LAY-010`) — a pre-existing mismatch in the shell source, not a typo
14
- introduced here. `compliance_new/AGENTS.md` names this exact failure mode
15
- ("a check that hardcodes [an id] has a second copy of a fact, free to
16
- disagree with the row") for two OTHER gates; this one has the same shape and
17
- was not caught. check.sh's own test.sh asserts findings are reported under
18
- `LAY-009` (`rg -q '^LAY-009 '`), so that is the behaviour ported here —
19
- faithfully, not silently corrected, since fixing it is a registry/shell-tree
20
- change outside this port's scope.
21
-
22
- `*/migrations/*.sql` is a bash `case` pattern, not `engine.scope`: it is the
23
- rule's own subject-matter test (a migration is defined by living in a
24
- `migrations/` directory), applied to whatever the given set already narrowed
25
- to `<rust>/crates/**`. A `.sql` file elsewhere under `<rust>/crates/` is not
26
- a migration and carries no naming contract, so it is never graded — ported as
27
- a substring test rather than a glob library, since a repository-relative path
28
- never carries the leading `/` a `*` prefix of zero length would require.
29
- """
30
-
31
- from __future__ import annotations
32
-
33
- import re
34
- from collections.abc import Iterable
35
- from typing import ClassVar
36
-
37
- from ....core.check import Check
38
- from ....core.context import Context, FileSet
39
- from ....core.finding import Report
40
-
41
-
42
- class ProfileData(Check):
43
- id: ClassVar[str] = "LAY-010"
44
- rule: ClassVar[str] = "LAY-009" # see module docstring: verbatim from check.sh
45
-
46
- NAME: ClassVar[re.Pattern[str]] = re.compile(r"^[0-9]{3}_[a-z0-9_]+\.sql$")
47
- """Three digits, an underscore, then a lowercase/digit/underscore slug of
48
- at least one character — check.sh's `^[0-9]{3}_[a-z0-9_]+\\.sql$`."""
49
-
50
- def graded(self, ctx: Context, files: FileSet) -> Iterable[Report]:
51
- for relative in sorted(files):
52
- if "/migrations/" not in relative or not relative.endswith(".sql"):
53
- continue # not a migration: no naming contract applies
54
- base = relative.rsplit("/", 1)[-1]
55
- if self.NAME.match(base):
56
- continue
57
- yield self.report(
58
- relative,
59
- f"invalid migration filename: {relative}",
60
- f"rename {relative} to match NNN_slug.sql "
61
- "(three dis, underscore, lowercase slug)",
62
- )
@@ -1,116 +0,0 @@
1
- """LAY-010 — ported from `compliance_new/checks/layout/profile-data/test.sh`.
2
-
3
- ONE corpus, one file per malformed shape, ported byte-for-byte from the shell
4
- fixture (`fixtures/migration-filenames/backend/crates/demo/migrations/` plus
5
- one `.sql` file that lives outside a `migrations/` directory). Each case below
6
- hands over a SUBSET of that same corpus, exactly as test.sh's `state_set`
7
- narrows one given list per case — a lumped fixture would pass as long as ONE
8
- shape is caught, which is how a loosened pattern hides.
9
- """
10
-
11
- from __future__ import annotations
12
-
13
- import pathlib
14
-
15
- import pytest
16
-
17
- from adl_compliance import runner
18
- from adl_compliance.checks.layout.profile_data import ProfileData
19
- from adl_compliance.core.verdict import Outcome
20
- from adl_compliance.policy.registry import load
21
-
22
- FIXTURES = pathlib.Path(__file__).parent / "fixtures"
23
- ROOT = FIXTURES / "migration-filenames"
24
- ROW = load().by_id("LAY-010")
25
-
26
-
27
- @pytest.fixture(autouse=True)
28
- def _wired(monkeypatch: pytest.MonkeyPatch) -> None:
29
- # LAY-010 is not yet in `checks/__init__.py`'s CHECKS tuple — a later step
30
- # wires this wave of checks into the registry in one shot, to avoid
31
- # concurrent edits to that shared file. Until then, `runner.lookup` cannot
32
- # find this row, so the dispatch path (`runner.run`) is exercised here with
33
- # its one lookup call patched to resolve LAY-010 to this module's class —
34
- # everything else (scope intersection, verdict decision) runs for real.
35
- monkeypatch.setattr(runner, "lookup", lambda gate_id: ProfileData)
36
-
37
-
38
- DIR = "backend/crates/demo/migrations"
39
- OUTSIDE = "backend/crates/demo/NotAMigration.sql"
40
-
41
- INIT = f"{DIR}/001_init.sql"
42
- ADD_INDEX = f"{DIR}/002_add_index.sql"
43
-
44
- # The six malformed shapes test.sh's `reject` loop names, each with the
45
- # reason it names for that shape.
46
- MALFORMED = (
47
- ("not-a-migration.sql", "a name with no numeric prefix"),
48
- ("01_short_prefix.sql", "a two-digit prefix"),
49
- ("0001_long_prefix.sql", "a four-digit prefix"),
50
- ("003-dashed-slug.sql", "a dashed separator instead of an underscore"),
51
- ("004_MixedCase.sql", "an uppercase slug"),
52
- ("005_trailing space.sql", "a slug containing a space"),
53
- )
54
-
55
- CONFORMING = (INIT, ADD_INDEX, OUTSIDE)
56
-
57
-
58
- def run(given: tuple[str, ...]) -> object:
59
- return runner.run(ROW, ROOT, given)
60
-
61
-
62
- def test_the_corpus_holds_nine_files() -> None:
63
- on_disk = tuple(str(p.relative_to(ROOT)) for p in ROOT.rglob("*") if p.is_file())
64
- assert len(on_disk) == 9, f"the corpus should hold 9 files, got {len(on_disk)}"
65
-
66
-
67
- def test_a_conforming_set_passes() -> None:
68
- verdict = run(CONFORMING)
69
- assert verdict.outcome is Outcome.CLEAN, verdict.render()
70
- assert verdict.findings == ()
71
-
72
-
73
- @pytest.mark.parametrize("bad,why", MALFORMED, ids=[b for b, _ in MALFORMED])
74
- def test_each_malformed_shape_is_rejected(bad: str, why: str) -> None:
75
- given = (*CONFORMING, f"{DIR}/{bad}")
76
- verdict = run(given)
77
- assert verdict.outcome is Outcome.FINDINGS, f"{why} was accepted: {bad}"
78
- assert len(verdict.findings) == 1
79
- finding = verdict.findings[0]
80
- assert finding.rule == "LAY-009" # check.sh's hardcoded RULE_ID; see check.py
81
- assert finding.path == f"{DIR}/{bad}"
82
- # The one name in every set that must never be reported: a .sql file
83
- # outside a migrations/ directory has no naming contract.
84
- assert OUTSIDE not in {f.path for f in verdict.findings}
85
-
86
-
87
- def test_the_whole_corpus_reports_all_six_malformed_names() -> None:
88
- given = (*CONFORMING, *(f"{DIR}/{bad}" for bad, _ in MALFORMED))
89
- verdict = run(given)
90
- assert verdict.outcome is Outcome.FINDINGS
91
- assert len(verdict.findings) == 6
92
- assert {f.rule for f in verdict.findings} == {"LAY-009"}
93
- reported = {f.path for f in verdict.findings}
94
- assert reported == {f"{DIR}/{bad}" for bad, _ in MALFORMED}
95
- # Isolation proof (test.sh): every reported path resolves inside the
96
- # corpus, not some unrelated migrations/ directory elsewhere on disk.
97
- for finding in verdict.findings:
98
- assert (ROOT / finding.path).exists()
99
-
100
-
101
- def test_a_sql_file_outside_migrations_is_never_graded() -> None:
102
- # OUTSIDE alone: a .sql file with no numeric prefix at all, but it does
103
- # not live under a migrations/ directory, so it carries no naming
104
- # contract and must stay silent.
105
- verdict = run((OUTSIDE,))
106
- assert verdict.outcome is Outcome.CLEAN, verdict.render()
107
-
108
-
109
- def test_no_files_given_is_could_not_run() -> None:
110
- # The shell gate refuses to run at all with ADL_CHANGED_FILES unset
111
- # (exit 2). This package has no "unset" state distinct from "empty" — the
112
- # equivalent, framework-level could-not-run is an empty intersection over
113
- # the whole visible tree (see core/runner.py's `exhaustive`, and
114
- # RST-008's identically-shaped test).
115
- verdict = runner.run(ROW, ROOT, (), exhaustive=True)
116
- assert verdict.outcome is Outcome.COULD_NOT_RUN
@@ -1,20 +0,0 @@
1
- ---
2
- title: "Links"
3
- description: "Three links on this page do not resolve"
4
- document_type: architecture
5
- status: canonical
6
- last_update: "2026-07-27T00:00:00Z"
7
- reason: "fixture"
8
- ---
9
-
10
- [Sibling](./route-target.md)
11
-
12
- [Published route](/architecture/product/route-target/)
13
-
14
- [Completed plan](../../../.plans/c_done/26-07-27-history.md)
15
-
16
- [Missing](./does-not-exist.md)
17
-
18
- [Wrong case](../../readme.md)
19
-
20
- Retired path: `docs/strategy/old-page.md`.
@@ -1,8 +0,0 @@
1
- ---
2
- title: "Route target"
3
- description: "Existing target for a published route reference"
4
- document_type: architecture
5
- status: canonical
6
- last_update: "2026-07-27T00:00:00Z"
7
- reason: "fixture"
8
- ---
@@ -1,20 +0,0 @@
1
- ---
2
- title: "Links"
3
- description: "Every link on this page resolves"
4
- document_type: architecture
5
- status: canonical
6
- last_update: "2026-07-27T00:00:00Z"
7
- reason: "fixture"
8
- ---
9
-
10
- [Sibling](./route-target.md)
11
-
12
- [Published route](/architecture/product/route-target/)
13
-
14
- [Exact case](../../README.md)
15
-
16
- [Completed plan](../../../.plans/c_done/26-07-27-history.md)
17
-
18
- ```
19
- [Inside a fence](./does-not-exist.md)
20
- ```
@@ -1,8 +0,0 @@
1
- ---
2
- title: "Route target"
3
- description: "Existing target for a published route reference"
4
- document_type: architecture
5
- status: canonical
6
- last_update: "2026-07-27T00:00:00Z"
7
- reason: "fixture"
8
- ---
@@ -1 +0,0 @@
1
- root-layout corpus: content under a declared top-level directory.
@@ -1,3 +0,0 @@
1
- # INDEPENDENT-VERIFICATION.md
2
-
3
- Admitted by literal name in the gate root allowlist.
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:2cb74edba754a81d121c9db6833704a8e7d417e5b13d1a19f4a52f007d644264
3
- size 1048577
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:2cb74edba754a81d121c9db6833704a8e7d417e5b13d1a19f4a52f007d644264
3
- size 1048577
@@ -1,12 +0,0 @@
1
- """The `pipeline.phase-disjoint` gate.
2
-
3
- A folder rather than a module because this gate GRADES A DOCUMENT, and the
4
- document belongs beside the check that reads it. `check.py` is the rule;
5
- anything else in here is what it grades.
6
- """
7
-
8
- from __future__ import annotations
9
-
10
- from .check import PhaseDisjoint
11
-
12
- __all__ = ["PhaseDisjoint"]
@@ -1,129 +0,0 @@
1
- """PIP-004 — ported from
2
- `compliance_new/checks/pipeline/phase-disjoint/check.sh` (rule id `MET-001`).
3
-
4
- No gate registry row may run in two mutually exclusive phases:
5
-
6
- 1. never both pre-commit and pre-push
7
- 2. never both pr_validation and qua_deploy
8
-
9
- Entirely `structural`: the registry is a NAMED INPUT (`Check.inputs`, resolved
10
- by the runner into `ctx.inputs["registry"]`) and every row it grades is inside
11
- that one document, so there is nothing in `graded` for this gate to read — the
12
- shell version's own comment says as much: it takes no arguments and holds no
13
- root variable, and finds the registry structurally from its own position in
14
- the package.
15
-
16
- `PhaseRow` and `PhaseRegistry` are `OpenModel`, not `StrictModel`. The real
17
- `policy/gate-registry.yaml` carries `name`, `domain`, `title`, `severity`,
18
- `controls`, `engine`, `test`, `grants`, `timeout_ms` on every row — none of
19
- which is this gate's business. `extra="forbid"` here would make this gate
20
- refuse to run against the real registry on every single invocation, exactly
21
- the trap `contracts.transport-boundaries`' own docstring names for its input.
22
-
23
- A missing registry or one that decodes to zero rows is `CouldNotRun` here,
24
- exactly as the shell version treats them (exit 2 in both cases) — never a
25
- `MET-001` finding. The shell script asserts its row count before the verdict
26
- for the same reason `contracts.transport-boundaries` asserts a non-empty
27
- `boundaries` list: an empty decode and a clean estate are the same exit code
28
- otherwise, and the empty one is a broken gate reporting success.
29
-
30
- **A field this repository's schema does not carry.** Neither the currently
31
- shipped shell registry (`compliance_new/policy/gate-registry.yaml`) nor this
32
- package's own (`policy/gate-registry.yaml`, whose `Row` model in
33
- `policy/registry.py` declares exactly `id · name · domain · title · severity ·
34
- controls · engine · test · grants · timeout_ms`, closed by K-09) has a single
35
- row carrying `phases:` today — the scheduling model this gate grades was
36
- already retired in favour of `engine.scope`-based triggering before this row
37
- was ported (see `compliance_new/AGENTS.md`, "A phase is not this tree's word",
38
- and this package's own K-43, "No phase here"). This gate is ported faithfully
39
- regardless, exactly as `check.sh` specifies it, because retiring a rule is a
40
- decision for whoever owns the registry row, not something a port silently
41
- does on its behalf — see this check's own `test_check.py` and this file's
42
- folder-level notes for what that means for a real run against either registry.
43
- """
44
-
45
- from __future__ import annotations
46
-
47
- from collections.abc import Iterable
48
- from typing import Annotated, ClassVar
49
-
50
- import yaml
51
- from pydantic import Field, ValidationError
52
-
53
- from ....core.check import Check
54
- from ....core.context import Context
55
- from ....core.errors import CouldNotRun
56
- from ....core.finding import Report
57
- from ....core.models import OpenModel
58
-
59
-
60
- class PhaseRow(OpenModel):
61
- """One row of the gate registry, projected to just what MET-001 grades."""
62
-
63
- id: str
64
- phases: Annotated[tuple[str, ...], Field(strict=False)] = ()
65
-
66
-
67
- class PhaseRegistry(OpenModel):
68
- """Open: the real document also carries `schema` at the top level."""
69
-
70
- rows: Annotated[tuple[PhaseRow, ...], Field(strict=False)] = ()
71
-
72
-
73
- class PhaseDisjoint(Check):
74
- id: ClassVar[str] = "PIP-004"
75
- rule: ClassVar[str] = "MET-001"
76
-
77
- inputs: ClassVar[dict[str, str]] = {
78
- "registry": "<compliance>/policy/gate-registry.yaml",
79
- }
80
-
81
- PRE_COMMIT: ClassVar[str] = "pre-commit"
82
- PRE_PUSH: ClassVar[str] = "pre-push"
83
- PR_VALIDATION: ClassVar[str] = "pr_validation"
84
- QUA_DEPLOY: ClassVar[str] = "qua_deploy"
85
-
86
- def structural(self, ctx: Context) -> Iterable[Report]:
87
- registry_path = ctx.inputs["registry"]
88
- shown = ctx.relative(registry_path)
89
-
90
- body = self.text(ctx, registry_path)
91
- if body is None:
92
- raise CouldNotRun(f"missing input: {shown}")
93
-
94
- registry = self._load_registry(body, shown)
95
- if not registry.rows:
96
- raise CouldNotRun(f"{shown} decoded zero rows")
97
-
98
- for row in registry.rows:
99
- phases = set(row.phases)
100
-
101
- if self.PRE_COMMIT in phases and self.PRE_PUSH in phases:
102
- yield self.report(
103
- shown,
104
- f"{row.id} runs at both {self.PRE_COMMIT} and {self.PRE_PUSH}",
105
- f"drop one of {self.PRE_COMMIT} or {self.PRE_PUSH} from "
106
- f"{row.id}'s phases in {shown}",
107
- )
108
-
109
- if self.PR_VALIDATION in phases and self.QUA_DEPLOY in phases:
110
- yield self.report(
111
- shown,
112
- f"{row.id} runs at both {self.PR_VALIDATION} and {self.QUA_DEPLOY}",
113
- f"drop one of {self.PR_VALIDATION} or {self.QUA_DEPLOY} from "
114
- f"{row.id}'s phases in {shown}",
115
- )
116
-
117
- # -------------------------------------------------------------- the registry
118
-
119
- def _load_registry(self, body: str, shown: str) -> PhaseRegistry:
120
- try:
121
- loaded = yaml.safe_load(body)
122
- except yaml.YAMLError as exc:
123
- raise CouldNotRun(f"could not read .rows from {shown}: {exc}") from exc
124
- if not isinstance(loaded, dict):
125
- raise CouldNotRun(f"could not read .rows from {shown}: not a mapping")
126
- try:
127
- return PhaseRegistry.model_validate(loaded)
128
- except ValidationError as exc:
129
- raise CouldNotRun(f"could not read .rows from {shown}: {exc}") from exc
@@ -1,13 +0,0 @@
1
- # MET-001 corpus — every row in exactly one phase.
2
- #
3
- # All four phases appear, so a gate that mistook any single phase name for an
4
- # overlap fires here. Nothing in this file may be reported.
5
- rows:
6
- - id: OK-01
7
- phases: [pre-commit]
8
- - id: OK-02
9
- phases: [pre-push]
10
- - id: OK-03
11
- phases: [pr_validation]
12
- - id: OK-04
13
- phases: [qua_deploy]
@@ -1,7 +0,0 @@
1
- # MET-001 corpus — a registry that decodes to zero rows.
2
- #
3
- # A gate that reads nothing and a gate that reads a clean estate reach the same
4
- # verdict unless the row count is asserted first, and the empty one is a broken
5
- # gate reporting success. This corpus is what makes that distinction testable:
6
- # the expected result is exit 2 ("could not run"), never exit 0.
7
- rows: []
@@ -1,13 +0,0 @@
1
- # MET-001 corpus — a registry that violates both exclusion rules.
2
- #
3
- # Two rows, two different overlaps, so a gate that checks only the first pair
4
- # still fails this corpus. OK-01 is here for the same reason the clean corpus
5
- # exists: without a row that must NOT be reported, "reported BAD-01" and
6
- # "reported every row it decoded" look identical.
7
- rows:
8
- - id: OK-01
9
- phases: [pre-commit]
10
- - id: BAD-01
11
- phases: [pre-commit, pre-push]
12
- - id: BAD-02
13
- phases: [pr_validation, qua_deploy]