@amsterdamdatalabs/adl-agent-control-linux-x64 0.1.37 → 0.1.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/adl +2 -2
- package/bin/reconcile +10 -13
- package/bin/setup +15 -15
- package/package.json +1 -1
- package/packages/agent-hooks/package.json +1 -1
- package/packages/agent-hooks/src/main.ts +23 -2
- package/packages/agent-hooks/src/rules/impl/adl-mcp-cli.ts +12 -8
- package/packages/agent-hooks/src/rules/impl/adl-run-required.ts +11 -5
- package/packages/agent-hooks/src/rules/impl/adl-workitem-role.ts +18 -5
- package/packages/agent-hooks/src/rules/impl/agent-tamper-protection.ts +30 -26
- package/packages/agent-hooks/src/rules/impl/git-branch.ts +1 -1
- package/packages/agent-hooks/src/rules/impl/git-target.ts +5 -0
- package/packages/agent-hooks/src/rules/impl/mcp-tool.ts +3 -1
- package/packages/agent-hooks/src/rules/impl/tool-frontend.ts +230 -11
- package/packages/agent-hooks/src/rules/shell/git-identity.ts +1 -1
- package/packages/agent-hooks/src/rules/shell/invocation.ts +14 -2
- package/packages/agent-hooks/src/rules/shell/protected-carriers.ts +10 -11
- package/packages/agent-settings/assets/TARUN-GLOBAL-AGENTS-INSTRUCTIONS.md +2 -2
- package/packages/agent-settings/package.json +1 -1
- package/packages/agent-settings/src/deploy/agents-deploy.ts +19 -1
- package/packages/agent-settings/src/deploy/index.ts +1 -0
- package/packages/agent-skills/assets/agent-search-tool-audit/SKILL.md +4 -6
- package/packages/agent-skills/assets/finalize-feature/SKILL.md +3 -3
- package/packages/agent-skills/assets/implement-feature/SKILL.md +17 -20
- package/packages/agent-skills/assets/implement-feature/references/briefs.md +3 -3
- package/packages/agent-skills/assets/implement-item/SKILL.md +3 -3
- package/packages/agent-skills/assets/mechanics/SKILL.md +1 -1
- package/packages/agent-skills/assets/plan-feature/SKILL.md +10 -10
- package/packages/agent-skills/assets/prepare-promotion/SKILL.md +3 -4
- package/packages/agent-skills/assets/report-bug/SKILL.md +2 -2
- package/packages/agent-skills/assets/review-change/SKILL.md +3 -3
- package/packages/agent-skills/assets/review-plan/SKILL.md +4 -4
- package/packages/agent-skills/assets/triage-workitems/SKILL.md +4 -4
- package/packages/agent-skills/assets/validate-design/SKILL.md +6 -12
- package/packages/agent-skills/assets/verify-item/SKILL.md +5 -5
- package/packages/agent-skills/assets/wayfinder/SKILL.md +1 -1
- package/packages/agent-skills/assets/workitems-process/SKILL.md +19 -21
- package/packages/agent-skills/assets/workitems-process/references/ado-and-git.md +36 -3
- package/packages/agent-skills/assets/workitems-process/references/evidence.md +4 -4
- package/packages/agent-skills/assets/write-feature/SKILL.md +15 -18
- package/packages/agent-skills/dist/deploy.d.ts +45 -0
- package/packages/agent-skills/dist/deploy.d.ts.map +1 -1
- package/packages/agent-skills/dist/deploy.js +167 -3
- package/packages/agent-skills/dist/deploy.js.map +1 -1
- package/packages/agent-skills/dist/index.d.ts +1 -1
- package/packages/agent-skills/dist/index.d.ts.map +1 -1
- package/packages/agent-skills/dist/index.js +1 -1
- package/packages/agent-skills/dist/index.js.map +1 -1
- package/packages/agent-skills/package.json +1 -1
- package/packages/agent-skills/src/deploy.ts +241 -3
- package/packages/agent-skills/src/index.ts +10 -1
- package/packages/azdo/README.md +13 -4
- package/packages/azdo/bunfig.toml +6 -0
- package/packages/azdo/package.json +1 -1
- package/packages/azdo/src/azdo-attachments.ts +2 -1
- package/packages/azdo/src/azdo-pr.ts +182 -6
- package/packages/azdo/src/azdo-wit.ts +290 -41
- package/packages/azdo/src/cli.ts +79 -12
- package/packages/azdo/src/lib/client.ts +88 -16
- package/packages/azdo/src/mcp-server.ts +75 -10
- package/packages/azdo/src/tool-dispatch.ts +61 -26
- package/packages/fleet/src/install-adl-package.ts +4 -3
- package/packages/repo-controls/assets/promote.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-untyped/docs/research/no-type.md +1 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-untyped/docs/research/typed-experiment.md +1 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-untyped/docs/research/typed-research.md +1 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/extra-key.md +1 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/extra-keys.md +1 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/missing-created.md +1 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/missing-description.md +1 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/missing-last-update.md +1 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/missing-status.md +1 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/missing-title.md +1 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/optional-keys.md +1 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-research/docs/research/research-ok.md +1 -1
- package/packages/repo-controls/package.json +1 -1
- package/packages/repo-controls/src/config.ts +21 -2
- package/packages/repo-controls/src/doctor.ts +9 -14
- package/packages/repo-controls/src/findings-ratchet.ts +12 -0
- package/packages/repo-controls/src/hook.ts +61 -4
- package/bin/lean-ctx-observe-strip +0 -434
- package/bin/lib/lean-ctx-observe-hooks.sh +0 -634
- package/bin/update-azure-agent-pool +0 -29
- package/packages/agent-hooks/src/hooks/lean-ctx/handler.ts +0 -22
- package/packages/agent-hooks/src/hooks/lean-ctx/index.ts +0 -173
- package/packages/agent-hooks/src/hooks/lean-ctx/mapping.ts +0 -121
- package/packages/agent-hooks/src/hooks/lean-ctx/scope-rewrite.ts +0 -207
- package/packages/agent-hooks/src/lean-ctx/env.ts +0 -123
- package/packages/agent-hooks/src/lean-ctx/mcp.ts +0 -142
- package/packages/agent-hooks/src/rules/impl/adl-build-run-denied.ts +0 -51
- package/packages/agent-hooks/src/rules/impl/adl-session-required.ts +0 -403
- package/packages/agent-hooks/src/rules/impl/tool-lean-ctx-global.ts +0 -594
- package/packages/agent-settings/assets/GLOBAL-AGENTS.md +0 -112
- package/packages/agent-settings/assets/lean-ctx/config.toml +0 -42
- package/packages/agent-settings/assets/lean-ctx/gitignore +0 -10
- package/packages/agent-settings/assets/lean-ctx/layout.toml +0 -7
- package/packages/agent-settings/src/deploy/lean-ctx-deploy.ts +0 -230
- package/packages/agent-settings/src/deploy/lean-ctx-merge.ts +0 -580
- package/packages/agent-skills/assets/adl-mechanics/SKILL.md +0 -38
- package/packages/agent-skills/assets/codebase-design/SKILL.md +0 -98
- package/packages/agent-skills/assets/codebase-design/references/DEEPENING.md +0 -37
- package/packages/agent-skills/assets/codebase-design/references/DESIGN-IT-TWICE.md +0 -44
- package/packages/agent-skills/assets/codebase-design/references/TESTABILITY.md +0 -29
- package/packages/agent-skills/assets/debug-issue/SKILL.md +0 -41
- package/packages/agent-skills/assets/domain-modeling/SKILL.md +0 -86
- package/packages/agent-skills/assets/domain-modeling/references/ADR-FORMAT.md +0 -47
- package/packages/agent-skills/assets/domain-modeling/references/CONTEXT-FORMAT.md +0 -60
- package/packages/agent-skills/assets/implement/SKILL.md +0 -28
- package/packages/agent-skills/assets/review-changes/SKILL.md +0 -45
- package/packages/agent-skills/assets/tdd/SKILL.md +0 -49
- package/packages/agent-skills/assets/tdd/references/mocking.md +0 -59
- package/packages/agent-skills/assets/tdd/references/tests.md +0 -77
- package/packages/agent-skills/assets/testing/SKILL.md +0 -54
- package/packages/agent-skills/assets/testing/references/e2e.md +0 -37
- package/packages/agent-skills/assets/testing/references/integration.md +0 -37
- package/packages/agent-skills/assets/testing/references/unit.md +0 -32
- package/packages/agent-skills/assets/to-feature/SKILL.md +0 -91
- package/packages/agent-skills/assets/to-feature/references/FEATURE-SPEC-TEMPLATE.md +0 -88
- package/packages/agent-skills/assets/to-workitems/SKILL.md +0 -90
- package/packages/agent-skills/assets/to-workitems/references/AZURE-DEVOPS-HIERARCHY.md +0 -121
- package/packages/agent-skills/assets/to-workitems/references/TICKET-TEMPLATES.md +0 -70
- package/packages/azdo/src/workflow-rules-matrix.csv +0 -85
- package/packages/fleet/src/launch-agents.ts +0 -649
- package/packages/repo-controls/assets/GLOBAL-INVARIANTS.md +0 -21
- package/packages/repo-controls/assets/enable-integration-auto-complete.mjs +0 -79
- package/packages/repo-controls/assets/scaffold/docs/notes.md +0 -20
- package/packages/repo-controls/assets/scaffold/plans/GAPS-AND-FINDINGS.md +0 -12
- package/packages/repo-controls/azure-pipelines.yml +0 -274
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/notes.md +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/fixtures/excluded/frontend/mobile/src/i18n/locales/zh-CN/strings.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-ledger-clean/docs/notes.md +0 -17
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-ledger-no-lines/docs/notes.md +0 -13
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/architecture/product/stable-delivery.md +0 -10
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/architecture/product/stable-recommendation.md +0 -12
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/architecture/product/target-narration.md +0 -10
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-clean/frontend/packages/desktop/src/renderer/solo/item.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-empty-register/frontend/packages/desktop/src/a.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-empty-register/frontend/packages/desktop/src/b.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/fresh/fresh.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub1/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub10/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub11/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub2/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub3/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub4/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub5/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub6/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub7/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub8/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub9/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/services/i18n/locales/de/common.json +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/solo/item.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/vendored-crate/Cargo.toml +0 -2
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-missing-tree/frontend/packages/desktop/src/renderer/solo/item.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-no-ceilings/frontend/packages/desktop/src/a.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-no-ceilings/frontend/packages/desktop/src/b.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-no-ceilings/frontend/packages/desktop/src/c.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-stale-entry/frontend/packages/desktop/src/renderer/solo/item.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/fresh/fresh.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub1/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub10/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub11/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub2/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub3/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub4/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub5/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub6/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub7/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub8/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub9/only.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/solo/item.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unusable-register/frontend/packages/desktop/src/renderer/solo/item.ts +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/open_work_cap/fixtures/open-work-cap-clean/plans/GAPS-AND-FINDINGS.md +0 -5
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/open_work_cap/fixtures/open-work-cap-clean/plans/features/az601-clean/spec.md +0 -10
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/agent/crates/enact-providers/src/snapshots/README.md +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/backend/crates/enact-app/assets/builtin-assistants/avatars/assistant.jpg +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/backend/crates/enact-assets/assets/logos/tools/coding/tool.png +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/backend/crates/enact-session/src/backend/codex_init_prompt.md +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/mobile/assets/images/icon.png +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/packages/desktop/src/renderer/assets/logos/brand/app.png +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/packages/desktop/src/renderer/assets/themes/default-theme.png +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/public/pwa/icon-192.png +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/resources/product.png +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-stray/backend/crates/enact-session/src/backend/README.md +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/fixtures/plans-layout-clean/plans/features/az347-test-coverage/spec.md +0 -12
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/fixtures/plans-layout-violation/plans/features/az347-test-coverage/spec.md +0 -12
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/__init__.py +0 -11
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/check.py +0 -62
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/NotAMigration.sql +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/0001_long_prefix.sql +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/001_init.sql +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/002_add_index.sql +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/003-dashed-slug.sql +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/004_MixedCase.sql +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/005_trailing space.sql +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/01_short_prefix.sql +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/not-a-migration.sql +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/test_check.py +0 -116
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-broken/docs/architecture/product/links.md +0 -20
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-broken/docs/architecture/product/route-target.md +0 -8
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-clean/docs/architecture/product/links.md +0 -20
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-clean/docs/architecture/product/route-target.md +0 -8
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.changeset/declared.txt +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/INDEPENDENT-VERIFICATION.md +0 -3
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/attribute-without-conversion/.gitattributes +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/attribute-without-conversion/large file.bin +0 -3
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/clean/.gitattributes +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/clean/large file.bin +0 -3
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/clean/small.txt +0 -1
- 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 +0 -1
- 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/pipeline/__init__.py +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/__init__.py +0 -12
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/check.py +0 -129
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/fixtures/disjoint/gate-registry.yaml +0 -13
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/fixtures/empty/gate-registry.yaml +0 -7
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/fixtures/overlapping/gate-registry.yaml +0 -13
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/test_check.py +0 -109
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/__init__.py +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/__init__.py +0 -11
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/check.py +0 -149
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/fixtures/clean/docs/readme.md +0 -4
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/fixtures/relevant/VERSION +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/test_check.py +0 -151
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/__init__.py +0 -11
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/check.py +0 -202
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/aligned/.workflows/changesets/package.json +0 -5
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/aligned/.workflows/package.json +0 -5
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/aligned/CHANGELOG.md +0 -5
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/aligned/VERSION +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/mismatched/.workflows/changesets/package.json +0 -5
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/mismatched/.workflows/package.json +0 -5
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/mismatched/CHANGELOG.md +0 -5
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/mismatched/VERSION +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/test_check.py +0 -162
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/check.py +0 -103
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/backend/Cargo.lock +0 -7
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/backend/Cargo.toml +0 -4
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/backend/rust-toolchain.toml +0 -3
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/backend/src/main.rs +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/frontend/bun.lock +0 -1
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/backend/Cargo.lock +0 -7
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/backend/Cargo.toml +0 -4
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/backend/rust-toolchain.toml +0 -3
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/backend/src/main.rs +0 -1
- 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/policy/grants-registry.yaml +0 -112
- package/packages/repo-controls/workflows/scripts/release/verify-npm-artifact.ts +0 -119
package/bin/adl
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/bin/adl
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 83039712 bytes
|
|
4
|
+
sha256: e0a9055e0d4a79460ea808646054ccce2aeb7958e081287982bbae0a14fab2d1
|
package/bin/reconcile
CHANGED
|
@@ -69,8 +69,9 @@ source_mode="npm"
|
|
|
69
69
|
# can point it at a disposable test_root directory (RECONCILE_SOURCE_ONLY=1)
|
|
70
70
|
# and exercise the real sync/removal mechanics without root or a real
|
|
71
71
|
# /usr/local. The production value is the libexec dir the apps/cli
|
|
72
|
-
# commands (repo-controls,
|
|
73
|
-
#
|
|
72
|
+
# commands (repo-controls, hooks, settings) resolve the projected payload
|
|
73
|
+
# from. az697 dropped `skills` from the libexec consumers: every skill
|
|
74
|
+
# now comes from `adl skills deploy`, not from the fleet projection.
|
|
74
75
|
repo_dir_libexec_root="/usr/local/libexec/adl"
|
|
75
76
|
# Test-only escape hatch for default-agent-file.ts / managed-settings.ts's own
|
|
76
77
|
# `--root` (both already accept it; see their headers). Unset in every real
|
|
@@ -2118,8 +2119,13 @@ run_surface_update() {
|
|
|
2118
2119
|
surface_update_error_reason() {
|
|
2119
2120
|
local output="$1" plain line
|
|
2120
2121
|
# LC_ALL=C: the strip is bytewise. Under en_US.UTF-8 glibc resolves [@-~]
|
|
2121
|
-
# by collation, so the escape's final letter would never match.
|
|
2122
|
-
|
|
2122
|
+
# by collation, so the escape's final letter would never match. The
|
|
2123
|
+
# ANSI strip uses `tr` to delete ESC bytes first -- BSD sed on macOS has a
|
|
2124
|
+
# long-standing segfault (exit 139) when fed input that contains the ESC
|
|
2125
|
+
# byte directly in a $'\x1b...' pattern, so we remove the byte in a
|
|
2126
|
+
# bytewise pass and let sed handle the bracketed parameter sequences that
|
|
2127
|
+
# remain (which do not contain ESC).
|
|
2128
|
+
plain="$(LC_ALL=C tr -d '\033' <<<"$output" | LC_ALL=C sed -E 's/\[[0-9;]*[@-~]//g')"
|
|
2123
2129
|
local error_re='^[[:space:]]*(✖[[:space:]]*)?[eE][rR][rR][oO][rR]:' candidate
|
|
2124
2130
|
line=""
|
|
2125
2131
|
while IFS= read -r candidate; do
|
|
@@ -2844,9 +2850,6 @@ project_adl_package_payload() {
|
|
|
2844
2850
|
fi
|
|
2845
2851
|
done
|
|
2846
2852
|
if [[ "$mode" != apply ]]; then
|
|
2847
|
-
if [[ "$source_mode" == checkout ]]; then
|
|
2848
|
-
echo "would build agent-skills payload from checkout"
|
|
2849
|
-
fi
|
|
2850
2853
|
echo "would project Adl package payload from $repo_root to /usr/local/libexec/adl and /usr/local/bin/git{,-ado}"
|
|
2851
2854
|
if [[ "$source_mode" == npm ]]; then
|
|
2852
2855
|
echo "would link /usr/local/bin/adl to $repo_root/bin/adl"
|
|
@@ -2855,12 +2858,6 @@ project_adl_package_payload() {
|
|
|
2855
2858
|
fi
|
|
2856
2859
|
bun_bin="$(command -v bun || true)"
|
|
2857
2860
|
[[ -n "$bun_bin" ]] || { echo "ERROR Adl package projection requires bun on PATH" >&2; return 1; }
|
|
2858
|
-
if [[ "$source_mode" == checkout ]]; then
|
|
2859
|
-
(cd "$repo_root/packages/agent-skills" && "$bun_bin" run build) || {
|
|
2860
|
-
echo "ERROR could not build agent-skills payload from checkout" >&2
|
|
2861
|
-
return 1
|
|
2862
|
-
}
|
|
2863
|
-
fi
|
|
2864
2861
|
local system_root_args=()
|
|
2865
2862
|
if [[ -n "${RECONCILE_TEST_SYSTEM_ROOT:-}" ]]; then
|
|
2866
2863
|
system_root_args+=(--system-root "$RECONCILE_TEST_SYSTEM_ROOT")
|
package/bin/setup
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -euo pipefail
|
|
3
3
|
|
|
4
|
-
# `sudo adl setup
|
|
4
|
+
# `sudo adl fleet setup NAME` -- the whole onboarding of a host after
|
|
5
5
|
# `bun install -g @amsterdamdatalabs/adl-agent-control` (run as the device's
|
|
6
6
|
# administrator):
|
|
7
7
|
#
|
|
@@ -45,15 +45,15 @@ while [[ "$#" -gt 0 ]]; do
|
|
|
45
45
|
*) echo "ERROR unknown argument: $1" >&2; exit 2 ;;
|
|
46
46
|
esac
|
|
47
47
|
done
|
|
48
|
-
[[ -n "$host" ]] || { echo "ERROR usage: sudo adl setup
|
|
49
|
-
[[ "$(id -u)" -eq 0 ]] || { echo "ERROR adl setup must run as root: sudo adl setup
|
|
48
|
+
[[ -n "$host" ]] || { echo "ERROR usage: sudo adl fleet setup NAME" >&2; exit 2; }
|
|
49
|
+
[[ "$(id -u)" -eq 0 ]] || { echo "ERROR adl fleet setup must run as root: sudo adl fleet setup $host" >&2; exit 1; }
|
|
50
50
|
|
|
51
51
|
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
52
52
|
package_dir="$(cd -- "$script_dir/.." && pwd)"
|
|
53
53
|
package_dir_real="$(cd -P -- "$script_dir/.." && pwd -P)"
|
|
54
54
|
# shellcheck source=lib/fleet-host.sh
|
|
55
55
|
source "$script_dir/lib/fleet-host.sh"
|
|
56
|
-
fleet_host_resolve "adl setup" "$package_dir/packages/fleet/manifest.json" "$host" || exit $?
|
|
56
|
+
fleet_host_resolve "adl fleet setup" "$package_dir/packages/fleet/manifest.json" "$host" || exit $?
|
|
57
57
|
owner="$fleet_host_owner"
|
|
58
58
|
minute="$fleet_host_minute"
|
|
59
59
|
|
|
@@ -66,23 +66,23 @@ minute="$fleet_host_minute"
|
|
|
66
66
|
source "$script_dir/lib/adl-package.sh"
|
|
67
67
|
os_name="$(uname -s)"
|
|
68
68
|
owner_home="$(adl_owner_home "$owner")" || {
|
|
69
|
-
echo "ERROR adl setup: cannot resolve the home directory of $owner" >&2
|
|
69
|
+
echo "ERROR adl fleet setup: cannot resolve the home directory of $owner" >&2
|
|
70
70
|
exit 1
|
|
71
71
|
}
|
|
72
72
|
managed_dir="$(adl_platform_package_dir "$(adl_global_node_modules "$owner_home")" "$os_name" "$(uname -m)")" || exit 1
|
|
73
73
|
managed_real="$(cd -P -- "$managed_dir" 2>/dev/null && pwd -P)" || managed_real=""
|
|
74
74
|
if [[ -z "$managed_real" || "$package_dir_real" != "$managed_real" ]]; then
|
|
75
75
|
{
|
|
76
|
-
echo "ERROR adl setup: this package ($package_dir_real) is not the package the scheduled job manages ($managed_dir)."
|
|
77
|
-
echo "ERROR adl setup: install it where the job looks, as $owner, then run setup again:"
|
|
78
|
-
echo "ERROR adl setup: bun install -g @amsterdamdatalabs/adl-agent-control"
|
|
76
|
+
echo "ERROR adl fleet setup: this package ($package_dir_real) is not the package the scheduled job manages ($managed_dir)."
|
|
77
|
+
echo "ERROR adl fleet setup: install it where the job looks, as $owner, then run setup again:"
|
|
78
|
+
echo "ERROR adl fleet setup: bun install -g @amsterdamdatalabs/adl-agent-control"
|
|
79
79
|
} >&2
|
|
80
80
|
exit 1
|
|
81
81
|
fi
|
|
82
82
|
|
|
83
83
|
adl_bin="$package_dir_real/bin/adl"
|
|
84
|
-
[[ -x "$adl_bin" ]] || { echo "ERROR adl setup: the package adl is missing or not executable: $package_dir/bin/adl" >&2; exit 1; }
|
|
85
|
-
adl_check_adl_not_shadowed "$owner" "$os_name" "$owner_home" "$package_dir_real" "adl setup" || exit 1
|
|
84
|
+
[[ -x "$adl_bin" ]] || { echo "ERROR adl fleet setup: the package adl is missing or not executable: $package_dir/bin/adl" >&2; exit 1; }
|
|
85
|
+
adl_check_adl_not_shadowed "$owner" "$os_name" "$owner_home" "$package_dir_real" "adl fleet setup" || exit 1
|
|
86
86
|
|
|
87
87
|
if [[ -n "${ADL_SETUP_TEST_ROOT:-}" ]]; then
|
|
88
88
|
system_root="${ADL_SETUP_TEST_ROOT%/}"
|
|
@@ -121,11 +121,11 @@ fi
|
|
|
121
121
|
|
|
122
122
|
mkdir -p "$system_root/var/lib/adl" "$system_root/var/log/adl"
|
|
123
123
|
|
|
124
|
-
echo "adl setup: first reconcile for $host (owner $owner)"
|
|
124
|
+
echo "adl fleet setup: first reconcile for $host (owner $owner)"
|
|
125
125
|
reconcile_rc=0
|
|
126
126
|
"$adl_bin" reconcile --host "$host" || reconcile_rc=$?
|
|
127
127
|
if [[ "$reconcile_rc" -ne 0 ]]; then
|
|
128
|
-
echo "ERROR adl setup: first reconcile failed (exit $reconcile_rc); scheduler NOT armed. Fix the failure and re-run: sudo adl setup
|
|
128
|
+
echo "ERROR adl fleet setup: first reconcile failed (exit $reconcile_rc); scheduler NOT armed. Fix the failure and re-run: sudo adl fleet setup $host" >&2
|
|
129
129
|
exit "$reconcile_rc"
|
|
130
130
|
fi
|
|
131
131
|
|
|
@@ -166,7 +166,7 @@ case "$fleet_host_platform" in
|
|
|
166
166
|
sleep 0.5
|
|
167
167
|
done
|
|
168
168
|
[[ "$unloaded" -eq 1 ]] || {
|
|
169
|
-
echo "ERROR adl setup: com.adl.global-tools is still loaded after bootout (waited 5s); not bootstrapping. Run: sudo launchctl bootout system/com.adl.global-tools" >&2
|
|
169
|
+
echo "ERROR adl fleet setup: com.adl.global-tools is still loaded after bootout (waited 5s); not bootstrapping. Run: sudo launchctl bootout system/com.adl.global-tools" >&2
|
|
170
170
|
exit 1
|
|
171
171
|
}
|
|
172
172
|
fi
|
|
@@ -214,7 +214,7 @@ esac
|
|
|
214
214
|
# would keep running stale update logic if anyone invoked it.
|
|
215
215
|
if [[ -e "$legacy_adl_sync" ]]; then
|
|
216
216
|
rm -f -- "$legacy_adl_sync"
|
|
217
|
-
echo "adl setup: removed the legacy scheduler copy $legacy_adl_sync"
|
|
217
|
+
echo "adl fleet setup: removed the legacy scheduler copy $legacy_adl_sync"
|
|
218
218
|
fi
|
|
219
219
|
|
|
220
|
-
echo "adl setup: $host reconciled and armed (every 12 hours at minute $minute); run on demand with: sudo adl reconcile --host $host"
|
|
220
|
+
echo "adl fleet setup: $host reconciled and armed (every 12 hours at minute $minute); run on demand with: sudo adl reconcile --host $host"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amsterdamdatalabs/adl-agent-control-linux-x64",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.47",
|
|
4
4
|
"description": "adl CLI binary for linux/x64 (agent identity + Azure DevOps front door — see docs/architecture/cli-design.md)",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"os": [
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"start": "bun src/main.ts",
|
|
9
9
|
"build": "bun ../../workflows/scripts/build/agent-hooks/build.ts",
|
|
10
10
|
"typecheck": "tsc --noEmit",
|
|
11
|
-
"test": "bun test --coverage --timeout 30000",
|
|
11
|
+
"test": "bun test --isolate --coverage --timeout 30000",
|
|
12
12
|
"check": "bun run typecheck && bun test --coverage"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
* silent no-op (exit 0, empty stdout/stderr).
|
|
27
27
|
* - `adl-config.toml` present but fails to parse/decode: fail
|
|
28
28
|
* loud (non-zero exit, reason on stderr) — never silently ignored.
|
|
29
|
+
* `pre-tool-use` exits at FAIL_CLOSED_EXIT_CODE (2); every other
|
|
30
|
+
* kind exits at the non-blocking NON_BLOCKING_FAIL_EXIT_CODE (1),
|
|
31
|
+
* matching the host-resolution and invalid-JSON-on-stdin branches
|
|
32
|
+
* above and avoiding the Claude Code/Codex `UserPromptSubmit`
|
|
33
|
+
* erase-on-exit-2 behaviour (this file's header, work item D).
|
|
29
34
|
* - `[hooks] enabled = false`: silent no-op, same as unmanaged.
|
|
30
35
|
*
|
|
31
36
|
* Every other hook kind is dispatched through the shared `HookHandler` shape
|
|
@@ -202,13 +207,29 @@ export async function run(argv: readonly string[], adlVersion?: string): Promise
|
|
|
202
207
|
|
|
203
208
|
let config: AdlRepoConfig
|
|
204
209
|
{
|
|
205
|
-
|
|
210
|
+
let text: string
|
|
211
|
+
try {
|
|
212
|
+
text = readFileSync(managed.configPath, 'utf8')
|
|
213
|
+
} catch (error) {
|
|
214
|
+
// The readFileSync race: `resolveManagedRepo` confirmed the marker
|
|
215
|
+
// exists a moment ago, but the file was unlinked, perm-removed, or
|
|
216
|
+
// became unreadable before we opened it. Same kind-conditional
|
|
217
|
+
// exit-code split as the JSON-stdin branch above and az385's
|
|
218
|
+
// host-resolution branch: pre-tool-use fails CLOSED (refuse the
|
|
219
|
+
// dangerous action), every other kind fails at the non-blocking
|
|
220
|
+
// exit 1 so a Claude Code `UserPromptSubmit` or an advisory
|
|
221
|
+
// `briefing` is never erased.
|
|
222
|
+
process.stderr.write(
|
|
223
|
+
`adl hook: cannot read ${managed.configPath}: ${String(error)}\n`,
|
|
224
|
+
)
|
|
225
|
+
return kind === 'pre-tool-use' ? FAIL_CLOSED_EXIT_CODE : NON_BLOCKING_FAIL_EXIT_CODE
|
|
226
|
+
}
|
|
206
227
|
const decoded = decodeConfig(text)
|
|
207
228
|
if (!decoded.ok) {
|
|
208
229
|
process.stderr.write(
|
|
209
230
|
`adl hook: ${describeConfigIssue(managed.configPath, decoded.issue)}\n`,
|
|
210
231
|
)
|
|
211
|
-
return
|
|
232
|
+
return kind === 'pre-tool-use' ? FAIL_CLOSED_EXIT_CODE : NON_BLOCKING_FAIL_EXIT_CODE
|
|
212
233
|
}
|
|
213
234
|
config = decoded.value
|
|
214
235
|
}
|
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
* `adl mcp cli pr-review --vote reject ...` reaches Azure DevOps exactly the
|
|
11
11
|
* way `mcp__azdo__pr_review` does, and must be denied the same way.
|
|
12
12
|
*
|
|
13
|
-
* Scoped to the
|
|
14
|
-
* `workitem-create-or-update
|
|
13
|
+
* Scoped to the commands this package's role rules actually gate —
|
|
14
|
+
* `workitem-create-or-update-feature`/`-pbi`/`-bug` (one command per MCP
|
|
15
|
+
* tool), `pr-create-or-update`, `pr-review`,
|
|
15
16
|
* `build-run` — not a general reimplementation of the whole CLI surface
|
|
16
17
|
* (`packages/azdo/src/cli.ts`'s `commands` table), which belongs to
|
|
17
18
|
* `packages/azdo`, outside this package's write scope. The flag → input-key
|
|
18
19
|
* mapping below is copied from that table (re-checked 2026-09-28) for
|
|
19
|
-
* exactly these
|
|
20
|
+
* exactly these entries; if `cli.ts`'s flags for one of them change,
|
|
20
21
|
* this table needs a matching update — there is no cross-package import that
|
|
21
22
|
* would keep the two in sync automatically without also pulling in
|
|
22
23
|
* `tool-dispatch.ts` and everything it depends on.
|
|
@@ -59,12 +60,15 @@ interface GatedCommand {
|
|
|
59
60
|
* `--delete-source-branch` (`isPrCompletionCall`, pr-completion.ts),
|
|
60
61
|
* `pr-review`'s `--comment`/`--vote`/`--target-branch`
|
|
61
62
|
* (`adl-pr-review-role.ts`), and `build-run`'s `--id`/`--branch`
|
|
62
|
-
* (`adl.build-run-role`). `workitem-create-or-update
|
|
63
|
-
*
|
|
63
|
+
* (`adl.build-run-role`). The three `workitem-create-or-update-*` commands
|
|
64
|
+
* are graded on identity
|
|
65
|
+
* alone — no input field changes its outcome — so their flag lists are empty;
|
|
64
66
|
* every command still needs an entry here so it is RECOGNIZED at all.
|
|
65
67
|
*/
|
|
66
68
|
const GATED_COMMANDS: Readonly<Record<string, GatedCommand>> = {
|
|
67
|
-
'workitem-create-or-update': { tool: '
|
|
69
|
+
'workitem-create-or-update-feature': { tool: 'workitem_create_or_update_feature', flags: [] },
|
|
70
|
+
'workitem-create-or-update-pbi': { tool: 'workitem_create_or_update_pbi', flags: [] },
|
|
71
|
+
'workitem-create-or-update-bug': { tool: 'workitem_create_or_update_bug', flags: [] },
|
|
68
72
|
'pr-create-or-update': {
|
|
69
73
|
tool: 'pr_create_or_update',
|
|
70
74
|
flags: [
|
|
@@ -96,7 +100,7 @@ const GATED_COMMANDS: Readonly<Record<string, GatedCommand>> = {
|
|
|
96
100
|
* `adl`/`adl.exe mcp cli <command> [--flag value|--boolean-flag ...]` → the
|
|
97
101
|
* MCP tool call it is equivalent to, or `null` when `inv` is not this shape,
|
|
98
102
|
* any of the first three words is dynamic, or `<command>` is not one of the
|
|
99
|
-
*
|
|
103
|
+
* six gated commands. A `--flag`'s value is read only when the flag is
|
|
100
104
|
* known for that specific command (an unrecognized flag is ignored, not an
|
|
101
105
|
* error — this is a read for GRADING, not the CLI's own arg parser, which
|
|
102
106
|
* would reject an unknown flag itself before any tool call happens) and the
|
|
@@ -162,7 +166,7 @@ export function toolCallFor(inv: Invocation): AdlMcpCliCall | null {
|
|
|
162
166
|
* `ADL_AGENT_ID_AGENT=` override on the very piece being graded wins. Grading
|
|
163
167
|
* the session identity alone would be wrong in both directions: a reviewer
|
|
164
168
|
* session's own inline `agent-tarun` override on
|
|
165
|
-
* `adl mcp cli workitem-create-or-update` would be denied as `agent-reviewer`
|
|
169
|
+
* `adl mcp cli workitem-create-or-update-bug` would be denied as `agent-reviewer`
|
|
166
170
|
* (a false deny), and — the more dangerous direction — an `agent-tarun`
|
|
167
171
|
* SESSION with an inline `ADL_AGENT_ID_AGENT=agent-reviewer` override would be
|
|
168
172
|
* graded as `agent-tarun` (a false ALLOW: the piece that will actually run is
|
|
@@ -58,9 +58,12 @@
|
|
|
58
58
|
* request-item/`--form`/`--raw` implying a body (httpie's own semantics:
|
|
59
59
|
* a request with data defaults to POST, one without defaults to GET).
|
|
60
60
|
* - An Azure DevOps MCP write tool (the `'tool-call'` kind), named
|
|
61
|
-
* `mcp__<prefix>__<tool>` where `<tool>` is one of the
|
|
61
|
+
* `mcp__<prefix>__<tool>` where `<tool>` is one of the six mutating
|
|
62
62
|
* tools `packages/azdo/src/mcp-server.ts` actually registers:
|
|
63
|
-
* `pr_create_or_update`, `pr_review`, `build_run`,
|
|
63
|
+
* `pr_create_or_update`, `pr_review`, `build_run`, and the three
|
|
64
|
+
* `workitem_create_or_update_feature`/`_pbi`/`_bug` (the tool NAME carries
|
|
65
|
+
* the work-item type, so there is no blanket `workitem_create_or_update`
|
|
66
|
+
* tool any more). The
|
|
64
67
|
* match is on the TOOL NAME alone, not the server prefix — the package is
|
|
65
68
|
* `azdo`, P4 folds the server under `adl`, and Claude Code's plugin-scoped
|
|
66
69
|
* form (`mcp__plugin_<plugin>_<server>__<tool>`) adds a third spelling —
|
|
@@ -165,7 +168,8 @@ const HTTP_CLIENT_NAMES = HTTP_CLIENT_BINARY_NAMES
|
|
|
165
168
|
* `ListToolsRequestSchema` handler (re-checked 2026-10-01) — the
|
|
166
169
|
* complete tool roster there is `pr_list_or_get`/`pr_create_or_update`/
|
|
167
170
|
* `pr_review`, `build_list_or_get`/`build_run`, `workitem_list_or_get`/
|
|
168
|
-
* `
|
|
171
|
+
* `workitem_create_or_update_feature`/`_pbi`/`_bug`; the three not in this
|
|
172
|
+
* set are the read half.
|
|
169
173
|
* `pr_review` (docs/operations/agent-permissions.md rows 6-8: comment + vote) is
|
|
170
174
|
* in this set because `adl-pr-review-role.ts` gates it by role —
|
|
171
175
|
* a caller with no run identity at all must be denied here FIRST, the
|
|
@@ -176,7 +180,9 @@ const ADO_MCP_WRITE_TOOLS: ReadonlySet<string> = new Set([
|
|
|
176
180
|
'pr_create_or_update',
|
|
177
181
|
'pr_review',
|
|
178
182
|
'build_run',
|
|
179
|
-
'
|
|
183
|
+
'workitem_create_or_update_feature',
|
|
184
|
+
'workitem_create_or_update_pbi',
|
|
185
|
+
'workitem_create_or_update_bug',
|
|
180
186
|
])
|
|
181
187
|
|
|
182
188
|
/**
|
|
@@ -184,7 +190,7 @@ const ADO_MCP_WRITE_TOOLS: ReadonlySet<string> = new Set([
|
|
|
184
190
|
* DevOps MCP tool call, reads included — the read half gets no
|
|
185
191
|
* pass just because it cannot mutate anything. `mcp-server.ts`'s complete
|
|
186
192
|
* roster: `pr_list_or_get`, `build_list_or_get`, `workitem_list_or_get`
|
|
187
|
-
* (reads) alongside the
|
|
193
|
+
* (reads) alongside the six writes above.
|
|
188
194
|
*/
|
|
189
195
|
/** The leading words of the `identityBearingReason` for an Azure DevOps MCP tool call — `message()` keys the MCP-only CLI advice off it. */
|
|
190
196
|
const MCP_REASON_PREFIX = 'Azure DevOps MCP tool'
|
|
@@ -27,20 +27,33 @@ import { effectiveIdentityForMcpCli, toolCallFor } from './adl-mcp-cli.ts'
|
|
|
27
27
|
|
|
28
28
|
const RULE_ID = 'adl.workitem-requires-tarun-or-vivek'
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* The work-item write tools this rule grades — the three per-type siblings the
|
|
32
|
+
* MCP server registers (the old single `workitem_create_or_update` tool is
|
|
33
|
+
* gone; the tool NAME is the type, so there is no `type` argument to inspect).
|
|
34
|
+
* A name outside this set is not a work-item write at all and is left to
|
|
35
|
+
* `adl.run-required-for-writes`/`adl-pr-role.ts`.
|
|
36
|
+
*/
|
|
37
|
+
const WORKITEM_WRITE_TOOLS: ReadonlySet<string> = new Set([
|
|
38
|
+
'workitem_create_or_update_feature',
|
|
39
|
+
'workitem_create_or_update_pbi',
|
|
40
|
+
'workitem_create_or_update_bug',
|
|
41
|
+
])
|
|
42
|
+
|
|
30
43
|
export const adlWorkitemRequiresTarunOrVivek: RuleSpec = {
|
|
31
44
|
id: RULE_ID,
|
|
32
45
|
category: 'tool-call',
|
|
33
46
|
severity: 'deny',
|
|
34
47
|
enabledByDefault: true,
|
|
35
|
-
summary: 'Deny
|
|
48
|
+
summary: 'Deny the workitem_create_or_update_* tools for agent-reviewer (docs/operations/agent-permissions.md row 10) — the MCP tools AND their adl mcp cli equivalents.',
|
|
36
49
|
params: noParams,
|
|
37
50
|
match(inv: Invocation, ctx: RuleContext<Record<string, never>>): Finding | null {
|
|
38
|
-
// `adl mcp cli
|
|
39
|
-
//
|
|
40
|
-
//
|
|
51
|
+
// `adl mcp cli workitem-create-or-update-feature`/`-pbi`/`-bug` dispatch to
|
|
52
|
+
// the same tools the MCP server calls — graded identically, not only the
|
|
53
|
+
// tool-call payload shape.
|
|
41
54
|
const call = toolCallFor(inv)
|
|
42
55
|
if (call === null) return null
|
|
43
|
-
if (mcpToolName(call.tool)
|
|
56
|
+
if (!WORKITEM_WRITE_TOOLS.has(mcpToolName(call.tool) ?? '')) return null
|
|
44
57
|
|
|
45
58
|
// Grade the EFFECTIVE identity for THIS specific piece — a valid inline
|
|
46
59
|
// `ADL_AGENT_ID_AGENT=` override on the same `adl mcp cli` invocation
|
|
@@ -2,22 +2,25 @@
|
|
|
2
2
|
* Editing the files that wire the host's hooks.
|
|
3
3
|
*
|
|
4
4
|
* Handoff 5, rule 5: deny Write/Edit/MultiEdit/NotebookEdit on
|
|
5
|
-
* `.claude/settings.json`, `.claude/settings.local.json`,
|
|
6
|
-
* `.codex/config.toml
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* way to switch the gate off without anyone noticing.
|
|
5
|
+
* `.claude/settings.json`, `.claude/settings.local.json`, and
|
|
6
|
+
* `.codex/config.toml`. These are the files that install the hook into
|
|
7
|
+
* the host (including the `.local.json` overrides) — editing any of them
|
|
8
|
+
* is a way to switch the gate off without anyone noticing.
|
|
10
9
|
*
|
|
11
|
-
* `adl-config.toml`
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* `[hooks] enabled = false`
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
10
|
+
* `adl-config.toml` is NOT in this set. The earlier 2026-10-12 ruling
|
|
11
|
+
* ("we left a door open, close it") assumed the working-tree copy is what
|
|
12
|
+
* every running hook reads and that an agent writing
|
|
13
|
+
* `[hooks] enabled = false` flips the gate off ahead of any commit. The
|
|
14
|
+
* commit side IS enforced — repo-controls' `integrity.ts` (`WIRING`,
|
|
15
|
+
* refuses a normal commit of `adl-config.toml`) and `agent-hooks`'s
|
|
16
|
+
* `git.protected-tree-commit` rule (PBI 373/679) — and the working-tree
|
|
17
|
+
* edit is a runtime-config edit, not a carrier rewrite. The design
|
|
18
|
+
* ("agents may edit [WIRING] while preparing a reviewed change, but a
|
|
19
|
+
* normal commit must never land them" — integrity.ts:5-7) places the
|
|
20
|
+
* edit on the allowed side and the commit on the denied side.
|
|
21
|
+
* Re-confirmed 2026-10-13 (Tarun: "adl-config.toml can be editted but
|
|
22
|
+
* not committed by the agents"). `adl-config.toml` is a config file,
|
|
23
|
+
* not a hook carrier.
|
|
21
24
|
*
|
|
22
25
|
* Hooks are local-repo-first (Tarun, 2026-09-29): there is no managed-hooks
|
|
23
26
|
* lock and no global carrier, so these per-repo carrier files are the ONLY
|
|
@@ -478,20 +481,21 @@ export const agentTamperProtection: RuleSpec = {
|
|
|
478
481
|
: via === 'interpreter'
|
|
479
482
|
? 'an interpreter one-liner writing'
|
|
480
483
|
: 'editing'
|
|
484
|
+
const listed = [...PROTECTED_CARRIER_PATHS]
|
|
485
|
+
.map((p) => '`' + p + '`')
|
|
486
|
+
.join(', ')
|
|
481
487
|
return {
|
|
482
488
|
user: `Blocked ${via === 'tool-call' ? 'editing' : verb} ${path}. This file wires the host's hooks; ask the user to change it.`,
|
|
483
489
|
agent:
|
|
484
|
-
`DENIED ${verb} ${path}. This file is one of the tamper-protected files: ` +
|
|
485
|
-
'
|
|
486
|
-
'
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
'
|
|
491
|
-
'
|
|
492
|
-
|
|
493
|
-
'enforcement layer for the hosts that read them (there is no managed-hooks lock). ' +
|
|
494
|
-
`If a legitimate change is needed, file a PR or ask the user to make it themselves. ` +
|
|
490
|
+
`DENIED ${verb} ${path}. This file is one of the tamper-protected files: ${listed}. ` +
|
|
491
|
+
'Each installs or overrides a host\'s own hook contract. Editing, overwriting, moving ' +
|
|
492
|
+
'over, truncating, deleting, or rewriting any of them — by a tool call, a shell write, ' +
|
|
493
|
+
'or a git checkout/restore/reset/rm — is a way to switch the gate off without anyone ' +
|
|
494
|
+
'noticing, the ONLY enforcement layer for the hosts that read them (there is no ' +
|
|
495
|
+
'managed-hooks lock). `adl-config.toml` is intentionally NOT in this list: it is a ' +
|
|
496
|
+
'runtime config file an agent may edit; the commit is denied by `git.protected-tree-' +
|
|
497
|
+
'commit` and by repo-controls\' `integrity.ts` (PBI 373/679). If a legitimate change ' +
|
|
498
|
+
`to a host carrier is needed, file a PR or ask the user to make it themselves. ` +
|
|
495
499
|
`Blocked call: ${ctx.snippet}`,
|
|
496
500
|
}
|
|
497
501
|
},
|
|
@@ -7,7 +7,7 @@ import { branchMutates, isHelpOnlyInvocation, isSequencerRecoveryOnly, switchChe
|
|
|
7
7
|
import { LANDING_SUBCOMMANDS, resolveGitTarget } from './git-target.ts'
|
|
8
8
|
import { gitAgentTail } from './messages.ts'
|
|
9
9
|
|
|
10
|
-
const ASK_USER = '
|
|
10
|
+
const ASK_USER = 'you are enforced to commit and push to the same branch, branches are not agent\'s choice. treat them as given and continue on the same branch without stopping'
|
|
11
11
|
|
|
12
12
|
const UNRESOLVED =
|
|
13
13
|
'The commit target (which repository and branch this would land on) could not be determined statically from this command line. ' +
|
|
@@ -209,6 +209,7 @@ function heredocDelimiters(piece: string): string[] | 'unparsable' {
|
|
|
209
209
|
for (; i < piece.length && !/[\s;|&<>()]/.test(piece[i] as string); i++) {
|
|
210
210
|
sawWord = true
|
|
211
211
|
const c = piece[i] as string
|
|
212
|
+
/* istanbul ignore next -- splitShell() only yields a valid (non-`invalid`) result when its trailing `escape` flag is clear, and it clears that flag by consuming the escaped character; so a valid piece can never END on a lone `\`, it can only end on the SECOND half of a `\\` pair, which this scan reaches as `c` and steps over with a defined `piece[++i]`. Exhaustively checked: 15,867,149 valid commands over the 18-symbol quote/separator alphabet produced zero pieces ending in a lone backslash. */
|
|
212
213
|
if (c === '\\') word += piece[++i] ?? ''
|
|
213
214
|
else if (c === "'" || c === '"') {
|
|
214
215
|
const close = piece.indexOf(c, i + 1)
|
|
@@ -240,6 +241,7 @@ function parse(command: string): Parsed | null | 'closed' {
|
|
|
240
241
|
let cursor = 0
|
|
241
242
|
for (const piece of split.pieces) {
|
|
242
243
|
const at = command.indexOf(piece, cursor)
|
|
244
|
+
/* istanbul ignore next -- every piece splitShell() returns is an ordered, non-overlapping substring of the very `command` it was split from, so `indexOf(piece, cursor)` always finds it at or after `cursor`; `at < 0` would require splitShell() to emit a piece that is not in its input. Exhaustively checked: 958,762 valid commands over the 18-symbol quote/separator alphabet produced zero such pieces. */
|
|
243
245
|
if (at < 0) return { tokens, gaps: null, functions }
|
|
244
246
|
gaps.push(command.slice(cursor, at))
|
|
245
247
|
cursor = at + piece.length
|
|
@@ -342,9 +344,11 @@ function applyState(parsed: Parsed, until: number, target: Mutable): boolean {
|
|
|
342
344
|
if (state.names.includes('GIT_WORK_TREE')) delete target.workTree
|
|
343
345
|
continue
|
|
344
346
|
}
|
|
347
|
+
/* istanbul ignore next -- `gaps` is null on exactly one path, parse()'s `at < 0` return above, which is itself unreachable because splitShell() only emits ordered non-overlapping substrings of `command`. Every other parse() result carries a populated `gaps`, so this re-check is the fail-closed half of that invariant rather than a reachable state. */
|
|
345
348
|
if (parsed.gaps === null) return false
|
|
346
349
|
const before = plainGap(parsed.gaps[i] as string)
|
|
347
350
|
if (before === null) return false
|
|
351
|
+
/* istanbul ignore next -- `parsed.tokens[i - 1]` is null only for a here-doc BODY, and parse() sets `gaps[body] = '\n'` for every such nulled index; bodies are newline-separated, so the gap at the next index is that same `'\n'`, never `'&&'`. `before === '&&'` therefore short-circuits before this line reads `tokens[i - 1]`, so the `?? null` fallback is unreachable. */
|
|
348
352
|
if (before === '&&' && (i === 0 || !['cd', 'export'].includes(classify(parsed.tokens[i - 1] ?? null, parsed.functions).kind))) return false
|
|
349
353
|
for (let j = i + 1; j <= Math.min(until, parsed.gaps.length - 1); j++) if (plainGap(parsed.gaps[j] as string) === null) return false
|
|
350
354
|
if (state.kind === 'cd') {
|
|
@@ -406,6 +410,7 @@ function walk(command: string, inv: Invocation & { kind: 'git' }, inherited: Mut
|
|
|
406
410
|
if (inner === undefined) continue
|
|
407
411
|
if (inner === null || !applyState(parsed, i, target)) return null
|
|
408
412
|
const nested = walk(script, inv, target)
|
|
413
|
+
/* istanbul ignore next -- `inner` and `nested` are the SAME walk over the SAME script and invocation, differing only in the inherited `dirs`/`gitDir`/`workTree`; no branch inside walk() reads those to choose null or undefined (only `homeUnknown` gates expandPath, and applyState above never sets it). Since `inner` was already a non-null target here, so is `nested`, and the fallback is unreachable. Fuzzed: 6.6M generated shell/-c command pairs produced no case where it fires. */
|
|
409
414
|
return nested ?? null
|
|
410
415
|
}
|
|
411
416
|
return undefined
|
|
@@ -11,7 +11,9 @@ export const KNOWN_MCP_TOOL_NAMES: ReadonlySet<string> = new Set([
|
|
|
11
11
|
'build_list_or_get',
|
|
12
12
|
'build_run',
|
|
13
13
|
'workitem_list_or_get',
|
|
14
|
-
'
|
|
14
|
+
'workitem_create_or_update_feature',
|
|
15
|
+
'workitem_create_or_update_pbi',
|
|
16
|
+
'workitem_create_or_update_bug',
|
|
15
17
|
])
|
|
16
18
|
|
|
17
19
|
/**
|