@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
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "agent-settings deploy profile",
|
|
4
|
+
"description": "Single source of truth for how assets/mcp.json's servers and assets/agents/*.toml's agents are written into each surface's file — target path, container/table key, per-entry field mapping (which target key comes from which source field, or a constant), array/JSON formatting style, and (for the Markdown surfaces) YAML front-matter field order including nested and comma-list styles. The renderer (src/deploy/*.ts) is generic over this document; it hard-codes nothing surface-specific. What IS necessarily code (documented at each site): the codex-toml-block marker-replace algorithm and its blank-line spacing, the width-aware vs always-expanded JSON array formatters themselves (a surface only picks a `jsonStyle` NAME), the meaning of the fixed `from` vocabulary (command/args/commandArgs; name/description/model/claude_model/cursor_model/tools), and the csv-list split transform — see mcp-render.ts / agent-render.ts headers.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["mcp", "agents"],
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": { "type": "string" },
|
|
10
|
+
"mcp": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"required": ["source", "surfaces"],
|
|
13
|
+
"additionalProperties": false,
|
|
14
|
+
"properties": {
|
|
15
|
+
"source": { "type": "string", "minLength": 1 },
|
|
16
|
+
"marker": { "type": "string", "minLength": 1 },
|
|
17
|
+
"surfaces": {
|
|
18
|
+
"type": "array",
|
|
19
|
+
"minItems": 1,
|
|
20
|
+
"items": { "$ref": "#/definitions/mcpSurface" }
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"agents": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"required": ["source", "surfaces"],
|
|
27
|
+
"additionalProperties": false,
|
|
28
|
+
"properties": {
|
|
29
|
+
"source": { "type": "string", "minLength": 1 },
|
|
30
|
+
"surfaces": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"minItems": 1,
|
|
33
|
+
"items": { "$ref": "#/definitions/agentSurface" }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"legacyLock": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"pattern": "^\\.[A-Za-z0-9_./-]+$",
|
|
40
|
+
"description": "Repo-relative path to the pre-agent-settings engine's own install lock (e.g. .agents/adl-repo.lock.json), if this repo may still carry one. When present, deploy takes over an agent file or lean-ctx file whose whole-file content hash matches that lock's files[<path>].sha256, an MCP server entry whose content hash matches merged[<mcp file>].entries[] at path [<containerKey>, <name>], the codex managed TOML block whose content hash matches toml[<codex file>].sha256, and .agents/.gitignore when its content equals that lock's gitignore[<path>].appended (or lines joined) text with created:true — instead of treating any of those as foreign. Optional: a profile with no legacy engine to migrate from omits it."
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"definitions": {
|
|
44
|
+
"mcpEntryField": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["key"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"key": { "type": "string", "minLength": 1 },
|
|
50
|
+
"from": { "type": "string", "enum": ["command", "args", "commandArgs"] },
|
|
51
|
+
"const": { "type": ["string", "boolean", "number"] }
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"mcpTopLevelField": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"required": ["key", "const"],
|
|
58
|
+
"properties": {
|
|
59
|
+
"key": { "type": "string", "minLength": 1 },
|
|
60
|
+
"const": { "type": ["string", "boolean", "number"] }
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"mcpTopLevelTable": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"additionalProperties": false,
|
|
66
|
+
"required": ["table", "fields"],
|
|
67
|
+
"properties": {
|
|
68
|
+
"table": { "type": "string", "minLength": 1 },
|
|
69
|
+
"fields": {
|
|
70
|
+
"type": "array",
|
|
71
|
+
"minItems": 1,
|
|
72
|
+
"items": { "$ref": "#/definitions/mcpTopLevelField" }
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"mcpSurface": {
|
|
77
|
+
"type": "object",
|
|
78
|
+
"required": ["name", "format", "file", "entry"],
|
|
79
|
+
"additionalProperties": false,
|
|
80
|
+
"properties": {
|
|
81
|
+
"name": { "type": "string", "minLength": 1 },
|
|
82
|
+
"format": { "type": "string", "enum": ["json", "toml-block"] },
|
|
83
|
+
"file": { "type": "string", "minLength": 1 },
|
|
84
|
+
"containerKey": { "type": "string", "minLength": 1 },
|
|
85
|
+
"jsonStyle": { "type": "string", "enum": ["width-aware", "expanded"] },
|
|
86
|
+
"tableKey": { "type": "string", "minLength": 1 },
|
|
87
|
+
"entry": {
|
|
88
|
+
"type": "array",
|
|
89
|
+
"minItems": 1,
|
|
90
|
+
"items": { "$ref": "#/definitions/mcpEntryField" }
|
|
91
|
+
},
|
|
92
|
+
"topLevel": {
|
|
93
|
+
"type": "array",
|
|
94
|
+
"minItems": 1,
|
|
95
|
+
"items": { "$ref": "#/definitions/mcpTopLevelTable" }
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"agentFrontMatterField": {
|
|
100
|
+
"type": "object",
|
|
101
|
+
"additionalProperties": false,
|
|
102
|
+
"required": ["key"],
|
|
103
|
+
"properties": {
|
|
104
|
+
"key": { "type": "string", "minLength": 1 },
|
|
105
|
+
"from": { "type": "string", "enum": ["name", "description", "model", "claude_model", "cursor_model", "tools"] },
|
|
106
|
+
"const": { "type": ["string", "boolean", "number"] },
|
|
107
|
+
"presentIf": { "type": "string", "enum": ["tools"] },
|
|
108
|
+
"style": { "type": "string", "enum": ["plain", "csv-list"] },
|
|
109
|
+
"fields": {
|
|
110
|
+
"type": "array",
|
|
111
|
+
"minItems": 1,
|
|
112
|
+
"items": { "$ref": "#/definitions/agentFrontMatterField" }
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"agentTomlField": {
|
|
117
|
+
"type": "object",
|
|
118
|
+
"additionalProperties": false,
|
|
119
|
+
"required": ["key", "from"],
|
|
120
|
+
"properties": {
|
|
121
|
+
"key": { "type": "string", "minLength": 1 },
|
|
122
|
+
"from": { "type": "string", "enum": ["name", "description", "model", "model_reasoning_effort", "sandbox_mode"] }
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"agentSurface": {
|
|
126
|
+
"type": "object",
|
|
127
|
+
"required": ["name", "format", "folder"],
|
|
128
|
+
"additionalProperties": false,
|
|
129
|
+
"properties": {
|
|
130
|
+
"name": { "type": "string", "minLength": 1 },
|
|
131
|
+
"format": { "type": "string", "enum": ["md", "toml"] },
|
|
132
|
+
"folder": { "type": "string", "pattern": "^\\.[A-Za-z0-9_.-]+/agents$" },
|
|
133
|
+
"frontMatter": {
|
|
134
|
+
"type": "array",
|
|
135
|
+
"minItems": 1,
|
|
136
|
+
"items": { "$ref": "#/definitions/agentFrontMatterField" }
|
|
137
|
+
},
|
|
138
|
+
"fields": {
|
|
139
|
+
"type": "array",
|
|
140
|
+
"minItems": 1,
|
|
141
|
+
"items": { "$ref": "#/definitions/agentTomlField" }
|
|
142
|
+
},
|
|
143
|
+
"bodyField": { "type": "string", "enum": ["developer_instructions"] }
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Managed baseline files (
|
|
1
|
+
# Managed baseline files (local repo first: no `adl hook` entries)
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Local repo first (Tarun, 2026-09-29): "adl is LOCAL REPO FIRST".**
|
|
4
4
|
"the repos where adl-config.toml does not exist has no business of running
|
|
5
5
|
hooks"; setting up Claude or Codex hooks globally "is incorrect". This
|
|
6
6
|
directory's two files no longer carry any `adl hook …` command — the
|
|
7
|
-
`adl.
|
|
7
|
+
`adl.run-required-for-writes` deny (`packages/agent-hooks/src/rules/impl/adl-run-required.ts`)
|
|
8
8
|
and every other rule now run ONLY from a repository's own per-repo carrier
|
|
9
9
|
(`.claude/settings.json`, `.codex/hooks.json`, `.cursor/hooks.json`,
|
|
10
10
|
`.opencode/plugins/adl-repo.ts`), written by `adl hooks deploy`
|
|
@@ -15,12 +15,12 @@ they no longer stop that per-repo carrier from running (see the "Locks"
|
|
|
15
15
|
citation further down). What each template still deploys machine-wide,
|
|
16
16
|
deliberately: the Claude worktree guard (`permissions.deny`, "Worktree guard
|
|
17
17
|
L2" below) and Orca's own reporting hooks (Tarun decides Orca's wiring
|
|
18
|
-
separately
|
|
18
|
+
separately; see "Orca" below).
|
|
19
19
|
|
|
20
|
-
**
|
|
20
|
+
**Tarun, 2026-09-29: the `lean-ctx hook observe`
|
|
21
21
|
session-lifecycle entries are REMOVED, everywhere adl manages them.**
|
|
22
22
|
"That's only for observation layer. We don't want to send any data to
|
|
23
|
-
remote."
|
|
23
|
+
remote." The local-repo-first rule had kept these five hooks wired here on the grounds
|
|
24
24
|
that `observe` had no per-repo carrier of its own; that tradeoff is now
|
|
25
25
|
retracted outright rather than replaced with one — see "lean-ctx `observe`
|
|
26
26
|
hooks (removed)" below for the full detail and every place this touched.
|
|
@@ -78,8 +78,8 @@ nobody reads and become the templates the installer renders from:
|
|
|
78
78
|
when the session env is absent, before ever reaching a no-identity
|
|
79
79
|
refusal — so surface parity for the *default* identity does not depend
|
|
80
80
|
on whether Codex honours `shell_environment_policy` at all. **Whether
|
|
81
|
-
Codex applies it remains UNCONFIRMED pending a live probe
|
|
82
|
-
|
|
81
|
+
Codex applies it remains UNCONFIRMED pending a live probe of plain
|
|
82
|
+
`codex`'s shell, hooks and MCP servers**; this file records that gap rather than assuming either answer.
|
|
83
83
|
What this `managed_config.toml` layer would still add, if honoured, is
|
|
84
84
|
only the env var being visible to a plain shell command Codex runs
|
|
85
85
|
directly — not the identity the hook or the MCP server resolve, since
|
|
@@ -89,14 +89,14 @@ nobody reads and become the templates the installer renders from:
|
|
|
89
89
|
|
|
90
90
|
`allowManagedHooksOnly` (Claude) / `allow_managed_hooks_only` (Codex, in
|
|
91
91
|
`codex-requirements.toml` only — the same key in `config.toml` does nothing)
|
|
92
|
-
is
|
|
92
|
+
is `false` in both templates (local-repo-first rule, Tarun, 2026-09-29):
|
|
93
93
|
set to `true`, it made each hook file fail-closed — a repository's own
|
|
94
94
|
`.claude/settings.json` or user-level Codex config could not add a hook that
|
|
95
95
|
overrides or removes a `PreToolUse` entry here. With no `adl hook` entry
|
|
96
96
|
left in either template, the lock's only remaining effect would have been to
|
|
97
97
|
stop the per-repo carrier (`adl hooks deploy` writes `.claude/settings.json`
|
|
98
|
-
/ `.codex/hooks.json`) from running at all — exactly what
|
|
99
|
-
|
|
98
|
+
/ `.codex/hooks.json`) from running at all — exactly what the local-repo-first
|
|
99
|
+
rule forbids. Both the lock's semantics and its install paths are
|
|
100
100
|
CONFIRMED from official docs (fetched 2026-09-27, re-confirmed 2026-09-29):
|
|
101
101
|
|
|
102
102
|
- Claude, <https://code.claude.com/docs/en/settings-reference>: `env` —
|
|
@@ -138,23 +138,23 @@ the render is left untouched; anything else (missing, stale, hand-edited) is
|
|
|
138
138
|
atomically replaced.
|
|
139
139
|
|
|
140
140
|
`packages/agent-settings/tests/managed-artifacts.test.ts` parses the two
|
|
141
|
-
templates in this directory and asserts the
|
|
141
|
+
templates in this directory and asserts the local-repo-first shape: the lockdown
|
|
142
142
|
key is `false` in both, and neither template contains the string `adl hook`
|
|
143
143
|
anywhere — `PreToolUse`/`PostToolUse` each carry only the Orca conditional
|
|
144
144
|
hook now (see "Orca" below). `adl hook pre-tool-use --host=kimi` (and the
|
|
145
145
|
rest of Kimi's eight commands) still run from `packages/agent-settings/src/kimi-hooks.ts`'s
|
|
146
|
-
own global `~/.kimi-code/config.toml` carrier, UNCHANGED by
|
|
146
|
+
own global `~/.kimi-code/config.toml` carrier, UNCHANGED by the local-repo-first rule —
|
|
147
147
|
Kimi genuinely has no per-repo hook configuration (confirmed from Kimi's own
|
|
148
148
|
docs, see `docs/architecture/cli-design.md` §2), so its carrier stays global
|
|
149
149
|
by necessity, not by the same "managed baseline" design this directory's two
|
|
150
150
|
files used to implement. `adl hook` is the old standalone `enact-hook`
|
|
151
|
-
binary, folded into the one `adl` binary (
|
|
152
|
-
docs/
|
|
151
|
+
binary, folded into the one `adl` binary (the P4 hard cut,
|
|
152
|
+
docs/architecture/cli-design.md §7): there is no `enact-hook`
|
|
153
153
|
executable on the fleet any more, hard cut, no compat shim.
|
|
154
154
|
|
|
155
155
|
The `adl hook pre-tool-use --host=<claude|codex>` guard and the catch-all
|
|
156
156
|
`adl hook lean-ctx <pre|post>-tool-use --host=<claude|codex>` hooks that used
|
|
157
|
-
to live in this directory's two templates are REMOVED (
|
|
157
|
+
to live in this directory's two templates are REMOVED (local repo first): they
|
|
158
158
|
now run only from a repository's own per-repo carrier
|
|
159
159
|
(`packages/agent-hooks/deploy-profile.json`, written by `adl hooks deploy`),
|
|
160
160
|
which already wires the same commands — `rg -c 'adl hook' .claude/settings.json
|
|
@@ -174,7 +174,7 @@ or `/etc` paths.
|
|
|
174
174
|
|
|
175
175
|
This is the ONE machine-level, non-overridable lever any of the researched
|
|
176
176
|
surfaces has for worktree creation specifically
|
|
177
|
-
(`docs/
|
|
177
|
+
(`docs/research/research-2026-09-27-worktree-controls-per-surface.md`, "Bottom line
|
|
178
178
|
for the fleet"). Managed settings rank above every user/project/local source,
|
|
179
179
|
so a repository's own `.claude/settings.json` cannot loosen this. Syntax
|
|
180
180
|
CONFIRMED from code.claude.com/docs/en/permissions (fetched 2026-09-27):
|
|
@@ -213,14 +213,14 @@ blocker for L2 today.
|
|
|
213
213
|
|
|
214
214
|
## lean-ctx `observe` hooks (removed)
|
|
215
215
|
|
|
216
|
-
**
|
|
216
|
+
**Tarun, 2026-09-29: REMOVED, everywhere adl
|
|
217
217
|
manages them.** "That's only for observation layer. We don't want to send
|
|
218
218
|
any data to remote." Both templates used to wire five session-lifecycle
|
|
219
219
|
events — `SessionStart`, `SessionEnd`, `Stop`, `PreCompact`,
|
|
220
220
|
`UserPromptSubmit` — each matcher `".*"`, each calling
|
|
221
221
|
`/usr/local/bin/lean-ctx hook observe` **directly**, with no `adl hook`/
|
|
222
222
|
`--host=` wrapper, added 2026-09-27 for parity with Tarun's then-live
|
|
223
|
-
`~/.claude/settings.json`.
|
|
223
|
+
`~/.claude/settings.json`. The local-repo-first rule (above) had kept these wired
|
|
224
224
|
regardless of `allowManagedHooksOnly`/`allow_managed_hooks_only` on the
|
|
225
225
|
grounds that `observe` had no per-repo carrier of its own on any surface —
|
|
226
226
|
that tradeoff is now retracted outright, not replaced with a carrier: no
|
|
@@ -228,14 +228,14 @@ surface wires `observe` from this repo any more.
|
|
|
228
228
|
|
|
229
229
|
`SessionStart`/`Stop`/`UserPromptSubmit` keep their Orca conditional hook,
|
|
230
230
|
now the only entry on each (same one-group shape `PreToolUse`/`PostToolUse`
|
|
231
|
-
already had after
|
|
231
|
+
already had after the local-repo-first rule). `PreCompact` (both hosts) and Codex's
|
|
232
232
|
`SessionEnd` — neither in Tarun's Orca event lists — carried `observe`
|
|
233
233
|
alone and now have no key/`[[hooks.*]]` entry at all, rather than being left
|
|
234
234
|
as an empty array. `packages/agent-settings/tests/managed-artifacts.test.ts`
|
|
235
235
|
covers the new shape, including a standing assertion that no managed
|
|
236
236
|
artifact's hook commands contain the string `hook observe` anywhere.
|
|
237
237
|
|
|
238
|
-
`
|
|
238
|
+
`packages/fleet/scripts/fleet-cutover.sh`'s `strip_user_lean_ctx_hooks`
|
|
239
239
|
(successor of the retired `m3-cutover.sh`) still strips any leftover
|
|
240
240
|
per-user `lean-ctx hook observe` entry from `~/.claude/settings.json` —
|
|
241
241
|
previously framed as "redundant once the managed baseline installs", now
|
|
@@ -243,14 +243,13 @@ simply "the hook Tarun retracted, wherever it is still found" (backing the
|
|
|
243
243
|
file up to that run's own backup folder first); its behaviour and tests are
|
|
244
244
|
unchanged by this removal, only its rationale.
|
|
245
245
|
|
|
246
|
-
## Orca (
|
|
246
|
+
## Orca ("Orca allowed for adl")
|
|
247
247
|
|
|
248
248
|
Tarun, 2026-09-27: "keep the orca hooks, let orca manage it, orca is allowed
|
|
249
249
|
for adl" — of the options considered, the one built is **the MANAGED layer
|
|
250
|
-
calls Orca**. This is unaffected by
|
|
250
|
+
calls Orca**. This is unaffected by the local-repo-first rule (2026-09-29,
|
|
251
251
|
`allowManagedHooksOnly` / `allow_managed_hooks_only` now `false`): Orca's own
|
|
252
|
-
wiring here is a separate decision Tarun makes independently
|
|
253
|
-
12d), and the question below was only whether Orca's own report-only hooks
|
|
252
|
+
wiring here is a separate decision Tarun makes independently, and the question below was only whether Orca's own report-only hooks
|
|
254
253
|
keep running, never about the lock's value.
|
|
255
254
|
|
|
256
255
|
Orca (`/Applications/Orca.app`) installs its own user-level hooks that call
|
|
@@ -262,14 +261,14 @@ report-only: they read the event JSON on stdin, POST it to Orca on
|
|
|
262
261
|
prints `{}` up front. Neither script does anything unless
|
|
263
262
|
`ORCA_PANE_KEY`/`ORCA_AGENT_HOOK_PORT`/`ORCA_AGENT_HOOK_TOKEN` are already set
|
|
264
263
|
in the environment (Orca sets these itself when it launches a pane). Before
|
|
265
|
-
|
|
264
|
+
the local-repo-first rule, once `allowManagedHooksOnly`/`allow_managed_hooks_only` locked a
|
|
266
265
|
host to this directory's templates, Orca's own user-level `hooks` entries in
|
|
267
266
|
`~/.claude/settings.json` / `~/.codex/hooks.json` stopped running fleet-wide —
|
|
268
267
|
exactly the same per-user gap the lean-ctx catch-alls and `observe` hooks
|
|
269
268
|
above already had to close, so the managed layer called Orca itself instead.
|
|
270
269
|
The lock is now `false`, but Orca's own user-level `hooks` entries are a
|
|
271
270
|
SEPARATE per-user config source from a repository's `adl hooks deploy`
|
|
272
|
-
carrier either way — nothing about
|
|
271
|
+
carrier either way — nothing about the local-repo-first rule reintroduces a route for
|
|
273
272
|
Orca's own wiring to run on its own, so this managed layer keeps calling
|
|
274
273
|
Orca directly, unchanged.
|
|
275
274
|
|
|
@@ -292,9 +291,9 @@ sh -c 'h="$HOME/.orca/agent-hooks/claude-hook.sh"; if [ -f "$h" ] && [ -r "$h" ]
|
|
|
292
291
|
|
|
293
292
|
Historically, for an event that already carried an adl/lean-ctx or `observe`
|
|
294
293
|
hook, the Orca entry was **added after** the existing ones, in the same
|
|
295
|
-
array — never replacing or reordering them.
|
|
296
|
-
guard and lean-ctx catch-alls from `PreToolUse`/`PostToolUse`, and
|
|
297
|
-
|
|
294
|
+
array — never replacing or reordering them. The local-repo-first rule removed the adl
|
|
295
|
+
guard and lean-ctx catch-alls from `PreToolUse`/`PostToolUse`, and Tarun
|
|
296
|
+
(2026-09-29) then removed `observe` from
|
|
298
297
|
`SessionStart`/`SessionEnd`/`Stop`/`UserPromptSubmit` too — so every event on
|
|
299
298
|
Tarun's Orca lists now carries the Orca entry as its ONLY hook, one group,
|
|
300
299
|
matcher `".*"`. `PreCompact` (Claude) and `PreCompact`/`SessionEnd` (Codex)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# The managed baseline hook (docs/architecture/cli-design.md §2/§3).
|
|
2
2
|
#
|
|
3
3
|
# This is the committed TEMPLATE. `bin/reconcile`
|
|
4
4
|
# (packages/fleet/src/managed-settings.ts, bin/managed-settings) installs it
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
# per-device-rendered managed_config.toml that carries
|
|
9
9
|
# shell_environment_policy.set.
|
|
10
10
|
#
|
|
11
|
-
#
|
|
11
|
+
# Local repo first (Tarun, 2026-09-29): "adl is LOCAL REPO FIRST …
|
|
12
12
|
# the repos where adl-config.toml does not exist has no business of running
|
|
13
13
|
# hooks"; setting up Codex hooks globally "is incorrect". `adl hook …` is
|
|
14
14
|
# therefore NOT wired from this machine-global layer any more — Codex's own
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
# `allow_managed_hooks_only` is Codex's fail-closed equivalent of Claude
|
|
30
30
|
# Code's `allowManagedHooksOnly`: set to `true` it made a repository or user
|
|
31
31
|
# Codex config unable to add a hook that overrides or removes ones wired
|
|
32
|
-
# here.
|
|
32
|
+
# here. It is `false` here: with no `adl hook` entries left in
|
|
33
33
|
# this file to protect, the lock's only remaining effect was to make a
|
|
34
34
|
# repository's own `.codex/hooks.json` — the carrier `adl hooks deploy`
|
|
35
35
|
# writes — silently not run. Per
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
# layer does not lock hooks, so the per-repo carrier is the one that runs.
|
|
41
41
|
allow_managed_hooks_only = false
|
|
42
42
|
|
|
43
|
-
# Orca wiring (
|
|
43
|
+
# Orca wiring (Tarun 2026-09-27: "keep the orca hooks,
|
|
44
44
|
# let orca manage it, orca is allowed for adl" -- the MANAGED layer calls
|
|
45
45
|
# Orca). Orca (/Applications/Orca.app) installs its own user-level hooks
|
|
46
46
|
# calling `~/.orca/agent-hooks/codex-hook.sh`, a report-only script (reads
|
|
@@ -49,8 +49,8 @@ allow_managed_hooks_only = false
|
|
|
49
49
|
# ORCA_AGENT_HOOK_TOKEN are set) -- read verbatim as part of this change.
|
|
50
50
|
# This entry is Orca's own global reporting hook, unrelated to
|
|
51
51
|
# `allow_managed_hooks_only`/the adl per-repo carrier above — kept exactly as
|
|
52
|
-
# it was; Tarun decides Orca's own wiring separately
|
|
53
|
-
#
|
|
52
|
+
# it was; Tarun decides Orca's own wiring separately, so it stays global.
|
|
53
|
+
# `$HOME`, never a hard-coded `/Users` path.
|
|
54
54
|
# Does nothing (exit 0, no output) when the script is absent or not
|
|
55
55
|
# executable.
|
|
56
56
|
[[hooks.PreToolUse]]
|
|
@@ -60,7 +60,7 @@ hooks = [{ type = "command", command = "sh -c 'h=\"$HOME/.orca/agent-hooks/codex
|
|
|
60
60
|
hooks = [{ type = "command", command = "sh -c 'h=\"$HOME/.orca/agent-hooks/codex-hook.sh\"; if [ -f \"$h\" ] && [ -r \"$h\" ] && [ -x \"$h\" ]; then exec \"$h\"; else cat >/dev/null 2>&1 || :; fi'" }]
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
# lean-ctx `observe` hooks: REMOVED (
|
|
63
|
+
# lean-ctx `observe` hooks: REMOVED (Tarun,
|
|
64
64
|
# 2026-09-29 — "That's only for observation layer. We don't want to send any
|
|
65
65
|
# data to remote."). These five session-lifecycle hooks (SessionStart,
|
|
66
66
|
# SessionEnd, Stop, PreCompact, UserPromptSubmit), added 2026-09-27 for
|
|
@@ -84,13 +84,13 @@ hooks = [{ type = "command", command = "sh -c 'h=\"$HOME/.orca/agent-hooks/codex
|
|
|
84
84
|
matcher = ".*"
|
|
85
85
|
hooks = [{ type = "command", command = "sh -c 'h=\"$HOME/.orca/agent-hooks/codex-hook.sh\"; if [ -f \"$h\" ] && [ -r \"$h\" ] && [ -x \"$h\" ]; then exec \"$h\"; else cat >/dev/null 2>&1 || :; fi'" }]
|
|
86
86
|
|
|
87
|
-
# Orca events with no prior adl/lean-ctx hook:
|
|
87
|
+
# Orca events with no prior adl/lean-ctx hook: Tarun's Orca list names these
|
|
88
88
|
# among Codex's 8 (SessionStart, UserPromptSubmit, PreToolUse,
|
|
89
89
|
# PermissionRequest, PostToolUse, SubagentStart, SubagentStop, Stop) — the
|
|
90
90
|
# Orca entry is simply the sole hook for the event, same conditional
|
|
91
91
|
# $HOME-gated command as above. `PreCompact` and `SessionEnd` are NOT in
|
|
92
92
|
# Tarun's 8-event list and no longer carry a `lean-ctx observe` hook either
|
|
93
|
-
# (
|
|
93
|
+
# (removed 2026-09-29), so neither has any
|
|
94
94
|
# `[[hooks.*]]` entry left at all.
|
|
95
95
|
[[hooks.PermissionRequest]]
|
|
96
96
|
matcher = ".*"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@adl/agent-settings",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Machine-global agent surface tooling (sweep, global-agents, kimi-hooks, surface-policy) run by the fleet bin wrappers under bun; also holds GLOBAL-AGENTS.md, surface policy, and the protected list. Subagent definitions (Claude/Codex/Cursor/Kimi/OpenCode) are canonical in packages/agent-skills/extensions/adl-factory/agents/*.toml and projected per repo by that package's installer; this package does not generate or hold its own copy.",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"typecheck": "tsc --noEmit",
|
|
9
|
+
"test": "bun test --coverage",
|
|
10
|
+
"check": "bun run typecheck && bun run test --coverage"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@iarna/toml": "^2.2.5",
|
|
14
|
+
"ajv": "^8.17.1"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"typescript": "5.9.3",
|
|
18
|
+
"@types/bun": "latest"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -60,7 +60,7 @@ function renderFrontMatterField(field: AgentFrontMatterField, def: AgentDef, ind
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/** `---\n<front matter>\n---\n\n<body>` — the YAML front-matter wrapper is structural (inherent to Markdown front matter), not a per-surface value, so it stays here; every LINE inside it comes from `surface.frontMatter`. */
|
|
63
|
-
|
|
63
|
+
function renderAgentMd(surface: AgentSurface, def: AgentDef): string {
|
|
64
64
|
const lines = (surface.frontMatter ?? []).flatMap((field) => renderFrontMatterField(field, def, ""));
|
|
65
65
|
return `---\n${lines.join("\n")}\n---\n\n${def.developerInstructions}`;
|
|
66
66
|
}
|
|
@@ -76,7 +76,7 @@ function resolveTomlField(field: AgentTomlField, def: AgentDef): string {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
/** Flat `key = "value"` lines plus one `bodyField = """..."""` block. The `key = value` / triple-quoted-string TEXT FORMAT is structural (inherent to TOML), not a per-surface value; which keys exist and their order come from `surface.fields`. */
|
|
79
|
-
|
|
79
|
+
function renderAgentToml(surface: AgentSurface, def: AgentDef): string {
|
|
80
80
|
const fields = surface.fields ?? [];
|
|
81
81
|
const lines = fields.map((field) => `${field.key} = ${tomlBasicString(resolveTomlField(field, def))}`);
|
|
82
82
|
const bodyKey = surface.bodyField ?? "developer_instructions";
|
|
@@ -36,7 +36,7 @@ function optionalString(doc: Record<string, unknown>, key: string): string | und
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/** Parses one source agent TOML file's text. Throws (fails loud) if a required key is missing, developer_instructions isn't a string, or the text is not valid TOML. */
|
|
39
|
-
|
|
39
|
+
function parseAgentToml(text: string, sourcePath: string): AgentDef {
|
|
40
40
|
let doc: unknown;
|
|
41
41
|
try {
|
|
42
42
|
doc = TOML.parse(text);
|
|
@@ -27,7 +27,7 @@ export interface DeployAgentsOptions {
|
|
|
27
27
|
readonly dryRun?: boolean;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
interface AgentConflict {
|
|
31
31
|
readonly folder: string;
|
|
32
32
|
readonly agent: string;
|
|
33
33
|
readonly reason: string;
|
|
@@ -38,6 +38,8 @@ export interface DeployAgentsResult {
|
|
|
38
38
|
readonly unchanged: readonly string[];
|
|
39
39
|
readonly removed: readonly string[];
|
|
40
40
|
readonly conflicts: readonly AgentConflict[];
|
|
41
|
+
/** Unlocked same-name agent files whose content was exactly what deploy renders: taken over and locked, never a conflict. */
|
|
42
|
+
readonly adopted: readonly string[];
|
|
41
43
|
readonly lockPath: string;
|
|
42
44
|
}
|
|
43
45
|
|
|
@@ -64,6 +66,7 @@ export function deployAgents(options: DeployAgentsOptions): DeployAgentsResult {
|
|
|
64
66
|
const unchanged: string[] = [];
|
|
65
67
|
const removed: string[] = [];
|
|
66
68
|
const conflicts: AgentConflict[] = [];
|
|
69
|
+
const adopted: string[] = [];
|
|
67
70
|
const legacyFileRemovals: string[] = [];
|
|
68
71
|
let anyLegacyTakeover = false;
|
|
69
72
|
|
|
@@ -83,12 +86,22 @@ export function deployAgents(options: DeployAgentsOptions): DeployAgentsResult {
|
|
|
83
86
|
anyLegacyTakeover = true;
|
|
84
87
|
}
|
|
85
88
|
|
|
89
|
+
const content = renderAgent(surface, def);
|
|
90
|
+
|
|
91
|
+
// Tarun, 2026-10-01: an unrecorded file byte-identical to what deploy
|
|
92
|
+
// renders holds no user content: adopt it (it is locked below via
|
|
93
|
+
// `kept`), the same rule as lean-ctx's adoptUnmarkedManagedText. A
|
|
94
|
+
// file that differs at all stays a conflict.
|
|
95
|
+
if (exists && !managedByUs && readFileSync(absPath, "utf8") === content) {
|
|
96
|
+
managedByUs = true;
|
|
97
|
+
adopted.push(relPath);
|
|
98
|
+
}
|
|
99
|
+
|
|
86
100
|
if (exists && !managedByUs) {
|
|
87
101
|
conflicts.push({ folder: surface.folder, agent: def.name, reason: "a user-owned agent file already exists with this name; deploy left it untouched" });
|
|
88
102
|
continue;
|
|
89
103
|
}
|
|
90
104
|
|
|
91
|
-
const content = renderAgent(surface, def);
|
|
92
105
|
if (exists && readFileSync(absPath, "utf8") === content) {
|
|
93
106
|
unchanged.push(relPath);
|
|
94
107
|
} else {
|
|
@@ -113,7 +126,7 @@ export function deployAgents(options: DeployAgentsOptions): DeployAgentsResult {
|
|
|
113
126
|
newAgentEntries[surface.folder] = kept.sort();
|
|
114
127
|
}
|
|
115
128
|
|
|
116
|
-
if (!dryRun) writeLock(targetRepo, { schema: 1, mcp: lock.mcp, agents: newAgentEntries
|
|
129
|
+
if (!dryRun) writeLock(targetRepo, { schema: 1, mcp: lock.mcp, agents: newAgentEntries });
|
|
117
130
|
|
|
118
131
|
// Once anything was actually taken over, this package's own footprint in
|
|
119
132
|
// the legacy lock's `files` section for these exact agent paths is stale:
|
|
@@ -129,6 +142,7 @@ export function deployAgents(options: DeployAgentsOptions): DeployAgentsResult {
|
|
|
129
142
|
unchanged: unchanged.sort(),
|
|
130
143
|
removed: removed.sort(),
|
|
131
144
|
conflicts: conflicts.sort((a, b) => `${a.folder}/${a.agent}`.localeCompare(`${b.folder}/${b.agent}`)),
|
|
145
|
+
adopted: adopted.sort(),
|
|
132
146
|
lockPath: join(targetRepo, ".agents/agent-settings.lock.json"),
|
|
133
147
|
};
|
|
134
148
|
}
|
|
@@ -12,14 +12,13 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
12
12
|
import { join } from "node:path";
|
|
13
13
|
import { extensionFor, renderAgent } from "./agent-render.js";
|
|
14
14
|
import { loadAgentSources, type AgentDef } from "./agent-toml.js";
|
|
15
|
-
import {
|
|
16
|
-
import { agentOwned, leanCtxOwned, mcpServerOwned, readLock, type SettingsLock } from "./lock.js";
|
|
15
|
+
import { readLock, type SettingsLock } from "./lock.js";
|
|
17
16
|
import { readDeployedMcpServerNames, readDeployedMcpServerValue } from "./mcp-inspect.js";
|
|
18
17
|
import { renderMcpJsonEntry } from "./mcp-render.js";
|
|
19
18
|
import { loadMcpSource, type McpServerSpec } from "./mcp-source.js";
|
|
20
19
|
import { type DeployProfile, loadProfile } from "./profile.js";
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
interface DoctorIssue {
|
|
23
22
|
readonly severity: "error" | "info";
|
|
24
23
|
readonly path: string;
|
|
25
24
|
readonly reason: string;
|
|
@@ -150,88 +149,9 @@ export function doctorAgents(options: DoctorAgentsOptions): DoctorResult {
|
|
|
150
149
|
return toResult(issues);
|
|
151
150
|
}
|
|
152
151
|
|
|
153
|
-
export interface DoctorLeanCtxOptions {
|
|
154
|
-
readonly assetsDir: string;
|
|
155
|
-
readonly targetRepo: string;
|
|
156
|
-
readonly profile?: DeployProfile;
|
|
157
|
-
readonly lock?: SettingsLock;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export function doctorLeanCtx(options: DoctorLeanCtxOptions): DoctorResult {
|
|
161
|
-
const profile = options.profile ?? loadProfile();
|
|
162
|
-
if (profile.leanCtx === undefined) {
|
|
163
|
-
throw new Error("deploy profile has no leanCtx section");
|
|
164
|
-
}
|
|
165
|
-
const lock = options.lock ?? readLock(options.targetRepo);
|
|
166
|
-
const issues: DoctorIssue[] = [];
|
|
167
|
-
const lockOwnedTargets = new Set(Object.keys(lock.leanCtx).filter((target) => lock.leanCtx[target] === true));
|
|
168
|
-
|
|
169
|
-
for (const file of profile.leanCtx.files) {
|
|
170
|
-
const assetAbs = join(options.assetsDir, file.asset);
|
|
171
|
-
const targetAbs = join(options.targetRepo, file.target);
|
|
172
|
-
const exists = existsSync(targetAbs);
|
|
173
|
-
const ownedByUs = leanCtxOwned(lock, file.target);
|
|
174
|
-
|
|
175
|
-
if (!exists) {
|
|
176
|
-
issues.push({ severity: "error", path: file.target, reason: ownedByUs ? "deploy-written lean-ctx file is missing from the target repo" : "expected lean-ctx file has not been deployed" });
|
|
177
|
-
continue;
|
|
178
|
-
}
|
|
179
|
-
// Independent review, 2026-09-30, finding 6: .gitignore is exempted
|
|
180
|
-
// from this early conflict the same way deploy itself now is — a
|
|
181
|
-
// markerless, never-adl-written .agents/.gitignore is not a hard
|
|
182
|
-
// conflict; resolveGitignoreWrite's own append-not-conflict migration
|
|
183
|
-
// decides it below instead (mirrors lean-ctx-deploy.ts's own guard).
|
|
184
|
-
if (!ownedByUs && file.asset !== "gitignore") {
|
|
185
|
-
issues.push({ severity: "error", path: file.target, reason: "a user-owned file conflicts with a lean-ctx asset path; not managed by deploy" });
|
|
186
|
-
continue;
|
|
187
|
-
}
|
|
188
|
-
const expected = readFileSync(assetAbs, "utf8");
|
|
189
|
-
const current = readFileSync(targetAbs, "utf8");
|
|
190
|
-
// Same merge-contract analysis deploy itself uses (lean-ctx-merge.ts):
|
|
191
|
-
// a user addition outside the managed block alone is not drift; a
|
|
192
|
-
// changed/removed/malformed managed block, or a duplicate key, is.
|
|
193
|
-
if (current !== expected) {
|
|
194
|
-
const outcome =
|
|
195
|
-
file.asset === "config.toml"
|
|
196
|
-
? resolveConfigTomlWrite(expected, current, ownedByUs)
|
|
197
|
-
: file.asset === "gitignore"
|
|
198
|
-
? resolveGitignoreWrite(expected, current, ownedByUs)
|
|
199
|
-
: resolveLeanCtxWrite(expected, current, ownedByUs);
|
|
200
|
-
if (outcome.action === "write") {
|
|
201
|
-
// Tarun, 2026-09-30 (merge-contract correction, same day):
|
|
202
|
-
// "adl-owned entries SELF-HEAL" — when the drift is specifically
|
|
203
|
-
// an adl-owned scalar restored to adl's own value, name it
|
|
204
|
-
// explicitly here too, the same way a healed hook is named
|
|
205
|
-
// ("restored … local changes replaced"), instead of the generic
|
|
206
|
-
// "modified since deploy" wording.
|
|
207
|
-
if (outcome.restoredScalars !== undefined && outcome.restoredScalars.length > 0) {
|
|
208
|
-
for (const scalar of outcome.restoredScalars) {
|
|
209
|
-
issues.push({
|
|
210
|
-
severity: "error",
|
|
211
|
-
path: file.target,
|
|
212
|
-
reason: `restored adl value: ${scalar.key} = ${JSON.stringify(scalar.value)} (was ${JSON.stringify(scalar.previous)}); run deploy to apply`,
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
} else {
|
|
216
|
-
issues.push({ severity: "error", path: file.target, reason: "deploy-written lean-ctx file was modified since deploy" });
|
|
217
|
-
}
|
|
218
|
-
} else if (outcome.action === "conflict") {
|
|
219
|
-
issues.push({ severity: "error", path: file.target, reason: outcome.reason });
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
for (const target of lockOwnedTargets) {
|
|
225
|
-
if (profile.leanCtx.files.some((f) => f.target === target)) continue;
|
|
226
|
-
issues.push({ severity: "error", path: target, reason: "deploy-written lean-ctx file is no longer in the deploy profile; run deploy to remove it" });
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
return toResult(issues);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
152
|
export function mergeDoctorResults(results: readonly DoctorResult[]): DoctorResult {
|
|
233
153
|
const issues = results.flatMap((r) => r.issues);
|
|
234
154
|
return toResult(issues);
|
|
235
155
|
}
|
|
236
156
|
|
|
237
|
-
|
|
157
|
+
;
|