@amsterdamdatalabs/adl-agent-control-darwin-arm64 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,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `git.worktree` — worktree policy (STATUS.md item 2, L2/L3;
|
|
3
|
+
* docs/operations/worktree-guard.md; docs/operations/agent-permissions.md "route, don't block").
|
|
4
|
+
*
|
|
5
|
+
* HARDCUT 2026-09-27 (Tarun, via the coordinator, on top of the earlier
|
|
6
|
+
* "deny every worktree action" hardcut this rule used to implement): the
|
|
7
|
+
* blanket deny-all is replaced by a ROUTE-when-possible, cap-aware policy:
|
|
8
|
+
*
|
|
9
|
+
* - `git worktree list|remove|prune|repair` — ALLOW outright (`match`
|
|
10
|
+
* returns `null`). These are needed to RECONCILE existing worktrees
|
|
11
|
+
* (docs/operations/worktree-guard.md L6, and this cap's own remove hint), and none
|
|
12
|
+
* of them creates a new checkout, so none of them can push a repository
|
|
13
|
+
* over the 3-checkout cap.
|
|
14
|
+
* - `git worktree add` — the task instruction for this change describes a
|
|
15
|
+
* silent REWRITE to `adl worktree add …` (`updatedInput` +
|
|
16
|
+
* `permissionDecision: allow`, "the same mechanism other adl rewrite
|
|
17
|
+
* rules use"). That mechanism DOES NOT EXIST in this engine — verified,
|
|
18
|
+
* not assumed: `Severity` (`../spec.ts`) is only `'deny' | 'advise'`;
|
|
19
|
+
* `Decision`/`Finding` carry no replacement-command field anywhere in
|
|
20
|
+
* `../engine.ts`; `HostSpec.Decision` (`../../hosts/spec.ts`) has
|
|
21
|
+
* `verdict: 'allow' | 'deny' | 'ask'` plus `reason`/`agentMessage`
|
|
22
|
+
* strings only, and every `renderDecision` (`../../hosts/impl/{claude,
|
|
23
|
+
* codex,kimi,opencode}.ts`) renders exactly that shape — none of them
|
|
24
|
+
* ever emits `updatedInput`. A repo-wide grep for `updatedInput` finds
|
|
25
|
+
* exactly one subsystem that does this at all: `../../hooks/lean-ctx/
|
|
26
|
+
* scope-rewrite.ts`, a DIFFERENT hook (`lean-ctx hook rewrite`) with its
|
|
27
|
+
* own envelope, unrelated to `adl hook`'s `pre-tool-use` engine this
|
|
28
|
+
* rule runs in. Building real rewrite support means extending
|
|
29
|
+
* `Severity`/`Finding`/`Decision`/`HostSpec` and all four host adapters —
|
|
30
|
+
* files this rule's write scope does not include (git-worktree.ts + its
|
|
31
|
+
* tests/fixtures/README only). Reported as a blocker rather than faked;
|
|
32
|
+
* see this task's final report for the flag. Until that engine work
|
|
33
|
+
* lands, `add` gets the fallback docs/operations/agent-permissions.md's own
|
|
34
|
+
* Principles section already names for this exact situation: "An
|
|
35
|
+
* inexact rewrite is a deny with the `adl` command to use. The hook
|
|
36
|
+
* never guesses." — DENY, with the precise `adl worktree add` command to
|
|
37
|
+
* run instead.
|
|
38
|
+
* - `git worktree move|lock|unlock` — still DENIED: each mutates a
|
|
39
|
+
* worktree's registration or lock state without checking the cap or
|
|
40
|
+
* reconciling anything, and none is needed to reconcile toward the cap
|
|
41
|
+
* (unlike list/remove/prune/repair above).
|
|
42
|
+
* - Any other/unrecognized `worktree` subcommand (bare `git worktree`,
|
|
43
|
+
* `--help`, …) stays DENIED — fail-closed default, unchanged from the
|
|
44
|
+
* old blanket policy.
|
|
45
|
+
* - Claude's `EnterWorktree` tool and `Task`/`Agent` launched with
|
|
46
|
+
* `isolation: "worktree"` cannot be rewritten either (there is no
|
|
47
|
+
* replacement TOOL CALL to substitute, only a replacement shell command —
|
|
48
|
+
* even a working rewrite mechanism would not help here). Neither can be
|
|
49
|
+
* routed through `list`/`remove` the way `add` can, so instead of a flat
|
|
50
|
+
* deny this rule now counts the session's cwd repo's worktrees itself
|
|
51
|
+
* (`worktreeCountForCwd`, real `git worktree list --porcelain`, scoped to
|
|
52
|
+
* `process.cwd()` — the pre-tool-use hook process's own cwd IS the
|
|
53
|
+
* session's cwd, since the host spawns it there) and ALLOWS below the
|
|
54
|
+
* cap, DENIES at or above it with the same limit wording `add`'s deny and
|
|
55
|
+
* `adl worktree add`/`bin/git` use. The count is FAIL-CLOSED: a `git
|
|
56
|
+
* worktree list` that errors (not a repo, git missing, …) denies rather
|
|
57
|
+
* than guessing "must be fine".
|
|
58
|
+
*
|
|
59
|
+
* `MAX_WORKTREES = 3` is kept as a local literal, not imported from
|
|
60
|
+
* `packages/repo-controls/src/constants.ts` (the value this task's CLI step
|
|
61
|
+
* does import) — this rule is loaded into `BUILTIN_RULES` at process start
|
|
62
|
+
* for every hook invocation in this package, and a new cross-package import
|
|
63
|
+
* here is a materially different tradeoff (a security-critical, always-on
|
|
64
|
+
* hot path) than the CLI's own opt-in command. If `MAX_WORKTREES` ever
|
|
65
|
+
* changes, update it here, in `packages/repo-controls/src/constants.ts`, and
|
|
66
|
+
* in `apps/cli`'s copy — all three are load-bearing.
|
|
67
|
+
*
|
|
68
|
+
* The shell-side classification (`-C`, `-c`, env-prefix, chained commands,
|
|
69
|
+
* dynamic-token fail-closed, aliasing, …) is entirely UNCHANGED — it comes
|
|
70
|
+
* from `../shell/invocation.ts`'s classifier, which this rule does not
|
|
71
|
+
* touch. A chained `git status && git worktree add ../wt` is decomposed by
|
|
72
|
+
* that classifier into separate invocations before `match()` ever runs, so
|
|
73
|
+
* the `add` half is still denied on its own — this rule has no separate
|
|
74
|
+
* "chain" branch to add, unlike a true rewrite would have needed (a
|
|
75
|
+
* rewrite can only safely replace a chain's `git worktree add` segment when
|
|
76
|
+
* the rest of the chain is inert; a deny has no such constraint, since it
|
|
77
|
+
* already tells the agent to re-run the command itself).
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
import { execFileSync } from 'node:child_process'
|
|
81
|
+
import { tokenValue, type Token } from '../shell/token.ts'
|
|
82
|
+
import type { Finding, MessageContext, RuleSpec } from '../spec.ts'
|
|
83
|
+
import { noParams } from '../spec.ts'
|
|
84
|
+
import { gitAgentTail } from './messages.ts'
|
|
85
|
+
|
|
86
|
+
const SUBAGENT_LAUNCH_TOOLS: ReadonlySet<string> = new Set(['Task', 'Agent'])
|
|
87
|
+
|
|
88
|
+
/** Kept in sync by hand with repo-controls' and the CLI's copies — see this file's header. */
|
|
89
|
+
const MAX_WORKTREES = 3
|
|
90
|
+
|
|
91
|
+
/** Subcommands that reconcile toward the cap rather than create a checkout — safe to allow outright. */
|
|
92
|
+
const ALWAYS_ALLOWED_SUBCOMMANDS: ReadonlySet<string> = new Set(['list', 'remove', 'prune', 'repair'])
|
|
93
|
+
|
|
94
|
+
/** Subcommands that mutate worktree state but neither create a checkout nor help reconcile toward the cap. */
|
|
95
|
+
const STILL_DENIED_SUBCOMMANDS: ReadonlySet<string> = new Set(['move', 'lock', 'unlock'])
|
|
96
|
+
|
|
97
|
+
/** The first non-flag token in `git worktree <this>` — e.g. `add`, `list`, `remove` — or `null` when there isn't one (`git worktree` alone). */
|
|
98
|
+
function worktreeSubcommand(rest: readonly Token[]): string | null {
|
|
99
|
+
for (const token of rest) {
|
|
100
|
+
const value = tokenValue(token)
|
|
101
|
+
if (!value.startsWith('-')) return value
|
|
102
|
+
}
|
|
103
|
+
return null
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* `git worktree list --porcelain` in the CURRENT process cwd (the
|
|
108
|
+
* pre-tool-use hook's own cwd, which is the session's cwd — this rule has
|
|
109
|
+
* no other way to learn "the session's cwd repo" for a tool-call, since
|
|
110
|
+
* `RuleContext`'s `RepoIndexPort` (`../ports.ts`) exposes only
|
|
111
|
+
* `stagedPaths`/`trackedModifiedPaths`, not a general git runner or a root
|
|
112
|
+
* path, and extending it is out of this file's write scope). Counts
|
|
113
|
+
* `worktree ` porcelain header lines, main worktree included. Returns
|
|
114
|
+
* `null` on any failure (not a repo, git missing, timeout, …) — the caller
|
|
115
|
+
* treats `null` as "cannot determine", which fails closed (deny), never
|
|
116
|
+
* "assume it's fine".
|
|
117
|
+
*/
|
|
118
|
+
function worktreeCountForCwd(): number | null {
|
|
119
|
+
try {
|
|
120
|
+
const out = execFileSync('git', ['worktree', 'list', '--porcelain'], {
|
|
121
|
+
cwd: process.cwd(),
|
|
122
|
+
encoding: 'utf8',
|
|
123
|
+
timeout: 10_000,
|
|
124
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
125
|
+
})
|
|
126
|
+
return out.split('\n').filter((line) => line.startsWith('worktree ')).length
|
|
127
|
+
} catch {
|
|
128
|
+
return null
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** The shared header/footer wording `adl worktree add` and `bin/git` also use for the cap refusal (kept in sync by eye — see this file's header). */
|
|
133
|
+
function worktreeCapMessage(extra: string): string {
|
|
134
|
+
return (
|
|
135
|
+
`worktree limit: only a maximum of ${MAX_WORKTREES} worktrees per repo is allowed (including the main folder). ` +
|
|
136
|
+
`Reconcile old worktrees first: run \`adl worktree list\` to see them with branch/clean/merged status, then ` +
|
|
137
|
+
`\`git worktree remove <path>\` (or ask the human). ${extra}`
|
|
138
|
+
)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export const gitWorktree: RuleSpec = {
|
|
142
|
+
id: 'git.worktree',
|
|
143
|
+
category: 'git',
|
|
144
|
+
severity: 'deny',
|
|
145
|
+
enabledByDefault: true,
|
|
146
|
+
summary: 'Allow worktree reconciliation (list/remove/prune/repair) and cap-aware add/tool-call handling; deny move/lock/unlock and anything over the 3-checkout cap.',
|
|
147
|
+
params: noParams,
|
|
148
|
+
match(inv): Finding | null {
|
|
149
|
+
if (inv.kind === 'git') {
|
|
150
|
+
if (inv.subcommand !== 'worktree') return null
|
|
151
|
+
|
|
152
|
+
const subcommand = worktreeSubcommand(inv.rest)
|
|
153
|
+
if (subcommand !== null && ALWAYS_ALLOWED_SUBCOMMANDS.has(subcommand)) return null // ALLOW: reconciliation
|
|
154
|
+
|
|
155
|
+
if (subcommand === 'add') {
|
|
156
|
+
return { ruleId: 'git.worktree', severity: 'deny', detail: { surface: 'add' } }
|
|
157
|
+
}
|
|
158
|
+
if (subcommand !== null && STILL_DENIED_SUBCOMMANDS.has(subcommand)) {
|
|
159
|
+
return { ruleId: 'git.worktree', severity: 'deny', detail: { surface: 'mutate', subcommand } }
|
|
160
|
+
}
|
|
161
|
+
// Bare `git worktree`, `--help`, or an unrecognized subcommand: unchanged fail-closed default.
|
|
162
|
+
return { ruleId: 'git.worktree', severity: 'deny', detail: { surface: 'other' } }
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (inv.kind === 'tool-call') {
|
|
166
|
+
const isEnterWorktree = inv.tool === 'EnterWorktree'
|
|
167
|
+
const isWorktreeIsolation = SUBAGENT_LAUNCH_TOOLS.has(inv.tool) && inv.input.isolation === 'worktree'
|
|
168
|
+
if (!isEnterWorktree && !isWorktreeIsolation) return null
|
|
169
|
+
|
|
170
|
+
const count = worktreeCountForCwd()
|
|
171
|
+
if (count === null) {
|
|
172
|
+
return { ruleId: 'git.worktree', severity: 'deny', detail: { surface: 'tool-cap-unknown', tool: inv.tool } }
|
|
173
|
+
}
|
|
174
|
+
if (count < MAX_WORKTREES) return null // ALLOW: below the cap
|
|
175
|
+
|
|
176
|
+
return { ruleId: 'git.worktree', severity: 'deny', detail: { surface: 'tool-cap', tool: inv.tool, count: String(count) } }
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return null
|
|
180
|
+
},
|
|
181
|
+
message(finding: Finding, ctx: MessageContext) {
|
|
182
|
+
const surface = finding.detail.surface as string
|
|
183
|
+
|
|
184
|
+
if (surface === 'add') {
|
|
185
|
+
const user = worktreeCapMessage('Ask the human to run it, or use `adl worktree add` instead of raw git.')
|
|
186
|
+
return {
|
|
187
|
+
user,
|
|
188
|
+
agent:
|
|
189
|
+
`DENIED git worktree add. There is no automatic rewrite for this command yet — run the equivalent ` +
|
|
190
|
+
`\`adl worktree add\` command instead (same arguments; put \`-C <dir>\` right after \`add\` if you used ` +
|
|
191
|
+
`\`-C\` here). ${worktreeCapMessage('adl worktree add refuses at the same cap and explains why.')} ` +
|
|
192
|
+
gitAgentTail(ctx.snippet),
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (surface === 'mutate') {
|
|
197
|
+
const subcommand = finding.detail.subcommand as string
|
|
198
|
+
const user = `Blocked git worktree ${subcommand}. This mutates a worktree's registration or lock state without checking the checkout cap, and is reserved for direct human use.`
|
|
199
|
+
return {
|
|
200
|
+
user,
|
|
201
|
+
agent:
|
|
202
|
+
`DENIED git worktree ${subcommand}. Unlike list/remove/prune/repair, this does not help reconcile toward ` +
|
|
203
|
+
`the 3-checkout cap and is reserved for direct human use. ${gitAgentTail(ctx.snippet)}`,
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (surface === 'tool-cap-unknown') {
|
|
208
|
+
const tool = finding.detail.tool as string
|
|
209
|
+
return {
|
|
210
|
+
user: `Blocked ${tool}. The current worktree count could not be determined, so this is refused rather than assumed safe.`,
|
|
211
|
+
agent:
|
|
212
|
+
`DENIED ${tool}. \`git worktree list --porcelain\` could not be read from this session's cwd, so the ` +
|
|
213
|
+
`worktree count is unknown — failing closed rather than assuming it is under the cap. Run \`adl worktree ` +
|
|
214
|
+
`list\` yourself to see what is wrong, or ask the human. Blocked tool call: ${ctx.snippet}`,
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (surface === 'tool-cap') {
|
|
219
|
+
const tool = finding.detail.tool as string
|
|
220
|
+
const count = finding.detail.count as string
|
|
221
|
+
return {
|
|
222
|
+
user: `Blocked ${tool}. ${worktreeCapMessage(`This repository already has ${count}.`)}`,
|
|
223
|
+
agent:
|
|
224
|
+
`DENIED ${tool}. ${worktreeCapMessage(`This repository already has ${count}.`)} Blocked tool call: ${ctx.snippet}`,
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// surface === 'other': bare `git worktree`, `--help`, or an unrecognized subcommand.
|
|
229
|
+
return {
|
|
230
|
+
user: 'Blocked git worktree. This form is reserved for direct human use because it manages or exposes secondary checkouts outside the current working tree.',
|
|
231
|
+
agent:
|
|
232
|
+
'DENIED git worktree. This form is reserved for direct human use because it manages or exposes secondary checkouts outside the current working tree. ' +
|
|
233
|
+
`Use \`git worktree list\`, \`git worktree remove <path>\`, \`git worktree prune\`, or \`git worktree repair\` to reconcile — those are allowed. ${gitAgentTail(ctx.snippet)}`,
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
corpus: {
|
|
237
|
+
deny: [
|
|
238
|
+
'git worktree',
|
|
239
|
+
'git worktree --help',
|
|
240
|
+
'git worktree add ../wt',
|
|
241
|
+
'git worktree move ../wt ../moved',
|
|
242
|
+
'git worktree lock ../wt',
|
|
243
|
+
'git worktree unlock ../wt',
|
|
244
|
+
],
|
|
245
|
+
allow: [
|
|
246
|
+
// Decided behaviour change (Tarun, 2026-09-27, via the coordinator):
|
|
247
|
+
// these four used to be denied by the old blanket "deny every
|
|
248
|
+
// worktree action" policy — see git-worktree.test.ts's own comment on
|
|
249
|
+
// the equivalent old assertions this replaces. They are needed to
|
|
250
|
+
// RECONCILE toward the 3-checkout cap (docs/operations/worktree-guard.md L6) and
|
|
251
|
+
// create no new checkout, so they are allowed outright now.
|
|
252
|
+
'git worktree list',
|
|
253
|
+
'git worktree remove ../wt',
|
|
254
|
+
'git worktree remove --force ../wt',
|
|
255
|
+
'git worktree prune',
|
|
256
|
+
'git worktree prune --dry-run',
|
|
257
|
+
'git worktree repair',
|
|
258
|
+
'git status',
|
|
259
|
+
'git branch --list',
|
|
260
|
+
'git help worktree',
|
|
261
|
+
'orca worktree ps --json',
|
|
262
|
+
'echo git worktree list',
|
|
263
|
+
],
|
|
264
|
+
},
|
|
265
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every azdo MCP tool name any rule in this package matches by name
|
|
3
|
+
* (`packages/azdo/src/mcp-server.ts`'s full roster) — the fixed fallback set
|
|
4
|
+
* `mcpToolName` matches an UNPREFIXED tool name against (see that
|
|
5
|
+
* function's own doc for why).
|
|
6
|
+
*/
|
|
7
|
+
export const KNOWN_MCP_TOOL_NAMES: ReadonlySet<string> = new Set([
|
|
8
|
+
'pr_list_or_get',
|
|
9
|
+
'pr_create_or_update',
|
|
10
|
+
'pr_review',
|
|
11
|
+
'build_list_or_get',
|
|
12
|
+
'build_run',
|
|
13
|
+
'workitem_list_or_get',
|
|
14
|
+
'workitem_create_or_update',
|
|
15
|
+
])
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* `tool` ending in `<separator><suffix>` for one of `knownSuffixes`
|
|
19
|
+
* (`_`/`.`/`:`), with a non-empty prefix before the separator — that prefix
|
|
20
|
+
* is the "server" part, whatever it is named; this never inspects it,
|
|
21
|
+
* matching `mcpToolName`'s own "deliberately not gated on the server key"
|
|
22
|
+
* discipline. Returns the matched suffix, or null when none match. Shared by
|
|
23
|
+
* `mcpToolName` (below) and `../pre-tool-use/handler.ts`'s
|
|
24
|
+
* `classifyCommandTool`, so the separator shapes cannot drift between the
|
|
25
|
+
* two call sites that need them.
|
|
26
|
+
*/
|
|
27
|
+
export function toolNameEndingWithKnownSuffix(tool: string, knownSuffixes: ReadonlySet<string>): string | null {
|
|
28
|
+
for (const suffix of knownSuffixes) {
|
|
29
|
+
for (const separator of ['_', '.', ':'] as const) {
|
|
30
|
+
const marker = `${separator}${suffix}`
|
|
31
|
+
if (tool.length > marker.length && tool.endsWith(marker)) return suffix
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return null
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The tool name off the end of an MCP tool call `mcp__<prefix>__<tool>`, or
|
|
39
|
+
* null when `tool` is not MCP-shaped at all.
|
|
40
|
+
*
|
|
41
|
+
* Deliberately NOT gated on the server key naming Azure DevOps: the package
|
|
42
|
+
* is `packages/azdo`, a host may register it as `mcp__azdo__...`, and P4's
|
|
43
|
+
* plan folds the server under `adl` (`mcp__adl__...`) — a substring check on
|
|
44
|
+
* "azure-devops" would miss both. This returns whatever sits after the LAST
|
|
45
|
+
* `__`, and callers check that against their own tool-name allowlist. Also
|
|
46
|
+
* transparently covers Claude Code's plugin-scoped tool names,
|
|
47
|
+
* `mcp__plugin_<plugin>_<server>__<tool>` — its extra `plugin_<plugin>_<server>`
|
|
48
|
+
* segment has no further `__` in it, so the last-`__` split still lands
|
|
49
|
+
* exactly on `<tool>`.
|
|
50
|
+
*
|
|
51
|
+
* Shared by every rule that gates an Azure DevOps MCP tool by name
|
|
52
|
+
* (adl-session-required.ts, adl-pr-role.ts, adl-pr-complete-pending.ts,
|
|
53
|
+
* adl-workitem-role.ts, adl-build-run-denied.ts) so the parsing cannot drift
|
|
54
|
+
* between them.
|
|
55
|
+
*
|
|
56
|
+
* WIDENED 2026-09-28 (STATUS.md 12p, W2 build item
|
|
57
|
+
* 4): OpenCode's and Kimi's own MCP tool-call naming has never actually been
|
|
58
|
+
* observed in production (`.adl/logs/hooks.log` shows only `mcp__`-prefixed
|
|
59
|
+
* calls, from Claude/Codex/Cursor) — they MAY call an azdo tool with no
|
|
60
|
+
* `mcp__` prefix at all, spelled `<server>_<tool>` / `<server>.<tool>` /
|
|
61
|
+
* `<server>:<tool>`. When `tool` carries no `mcp__` prefix, this falls back
|
|
62
|
+
* to matching it against the FIXED azdo tool roster
|
|
63
|
+
* (`KNOWN_MCP_TOOL_NAMES`) under those three separators, defensively —
|
|
64
|
+
* ASSUMPTION, not a confirmed host contract; see `classifyCommandTool`'s own
|
|
65
|
+
* identical fallback for the lean-ctx shell tools.
|
|
66
|
+
*/
|
|
67
|
+
export function mcpToolName(tool: string): string | null {
|
|
68
|
+
const prefix = 'mcp__'
|
|
69
|
+
if (tool.startsWith(prefix)) {
|
|
70
|
+
const rest = tool.slice(prefix.length)
|
|
71
|
+
if (rest.length === 0) return null
|
|
72
|
+
const lastSeparator = rest.lastIndexOf('__')
|
|
73
|
+
return lastSeparator < 0 ? rest : rest.slice(lastSeparator + 2)
|
|
74
|
+
}
|
|
75
|
+
return toolNameEndingWithKnownSuffix(tool, KNOWN_MCP_TOOL_NAMES)
|
|
76
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message text shared by several rules.
|
|
3
|
+
*
|
|
4
|
+
* Ported from `.agents/hooks/pre-tool-use/src/deny.mjs`. Most git policy
|
|
5
|
+
* rules (stash, clean/rebase/filter-branch, restore, reset, update-index,
|
|
6
|
+
* --amend, branch -D, tag -d, switch -f, worktree remove --force,
|
|
7
|
+
* update-ref -d, gc --prune, checkout --) fell through `classifyReason`'s
|
|
8
|
+
* `default:` arm there and therefore shared one message, parameterized only
|
|
9
|
+
* by the `reason` prose. `defaultGitMessage` is that shared text, kept in
|
|
10
|
+
* one place rather than copied into eleven `message()` functions.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { existsSync, readFileSync } from 'node:fs'
|
|
14
|
+
import { dirname } from 'node:path'
|
|
15
|
+
import type { Finding, RuleMessage } from '../spec.ts'
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Read one string field out of a Finding's detail.
|
|
19
|
+
*
|
|
20
|
+
* `noUncheckedIndexedAccess` makes every `Record` lookup `T | undefined`
|
|
21
|
+
* even though a rule's own `match()` always sets the fields its `message()`
|
|
22
|
+
* reads — the two are written together, in the same file. This is the one
|
|
23
|
+
* place that fact is asserted, instead of forty optional-chaining call
|
|
24
|
+
* sites each silently tolerating a missing key they can never actually see.
|
|
25
|
+
*/
|
|
26
|
+
export function detailString(finding: Finding, key: string): string {
|
|
27
|
+
const value = finding.detail[key]
|
|
28
|
+
if (typeof value !== 'string') throw new Error(`finding '${finding.ruleId}' is missing string detail '${key}'`)
|
|
29
|
+
return value
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Appended to EVERY git-related agent deny message (via `gitAgentTail`).
|
|
34
|
+
*
|
|
35
|
+
* Incident: a wrongly denied `git rebase --abort` was treated as an obstacle
|
|
36
|
+
* to route around — the agent rebuilt state by hand with `update-ref`,
|
|
37
|
+
* `symbolic-ref`, `read-tree` and by trashing `.git/rebase-merge`, which is
|
|
38
|
+
* far riskier than the command it was denied. A git denial must say plainly
|
|
39
|
+
* that there is no sanctioned workaround, name the recovery commands that
|
|
40
|
+
* ARE allowed, and otherwise send the agent back to the user.
|
|
41
|
+
*/
|
|
42
|
+
export const GIT_NO_WORKAROUND_GUIDANCE =
|
|
43
|
+
'Do NOT work around this block: no git plumbing (update-ref, symbolic-ref, read-tree, update-index, ' +
|
|
44
|
+
'reflog, replace, prune) and no editing, moving, copying over, or deleting anything under .git. If you ' +
|
|
45
|
+
'are stuck in an in-progress rebase/merge/cherry-pick/revert/am and a recovery command is what is ' +
|
|
46
|
+
'needed, run it - `git rebase --abort`, `git merge --abort`, `git cherry-pick --abort`, ' +
|
|
47
|
+
'`git revert --abort`, `git am --abort` (or `--quit`) are allowed. Otherwise STOP and ask the user how ' +
|
|
48
|
+
'to proceed.'
|
|
49
|
+
|
|
50
|
+
/** The shared ending of every git-related agent deny message: the no-workaround guidance, then the blocked command. */
|
|
51
|
+
export function gitAgentTail(snippet: string): string {
|
|
52
|
+
return `${GIT_NO_WORKAROUND_GUIDANCE} Blocked command: ${snippet}`
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function defaultGitMessage(reason: string, snippet: string): RuleMessage {
|
|
56
|
+
return {
|
|
57
|
+
user: `Blocked ${reason}. This git operation can discard or irreversibly rewrite work in a shared checkout. Run it yourself in a terminal if you really mean it.`,
|
|
58
|
+
agent:
|
|
59
|
+
`DENIED ${reason}. This git operation is blocked for agents in this shared checkout - it can discard, ` +
|
|
60
|
+
`hide, or irreversibly rewrite work. Read-only inspection (git status, git log, git diff, git stash ` +
|
|
61
|
+
`list) is always fine. If the human explicitly asked for this exact command, tell them to run it ` +
|
|
62
|
+
`themselves in their own terminal - this hook still blocks you. ${gitAgentTail(snippet)}`,
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function protectedTreesText(protectedTrees: readonly string[]): string {
|
|
67
|
+
return protectedTrees.join(', ')
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The generic "use just recipes" pointer, shared by every rule that denies a
|
|
72
|
+
* direct tool invocation in favour of a `just` recipe (tool.cargo,
|
|
73
|
+
* tool.frontend, tool.bun-test, tool.chmod-hook-disarm).
|
|
74
|
+
*
|
|
75
|
+
* Tarun's decision (2026-09-27, feature az372), verbatim: "ban 'bun test'
|
|
76
|
+
* only and ask to run just recipes. Do not mention any particular recipe
|
|
77
|
+
* name. Same for deny rule on just frontend type check. Any debt should not
|
|
78
|
+
* mention a particular recipe name. Just deny with use just recipes.
|
|
79
|
+
* Generic!" A message that names a specific recipe (`just frontend
|
|
80
|
+
* typecheck`, `just test-affected`, `just hooks install`, ...) goes stale
|
|
81
|
+
* the moment the justfile is restructured; `just --list` never does. Every
|
|
82
|
+
* such message was ported to this one pointer instead of naming a recipe —
|
|
83
|
+
* see tests/unit/rules-no-concrete-recipe-name.test.ts, which scans every
|
|
84
|
+
* registered rule's rendered messages for a leftover concrete `just <word>`
|
|
85
|
+
* mention.
|
|
86
|
+
*/
|
|
87
|
+
export const JUST_RECIPES_POINTER = "the repository's just recipes (`just --list` shows them)"
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Read the live backend coverage floor, if this checkout has one.
|
|
91
|
+
*
|
|
92
|
+
* Ported from deny.mjs's `coverageAdvisory`. Real filesystem, walking up from
|
|
93
|
+
* `startDir` — no mock, since the whole point is the real ratchet file. A
|
|
94
|
+
* checkout with no such file (most of them) returns ''.
|
|
95
|
+
*/
|
|
96
|
+
export function coverageAdvisory(startDir: string): string {
|
|
97
|
+
const REL = 'workflows/config/coverage/coverage.json'
|
|
98
|
+
let dir = startDir
|
|
99
|
+
let found = ''
|
|
100
|
+
for (;;) {
|
|
101
|
+
const candidate = dir.endsWith('/') ? dir + REL : `${dir}/${REL}`
|
|
102
|
+
if (existsSync(candidate)) {
|
|
103
|
+
found = candidate
|
|
104
|
+
break
|
|
105
|
+
}
|
|
106
|
+
const parent = dirname(dir)
|
|
107
|
+
if (parent === dir) break
|
|
108
|
+
dir = parent
|
|
109
|
+
}
|
|
110
|
+
if (!found) return ''
|
|
111
|
+
try {
|
|
112
|
+
const config = JSON.parse(readFileSync(found, 'utf8')) as {
|
|
113
|
+
modules?: { backend?: { baseline?: { lines?: unknown }; crateBaseline?: { lines?: unknown } } }
|
|
114
|
+
}
|
|
115
|
+
const backend = config.modules?.backend ?? {}
|
|
116
|
+
const workspace = backend.baseline?.lines
|
|
117
|
+
const perCrate = backend.crateBaseline?.lines
|
|
118
|
+
if (typeof workspace !== 'number' || typeof perCrate !== 'number') return ''
|
|
119
|
+
return (
|
|
120
|
+
` Advisory: backend coverage may not fall below ${workspace}% workspace-wide or ` +
|
|
121
|
+
`${perCrate}% for a crate, and sync-coverage-baseline.sh only ever ratchets those ` +
|
|
122
|
+
'floors upward - a change that adds code without tests moves you toward that floor, ' +
|
|
123
|
+
'not away from it.'
|
|
124
|
+
)
|
|
125
|
+
} catch {
|
|
126
|
+
return ''
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fail-closed parse rule: an invocation the shell parser could not classify.
|
|
3
|
+
*
|
|
4
|
+
* Ported from every `uncertain(reason)` call in shell/{token,substitution,
|
|
5
|
+
* split,xargs,invocation}.ts, and from `classifyReason`'s
|
|
6
|
+
* `/^(?:invalid|empty|missing|unparsed|unclosed|unterminated|dynamic|shell
|
|
7
|
+
* script|hook input)/` case in deny.mjs:139-141. The original produced ~19
|
|
8
|
+
* distinct reason strings from that many distinct parse failures — a
|
|
9
|
+
* dynamic command name, an unclosed substitution or quote, an unterminated
|
|
10
|
+
* here-document, an unparsed xargs option, a shell script that is not
|
|
11
|
+
* trusted, and so on — but `classifyReason`/`userMessageFor`/
|
|
12
|
+
* `agentMessageFor` always treated every one of them identically: one
|
|
13
|
+
* message, `reason` interpolated into it. Splitting that into ~19 RuleSpecs
|
|
14
|
+
* would mean ~19 copies of the same `match`/`message` pair, distinguished
|
|
15
|
+
* only by which reason string happened to appear — no behavioural
|
|
16
|
+
* difference, and each still needs the SAME `unsafeAllowUncertain` gate
|
|
17
|
+
* (config/schema.ts's `RulesSection`). This is deliberately one rule
|
|
18
|
+
* instead; its corpus below pins a representative command for each of the
|
|
19
|
+
* ~19 distinct reason-producing code paths, so the consolidation costs no
|
|
20
|
+
* coverage.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import type { Invocation } from '../shell/invocation.ts'
|
|
24
|
+
import type { Finding, MessageContext, RuleSpec } from '../spec.ts'
|
|
25
|
+
import { noParams } from '../spec.ts'
|
|
26
|
+
import { detailString } from './messages.ts'
|
|
27
|
+
|
|
28
|
+
export const parseUncertain: RuleSpec = {
|
|
29
|
+
id: 'parse.uncertain',
|
|
30
|
+
category: 'uncertain',
|
|
31
|
+
severity: 'deny',
|
|
32
|
+
enabledByDefault: true,
|
|
33
|
+
summary: 'Fail closed on shell input the parser could not classify.',
|
|
34
|
+
params: noParams,
|
|
35
|
+
match(inv: Invocation): Finding | null {
|
|
36
|
+
if (inv.kind !== 'uncertain') return null
|
|
37
|
+
return { ruleId: 'parse.uncertain', severity: 'deny', detail: { reason: inv.reason } }
|
|
38
|
+
},
|
|
39
|
+
message(finding: Finding, ctx: MessageContext) {
|
|
40
|
+
const reason = detailString(finding, 'reason')
|
|
41
|
+
return {
|
|
42
|
+
user: `Blocked uninspectable shell input (${reason}). The hook fails closed; simplify the command and retry.`,
|
|
43
|
+
agent: `DENIED ${reason}. The hook cannot prove that this shell input is safe. Remove the dynamic or unparsed shell construct and retry. Blocked command: ${ctx.snippet}`,
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
corpus: {
|
|
47
|
+
deny: [
|
|
48
|
+
// dynamic shell command / dynamic git subcommand / missing subcommand
|
|
49
|
+
'git "$SUBCOMMAND"',
|
|
50
|
+
'git',
|
|
51
|
+
// dynamic shell script / shell script execution (untrusted path)
|
|
52
|
+
'bash /tmp/install.sh',
|
|
53
|
+
'bash "$SCRIPT"',
|
|
54
|
+
'bash /Users/tarunrana/Documents/Repos/adl-maintenance-checkout/workflows/scripts/gates/rust/check-rust-policy.sh',
|
|
55
|
+
'bash workflows/scripts/../../../etc/passwd',
|
|
56
|
+
'bash workflows/scripts/gates/rust/../../../../etc/passwd',
|
|
57
|
+
'bash workflows/scriptsxrust/check-rust-policy.sh',
|
|
58
|
+
'bash workflows/other/check.sh',
|
|
59
|
+
'bash .code-quality/../../../etc/passwd',
|
|
60
|
+
'bash .code-quality/typescript/../../../../etc/passwd',
|
|
61
|
+
'bash /etc/.code-quality/evil.sh',
|
|
62
|
+
'bash .code-qualityx/typescript/scan.sh',
|
|
63
|
+
'bash .agentsx/hooks/setup.sh',
|
|
64
|
+
'bash .agents/hooks/../../etc/evil.sh',
|
|
65
|
+
'bash /Users/x/.agents/hooks/setup.sh',
|
|
66
|
+
'bash .agents/hooks/',
|
|
67
|
+
'bash .code-quality/',
|
|
68
|
+
// dynamic `.`/eval/source execution
|
|
69
|
+
'eval "$COMMAND"',
|
|
70
|
+
// dynamic shell command, reached by recursing into a `-c` argument
|
|
71
|
+
// that is itself a bare, unresolved variable
|
|
72
|
+
'sh -c "$COMMAND"',
|
|
73
|
+
// unparsed unquoted here-document (no quote around the terminator)
|
|
74
|
+
'cat <<EOF\nrm -rf dist\nEOF',
|
|
75
|
+
// The remaining reasons below have no counterpart in the original
|
|
76
|
+
// self-test corpus at all — they are genuinely malformed input no
|
|
77
|
+
// legitimate command produces, so nothing in tests/self-test.mjs
|
|
78
|
+
// exercises them either. Added here (and unit-tested directly in
|
|
79
|
+
// shell-substitution.test.ts / shell-xargs.test.ts) so the
|
|
80
|
+
// consolidation into one rule still costs no coverage.
|
|
81
|
+
'echo $(unclosed', // unclosed shell substitution
|
|
82
|
+
'echo `unclosed', // unclosed backtick substitution
|
|
83
|
+
'echo "unclosed', // unclosed shell quote
|
|
84
|
+
"cat <<'EOF'\nbody", // unterminated here-document (quoted terminator, never closed)
|
|
85
|
+
'xargs -n', // incomplete xargs option
|
|
86
|
+
'xargs --not-a-real-option rm -rf x', // unparsed xargs option
|
|
87
|
+
'xargs $(cmd)', // dynamic xargs execution (bare, no options read first)
|
|
88
|
+
'xargs -0 $(safe-thing)', // dynamic xargs execution (after a real flag)
|
|
89
|
+
"xargs sh <<'EOF'\nfoo\nEOF", // dynamic xargs execution (shell over here-document input)
|
|
90
|
+
'bash <<EOF\necho hi\nEOF', // unparsed unquoted here-document fed to a shell
|
|
91
|
+
'bash <<< "$CMD"', // dynamic here-string
|
|
92
|
+
"cat <<'EOF' | tee /dev/null | bash\necho hi\nEOF", // here-document piped to shell
|
|
93
|
+
'bash < script.sh', // shell script execution (stdin from a file)
|
|
94
|
+
'tee $(pwd)/out.txt', // dynamic write target
|
|
95
|
+
'cp a `pwd`/b', // dynamic write target
|
|
96
|
+
'dd if=a of=$(pwd)/b', // dynamic write target
|
|
97
|
+
'cat install.sh | bash', // script piped to shell (producer output unknowable)
|
|
98
|
+
'git show HEAD:script.sh | sh', // script piped to shell
|
|
99
|
+
'echo "$CMD" | bash', // script piped to shell (echo with an expansion)
|
|
100
|
+
'echo x.sh | xargs bash', // dynamic xargs execution (input items become script operands)
|
|
101
|
+
'let x=1<<2', // unterminated here-document: bash reads an unquoted let `<<` as a here-document
|
|
102
|
+
// A `-c` script inherits the outer pipe's stdin: a bare shell (or
|
|
103
|
+
// `exec <shell>`) as the `-c` payload reading that stdin, fed by an
|
|
104
|
+
// unknowable local producer, fails closed exactly like the top-level
|
|
105
|
+
// `producer | shell` form.
|
|
106
|
+
"cat f | bash -c 'bash'",
|
|
107
|
+
"cat f | sh -c 'exec sh'",
|
|
108
|
+
"cat f | bash -c 'bash -s'",
|
|
109
|
+
"git show HEAD:script.sh | bash -c 'bash'",
|
|
110
|
+
'cat f | busybox sh', // a shell multi-call binary threads the outer feed the same way
|
|
111
|
+
// `source`/`.`/`eval` are unconditionally uncertain (dynamic-execution
|
|
112
|
+
// fail-closed), whether piped directly or nested in a `-c` script.
|
|
113
|
+
'cat f | source /dev/stdin',
|
|
114
|
+
'cat f | . /dev/stdin',
|
|
115
|
+
"cat f | bash -c 'source /dev/stdin'",
|
|
116
|
+
"cat f | bash -c '. /dev/stdin'",
|
|
117
|
+
"cat f | bash -c 'eval \"$(cat)\"'",
|
|
118
|
+
],
|
|
119
|
+
allow: [
|
|
120
|
+
'timeout 90 git status',
|
|
121
|
+
"sh -c 'echo hi'",
|
|
122
|
+
'bash .agents/hooks/setup.sh',
|
|
123
|
+
'./.agents/hooks/setup.sh',
|
|
124
|
+
"bash .agents/hooks/adl-code-quality scan --language typescript --filter '^raw-interactive-html$'",
|
|
125
|
+
"bash <<'EOF'\necho hi\nEOF",
|
|
126
|
+
"bash <<< 'echo hi'",
|
|
127
|
+
"cat <<'EOF' | bash\necho hi\nEOF",
|
|
128
|
+
'tee $HOME/out.txt',
|
|
129
|
+
'cp $(ls a) dest',
|
|
130
|
+
"echo 'echo hi' | bash", // static echo reconstructed and walked
|
|
131
|
+
"printf '%s\\n' 'echo hi' | sh", // static printf reconstructed and walked
|
|
132
|
+
'echo $((1<<2))', // arithmetic shift, not a here-document
|
|
133
|
+
'(( x = 1 << 2 ))', // arithmetic command shift
|
|
134
|
+
'[[ 1 -lt 2 ]]',
|
|
135
|
+
'echo "a<<b"', // quoted `<<` is literal text
|
|
136
|
+
// A `-c` script that does not read stdin as code ignores the outer
|
|
137
|
+
// pipe's content entirely, same as a bare `-c` script does.
|
|
138
|
+
"cat f | bash -c 'wc -l'",
|
|
139
|
+
"echo hi | bash -c 'read x; echo $x'",
|
|
140
|
+
"cat f | busybox echo hi",
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Setting auto-complete" on an existing PR — docs/operations/agent-permissions.md row 9
|
|
3
|
+
* ("PR complete / set auto-complete") — shared by adl-pr-role.ts (which steps
|
|
4
|
+
* aside for this shape) and adl-pr-complete-pending.ts (which denies it).
|
|
5
|
+
*
|
|
6
|
+
* DECISION (this rule's scope, since row 9 is marked OPEN in the matrix and
|
|
7
|
+
* the tool has no dedicated "complete" action to key off): a `create` call
|
|
8
|
+
* always arms auto-complete BY DEFAULT unless the caller explicitly opts out
|
|
9
|
+
* (`packages/azdo/src/azdo-pr.ts`: "owner decision 2026-09-15: every PR is
|
|
10
|
+
* auto-complete" — `arm = args.autoComplete !== false`). Denying that default
|
|
11
|
+
* would block PR creation entirely for `agent-reviewer` too, which
|
|
12
|
+
* contradicts row 5's ALLOW and would break the one path the whole adl flow
|
|
13
|
+
* depends on. "PR complete" is read narrowly instead: an `update` call that
|
|
14
|
+
* explicitly touches completion — `autoComplete`, `mergeStrategy`, or
|
|
15
|
+
* `deleteSourceBranch` present in the input — which is exactly the "arm an
|
|
16
|
+
* EXISTING PR" shape `azdo-pr.ts`'s own `autoCompleteBody()` comment
|
|
17
|
+
* describes. A plain `create`, and a plain metadata-only `update` (title/
|
|
18
|
+
* description, no completion fields), are both untouched by row 9.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
export interface PrCreateOrUpdateInput {
|
|
22
|
+
readonly action?: unknown
|
|
23
|
+
readonly autoComplete?: unknown
|
|
24
|
+
readonly mergeStrategy?: unknown
|
|
25
|
+
readonly deleteSourceBranch?: unknown
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const COMPLETION_FIELDS = ['autoComplete', 'mergeStrategy', 'deleteSourceBranch'] as const
|
|
29
|
+
|
|
30
|
+
/** True for an `action: 'update'` call that also sets a completion field — see this file's header for why `create` is excluded. */
|
|
31
|
+
export function isPrCompletionCall(input: Readonly<Record<string, unknown>>): boolean {
|
|
32
|
+
const args = input as PrCreateOrUpdateInput
|
|
33
|
+
if (args.action !== 'update') return false
|
|
34
|
+
return COMPLETION_FIELDS.some((field) => args[field] !== undefined)
|
|
35
|
+
}
|