@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,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ADL_AGENT_ID_AGENT`, read the same way by every rule that keys behaviour
|
|
3
|
+
* off the session's agent identity (docs/operations/agent-permissions.md, docs/architecture/cli-design.md
|
|
4
|
+
* decision 2).
|
|
5
|
+
*
|
|
6
|
+
* The one-agent-identity standard (STATUS.md 12p)
|
|
7
|
+
* makes `packages/azdo/src/lib/agent-identity.ts` the ONE Azure DevOps
|
|
8
|
+
* identity resolver in this repo; this file no longer keeps its own copy of
|
|
9
|
+
* `VALID_AGENTS`/`NO_AGENT_IDENTITY_MESSAGE`/the default-agent-file read — it
|
|
10
|
+
* imports them, and `BUILDER_AGENTS` derives from `VALID_AGENTS` rather than
|
|
11
|
+
* naming `AGENT_TARUN`/`AGENT_VIVEK` a second time.
|
|
12
|
+
*/
|
|
13
|
+
import {
|
|
14
|
+
isValidAgent,
|
|
15
|
+
NO_AGENT_IDENTITY_MESSAGE,
|
|
16
|
+
resolveAgentIdentity,
|
|
17
|
+
VALID_AGENTS,
|
|
18
|
+
type ValidAgent,
|
|
19
|
+
} from '../../../../azdo/src/lib/agent-identity.ts'
|
|
20
|
+
import type { EnvPort } from '../ports.ts'
|
|
21
|
+
|
|
22
|
+
export { isValidAgent, NO_AGENT_IDENTITY_MESSAGE, VALID_AGENTS, type ValidAgent }
|
|
23
|
+
|
|
24
|
+
export const ADL_AGENT_ID_ENV_VAR = 'ADL_AGENT_ID_AGENT'
|
|
25
|
+
export const AGENT_REVIEWER = 'agent-reviewer'
|
|
26
|
+
export const AGENT_TARUN = 'agent-tarun'
|
|
27
|
+
export const AGENT_VIVEK = 'agent-vivek'
|
|
28
|
+
|
|
29
|
+
/** The two-branch standard's builders (docs/specs/two-branch-standard-2026-09-27.md §1b.1): cut a feature branch from `integration`, create their own PRs into it. Every VALID_AGENTS member except agent-reviewer. */
|
|
30
|
+
export const BUILDER_AGENTS: ReadonlySet<string> = new Set(VALID_AGENTS.filter((name) => name !== AGENT_REVIEWER))
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Test-only override name the shared module accepts for its default-agent
|
|
34
|
+
* file read (`packages/azdo/src/lib/agent-identity.ts`'s `OVERRIDE_ENV_VAR`)
|
|
35
|
+
* -- re-exported here so callers in this package (and their tests) do not
|
|
36
|
+
* have to know the azdo module's internal constant name. Production never
|
|
37
|
+
* sets this; every test that wants "no default-agent file configured" MUST
|
|
38
|
+
* set it to a path that does not exist -- see `resolveFromEnvOrFile`'s doc.
|
|
39
|
+
* Never the real system path (AGENTS.md: tests are hermetic).
|
|
40
|
+
*/
|
|
41
|
+
export const DEFAULT_AGENT_FILE_OVERRIDE_ENV = 'ADL_DEFAULT_AGENT_FILE'
|
|
42
|
+
|
|
43
|
+
// L3 (STATUS.md 12p): `currentAgent` — the
|
|
44
|
+
// session-env-only read this file used to export for
|
|
45
|
+
// `../../hooks/lean-ctx/scope-rewrite.ts`'s `sessionIdentityOf` — was
|
|
46
|
+
// removed here (not merely superseded) once that caller switched to
|
|
47
|
+
// `resolveFromEnvOrFile` (steps 2-3 of the standard: env, THEN the machine
|
|
48
|
+
// default-agent file). It had no other caller left, so it stayed as dead,
|
|
49
|
+
// uncovered code rather than a function this file's own contract still
|
|
50
|
+
// needs — bunfig.toml's coverage policy has no ignore-list for exactly this
|
|
51
|
+
// reason: a function nothing calls gets deleted, not exempted.
|
|
52
|
+
|
|
53
|
+
export type IdentitySource = 'env' | 'default-file'
|
|
54
|
+
|
|
55
|
+
export interface ResolvedIdentity {
|
|
56
|
+
readonly ok: true
|
|
57
|
+
readonly agent: string
|
|
58
|
+
readonly source: IdentitySource
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* `resolveAgentIdentity` failed: either nothing at all was configured
|
|
63
|
+
* (`reason: 'none'` — step 4 of the standard, `NO_AGENT_IDENTITY_MESSAGE`),
|
|
64
|
+
* or something WAS configured (the env var or the default-agent file) but
|
|
65
|
+
* named an agent outside `VALID_AGENTS`, or the default-agent file could not
|
|
66
|
+
* be read for a reason other than "it does not exist" (`reason: 'invalid'`).
|
|
67
|
+
* The distinction matters for the message a caller shows: "no agent
|
|
68
|
+
* identity, here is how to set one" is a different problem from "an agent
|
|
69
|
+
* identity IS configured and it is wrong."
|
|
70
|
+
*/
|
|
71
|
+
export interface UnresolvedIdentity {
|
|
72
|
+
readonly ok: false
|
|
73
|
+
readonly reason: 'none' | 'invalid'
|
|
74
|
+
readonly message: string
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type IdentityResolution = ResolvedIdentity | UnresolvedIdentity
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Steps 2-3 of the standard (STATUS.md 12p, "The
|
|
81
|
+
* standard"): `ADL_AGENT_ID_AGENT` from the session environment, else the
|
|
82
|
+
* machine default-agent file, else unresolved. Step 1 (an inline
|
|
83
|
+
* `ADL_AGENT_ID_AGENT=<agent>` prefix on the command itself) is NOT this
|
|
84
|
+
* function's job — that is a property of the command text, resolved by
|
|
85
|
+
* `../shell/git-identity.ts`'s scanner, which calls this function only for
|
|
86
|
+
* the FALLBACK once it has already looked for an inline override.
|
|
87
|
+
*
|
|
88
|
+
* Delegates to `packages/azdo/src/lib/agent-identity.ts`'s
|
|
89
|
+
* `resolveAgentIdentity` — the one resolver every Azure DevOps surface in
|
|
90
|
+
* this repo shares — passing it a minimal, hand-built `NodeJS.ProcessEnv`
|
|
91
|
+
* carrying only the two variables that function reads
|
|
92
|
+
* (`ADL_AGENT_ID_AGENT`, and the test-only `ADL_DEFAULT_AGENT_FILE`
|
|
93
|
+
* override), rather than `process.env`: this hook's own `EnvPort` is already
|
|
94
|
+
* the caller-supplied source of truth for "the environment this invocation
|
|
95
|
+
* ran in" (see `../../pre-tool-use/handler.ts`'s `invocationEnv` — a host
|
|
96
|
+
* that scrubs its hook child's environment must not inherit the wrapper
|
|
97
|
+
* process's own identity), and reusing that same discipline here keeps this
|
|
98
|
+
* function callable from a hand-built `EnvPort` in a unit test without
|
|
99
|
+
* ever touching this process's real environment.
|
|
100
|
+
*
|
|
101
|
+
* PRODUCTION NOTE — hermeticity: when neither variable is set, the shared
|
|
102
|
+
* module reads the REAL machine default-agent file
|
|
103
|
+
* (`/Library/Application Support/adl/default-agent` on darwin,
|
|
104
|
+
* `/etc/adl/default-agent` on linux) — that real read is the whole point in
|
|
105
|
+
* production (step 3 of the standard). Every test that wants "no identity
|
|
106
|
+
* resolves" MUST therefore set `ADL_DEFAULT_AGENT_FILE` (via the `EnvPort`
|
|
107
|
+
* passed in) to a path that provably does not exist; `tests/fixtures/ports.ts`'s
|
|
108
|
+
* `envWith` does this by default so ordinary rule tests stay hermetic
|
|
109
|
+
* without every call site repeating it.
|
|
110
|
+
*
|
|
111
|
+
* `platform` defaults to `process.platform` (production behaviour) but can
|
|
112
|
+
* be overridden explicitly — this is a test seam only, so a unit test can
|
|
113
|
+
* exercise the shared module's per-OS default-agent-file path (darwin vs
|
|
114
|
+
* linux) without monkey-patching the real `process.platform`.
|
|
115
|
+
*/
|
|
116
|
+
export function resolveFromEnvOrFile(env: Pick<EnvPort, 'get'>, platform: NodeJS.Platform = process.platform): IdentityResolution {
|
|
117
|
+
const fakeEnv = {
|
|
118
|
+
ADL_AGENT_ID_AGENT: env.get(ADL_AGENT_ID_ENV_VAR),
|
|
119
|
+
[DEFAULT_AGENT_FILE_OVERRIDE_ENV]: env.get(DEFAULT_AGENT_FILE_OVERRIDE_ENV),
|
|
120
|
+
} as NodeJS.ProcessEnv
|
|
121
|
+
try {
|
|
122
|
+
const resolved = resolveAgentIdentity(fakeEnv, platform)
|
|
123
|
+
return { ok: true, agent: resolved.agent, source: resolved.source }
|
|
124
|
+
} catch (error) {
|
|
125
|
+
const message = error instanceof Error ? error.message : String(error)
|
|
126
|
+
return { ok: false, reason: message === NO_AGENT_IDENTITY_MESSAGE ? 'none' : 'invalid', message }
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `adl mcp cli <command> [options]` → the equivalent MCP tool call, for the
|
|
3
|
+
* role rules that must grade it EXACTLY like the real MCP tool call (M4,
|
|
4
|
+
* STATUS.md 12p): `docs/operations/agent-permissions.md`
|
|
5
|
+
* gates the tool, not the surface it was invoked through, and `adl mcp cli`
|
|
6
|
+
* (`packages/azdo/src/cli.ts`'s `runCli`) dispatches to the SAME
|
|
7
|
+
* `dispatchTool` the MCP server itself calls — a caller who runs
|
|
8
|
+
* `adl mcp cli pr-review --vote reject ...` reaches Azure DevOps exactly the
|
|
9
|
+
* way `mcp__azdo__pr_review` does, and must be denied the same way.
|
|
10
|
+
*
|
|
11
|
+
* Scoped to the four commands this package's role rules actually gate —
|
|
12
|
+
* `workitem-create-or-update`, `pr-create-or-update`, `pr-review`,
|
|
13
|
+
* `build-run` — not a general reimplementation of the whole CLI surface
|
|
14
|
+
* (`packages/azdo/src/cli.ts`'s `commands` table), which belongs to
|
|
15
|
+
* `packages/azdo`, outside this package's write scope. The flag → input-key
|
|
16
|
+
* mapping below is copied from that table (re-checked 2026-09-28) for
|
|
17
|
+
* exactly these four entries; if `cli.ts`'s flags for one of them change,
|
|
18
|
+
* this table needs a matching update — there is no cross-package import that
|
|
19
|
+
* would keep the two in sync automatically without also pulling in
|
|
20
|
+
* `tool-dispatch.ts` and everything it depends on.
|
|
21
|
+
*
|
|
22
|
+
* The synthesized `tool` name is `mcp__adl-cli__<tool>` — not the bare tool
|
|
23
|
+
* name — so `./mcp-tool.ts`'s `mcpToolName` (which requires a
|
|
24
|
+
* `mcp__<prefix>__<tool>` shape, or a known-suffix fallback that itself
|
|
25
|
+
* requires a prefix before the separator) extracts it the same way it would
|
|
26
|
+
* a real host's MCP tool-call name. `adl-cli` is not a real MCP server; it
|
|
27
|
+
* only needs to be A prefix, so `mcpToolName`'s last-`__` split lands on the
|
|
28
|
+
* real tool name.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
import type { Invocation } from '../shell/invocation.ts'
|
|
32
|
+
import { dynamicToken, tokenValue } from '../shell/token.ts'
|
|
33
|
+
import { ADL_BINARY_NAMES } from './git-helpers.ts'
|
|
34
|
+
import { effectiveIdentityForCommand, scanAdlMcpCliPieces } from '../shell/git-identity.ts'
|
|
35
|
+
|
|
36
|
+
export interface AdlMcpCliCall {
|
|
37
|
+
readonly tool: string
|
|
38
|
+
readonly input: Readonly<Record<string, unknown>>
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
type FlagType = 'string' | 'integer' | 'boolean'
|
|
42
|
+
|
|
43
|
+
interface FlagSpec {
|
|
44
|
+
readonly flag: string
|
|
45
|
+
readonly key: string
|
|
46
|
+
readonly type: FlagType
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface GatedCommand {
|
|
50
|
+
readonly tool: string
|
|
51
|
+
readonly flags: readonly FlagSpec[]
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Only the flags a role rule actually inspects: `pr-create-or-update`'s
|
|
56
|
+
* `--action`/`--auto-complete`/`--no-auto-complete`/`--merge-strategy`/
|
|
57
|
+
* `--delete-source-branch` (`isPrCompletionCall`, pr-completion.ts) and
|
|
58
|
+
* `pr-review`'s `--comment`/`--vote`/`--target-branch`
|
|
59
|
+
* (`adl-pr-review-role.ts`). `workitem-create-or-update` and `build-run` are
|
|
60
|
+
* graded on identity alone — no input field changes their outcome — so
|
|
61
|
+
* their flag lists are empty; the command still needs an entry here so it is
|
|
62
|
+
* RECOGNIZED at all.
|
|
63
|
+
*/
|
|
64
|
+
const GATED_COMMANDS: Readonly<Record<string, GatedCommand>> = {
|
|
65
|
+
'workitem-create-or-update': { tool: 'workitem_create_or_update', flags: [] },
|
|
66
|
+
'pr-create-or-update': {
|
|
67
|
+
tool: 'pr_create_or_update',
|
|
68
|
+
flags: [
|
|
69
|
+
{ flag: '--action', key: 'action', type: 'string' },
|
|
70
|
+
{ flag: '--auto-complete', key: 'autoComplete', type: 'boolean' },
|
|
71
|
+
{ flag: '--no-auto-complete', key: 'autoComplete', type: 'boolean' },
|
|
72
|
+
{ flag: '--merge-strategy', key: 'mergeStrategy', type: 'string' },
|
|
73
|
+
{ flag: '--delete-source-branch', key: 'deleteSourceBranch', type: 'boolean' },
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
'pr-review': {
|
|
77
|
+
tool: 'pr_review',
|
|
78
|
+
flags: [
|
|
79
|
+
{ flag: '--comment', key: 'comment', type: 'string' },
|
|
80
|
+
{ flag: '--vote', key: 'vote', type: 'string' },
|
|
81
|
+
{ flag: '--target-branch', key: 'targetBranch', type: 'string' },
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
'build-run': { tool: 'build_run', flags: [] },
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* `adl`/`adl.exe mcp cli <command> [--flag value|--boolean-flag ...]` → the
|
|
89
|
+
* MCP tool call it is equivalent to, or `null` when `inv` is not this shape,
|
|
90
|
+
* any of the first three words is dynamic, or `<command>` is not one of the
|
|
91
|
+
* four gated commands. A `--flag`'s value is read only when the flag is
|
|
92
|
+
* known for that specific command (an unrecognized flag is ignored, not an
|
|
93
|
+
* error — this is a read for GRADING, not the CLI's own arg parser, which
|
|
94
|
+
* would reject an unknown flag itself before any tool call happens) and the
|
|
95
|
+
* NEXT word is neither dynamic nor itself another `--flag` (a boolean flag
|
|
96
|
+
* taking no value, or a malformed line with a missing value, is left unset
|
|
97
|
+
* rather than guessed).
|
|
98
|
+
*/
|
|
99
|
+
export function adlMcpCliCall(inv: Invocation): AdlMcpCliCall | null {
|
|
100
|
+
if (inv.kind !== 'command' || !ADL_BINARY_NAMES.has(inv.name)) return null
|
|
101
|
+
const args = inv.args
|
|
102
|
+
if (args.length < 3) return null
|
|
103
|
+
if (args.slice(0, 3).some((token) => dynamicToken(token))) return null
|
|
104
|
+
if (tokenValue(args[0]!).toLowerCase() !== 'mcp' || tokenValue(args[1]!).toLowerCase() !== 'cli') return null
|
|
105
|
+
|
|
106
|
+
const commandName = tokenValue(args[2]!).toLowerCase()
|
|
107
|
+
const spec = GATED_COMMANDS[commandName]
|
|
108
|
+
if (spec === undefined) return null
|
|
109
|
+
|
|
110
|
+
const rest = args.slice(3)
|
|
111
|
+
const values = rest.map((token) => (dynamicToken(token) ? null : tokenValue(token)))
|
|
112
|
+
|
|
113
|
+
const input: Record<string, unknown> = {}
|
|
114
|
+
for (let index = 0; index < values.length; index += 1) {
|
|
115
|
+
const value = values[index]
|
|
116
|
+
if (value === null || value === undefined) continue
|
|
117
|
+
const flagSpec = spec.flags.find((candidate) => candidate.flag === value)
|
|
118
|
+
if (flagSpec === undefined) continue
|
|
119
|
+
if (flagSpec.type === 'boolean') {
|
|
120
|
+
// `--auto-complete` sets autoComplete: true; `--no-auto-complete` sets
|
|
121
|
+
// it to false (both are the SAME input key, mirroring cli.ts's own
|
|
122
|
+
// two-flags-one-key shape) — deleteSourceBranch has no "--no-" form,
|
|
123
|
+
// so this is always true for it.
|
|
124
|
+
input[flagSpec.key] = flagSpec.flag.startsWith('--no-') ? false : true
|
|
125
|
+
continue
|
|
126
|
+
}
|
|
127
|
+
const next = values[index + 1]
|
|
128
|
+
if (next === null || next === undefined || next.startsWith('--')) continue
|
|
129
|
+
input[flagSpec.key] = flagSpec.type === 'integer' ? Number(next) : next
|
|
130
|
+
index += 1
|
|
131
|
+
}
|
|
132
|
+
return { tool: `mcp__adl-cli__${spec.tool}`, input }
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* The `{tool, input}` pair for `inv`, whether it is a real MCP tool-call
|
|
137
|
+
* payload or an equivalent `adl mcp cli <command>` shell invocation (M4) —
|
|
138
|
+
* or `null` when `inv` is neither. Every role rule that used to check only
|
|
139
|
+
* `inv.kind === 'tool-call'` calls this instead, so a caller cannot route
|
|
140
|
+
* around role grading just by using the CLI form of the same tool.
|
|
141
|
+
*/
|
|
142
|
+
export function toolCallFor(inv: Invocation): AdlMcpCliCall | null {
|
|
143
|
+
if (inv.kind === 'tool-call') return { tool: inv.tool, input: inv.input }
|
|
144
|
+
return adlMcpCliCall(inv)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* R5 (STATUS.md 12p, re-review 2026-09-28 night): the
|
|
149
|
+
* EFFECTIVE identity for THIS specific `adl mcp cli <command>` invocation —
|
|
150
|
+
* the same M2/M3 correlation `impl/adl-git-push-policy.ts`'s
|
|
151
|
+
* `effectiveIdentityForPush` already gives `git push`, extended to this
|
|
152
|
+
* command class. Before this fix, `adl-workitem-role.ts`/`adl-pr-role.ts`/
|
|
153
|
+
* `adl-pr-review-role.ts` graded `resolveFromEnvOrFile(ctx.env)` alone —
|
|
154
|
+
* ignoring a valid inline `ADL_AGENT_ID_AGENT=` override on the very piece
|
|
155
|
+
* being graded, so a reviewer session's own inline `agent-tarun` override on
|
|
156
|
+
* `adl mcp cli workitem-create-or-update` was denied as `agent-reviewer`
|
|
157
|
+
* regardless (a false deny), and — the more dangerous direction R5 actually
|
|
158
|
+
* names — a `agent-tarun` SESSION with an inline `ADL_AGENT_ID_AGENT=agent-
|
|
159
|
+
* reviewer` override was graded as `agent-tarun` (a false ALLOW: the piece
|
|
160
|
+
* that will actually run is `agent-reviewer`'s).
|
|
161
|
+
*
|
|
162
|
+
* A `tool-call`-kind `inv` (a real MCP tool call, not the CLI shell form)
|
|
163
|
+
* carries no command text at all — no inline override is possible for it —
|
|
164
|
+
* so `fallback` (the session's own resolved identity) is the correct,
|
|
165
|
+
* unchanged answer.
|
|
166
|
+
*/
|
|
167
|
+
export function effectiveIdentityForMcpCli(inv: Invocation, command: string, fallback: string | null): string | null {
|
|
168
|
+
if (inv.kind !== 'command') return fallback
|
|
169
|
+
const gatedCommandWord = inv.args[2]
|
|
170
|
+
if (gatedCommandWord === undefined) return fallback
|
|
171
|
+
const gatedCommand = tokenValue(gatedCommandWord).toLowerCase()
|
|
172
|
+
const restValues = inv.args.slice(3).map((token) => tokenValue(token))
|
|
173
|
+
const pieces = scanAdlMcpCliPieces(command, fallback)
|
|
174
|
+
const match = pieces.find(
|
|
175
|
+
(piece) => piece.command === gatedCommand && piece.rest.length === restValues.length && piece.rest.every((value, index) => value === restValues[index]),
|
|
176
|
+
)
|
|
177
|
+
if (match !== undefined) return match.effectiveAgent
|
|
178
|
+
return effectiveIdentityForCommand(command, fallback)
|
|
179
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `adl.pr-complete-pending-decision` — docs/operations/agent-permissions.md row 9
|
|
3
|
+
* ("PR complete / set auto-complete"), marked **OPEN** in the matrix: denied
|
|
4
|
+
* for BOTH `agent-tarun`/`agent-vivek` AND `agent-reviewer` "until Tarun
|
|
5
|
+
* decides", as its own separately named rule specifically so it can be
|
|
6
|
+
* relaxed (or given a real role split) without touching
|
|
7
|
+
* `adl.pr-create-update-role` (row 5), which keeps allowing a plain PR
|
|
8
|
+
* create/update for builders and `agent-reviewer` throughout
|
|
9
|
+
* (docs/specs/two-branch-standard-2026-09-27.md §1b.5: auto-complete is armed
|
|
10
|
+
* by the azdo core at creation, not set explicitly by an agent).
|
|
11
|
+
*
|
|
12
|
+
* "Setting auto-complete" is `isPrCompletionCall()` (pr-completion.ts) —
|
|
13
|
+
* see that file for why this is scoped to an `update` call that explicitly
|
|
14
|
+
* touches `autoComplete`/`mergeStrategy`/`deleteSourceBranch`, not to every
|
|
15
|
+
* `create` (which arms auto-complete by default already, per a 2026-09-15
|
|
16
|
+
* owner decision unrelated to this row, and denying that would block PR
|
|
17
|
+
* creation entirely).
|
|
18
|
+
*
|
|
19
|
+
* Deliberately does NOT require an identity to be present: row 9 is OPEN
|
|
20
|
+
* regardless of who is asking, including a caller with no session identity at
|
|
21
|
+
* all (whichever rule reports first, the outcome is the same: denied).
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import type { Invocation } from '../shell/invocation.ts'
|
|
25
|
+
import type { Finding, MessageContext, RuleSpec } from '../spec.ts'
|
|
26
|
+
import { noParams } from '../spec.ts'
|
|
27
|
+
import { isPrCompletionCall } from './pr-completion.ts'
|
|
28
|
+
import { mcpToolName } from './mcp-tool.ts'
|
|
29
|
+
import { toolCallFor } from './adl-mcp-cli.ts'
|
|
30
|
+
|
|
31
|
+
const RULE_ID = 'adl.pr-complete-pending-decision'
|
|
32
|
+
|
|
33
|
+
export const adlPrCompletePendingDecision: RuleSpec = {
|
|
34
|
+
id: RULE_ID,
|
|
35
|
+
category: 'tool-call',
|
|
36
|
+
severity: 'deny',
|
|
37
|
+
enabledByDefault: true,
|
|
38
|
+
summary:
|
|
39
|
+
'Deny PR completion / auto-complete for every identity — open decision (docs/operations/agent-permissions.md row 9) — the MCP tool AND its adl mcp cli equivalent (M4).',
|
|
40
|
+
params: noParams,
|
|
41
|
+
match(inv: Invocation): Finding | null {
|
|
42
|
+
// M4 (STATUS.md 12p): `adl mcp cli
|
|
43
|
+
// pr-create-or-update` is the SAME tool `adl.pr-create-update-role`
|
|
44
|
+
// steps aside for on this shape — without this, the CLI form of a
|
|
45
|
+
// completion call would sail through both rules.
|
|
46
|
+
const call = toolCallFor(inv)
|
|
47
|
+
if (call === null) return null
|
|
48
|
+
if (mcpToolName(call.tool) !== 'pr_create_or_update') return null
|
|
49
|
+
if (!isPrCompletionCall(call.input)) return null
|
|
50
|
+
return { ruleId: RULE_ID, severity: 'deny', detail: { tool: call.tool } }
|
|
51
|
+
},
|
|
52
|
+
message(_finding: Finding, ctx: MessageContext) {
|
|
53
|
+
const user = 'PR completion / auto-complete is not enabled for agents yet — pending a decision from Tarun'
|
|
54
|
+
return {
|
|
55
|
+
user,
|
|
56
|
+
agent:
|
|
57
|
+
`DENIED ${user} (docs/operations/agent-permissions.md row 9, marked OPEN). Create or update the PR's title/description ` +
|
|
58
|
+
`normally; do not pass autoComplete, mergeStrategy, or deleteSourceBranch. Blocked: ${ctx.snippet}`,
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
corpus: {
|
|
62
|
+
deny: [],
|
|
63
|
+
allow: ['ls -la', 'git status'],
|
|
64
|
+
},
|
|
65
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `adl.pr-review-role` — docs/operations/agent-permissions.md rows 6-8 (PR comment; PR
|
|
3
|
+
* vote on `main`; PR vote on `integration`), the sibling `adl-pr-role.ts`'s
|
|
4
|
+
* own header named as PENDING until `packages/azdo` shipped a comment/vote
|
|
5
|
+
* tool (C3, `pr_review`). Gates the ONE MCP tool that ships that shape,
|
|
6
|
+
* `pr_review({ pullRequestId, comment?, vote?, targetBranch?, repository? })`
|
|
7
|
+
* — see `packages/azdo/src/azdo-pr-review.ts`.
|
|
8
|
+
*
|
|
9
|
+
* Two independent gates, because a single `pr_review` call may carry a
|
|
10
|
+
* comment, a vote, or both:
|
|
11
|
+
*
|
|
12
|
+
* Row 6 (comment) — same allow-set as row 5's `adl.pr-create-update-role`:
|
|
13
|
+
* a builder (`agent-tarun`/`agent-vivek`) OR `agent-reviewer`. Nobody else.
|
|
14
|
+
* No branch restriction — comments are not a gate.
|
|
15
|
+
*
|
|
16
|
+
* Rows 7/8 (vote) — narrower: `agent-reviewer` ONLY, and only when the
|
|
17
|
+
* call's OWN `targetBranch` argument says `main`. This hook has no network
|
|
18
|
+
* access and cannot ask Azure DevOps what the pull request's real target
|
|
19
|
+
* is, so `targetBranch` is a REQUIRED, caller-declared argument on the tool
|
|
20
|
+
* itself precisely so this rule can gate on it synchronously — the
|
|
21
|
+
* implementation-status note for rows 7/8 in docs/operations/agent-permissions.md is
|
|
22
|
+
* explicit that the vote tool "must fail closed for a vote whose input does
|
|
23
|
+
* not reveal the target branch, or whose target is `integration`", which is
|
|
24
|
+
* exactly the two `return`s below before the role check even runs. The
|
|
25
|
+
* `azdo` core (`azdo-pr-review.ts`) does NOT trust this argument either —
|
|
26
|
+
* it re-derives the pull request's REAL target from Azure DevOps and
|
|
27
|
+
* refuses on a mismatch, the same "never trust the caller, ask Azure"
|
|
28
|
+
* discipline `azdo-pr.ts`'s `assertBranchReadyForPr` already uses. This
|
|
29
|
+
* rule and that core check are deliberately redundant: this one is the
|
|
30
|
+
* fast, offline pre-flight; that one is the authoritative, online guard a
|
|
31
|
+
* caller cannot route around by skipping the hook.
|
|
32
|
+
*
|
|
33
|
+
* Requires an identity to already be present (`ADL_AGENT_ID_AGENT`
|
|
34
|
+
* non-blank) — with no identity at all, `adl.session-required-for-writes`
|
|
35
|
+
* denies the call first (a different problem: no session, not the wrong
|
|
36
|
+
* role or branch), so this rule returns null when the env var is absent or
|
|
37
|
+
* blank, matching `adl-pr-role.ts`'s own convention exactly.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
import type { Invocation } from '../shell/invocation.ts'
|
|
41
|
+
import type { Finding, MessageContext, RuleContext, RuleSpec } from '../spec.ts'
|
|
42
|
+
import { noParams } from '../spec.ts'
|
|
43
|
+
import { AGENT_REVIEWER, BUILDER_AGENTS, resolveFromEnvOrFile } from './adl-identity.ts'
|
|
44
|
+
import { detailString } from './messages.ts'
|
|
45
|
+
import { mcpToolName } from './mcp-tool.ts'
|
|
46
|
+
import { effectiveIdentityForMcpCli, toolCallFor } from './adl-mcp-cli.ts'
|
|
47
|
+
|
|
48
|
+
const RULE_ID = 'adl.pr-review-role'
|
|
49
|
+
|
|
50
|
+
type Reason = 'comment-role' | 'vote-no-target' | 'vote-integration' | 'vote-wrong-branch' | 'vote-role'
|
|
51
|
+
|
|
52
|
+
function isAllowedToComment(agent: string): boolean {
|
|
53
|
+
return BUILDER_AGENTS.has(agent) || agent === AGENT_REVIEWER
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface PrReviewInput {
|
|
57
|
+
readonly comment?: unknown
|
|
58
|
+
readonly vote?: unknown
|
|
59
|
+
readonly targetBranch?: unknown
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function finding(tool: string, agent: string, reason: Reason): Finding {
|
|
63
|
+
return { ruleId: RULE_ID, severity: 'deny', detail: { tool, agent, reason } }
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const adlPrReviewRole: RuleSpec = {
|
|
67
|
+
id: RULE_ID,
|
|
68
|
+
category: 'tool-call',
|
|
69
|
+
severity: 'deny',
|
|
70
|
+
enabledByDefault: true,
|
|
71
|
+
summary:
|
|
72
|
+
'Gate pr_review: comment for a builder or agent-reviewer (row 6); vote for agent-reviewer only, main only, fail-closed without a declared target (rows 7-8).',
|
|
73
|
+
params: noParams,
|
|
74
|
+
match(inv: Invocation, ctx: RuleContext<Record<string, never>>): Finding | null {
|
|
75
|
+
// M4 (STATUS.md 12p): `adl mcp cli
|
|
76
|
+
// pr-review` dispatches to the same tool the MCP server calls.
|
|
77
|
+
const call = toolCallFor(inv)
|
|
78
|
+
if (call === null) return null
|
|
79
|
+
if (mcpToolName(call.tool) !== 'pr_review') return null
|
|
80
|
+
|
|
81
|
+
// R5 (STATUS.md 12p, re-review 2026-09-28 night):
|
|
82
|
+
// grade the EFFECTIVE identity for THIS specific piece — a valid inline
|
|
83
|
+
// `ADL_AGENT_ID_AGENT=` override on the same `adl mcp cli` invocation
|
|
84
|
+
// still wins, exactly like M3 already does for `git push` (see
|
|
85
|
+
// `effectiveIdentityForMcpCli`'s own doc). A real MCP tool-call payload
|
|
86
|
+
// carries no command text at all (no inline override possible), so this
|
|
87
|
+
// still resolves to the plain session identity for that shape — env,
|
|
88
|
+
// else the machine default-agent file (adl-identity.ts's
|
|
89
|
+
// resolveFromEnvOrFile).
|
|
90
|
+
const resolution = resolveFromEnvOrFile(ctx.env)
|
|
91
|
+
const fallback = resolution.ok ? resolution.agent : null
|
|
92
|
+
const agent = effectiveIdentityForMcpCli(inv, ctx.command ?? '', fallback)
|
|
93
|
+
if (agent === null) return null // no identity at all: adl.session-required-for-writes's job
|
|
94
|
+
|
|
95
|
+
const input = call.input as PrReviewInput
|
|
96
|
+
|
|
97
|
+
// Row 6: comment — the more fundamental restriction when present, same
|
|
98
|
+
// allow-set as row 5, checked first regardless of whether a vote is ALSO
|
|
99
|
+
// on this call. W2 build item 2 (2026-09-28): `agent` is now guaranteed
|
|
100
|
+
// a VALID_AGENTS member whenever it is non-null (resolveFromEnvOrFile
|
|
101
|
+
// validates it), and BUILDER_AGENTS ∪ {agent-reviewer} already IS all of
|
|
102
|
+
// VALID_AGENTS for this row — so `!isAllowedToComment(agent)` can never
|
|
103
|
+
// be true through any real resolved identity any more (same fact
|
|
104
|
+
// adl-pr-role.ts's sibling check already lived with, one line, before
|
|
105
|
+
// this widening). Kept as defense in depth for a future VALID_AGENTS
|
|
106
|
+
// member this allow-set does not name, in the same single-physical-line
|
|
107
|
+
// shape adl-pr-role.ts already uses for its own now-unreachable check —
|
|
108
|
+
// see rules-adl-pr-role.test.ts's "denial message is exact" describe
|
|
109
|
+
// block for why the MESSAGE half is tested against a hand-built Finding
|
|
110
|
+
// rather than through this line.
|
|
111
|
+
if (input.comment !== undefined && !isAllowedToComment(agent)) return finding(call.tool, agent, 'comment-role')
|
|
112
|
+
|
|
113
|
+
if (input.vote === undefined) return null
|
|
114
|
+
|
|
115
|
+
// Rows 7/8: vote. Fail closed before anything else — an input that does
|
|
116
|
+
// not name a real target branch is refused the same as one that names
|
|
117
|
+
// `integration`, never defaulted or inferred.
|
|
118
|
+
const targetBranch = typeof input.targetBranch === 'string' ? input.targetBranch.trim() : ''
|
|
119
|
+
if (targetBranch === '') return finding(call.tool, agent, 'vote-no-target')
|
|
120
|
+
if (targetBranch === 'integration') return finding(call.tool, agent, 'vote-integration')
|
|
121
|
+
if (targetBranch !== 'main') return finding(call.tool, agent, 'vote-wrong-branch')
|
|
122
|
+
if (agent !== AGENT_REVIEWER) return finding(call.tool, agent, 'vote-role')
|
|
123
|
+
|
|
124
|
+
return null
|
|
125
|
+
},
|
|
126
|
+
message(finding: Finding, ctx: MessageContext) {
|
|
127
|
+
const tool = detailString(finding, 'tool')
|
|
128
|
+
const agent = detailString(finding, 'agent')
|
|
129
|
+
const reason = detailString(finding, 'reason') as Reason
|
|
130
|
+
const user = ((): string => {
|
|
131
|
+
switch (reason) {
|
|
132
|
+
case 'comment-role':
|
|
133
|
+
return 'this operation can only be done with agent-tarun, agent-vivek, or agent-reviewer'
|
|
134
|
+
case 'vote-no-target':
|
|
135
|
+
return "pr_review vote requires targetBranch (the pull request's real target branch); refused rather than guessing which pull request this vote is for"
|
|
136
|
+
case 'vote-integration':
|
|
137
|
+
return 'no vote gate on integration — CI + auto-complete only, no human or agent review there'
|
|
138
|
+
case 'vote-wrong-branch':
|
|
139
|
+
return "votes are only defined for pull requests targeting 'main' or 'integration'"
|
|
140
|
+
case 'vote-role':
|
|
141
|
+
return "human approval gate — an agent vote does not substitute for Tarun's or Vivek's own review"
|
|
142
|
+
}
|
|
143
|
+
})()
|
|
144
|
+
return {
|
|
145
|
+
user,
|
|
146
|
+
agent: `DENIED ${tool} for '${agent}' (${reason}): ${user}. Blocked: ${ctx.snippet}`,
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
corpus: {
|
|
150
|
+
// Tool-call rule; the shared shell corpus only proves this rule never
|
|
151
|
+
// fires on an unrelated shell command. Real coverage is
|
|
152
|
+
// tests/unit/rules-adl-pr-review-role.test.ts.
|
|
153
|
+
deny: [],
|
|
154
|
+
allow: ['ls -la', 'git status'],
|
|
155
|
+
},
|
|
156
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `adl.pr-create-update-role` — docs/operations/agent-permissions.md row 5 (PR
|
|
3
|
+
* create/update), updated for the two-branch standard
|
|
4
|
+
* (docs/specs/two-branch-standard-2026-09-27.md §1b.1): builders
|
|
5
|
+
* (`agent-tarun`/`agent-vivek`) cut a feature branch from `integration` and
|
|
6
|
+
* **create their own PRs into it** — `packages/azdo/src/mcp-server.ts`
|
|
7
|
+
* registers exactly one PR write tool, `pr_create_or_update`
|
|
8
|
+
* (`action: 'create' | 'update'`), and it always targets `integration` (there
|
|
9
|
+
* is no target-branch choice for a caller to make). `agent-reviewer` stays
|
|
10
|
+
* ALLOWED too — its `main` vote is optional for now (§1b.1: "agent-reviewer
|
|
11
|
+
* is optional for now"), and nothing stops it opening/updating a PR either.
|
|
12
|
+
* Nobody else may.
|
|
13
|
+
*
|
|
14
|
+
* This is the mirror image of `adl-workitem-role.ts`'s row 10 (there:
|
|
15
|
+
* everyone but `agent-reviewer`; here: builders AND `agent-reviewer`), not a
|
|
16
|
+
* simple negation of either — hence the explicit allow-set below rather than
|
|
17
|
+
* a single `!== AGENT_REVIEWER` check.
|
|
18
|
+
*
|
|
19
|
+
* Azure DevOps' own repo-wide "Contribute to pull requests" Deny on
|
|
20
|
+
* `agent-tarun`/`agent-vivek` (docs/specs/two-branch-standard-2026-09-27.md
|
|
21
|
+
* §3.1 P1) is a SEPARATE, ADO-side change this rule does not make — until P1
|
|
22
|
+
* lands, a builder's create/update call can still 403 at Azure DevOps even
|
|
23
|
+
* though this hook now allows it through. The row's REWRITE half (`az repos
|
|
24
|
+
* pr create/update` → `adl pr create/update`) is explicitly a LATER stream
|
|
25
|
+
* (docs/operations/agent-permissions.md "Build order"); `tool.azure-devops` keeps
|
|
26
|
+
* denying the raw `az` form unchanged, and this rule does not touch it.
|
|
27
|
+
*
|
|
28
|
+
* Row 9 (PR complete / set auto-complete) is a SEPARATE, more specific rule
|
|
29
|
+
* (adl-pr-complete-pending.ts) so it can be relaxed independently once Tarun
|
|
30
|
+
* decides — see that file. It denies EVERY identity, builder or reviewer
|
|
31
|
+
* alike (auto-complete is armed by the azdo core at PR creation, never set
|
|
32
|
+
* explicitly by an agent — docs/specs/two-branch-standard-2026-09-27.md
|
|
33
|
+
* §1b.5's brief), so this rule steps aside for the completion shape
|
|
34
|
+
* regardless of who is asking, and the two rules never fight over the same
|
|
35
|
+
* call.
|
|
36
|
+
*
|
|
37
|
+
* Rows 6 and 7 (PR comment; PR vote) are the same allow-set shape, but
|
|
38
|
+
* `packages/azdo` has no comment/vote tool today — grepped 2026-09-27,
|
|
39
|
+
* nothing named `pr_review`/`pr_comment`/`pr_vote` exists. PENDING: add a
|
|
40
|
+
* sibling check here (or a new rule) when Stream B ships one, rather than
|
|
41
|
+
* matching a guessed tool name now.
|
|
42
|
+
*
|
|
43
|
+
* Requires an identity to already be present (`ADL_AGENT_ID_AGENT`
|
|
44
|
+
* non-blank) — with no identity at all, `adl.session-required-for-writes`
|
|
45
|
+
* denies the call first (a different problem: no session, not the wrong
|
|
46
|
+
* role), so this rule returns null when the env var is absent or blank.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
import type { Invocation } from '../shell/invocation.ts'
|
|
50
|
+
import type { Finding, MessageContext, RuleContext, RuleSpec } from '../spec.ts'
|
|
51
|
+
import { noParams } from '../spec.ts'
|
|
52
|
+
import { AGENT_REVIEWER, BUILDER_AGENTS, resolveFromEnvOrFile } from './adl-identity.ts'
|
|
53
|
+
import { detailString } from './messages.ts'
|
|
54
|
+
import { mcpToolName } from './mcp-tool.ts'
|
|
55
|
+
import { isPrCompletionCall } from './pr-completion.ts'
|
|
56
|
+
import { effectiveIdentityForMcpCli, toolCallFor } from './adl-mcp-cli.ts'
|
|
57
|
+
|
|
58
|
+
const RULE_ID = 'adl.pr-create-update-role'
|
|
59
|
+
|
|
60
|
+
function isAllowedToCreateOrUpdatePrs(agent: string): boolean {
|
|
61
|
+
return BUILDER_AGENTS.has(agent) || agent === AGENT_REVIEWER
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const adlPrCreateUpdateRole: RuleSpec = {
|
|
65
|
+
id: RULE_ID,
|
|
66
|
+
category: 'tool-call',
|
|
67
|
+
severity: 'deny',
|
|
68
|
+
enabledByDefault: true,
|
|
69
|
+
summary:
|
|
70
|
+
'Deny pr_create_or_update for any identity other than a builder (agent-tarun/agent-vivek) or agent-reviewer (docs/operations/agent-permissions.md row 5).',
|
|
71
|
+
params: noParams,
|
|
72
|
+
match(inv: Invocation, ctx: RuleContext<Record<string, never>>): Finding | null {
|
|
73
|
+
// M4 (STATUS.md 12p): `adl mcp cli
|
|
74
|
+
// pr-create-or-update` dispatches to the same tool the MCP server calls.
|
|
75
|
+
const call = toolCallFor(inv)
|
|
76
|
+
if (call === null) return null
|
|
77
|
+
if (mcpToolName(call.tool) !== 'pr_create_or_update') return null
|
|
78
|
+
|
|
79
|
+
// R5 (STATUS.md 12p, re-review 2026-09-28 night):
|
|
80
|
+
// grade the EFFECTIVE identity for THIS specific piece — a valid inline
|
|
81
|
+
// `ADL_AGENT_ID_AGENT=` override on the same `adl mcp cli` invocation
|
|
82
|
+
// still wins, exactly like M3 already does for `git push` (see
|
|
83
|
+
// `effectiveIdentityForMcpCli`'s own doc). A real MCP tool-call payload
|
|
84
|
+
// carries no command text at all (no inline override possible), so this
|
|
85
|
+
// still resolves to the plain session identity for that shape — env,
|
|
86
|
+
// else the machine default-agent file (adl-identity.ts's
|
|
87
|
+
// resolveFromEnvOrFile).
|
|
88
|
+
const resolution = resolveFromEnvOrFile(ctx.env)
|
|
89
|
+
const fallback = resolution.ok ? resolution.agent : null
|
|
90
|
+
const agent = effectiveIdentityForMcpCli(inv, ctx.command ?? '', fallback)
|
|
91
|
+
if (agent === null) return null // no identity at all: adl.session-required-for-writes's job
|
|
92
|
+
|
|
93
|
+
// Not a builder and not agent-reviewer: denied regardless of shape — this
|
|
94
|
+
// is the more fundamental restriction, so it reports even for a call that
|
|
95
|
+
// ALSO happens to be completion-shaped.
|
|
96
|
+
if (!isAllowedToCreateOrUpdatePrs(agent)) return { ruleId: RULE_ID, severity: 'deny', detail: { tool: call.tool } }
|
|
97
|
+
|
|
98
|
+
// A builder or agent-reviewer would otherwise be allowed by this rule —
|
|
99
|
+
// EXCEPT row 9 (PR completion / auto-complete) overrides that for
|
|
100
|
+
// everyone; let adl.pr-complete-pending-decision report instead, so it
|
|
101
|
+
// stays the one place that decision can be relaxed later.
|
|
102
|
+
if (isPrCompletionCall(call.input)) return null
|
|
103
|
+
|
|
104
|
+
return null
|
|
105
|
+
},
|
|
106
|
+
message(finding: Finding, ctx: MessageContext) {
|
|
107
|
+
const tool = detailString(finding, 'tool')
|
|
108
|
+
const user = 'this operation can only be done with agent-tarun, agent-vivek, or agent-reviewer'
|
|
109
|
+
return {
|
|
110
|
+
user,
|
|
111
|
+
agent: `DENIED ${tool}: ${user}. Blocked: ${ctx.snippet}`,
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
corpus: {
|
|
115
|
+
// Tool-call rule; the shared shell corpus only proves this rule never
|
|
116
|
+
// fires on an unrelated shell command (tests/unit/rules-tool-search.test.ts's
|
|
117
|
+
// pattern). Real coverage is tests/unit/rules-adl-pr-role.test.ts.
|
|
118
|
+
deny: [],
|
|
119
|
+
allow: ['ls -la', 'git status'],
|
|
120
|
+
},
|
|
121
|
+
}
|