@amsterdamdatalabs/adl-agent-control-linux-x64 0.1.12 → 0.1.26
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 +2 -2
- package/bin/git +16 -17
- package/bin/git-ado +25 -24
- package/bin/git-defaults +173 -0
- package/bin/health-check +8 -1
- package/bin/kimi-hooks +1 -1
- package/bin/lib/adl-package.sh +257 -0
- package/bin/lib/fleet-host.sh +8 -5
- package/bin/reconcile +482 -232
- package/bin/reconcile-host +30 -20
- package/bin/setup +20 -17
- package/bin/shell-path-policy +15 -5
- package/bin/sync-and-reconcile +62 -64
- package/bin/validate-manifest +33 -9
- package/package.json +2 -10
- package/packages/agent-hooks/README.md +14 -9
- package/packages/agent-hooks/assets/hooks.json +0 -20
- package/packages/agent-hooks/src/cli/args.ts +1 -1
- package/packages/agent-hooks/src/cli/doctor.ts +6 -58
- package/packages/agent-hooks/src/deploy/deploy.ts +12 -41
- package/packages/agent-hooks/src/deploy/doctor.ts +8 -11
- package/packages/agent-hooks/src/deploy/index.ts +14 -14
- package/packages/agent-hooks/src/deploy/json-merge.ts +7 -8
- package/packages/agent-hooks/src/deploy/legacy-lock.ts +2 -2
- package/packages/agent-hooks/src/deploy/list.ts +1 -1
- package/packages/agent-hooks/src/deploy/lock.ts +31 -12
- package/packages/agent-hooks/src/deploy/profile.ts +3 -4
- package/packages/agent-hooks/src/deploy/source.ts +1 -1
- package/packages/agent-hooks/src/gating/config.ts +10 -24
- package/packages/agent-hooks/src/gating/root.ts +3 -3
- package/packages/agent-hooks/src/hooks/briefing/handler.ts +2 -2
- package/packages/agent-hooks/src/hooks/briefing/index.ts +27 -287
- package/packages/agent-hooks/src/hooks/contract.ts +17 -17
- package/packages/agent-hooks/src/hooks/crg/background.ts +27 -0
- package/packages/agent-hooks/src/hooks/crg/index.ts +7 -6
- package/packages/agent-hooks/src/hooks/log.ts +8 -10
- package/packages/agent-hooks/src/hooks/user-prompt-submit/match.ts +1 -1
- package/packages/agent-hooks/src/hooks/user-prompt-submit/tokenizer.ts +1 -1
- package/packages/agent-hooks/src/hooks/user-prompt-submit/vector.ts +6 -5
- package/packages/agent-hooks/src/hosts/registry.ts +1 -1
- package/packages/agent-hooks/src/log/adl-dir.ts +44 -0
- package/packages/agent-hooks/src/log/writer.ts +16 -2
- package/packages/agent-hooks/src/main.ts +7 -41
- package/packages/agent-hooks/src/pre-tool-use/handler.ts +71 -82
- package/packages/agent-hooks/src/rules/engine.ts +13 -17
- package/packages/agent-hooks/src/rules/impl/adl-build-run-denied.ts +3 -3
- package/packages/agent-hooks/src/rules/impl/adl-git-credential-bypass.ts +12 -14
- package/packages/agent-hooks/src/rules/impl/adl-git-identity.ts +28 -28
- package/packages/agent-hooks/src/rules/impl/adl-git-push-policy.ts +8 -9
- package/packages/agent-hooks/src/rules/impl/adl-human-azdo-bypass.ts +56 -59
- package/packages/agent-hooks/src/rules/impl/adl-identity.ts +16 -23
- package/packages/agent-hooks/src/rules/impl/adl-mcp-cli.ts +19 -16
- package/packages/agent-hooks/src/rules/impl/adl-pr-complete-pending.ts +2 -2
- package/packages/agent-hooks/src/rules/impl/adl-pr-review-role.ts +9 -12
- package/packages/agent-hooks/src/rules/impl/adl-pr-role.ts +5 -7
- package/packages/agent-hooks/src/rules/impl/adl-run-required.ts +411 -0
- package/packages/agent-hooks/src/rules/impl/adl-token-minting-role.ts +4 -5
- package/packages/agent-hooks/src/rules/impl/adl-workitem-role.ts +6 -7
- package/packages/agent-hooks/src/rules/impl/agent-tamper-protection.ts +77 -70
- package/packages/agent-hooks/src/rules/impl/deny-allowlist.ts +159 -0
- package/packages/agent-hooks/src/rules/impl/git-helpers.ts +21 -23
- package/packages/agent-hooks/src/rules/impl/git-worktree.ts +14 -28
- package/packages/agent-hooks/src/rules/impl/mcp-tool.ts +3 -3
- package/packages/agent-hooks/src/rules/impl/messages.ts +1 -1
- package/packages/agent-hooks/src/rules/impl/pr-completion.ts +1 -1
- package/packages/agent-hooks/src/rules/impl/tool-azure-devops.ts +35 -46
- package/packages/agent-hooks/src/rules/impl/tool-find.ts +34 -7
- package/packages/agent-hooks/src/rules/impl/tool-grep.ts +34 -12
- package/packages/agent-hooks/src/rules/impl/tool-native-search.ts +52 -9
- package/packages/agent-hooks/src/rules/ports.ts +5 -7
- package/packages/agent-hooks/src/rules/registry.ts +4 -6
- package/packages/agent-hooks/src/rules/shell/git-identity.ts +86 -101
- package/packages/agent-hooks/src/rules/shell/git-internals.ts +1 -1
- package/packages/agent-hooks/src/rules/shell/invocation.ts +24 -118
- package/packages/agent-hooks/src/rules/shell/piped-script.ts +1 -1
- package/packages/agent-hooks/src/rules/shell/prefixes.ts +1 -1
- package/packages/agent-hooks/src/rules/shell/protected-carrier-writes.ts +11 -10
- package/packages/agent-hooks/src/rules/shell/protected-carriers.ts +26 -26
- package/packages/agent-hooks/src/rules/shell/substitution.ts +1 -1
- package/packages/agent-hooks/src/rules/shell/xargs.ts +2 -2
- package/packages/agent-hooks/src/rules/spec.ts +2 -2
- package/packages/agent-settings/README.md +287 -0
- package/packages/agent-settings/assets/GLOBAL-AGENTS.md +14 -16
- package/packages/agent-settings/assets/agents/architect.toml +2 -0
- package/packages/agent-settings/assets/agents/code-reviewer.toml +2 -0
- package/packages/agent-settings/assets/agents/executor.toml +2 -0
- package/packages/agent-settings/assets/agents/explore.toml +2 -0
- package/packages/agent-settings/assets/agents/planner.toml +2 -0
- package/packages/agent-settings/assets/mcp.json +0 -4
- package/packages/agent-settings/deploy-profile.json +139 -0
- package/packages/agent-settings/deploy-profile.schema.json +147 -0
- package/packages/agent-settings/managed/README.md +29 -30
- package/packages/agent-settings/managed/codex-requirements.toml +9 -9
- package/packages/agent-settings/package.json +20 -0
- package/packages/agent-settings/src/deploy/agent-render.ts +2 -2
- package/packages/agent-settings/src/deploy/agent-toml.ts +1 -1
- package/packages/agent-settings/src/deploy/agents-deploy.ts +17 -3
- package/packages/agent-settings/src/deploy/doctor.ts +3 -83
- package/packages/agent-settings/src/deploy/index.ts +6 -33
- package/packages/agent-settings/src/deploy/legacy-lock.ts +6 -6
- package/packages/agent-settings/src/deploy/list.ts +5 -19
- package/packages/agent-settings/src/deploy/lock.ts +8 -18
- package/packages/agent-settings/src/deploy/mcp-deploy.ts +10 -5
- package/packages/agent-settings/src/deploy/mcp-merge.ts +22 -3
- package/packages/agent-settings/src/deploy/mcp-source.ts +1 -1
- package/packages/agent-settings/src/deploy/profile.ts +11 -35
- package/packages/agent-settings/src/deploy/retire-lean-ctx.ts +184 -0
- package/packages/agent-settings/src/deploy/settings.ts +17 -22
- package/packages/agent-settings/src/global-surface-sweep.ts +0 -2
- package/packages/agent-settings/src/kimi-hooks.ts +339 -192
- package/packages/agent-settings/src/opencode-hooks.ts +1 -1
- package/packages/agent-settings/tsconfig.json +23 -0
- package/packages/agent-skills/assets/agent-search-tool-audit/SKILL.md +120 -0
- package/packages/agent-skills/assets/agent-search-tool-audit/scripts/audit.sh +276 -0
- package/packages/agent-skills/assets/debug-issue/SKILL.md +8 -7
- package/packages/agent-skills/assets/explore-codebase/SKILL.md +13 -13
- package/packages/agent-skills/assets/refactor-safely/SKILL.md +12 -11
- package/packages/agent-skills/assets/review-changes/SKILL.md +7 -7
- package/packages/agent-skills/assets/testing/references/e2e.md +37 -0
- package/packages/agent-skills/assets/testing/references/integration.md +37 -0
- package/packages/agent-skills/assets/testing/references/unit.md +32 -0
- package/packages/agent-skills/dist/deploy.d.ts +2 -0
- package/packages/agent-skills/dist/deploy.d.ts.map +1 -1
- package/packages/agent-skills/dist/deploy.js +27 -1
- package/packages/agent-skills/dist/deploy.js.map +1 -1
- package/packages/agent-skills/dist/doctor.d.ts +0 -2
- package/packages/agent-skills/dist/doctor.d.ts.map +1 -1
- package/packages/agent-skills/dist/doctor.js +1 -1
- package/packages/agent-skills/dist/doctor.js.map +1 -1
- package/packages/agent-skills/dist/fs-utils.d.ts +0 -1
- package/packages/agent-skills/dist/fs-utils.d.ts.map +1 -1
- package/packages/agent-skills/dist/fs-utils.js +1 -1
- package/packages/agent-skills/dist/fs-utils.js.map +1 -1
- package/packages/agent-skills/src/deploy.ts +29 -1
- package/packages/agent-skills/src/doctor.ts +1 -1
- package/packages/agent-skills/src/fs-utils.ts +1 -1
- package/packages/azdo/README.md +10 -9
- package/packages/azdo/package.json +1 -3
- package/packages/azdo/src/azdo-pl.ts +2 -54
- package/packages/azdo/src/azdo-pr-review.ts +4 -4
- package/packages/azdo/src/azdo-repo-doctor.ts +101 -52
- package/packages/azdo/src/azdo-wit.ts +41 -2
- package/packages/azdo/src/lib/agent-identity.ts +12 -14
- package/packages/azdo/src/lib/agent-token.ts +2 -2
- package/packages/azdo/src/lib/client.ts +0 -5
- package/packages/azdo/src/lib/graph-identity.ts +4 -4
- package/packages/azdo/src/workflow-rules-matrix.csv +85 -0
- package/packages/azdo/src/workflow-rules.ts +128 -0
- package/packages/fleet/manifest.json +35 -11
- package/packages/fleet/manifest.schema.json +62 -10
- package/packages/fleet/src/default-agent-file.ts +3 -3
- package/packages/fleet/src/install-adl-package.ts +73 -15
- package/packages/fleet/src/install-embedding-model.ts +13 -13
- package/packages/fleet/src/managed-settings.ts +7 -7
- package/packages/fleet/src/repo-maintain.ts +91 -55
- package/packages/fleet/src/scratch-reap.ts +5 -5
- package/packages/fleet/src/vscode-settings.ts +5 -5
- package/packages/repo-controls/README.md +141 -43
- package/packages/repo-controls/assets/promote.ts +4 -4
- package/packages/repo-controls/assets/reconcile-guard.sh +10 -46
- package/packages/repo-controls/assets/version-bump.sh +31 -84
- package/packages/repo-controls/bunfig.toml +6 -7
- package/packages/repo-controls/package/adl-compliance/AGENTS.md +5 -6
- package/packages/repo-controls/package/adl-compliance/conftest.py +3 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/__init__.py +4 -16
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/test_check.py +9 -2
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/notes.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/test_check.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/__init__.py +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/check.py +266 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-assets/docs/guide/.drafts/c.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-assets/docs/guide/.drafts/d.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-assets/docs/guide/.hidden.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-assets/docs/guide/a.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-assets/docs/guide/b.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-assets/docs/guide/data.csv +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-assets/docs/guide/diagram.png +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-assets/docs/guide/mock.png +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-assets/docs/guide/sub/nested.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-assets/docs.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-assets/grants.yaml +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-assets/plans/deep/p1.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-assets/plans/deep/p2.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-assets/plans/deep/p3.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-assets/plans/deep/p4.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-assets/plans/deep/p5.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-clean/docs/architecture/build.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-clean/docs/architecture/overview.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-clean/docs/guide/install.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-clean/docs/guide/start.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-clean/grants.yaml +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-decisions/docs/decisions/adr-001-tenancy.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-decisions/docs/decisions/adr-002-carrier.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-decisions/docs/decisions/adr-003-cli.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-decisions/docs/decisions/archive/adr-000-old.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-decisions/docs/decisions/archive/adr-000-older.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-decisions/docs/guide/a.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-decisions/docs/guide/b.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-decisions/docs/guide/c.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-decisions/grants.yaml +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/docs/guide/page-01.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/docs/guide/page-02.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/docs/guide/page-03.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/docs/guide/page-04.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/docs/guide/page-05.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/docs/guide/page-06.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/docs/guide/page-07.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/docs/guide/page-08.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/docs/guide/page-09.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/docs/guide/page-10.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/docs/guide/page-11.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/docs/guide/page-12.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/docs/guide/page-13.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/docs/guide/page-14.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/docs/guide/page-15.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/docs/guide/page-16.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-default-cap/grants.yaml +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-exempt/docs/guide/a.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-exempt/docs/guide/b.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-exempt/docs/guide/c.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-exempt/grants.yaml +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-grew/docs/guide/a.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-grew/docs/guide/b.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-grew/docs/guide/c.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-grew/grants.yaml +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-no-section/docs/guide/a.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-no-section/docs/guide/b.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-no-section/docs/guide/c.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-no-section/docs/guide/d.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-no-section/docs/guide/e.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-no-section/grants.yaml +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-over-cap/docs/guide/a.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-over-cap/docs/guide/b.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-over-cap/docs/guide/c.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-over-cap/docs/short/only.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-over-cap/grants.yaml +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-stale/docs/held/a.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-stale/docs/held/b.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-stale/docs/held/c.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-stale/docs/held/d.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-stale/docs/shrunk/a.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-stale/docs/shrunk/b.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-stale/grants.yaml +6 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-unusable/docs/guide/a.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-unusable/docs/guide/b.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-unusable/docs/guide/c.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/fixtures/docs-size-unusable/grants.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/directory_size/test_check.py +345 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/check.py +18 -5
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/test_check.py +35 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/__init__.py +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/check.py +91 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/CLAUDE.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/architecture/-leading-hyphen.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/architecture/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/architecture/double--hyphen.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/architecture/getting started.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/architecture/nested/page-here.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/architecture/trailing-hyphen-.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/architecture/ui-contract.md +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/architecture/user_profile.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/assets/UI-CONTRACT.png +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/assets/diagram.png +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/index.md +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/notes.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/reference.html +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/research/2026-10-experiment.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs/research/UI-CONTRACT.md +6 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/fixtures/docs.md +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/filename/test_check.py +194 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/check.py +14 -2
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/docs-knowledge-indexes.yaml +5 -5
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-shipped-register-legacy/docs/compliance/index.md +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-shipped-register-type/docs/compliance/index.md +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/test_check.py +58 -6
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/test_check.py +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/check.py +64 -17
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/docs-okf-profiles.yaml +60 -9
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-ledger-clean/docs/notes.md +17 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-ledger-no-lines/docs/notes.md +13 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-clean/docs/architecture/demo.md +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-clean/docs-okf-profiles.yaml +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-untyped/docs/research/no-type.md +9 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-untyped/docs/research/typed-experiment.md +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-untyped/docs/research/typed-research.md +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-untyped/docs-okf-profiles.yaml +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-violation/docs/architecture/bad-status.md +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-violation/docs-okf-profiles.yaml +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/experiment-ok.md +15 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/extra-key.md +15 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/extra-keys.md +16 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/missing-created.md +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/missing-description.md +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/missing-last-update.md +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/missing-sources.md +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/missing-status.md +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/missing-title.md +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/optional-keys.md +16 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/research-ok.md +14 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research-neighbours/docs/architecture/created-date.md +21 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research-neighbours/docs/architecture/research-shaped.md +19 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research-neighbours/docs/operations/runbook.md +26 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/test_check.py +228 -2
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/register.py +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/test_check.py +11 -2
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/__init__.py +5 -3
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/check.py +160 -44
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-clean/grants.yaml +0 -2
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-empty-register/frontend/packages/desktop/src/a.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-empty-register/frontend/packages/desktop/src/b.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-empty-register/grants.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/grants.yaml +0 -2
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-missing-tree/frontend/packages/desktop/src/renderer/solo/item.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-missing-tree/grants.yaml +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-no-ceilings/frontend/packages/desktop/src/a.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-no-ceilings/frontend/packages/desktop/src/b.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-no-ceilings/frontend/packages/desktop/src/c.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-no-ceilings/grants.yaml +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-stale-entry/frontend/packages/desktop/src/renderer/solo/item.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-stale-entry/grants.yaml +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/grants.yaml +0 -2
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unusable-register/frontend/packages/desktop/src/renderer/solo/item.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unusable-register/grants.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/register.py +127 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/test_check.py +265 -29
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/check.py +75 -2
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/test_check.py +194 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/open_work_cap/check.py +56 -10
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/open_work_cap/test_check.py +256 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/check.py +40 -12
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/test_check.py +108 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/test_check.py +1 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/check.py +2 -3
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/check.py +23 -6
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/test_check.py +76 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/check.py +58 -17
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/test_check.py +161 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/check.py +35 -3
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/test_check.py +108 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/check.py +281 -61
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/absolute-path.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/backslash-path.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/baseline-is-a-list.yaml +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/boolean-size.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/dot-segment.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/duplicate-path.yaml +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/empty-file.yaml +0 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/empty-segment.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/float-size.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/negative-size.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/no-over-limit-baseline.yaml +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/no-schema-version.yaml +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/non-string-path.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/not-yaml.yaml +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/null-size.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/parent-segment.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/string-size.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/top-level-is-a-list.yaml +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/trailing-slash.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/unknown-key.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/wrong-schema-version.yaml +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/malformed/zero-size.yaml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/valid.yaml +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/test_check.py +758 -45
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/ignored_paths/check.py +4 -3
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/ignored_paths/test_check.py +2 -2
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/cargo_lock.py +490 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/check.py +368 -55
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/test_check.py +4 -2
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/test_declared_paths.py +523 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/test_stale_lock.py +1179 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/cli.py +122 -3
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/check.py +33 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/constants.py +0 -11
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/context.py +16 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/config.py +1 -2
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/docs_shape.py +12 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/gate-registry.alt.yaml +133 -147
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/gate-registry.yaml +133 -147
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/registry.py +1 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/root_shape.py +52 -10
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/runner.py +23 -4
- package/packages/repo-controls/package.json +2 -9
- package/packages/repo-controls/scripts/hooks/post-merge +13 -0
- package/packages/repo-controls/scripts/hooks/pre-push +3 -3
- package/packages/repo-controls/src/azdo-push.ts +64 -36
- package/packages/repo-controls/src/azure-devops-governance.ts +7 -9
- package/packages/repo-controls/src/azure-devops-remote.ts +1 -1
- package/packages/repo-controls/src/cli.ts +29 -8
- package/packages/repo-controls/src/compliance-config.ts +410 -2
- package/packages/repo-controls/src/config.ts +133 -60
- package/packages/repo-controls/src/constants.ts +13 -27
- package/packages/repo-controls/src/coverage-ratchet.ts +4 -4
- package/packages/repo-controls/src/doctor.ts +46 -19
- package/packages/repo-controls/src/gitignore-block.ts +5 -29
- package/packages/repo-controls/src/hook-log.ts +1 -2
- package/packages/repo-controls/src/hook.ts +201 -45
- package/packages/repo-controls/src/install.ts +14 -8
- package/packages/repo-controls/src/integrity.ts +3 -3
- package/packages/repo-controls/src/lfs.ts +111 -0
- package/packages/repo-controls/src/promote.ts +8 -8
- package/packages/repo-controls/src/runtime.ts +9 -1
- package/packages/repo-controls/src/workflows-drift.ts +4 -5
- package/packages/repo-controls/src/worktree-guard.ts +3 -3
|
@@ -53,7 +53,7 @@ import { fsTrash } from './impl/fs-trash.ts'
|
|
|
53
53
|
import { toolCargo } from './impl/tool-cargo.ts'
|
|
54
54
|
import { toolBunTest } from './impl/tool-bun-test.ts'
|
|
55
55
|
import { toolAzureDevops } from './impl/tool-azure-devops.ts'
|
|
56
|
-
import {
|
|
56
|
+
import { adlRunRequiredForWrites } from './impl/adl-run-required.ts'
|
|
57
57
|
import { adlHumanAzdoBypass } from './impl/adl-human-azdo-bypass.ts'
|
|
58
58
|
import { adlGitCredentialBypass, adlSecurityKeychainAdo } from './impl/adl-git-credential-bypass.ts'
|
|
59
59
|
import { adlGitPushBranchPolicy } from './impl/adl-git-push-policy.ts'
|
|
@@ -69,7 +69,6 @@ import { toolGrep } from './impl/tool-grep.ts'
|
|
|
69
69
|
import { toolNativeSearch } from './impl/tool-native-search.ts'
|
|
70
70
|
import { toolFrontend } from './impl/tool-frontend.ts'
|
|
71
71
|
import { toolChmodHookDisarm } from './impl/tool-chmod-hook.ts'
|
|
72
|
-
import { toolLeanCtxGlobalState } from './impl/tool-lean-ctx-global.ts'
|
|
73
72
|
import { shellRemoteScriptExec } from './impl/shell-remote-script-exec.ts'
|
|
74
73
|
import { parseUncertain } from './impl/parse-uncertain.ts'
|
|
75
74
|
import { advisoryFinder } from './impl/advisory-finder.ts'
|
|
@@ -124,21 +123,20 @@ export const TOOL_RULES: readonly AnyRuleSpec[] = [
|
|
|
124
123
|
toolNativeSearch,
|
|
125
124
|
toolFrontend,
|
|
126
125
|
toolChmodHookDisarm,
|
|
127
|
-
toolLeanCtxGlobalState,
|
|
128
126
|
shellRemoteScriptExec,
|
|
129
127
|
// Before everything else identity-related: an agent setting the human
|
|
130
128
|
// pass-through marker itself is the most fundamental problem (decisions
|
|
131
129
|
// 1/1b/1c) — it gets its own specific message rather than being shadowed
|
|
132
130
|
// by a "no identity"/"protected branch"/credential-bypass one.
|
|
133
131
|
adlHumanAzdoBypass,
|
|
134
|
-
// Before adl.
|
|
132
|
+
// Before adl.run-required-for-writes: an absolute-binary/remote-
|
|
135
133
|
// update/submodule/credential-helper bypass is the more fundamental
|
|
136
134
|
// problem (it sidesteps bin/git-ado's routing regardless of whether an
|
|
137
135
|
// identity would otherwise resolve), so it gets its own specific message
|
|
138
136
|
// rather than being shadowed by the generic "no identity" one.
|
|
139
137
|
adlGitCredentialBypass,
|
|
140
138
|
adlSecurityKeychainAdo,
|
|
141
|
-
|
|
139
|
+
adlRunRequiredForWrites,
|
|
142
140
|
adlGitPushBranchPolicy,
|
|
143
141
|
// After the push policies: it rewrites what they allow, and denies the
|
|
144
142
|
// identity conflicts (inline override / sudo wrapper) those rules ignore.
|
|
@@ -172,7 +170,7 @@ export const ADVISORY_RULES: readonly AnyRuleSpec[] = [advisoryFinder, advisoryC
|
|
|
172
170
|
* `AGENT_VAULT_*` env triad) was removed. It gated Azure DevOps access
|
|
173
171
|
* unconditionally on `AGENT_VAULT_VAULT`, ran BEFORE every `adl.*` rule in
|
|
174
172
|
* `BUILTIN_RULES`, and did not know about adl's own identity mechanism
|
|
175
|
-
* (`ADL_AGENT_ID_AGENT`, `adl.
|
|
173
|
+
* (`ADL_AGENT_ID_AGENT`, `adl.run-required-for-writes`,
|
|
176
174
|
* `adl.git-push-branch-policy`) — the two mechanisms conflicted and the
|
|
177
175
|
* Agent-Vault one intercepted first, regressing adl's tested behaviour. Only
|
|
178
176
|
* `agent.secrets-stay-unread` and `agent.tamper-protection` survive; neither
|
|
@@ -19,17 +19,15 @@
|
|
|
19
19
|
* The verb list (`NETWORK_GIT_VERBS`) started as exactly `bin/git-ado`'s
|
|
20
20
|
* credential path (`fetch|pull|clone|ls-remote|push`, bin/git-ado:159-165):
|
|
21
21
|
* those are the commands for which a missing identity silently becomes the
|
|
22
|
-
* human.
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* classifies as network, only for what `bin/git-ado`'s OWN credential path
|
|
32
|
-
* covers today. Reads and local operations (`status`/`log`/`diff`/…) never
|
|
22
|
+
* human. What this file (and `impl/adl-run-required.ts`'s deny side)
|
|
23
|
+
* actually TREATS as network is wider — see `isNetworkGitInvocation`'s own
|
|
24
|
+
* doc below for the additional shapes (`git remote show|prune|update`/
|
|
25
|
+
* `set-head -a`, `git maintenance run --task=prefetch` specifically — not a
|
|
26
|
+
* bare `git maintenance run`, aligned with the `bin/git` front controller's
|
|
27
|
+
* own narrower routing there — the transport helpers,
|
|
28
|
+
* `git submodule update|sync --recursive`, `git archive --remote`); the bare
|
|
29
|
+
* five-verb `NETWORK_GIT_VERBS` set is only what the git-ado credential path
|
|
30
|
+
* itself was first built around. Reads and local operations (`status`/`log`/`diff`/…) never
|
|
33
31
|
* touch git-ado's identity branch and are deliberately left untouched,
|
|
34
32
|
* idempotency included — a command already prefixed with the SAME identity
|
|
35
33
|
* is returned unchanged, and one prefixed with a DIFFERENT (or emptied)
|
|
@@ -76,8 +74,8 @@ import {
|
|
|
76
74
|
export const NETWORK_GIT_VERBS: ReadonlySet<string> = new Set(['fetch', 'pull', 'clone', 'ls-remote', 'push'])
|
|
77
75
|
|
|
78
76
|
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
77
|
+
* Network-reaching git shapes beyond the bare verb set —
|
|
78
|
+
* subcommands other than the five `NETWORK_GIT_VERBS`
|
|
81
79
|
* above, or ones where only a SPECIFIC sub-action/flag combination reaches
|
|
82
80
|
* the network (an innocuous sibling form of the same subcommand must NOT be
|
|
83
81
|
* swept in): `git remote show|prune|update <remote>` (each contacts the
|
|
@@ -98,9 +96,9 @@ export const NETWORK_GIT_VERBS: ReadonlySet<string> = new Set(['fetch', 'pull',
|
|
|
98
96
|
* every global flag, `-c` included, before either call site below ever
|
|
99
97
|
* inspects the subcommand word.
|
|
100
98
|
*
|
|
101
|
-
* Used by BOTH sides `adl.
|
|
99
|
+
* Used by BOTH sides `adl.run-required-for-writes`'s own header names
|
|
102
100
|
* ("deny with no identity / rewrite with one"): `identityBearingReason`
|
|
103
|
-
* (`impl/adl-
|
|
101
|
+
* (`impl/adl-run-required.ts`) for the deny side, and the REWRITE
|
|
104
102
|
* scanner's own `NETWORK_GIT_VERBS` gate below for the rewrite side — one
|
|
105
103
|
* shared predicate, not two independently-maintained shape lists.
|
|
106
104
|
*/
|
|
@@ -130,7 +128,7 @@ export function isNetworkGitInvocation(subcommand: string, restValues: readonly
|
|
|
130
128
|
if (subcommand === 'submodule') {
|
|
131
129
|
const action = firstNonOptionValue(restValues)?.toLowerCase()
|
|
132
130
|
if (action === undefined || !SUBMODULE_RECURSIVE_ACTIONS.has(action)) return false
|
|
133
|
-
//
|
|
131
|
+
// `--init` clones every submodule
|
|
134
132
|
// not yet checked out — network, same as `--recursive` recursing into
|
|
135
133
|
// nested ones.
|
|
136
134
|
return restValues.some((value) => value === '--recursive' || value === '--init')
|
|
@@ -149,9 +147,8 @@ const SHELL_NAMES: ReadonlySet<string> = new Set(['sh', 'bash', 'zsh', 'dash', '
|
|
|
149
147
|
const MAX_NESTED_SCRIPT_DEPTH = 16
|
|
150
148
|
|
|
151
149
|
/**
|
|
152
|
-
* `identity-mismatch` covers BOTH shapes the standard treats the
|
|
153
|
-
* (
|
|
154
|
-
* shell command"): an inline `ADL_AGENT_ID_AGENT=<value>` that is empty
|
|
150
|
+
* `identity-mismatch` covers BOTH shapes the identity standard treats the
|
|
151
|
+
* same way (one decision per identity-bearing shell command): an inline `ADL_AGENT_ID_AGENT=<value>` that is empty
|
|
155
152
|
* (would launder the command back onto git-ado's human pass-through) or
|
|
156
153
|
* names an agent outside `VALID_AGENTS`. A VALID inline value — even one
|
|
157
154
|
* that differs from the resolved fallback — is no longer a conflict at all:
|
|
@@ -159,14 +156,14 @@ const MAX_NESTED_SCRIPT_DEPTH = 16
|
|
|
159
156
|
* See `applyIdentityOutcome` below.
|
|
160
157
|
*/
|
|
161
158
|
/**
|
|
162
|
-
* `network-alias-redefinition
|
|
159
|
+
* `network-alias-redefinition`:
|
|
163
160
|
* a self-referential `git -c alias.<name>=<value>`/`--config-env[=]
|
|
164
161
|
* alias.<name>=<value>` where `<name>` is the literal subcommand this
|
|
165
162
|
* invocation runs and `<value>`'s own verb is network/credential-bearing —
|
|
166
163
|
* see `networkAliasRedefinition`'s own doc.
|
|
167
164
|
*/
|
|
168
165
|
/**
|
|
169
|
-
* `dynamic-agent
|
|
166
|
+
* `dynamic-agent`: `adl id
|
|
170
167
|
* token <agent>`/`adl-agent-id exec --agent <agent>` whose agent argument
|
|
171
168
|
* is itself dynamic ($-expansion, backtick, or a glob character) — denied
|
|
172
169
|
* outright rather than silently treated as "not identity-bearing", since a
|
|
@@ -187,8 +184,9 @@ export type GitIdentityScan =
|
|
|
187
184
|
* An identity-bearing simple command was found, it carries no (valid)
|
|
188
185
|
* inline override, and no fallback identity was resolved (the `fallback`
|
|
189
186
|
* argument was `null`). Nothing was rewritten or denied here — this is a
|
|
190
|
-
* signal for the CALLER
|
|
191
|
-
*
|
|
187
|
+
* signal for the CALLER to deny with the standard's own message (the
|
|
188
|
+
* engine's rewrite stage does, and `adl-run-required.ts` already has,
|
|
189
|
+
* earlier in the rule pass); this scanner's job is only to rewrite/detect
|
|
192
190
|
* conflicts once an identity — inline or fallback — actually exists.
|
|
193
191
|
*/
|
|
194
192
|
| { readonly kind: 'needs-identity' }
|
|
@@ -471,7 +469,7 @@ function skipWrapperFlagArgs(words: readonly Word[], start: number, withValue: r
|
|
|
471
469
|
return index
|
|
472
470
|
}
|
|
473
471
|
|
|
474
|
-
/** One wrapper's flag scan: the index past its own flags, and whether it strips the environment
|
|
472
|
+
/** One wrapper's flag scan: the index past its own flags, and whether it strips the environment. */
|
|
475
473
|
interface WrapperScan {
|
|
476
474
|
readonly index: number
|
|
477
475
|
readonly strips: boolean
|
|
@@ -480,7 +478,7 @@ interface WrapperScan {
|
|
|
480
478
|
/**
|
|
481
479
|
* Port of prefixes.ts's skipEnvFlags, on words; collects the env command's
|
|
482
480
|
* `NAME=value` arguments for identity-conflict checks, and reports whether
|
|
483
|
-
* `-u`/`--unset[=NAME]` or `-i`/`--ignore-environment` were used
|
|
481
|
+
* `-u`/`--unset[=NAME]` or `-i`/`--ignore-environment` were used.
|
|
484
482
|
*
|
|
485
483
|
* `-u`/`--unset` denies regardless of WHICH name it names — not only
|
|
486
484
|
* `ADL_AGENT_ID_AGENT` itself — the same blanket treatment `sudo`/`doas` get
|
|
@@ -529,7 +527,7 @@ function skipEnvArgs(words: readonly Word[], start: number, assignments: string[
|
|
|
529
527
|
/**
|
|
530
528
|
* `exec`'s `-c`/`-l` flags run the wrapped command with an empty environment
|
|
531
529
|
* (`-c`) or as a login shell that can re-source profiles which reset it
|
|
532
|
-
* (`-l`) —
|
|
530
|
+
* (`-l`) — both are treated as environment-stripping, like sudo/doas. `-a
|
|
533
531
|
* name` (argv0 only) never strips and is skipped transparently. Bash's own
|
|
534
532
|
* `exec` builtin accepts these bundled (`-cl`, `-la name`, …); any bundle
|
|
535
533
|
* containing `c` or `l` is treated as stripping, fail-closed, rather than
|
|
@@ -579,8 +577,7 @@ function skipTimeoutArgs(words: readonly Word[], start: number): number {
|
|
|
579
577
|
* Wrapper commands whose environment passes through to the wrapped command —
|
|
580
578
|
* port of prefixes.ts's COMMAND_PREFIXES/PREFIX_HANDLERS. Each value skips the
|
|
581
579
|
* wrapper's own flags/operands and lands on the wrapped command; none of
|
|
582
|
-
* these ever strip the environment. `env` and `exec` are NOT here —
|
|
583
|
-
* treats their environment-stripping flags (`env -u`/`--unset`/`-i`, `exec
|
|
580
|
+
* these ever strip the environment. `env` and `exec` are NOT here — their environment-stripping flags (`env -u`/`--unset`/`-i`, `exec
|
|
584
581
|
* -c`/`-l`) like sudo/doas, so `analyzePiece` special-cases them the same
|
|
585
582
|
* way it special-cases sudo/doas, rather than folding a `strips` result into
|
|
586
583
|
* every entry in this map for the sake of two wrappers that need it.
|
|
@@ -637,7 +634,7 @@ const SUBMODULE_NETWORK_VERBS: ReadonlySet<string> = new Set(['update', 'sync',
|
|
|
637
634
|
* `!git push …` reads as verb `push`, not `git`. A fully arbitrary shell
|
|
638
635
|
* one-liner alias (`!curl … | sh`) is not further inspected here — that is
|
|
639
636
|
* `shell.remote-script-exec`'s/`parse.uncertain`'s concern, not this one's;
|
|
640
|
-
* this only recognizes the exact network/credential VERB shapes
|
|
637
|
+
* this only recognizes the exact network/credential VERB shapes `network-alias-redefinition` names.
|
|
641
638
|
*/
|
|
642
639
|
export function networkAliasVerb(aliasValue: string): boolean {
|
|
643
640
|
const stripped = aliasValue.startsWith('!') ? aliasValue.slice(1).trim() : aliasValue
|
|
@@ -657,7 +654,7 @@ export function networkAliasVerb(aliasValue: string): boolean {
|
|
|
657
654
|
* True when `globalWords` (a git invocation's `-c`/`--config-env` globals,
|
|
658
655
|
* BEFORE alias resolution) define `alias.<subcommand>` — SELF-referential:
|
|
659
656
|
* the literal word this invocation actually runs — to a value whose own
|
|
660
|
-
* verb is network/credential-bearing (`networkAliasVerb`). See
|
|
657
|
+
* verb is network/credential-bearing (`networkAliasVerb`). See the comment
|
|
661
658
|
* at this function's one call site for why this is narrower than a blanket
|
|
662
659
|
* `-c alias.*` deny.
|
|
663
660
|
*/
|
|
@@ -687,8 +684,7 @@ function networkAliasRedefinition(globalWords: readonly Word[], subcommand: stri
|
|
|
687
684
|
}
|
|
688
685
|
|
|
689
686
|
/**
|
|
690
|
-
*
|
|
691
|
-
* ENV-VAR-based sibling of `networkAliasRedefinition` — `GIT_CONFIG_COUNT`/
|
|
687
|
+
* The ENV-VAR-based sibling of `networkAliasRedefinition` — `GIT_CONFIG_COUNT`/
|
|
692
688
|
* `GIT_CONFIG_KEY_<n>`/`GIT_CONFIG_VALUE_<n>` are git's OWN alternative to
|
|
693
689
|
* `-c`/`--config-env` for supplying ad-hoc config, read the same way
|
|
694
690
|
* `../shell/invocation.ts`'s `environmentGitAlias` already reads them for
|
|
@@ -748,7 +744,6 @@ function skipGitConfigScopeFlags(words: readonly Word[], start: number): number
|
|
|
748
744
|
}
|
|
749
745
|
|
|
750
746
|
/**
|
|
751
|
-
* R4 (STATUS.md 12p, re-review 2026-09-28 night):
|
|
752
747
|
* `git config [--global|--local|…] alias.<verb> <value>` WRITES a
|
|
753
748
|
* persistent alias a LATER, separate command can invoke — pre-loading the
|
|
754
749
|
* exact bypass `networkAliasRedefinition`/`environmentAliasRedefinition`
|
|
@@ -833,9 +828,8 @@ interface ScanState {
|
|
|
833
828
|
/**
|
|
834
829
|
* Every network git invocation found (`fetch`/`pull`/`clone`/`ls-remote`/
|
|
835
830
|
* `push`), paired with the effective identity for THAT SPECIFIC piece —
|
|
836
|
-
* see `GitInvocationPiece` and `scanGitInvocationPieces`.
|
|
837
|
-
* (
|
|
838
|
-
* (`adl-git-push-policy.ts`) needs the identity a PARTICULAR push on a
|
|
831
|
+
* see `GitInvocationPiece` and `scanGitInvocationPieces`. A role-grading
|
|
832
|
+
* rule (`adl-git-push-policy.ts`) needs the identity a PARTICULAR push on a
|
|
839
833
|
* compound command line actually carries, not the whole command's coarse
|
|
840
834
|
* `inlineIdentity` (which is set from whichever piece happens to be first
|
|
841
835
|
* — a reviewer session could otherwise smuggle a denied push past the
|
|
@@ -845,13 +839,12 @@ interface ScanState {
|
|
|
845
839
|
gitInvocations: GitInvocationPiece[]
|
|
846
840
|
/**
|
|
847
841
|
* Every `adl mcp cli <command> …` invocation found, paired with the
|
|
848
|
-
* effective identity for THAT SPECIFIC piece
|
|
849
|
-
* (
|
|
850
|
-
*
|
|
851
|
-
* `
|
|
852
|
-
*
|
|
853
|
-
*
|
|
854
|
-
* `scanAdlMcpCliPieces`.
|
|
842
|
+
* effective identity for THAT SPECIFIC piece: the role rules that gate
|
|
843
|
+
* these commands (`adl-workitem-role.ts`, `adl-pr-role.ts`,
|
|
844
|
+
* `adl-pr-review-role.ts`) must grade a valid inline override on the SAME
|
|
845
|
+
* piece, not `resolveFromEnvOrFile` alone — the same per-piece rule as
|
|
846
|
+
* `gitInvocations`, for `adl mcp cli` instead of `git push`. See
|
|
847
|
+
* `AdlMcpCliPiece` and `scanAdlMcpCliPieces`.
|
|
855
848
|
*/
|
|
856
849
|
mcpCliInvocations: AdlMcpCliPiece[]
|
|
857
850
|
}
|
|
@@ -875,8 +868,7 @@ export interface GitInvocationPiece {
|
|
|
875
868
|
|
|
876
869
|
/**
|
|
877
870
|
* One `adl mcp cli <command> …` invocation found while scanning a command,
|
|
878
|
-
* paired with the effective identity for THAT specific piece
|
|
879
|
-
* (STATUS.md 12p). `command` is the gated command name
|
|
871
|
+
* paired with the effective identity for THAT specific piece. `command` is the gated command name
|
|
880
872
|
* (e.g. `workitem-create-or-update`), lower-cased; `rest` is the dequoted
|
|
881
873
|
* values after it, the same shape `impl/adl-mcp-cli.ts`'s `adlMcpCliCall`
|
|
882
874
|
* reads off `Invocation.args.slice(3)`, so a role rule can correlate a
|
|
@@ -896,7 +888,7 @@ export interface AdlMcpCliPiece {
|
|
|
896
888
|
* the effective identity for that specific simple command: a valid inline
|
|
897
889
|
* `ADL_AGENT_ID_AGENT=` override on the SAME piece, else the resolved
|
|
898
890
|
* fallback (steps 2-3 of the standard), else null (no identity at all —
|
|
899
|
-
* `adl.
|
|
891
|
+
* `adl.run-required-for-writes`'s problem, not this one's).
|
|
900
892
|
* `requestedAgent` is the raw text the command names, unvalidated — the
|
|
901
893
|
* caller (`impl/adl-token-minting-role.ts`) is the one that compares it
|
|
902
894
|
* against `effectiveAgent`.
|
|
@@ -933,7 +925,7 @@ function execAgentFlagValue(restValues: readonly string[]): string | undefined {
|
|
|
933
925
|
* The WORD (not the dequoted string `execAgentFlagValue` reads) carrying
|
|
934
926
|
* `adl-agent-id exec`'s `--agent` value — `--agent=<value>` is itself the
|
|
935
927
|
* carrying word; `--agent <value>` is the word AFTER the flag. Used only to
|
|
936
|
-
* check DYNAMISM
|
|
928
|
+
* check DYNAMISM: a
|
|
937
929
|
* `--agent "$AGENT"` argument could name ANY agent at runtime, evading
|
|
938
930
|
* `adl.token-minting-role`'s static "own identity only" check entirely if
|
|
939
931
|
* it were silently treated as "not identity-bearing" the way any other
|
|
@@ -950,8 +942,7 @@ function execAgentFlagWord(rest: readonly Word[]): Word | undefined {
|
|
|
950
942
|
|
|
951
943
|
/**
|
|
952
944
|
* Shared identity decision for ONE matched identity-bearing simple command
|
|
953
|
-
* (
|
|
954
|
-
* shell command"):
|
|
945
|
+
* (the identity standard's one decision per identity-bearing shell command):
|
|
955
946
|
*
|
|
956
947
|
* - an inline `ADL_AGENT_ID_AGENT=<value>` among `assignments` that is
|
|
957
948
|
* empty or not one of `VALID_AGENTS` is a deny (`identity-mismatch`) —
|
|
@@ -962,7 +953,7 @@ function execAgentFlagWord(rest: readonly Word[]): Word | undefined {
|
|
|
962
953
|
* - no inline value at all: a `sudo`/`doas` wrapper is `unrewritable-wrapper`
|
|
963
954
|
* (the environment a prefix relies on is stripped); otherwise, with
|
|
964
955
|
* `state.fallback === null`, this piece `needsIdentity` (the caller —
|
|
965
|
-
* `adl-
|
|
956
|
+
* `engine.ts`, and `adl-run-required.ts` earlier — is what denies this); otherwise the
|
|
966
957
|
* fallback is inserted at `insertAt` (skipped in `conflictsOnly` mode).
|
|
967
958
|
*/
|
|
968
959
|
function applyIdentityOutcome(assignments: readonly string[], unrewritableWrapper: boolean, insertAt: number, state: ScanState): void {
|
|
@@ -1041,7 +1032,7 @@ function analyzePiece(command: string, words: readonly Word[], state: ScanState,
|
|
|
1041
1032
|
}
|
|
1042
1033
|
continue
|
|
1043
1034
|
}
|
|
1044
|
-
//
|
|
1035
|
+
// env -u/--unset[=NAME]/-i and exec -c/-l can strip the environment
|
|
1045
1036
|
// a prefix would rely on, the same way sudo/doas do — see skipEnvArgs's
|
|
1046
1037
|
// and skipExecArgs's own docs for why this is blanket (any use of the
|
|
1047
1038
|
// flag), not scoped to "only when it names ADL_AGENT_ID_AGENT".
|
|
@@ -1086,15 +1077,14 @@ function analyzePiece(command: string, words: readonly Word[], state: ScanState,
|
|
|
1086
1077
|
const subcommandWord = words[globals.index]
|
|
1087
1078
|
if (subcommandWord === undefined || subcommandWord.operator) return
|
|
1088
1079
|
if (dynamicValue(subcommandWord.value)) return
|
|
1089
|
-
//
|
|
1090
|
-
// SELF-REFERENTIAL `-c alias.<name>=<value>` (or `--config-env[=]
|
|
1080
|
+
// A SELF-REFERENTIAL `-c alias.<name>=<value>` (or `--config-env[=]
|
|
1091
1081
|
// alias.<name>=<value>`) where `<name>` is the LITERAL subcommand word
|
|
1092
1082
|
// this invocation runs, and `<value>`'s own verb is a network/credential
|
|
1093
1083
|
// one — checked BEFORE the NETWORK_GIT_VERBS gate below, since the
|
|
1094
1084
|
// literal word (e.g. `status`) need not itself be a network verb at all.
|
|
1095
|
-
// `/usr/local/bin/git` (bin/git
|
|
1096
|
-
// does not resolve git aliases itself, so an
|
|
1097
|
-
// reaches
|
|
1085
|
+
// `/usr/local/bin/git` (the `bin/git` front controller) routes by the
|
|
1086
|
+
// literal argv verb; it does not resolve git aliases itself, so an
|
|
1087
|
+
// aliased network verb never reaches git-ado's identity routing. A NON-self-referential alias (`git -c
|
|
1098
1088
|
// alias.wt=worktree wt …`) is untouched — see `networkAliasRedefinition`'s
|
|
1099
1089
|
// own doc for why this is deliberately narrower than a blanket
|
|
1100
1090
|
// `-c alias.*` deny.
|
|
@@ -1104,7 +1094,7 @@ function analyzePiece(command: string, words: readonly Word[], state: ScanState,
|
|
|
1104
1094
|
state.deny = 'network-alias-redefinition'
|
|
1105
1095
|
return
|
|
1106
1096
|
}
|
|
1107
|
-
//
|
|
1097
|
+
// The ENV-VAR-based sibling of the check above (`GIT_CONFIG_COUNT`/
|
|
1108
1098
|
// `GIT_CONFIG_KEY_n`/`GIT_CONFIG_VALUE_n`, already collected into
|
|
1109
1099
|
// `assignments` by the leading-assignment loop above this function's
|
|
1110
1100
|
// wrapper-skip loop) — see `environmentAliasRedefinition`'s own doc.
|
|
@@ -1112,7 +1102,7 @@ function analyzePiece(command: string, words: readonly Word[], state: ScanState,
|
|
|
1112
1102
|
state.deny = 'network-alias-redefinition'
|
|
1113
1103
|
return
|
|
1114
1104
|
}
|
|
1115
|
-
//
|
|
1105
|
+
// `git config [--global|…] alias.<verb> <value>` WRITES a
|
|
1116
1106
|
// persistent alias for a LATER command to exploit — see
|
|
1117
1107
|
// `gitConfigWritesNetworkAlias`'s own doc. Checked before the
|
|
1118
1108
|
// NETWORK_GIT_VERBS gate below since `config` itself is never a network
|
|
@@ -1122,12 +1112,11 @@ function analyzePiece(command: string, words: readonly Word[], state: ScanState,
|
|
|
1122
1112
|
return
|
|
1123
1113
|
}
|
|
1124
1114
|
const rest = words.slice(globals.index + 1).map((word) => word.value)
|
|
1125
|
-
//
|
|
1126
|
-
// `NETWORK_GIT_VERBS.has(literalSubcommand)` gate — see
|
|
1115
|
+
// Wider than a plain `NETWORK_GIT_VERBS.has(literalSubcommand)` gate — see
|
|
1127
1116
|
// `isNetworkGitInvocation`'s own doc for the additional shapes.
|
|
1128
1117
|
if (!isNetworkGitInvocation(literalSubcommand, rest)) return
|
|
1129
1118
|
if (valuesHelpOnly(rest)) return
|
|
1130
|
-
//
|
|
1119
|
+
// Record this SPECIFIC piece's own effective identity — see
|
|
1131
1120
|
// `GitInvocationPiece`'s doc — before the destination exemption below,
|
|
1132
1121
|
// so a role-grading rule can correlate to it by subcommand+rest
|
|
1133
1122
|
// regardless of whether THIS scanner itself treats the piece as
|
|
@@ -1137,18 +1126,16 @@ function analyzePiece(command: string, words: readonly Word[], state: ScanState,
|
|
|
1137
1126
|
rest,
|
|
1138
1127
|
effectiveAgent: validInlineIdentity(assignments) ?? state.fallback,
|
|
1139
1128
|
})
|
|
1140
|
-
//
|
|
1141
|
-
//
|
|
1142
|
-
// `
|
|
1143
|
-
//
|
|
1144
|
-
//
|
|
1145
|
-
//
|
|
1146
|
-
//
|
|
1147
|
-
//
|
|
1148
|
-
//
|
|
1149
|
-
//
|
|
1150
|
-
// when `needs-identity` was never denied on its own, but is not harmless
|
|
1151
|
-
// now that it is.
|
|
1129
|
+
// An EXPLICIT non-Azure-DevOps destination is provably safe without an
|
|
1130
|
+
// identity — same exemption `git-helpers.ts`'s
|
|
1131
|
+
// `classifyGitPushDestination` gives `adl.run-required-for-writes`. No
|
|
1132
|
+
// explicit URL (a bare `git push`, or one naming a remote this scanner
|
|
1133
|
+
// cannot look up) stays UNRESOLVED and is treated as identity-bearing,
|
|
1134
|
+
// same fail-closed rule. Needed so `../engine.ts`'s own deny on
|
|
1135
|
+
// `needs-identity` does not deny a legitimate
|
|
1136
|
+
// `git fetch https://github.com/...` that has no identity at all: a
|
|
1137
|
+
// scanner that flagged every network git verb regardless of destination
|
|
1138
|
+
// would make that engine deny wrongly block it.
|
|
1152
1139
|
const explicitUrl = firstHttpUrl(rest)
|
|
1153
1140
|
if (explicitUrl !== null && !isAdoUrl(explicitUrl)) return
|
|
1154
1141
|
applyIdentityOutcome(assignments, unrewritableWrapper, insertAt, state)
|
|
@@ -1160,14 +1147,13 @@ function analyzePiece(command: string, words: readonly Word[], state: ScanState,
|
|
|
1160
1147
|
const restValues = rest.map((word) => word.value)
|
|
1161
1148
|
// The shape check itself does not care about dynamism (a dynamic
|
|
1162
1149
|
// position's raw text is never literally "id"/"token"/… anyway), so it
|
|
1163
|
-
// can run before the dynamic checks below — that lets the
|
|
1164
|
-
// after it single out the SPECIFIC agent-argument position rather than
|
|
1150
|
+
// can run before the dynamic checks below — that lets the dynamic-agent check
|
|
1151
|
+
// just after it single out the SPECIFIC agent-argument position rather than
|
|
1165
1152
|
// bailing on ANY dynamic content anywhere on the line.
|
|
1166
1153
|
if (!matchesIdentityShape(restValues, ADL_IDENTITY_COMMAND_SHAPES)) return
|
|
1167
1154
|
const isIdToken = restValues[0]?.toLowerCase() === 'id' && restValues[1]?.toLowerCase() === 'token'
|
|
1168
1155
|
const isMcpCli = restValues[0]?.toLowerCase() === 'mcp' && restValues[1]?.toLowerCase() === 'cli'
|
|
1169
|
-
//
|
|
1170
|
-
// a DYNAMIC agent argument is denied outright — a dynamically computed
|
|
1156
|
+
// `adl id token <agent>` with a DYNAMIC agent argument is denied outright — a dynamically computed
|
|
1171
1157
|
// agent name could name ANY agent at runtime, evading
|
|
1172
1158
|
// adl.token-minting-role's static "own identity only" check entirely if
|
|
1173
1159
|
// this were silently treated as "not identity-bearing" instead.
|
|
@@ -1194,7 +1180,7 @@ function analyzePiece(command: string, words: readonly Word[], state: ScanState,
|
|
|
1194
1180
|
})
|
|
1195
1181
|
}
|
|
1196
1182
|
}
|
|
1197
|
-
//
|
|
1183
|
+
// Record this SPECIFIC `adl mcp cli <command>` piece's own effective
|
|
1198
1184
|
// identity — see `AdlMcpCliPiece`'s doc — so the role rules that gate
|
|
1199
1185
|
// these commands can grade the piece actually being invoked, not the
|
|
1200
1186
|
// whole command's coarse `inlineIdentity`.
|
|
@@ -1215,12 +1201,12 @@ function analyzePiece(command: string, words: readonly Word[], state: ScanState,
|
|
|
1215
1201
|
if (ADL_AGENT_ID_BINARY_NAMES.has(commandName)) {
|
|
1216
1202
|
const rest = words.slice(index + 1)
|
|
1217
1203
|
const restValues = rest.map((word) => word.value)
|
|
1218
|
-
//
|
|
1204
|
+
// Leading dash-prefixed global flags (e.g. `adl-agent-id --verbose
|
|
1219
1205
|
// exec --agent …`) are skipped before matching the `['exec']` shape —
|
|
1220
1206
|
// see skipLeadingDashFlags's own doc for why this must not require
|
|
1221
1207
|
// `exec` sitting at position 0 exactly.
|
|
1222
1208
|
if (!matchesIdentityShape(skipLeadingDashFlags(restValues), ADL_AGENT_ID_COMMAND_SHAPES)) return
|
|
1223
|
-
//
|
|
1209
|
+
// A DYNAMIC --agent value is denied outright — same reasoning as
|
|
1224
1210
|
// the `adl id token` case above, applied to this shape's own
|
|
1225
1211
|
// agent-bearing flag instead of a positional argument.
|
|
1226
1212
|
const agentWord = execAgentFlagWord(rest)
|
|
@@ -1290,23 +1276,24 @@ function scan(command: string, fallback: string | null, conflictsOnly: boolean):
|
|
|
1290
1276
|
* identity from steps 2-3 of the standard (`adl-identity.ts`'s
|
|
1291
1277
|
* `resolveFromEnvOrFile`), or `null` when nothing resolved — a piece that
|
|
1292
1278
|
* needs an identity and has none at all yields `needs-identity` rather than
|
|
1293
|
-
* a deny; the caller (`
|
|
1279
|
+
* a deny; the caller (`engine.ts`'s rewrite stage, and
|
|
1280
|
+
* `adl-run-required.ts` earlier in the rule pass) is the one that denies that
|
|
1294
1281
|
* case, with the standard's own message. Idempotent; never emits a token or
|
|
1295
1282
|
* an identity-bearing prefix the command did not already agree to.
|
|
1296
1283
|
*
|
|
1297
|
-
* Narrow by design (Tarun, 2026-09-29
|
|
1298
|
-
* whole-command `export
|
|
1299
|
-
*
|
|
1284
|
+
* Narrow by design (Tarun, 2026-09-29: the rewrite covers only Azure DevOps
|
|
1285
|
+
* commands, not a whole-command `export ADL_AGENT_ID_AGENT=<id>; ` prefix on
|
|
1286
|
+
* every shell command): this only rewrites the identity-bearing shapes the piece
|
|
1300
1287
|
* scanner (`scanPieces`/`analyzePiece`, above) actually recognizes — a
|
|
1301
1288
|
* TOP-LEVEL simple command (or one nested inside a recognized `bash -c`/
|
|
1302
1289
|
* `sh -c` script). It deliberately does NOT walk into `if`/`!`/`for..do`/
|
|
1303
1290
|
* `xargs`/a heredoc or here-string/an interpreter one-liner to find a
|
|
1304
|
-
* buried git/adl/curl invocation — `bin/git-ado` itself
|
|
1305
|
-
* (refuses) whenever `ADL_AGENT_ID_AGENT` is unset unless the caller is
|
|
1306
|
-
*
|
|
1307
|
-
* loudly by git-ado, never silently laundered onto
|
|
1308
|
-
* path — the risk a broader rewrite here would have
|
|
1309
|
-
*
|
|
1291
|
+
* buried git/adl/curl invocation — `bin/git-ado` itself fails closed
|
|
1292
|
+
* (refuses) whenever `ADL_AGENT_ID_AGENT` is unset unless the caller is a
|
|
1293
|
+
* marked human terminal (a real TTY AND `ADL_HUMAN_AZDO=1`), so a shape this
|
|
1294
|
+
* scanner misses is refused loudly by git-ado, never silently laundered onto
|
|
1295
|
+
* the human credential path — the risk a broader rewrite here would have
|
|
1296
|
+
* hedged against does not exist.
|
|
1310
1297
|
*/
|
|
1311
1298
|
export function rewriteGitNetworkCommands(command: string, fallback: string | null): GitIdentityScan {
|
|
1312
1299
|
if (fallback !== null && !SAFE_IDENTITY.test(fallback)) return { kind: 'deny', reason: 'unsafe-identity' }
|
|
@@ -1329,7 +1316,7 @@ export function rewriteGitNetworkCommands(command: string, fallback: string | nu
|
|
|
1329
1316
|
* longer a conflict) or needs no identity at all — the rule stays silent so
|
|
1330
1317
|
* the rewrite stage (or plain allow) proceeds. `fallback` only affects
|
|
1331
1318
|
* whether a missing-inline piece is treated as "needs identity" internally;
|
|
1332
|
-
* this view never reports that as a conflict (`adl-
|
|
1319
|
+
* this view never reports that as a conflict (`adl-run-required.ts` owns
|
|
1333
1320
|
* that message), so it is safe to call with `fallback: null`.
|
|
1334
1321
|
*/
|
|
1335
1322
|
export function scanGitIdentityConflicts(command: string, fallback: string | null): GitIdentityDenyReason | null {
|
|
@@ -1338,7 +1325,7 @@ export function scanGitIdentityConflicts(command: string, fallback: string | nul
|
|
|
1338
1325
|
}
|
|
1339
1326
|
|
|
1340
1327
|
/**
|
|
1341
|
-
* Whole-command, coarse signal used by `adl-
|
|
1328
|
+
* Whole-command, coarse signal used by `adl-run-required.ts`: true when
|
|
1342
1329
|
* SOME identity-bearing simple command in `command` carries a syntactically
|
|
1343
1330
|
* valid inline `ADL_AGENT_ID_AGENT=` override. This is intentionally
|
|
1344
1331
|
* coarser than the per-piece precision `rewriteGitNetworkCommands` itself
|
|
@@ -1356,8 +1343,7 @@ export function commandHasValidInlineIdentity(command: string): boolean {
|
|
|
1356
1343
|
}
|
|
1357
1344
|
|
|
1358
1345
|
/**
|
|
1359
|
-
* The EFFECTIVE identity for `command
|
|
1360
|
-
* STATUS.md 12p): a valid inline
|
|
1346
|
+
* The EFFECTIVE identity for `command`: a valid inline
|
|
1361
1347
|
* `ADL_AGENT_ID_AGENT=` override anywhere on the command line (step 1 — same
|
|
1362
1348
|
* whole-command coarseness as `commandHasValidInlineIdentity`, which is the
|
|
1363
1349
|
* shape every real override takes: `ADL_AGENT_ID_AGENT=<agent> git push …`),
|
|
@@ -1380,7 +1366,7 @@ export function effectiveIdentityForCommand(command: string, fallback: string |
|
|
|
1380
1366
|
* Every token-minting invocation (`adl id token <agent>` /
|
|
1381
1367
|
* `adl-agent-id exec --agent <agent>`) found in `command`, each paired with
|
|
1382
1368
|
* the effective identity for that specific piece — see `TokenMintingPiece`.
|
|
1383
|
-
* Used by `impl/adl-token-minting-role.ts
|
|
1369
|
+
* Used by `impl/adl-token-minting-role.ts`.
|
|
1384
1370
|
*/
|
|
1385
1371
|
export function scanTokenMintingPieces(command: string, fallback: string | null): readonly TokenMintingPiece[] {
|
|
1386
1372
|
return scan(command, fallback, true).tokenMinting
|
|
@@ -1389,8 +1375,7 @@ export function scanTokenMintingPieces(command: string, fallback: string | null)
|
|
|
1389
1375
|
/**
|
|
1390
1376
|
* Every network git invocation (`fetch`/`pull`/`clone`/`ls-remote`/`push`)
|
|
1391
1377
|
* found in `command`, each paired with the effective identity for THAT
|
|
1392
|
-
* specific piece — see `GitInvocationPiece`.
|
|
1393
|
-
* 12p): used by `impl/adl-git-push-policy.ts` to grade a
|
|
1378
|
+
* specific piece — see `GitInvocationPiece`. Used by `impl/adl-git-push-policy.ts` to grade a
|
|
1394
1379
|
* SPECIFIC push by its own piece's identity, not the whole command's coarse
|
|
1395
1380
|
* `effectiveIdentityForCommand` (which a compound command with more than one
|
|
1396
1381
|
* identity-bearing piece could use to smuggle one piece's override onto
|
|
@@ -1403,12 +1388,12 @@ export function scanGitInvocationPieces(command: string, fallback: string | null
|
|
|
1403
1388
|
/**
|
|
1404
1389
|
* Every `adl mcp cli <command> …` invocation found in `command`, each
|
|
1405
1390
|
* paired with the effective identity for THAT specific piece — see
|
|
1406
|
-
* `AdlMcpCliPiece`.
|
|
1391
|
+
* `AdlMcpCliPiece`. Used by
|
|
1407
1392
|
* `impl/adl-workitem-role.ts`/`adl-pr-role.ts`/`adl-pr-review-role.ts` to
|
|
1408
1393
|
* grade a SPECIFIC `adl mcp cli` invocation by its own piece's inline
|
|
1409
|
-
* identity, else the fallback — the same
|
|
1410
|
-
* `scanGitInvocationPieces`
|
|
1411
|
-
*
|
|
1394
|
+
* identity, else the fallback — the same per-piece correlation
|
|
1395
|
+
* `scanGitInvocationPieces` gives `git push`, extended to this command
|
|
1396
|
+
* class.
|
|
1412
1397
|
*/
|
|
1413
1398
|
export function scanAdlMcpCliPieces(command: string, fallback: string | null): readonly AdlMcpCliPiece[] {
|
|
1414
1399
|
return scan(command, fallback, true).mcpCliInvocations
|
|
@@ -23,7 +23,7 @@ import { isRedirection, redirectionWrites, type Token, tokenValue } from './toke
|
|
|
23
23
|
* `.gitignore`, `.github`, `repo.git-backup` are not matched: the check is on
|
|
24
24
|
* a whole `.git` path segment.
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
function isGitInternalsPath(raw: string): boolean {
|
|
27
27
|
const value = raw.replace(/^--?[A-Za-z][\w-]*=/, '')
|
|
28
28
|
if (/\bGIT_DIR\b/.test(value)) return true
|
|
29
29
|
if (/--(?:absolute-)?git-dir\b|--git-common-dir\b|--git-path\b/.test(value)) return true
|