@amsterdamdatalabs/adl-agent-control-linux-x64 0.1.10 → 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 +17 -18
- package/bin/git-ado +27 -26
- 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/bun-compile-build.sh +1 -1
- package/bin/lib/fleet-host.sh +62 -0
- package/bin/lib/lean-ctx-observe-hooks.sh +9 -9
- package/bin/reconcile +693 -470
- package/bin/reconcile-host +121 -0
- package/bin/setup +219 -0
- package/bin/shell-path-policy +15 -5
- package/bin/sync-and-reconcile +79 -68
- package/bin/validate-manifest +46 -51
- package/package.json +2 -12
- package/packages/agent-hooks/README.md +14 -9
- package/packages/agent-hooks/assets/hooks.json +0 -20
- package/packages/agent-hooks/package.json +1 -2
- 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/fs-trash.ts +2 -2
- 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 +18 -18
- 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 +5 -17
- 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/package.json +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 +2 -5
- 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 +38 -33
- package/packages/fleet/manifest.schema.json +67 -65
- 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 +14 -14
- package/packages/fleet/src/managed-settings.ts +7 -7
- package/packages/fleet/src/repo-maintain.ts +439 -0
- package/packages/fleet/src/scratch-reap.ts +6 -6
- 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 -10
- 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
- package/packages/fleet/jobs/git-maintain/src/main.ts +0 -848
- package/packages/fleet/systemd/adl-azure-agent-update.service +0 -13
- package/packages/fleet/systemd/adl-azure-agent-update.timer +0 -10
|
@@ -42,11 +42,12 @@ export type Invocation =
|
|
|
42
42
|
* The raw command word that invoked git — `git`/`git.exe` when run by
|
|
43
43
|
* bare name (the common case, and the only one `git-worktree`'s
|
|
44
44
|
* synthetic shortcut below ever produces), or the exact path when run
|
|
45
|
-
* by one (`/usr/local/bin/git`, `/usr/bin/git`, …).
|
|
46
|
-
* (`adl-git-credential-bypass.ts`) denies an ABSOLUTE path other than
|
|
45
|
+
* by one (`/usr/local/bin/git`, `/usr/bin/git`, …).
|
|
46
|
+
* `adl.git-credential-bypass` (`adl-git-credential-bypass.ts`) denies an ABSOLUTE path other than
|
|
47
47
|
* the managed front controller `/usr/local/bin/git` — an agent
|
|
48
|
-
* invoking git by any other absolute path bypasses `bin/git
|
|
49
|
-
* entirely, since that routing lives at exactly
|
|
48
|
+
* invoking git by any other absolute path bypasses the `bin/git` front
|
|
49
|
+
* controller and git-ado entirely, since that routing lives at exactly
|
|
50
|
+
* that one path. Absent
|
|
50
51
|
* on the `git-worktree` binary shortcut (no real "binary word" to
|
|
51
52
|
* report there).
|
|
52
53
|
*/
|
|
@@ -65,8 +66,8 @@ export type Invocation =
|
|
|
65
66
|
| { readonly kind: 'git-internals-write'; readonly name: string; readonly targets: readonly string[] }
|
|
66
67
|
/**
|
|
67
68
|
* A command that writes into one of the seven tamper-protected carrier
|
|
68
|
-
* files (`.claude/settings.json`, `.codex/hooks.json`,
|
|
69
|
-
* …) via redirection, tee, mv/cp/install/ln, sed -i/perl -pi, truncate,
|
|
69
|
+
* files (`.claude/settings.json`, `.codex/hooks.json`,
|
|
70
|
+
* `.cursor/hooks.json`, …) via redirection, tee, mv/cp/install/ln, sed -i/perl -pi, truncate,
|
|
70
71
|
* trash/rm/unlink/shred, or dd. See shell/protected-carrier-writes.ts;
|
|
71
72
|
* denied by agent.tamper-protection. `git rm`/`checkout --`/`restore --`/
|
|
72
73
|
* `reset --` on one of these files is a `'git'` Invocation instead — see
|
|
@@ -78,7 +79,7 @@ export type Invocation =
|
|
|
78
79
|
* `az devops|repos|pipelines|boards|artifacts ...`. `args` is everything
|
|
79
80
|
* after `az` itself (the subcommand group onward, e.g. `['repos', 'pr',
|
|
80
81
|
* 'create', '--title', 'x']`) — carried so a rule can tell a mutating
|
|
81
|
-
* subcommand from a read one (`adl.
|
|
82
|
+
* subcommand from a read one (`adl.run-required-for-writes`); denied
|
|
82
83
|
* outright regardless of that distinction by tool.azure-devops, which
|
|
83
84
|
* ignores this field. See impl/tool-azure-devops.ts.
|
|
84
85
|
*/
|
|
@@ -282,10 +283,9 @@ const LEADING_ASSIGNMENT_RE = /^[A-Za-z_][A-Za-z0-9_]*=/
|
|
|
282
283
|
/**
|
|
283
284
|
* Whether `tokens` begins (after any leading `NAME=value` assignments) with
|
|
284
285
|
* an `env`/`env.exe` invocation that carries `-S`/`--split-string` among its
|
|
285
|
-
* own flags
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
* flag argument; this mirrors that same flag-scanning loop just far enough
|
|
286
|
+
* own flags. Checked at `walk()`'s own call site BEFORE `skipPrefixes`
|
|
287
|
+
* (../prefixes.ts's `skipEnvFlags`) consumes `-S`/`--split-string` and its
|
|
288
|
+
* value as an opaque, value-taking flag argument; this mirrors that same flag-scanning loop just far enough
|
|
289
289
|
* to detect the flag's PRESENCE, without trying to parse or classify what
|
|
290
290
|
* its value names. Narrow by design: only a leading `env`, not `env` nested
|
|
291
291
|
* behind another wrapper (`sudo env -S …`) — the common, and only currently
|
|
@@ -523,90 +523,6 @@ function walkShellCommand(name: string, args: readonly Token[], cfg: ClassifyCon
|
|
|
523
523
|
return null
|
|
524
524
|
}
|
|
525
525
|
|
|
526
|
-
const LEAN_CTX_COMMAND_NAMES: ReadonlySet<string> = new Set(['lean-ctx', 'lean-ctx.exe'])
|
|
527
|
-
/** `lean-ctx raw`'s documented alias, plus `exec` ("Same as -c" per `lean-ctx help all`). */
|
|
528
|
-
const LEAN_CTX_EXEC_WORDS: ReadonlySet<string> = new Set(['exec', 'raw', 'bypass'])
|
|
529
|
-
/**
|
|
530
|
-
* lean-ctx's own shell-hook re-exec placeholder (`exec lean-ctx -c
|
|
531
|
-
* "$BASH_EXECUTION_STRING"`, injected into `~/.bashenv` by `lean-ctx setup`
|
|
532
|
-
* — see `../impl/tool-lean-ctx-global.ts`'s module doc). Bash substitutes
|
|
533
|
-
* the REAL command text into this variable inside the interactive shell's
|
|
534
|
-
* OWN DEBUG-trap machinery — never inside a Bash-tool `command` string an
|
|
535
|
-
* agent hands this hook. Reaching here unresolved means lean-ctx execs an
|
|
536
|
-
* EMPTY command (the variable is unset in every context this static
|
|
537
|
-
* scanner actually observes), not an unknown one, so it is recognized as
|
|
538
|
-
* this ONE specific, known placeholder and left alone — rather than
|
|
539
|
-
* failing closed on "any `$...`", which `dynamicToken` would otherwise do
|
|
540
|
-
* for every other unresolvable value below.
|
|
541
|
-
*/
|
|
542
|
-
const LEAN_CTX_SHELL_HOOK_PLACEHOLDER = '$BASH_EXECUTION_STRING'
|
|
543
|
-
|
|
544
|
-
/**
|
|
545
|
-
* lean-ctx's own arbitrary-command-execution surface — independent-review
|
|
546
|
-
* finding 1 (HIGH, pre-existing, affects every rule): `-c [--raw]`, `-t`,
|
|
547
|
-
* `exec`, `raw`/`bypass <command>` all hand a shell command to a REAL
|
|
548
|
-
* shell, exactly like `bash -c`'s own script argument, but nothing walked
|
|
549
|
-
* that argument before this fix — it was an opaque word inside an
|
|
550
|
-
* unclassified `{kind:'command', name:'lean-ctx', ...}`.
|
|
551
|
-
*
|
|
552
|
-
* Verified against the real `lean-ctx 3.10.5` binary: `lean-ctx -c echo a
|
|
553
|
-
* b` prints `a b` — every remaining word is joined with a single space
|
|
554
|
-
* into ONE command string (not only the first), so `rest.map(tokenValue).
|
|
555
|
-
* join(' ')` mirrors that exactly; a single already-quoted argument
|
|
556
|
-
* (`-c "npm install"`) round-trips unchanged through the same join.
|
|
557
|
-
*
|
|
558
|
-
* `lean-ctx shell` (an interactive compressed shell) is the READ side of
|
|
559
|
-
* the same risk when its stdin is fed by a pipe or a file redirection —
|
|
560
|
-
* the commands it will run are whatever that feed contains, invisible to
|
|
561
|
-
* this static scanner, so it fails closed as `uncertain` (matching how
|
|
562
|
-
* every other unreadable script source in this file is handled) rather
|
|
563
|
-
* than silently falling through to an unclassified allow. A bare `lean-ctx
|
|
564
|
-
* shell` with no stdin feed is left unclassified (out of scope for this
|
|
565
|
-
* finding — no probe or finding names that shape, and an interactive
|
|
566
|
-
* session an agent cannot feed input into is not the arbitrary-command
|
|
567
|
-
* risk this fix closes).
|
|
568
|
-
*
|
|
569
|
-
* Redirections between `lean-ctx` and its first argument (`lean-ctx
|
|
570
|
-
* >/dev/null -c "cmd"`) are stripped here the same way `walkShell` strips
|
|
571
|
-
* them for a real shell's own `-c` — `rawArgs` (`args` in `classify()`)
|
|
572
|
-
* still carries them; the generic `{kind:'command', ...}` fallback and
|
|
573
|
-
* `tool.lean-ctx-global-state`'s own `firstPositional` scan handle THAT
|
|
574
|
-
* redirection-before-subcommand case for the subcommand forms this
|
|
575
|
-
* function does not otherwise touch.
|
|
576
|
-
*/
|
|
577
|
-
function walkLeanCtxExec(
|
|
578
|
-
name: string,
|
|
579
|
-
rawArgs: readonly Token[],
|
|
580
|
-
rawTokens: readonly Token[],
|
|
581
|
-
parser: Parser,
|
|
582
|
-
feed: StdinFeed | undefined,
|
|
583
|
-
): readonly Invocation[] | null {
|
|
584
|
-
if (!LEAN_CTX_COMMAND_NAMES.has(name)) return null
|
|
585
|
-
const args = withoutRedirections(rawArgs)
|
|
586
|
-
if (args.length === 0) return null
|
|
587
|
-
const first = tokenValue(args[0] as Token)
|
|
588
|
-
const firstLower = first.toLowerCase()
|
|
589
|
-
|
|
590
|
-
if (firstLower === 'shell') {
|
|
591
|
-
return feed !== undefined || readsStdinFromFile(rawTokens) ? uncertain('lean-ctx shell fed from stdin') : null
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
let rest: readonly Token[] | null = null
|
|
595
|
-
if (first === '-c') {
|
|
596
|
-
const second = args[1]
|
|
597
|
-
rest = second !== undefined && tokenValue(second) === '--raw' ? args.slice(2) : args.slice(1)
|
|
598
|
-
} else if (first === '-t') {
|
|
599
|
-
rest = args.slice(1)
|
|
600
|
-
} else if (LEAN_CTX_EXEC_WORDS.has(firstLower)) {
|
|
601
|
-
rest = args.slice(1)
|
|
602
|
-
}
|
|
603
|
-
if (rest === null) return null
|
|
604
|
-
if (rest.length === 0) return uncertain('dynamic lean-ctx script')
|
|
605
|
-
if (rest.length === 1 && tokenValue(rest[0] as Token) === LEAN_CTX_SHELL_HOOK_PLACEHOLDER) return []
|
|
606
|
-
const joined = rest.map(tokenValue).join(' ')
|
|
607
|
-
return parser.parseScript(joined, feed)
|
|
608
|
-
}
|
|
609
|
-
|
|
610
526
|
const isTrashDestination = (token: Token): boolean => {
|
|
611
527
|
const value = tokenValue(token).replace(/\/+$/, '')
|
|
612
528
|
return value.endsWith('/.Trash') || value === '~/.Trash' || value.endsWith('/Trash')
|
|
@@ -669,11 +585,10 @@ function isBunTestSubcommand(args: readonly Token[]): boolean {
|
|
|
669
585
|
/**
|
|
670
586
|
* The real Azure CLI global parameters that can appear before ANY
|
|
671
587
|
* subcommand group — https://learn.microsoft.com/cli/azure/reference-index
|
|
672
|
-
* (checked 2026-09-28)
|
|
673
|
-
*
|
|
674
|
-
* `
|
|
675
|
-
* `
|
|
676
|
-
* — invisible to `tool.azure-devops`'s outright deny. `--help`/`-h`/
|
|
588
|
+
* (checked 2026-09-28): without skipping these,
|
|
589
|
+
* `az --output json devops project list` read `args[0]` as `--output`, not
|
|
590
|
+
* `devops`, never matched `azureDevopsSubcommands`, and fell through to the
|
|
591
|
+
* generic `'command'` kind — invisible to `tool.azure-devops`'s outright deny. `--help`/`-h`/
|
|
677
592
|
* `--version`/`-v` are deliberately NOT skipped here: `isHelpOrVersionOnly`
|
|
678
593
|
* already gates a purely-help invocation before this runs, and one
|
|
679
594
|
* appearing BEFORE the subcommand group is real az's own "show generic
|
|
@@ -687,7 +602,7 @@ const AZ_GLOBAL_BOOLEAN_FLAGS: ReadonlySet<string> = new Set(['--debug', '--only
|
|
|
687
602
|
* flag (or its value) — see `AZ_GLOBAL_VALUE_FLAGS`/`AZ_GLOBAL_BOOLEAN_FLAGS`.
|
|
688
603
|
* `--flag=value` is a single word and is skipped as one. Exported (not just
|
|
689
604
|
* used internally here) so `impl/tool-azure-devops.ts`'s own separate
|
|
690
|
-
* `account get-access-token`/`rest` positional checks
|
|
605
|
+
* `account get-access-token`/`rest` positional checks use the SAME
|
|
691
606
|
* skip, rather than a second copy that could drift from this one.
|
|
692
607
|
*/
|
|
693
608
|
export function skipAzGlobalFlags(args: readonly Token[]): number {
|
|
@@ -757,7 +672,7 @@ function walkNested(tokens: readonly Token[], index: number, args: readonly Toke
|
|
|
757
672
|
}
|
|
758
673
|
|
|
759
674
|
/** Nested shell scripts (`-c` arguments, here-document and here-string bodies fed to a shell) are walked at most this deep. */
|
|
760
|
-
|
|
675
|
+
const MAX_SHELL_SCRIPT_DEPTH = 16
|
|
761
676
|
|
|
762
677
|
/**
|
|
763
678
|
* A piece's stdin when a pipe feeds it: every earlier stage of its pipeline
|
|
@@ -928,13 +843,13 @@ function makeParser(cfg: ClassifyConfig): Parser & { readonly parse: (command: s
|
|
|
928
843
|
const walk = (rawTokens: readonly Token[], feed?: StdinFeed): readonly Invocation[] => {
|
|
929
844
|
const input = detachShellInput(rawTokens, documents)
|
|
930
845
|
const tokens = input.tokens
|
|
931
|
-
//
|
|
932
|
-
//
|
|
933
|
-
//
|
|
934
|
-
//
|
|
935
|
-
//
|
|
936
|
-
//
|
|
937
|
-
//
|
|
846
|
+
// `env -S`/`--split-string` splits its value into argv and execs it —
|
|
847
|
+
// but `skipPrefixes`'s own `skipEnvFlags` (../prefixes.ts) treats that
|
|
848
|
+
// value as an opaque, value-taking flag argument and skips straight past
|
|
849
|
+
// it, so whatever it actually names would be invisible to every rule (a
|
|
850
|
+
// bare `env -S '<value>'` would make `invocations()` return `[]` — no
|
|
851
|
+
// Invocation, so no rule's match() ever runs). Checked BEFORE
|
|
852
|
+
// `skipPrefixes` runs, so it is reported as uncertain instead of
|
|
938
853
|
// silently vanishing; see `envUsesSplitString`'s own doc.
|
|
939
854
|
if (envUsesSplitString(tokens)) return [...uncertain('env -S/--split-string execution')]
|
|
940
855
|
const index = skipPrefixes(tokens)
|
|
@@ -959,15 +874,6 @@ function makeParser(cfg: ClassifyConfig): Parser & { readonly parse: (command: s
|
|
|
959
874
|
if (name === 'git-worktree' || name === 'git-worktree.exe') return [{ kind: 'git', subcommand: 'worktree', globals: [], rest: args }]
|
|
960
875
|
if (dynamicToken(first)) return uncertain('dynamic shell command')
|
|
961
876
|
|
|
962
|
-
// Independent-review finding 1 (HIGH, pre-existing, affects every rule):
|
|
963
|
-
// lean-ctx's own -c/-t/exec/raw(/bypass) run an ARBITRARY shell command
|
|
964
|
-
// that nothing below this point ever inspected — see walkLeanCtxExec's
|
|
965
|
-
// own doc for the fix and the verified-against-the-real-binary behavior
|
|
966
|
-
// it relies on. Checked before walkShellCommand/walkToolCommand/the
|
|
967
|
-
// generic fallback, same priority as a real shell's own -c.
|
|
968
|
-
const leanCtxExec = walkLeanCtxExec(name, args, tokens, parser, feed)
|
|
969
|
-
if (leanCtxExec !== null) return leanCtxExec
|
|
970
|
-
|
|
971
877
|
const shellCommand = walkShellCommand(name, args, cfg, parser, feed)
|
|
972
878
|
const denied = deniedPathInvocation(name, args, cfg)
|
|
973
879
|
if (denied !== null) return [denied]
|
|
@@ -20,7 +20,7 @@ import { splitShell } from './split.ts'
|
|
|
20
20
|
import { nestedSources } from './substitution.ts'
|
|
21
21
|
import { tokenize } from './token.ts'
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
const REMOTE_FETCHERS: ReadonlySet<string> = new Set([
|
|
24
24
|
'curl',
|
|
25
25
|
'curlie',
|
|
26
26
|
'wget',
|
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Filesystem writes into one of the
|
|
2
|
+
* Filesystem writes into one of the tamper-protected carrier files —
|
|
3
3
|
* the shell-command half of `agent.tamper-protection`.
|
|
4
4
|
*
|
|
5
5
|
* That rule's `match()` used to see only `tool-call` Write/Edit/MultiEdit/
|
|
6
6
|
* NotebookEdit/Patch; a shell command reaching the same file through `>`,
|
|
7
7
|
* `tee`, `mv`, `cp`, `install`, `ln -sf`, `sed -i`/`perl -pi`, `truncate`,
|
|
8
8
|
* `trash`/`rm`/`unlink`/`shred`, or `dd of=` was invisible to it — measured
|
|
9
|
-
* `{blocked: false}` against the real engine,
|
|
10
|
-
*
|
|
9
|
+
* `{blocked: false}` against the real engine, which is why this module
|
|
10
|
+
* exists: hooks run per repo (Tarun, 2026-09-29), so the hook carriers are the
|
|
11
|
+
* enforcement layer, and an agent must not be able to edit its own guard away
|
|
12
|
+
* through the shell either.
|
|
11
13
|
*
|
|
12
14
|
* Deliberately mirrors `git-internals.ts`'s own redirection/operand
|
|
13
15
|
* extraction (same incident shape: a denied edit tool is not the only way to
|
|
14
16
|
* mutate a file) instead of re-deriving it — `nonOptionArgs`/`copyDestination`/
|
|
15
17
|
* `inPlaceEditFiles`/`redirectionWriteTargets`/`withoutRedirections` are the
|
|
16
18
|
* exact pure, path-agnostic pieces `git-internals.ts` already built and
|
|
17
|
-
* tests; only the verb vocabulary (`shred
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* `chown`/`chgrp` still excluded, not named by that finding) and the path
|
|
19
|
+
* tests; only the verb vocabulary (`shred`, `chmod` and `rsync` added;
|
|
20
|
+
* unlike `git-internals.ts`'s own carve-out for `.git/hooks` there is no such
|
|
21
|
+
* exemption needed here; `chown`/`chgrp` are not covered) and the path
|
|
21
22
|
* predicate (`protectedCarrierMatch`/`protectedCarrierDirMatch` instead of
|
|
22
23
|
* `isGitInternalsPath`) differ. `git rm`/`mv`/`checkout --`/`restore --`/
|
|
23
24
|
* `reset --` are NOT handled here — those are `'git'`-kind Invocations, not
|
|
24
25
|
* generic commands, and are checked directly in
|
|
25
26
|
* `impl/agent-tamper-protection.ts`.
|
|
26
27
|
*
|
|
27
|
-
*
|
|
28
|
+
* `mv`/`cp -r`/`rsync` onto (or, for `mv`, of) a carrier
|
|
28
29
|
* DIRECTORY (`.claude`/`.codex`/`.cursor`/`.opencode` — deleting or
|
|
29
30
|
* overwriting the whole directory takes the carrier file inside it with
|
|
30
31
|
* it) — covered by the SAME candidate extraction as the file-level check,
|
|
@@ -56,7 +57,7 @@ const ANY_OPERAND = new Set(['rm', 'rm.exe', 'unlink', 'unlink.exe', 'trash', 't
|
|
|
56
57
|
/** Tools where only the DESTINATION is a candidate write target. */
|
|
57
58
|
const COPY_LIKE = new Set(['cp', 'ln', 'install'])
|
|
58
59
|
|
|
59
|
-
/** `rsync ... SRC DEST` — the last positional operand is the destination
|
|
60
|
+
/** `rsync ... SRC DEST` — the last positional operand is the destination. */
|
|
60
61
|
function rsyncDestination(args: readonly Token[]): string | null {
|
|
61
62
|
const positional = nonOptionArgs(args)
|
|
62
63
|
return positional.length >= 2 ? (positional[positional.length - 1] as string) : null
|
|
@@ -100,7 +101,7 @@ function writeTargetCandidates(name: string, rawArgs: readonly Token[], tokens:
|
|
|
100
101
|
*/
|
|
101
102
|
const isDynamicCandidate = (target: string): boolean => /\$\(|`/.test(target) && !/^[<>]\(/.test(target)
|
|
102
103
|
|
|
103
|
-
/** The protected-carrier paths (files or
|
|
104
|
+
/** The protected-carrier paths (files or directories) `name args...` (with its whole token list, for redirections) would write to. */
|
|
104
105
|
export function protectedCarrierWriteTargets(name: string, rawArgs: readonly Token[], tokens: readonly Token[]): readonly string[] {
|
|
105
106
|
return writeTargetCandidates(name, rawArgs, tokens).filter(
|
|
106
107
|
(candidate) => !isDynamicCandidate(candidate) && (protectedCarrierMatch(candidate) !== null || protectedCarrierDirMatch(candidate) !== null),
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The tamper-protected carrier files — one source of the list.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
4
|
+
* Hooks run only per repo, where `adl hooks deploy` has run (Tarun,
|
|
5
|
+
* 2026-09-29), so these carriers are the enforcement layer an agent must not
|
|
6
|
+
* be able to edit away. `agent.tamper-protection`'s `tool-call` branch
|
|
7
|
+
* (`impl/agent-tamper-protection.ts`) and the shell-write coverage
|
|
8
|
+
* (`protected-carrier-writes.ts`) both need the SAME list; `impl/*.ts` rules
|
|
9
|
+
* import FROM `shell/`, never the reverse, so the list lives here and
|
|
10
|
+
* `agent-tamper-protection.ts` imports it, rather than two copies that could
|
|
11
|
+
* drift.
|
|
11
12
|
*
|
|
12
13
|
* Still hard-coded on purpose (not configurable): see
|
|
13
14
|
* `impl/agent-tamper-protection.ts`'s header for why an `adl-config.toml`
|
|
@@ -28,15 +29,17 @@ export const PROTECTED_CARRIER_PATHS: ReadonlySet<string> = new Set([
|
|
|
28
29
|
'.claude/settings.json',
|
|
29
30
|
'.claude/settings.local.json',
|
|
30
31
|
'.codex/config.toml',
|
|
31
|
-
|
|
32
|
+
// `adl-config.toml` was the fourth entry until 2026-10-01 (Tarun: "nobody
|
|
33
|
+
// should stop editing adl-config.toml"). It stays human-landed at commit time
|
|
34
|
+
// (`git.protected-tree-commit`, repo-controls' integrity gate), but an agent
|
|
35
|
+
// can now write it, and every hook run re-reads it.
|
|
32
36
|
'.codex/hooks.json',
|
|
33
37
|
'.cursor/hooks.json',
|
|
34
38
|
'.opencode/plugins/adl-repo.ts',
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
// exists for it at all). Deliberately a suffix-only entry, no leading
|
|
39
|
+
// Kimi's ONLY carrier — a single, globally-installed
|
|
40
|
+
// `~/.kimi-code/config.toml` (Kimi stays global by design: its documented
|
|
41
|
+
// hook config is that one file, checked against Kimi's own docs on
|
|
42
|
+
// 2026-09-29, so no per-repo carrier exists for it). Deliberately a suffix-only entry, no leading
|
|
40
43
|
// `~`/home path baked in: the EXISTING suffix match
|
|
41
44
|
// (`protectedCarrierMatch`'s `candidate.endsWith('/'+target)`) already
|
|
42
45
|
// matches `~/.kimi-code/config.toml`, `$HOME/.kimi-code/config.toml`, and
|
|
@@ -47,7 +50,7 @@ export const PROTECTED_CARRIER_PATHS: ReadonlySet<string> = new Set([
|
|
|
47
50
|
])
|
|
48
51
|
|
|
49
52
|
/**
|
|
50
|
-
*
|
|
53
|
+
* On a case-INSENSITIVE filesystem
|
|
51
54
|
* (macOS's default APFS/HFS+ — `darwin`), `.CLAUDE/Settings.JSON` opens the
|
|
52
55
|
* SAME file on disk as `.claude/settings.json`, so a purely case-sensitive
|
|
53
56
|
* string compare is a real bypass there, not merely cosmetic. Linux's
|
|
@@ -60,8 +63,8 @@ const CASE_INSENSITIVE_HOST_FS = process.platform === 'darwin'
|
|
|
60
63
|
/**
|
|
61
64
|
* Collapse `//` to `/` and resolve `.`/`..` segments (POSIX-style, no
|
|
62
65
|
* filesystem access — this never has to be correct about symlinks, only
|
|
63
|
-
* about what STRING a shell command's own path argument denotes)
|
|
64
|
-
*
|
|
66
|
+
* about what STRING a shell command's own path argument denotes):
|
|
67
|
+
* `.codex/sub/../hooks.json` names
|
|
65
68
|
* `.codex/hooks.json` exactly as much as the already-normalized spelling
|
|
66
69
|
* does, and a purely textual suffix check misses it. A leading `..` (would
|
|
67
70
|
* escape above the argument's own root) is left as `..` — this function
|
|
@@ -102,12 +105,10 @@ export function protectedCarrierMatch(path: string): string | null {
|
|
|
102
105
|
/**
|
|
103
106
|
* The per-host carrier DIRECTORIES — deleting, moving away, or overwriting
|
|
104
107
|
* the WHOLE directory removes (or replaces) the carrier file inside it too,
|
|
105
|
-
* exactly as much as touching that file directly
|
|
106
|
-
* 2026-09-29). `.claude`/`.codex`/`.cursor`/`.opencode` — Kimi's own
|
|
108
|
+
* exactly as much as touching that file directly. `.claude`/`.codex`/`.cursor`/`.opencode` — Kimi's own
|
|
107
109
|
* `~/.kimi-code/` is deliberately NOT included: `mv ~/.kimi-code /tmp` is a
|
|
108
110
|
* genuinely different, much bigger blast radius (moving the user's whole
|
|
109
|
-
* Kimi config directory, not a repo-scoped host-config directory)
|
|
110
|
-
* finding did not name.
|
|
111
|
+
* Kimi config directory, not a repo-scoped host-config directory).
|
|
111
112
|
*
|
|
112
113
|
* Covers `mv`/`cp -r` (destination)/`rsync` (destination) via
|
|
113
114
|
* `protected-carrier-writes.ts`'s existing operand extraction — a
|
|
@@ -115,18 +116,17 @@ export function protectedCarrierMatch(path: string): string | null {
|
|
|
115
116
|
* operand) moving it away too. `tar -x`/`unzip -o` extracting INTO one of
|
|
116
117
|
* these directories (via `-C`/`-d`) are NOT covered — those tools' own
|
|
117
118
|
* target-directory flags are not among `protected-carrier-writes.ts`'s
|
|
118
|
-
* existing operand handlers, and
|
|
119
|
-
* parsing
|
|
120
|
-
* dropped.
|
|
119
|
+
* existing operand handlers, and covering them needs new, tool-specific
|
|
120
|
+
* parsing; a known gap, recorded here rather than silently dropped.
|
|
121
121
|
*/
|
|
122
|
-
|
|
122
|
+
const PROTECTED_CARRIER_DIRS: ReadonlySet<string> = new Set(['.claude', '.codex', '.cursor', '.opencode'])
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* The protected carrier directory `path` names — exact match or a trailing
|
|
126
126
|
* `/<dir>` suffix — or null. Same normalization/case rules as
|
|
127
127
|
* `protectedCarrierMatch`.
|
|
128
128
|
*
|
|
129
|
-
*
|
|
129
|
+
* `path` ending in a literal
|
|
130
130
|
* `/` (BEFORE normalization strips it for the comparison itself) means "a
|
|
131
131
|
* file goes INTO this directory" (`cp GLOBAL-AGENTS.md .claude/`, `mv
|
|
132
132
|
* notes.md .cursor/`) — the directory itself is untouched, only gaining an
|
|
@@ -46,7 +46,7 @@ export function findMatchingParen(command: string, openIndex: number): number {
|
|
|
46
46
|
* `$((a) && (b))` is a command substitution of two subshells, not arithmetic,
|
|
47
47
|
* and returns -1.
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
function arithmeticClose(command: string, openIndex: number): number {
|
|
50
50
|
if (command[openIndex] !== '(' || command[openIndex + 1] !== '(') return -1
|
|
51
51
|
const close = findMatchingParen(command, openIndex)
|
|
52
52
|
if (close < 0) return -1
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { dynamicToken, type Token, tokenValue } from './token.ts'
|
|
13
13
|
import type { Invocation } from './invocation.ts'
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
const XARGS_OPTIONS_WITH_VALUE = new Set([
|
|
16
16
|
'-a',
|
|
17
17
|
'--arg-file',
|
|
18
18
|
'-d',
|
|
@@ -31,7 +31,7 @@ export const XARGS_OPTIONS_WITH_VALUE = new Set([
|
|
|
31
31
|
'-s',
|
|
32
32
|
'--max-chars',
|
|
33
33
|
])
|
|
34
|
-
|
|
34
|
+
const XARGS_FLAG_OPTIONS = new Set([
|
|
35
35
|
'-0',
|
|
36
36
|
'--null',
|
|
37
37
|
'-r',
|
|
@@ -33,9 +33,9 @@ export type Severity = 'deny' | 'advise'
|
|
|
33
33
|
* (`../gating/config.ts`) treats it specially, refusing to let it resolve to
|
|
34
34
|
* disabled without `rules.unsafeAllowUncertain` set.
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
type RuleCategory = 'git' | 'filesystem' | 'tool' | 'tool-call' | 'uncertain' | 'advisory'
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
interface ParamDecodeIssue {
|
|
39
39
|
readonly pointer: string
|
|
40
40
|
readonly message: string
|
|
41
41
|
}
|