@amsterdamdatalabs/adl-agent-control-linux-x64 0.1.4
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.
- package/bin/adl +4 -0
- package/bin/cursor-settings +14 -0
- package/bin/default-agent-file +14 -0
- package/bin/git +670 -0
- package/bin/git-ado +425 -0
- package/bin/global-agents +14 -0
- package/bin/global-surface-sweep +14 -0
- package/bin/health-check +38 -0
- package/bin/kimi-hooks +14 -0
- package/bin/lean-ctx-observe-strip +361 -0
- package/bin/lib/bun-compile-build.sh +34 -0
- package/bin/lib/lean-ctx-observe-hooks.sh +634 -0
- package/bin/managed-settings +14 -0
- package/bin/opencode-hooks +14 -0
- package/bin/reconcile +2648 -0
- package/bin/scratch-reap +14 -0
- package/bin/shell-path-policy +64 -0
- package/bin/surface-policy +14 -0
- package/bin/sync-and-reconcile +215 -0
- package/bin/update-azure-agent-pool +29 -0
- package/bin/validate-manifest +171 -0
- package/bin/vscode-settings +14 -0
- package/package.json +44 -0
- package/packages/agent-hooks/README.md +411 -0
- package/packages/agent-hooks/assets/hooks.json +97 -0
- package/packages/agent-hooks/assets/opencode-plugin.template.ts +224 -0
- package/packages/agent-hooks/bunfig.toml +27 -0
- package/packages/agent-hooks/deploy-profile.json +53 -0
- package/packages/agent-hooks/deploy-profile.schema.json +120 -0
- package/packages/agent-hooks/package.json +23 -0
- package/packages/agent-hooks/src/cli/args.ts +99 -0
- package/packages/agent-hooks/src/cli/doctor.ts +241 -0
- package/packages/agent-hooks/src/cli/rules.ts +133 -0
- package/packages/agent-hooks/src/deploy/deploy.ts +181 -0
- package/packages/agent-hooks/src/deploy/doctor.ts +158 -0
- package/packages/agent-hooks/src/deploy/index.ts +17 -0
- package/packages/agent-hooks/src/deploy/json-merge.ts +115 -0
- package/packages/agent-hooks/src/deploy/legacy-lock.ts +213 -0
- package/packages/agent-hooks/src/deploy/list.ts +117 -0
- package/packages/agent-hooks/src/deploy/lock.ts +65 -0
- package/packages/agent-hooks/src/deploy/opencode-template.ts +74 -0
- package/packages/agent-hooks/src/deploy/profile.ts +117 -0
- package/packages/agent-hooks/src/deploy/render.ts +162 -0
- package/packages/agent-hooks/src/deploy/source.ts +84 -0
- package/packages/agent-hooks/src/gating/config.ts +514 -0
- package/packages/agent-hooks/src/gating/root.ts +117 -0
- package/packages/agent-hooks/src/hooks/briefing/handler.ts +22 -0
- package/packages/agent-hooks/src/hooks/briefing/index.ts +320 -0
- package/packages/agent-hooks/src/hooks/contract.ts +112 -0
- package/packages/agent-hooks/src/hooks/crg/handler.ts +22 -0
- package/packages/agent-hooks/src/hooks/crg/index.ts +209 -0
- package/packages/agent-hooks/src/hooks/lean-ctx/handler.ts +22 -0
- package/packages/agent-hooks/src/hooks/lean-ctx/index.ts +173 -0
- package/packages/agent-hooks/src/hooks/lean-ctx/mapping.ts +121 -0
- package/packages/agent-hooks/src/hooks/lean-ctx/scope-rewrite.ts +207 -0
- package/packages/agent-hooks/src/hooks/log.ts +233 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/config.ts +58 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/constants.ts +149 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/handler.ts +72 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/index.ts +203 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/match.ts +212 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/skill-roots.ts +73 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/skills.ts +98 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/tokenizer.ts +115 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/vector.ts +174 -0
- package/packages/agent-hooks/src/hosts/impl/claude.ts +47 -0
- package/packages/agent-hooks/src/hosts/impl/codex.ts +47 -0
- package/packages/agent-hooks/src/hosts/impl/cursor.ts +40 -0
- package/packages/agent-hooks/src/hosts/impl/kimi.ts +47 -0
- package/packages/agent-hooks/src/hosts/impl/opencode.ts +54 -0
- package/packages/agent-hooks/src/hosts/registry.ts +29 -0
- package/packages/agent-hooks/src/hosts/spec.ts +113 -0
- package/packages/agent-hooks/src/lean-ctx/env.ts +106 -0
- package/packages/agent-hooks/src/lean-ctx/mcp.ts +140 -0
- package/packages/agent-hooks/src/lib/spawn-with-timeout.ts +120 -0
- package/packages/agent-hooks/src/log/writer.ts +230 -0
- package/packages/agent-hooks/src/main.ts +269 -0
- package/packages/agent-hooks/src/pre-tool-use/handler.ts +549 -0
- package/packages/agent-hooks/src/rules/engine.ts +293 -0
- package/packages/agent-hooks/src/rules/impl/adl-build-run-denied.ts +51 -0
- package/packages/agent-hooks/src/rules/impl/adl-git-credential-bypass.ts +320 -0
- package/packages/agent-hooks/src/rules/impl/adl-git-identity.ts +249 -0
- package/packages/agent-hooks/src/rules/impl/adl-git-push-policy.ts +258 -0
- package/packages/agent-hooks/src/rules/impl/adl-human-azdo-bypass.ts +731 -0
- package/packages/agent-hooks/src/rules/impl/adl-identity.ts +128 -0
- package/packages/agent-hooks/src/rules/impl/adl-mcp-cli.ts +179 -0
- package/packages/agent-hooks/src/rules/impl/adl-pr-complete-pending.ts +65 -0
- package/packages/agent-hooks/src/rules/impl/adl-pr-review-role.ts +156 -0
- package/packages/agent-hooks/src/rules/impl/adl-pr-role.ts +121 -0
- package/packages/agent-hooks/src/rules/impl/adl-session-required.ts +403 -0
- package/packages/agent-hooks/src/rules/impl/adl-token-minting-role.ts +92 -0
- package/packages/agent-hooks/src/rules/impl/adl-workitem-role.ts +74 -0
- package/packages/agent-hooks/src/rules/impl/advisory-coverage.ts +43 -0
- package/packages/agent-hooks/src/rules/impl/advisory-finder.ts +62 -0
- package/packages/agent-hooks/src/rules/impl/agent-secrets-stay-unread.ts +173 -0
- package/packages/agent-hooks/src/rules/impl/agent-tamper-protection.ts +508 -0
- package/packages/agent-hooks/src/rules/impl/fs-canonical-checkout.ts +86 -0
- package/packages/agent-hooks/src/rules/impl/fs-git-internals.ts +75 -0
- package/packages/agent-hooks/src/rules/impl/fs-mv.ts +66 -0
- package/packages/agent-hooks/src/rules/impl/fs-rm.ts +83 -0
- package/packages/agent-hooks/src/rules/impl/fs-trash.ts +140 -0
- package/packages/agent-hooks/src/rules/impl/git-core.ts +101 -0
- package/packages/agent-hooks/src/rules/impl/git-helpers.ts +408 -0
- package/packages/agent-hooks/src/rules/impl/git-history.ts +77 -0
- package/packages/agent-hooks/src/rules/impl/git-paths.ts +139 -0
- package/packages/agent-hooks/src/rules/impl/git-plumbing.ts +167 -0
- package/packages/agent-hooks/src/rules/impl/git-protected-tree.ts +132 -0
- package/packages/agent-hooks/src/rules/impl/git-transitions.ts +292 -0
- package/packages/agent-hooks/src/rules/impl/git-verify.ts +95 -0
- package/packages/agent-hooks/src/rules/impl/git-worktree.ts +265 -0
- package/packages/agent-hooks/src/rules/impl/mcp-tool.ts +76 -0
- package/packages/agent-hooks/src/rules/impl/messages.ts +128 -0
- package/packages/agent-hooks/src/rules/impl/parse-uncertain.ts +143 -0
- package/packages/agent-hooks/src/rules/impl/pr-completion.ts +35 -0
- package/packages/agent-hooks/src/rules/impl/shell-remote-script-exec.ts +63 -0
- package/packages/agent-hooks/src/rules/impl/tool-azure-devops.ts +283 -0
- package/packages/agent-hooks/src/rules/impl/tool-bun-test.ts +81 -0
- package/packages/agent-hooks/src/rules/impl/tool-cargo.ts +66 -0
- package/packages/agent-hooks/src/rules/impl/tool-chmod-hook.ts +42 -0
- package/packages/agent-hooks/src/rules/impl/tool-find.ts +82 -0
- package/packages/agent-hooks/src/rules/impl/tool-frontend.ts +83 -0
- package/packages/agent-hooks/src/rules/impl/tool-grep.ts +93 -0
- package/packages/agent-hooks/src/rules/impl/tool-lean-ctx-global.ts +594 -0
- package/packages/agent-hooks/src/rules/impl/tool-native-search.ts +77 -0
- package/packages/agent-hooks/src/rules/ports.ts +178 -0
- package/packages/agent-hooks/src/rules/registry.ts +233 -0
- package/packages/agent-hooks/src/rules/shell/git-identity.ts +1415 -0
- package/packages/agent-hooks/src/rules/shell/git-internals.ts +186 -0
- package/packages/agent-hooks/src/rules/shell/invocation.ts +1083 -0
- package/packages/agent-hooks/src/rules/shell/piped-script.ts +201 -0
- package/packages/agent-hooks/src/rules/shell/prefixes.ts +214 -0
- package/packages/agent-hooks/src/rules/shell/protected-carrier-writes.ts +108 -0
- package/packages/agent-hooks/src/rules/shell/protected-carriers.ts +149 -0
- package/packages/agent-hooks/src/rules/shell/split.ts +179 -0
- package/packages/agent-hooks/src/rules/shell/substitution.ts +394 -0
- package/packages/agent-hooks/src/rules/shell/token.ts +180 -0
- package/packages/agent-hooks/src/rules/shell/xargs.ts +81 -0
- package/packages/agent-hooks/src/rules/spec.ts +152 -0
- package/packages/agent-hooks/src/surface-policy.ts +37 -0
- package/packages/agent-hooks/tsconfig.json +23 -0
- package/packages/agent-settings/assets/GLOBAL-AGENTS.md +107 -0
- package/packages/agent-settings/assets/agents/architect.toml +30 -0
- package/packages/agent-settings/assets/agents/code-reviewer.toml +27 -0
- package/packages/agent-settings/assets/agents/critic.toml +35 -0
- package/packages/agent-settings/assets/agents/executor.toml +28 -0
- package/packages/agent-settings/assets/agents/explore.toml +25 -0
- package/packages/agent-settings/assets/agents/planner.toml +29 -0
- package/packages/agent-settings/assets/lean-ctx/config.toml +39 -0
- package/packages/agent-settings/assets/lean-ctx/gitignore +6 -0
- package/packages/agent-settings/assets/lean-ctx/layout.toml +5 -0
- package/packages/agent-settings/assets/mcp.json +20 -0
- package/packages/agent-settings/managed/README.md +331 -0
- package/packages/agent-settings/managed/claude-managed-settings.json +150 -0
- package/packages/agent-settings/managed/codex-requirements.toml +105 -0
- package/packages/agent-settings/protected.json +470 -0
- package/packages/agent-settings/src/deploy/agent-render.ts +94 -0
- package/packages/agent-settings/src/deploy/agent-toml.ts +76 -0
- package/packages/agent-settings/src/deploy/agents-deploy.ts +129 -0
- package/packages/agent-settings/src/deploy/doctor.ts +201 -0
- package/packages/agent-settings/src/deploy/index.ts +33 -0
- package/packages/agent-settings/src/deploy/json-pretty.ts +66 -0
- package/packages/agent-settings/src/deploy/lean-ctx-deploy.ts +138 -0
- package/packages/agent-settings/src/deploy/legacy-lock.ts +286 -0
- package/packages/agent-settings/src/deploy/list.ts +135 -0
- package/packages/agent-settings/src/deploy/lock.ts +112 -0
- package/packages/agent-settings/src/deploy/mcp-deploy.ts +175 -0
- package/packages/agent-settings/src/deploy/mcp-inspect.ts +56 -0
- package/packages/agent-settings/src/deploy/mcp-merge.ts +164 -0
- package/packages/agent-settings/src/deploy/mcp-render.ts +80 -0
- package/packages/agent-settings/src/deploy/mcp-source.ts +43 -0
- package/packages/agent-settings/src/deploy/profile.ts +296 -0
- package/packages/agent-settings/src/deploy/settings.ts +65 -0
- package/packages/agent-settings/src/global-agents.ts +230 -0
- package/packages/agent-settings/src/global-surface-sweep.ts +2179 -0
- package/packages/agent-settings/src/kimi-hooks.ts +455 -0
- package/packages/agent-settings/src/opencode-hooks.ts +76 -0
- package/packages/agent-settings/src/surface-policy.ts +441 -0
- package/packages/agent-settings/surface-policy.json +20 -0
- package/packages/agent-skills/assets/code-review/SKILL.md +100 -0
- package/packages/agent-skills/assets/codebase-design/SKILL.md +98 -0
- package/packages/agent-skills/assets/codebase-design/references/DEEPENING.md +37 -0
- package/packages/agent-skills/assets/codebase-design/references/DESIGN-IT-TWICE.md +44 -0
- package/packages/agent-skills/assets/codebase-design/references/TESTABILITY.md +29 -0
- package/packages/agent-skills/assets/debug-issue/SKILL.md +40 -0
- package/packages/agent-skills/assets/diagnosing-bugs/SKILL.md +100 -0
- package/packages/agent-skills/assets/diagnosing-bugs/references/FEEDBACK-LOOP-TACTICS.md +34 -0
- package/packages/agent-skills/assets/diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
- package/packages/agent-skills/assets/domain-modeling/SKILL.md +86 -0
- package/packages/agent-skills/assets/domain-modeling/references/ADR-FORMAT.md +47 -0
- package/packages/agent-skills/assets/domain-modeling/references/CONTEXT-FORMAT.md +60 -0
- package/packages/agent-skills/assets/explore-codebase/SKILL.md +41 -0
- package/packages/agent-skills/assets/handoff/SKILL.md +28 -0
- package/packages/agent-skills/assets/implement/SKILL.md +28 -0
- package/packages/agent-skills/assets/refactor-safely/SKILL.md +44 -0
- package/packages/agent-skills/assets/review-changes/SKILL.md +45 -0
- package/packages/agent-skills/assets/tdd/SKILL.md +49 -0
- package/packages/agent-skills/assets/tdd/references/mocking.md +59 -0
- package/packages/agent-skills/assets/tdd/references/tests.md +77 -0
- package/packages/agent-skills/assets/testing/SKILL.md +54 -0
- package/packages/agent-skills/assets/to-feature/SKILL.md +91 -0
- package/packages/agent-skills/assets/to-feature/references/FEATURE-SPEC-TEMPLATE.md +88 -0
- package/packages/agent-skills/assets/to-workitems/SKILL.md +90 -0
- package/packages/agent-skills/assets/to-workitems/references/AZURE-DEVOPS-HIERARCHY.md +118 -0
- package/packages/agent-skills/assets/to-workitems/references/TICKET-TEMPLATES.md +70 -0
- package/packages/agent-skills/assets/wayfinder/SKILL.md +100 -0
- package/packages/agent-skills/assets/wayfinder/references/TEMPLATES.md +35 -0
- package/packages/agent-skills/assets/wayfinder/references/TICKET-TYPES.md +8 -0
- package/packages/agent-skills/deploy-profile.json +9 -0
- package/packages/agent-skills/deploy-profile.schema.json +45 -0
- package/packages/agent-skills/dist/deploy.d.ts +27 -0
- package/packages/agent-skills/dist/deploy.d.ts.map +1 -0
- package/packages/agent-skills/dist/deploy.js +186 -0
- package/packages/agent-skills/dist/deploy.js.map +1 -0
- package/packages/agent-skills/dist/doctor.d.ts +24 -0
- package/packages/agent-skills/dist/doctor.d.ts.map +1 -0
- package/packages/agent-skills/dist/doctor.js +141 -0
- package/packages/agent-skills/dist/doctor.js.map +1 -0
- package/packages/agent-skills/dist/fs-utils.d.ts +8 -0
- package/packages/agent-skills/dist/fs-utils.d.ts.map +1 -0
- package/packages/agent-skills/dist/fs-utils.js +40 -0
- package/packages/agent-skills/dist/fs-utils.js.map +1 -0
- package/packages/agent-skills/dist/index.d.ts +8 -0
- package/packages/agent-skills/dist/index.d.ts.map +1 -0
- package/packages/agent-skills/dist/index.js +8 -0
- package/packages/agent-skills/dist/index.js.map +1 -0
- package/packages/agent-skills/dist/legacy-lock.d.ts +44 -0
- package/packages/agent-skills/dist/legacy-lock.d.ts.map +1 -0
- package/packages/agent-skills/dist/legacy-lock.js +121 -0
- package/packages/agent-skills/dist/legacy-lock.js.map +1 -0
- package/packages/agent-skills/dist/list.d.ts +23 -0
- package/packages/agent-skills/dist/list.d.ts.map +1 -0
- package/packages/agent-skills/dist/list.js +75 -0
- package/packages/agent-skills/dist/list.js.map +1 -0
- package/packages/agent-skills/dist/manifest.d.ts +15 -0
- package/packages/agent-skills/dist/manifest.d.ts.map +1 -0
- package/packages/agent-skills/dist/manifest.js +57 -0
- package/packages/agent-skills/dist/manifest.js.map +1 -0
- package/packages/agent-skills/dist/profile.d.ts +41 -0
- package/packages/agent-skills/dist/profile.d.ts.map +1 -0
- package/packages/agent-skills/dist/profile.js +86 -0
- package/packages/agent-skills/dist/profile.js.map +1 -0
- package/packages/agent-skills/dist/skill-config.d.ts +24 -0
- package/packages/agent-skills/dist/skill-config.d.ts.map +1 -0
- package/packages/agent-skills/dist/skill-config.js +68 -0
- package/packages/agent-skills/dist/skill-config.js.map +1 -0
- package/packages/agent-skills/dist/skill-meta.d.ts +17 -0
- package/packages/agent-skills/dist/skill-meta.d.ts.map +1 -0
- package/packages/agent-skills/dist/skill-meta.js +67 -0
- package/packages/agent-skills/dist/skill-meta.js.map +1 -0
- package/packages/agent-skills/package.json +31 -0
- package/packages/agent-skills/src/deploy.ts +222 -0
- package/packages/agent-skills/src/doctor.ts +178 -0
- package/packages/agent-skills/src/fs-utils.ts +40 -0
- package/packages/agent-skills/src/index.ts +29 -0
- package/packages/agent-skills/src/legacy-lock.ts +152 -0
- package/packages/agent-skills/src/list.ts +94 -0
- package/packages/agent-skills/src/manifest.ts +66 -0
- package/packages/agent-skills/src/profile.ts +128 -0
- package/packages/agent-skills/src/skill-config.ts +75 -0
- package/packages/agent-skills/src/skill-meta.ts +78 -0
- package/packages/agent-skills/tsconfig.build.json +13 -0
- package/packages/agent-skills/tsconfig.json +23 -0
- package/packages/azdo/README.md +111 -0
- package/packages/azdo/package.json +21 -0
- package/packages/azdo/src/azdo-pl.ts +275 -0
- package/packages/azdo/src/azdo-pr-review.ts +160 -0
- package/packages/azdo/src/azdo-pr.ts +289 -0
- package/packages/azdo/src/azdo-repo-doctor.ts +839 -0
- package/packages/azdo/src/azdo-wit.ts +145 -0
- package/packages/azdo/src/cli.ts +251 -0
- package/packages/azdo/src/lib/agent-identity.ts +198 -0
- package/packages/azdo/src/lib/agent-token.ts +167 -0
- package/packages/azdo/src/lib/client.ts +259 -0
- package/packages/azdo/src/lib/graph-identity.ts +153 -0
- package/packages/azdo/src/lib/validate-pr-metadata.ts +57 -0
- package/packages/azdo/src/mcp-server.ts +209 -0
- package/packages/azdo/src/tool-dispatch.ts +204 -0
- package/packages/azdo/tsconfig.json +13 -0
- package/packages/fleet/jobs/git-maintain/src/main.ts +588 -0
- package/packages/fleet/manifest.json +207 -0
- package/packages/fleet/manifest.schema.json +283 -0
- package/packages/fleet/src/default-agent-file.ts +144 -0
- package/packages/fleet/src/install-adl-package.ts +178 -0
- package/packages/fleet/src/install-embedding-model.ts +412 -0
- package/packages/fleet/src/launch-agents.ts +649 -0
- package/packages/fleet/src/managed-settings.ts +278 -0
- package/packages/fleet/src/scratch-reap.ts +601 -0
- package/packages/fleet/src/vscode-settings.ts +705 -0
- package/packages/fleet/systemd/adl-azure-agent-update.service +13 -0
- package/packages/fleet/systemd/adl-azure-agent-update.timer +10 -0
- package/packages/repo-controls/AGENTS.md +96 -0
- package/packages/repo-controls/CLAUDE.md +1 -0
- package/packages/repo-controls/LICENSE +20 -0
- package/packages/repo-controls/README.md +493 -0
- package/packages/repo-controls/assets/enable-integration-auto-complete.mjs +79 -0
- package/packages/repo-controls/assets/promote.ts +371 -0
- package/packages/repo-controls/assets/version-bump.sh +189 -0
- package/packages/repo-controls/azure-pipelines.yml +274 -0
- package/packages/repo-controls/bin/adl-repo-controls.ts +10 -0
- package/packages/repo-controls/bunfig.toml +58 -0
- package/packages/repo-controls/package/adl-compliance/AGENTS.md +163 -0
- package/packages/repo-controls/package/adl-compliance/CLAUDE.md +1 -0
- package/packages/repo-controls/package/adl-compliance/conftest.py +78 -0
- package/packages/repo-controls/package/adl-compliance/pyproject.toml +31 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/__init__.py +50 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/__init__.py +98 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/__init__.py +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/check.py +210 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-bad-status/docs/architecture/overview.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-bad-status/docs/decisions/adr-901-proposed.md +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-broken-backlink/docs/decisions/adr-902-dangling.md +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-clean/docs/architecture/overview.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-clean/docs/decisions/adr-900-example.md +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-frontmatter-mismatch/.plans/b_committed/26-08-08-lifecycle-fixture.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-frontmatter-mismatch/.specs/demo/lifecycle.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-frontmatter-mismatch/docs/decisions/adr-903-frontmatter-mismatch.md +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-inactive-plan/.plans/c_done/26-08-08-completed-fixture.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-inactive-plan/.specs/demo/lifecycle.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-inactive-plan/docs/decisions/adr-904-completed-plan.md +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/test_check.py +127 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/__init__.py +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/check.py +91 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/CLAUDE.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/architecture/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/compliance/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/decisions/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/index.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/operations/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/research/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/stray-root-file.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/totally-made-up/nonsense.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/test_check.py +106 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/__init__.py +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/check.py +291 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/fixtures/clean/backend/clean.rs +1 -0
- 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 +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/fixtures/violation/backend/escaped.rs +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/fixtures/violation/backend/raw.rs +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/fixtures/violation/backend//346/226/207/344/273/266.rs +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/test_check.py +193 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/index_updated/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/index_updated/check.py +140 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/index_updated/fixtures/index-updated-clean/docs/architecture/foo.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/index_updated/fixtures/index-updated-clean/docs/architecture/index.md +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/index_updated/fixtures/index-updated-violation/docs/architecture/foo.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/index_updated/fixtures/index-updated-violation/docs/architecture/index.md +9 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/index_updated/test_check.py +98 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/check.py +378 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/docs-knowledge-indexes.yaml +192 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-clean/docs/index.md +14 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-clean/docs/one.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-clean/docs/two.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-clean/docs-knowledge-indexes.yaml +20 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-duplicate/docs/index.md +15 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-duplicate/docs/one.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-duplicate/docs/two.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-duplicate/docs-knowledge-indexes.yaml +16 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-missing-entry/docs/index.md +13 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-missing-entry/docs/one.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-missing-entry/docs/two.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-missing-entry/docs-knowledge-indexes.yaml +16 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/test_check.py +102 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/check.py +387 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/fixtures/ledger-bad-date/plans/LEDGER.md +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/fixtures/ledger-clean/plans/LEDGER.md +6 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/fixtures/ledger-empty-table/plans/LEDGER.md +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/fixtures/ledger-long-event/plans/LEDGER.md +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/fixtures/ledger-violation/plans/LEDGER.md +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/test_check.py +427 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/markdown_ast/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/markdown_ast/check.py +84 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/markdown_ast/fixtures/markdown-structure-bad-fence/docs/bad-fence.md +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/markdown_ast/fixtures/markdown-structure-bad-fence/docs/valid.md +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/markdown_ast/fixtures/markdown-structure-bad-frontmatter/docs/bad-front-matter.md +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/markdown_ast/fixtures/markdown-structure-bad-frontmatter/docs/valid.md +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/markdown_ast/fixtures/markdown-structure-clean/docs/valid.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/markdown_ast/test_check.py +126 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/check.py +210 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/docs-okf-profiles.yaml +119 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-clean/docs/architecture/demo.md +17 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-clean/docs-okf-profiles.yaml +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-violation/docs/architecture/bad-status.md +17 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-violation/docs-okf-profiles.yaml +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/test_check.py +49 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/register.py +159 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/check.py +578 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-clean/docs/architecture/backend/crate-overview.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-clean/docs/architecture/team/team-overview.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-clean/docs/compliance/controls/control-matrix.md +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-clean/docs/compliance/controls/control-matrix.yaml +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-clean/docs/research/benchmarks/note.md +24 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/architecture/backend/crate-overview.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/architecture/product/stable-delivery.md +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/architecture/product/stable-recommendation.md +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/architecture/product/target-narration.md +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/architecture/team/team-overview.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/compliance/controls/control-matrix.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/compliance/controls/control-matrix.yaml +17 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/research/benchmarks/bad-research.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/test_check.py +461 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/__init__.py +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/check.py +124 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/.workflows/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/.workflows/CLAUDE.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/CLAUDE.md +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/INVARIANTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/bad-pointer/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/bad-pointer/CLAUDE.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/docs/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/docs/CLAUDE.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/missing-pair/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/owned/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/owned/CLAUDE.md +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/test_check.py +116 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/ci_paths/__init__.py +13 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/ci_paths/check.py +380 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/ci_paths/fixtures/redeclared-workflows-tree/automation/pipelines/pr-validation.yaml +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/ci_paths/test_check.py +274 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/check.py +227 -0
- 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 +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-clean/grants.yaml +6 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/grants.yaml +6 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/grants.yaml +6 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/test_check.py +138 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/check.py +240 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/fixtures/markdown-trees-clean/.plans/a_new/plan.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/fixtures/markdown-trees-clean/backend/AGENTS.md +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/fixtures/markdown-trees-clean/docs/page.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/fixtures/markdown-trees-stray/backend/notes.md +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/fixtures/markdown-trees-stray/docs/page.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/test_check.py +220 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/open_work_cap/__init__.py +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/open_work_cap/check.py +225 -0
- 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 +5 -0
- 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 +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/open_work_cap/test_check.py +330 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/check.py +240 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/agent/crates/enact-providers/src/snapshots/README.md +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/mobile/assets/images/icon.png +1 -0
- 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 +1 -0
- 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 +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/public/pwa/icon-192.png +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/resources/product.png +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-stray/apps/legacy/file.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-stray/backend/crates/enact-session/src/backend/README.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-stray/frontend/unapproved/screenshot.png +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/test_check.py +230 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plan_metadata.py +53 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/__init__.py +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/check.py +438 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/fixtures/plans-layout-clean/plans/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/fixtures/plans-layout-clean/plans/features/az347-test-coverage/items/az351-restore-entrypoint.md +9 -0
- 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 +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/fixtures/plans-layout-clean/plans/templates/feature.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/fixtures/plans-layout-violation/plans/features/az347-test-coverage/items/az351-restore-entrypoint.md +9 -0
- 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 +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/test_check.py +461 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/check.py +62 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/NotAMigration.sql +1 -0
- 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 +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/001_init.sql +1 -0
- 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 +1 -0
- 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 +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/004_MixedCase.sql +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/test_check.py +116 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/check.py +188 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-broken/.plans/c_done/26-07-27-history.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-broken/docs/README.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-broken/docs/architecture/product/links.md +20 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-broken/docs/architecture/product/route-target.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-clean/.plans/c_done/26-07-27-history.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-clean/docs/README.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-clean/docs/architecture/product/links.md +20 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-clean/docs/architecture/product/route-target.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/test_check.py +166 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/check.py +135 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.agents/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.changeset/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.claude/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.code-review-graph/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.code-review-graph_old/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.codex/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.cursor/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.cursorrules +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.dockerignore +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.docs/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.donors/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.gitattributes +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.kimi-code/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.lfsconfig +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.mcp.json +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.opencode/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.workflows/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/CHANGELOG.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/CLAUDE-INVARIANTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/CLAUDE.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/INDEPENDENT-VERIFICATION.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/INVARIANTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/LICENSE +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/NOTICE +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/README.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/RELEASE.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/VERSION +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/backend/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/compliance/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/dev/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/docker/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/docs/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/frontend/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/infra/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/justfile +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/opencode.jsonc +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/rule-tests/undeclared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/rules/undeclared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/unapproved-root/undeclared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/undeclared-root-file.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/test_check.py +122 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/check.py +290 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/.changeset/some-change.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/.plans/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/.specs/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/.workflows/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/CHANGELOG.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/CLAUDE.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/INDEPENDENT-VERIFICATION.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/INVARIANTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/README.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/RELEASE.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/STRAY.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/docs/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/docs/architecture/note.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/frontend/README.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-missing-guide/.workflows/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-missing-guide/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-missing-guide/README.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-missing-guide/docs/overview.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-missing-guide/plans/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/test_check.py +329 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/check.py +127 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/a/b/c/d/at-limit.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/a/b/c/d/e/too-deep.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-01.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-02.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-03.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-04.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-05.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-06.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-07.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-08.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-09.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-10.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-11.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-12.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-13.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-14.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-15.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-16.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/test_check.py +163 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/__init__.py +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/check.py +169 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/attribute-without-conversion/.gitattributes +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/attribute-without-conversion/large file.bin +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/clean/.gitattributes +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/clean/large file.bin +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/clean/small.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/missing-filter/large file.bin +0 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/unmatched-extension/.gitattributes +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/unmatched-extension/payload.dat +0 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/test_check.py +133 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/__init__.py +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/check.py +129 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/fixtures/disjoint/gate-registry.yaml +13 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/fixtures/empty/gate-registry.yaml +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/fixtures/overlapping/gate-registry.yaml +13 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/test_check.py +109 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/__init__.py +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/check.py +149 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/fixtures/clean/docs/readme.md +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/fixtures/relevant/VERSION +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/test_check.py +151 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/check.py +202 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/aligned/.workflows/changesets/package.json +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/aligned/.workflows/package.json +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/aligned/CHANGELOG.md +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/aligned/VERSION +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/mismatched/.workflows/changesets/package.json +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/mismatched/.workflows/package.json +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/mismatched/CHANGELOG.md +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/mismatched/VERSION +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/test_check.py +162 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/__init__.py +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/check.py +103 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/compliance_py/checks/git-bad.sh +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/compliance_py/checks/git-note.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/compliance_py/checks/good.sh +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/compliance_py/checks/grep-bad.sh +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/compliance_py/checks/grep-note.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/compliance_py/checks/grep-trailing.sh +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/compliance_py/checks/notes.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/elsewhere/loose-git.sh +6 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/elsewhere/loose-grep.sh +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/test_check.py +117 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/ignored_paths/__init__.py +13 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/ignored_paths/check.py +265 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/ignored_paths/fixtures/ignored-paths/keep.log +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/ignored_paths/fixtures/ignored-paths/src/main.rs +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/ignored_paths/test_check.py +180 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/license_declared/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/license_declared/check.py +84 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/license_declared/fixtures/license-declared-clean/LICENSE +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/license_declared/fixtures/license-declared-mismatch/LICENSE +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/license_declared/fixtures/license-declared-missing/README.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/license_declared/test_check.py +66 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/check.py +167 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/backend/Cargo.lock +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/backend/Cargo.toml +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/backend/rust-toolchain.toml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/backend/src/main.rs +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/frontend/bun.lock +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/backend/Cargo.lock +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/backend/Cargo.toml +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/backend/rust-toolchain.toml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/backend/src/main.rs +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/frontend/bun.lock +0 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/test_check.py +109 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/cli.py +483 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/__init__.py +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/ast_grep.py +199 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/batch.py +52 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/check.py +303 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/constants.py +106 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/context.py +99 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/errors.py +32 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/finding.py +65 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/models.py +40 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/receipt.py +63 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/scope.py +82 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/verdict.py +161 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/__init__.py +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/config.py +131 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/config.toml +30 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/docs_shape.py +65 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/gate-registry.alt.yaml +791 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/gate-registry.schema.yaml +176 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/gate-registry.yaml +791 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/grants-registry.yaml +112 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/grants.py +129 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/registry.py +281 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/root_shape.py +250 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/severity-policy.yaml +114 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/providers/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/runner.py +371 -0
- package/packages/repo-controls/package/adl-compliance/uv.lock +199 -0
- package/packages/repo-controls/package.json +33 -0
- package/packages/repo-controls/scripts/hooks/commit-msg +63 -0
- package/packages/repo-controls/scripts/hooks/lib/hook-log.sh +62 -0
- package/packages/repo-controls/scripts/hooks/post-checkout +15 -0
- package/packages/repo-controls/scripts/hooks/post-commit +18 -0
- package/packages/repo-controls/scripts/hooks/pre-commit +82 -0
- package/packages/repo-controls/scripts/hooks/pre-push +144 -0
- package/packages/repo-controls/src/azdo-push.ts +463 -0
- package/packages/repo-controls/src/azure-devops-governance.ts +248 -0
- package/packages/repo-controls/src/azure-devops-remote.ts +61 -0
- package/packages/repo-controls/src/cli.ts +188 -0
- package/packages/repo-controls/src/compliance-config.ts +200 -0
- package/packages/repo-controls/src/config.ts +690 -0
- package/packages/repo-controls/src/constants.ts +97 -0
- package/packages/repo-controls/src/coverage-ratchet.ts +153 -0
- package/packages/repo-controls/src/doc-freshness.ts +172 -0
- package/packages/repo-controls/src/doctor.ts +304 -0
- package/packages/repo-controls/src/findings-ratchet.ts +163 -0
- package/packages/repo-controls/src/gitignore-block.ts +253 -0
- package/packages/repo-controls/src/hook-log.ts +72 -0
- package/packages/repo-controls/src/hook.ts +694 -0
- package/packages/repo-controls/src/install.ts +506 -0
- package/packages/repo-controls/src/integrity.ts +104 -0
- package/packages/repo-controls/src/promote.ts +25 -0
- package/packages/repo-controls/src/runtime.ts +110 -0
- package/packages/repo-controls/src/workflows-drift.ts +106 -0
- package/packages/repo-controls/src/worktree-guard.ts +272 -0
- package/packages/repo-controls/src/worktree-limit.ts +11 -0
- package/packages/repo-controls/tsconfig.json +14 -0
- package/packages/repo-controls/workflows/scripts/release/verify-npm-artifact.ts +119 -0
|
@@ -0,0 +1,694 @@
|
|
|
1
|
+
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
|
|
2
|
+
import { tmpdir } from 'node:os'
|
|
3
|
+
import { join } from 'node:path'
|
|
4
|
+
import { loadComplianceConfig } from './compliance-config.ts'
|
|
5
|
+
import { configEnv, type FindingsConfig, loadConfig, parseConfig, type StaticCheck } from './config.ts'
|
|
6
|
+
import { BUNDLE_ROOT, COMPLIANCE_ROOT, HOOK_NAMES, type HookName } from './constants.ts'
|
|
7
|
+
import { docFreshnessProblems, inScope } from './doc-freshness.ts'
|
|
8
|
+
import { azureDevOpsPromotionGovernanceChecks, type Check, doctor, type DoctorReport } from './doctor.ts'
|
|
9
|
+
import { commitRequiredProblems, integrityProblems } from './integrity.ts'
|
|
10
|
+
import { type CoverageSummary, coverageRegressions, readSummary } from './coverage-ratchet.ts'
|
|
11
|
+
import { type Floor, findingsProblems, parseCounterOutput, parseFloor } from './findings-ratchet.ts'
|
|
12
|
+
import { bashProblem, capture, childEnv, type Env, resolveRepo, which } from './runtime.ts'
|
|
13
|
+
import { postCheckoutWorktreeGuardStep } from './worktree-guard.ts'
|
|
14
|
+
|
|
15
|
+
export const isHookName = (name: string): name is HookName => (HOOK_NAMES as readonly string[]).includes(name)
|
|
16
|
+
|
|
17
|
+
/** Bundled enact-m5 tools runnable against a repository via `adl-repo-controls run`. */
|
|
18
|
+
export const TOOLS = {
|
|
19
|
+
/** The bundled Python compliance engine — a separate runtime (`uv`), no bundled script of ours. */
|
|
20
|
+
compliance: { runtime: 'uv' },
|
|
21
|
+
} as const
|
|
22
|
+
export type ToolName = keyof typeof TOOLS
|
|
23
|
+
export const isToolName = (name: string): name is ToolName => Object.hasOwn(TOOLS, name)
|
|
24
|
+
|
|
25
|
+
export interface RunContext {
|
|
26
|
+
env: Env
|
|
27
|
+
cwd: string
|
|
28
|
+
err: (line: string) => void
|
|
29
|
+
/** Progress the hook wants seen. Defaults to stderr's sink when not supplied. */
|
|
30
|
+
out?: (line: string) => void
|
|
31
|
+
/**
|
|
32
|
+
* What the bundled script's stdin is wired to. `inherit` is the default and
|
|
33
|
+
* the production answer: git pipes the pushed refs into the hook process, and
|
|
34
|
+
* `hooks/pre-push` consumes them with `push_updates="$(cat)"`.
|
|
35
|
+
*
|
|
36
|
+
* That `cat` is why this is configurable at all. A caller that invokes the
|
|
37
|
+
* hook IN PROCESS -- the test suite -- hands the child whatever stdin it
|
|
38
|
+
* happens to own. On a developer machine that stream is already at EOF, so
|
|
39
|
+
* `cat` returns instantly and the hook looks fine. On the pipeline agent it
|
|
40
|
+
* stays open, `cat` blocks forever, and the test dies on its timeout with
|
|
41
|
+
* nothing to show for it. Raising the timeout only changes how long it takes
|
|
42
|
+
* to fail; the fix is to stop relying on ambient stdin.
|
|
43
|
+
*/
|
|
44
|
+
stdin?: 'inherit' | 'ignore'
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Runs one bundled script with the repository's config exported; returns its exit status. */
|
|
48
|
+
function runBundled(runtime: 'bash' | 'bun', script: string, args: string[], repo: string, workdir: string, context: RunContext): number {
|
|
49
|
+
const problem = bashProblem(context.env)
|
|
50
|
+
if (problem) throw new Error(problem)
|
|
51
|
+
const env = { ...context.env, ...configEnv(repo, loadConfig(repo)) }
|
|
52
|
+
const executable = which(runtime, context.env)
|
|
53
|
+
if (!executable) throw new Error(`${runtime} not found on PATH`)
|
|
54
|
+
const proc = Bun.spawnSync([executable, join(BUNDLE_ROOT, script), ...args], {
|
|
55
|
+
cwd: workdir,
|
|
56
|
+
env: childEnv(env),
|
|
57
|
+
stdin: context.stdin ?? 'inherit',
|
|
58
|
+
stdout: 'inherit',
|
|
59
|
+
stderr: 'inherit',
|
|
60
|
+
})
|
|
61
|
+
return proc.exitCode ?? 1
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Runs `adl-compliance` (a `uv`-managed Python project bundled at `COMPLIANCE_ROOT`)
|
|
66
|
+
* against the repository. `--root` is always injected first so a user-supplied `--root`
|
|
67
|
+
* after `--` overrides it (argparse's last-flag-wins); `--only` is injected from
|
|
68
|
+
* `[compliance].enabled` whenever it is non-empty, same override rule applies. Unlike
|
|
69
|
+
* `runBundled`, this never reads `[controls]`/`configEnv()` — that env means nothing to
|
|
70
|
+
* the Python side.
|
|
71
|
+
*/
|
|
72
|
+
function runUv(args: string[], repo: string, context: RunContext): number {
|
|
73
|
+
const executable = which('uv', context.env)
|
|
74
|
+
if (!executable) throw new Error('uv not found on PATH — required by `run compliance` (see README)')
|
|
75
|
+
const config = loadComplianceConfig(repo)
|
|
76
|
+
// Everything the repository declares about its own shape, passed through. Before
|
|
77
|
+
// this, `[controls.compliance].trees` was parsed, validated and 100%-covered by
|
|
78
|
+
// tests — and reached nothing, so 29 of 100 rows errored against this repo alone
|
|
79
|
+
// because `<compliance>` still resolved to the packaged default. `inputs` is the
|
|
80
|
+
// same shape for a check's named files, which had no override at all.
|
|
81
|
+
const injected = [
|
|
82
|
+
...(config.enabled.length > 0 ? ['--only', config.enabled.join(',')] : []),
|
|
83
|
+
...Object.entries(config.trees).flatMap(([name, path]) => ['--tree', `${name}=${path}`]),
|
|
84
|
+
...Object.entries(config.inputs).flatMap(([name, path]) => ['--input', `${name}=${path}`]),
|
|
85
|
+
...Object.entries(config.declarations).flatMap(([name, value]) => ['--declare', `${name}=${value}`]),
|
|
86
|
+
]
|
|
87
|
+
const proc = Bun.spawnSync(
|
|
88
|
+
[executable, 'run', '--project', COMPLIANCE_ROOT, 'adl-compliance', '--root', repo, ...injected, ...args],
|
|
89
|
+
{ cwd: repo, env: childEnv(context.env), stdin: 'inherit', stdout: 'inherit', stderr: 'inherit' },
|
|
90
|
+
)
|
|
91
|
+
return proc.exitCode ?? 1
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface StagedIndexSnapshot {
|
|
95
|
+
/** Root containing exactly the files and bytes currently stored in Git's index. */
|
|
96
|
+
root: string
|
|
97
|
+
/** Newline-delimited repository-relative paths in the complete staged snapshot. */
|
|
98
|
+
files: string
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Materialize the complete candidate commit and remove it after `use` returns.
|
|
103
|
+
*
|
|
104
|
+
* Compliance at pre-commit must grade the index, not the working tree. A changed-
|
|
105
|
+
* files list is insufficient because exact-zero gates have repository-wide
|
|
106
|
+
* invariants, while pointing the engine at the live checkout lets unstaged bytes
|
|
107
|
+
* change the verdict. `git checkout-index` is the one operation that gives both
|
|
108
|
+
* the staged bytes and staged path topology, including additions, deletions and
|
|
109
|
+
* renames. The file list comes from the same index and is declared exhaustive to
|
|
110
|
+
* the engine, so the snapshot never needs its own `.git` directory.
|
|
111
|
+
*/
|
|
112
|
+
export function withStagedIndexSnapshot<T>(
|
|
113
|
+
repo: string,
|
|
114
|
+
env: Env,
|
|
115
|
+
use: (snapshot: StagedIndexSnapshot) => T,
|
|
116
|
+
): T {
|
|
117
|
+
const container = mkdtempSync(join(tmpdir(), 'adl-compliance-index-'))
|
|
118
|
+
const root = join(container, 'tree')
|
|
119
|
+
const files = join(container, 'files.list')
|
|
120
|
+
mkdirSync(root)
|
|
121
|
+
|
|
122
|
+
try {
|
|
123
|
+
const listed = capture(['git', 'ls-files', '--cached', '-z'], repo, env)
|
|
124
|
+
if (listed.code !== 0) {
|
|
125
|
+
throw new Error(`git ls-files --cached failed: ${listed.stderr.trim()}`)
|
|
126
|
+
}
|
|
127
|
+
const paths = listed.stdout.split('\0').filter(Boolean)
|
|
128
|
+
if (paths.length === 0) {
|
|
129
|
+
throw new Error('the staged index contains no files; an empty snapshot cannot pass compliance')
|
|
130
|
+
}
|
|
131
|
+
writeFileSync(files, `${paths.join('\n')}\n`)
|
|
132
|
+
|
|
133
|
+
const exported = capture(
|
|
134
|
+
['git', 'checkout-index', '--all', '--force', `--prefix=${root}/`],
|
|
135
|
+
repo,
|
|
136
|
+
{ ...env, GIT_LFS_SKIP_SMUDGE: '1' },
|
|
137
|
+
)
|
|
138
|
+
if (exported.code !== 0) {
|
|
139
|
+
throw new Error(`git checkout-index failed: ${exported.stderr.trim()}`)
|
|
140
|
+
}
|
|
141
|
+
return use({ root, files })
|
|
142
|
+
} finally {
|
|
143
|
+
rmSync(container, { recursive: true, force: true })
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** Whether the candidate commit itself arms compliance. */
|
|
148
|
+
export function stagedComplianceEnabled(repo: string, env: Env): boolean {
|
|
149
|
+
const shown = capture(['git', 'show', ':adl-config.toml'], repo, env)
|
|
150
|
+
if (shown.code !== 0) {
|
|
151
|
+
if (loadConfig(repo).preCommit.compliance) {
|
|
152
|
+
throw new Error(
|
|
153
|
+
'compliance is enabled in the working tree but adl-config.toml is absent from the staged index',
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
return false
|
|
157
|
+
}
|
|
158
|
+
return parseConfig(shown.stdout).preCommit.compliance
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* `last_update` freshness over the STAGED INDEX, in this package rather than in the
|
|
163
|
+
* bundled script: this is the package's own code, not a copy of a consumer's.
|
|
164
|
+
*
|
|
165
|
+
* Blobs are read with `git show :<path>`, the index version, for the same reason the
|
|
166
|
+
* bundled biome step snapshots the index with `git checkout-index`: the rule grades
|
|
167
|
+
* what is being committed, not what happens to be in the work tree.
|
|
168
|
+
*/
|
|
169
|
+
function stagedDocFreshness(repo: string, now: Date, context: RunContext): number {
|
|
170
|
+
const listed = capture(['git', 'diff', '--cached', '--name-only', '--diff-filter=ACMR', '-z'], repo, context.env)
|
|
171
|
+
if (listed.code !== 0) throw new Error(`git diff --cached failed: ${listed.stderr.trim()}`)
|
|
172
|
+
|
|
173
|
+
const docs = listed.stdout
|
|
174
|
+
.split('\0')
|
|
175
|
+
.filter((path) => path !== '' && inScope(path))
|
|
176
|
+
.map((path) => ({ path, text: capture(['git', 'show', `:${path}`], repo, context.env).stdout }))
|
|
177
|
+
|
|
178
|
+
const problems = docFreshnessProblems(docs, now)
|
|
179
|
+
if (problems.length === 0) return 0
|
|
180
|
+
|
|
181
|
+
context.err('pre-commit: FAIL — staged documentation is not stamped with a current last_update.')
|
|
182
|
+
for (const problem of problems) context.err(` - ${problem.path}: ${problem.message}`)
|
|
183
|
+
context.err(` ${problems[0]?.hint}`)
|
|
184
|
+
return 1
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Runs each declared counter and grades its paths against the floor.
|
|
189
|
+
*
|
|
190
|
+
* Lives in `src/` because it is mechanism: this package decides WHEN a gate
|
|
191
|
+
* runs and grades the result. `scripts/` holds only what a hook execs.
|
|
192
|
+
*
|
|
193
|
+
* A counter that exits non-zero has not run. That is could-not-run and it
|
|
194
|
+
* blocks, because the alternative -- treating a broken counter as "no findings"
|
|
195
|
+
* -- is the empty-scope false pass this estate keeps paying for.
|
|
196
|
+
*/
|
|
197
|
+
export function findingsRatchetReport(
|
|
198
|
+
findings: FindingsConfig,
|
|
199
|
+
readFloor: () => string,
|
|
200
|
+
runCounter: (command: string) => { code: number; stdout: string; stderr: string },
|
|
201
|
+
err: (line: string) => void,
|
|
202
|
+
): number {
|
|
203
|
+
const counters = Object.entries(findings.counters)
|
|
204
|
+
|
|
205
|
+
if (counters.length === 0) {
|
|
206
|
+
err('pre-push: FAIL — pre_push.findings_ratchet is on but [controls.findings.counters] is empty.')
|
|
207
|
+
err(' A ratchet with nothing to measure grades nothing and would pass every push.')
|
|
208
|
+
return 1
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
let floor: Floor
|
|
212
|
+
try {
|
|
213
|
+
floor = parseFloor(readFloor())
|
|
214
|
+
} catch (error) {
|
|
215
|
+
err(`pre-push: FAIL — cannot read the findings floor ${findings.floor}:`)
|
|
216
|
+
err(` ${error instanceof Error ? error.message : String(error)}`)
|
|
217
|
+
return 1
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
let failed = false
|
|
221
|
+
for (const [name, command] of counters) {
|
|
222
|
+
const run = runCounter(command)
|
|
223
|
+
if (run.code !== 0) {
|
|
224
|
+
err(`pre-push: FAIL — findings counter '${name}' did not run (exit ${run.code}).`)
|
|
225
|
+
err(` ${command}`)
|
|
226
|
+
if (run.stderr.trim() !== '') err(` ${run.stderr.trim().split('\n').slice(-3).join('\n ')}`)
|
|
227
|
+
err(' A counter that cannot run is could-not-run, never zero findings.')
|
|
228
|
+
failed = true
|
|
229
|
+
continue
|
|
230
|
+
}
|
|
231
|
+
for (const problem of findingsProblems(name, parseCounterOutput(name, run.stdout), floor)) {
|
|
232
|
+
if (problem.fails) {
|
|
233
|
+
failed = true
|
|
234
|
+
err(`pre-push: FAIL — ${problem.message}`)
|
|
235
|
+
} else {
|
|
236
|
+
err(`pre-push: note — ${problem.message}`)
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (failed) {
|
|
241
|
+
err(` The floor is ${findings.floor}. A listed file is amnestied entirely;`)
|
|
242
|
+
err(' a file not listed must be clean. Adding a line declares new debt.')
|
|
243
|
+
return 1
|
|
244
|
+
}
|
|
245
|
+
return 0
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Staged-coverage at commit: the repository's declared command, not ours.
|
|
250
|
+
*
|
|
251
|
+
* The bundled `pre-commit` used to shell into
|
|
252
|
+
* `$HOOK_REPO_ROOT/workflows/scripts/coverage/command.ts`, which is a path INTO
|
|
253
|
+
* this package running this package's copy of the consumer's code. `workflows/`
|
|
254
|
+
* is the tree the repository declares and owns; `.workflows/` is what this
|
|
255
|
+
* package deploys as owner of the git hooks. The package reaching into the
|
|
256
|
+
* former is the coupling being removed, and this is the seam that removes it.
|
|
257
|
+
*
|
|
258
|
+
* `[controls.coverage].produce` has been parsed, typed and documented since
|
|
259
|
+
* before this function existed, and read by nothing. The division is the same
|
|
260
|
+
* one `pre_push.static_checks` and `findings.counters` already draw: the repo
|
|
261
|
+
* says HOW to measure, the package decides WHEN and grades the exit status. No
|
|
262
|
+
* tool name appears here.
|
|
263
|
+
*
|
|
264
|
+
* Absence is deliberately NOT a skip. A step that measures nothing and reports
|
|
265
|
+
* success is the empty-scope false pass this estate keeps paying for, so with
|
|
266
|
+
* neither a declaration nor a fallback this is could-not-run.
|
|
267
|
+
*/
|
|
268
|
+
export function stagedCoverageStep(
|
|
269
|
+
coverage: { produce: string },
|
|
270
|
+
runCommand: (command: string) => { code: number; stdout: string; stderr: string },
|
|
271
|
+
fallback: (() => number) | null,
|
|
272
|
+
err: (line: string) => void,
|
|
273
|
+
): number {
|
|
274
|
+
const declared = coverage.produce.trim()
|
|
275
|
+
if (declared === '') {
|
|
276
|
+
if (fallback !== null) return fallback()
|
|
277
|
+
err('pre-commit: FAIL — staged coverage is on but [controls.coverage].produce declares no command,')
|
|
278
|
+
err(' and no bundled fallback is available. A step that measures nothing is not a pass.')
|
|
279
|
+
return 1
|
|
280
|
+
}
|
|
281
|
+
const run = runCommand(declared)
|
|
282
|
+
if (run.code !== 0) {
|
|
283
|
+
err(`pre-commit: FAIL — coverage.produce exited ${run.code}: ${declared}`)
|
|
284
|
+
if (run.stderr.trim() !== '') err(` ${run.stderr.trim().split('\n').slice(-3).join('\n ')}`)
|
|
285
|
+
}
|
|
286
|
+
return run.code
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* The coverage ratchet at push: did anything get worse between the baseline and
|
|
291
|
+
* what is being pushed.
|
|
292
|
+
*
|
|
293
|
+
* This is the whole of what the package does about coverage. Producing the
|
|
294
|
+
* summary is the repository's (`[controls.coverage].produce`); this reads the
|
|
295
|
+
* file the repository declared (`[controls.coverage].summary`) and grades it.
|
|
296
|
+
*
|
|
297
|
+
* `readBaseline` returning `null` means there is no baseline — a new branch, or
|
|
298
|
+
* the file is new — and that passes: nothing can have regressed against a floor
|
|
299
|
+
* that does not exist. But once a baseline EXISTS, a current summary that
|
|
300
|
+
* cannot be read blocks. "I could not measure" must never resolve to "nothing
|
|
301
|
+
* got worse"; that is the empty-baseline false pass in the other direction.
|
|
302
|
+
*/
|
|
303
|
+
export function coverageRatchetStep(
|
|
304
|
+
summaryPath: string,
|
|
305
|
+
readBaseline: () => string | null,
|
|
306
|
+
readCurrent: () => string,
|
|
307
|
+
err: (line: string) => void,
|
|
308
|
+
): number {
|
|
309
|
+
const baselineText = readBaseline()
|
|
310
|
+
if (baselineText === null) return 0
|
|
311
|
+
|
|
312
|
+
let baseline: CoverageSummary
|
|
313
|
+
let current: CoverageSummary
|
|
314
|
+
try {
|
|
315
|
+
baseline = readSummary(() => baselineText)
|
|
316
|
+
} catch (error) {
|
|
317
|
+
err(`pre-push: FAIL — the BASELINE ${summaryPath} is unreadable: ${error instanceof Error ? error.message : String(error)}`)
|
|
318
|
+
return 1
|
|
319
|
+
}
|
|
320
|
+
try {
|
|
321
|
+
current = readSummary(readCurrent)
|
|
322
|
+
} catch (error) {
|
|
323
|
+
err(`pre-push: FAIL — ${summaryPath} is unreadable, and a baseline exists: ${error instanceof Error ? error.message : String(error)}`)
|
|
324
|
+
err(' A summary that cannot be read is not a summary with no regressions.')
|
|
325
|
+
return 1
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
const regressions = coverageRegressions(baseline, current)
|
|
329
|
+
if (regressions.length === 0) return 0
|
|
330
|
+
err(`pre-push: FAIL — coverage regressed in ${summaryPath}:`)
|
|
331
|
+
for (const line of regressions) err(` - ${line}`)
|
|
332
|
+
return 1
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* The repository's declared commands for one hook.
|
|
337
|
+
*
|
|
338
|
+
* Every hook name has a seam, `post-commit` included. That one looks decorative
|
|
339
|
+
* and is not: a producer that DEFERS work from pre-commit -- enact-m5's coverage
|
|
340
|
+
* summary publish lock marks itself `awaiting-commit` and releases after the
|
|
341
|
+
* commit lands -- has nowhere to land it otherwise. A lock that is never
|
|
342
|
+
* released does not fail loudly; it fails on somebody's next commit.
|
|
343
|
+
*/
|
|
344
|
+
export function declaredChecksFor(
|
|
345
|
+
name: HookName,
|
|
346
|
+
config: {
|
|
347
|
+
preCommit: { staticChecks: StaticCheck[] }
|
|
348
|
+
prePush: { staticChecks: StaticCheck[] }
|
|
349
|
+
commitMsg: { staticChecks: StaticCheck[] }
|
|
350
|
+
postCommit: { staticChecks: StaticCheck[] }
|
|
351
|
+
},
|
|
352
|
+
): StaticCheck[] {
|
|
353
|
+
switch (name) {
|
|
354
|
+
case 'pre-commit':
|
|
355
|
+
return config.preCommit.staticChecks
|
|
356
|
+
case 'pre-push':
|
|
357
|
+
return config.prePush.staticChecks
|
|
358
|
+
case 'commit-msg':
|
|
359
|
+
return config.commitMsg.staticChecks
|
|
360
|
+
case 'post-commit':
|
|
361
|
+
return config.postCommit.staticChecks
|
|
362
|
+
// `post-checkout` is a fixed safety gate (the worktree-count backstop —
|
|
363
|
+
// see ./worktree-guard.ts), never a repository-customizable pipeline
|
|
364
|
+
// step: it has no `[controls.post_checkout]` config table and no seam
|
|
365
|
+
// here, on purpose — see tests/declared-hook-scripts.test.ts.
|
|
366
|
+
case 'post-checkout':
|
|
367
|
+
return []
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* The repository's declared pre-commit checks.
|
|
373
|
+
*
|
|
374
|
+
* This package decides WHEN a check runs and grades its exit status; the
|
|
375
|
+
* repository decides WHAT runs and which hook it runs in. Identical division to
|
|
376
|
+
* `pre_push.static_checks` and `findings.counters`, and no tool is named here --
|
|
377
|
+
* the package is language agnostic, so a Rust repository declaring `cargo
|
|
378
|
+
* clippy` and a TypeScript one declaring a linter are the same case to it.
|
|
379
|
+
*
|
|
380
|
+
* Every check runs even after one fails. One report per commit beats one
|
|
381
|
+
* failure per commit: a developer who must re-run to discover the next problem
|
|
382
|
+
* re-runs once per problem.
|
|
383
|
+
*/
|
|
384
|
+
export function preCommitChecks(
|
|
385
|
+
checks: readonly { label: string; run: string }[],
|
|
386
|
+
runCommand: (command: string) => { code: number; stdout: string; stderr: string },
|
|
387
|
+
err: (line: string) => void,
|
|
388
|
+
): number {
|
|
389
|
+
let failed = 0
|
|
390
|
+
for (const { label, run } of checks) {
|
|
391
|
+
const result = runCommand(run)
|
|
392
|
+
if (result.code === 0) continue
|
|
393
|
+
failed = 1
|
|
394
|
+
err(`pre-commit: FAIL — ${label} exited ${result.code}: ${run}`)
|
|
395
|
+
const detail = result.stderr.trim() || result.stdout.trim()
|
|
396
|
+
if (detail !== '') err(` ${detail.split('\n').slice(-5).join('\n ')}`)
|
|
397
|
+
}
|
|
398
|
+
return failed
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* The armed compliance rows, through an injected runner.
|
|
403
|
+
*
|
|
404
|
+
* Injectable for the same reason the other three steps are: the alternative is
|
|
405
|
+
* spawning `uv` and grading the real engine inside a unit test, which takes
|
|
406
|
+
* minutes. A gate that can only be tested by running everything it gates is a
|
|
407
|
+
* gate nobody tests.
|
|
408
|
+
*/
|
|
409
|
+
export function complianceStep(run: () => number): number {
|
|
410
|
+
return run()
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Read paths excluded from this commit, including untracked paths that have no
|
|
415
|
+
* index entry yet.
|
|
416
|
+
*
|
|
417
|
+
* `git status --porcelain=v1 -z` emits literal paths separated by NUL, so a
|
|
418
|
+
* filename's newline or non-ASCII bytes never become C-quoted syntax. Rename
|
|
419
|
+
* and copy records carry a second, origin path; consume it before reading the
|
|
420
|
+
* next status record.
|
|
421
|
+
*/
|
|
422
|
+
function dirtyPaths(porcelain: string): string[] {
|
|
423
|
+
const paths: string[] = []
|
|
424
|
+
const records = porcelain.split('\0')
|
|
425
|
+
for (let index = 0; index < records.length; index++) {
|
|
426
|
+
const record = records[index] as string
|
|
427
|
+
if (record.length < 4 || record[2] !== ' ') continue
|
|
428
|
+
const staged = record[0] as string
|
|
429
|
+
const worktree = record[1] as string
|
|
430
|
+
const hasOrigin = staged === 'R' || staged === 'C' || worktree === 'R' || worktree === 'C'
|
|
431
|
+
const origin = hasOrigin ? records[++index] : undefined
|
|
432
|
+
// An untracked path has no index entry, so it is necessarily omitted from
|
|
433
|
+
// this commit. Keep it: centrally managed dot paths must be staged rather
|
|
434
|
+
// than silently left behind.
|
|
435
|
+
if (staged === '?' && worktree === '?') {
|
|
436
|
+
paths.push(record.slice(3))
|
|
437
|
+
continue
|
|
438
|
+
}
|
|
439
|
+
if (worktree === ' ') continue
|
|
440
|
+
paths.push(record.slice(3))
|
|
441
|
+
// A worktree rename changes both paths. Keep the origin too, otherwise
|
|
442
|
+
// moving a protected path to an ordinary name would evade this half of the
|
|
443
|
+
// integrity check.
|
|
444
|
+
if (origin !== undefined && origin !== '') paths.push(origin)
|
|
445
|
+
}
|
|
446
|
+
return paths
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/** Refuses a commit while a protected worktree edit is excluded from its index. */
|
|
450
|
+
export function integrityStep(
|
|
451
|
+
porcelain: string,
|
|
452
|
+
watched: readonly string[],
|
|
453
|
+
err: (line: string) => void,
|
|
454
|
+
): number {
|
|
455
|
+
const paths = dirtyPaths(porcelain)
|
|
456
|
+
const problems = [...integrityProblems(paths, watched), ...commitRequiredProblems(paths, watched)]
|
|
457
|
+
if (problems.length === 0) return 0
|
|
458
|
+
for (const line of problems) err(line)
|
|
459
|
+
return 1
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* The final-index gate plus the dirty-but-excluded check. The index reader is
|
|
464
|
+
* separate from status because `git diff --cached --no-renames -z` is the
|
|
465
|
+
* authoritative final path set: crossing-boundary renames report both sides.
|
|
466
|
+
*/
|
|
467
|
+
export function integrityGate(
|
|
468
|
+
readStatus: () => { code: number; stdout: string },
|
|
469
|
+
readFinalStaged: () => { code: number; stdout: string },
|
|
470
|
+
watched: readonly string[],
|
|
471
|
+
err: (line: string) => void,
|
|
472
|
+
): number {
|
|
473
|
+
const status = readStatus()
|
|
474
|
+
if (status.code !== 0) {
|
|
475
|
+
err('pre-commit: FAIL — `git status` could not be read, so gate-file integrity is unknown.')
|
|
476
|
+
return 1
|
|
477
|
+
}
|
|
478
|
+
const staged = readFinalStaged()
|
|
479
|
+
if (staged.code !== 0) {
|
|
480
|
+
err('pre-commit: FAIL — `git diff --cached` could not be read, so final-index control integrity is unknown.')
|
|
481
|
+
return 1
|
|
482
|
+
}
|
|
483
|
+
const finalPaths = staged.stdout.split('\0').filter((path) => path !== '')
|
|
484
|
+
const dirty = dirtyPaths(status.stdout)
|
|
485
|
+
const problems = [
|
|
486
|
+
...integrityProblems([...finalPaths, ...dirty], watched),
|
|
487
|
+
...commitRequiredProblems(dirty, watched),
|
|
488
|
+
]
|
|
489
|
+
if (problems.length === 0) return 0
|
|
490
|
+
for (const line of problems) err(line)
|
|
491
|
+
return 1
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Read-only pre-commit gate. `doctor` proves the local hook surface is armed;
|
|
496
|
+
* repair is an explicit `install` operation, never an implicit commit side
|
|
497
|
+
* effect. As of 2026-09-28 (Tarun) this runs `doctor` with the Azure DevOps
|
|
498
|
+
* promotion-governance checks EXCLUDED (`includeAzureDevOpsGovernance: false`
|
|
499
|
+
* — see `runHook`'s `pre-commit` wiring below): those checks need network
|
|
500
|
+
* access and a minted Azure DevOps token, which a `git commit` must never
|
|
501
|
+
* require. They still run — fail-closed, by name — in the `pre-push` gate via
|
|
502
|
+
* `azureDevOpsPromotionGovernanceGate` below. A bare `adl-repo-controls
|
|
503
|
+
* doctor` run (not through a hook) keeps reporting everything.
|
|
504
|
+
*/
|
|
505
|
+
export function doctorGate(readDoctor: () => DoctorReport, err: (line: string) => void): number {
|
|
506
|
+
const report = readDoctor()
|
|
507
|
+
if (report.ok) return 0
|
|
508
|
+
err('pre-commit: FAIL — adl-repo-controls doctor found an unarmed control:')
|
|
509
|
+
for (const check of report.checks) {
|
|
510
|
+
if (check.status === 'fail') err(` ${check.id} ${check.message}`)
|
|
511
|
+
}
|
|
512
|
+
err(' Fix the named control, then rerun: adl-repo-controls doctor --repo . --json')
|
|
513
|
+
return 1
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* pre-push gate for the Azure DevOps promotion-governance checks alone
|
|
518
|
+
* (Tarun, 2026-09-28): these need network access and a minted Azure DevOps
|
|
519
|
+
* token, so they moved out of pre-commit and into pre-push, where a network
|
|
520
|
+
* requirement is already expected. Same fail-closed contract as `doctorGate`:
|
|
521
|
+
* unreadable evidence blocks the push, by name — never a warning, never a
|
|
522
|
+
* silent pass. `readChecks` reading `[controls.release]` itself (via
|
|
523
|
+
* `loadConfig`) can throw on a malformed config; that is reported the same
|
|
524
|
+
* way as an unarmed check rather than crashing the hook process.
|
|
525
|
+
*/
|
|
526
|
+
export function azureDevOpsPromotionGovernanceGate(readChecks: () => Check[], err: (line: string) => void): number {
|
|
527
|
+
let checks: Check[]
|
|
528
|
+
try {
|
|
529
|
+
checks = readChecks()
|
|
530
|
+
} catch (error) {
|
|
531
|
+
err('pre-push: FAIL — could not evaluate Azure DevOps promotion governance:')
|
|
532
|
+
err(` ${error instanceof Error ? error.message : String(error)}`)
|
|
533
|
+
return 1
|
|
534
|
+
}
|
|
535
|
+
const failed = checks.filter((check) => check.status === 'fail')
|
|
536
|
+
if (failed.length === 0) return 0
|
|
537
|
+
err('pre-push: FAIL — adl-repo-controls doctor found an unarmed Azure DevOps promotion control:')
|
|
538
|
+
for (const check of failed) err(` ${check.id} ${check.message}`)
|
|
539
|
+
err(' Fix the named control, then rerun: adl-repo-controls doctor --repo . --json')
|
|
540
|
+
return 1
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/** Real I/O around `findingsRatchetReport`. */
|
|
544
|
+
function runFindingsRatchet(repo: string, context: RunContext): number {
|
|
545
|
+
const config = loadConfig(repo)
|
|
546
|
+
return findingsRatchetReport(
|
|
547
|
+
config.findings,
|
|
548
|
+
() => readFileSync(join(repo, config.findings.floor), 'utf8'),
|
|
549
|
+
(command) => capture(['bash', '-c', command], repo, context.env),
|
|
550
|
+
context.err,
|
|
551
|
+
)
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/** `adl-repo-controls hook <name>` — invoked by the committed stubs, from the work tree root. */
|
|
555
|
+
export function runHook(name: HookName, args: string[], context: RunContext): number {
|
|
556
|
+
const top = capture(['git', 'rev-parse', '--show-toplevel'], context.cwd, context.env)
|
|
557
|
+
if (top.code !== 0) throw new Error(`not inside a git work tree: ${context.cwd}`)
|
|
558
|
+
const repo = top.stdout.trim()
|
|
559
|
+
// The worktree-count backstop (STATUS.md item 2, adl-m3-items). Git has no
|
|
560
|
+
// pre-worktree hook, so this cannot stop `git worktree add` from creating
|
|
561
|
+
// the checkout — it runs after, in the NEW worktree, and actively removes it
|
|
562
|
+
// when the repository is over the limit. See ./worktree-guard.ts for why
|
|
563
|
+
// this fires here and not just on the shell/agent-tool side
|
|
564
|
+
// (packages/agent-hooks's `git.worktree` denies agent-driven worktree
|
|
565
|
+
// creation outright; this is the backstop for a human, or any agent path
|
|
566
|
+
// that hook engine cannot see).
|
|
567
|
+
if (name === 'post-checkout') {
|
|
568
|
+
const code = postCheckoutWorktreeGuardStep(repo, args, context)
|
|
569
|
+
if (code !== 0) return code
|
|
570
|
+
}
|
|
571
|
+
// The atomic index gate comes first. A modified managed hook can make doctor
|
|
572
|
+
// fail too, but integrity must name every protected path rather than masking
|
|
573
|
+
// it behind that secondary symptom.
|
|
574
|
+
if (name === 'pre-commit') {
|
|
575
|
+
const code = integrityGate(
|
|
576
|
+
() => capture(['git', 'status', '--porcelain=v1', '-z', '--untracked-files=all'], repo, context.env),
|
|
577
|
+
() => capture(['git', 'diff', '--cached', '--name-only', '--no-renames', '-z'], repo, context.env),
|
|
578
|
+
loadConfig(repo).integrity.watched,
|
|
579
|
+
context.err,
|
|
580
|
+
)
|
|
581
|
+
if (code !== 0) return code
|
|
582
|
+
}
|
|
583
|
+
// After path integrity is clean, prove the local hook surface is armed.
|
|
584
|
+
// This path never writes or stages files. The Azure DevOps promotion-
|
|
585
|
+
// governance checks are deliberately excluded here (2026-09-28, Tarun):
|
|
586
|
+
// they need network access and a minted token, which a commit must never
|
|
587
|
+
// require — see azureDevOpsPromotionGovernanceGate below, run at pre-push.
|
|
588
|
+
if (name === 'pre-commit') {
|
|
589
|
+
const code = doctorGate(() => doctor(repo, context.env, { includeAzureDevOpsGovernance: false }), context.err)
|
|
590
|
+
if (code !== 0) return code
|
|
591
|
+
}
|
|
592
|
+
if (name === 'pre-commit' && loadConfig(repo).preCommit.docFreshness) {
|
|
593
|
+
const code = stagedDocFreshness(repo, new Date(), context)
|
|
594
|
+
if (code !== 0) return code
|
|
595
|
+
}
|
|
596
|
+
// The armed compliance gates, before the bundled script. Until this existed
|
|
597
|
+
// `[controls.compliance].enabled` armed nothing that ever ran: no bundled hook
|
|
598
|
+
// mentions compliance and `runHook` never reached `runUv`, so a gate was
|
|
599
|
+
// "enabled" and dormant. Off by default -- a repository opts in with
|
|
600
|
+
// `pre_commit.compliance = true`, the same way it opts into every other step.
|
|
601
|
+
if (name === 'pre-commit' && stagedComplianceEnabled(repo, context.env)) {
|
|
602
|
+
const code = withStagedIndexSnapshot(repo, context.env, (snapshot) => {
|
|
603
|
+
// Activation is itself read from the candidate commit. An unstaged config
|
|
604
|
+
// edit cannot turn a staged gate off (or on), and a commit introducing the
|
|
605
|
+
// gate proves it is armed before it lands.
|
|
606
|
+
return complianceStep(() =>
|
|
607
|
+
runUv(['--files', snapshot.files, '--exhaustive'], snapshot.root, context),
|
|
608
|
+
)
|
|
609
|
+
})
|
|
610
|
+
if (code !== 0) return code
|
|
611
|
+
}
|
|
612
|
+
// Staged coverage, through the repository's declared command. Was a hardcoded
|
|
613
|
+
// shell-out inside the bundled pre-commit into this package's copy of the
|
|
614
|
+
// consumer's coverage code; see `stagedCoverageStep`.
|
|
615
|
+
if (name === 'pre-commit' && loadConfig(repo).preCommit.stagedCoverage) {
|
|
616
|
+
const config = loadConfig(repo)
|
|
617
|
+
const code = stagedCoverageStep(
|
|
618
|
+
config.coverage,
|
|
619
|
+
(command) => capture(['bash', '-c', command], repo, context.env),
|
|
620
|
+
// No fallback. The bundled coverage mechanism is gone, so a repository
|
|
621
|
+
// that arms staged coverage without declaring `produce` is could-not-run,
|
|
622
|
+
// which is the honest answer rather than a step that measures nothing.
|
|
623
|
+
null,
|
|
624
|
+
context.err,
|
|
625
|
+
)
|
|
626
|
+
if (code !== 0) return code
|
|
627
|
+
}
|
|
628
|
+
// The Azure DevOps promotion-governance checks, moved here from pre-commit
|
|
629
|
+
// (2026-09-28, Tarun): network access and a minted token are already
|
|
630
|
+
// expected at push time, unlike at commit time. `azureDevOpsPromotionGovernanceChecks`
|
|
631
|
+
// itself returns `[]` (an unconditional pass) when the repository declares
|
|
632
|
+
// no `[controls.release]` at all, so this runs on every pre-push rather than
|
|
633
|
+
// behind its own config flag.
|
|
634
|
+
if (name === 'pre-push') {
|
|
635
|
+
const code = azureDevOpsPromotionGovernanceGate(
|
|
636
|
+
() => azureDevOpsPromotionGovernanceChecks(repo, context.env),
|
|
637
|
+
context.err,
|
|
638
|
+
)
|
|
639
|
+
if (code !== 0) return code
|
|
640
|
+
}
|
|
641
|
+
// The coverage ratchet at push. Was `command.ts check-push` inside the bundled
|
|
642
|
+
// pre-push, running the package's copy of the consumer's coverage code.
|
|
643
|
+
if (name === 'pre-push' && loadConfig(repo).prePush.coverageRatchet) {
|
|
644
|
+
const config = loadConfig(repo)
|
|
645
|
+
const rel = config.coverage.summary
|
|
646
|
+
const at = (ref: string) => {
|
|
647
|
+
const shown = capture(['git', 'show', `${ref}:${rel}`], repo, context.env)
|
|
648
|
+
return shown.code === 0 ? shown.stdout : null
|
|
649
|
+
}
|
|
650
|
+
const code = coverageRatchetStep(
|
|
651
|
+
rel,
|
|
652
|
+
() => at('HEAD~1'),
|
|
653
|
+
() => at('HEAD') ?? readFileSync(join(repo, rel), 'utf8'),
|
|
654
|
+
context.err,
|
|
655
|
+
)
|
|
656
|
+
if (code !== 0) return code
|
|
657
|
+
}
|
|
658
|
+
// The findings ratchet, before the bundled script, same shape as compliance
|
|
659
|
+
// above. `[controls.findings]` was parsed, defaulted, exported into every
|
|
660
|
+
// child process, documented and doctored -- and read by nothing. Opt-in via
|
|
661
|
+
// `pre_push.findings_ratchet`, off by default.
|
|
662
|
+
if (name === 'pre-push' && loadConfig(repo).prePush.findingsRatchet) {
|
|
663
|
+
const code = runFindingsRatchet(repo, context)
|
|
664
|
+
if (code !== 0) return code
|
|
665
|
+
}
|
|
666
|
+
// The package's standard bash: the shared policy every repository gets.
|
|
667
|
+
const standard = runBundled('bash', `hooks/${name}`, args, repo, context.cwd, context)
|
|
668
|
+
if (standard !== 0) return standard
|
|
669
|
+
|
|
670
|
+
// pre-push owns its declared static checks inside the bundled script: it
|
|
671
|
+
// exports immutable HEAD, runs them there, and caches the pass by tree OID.
|
|
672
|
+
// Running them again here would grade the dirty checkout a second time.
|
|
673
|
+
if (name === 'pre-push') return 0
|
|
674
|
+
|
|
675
|
+
// Then the repository's own script, on top (owner: "standard bash + script
|
|
676
|
+
// calling on top"). Declared per hook, run from the repo root, never named by
|
|
677
|
+
// this package. Absent means nothing runs -- there is no bundled default for
|
|
678
|
+
// a repository's own policy.
|
|
679
|
+
return preCommitChecks(
|
|
680
|
+
declaredChecksFor(name, loadConfig(repo)),
|
|
681
|
+
(command) => capture(['bash', '-c', command], repo, context.env),
|
|
682
|
+
context.err,
|
|
683
|
+
)
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
// `_tool` is unread on purpose. `compliance` is the only tool left, and it is a
|
|
687
|
+
// separate runtime (`uv`) rather than a bundled script of ours -- everything else
|
|
688
|
+
// became a CLI command or a repository-declared check. Dispatching on the name
|
|
689
|
+
// would be a branch no test could reach, but the parameter stays because it is
|
|
690
|
+
// what the CLI parsed and what a second runtime would key off.
|
|
691
|
+
export function runTool(_tool: ToolName, repoArg: string, args: string[], context: RunContext): number {
|
|
692
|
+
const repo = resolveRepo(repoArg)
|
|
693
|
+
return runUv(args, repo, context)
|
|
694
|
+
}
|