@amsterdamdatalabs/adl-agent-control-darwin-arm64 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/adl +4 -0
- package/bin/cursor-settings +14 -0
- package/bin/default-agent-file +14 -0
- package/bin/git +670 -0
- package/bin/git-ado +425 -0
- package/bin/global-agents +14 -0
- package/bin/global-surface-sweep +14 -0
- package/bin/health-check +38 -0
- package/bin/kimi-hooks +14 -0
- package/bin/lean-ctx-observe-strip +361 -0
- package/bin/lib/bun-compile-build.sh +34 -0
- package/bin/lib/lean-ctx-observe-hooks.sh +634 -0
- package/bin/managed-settings +14 -0
- package/bin/opencode-hooks +14 -0
- package/bin/reconcile +2648 -0
- package/bin/scratch-reap +14 -0
- package/bin/shell-path-policy +64 -0
- package/bin/surface-policy +14 -0
- package/bin/sync-and-reconcile +215 -0
- package/bin/update-azure-agent-pool +29 -0
- package/bin/validate-manifest +171 -0
- package/bin/vscode-settings +14 -0
- package/package.json +44 -0
- package/packages/agent-hooks/README.md +411 -0
- package/packages/agent-hooks/assets/hooks.json +97 -0
- package/packages/agent-hooks/assets/opencode-plugin.template.ts +224 -0
- package/packages/agent-hooks/bunfig.toml +27 -0
- package/packages/agent-hooks/deploy-profile.json +53 -0
- package/packages/agent-hooks/deploy-profile.schema.json +120 -0
- package/packages/agent-hooks/package.json +23 -0
- package/packages/agent-hooks/src/cli/args.ts +99 -0
- package/packages/agent-hooks/src/cli/doctor.ts +241 -0
- package/packages/agent-hooks/src/cli/rules.ts +133 -0
- package/packages/agent-hooks/src/deploy/deploy.ts +181 -0
- package/packages/agent-hooks/src/deploy/doctor.ts +158 -0
- package/packages/agent-hooks/src/deploy/index.ts +17 -0
- package/packages/agent-hooks/src/deploy/json-merge.ts +115 -0
- package/packages/agent-hooks/src/deploy/legacy-lock.ts +213 -0
- package/packages/agent-hooks/src/deploy/list.ts +117 -0
- package/packages/agent-hooks/src/deploy/lock.ts +65 -0
- package/packages/agent-hooks/src/deploy/opencode-template.ts +74 -0
- package/packages/agent-hooks/src/deploy/profile.ts +117 -0
- package/packages/agent-hooks/src/deploy/render.ts +162 -0
- package/packages/agent-hooks/src/deploy/source.ts +84 -0
- package/packages/agent-hooks/src/gating/config.ts +514 -0
- package/packages/agent-hooks/src/gating/root.ts +117 -0
- package/packages/agent-hooks/src/hooks/briefing/handler.ts +22 -0
- package/packages/agent-hooks/src/hooks/briefing/index.ts +320 -0
- package/packages/agent-hooks/src/hooks/contract.ts +112 -0
- package/packages/agent-hooks/src/hooks/crg/handler.ts +22 -0
- package/packages/agent-hooks/src/hooks/crg/index.ts +209 -0
- package/packages/agent-hooks/src/hooks/lean-ctx/handler.ts +22 -0
- package/packages/agent-hooks/src/hooks/lean-ctx/index.ts +173 -0
- package/packages/agent-hooks/src/hooks/lean-ctx/mapping.ts +121 -0
- package/packages/agent-hooks/src/hooks/lean-ctx/scope-rewrite.ts +207 -0
- package/packages/agent-hooks/src/hooks/log.ts +233 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/config.ts +58 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/constants.ts +149 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/handler.ts +72 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/index.ts +203 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/match.ts +212 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/skill-roots.ts +73 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/skills.ts +98 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/tokenizer.ts +115 -0
- package/packages/agent-hooks/src/hooks/user-prompt-submit/vector.ts +174 -0
- package/packages/agent-hooks/src/hosts/impl/claude.ts +47 -0
- package/packages/agent-hooks/src/hosts/impl/codex.ts +47 -0
- package/packages/agent-hooks/src/hosts/impl/cursor.ts +40 -0
- package/packages/agent-hooks/src/hosts/impl/kimi.ts +47 -0
- package/packages/agent-hooks/src/hosts/impl/opencode.ts +54 -0
- package/packages/agent-hooks/src/hosts/registry.ts +29 -0
- package/packages/agent-hooks/src/hosts/spec.ts +113 -0
- package/packages/agent-hooks/src/lean-ctx/env.ts +106 -0
- package/packages/agent-hooks/src/lean-ctx/mcp.ts +140 -0
- package/packages/agent-hooks/src/lib/spawn-with-timeout.ts +120 -0
- package/packages/agent-hooks/src/log/writer.ts +230 -0
- package/packages/agent-hooks/src/main.ts +269 -0
- package/packages/agent-hooks/src/pre-tool-use/handler.ts +549 -0
- package/packages/agent-hooks/src/rules/engine.ts +293 -0
- package/packages/agent-hooks/src/rules/impl/adl-build-run-denied.ts +51 -0
- package/packages/agent-hooks/src/rules/impl/adl-git-credential-bypass.ts +320 -0
- package/packages/agent-hooks/src/rules/impl/adl-git-identity.ts +249 -0
- package/packages/agent-hooks/src/rules/impl/adl-git-push-policy.ts +258 -0
- package/packages/agent-hooks/src/rules/impl/adl-human-azdo-bypass.ts +731 -0
- package/packages/agent-hooks/src/rules/impl/adl-identity.ts +128 -0
- package/packages/agent-hooks/src/rules/impl/adl-mcp-cli.ts +179 -0
- package/packages/agent-hooks/src/rules/impl/adl-pr-complete-pending.ts +65 -0
- package/packages/agent-hooks/src/rules/impl/adl-pr-review-role.ts +156 -0
- package/packages/agent-hooks/src/rules/impl/adl-pr-role.ts +121 -0
- package/packages/agent-hooks/src/rules/impl/adl-session-required.ts +403 -0
- package/packages/agent-hooks/src/rules/impl/adl-token-minting-role.ts +92 -0
- package/packages/agent-hooks/src/rules/impl/adl-workitem-role.ts +74 -0
- package/packages/agent-hooks/src/rules/impl/advisory-coverage.ts +43 -0
- package/packages/agent-hooks/src/rules/impl/advisory-finder.ts +62 -0
- package/packages/agent-hooks/src/rules/impl/agent-secrets-stay-unread.ts +173 -0
- package/packages/agent-hooks/src/rules/impl/agent-tamper-protection.ts +508 -0
- package/packages/agent-hooks/src/rules/impl/fs-canonical-checkout.ts +86 -0
- package/packages/agent-hooks/src/rules/impl/fs-git-internals.ts +75 -0
- package/packages/agent-hooks/src/rules/impl/fs-mv.ts +66 -0
- package/packages/agent-hooks/src/rules/impl/fs-rm.ts +83 -0
- package/packages/agent-hooks/src/rules/impl/fs-trash.ts +140 -0
- package/packages/agent-hooks/src/rules/impl/git-core.ts +101 -0
- package/packages/agent-hooks/src/rules/impl/git-helpers.ts +408 -0
- package/packages/agent-hooks/src/rules/impl/git-history.ts +77 -0
- package/packages/agent-hooks/src/rules/impl/git-paths.ts +139 -0
- package/packages/agent-hooks/src/rules/impl/git-plumbing.ts +167 -0
- package/packages/agent-hooks/src/rules/impl/git-protected-tree.ts +132 -0
- package/packages/agent-hooks/src/rules/impl/git-transitions.ts +292 -0
- package/packages/agent-hooks/src/rules/impl/git-verify.ts +95 -0
- package/packages/agent-hooks/src/rules/impl/git-worktree.ts +265 -0
- package/packages/agent-hooks/src/rules/impl/mcp-tool.ts +76 -0
- package/packages/agent-hooks/src/rules/impl/messages.ts +128 -0
- package/packages/agent-hooks/src/rules/impl/parse-uncertain.ts +143 -0
- package/packages/agent-hooks/src/rules/impl/pr-completion.ts +35 -0
- package/packages/agent-hooks/src/rules/impl/shell-remote-script-exec.ts +63 -0
- package/packages/agent-hooks/src/rules/impl/tool-azure-devops.ts +283 -0
- package/packages/agent-hooks/src/rules/impl/tool-bun-test.ts +81 -0
- package/packages/agent-hooks/src/rules/impl/tool-cargo.ts +66 -0
- package/packages/agent-hooks/src/rules/impl/tool-chmod-hook.ts +42 -0
- package/packages/agent-hooks/src/rules/impl/tool-find.ts +82 -0
- package/packages/agent-hooks/src/rules/impl/tool-frontend.ts +83 -0
- package/packages/agent-hooks/src/rules/impl/tool-grep.ts +93 -0
- package/packages/agent-hooks/src/rules/impl/tool-lean-ctx-global.ts +594 -0
- package/packages/agent-hooks/src/rules/impl/tool-native-search.ts +77 -0
- package/packages/agent-hooks/src/rules/ports.ts +178 -0
- package/packages/agent-hooks/src/rules/registry.ts +233 -0
- package/packages/agent-hooks/src/rules/shell/git-identity.ts +1415 -0
- package/packages/agent-hooks/src/rules/shell/git-internals.ts +186 -0
- package/packages/agent-hooks/src/rules/shell/invocation.ts +1083 -0
- package/packages/agent-hooks/src/rules/shell/piped-script.ts +201 -0
- package/packages/agent-hooks/src/rules/shell/prefixes.ts +214 -0
- package/packages/agent-hooks/src/rules/shell/protected-carrier-writes.ts +108 -0
- package/packages/agent-hooks/src/rules/shell/protected-carriers.ts +149 -0
- package/packages/agent-hooks/src/rules/shell/split.ts +179 -0
- package/packages/agent-hooks/src/rules/shell/substitution.ts +394 -0
- package/packages/agent-hooks/src/rules/shell/token.ts +180 -0
- package/packages/agent-hooks/src/rules/shell/xargs.ts +81 -0
- package/packages/agent-hooks/src/rules/spec.ts +152 -0
- package/packages/agent-hooks/src/surface-policy.ts +37 -0
- package/packages/agent-hooks/tsconfig.json +23 -0
- package/packages/agent-settings/assets/GLOBAL-AGENTS.md +107 -0
- package/packages/agent-settings/assets/agents/architect.toml +30 -0
- package/packages/agent-settings/assets/agents/code-reviewer.toml +27 -0
- package/packages/agent-settings/assets/agents/critic.toml +35 -0
- package/packages/agent-settings/assets/agents/executor.toml +28 -0
- package/packages/agent-settings/assets/agents/explore.toml +25 -0
- package/packages/agent-settings/assets/agents/planner.toml +29 -0
- package/packages/agent-settings/assets/lean-ctx/config.toml +39 -0
- package/packages/agent-settings/assets/lean-ctx/gitignore +6 -0
- package/packages/agent-settings/assets/lean-ctx/layout.toml +5 -0
- package/packages/agent-settings/assets/mcp.json +20 -0
- package/packages/agent-settings/managed/README.md +331 -0
- package/packages/agent-settings/managed/claude-managed-settings.json +150 -0
- package/packages/agent-settings/managed/codex-requirements.toml +105 -0
- package/packages/agent-settings/protected.json +470 -0
- package/packages/agent-settings/src/deploy/agent-render.ts +94 -0
- package/packages/agent-settings/src/deploy/agent-toml.ts +76 -0
- package/packages/agent-settings/src/deploy/agents-deploy.ts +129 -0
- package/packages/agent-settings/src/deploy/doctor.ts +201 -0
- package/packages/agent-settings/src/deploy/index.ts +33 -0
- package/packages/agent-settings/src/deploy/json-pretty.ts +66 -0
- package/packages/agent-settings/src/deploy/lean-ctx-deploy.ts +138 -0
- package/packages/agent-settings/src/deploy/legacy-lock.ts +286 -0
- package/packages/agent-settings/src/deploy/list.ts +135 -0
- package/packages/agent-settings/src/deploy/lock.ts +112 -0
- package/packages/agent-settings/src/deploy/mcp-deploy.ts +175 -0
- package/packages/agent-settings/src/deploy/mcp-inspect.ts +56 -0
- package/packages/agent-settings/src/deploy/mcp-merge.ts +164 -0
- package/packages/agent-settings/src/deploy/mcp-render.ts +80 -0
- package/packages/agent-settings/src/deploy/mcp-source.ts +43 -0
- package/packages/agent-settings/src/deploy/profile.ts +296 -0
- package/packages/agent-settings/src/deploy/settings.ts +65 -0
- package/packages/agent-settings/src/global-agents.ts +230 -0
- package/packages/agent-settings/src/global-surface-sweep.ts +2179 -0
- package/packages/agent-settings/src/kimi-hooks.ts +455 -0
- package/packages/agent-settings/src/opencode-hooks.ts +76 -0
- package/packages/agent-settings/src/surface-policy.ts +441 -0
- package/packages/agent-settings/surface-policy.json +20 -0
- package/packages/agent-skills/assets/code-review/SKILL.md +100 -0
- package/packages/agent-skills/assets/codebase-design/SKILL.md +98 -0
- package/packages/agent-skills/assets/codebase-design/references/DEEPENING.md +37 -0
- package/packages/agent-skills/assets/codebase-design/references/DESIGN-IT-TWICE.md +44 -0
- package/packages/agent-skills/assets/codebase-design/references/TESTABILITY.md +29 -0
- package/packages/agent-skills/assets/debug-issue/SKILL.md +40 -0
- package/packages/agent-skills/assets/diagnosing-bugs/SKILL.md +100 -0
- package/packages/agent-skills/assets/diagnosing-bugs/references/FEEDBACK-LOOP-TACTICS.md +34 -0
- package/packages/agent-skills/assets/diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
- package/packages/agent-skills/assets/domain-modeling/SKILL.md +86 -0
- package/packages/agent-skills/assets/domain-modeling/references/ADR-FORMAT.md +47 -0
- package/packages/agent-skills/assets/domain-modeling/references/CONTEXT-FORMAT.md +60 -0
- package/packages/agent-skills/assets/explore-codebase/SKILL.md +41 -0
- package/packages/agent-skills/assets/handoff/SKILL.md +28 -0
- package/packages/agent-skills/assets/implement/SKILL.md +28 -0
- package/packages/agent-skills/assets/refactor-safely/SKILL.md +44 -0
- package/packages/agent-skills/assets/review-changes/SKILL.md +45 -0
- package/packages/agent-skills/assets/tdd/SKILL.md +49 -0
- package/packages/agent-skills/assets/tdd/references/mocking.md +59 -0
- package/packages/agent-skills/assets/tdd/references/tests.md +77 -0
- package/packages/agent-skills/assets/testing/SKILL.md +54 -0
- package/packages/agent-skills/assets/to-feature/SKILL.md +91 -0
- package/packages/agent-skills/assets/to-feature/references/FEATURE-SPEC-TEMPLATE.md +88 -0
- package/packages/agent-skills/assets/to-workitems/SKILL.md +90 -0
- package/packages/agent-skills/assets/to-workitems/references/AZURE-DEVOPS-HIERARCHY.md +118 -0
- package/packages/agent-skills/assets/to-workitems/references/TICKET-TEMPLATES.md +70 -0
- package/packages/agent-skills/assets/wayfinder/SKILL.md +100 -0
- package/packages/agent-skills/assets/wayfinder/references/TEMPLATES.md +35 -0
- package/packages/agent-skills/assets/wayfinder/references/TICKET-TYPES.md +8 -0
- package/packages/agent-skills/deploy-profile.json +9 -0
- package/packages/agent-skills/deploy-profile.schema.json +45 -0
- package/packages/agent-skills/dist/deploy.d.ts +27 -0
- package/packages/agent-skills/dist/deploy.d.ts.map +1 -0
- package/packages/agent-skills/dist/deploy.js +186 -0
- package/packages/agent-skills/dist/deploy.js.map +1 -0
- package/packages/agent-skills/dist/doctor.d.ts +24 -0
- package/packages/agent-skills/dist/doctor.d.ts.map +1 -0
- package/packages/agent-skills/dist/doctor.js +141 -0
- package/packages/agent-skills/dist/doctor.js.map +1 -0
- package/packages/agent-skills/dist/fs-utils.d.ts +8 -0
- package/packages/agent-skills/dist/fs-utils.d.ts.map +1 -0
- package/packages/agent-skills/dist/fs-utils.js +40 -0
- package/packages/agent-skills/dist/fs-utils.js.map +1 -0
- package/packages/agent-skills/dist/index.d.ts +8 -0
- package/packages/agent-skills/dist/index.d.ts.map +1 -0
- package/packages/agent-skills/dist/index.js +8 -0
- package/packages/agent-skills/dist/index.js.map +1 -0
- package/packages/agent-skills/dist/legacy-lock.d.ts +44 -0
- package/packages/agent-skills/dist/legacy-lock.d.ts.map +1 -0
- package/packages/agent-skills/dist/legacy-lock.js +121 -0
- package/packages/agent-skills/dist/legacy-lock.js.map +1 -0
- package/packages/agent-skills/dist/list.d.ts +23 -0
- package/packages/agent-skills/dist/list.d.ts.map +1 -0
- package/packages/agent-skills/dist/list.js +75 -0
- package/packages/agent-skills/dist/list.js.map +1 -0
- package/packages/agent-skills/dist/manifest.d.ts +15 -0
- package/packages/agent-skills/dist/manifest.d.ts.map +1 -0
- package/packages/agent-skills/dist/manifest.js +57 -0
- package/packages/agent-skills/dist/manifest.js.map +1 -0
- package/packages/agent-skills/dist/profile.d.ts +41 -0
- package/packages/agent-skills/dist/profile.d.ts.map +1 -0
- package/packages/agent-skills/dist/profile.js +86 -0
- package/packages/agent-skills/dist/profile.js.map +1 -0
- package/packages/agent-skills/dist/skill-config.d.ts +24 -0
- package/packages/agent-skills/dist/skill-config.d.ts.map +1 -0
- package/packages/agent-skills/dist/skill-config.js +68 -0
- package/packages/agent-skills/dist/skill-config.js.map +1 -0
- package/packages/agent-skills/dist/skill-meta.d.ts +17 -0
- package/packages/agent-skills/dist/skill-meta.d.ts.map +1 -0
- package/packages/agent-skills/dist/skill-meta.js +67 -0
- package/packages/agent-skills/dist/skill-meta.js.map +1 -0
- package/packages/agent-skills/package.json +31 -0
- package/packages/agent-skills/src/deploy.ts +222 -0
- package/packages/agent-skills/src/doctor.ts +178 -0
- package/packages/agent-skills/src/fs-utils.ts +40 -0
- package/packages/agent-skills/src/index.ts +29 -0
- package/packages/agent-skills/src/legacy-lock.ts +152 -0
- package/packages/agent-skills/src/list.ts +94 -0
- package/packages/agent-skills/src/manifest.ts +66 -0
- package/packages/agent-skills/src/profile.ts +128 -0
- package/packages/agent-skills/src/skill-config.ts +75 -0
- package/packages/agent-skills/src/skill-meta.ts +78 -0
- package/packages/agent-skills/tsconfig.build.json +13 -0
- package/packages/agent-skills/tsconfig.json +23 -0
- package/packages/azdo/README.md +111 -0
- package/packages/azdo/package.json +21 -0
- package/packages/azdo/src/azdo-pl.ts +275 -0
- package/packages/azdo/src/azdo-pr-review.ts +160 -0
- package/packages/azdo/src/azdo-pr.ts +289 -0
- package/packages/azdo/src/azdo-repo-doctor.ts +839 -0
- package/packages/azdo/src/azdo-wit.ts +145 -0
- package/packages/azdo/src/cli.ts +251 -0
- package/packages/azdo/src/lib/agent-identity.ts +198 -0
- package/packages/azdo/src/lib/agent-token.ts +167 -0
- package/packages/azdo/src/lib/client.ts +259 -0
- package/packages/azdo/src/lib/graph-identity.ts +153 -0
- package/packages/azdo/src/lib/validate-pr-metadata.ts +57 -0
- package/packages/azdo/src/mcp-server.ts +209 -0
- package/packages/azdo/src/tool-dispatch.ts +204 -0
- package/packages/azdo/tsconfig.json +13 -0
- package/packages/fleet/jobs/git-maintain/src/main.ts +588 -0
- package/packages/fleet/manifest.json +207 -0
- package/packages/fleet/manifest.schema.json +283 -0
- package/packages/fleet/src/default-agent-file.ts +144 -0
- package/packages/fleet/src/install-adl-package.ts +178 -0
- package/packages/fleet/src/install-embedding-model.ts +412 -0
- package/packages/fleet/src/launch-agents.ts +649 -0
- package/packages/fleet/src/managed-settings.ts +278 -0
- package/packages/fleet/src/scratch-reap.ts +601 -0
- package/packages/fleet/src/vscode-settings.ts +705 -0
- package/packages/fleet/systemd/adl-azure-agent-update.service +13 -0
- package/packages/fleet/systemd/adl-azure-agent-update.timer +10 -0
- package/packages/repo-controls/AGENTS.md +96 -0
- package/packages/repo-controls/CLAUDE.md +1 -0
- package/packages/repo-controls/LICENSE +20 -0
- package/packages/repo-controls/README.md +493 -0
- package/packages/repo-controls/assets/enable-integration-auto-complete.mjs +79 -0
- package/packages/repo-controls/assets/promote.ts +371 -0
- package/packages/repo-controls/assets/version-bump.sh +189 -0
- package/packages/repo-controls/azure-pipelines.yml +274 -0
- package/packages/repo-controls/bin/adl-repo-controls.ts +10 -0
- package/packages/repo-controls/bunfig.toml +58 -0
- package/packages/repo-controls/package/adl-compliance/AGENTS.md +163 -0
- package/packages/repo-controls/package/adl-compliance/CLAUDE.md +1 -0
- package/packages/repo-controls/package/adl-compliance/conftest.py +78 -0
- package/packages/repo-controls/package/adl-compliance/pyproject.toml +31 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/__init__.py +50 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/__init__.py +98 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/__init__.py +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/check.py +210 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-bad-status/docs/architecture/overview.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-bad-status/docs/decisions/adr-901-proposed.md +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-broken-backlink/docs/decisions/adr-902-dangling.md +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-clean/docs/architecture/overview.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-clean/docs/decisions/adr-900-example.md +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-frontmatter-mismatch/.plans/b_committed/26-08-08-lifecycle-fixture.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-frontmatter-mismatch/.specs/demo/lifecycle.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-frontmatter-mismatch/docs/decisions/adr-903-frontmatter-mismatch.md +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-inactive-plan/.plans/c_done/26-08-08-completed-fixture.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-inactive-plan/.specs/demo/lifecycle.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/fixtures/adr-lifecycle-inactive-plan/docs/decisions/adr-904-completed-plan.md +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/adr_lifecycle/test_check.py +127 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/__init__.py +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/check.py +91 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/CLAUDE.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/architecture/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/compliance/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/decisions/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/index.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/operations/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/research/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/stray-root-file.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/fixtures/docs/totally-made-up/nonsense.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/closed_set/test_check.py +106 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/__init__.py +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/check.py +291 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/fixtures/clean/backend/clean.rs +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/fixtures/excluded/frontend/mobile/src/i18n/locales/zh-CN/strings.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/fixtures/violation/backend/escaped.rs +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/fixtures/violation/backend/raw.rs +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/fixtures/violation/backend//346/226/207/344/273/266.rs +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/english_only/test_check.py +193 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/index_updated/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/index_updated/check.py +140 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/index_updated/fixtures/index-updated-clean/docs/architecture/foo.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/index_updated/fixtures/index-updated-clean/docs/architecture/index.md +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/index_updated/fixtures/index-updated-violation/docs/architecture/foo.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/index_updated/fixtures/index-updated-violation/docs/architecture/index.md +9 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/index_updated/test_check.py +98 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/check.py +378 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/docs-knowledge-indexes.yaml +192 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-clean/docs/index.md +14 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-clean/docs/one.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-clean/docs/two.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-clean/docs-knowledge-indexes.yaml +20 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-duplicate/docs/index.md +15 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-duplicate/docs/one.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-duplicate/docs/two.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-duplicate/docs-knowledge-indexes.yaml +16 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-missing-entry/docs/index.md +13 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-missing-entry/docs/one.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-missing-entry/docs/two.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/fixtures/knowledge-indexes-missing-entry/docs-knowledge-indexes.yaml +16 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/indexes/test_check.py +102 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/check.py +387 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/fixtures/ledger-bad-date/plans/LEDGER.md +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/fixtures/ledger-clean/plans/LEDGER.md +6 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/fixtures/ledger-empty-table/plans/LEDGER.md +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/fixtures/ledger-long-event/plans/LEDGER.md +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/fixtures/ledger-violation/plans/LEDGER.md +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/ledger/test_check.py +427 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/markdown_ast/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/markdown_ast/check.py +84 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/markdown_ast/fixtures/markdown-structure-bad-fence/docs/bad-fence.md +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/markdown_ast/fixtures/markdown-structure-bad-fence/docs/valid.md +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/markdown_ast/fixtures/markdown-structure-bad-frontmatter/docs/bad-front-matter.md +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/markdown_ast/fixtures/markdown-structure-bad-frontmatter/docs/valid.md +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/markdown_ast/fixtures/markdown-structure-clean/docs/valid.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/markdown_ast/test_check.py +126 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/check.py +210 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/docs-okf-profiles.yaml +119 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-clean/docs/architecture/demo.md +17 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-clean/docs-okf-profiles.yaml +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-violation/docs/architecture/bad-status.md +17 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/fixtures/okf-profile-violation/docs-okf-profiles.yaml +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/okf_profile/test_check.py +49 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/register.py +159 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/check.py +578 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-clean/docs/architecture/backend/crate-overview.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-clean/docs/architecture/team/team-overview.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-clean/docs/compliance/controls/control-matrix.md +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-clean/docs/compliance/controls/control-matrix.yaml +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-clean/docs/research/benchmarks/note.md +24 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/architecture/backend/crate-overview.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/architecture/product/stable-delivery.md +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/architecture/product/stable-recommendation.md +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/architecture/product/target-narration.md +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/architecture/team/team-overview.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/compliance/controls/control-matrix.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/compliance/controls/control-matrix.yaml +17 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/fixtures/semantics-violations/docs/research/benchmarks/bad-research.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/docs/semantics/test_check.py +461 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/__init__.py +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/check.py +124 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/.workflows/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/.workflows/CLAUDE.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/CLAUDE.md +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/INVARIANTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/bad-pointer/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/bad-pointer/CLAUDE.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/docs/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/docs/CLAUDE.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/missing-pair/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/owned/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/fixtures/owned/CLAUDE.md +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/agents_layout/test_check.py +116 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/ci_paths/__init__.py +13 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/ci_paths/check.py +380 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/ci_paths/fixtures/redeclared-workflows-tree/automation/pipelines/pr-validation.yaml +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/ci_paths/test_check.py +274 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/check.py +227 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-clean/frontend/packages/desktop/src/renderer/solo/item.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-clean/grants.yaml +6 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/fresh/fresh.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub1/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub10/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub11/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub2/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub3/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub4/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub5/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub6/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub7/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub8/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/many/sub9/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/services/i18n/locales/de/common.json +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/renderer/solo/item.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/frontend/packages/desktop/src/vendored-crate/Cargo.toml +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-excluded/grants.yaml +6 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/fresh/fresh.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub1/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub10/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub11/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub2/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub3/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub4/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub5/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub6/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub7/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub8/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/many/sub9/only.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/frontend/packages/desktop/src/renderer/solo/item.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/fixtures/directory-ratchet-unbaselined/grants.yaml +6 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/directory_ratchet/test_check.py +138 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/check.py +240 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/fixtures/markdown-trees-clean/.plans/a_new/plan.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/fixtures/markdown-trees-clean/backend/AGENTS.md +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/fixtures/markdown-trees-clean/docs/page.md +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/fixtures/markdown-trees-stray/backend/notes.md +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/fixtures/markdown-trees-stray/docs/page.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/markdown_trees/test_check.py +220 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/open_work_cap/__init__.py +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/open_work_cap/check.py +225 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/open_work_cap/fixtures/open-work-cap-clean/plans/GAPS-AND-FINDINGS.md +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/open_work_cap/fixtures/open-work-cap-clean/plans/features/az601-clean/spec.md +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/open_work_cap/test_check.py +330 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/check.py +240 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/agent/crates/enact-providers/src/snapshots/README.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/backend/crates/enact-app/assets/builtin-assistants/avatars/assistant.jpg +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/backend/crates/enact-assets/assets/logos/tools/coding/tool.png +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/backend/crates/enact-session/src/backend/codex_init_prompt.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/mobile/assets/images/icon.png +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/packages/desktop/src/renderer/assets/logos/brand/app.png +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/packages/desktop/src/renderer/assets/themes/default-theme.png +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/public/pwa/icon-192.png +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-allowed/frontend/resources/product.png +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-stray/apps/legacy/file.ts +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-stray/backend/crates/enact-session/src/backend/README.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/fixtures/placement-stray/frontend/unapproved/screenshot.png +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/placement/test_check.py +230 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plan_metadata.py +53 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/__init__.py +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/check.py +438 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/fixtures/plans-layout-clean/plans/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/fixtures/plans-layout-clean/plans/features/az347-test-coverage/items/az351-restore-entrypoint.md +9 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/fixtures/plans-layout-clean/plans/features/az347-test-coverage/spec.md +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/fixtures/plans-layout-clean/plans/templates/feature.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/fixtures/plans-layout-violation/plans/features/az347-test-coverage/items/az351-restore-entrypoint.md +9 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/fixtures/plans-layout-violation/plans/features/az347-test-coverage/spec.md +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/plans_layout/test_check.py +461 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/check.py +62 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/NotAMigration.sql +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/0001_long_prefix.sql +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/001_init.sql +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/002_add_index.sql +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/003-dashed-slug.sql +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/004_MixedCase.sql +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/005_trailing space.sql +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/01_short_prefix.sql +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/fixtures/migration-filenames/backend/crates/demo/migrations/not-a-migration.sql +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/profile_data/test_check.py +116 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/check.py +188 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-broken/.plans/c_done/26-07-27-history.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-broken/docs/README.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-broken/docs/architecture/product/links.md +20 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-broken/docs/architecture/product/route-target.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-clean/.plans/c_done/26-07-27-history.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-clean/docs/README.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-clean/docs/architecture/product/links.md +20 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/fixtures/link-targets-clean/docs/architecture/product/route-target.md +8 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/references/test_check.py +166 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/check.py +135 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.agents/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.changeset/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.claude/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.code-review-graph/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.code-review-graph_old/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.codex/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.cursor/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.cursorrules +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.dockerignore +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.docs/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.donors/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.gitattributes +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.kimi-code/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.lfsconfig +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.mcp.json +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.opencode/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/.workflows/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/CHANGELOG.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/CLAUDE-INVARIANTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/CLAUDE.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/INDEPENDENT-VERIFICATION.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/INVARIANTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/LICENSE +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/NOTICE +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/README.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/RELEASE.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/VERSION +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/backend/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/compliance/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/dev/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/docker/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/docs/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/frontend/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/infra/declared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/justfile +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/opencode.jsonc +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/rule-tests/undeclared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/rules/undeclared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/unapproved-root/undeclared.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/fixtures/undeclared-root-file.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_closed_set/test_check.py +122 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/check.py +290 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/.changeset/some-change.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/.plans/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/.specs/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/.workflows/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/CHANGELOG.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/CLAUDE.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/INDEPENDENT-VERIFICATION.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/INVARIANTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/README.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/RELEASE.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/STRAY.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/docs/AGENTS.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/docs/architecture/note.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-clean/frontend/README.md +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-missing-guide/.workflows/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-missing-guide/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-missing-guide/README.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-missing-guide/docs/overview.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/fixtures/root-markdown-missing-guide/plans/AGENTS.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/root_markdown_allowlist/test_check.py +329 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/check.py +127 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/a/b/c/d/at-limit.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/a/b/c/d/e/too-deep.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-01.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-02.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-03.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-04.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-05.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-06.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-07.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-08.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-09.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-10.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-11.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-12.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-13.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-14.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-15.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/fixtures/scripts-layout/.workflows/scripts/direct-16.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/layout/scripts_size_depth/test_check.py +163 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/__init__.py +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/check.py +169 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/attribute-without-conversion/.gitattributes +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/attribute-without-conversion/large file.bin +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/clean/.gitattributes +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/clean/large file.bin +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/clean/small.txt +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/missing-filter/large file.bin +0 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/unmatched-extension/.gitattributes +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/fixtures/unmatched-extension/payload.dat +0 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/lfs/integrity/test_check.py +133 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/__init__.py +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/check.py +129 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/fixtures/disjoint/gate-registry.yaml +13 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/fixtures/empty/gate-registry.yaml +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/fixtures/overlapping/gate-registry.yaml +13 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/pipeline/phase_disjoint/test_check.py +109 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/__init__.py +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/check.py +149 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/fixtures/clean/docs/readme.md +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/fixtures/relevant/VERSION +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/changeset_plan/test_check.py +151 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/check.py +202 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/aligned/.workflows/changesets/package.json +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/aligned/.workflows/package.json +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/aligned/CHANGELOG.md +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/aligned/VERSION +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/mismatched/.workflows/changesets/package.json +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/mismatched/.workflows/package.json +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/mismatched/CHANGELOG.md +5 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/fixtures/mismatched/VERSION +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/release/version_release/test_check.py +162 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/__init__.py +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/check.py +103 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/compliance_py/checks/git-bad.sh +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/compliance_py/checks/git-note.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/compliance_py/checks/good.sh +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/compliance_py/checks/grep-bad.sh +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/compliance_py/checks/grep-note.sh +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/compliance_py/checks/grep-trailing.sh +2 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/compliance_py/checks/notes.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/elsewhere/loose-git.sh +6 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/fixtures/no-banned-commands/elsewhere/loose-grep.sh +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/banned_commands/test_check.py +117 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/ignored_paths/__init__.py +13 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/ignored_paths/check.py +265 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/ignored_paths/fixtures/ignored-paths/keep.log +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/ignored_paths/fixtures/ignored-paths/src/main.rs +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/ignored_paths/test_check.py +180 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/license_declared/__init__.py +12 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/license_declared/check.py +84 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/license_declared/fixtures/license-declared-clean/LICENSE +10 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/license_declared/fixtures/license-declared-mismatch/LICENSE +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/license_declared/fixtures/license-declared-missing/README.md +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/license_declared/test_check.py +66 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/check.py +167 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/backend/Cargo.lock +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/backend/Cargo.toml +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/backend/rust-toolchain.toml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/backend/src/main.rs +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/clean/frontend/bun.lock +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/backend/Cargo.lock +7 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/backend/Cargo.toml +4 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/backend/rust-toolchain.toml +3 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/backend/src/main.rs +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/fixtures/empty-bun-lock/frontend/bun.lock +0 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/checks/repository/lockfile_integrity/test_check.py +109 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/cli.py +483 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/__init__.py +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/ast_grep.py +199 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/batch.py +52 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/check.py +303 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/constants.py +106 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/context.py +99 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/errors.py +32 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/finding.py +65 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/models.py +40 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/receipt.py +63 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/scope.py +82 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/core/verdict.py +161 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/__init__.py +1 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/config.py +131 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/config.toml +30 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/docs_shape.py +65 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/gate-registry.alt.yaml +791 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/gate-registry.schema.yaml +176 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/gate-registry.yaml +791 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/grants-registry.yaml +112 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/grants.py +129 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/registry.py +281 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/root_shape.py +250 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/policy/severity-policy.yaml +114 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/providers/__init__.py +11 -0
- package/packages/repo-controls/package/adl-compliance/src/adl_compliance/runner.py +371 -0
- package/packages/repo-controls/package/adl-compliance/uv.lock +199 -0
- package/packages/repo-controls/package.json +33 -0
- package/packages/repo-controls/scripts/hooks/commit-msg +63 -0
- package/packages/repo-controls/scripts/hooks/lib/hook-log.sh +62 -0
- package/packages/repo-controls/scripts/hooks/post-checkout +15 -0
- package/packages/repo-controls/scripts/hooks/post-commit +18 -0
- package/packages/repo-controls/scripts/hooks/pre-commit +82 -0
- package/packages/repo-controls/scripts/hooks/pre-push +144 -0
- package/packages/repo-controls/src/azdo-push.ts +463 -0
- package/packages/repo-controls/src/azure-devops-governance.ts +248 -0
- package/packages/repo-controls/src/azure-devops-remote.ts +61 -0
- package/packages/repo-controls/src/cli.ts +188 -0
- package/packages/repo-controls/src/compliance-config.ts +200 -0
- package/packages/repo-controls/src/config.ts +690 -0
- package/packages/repo-controls/src/constants.ts +97 -0
- package/packages/repo-controls/src/coverage-ratchet.ts +153 -0
- package/packages/repo-controls/src/doc-freshness.ts +172 -0
- package/packages/repo-controls/src/doctor.ts +304 -0
- package/packages/repo-controls/src/findings-ratchet.ts +163 -0
- package/packages/repo-controls/src/gitignore-block.ts +253 -0
- package/packages/repo-controls/src/hook-log.ts +72 -0
- package/packages/repo-controls/src/hook.ts +694 -0
- package/packages/repo-controls/src/install.ts +506 -0
- package/packages/repo-controls/src/integrity.ts +104 -0
- package/packages/repo-controls/src/promote.ts +25 -0
- package/packages/repo-controls/src/runtime.ts +110 -0
- package/packages/repo-controls/src/workflows-drift.ts +106 -0
- package/packages/repo-controls/src/worktree-guard.ts +272 -0
- package/packages/repo-controls/src/worktree-limit.ts +11 -0
- package/packages/repo-controls/tsconfig.json +14 -0
- package/packages/repo-controls/workflows/scripts/release/verify-npm-artifact.ts +119 -0
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
# Shared "strip raw per-user `lean-ctx hook <subcommand>` entries" primitive,
|
|
2
|
+
# sourced by bin/lean-ctx-observe-strip (bin/reconcile's per-device step) and
|
|
3
|
+
# by workflows/scripts/fleet/fleet-cutover.sh's strip_user_lean_ctx_hooks.
|
|
4
|
+
#
|
|
5
|
+
# Scope, in order of decision (all 2026-09-29, all Tarun, relayed through the
|
|
6
|
+
# orchestrator in this same work item):
|
|
7
|
+
# 1. STATUS.md 12p item 13: "That's only for observation layer. We don't
|
|
8
|
+
# want to send any data to remote." -- retracted the
|
|
9
|
+
# `/usr/local/bin/lean-ctx hook observe` session-lifecycle hook
|
|
10
|
+
# everywhere adl manages it.
|
|
11
|
+
# 2. Final decision (supersedes an intermediate "observe only" correction
|
|
12
|
+
# that itself supersedes an intermediate "every subcommand" widening --
|
|
13
|
+
# this is the one that stands): lean-ctx hooks are "moved to repo
|
|
14
|
+
# level" and must be REMOVED FROM GLOBAL. The per-repo carrier already
|
|
15
|
+
# provides them -- `adl hook lean-ctx pre-tool-use|post-tool-use` (in
|
|
16
|
+
# each managed repo's own `.claude/settings.json`, `.codex/hooks.json`,
|
|
17
|
+
# etc., written by `adl hooks deploy`) maps to lean-ctx `rewrite`
|
|
18
|
+
# (Bash), `redirect` (Read/Grep/Glob/...) and `read-dedup` (PostToolUse
|
|
19
|
+
# Read) using the REPO's own `LEAN_CTX_*` config -- see
|
|
20
|
+
# `packages/agent-hooks/src/hooks/lean-ctx/mapping.ts` (CLAUDE routes,
|
|
21
|
+
# `pre`: rewrite/redirect, `post`: read-dedup). `observe` has no
|
|
22
|
+
# per-repo carrier at all and is dropped outright. So this strips EVERY
|
|
23
|
+
# raw, unwrapped `lean-ctx hook <subcommand>` entry found directly in a
|
|
24
|
+
# per-user config -- observe, rewrite, redirect, read-dedup, and any
|
|
25
|
+
# other subcommand -- never just observe.
|
|
26
|
+
#
|
|
27
|
+
# This file is the ONE place that knows what "a raw lean-ctx hook entry" is
|
|
28
|
+
# and how to remove it, so bin/reconcile's recurring per-device
|
|
29
|
+
# reconciliation and fleet-cutover.sh's one-time cutover can never drift
|
|
30
|
+
# apart on the answer (before this, fleet-cutover.sh carried its own inline
|
|
31
|
+
# jq queries -- observe-only -- and bin/reconcile had no strip step at all).
|
|
32
|
+
#
|
|
33
|
+
# What is NEVER touched, by construction of the match below:
|
|
34
|
+
# - `adl hook lean-ctx pre-tool-use|post-tool-use --host=<x>` (the per-repo
|
|
35
|
+
# carrier itself): the literal word order is "hook lean-ctx", never
|
|
36
|
+
# "lean-ctx hook" -- the substring this matches never appears in it.
|
|
37
|
+
# - Orca's own conditional hooks (`~/.orca/agent-hooks/*-hook.sh`): they
|
|
38
|
+
# never mention "lean-ctx" at all.
|
|
39
|
+
# - Kimi's per-user hooks (`adl hook lean-ctx ... --host=kimi`, written by
|
|
40
|
+
# packages/agent-settings/src/kimi-hooks.ts): same "hook lean-ctx" word
|
|
41
|
+
# order as the adl carrier above -- never matches either.
|
|
42
|
+
#
|
|
43
|
+
# Names below still say "observe" (this strip started as observe-only, and
|
|
44
|
+
# renaming a shared, already-referenced identifier mid-flight risked a
|
|
45
|
+
# missed call site more than it bought clarity) -- read them as "the
|
|
46
|
+
# lean-ctx raw-hook strip", not as scoped to the `observe` subcommand alone;
|
|
47
|
+
# the matching regex is the actual source of truth for scope.
|
|
48
|
+
#
|
|
49
|
+
# Scope -- which per-user files can actually carry a raw lean-ctx hook,
|
|
50
|
+
# checked read-only against a real machine's files and this repo's own
|
|
51
|
+
# docs/tests before writing this (bin/lean-ctx-observe-strip's own header
|
|
52
|
+
# lists the two files this is actually run against):
|
|
53
|
+
# - `~/.claude/settings.json` and `~/.codex/hooks.json` share the same
|
|
54
|
+
# JSON `json-hook-map` shape (global-surface-sweep.ts's own term):
|
|
55
|
+
# `{ hooks: { <Event>: [ { matcher?, hooks: [ { command, ... } ] } ] } }`.
|
|
56
|
+
# This is the per-user hook shape that carried `lean-ctx hook observe`
|
|
57
|
+
# (the managed baseline wired it, identically, for Claude and Codex only
|
|
58
|
+
# -- "both templates" -- packages/agent-settings/managed/README.md's
|
|
59
|
+
# "lean-ctx `observe` hooks (removed)" section) and is where a real,
|
|
60
|
+
# live `~/.claude/settings.json` on this machine was found to also carry
|
|
61
|
+
# raw `rewrite`/`redirect`/`read-dedup` entries -- both files covered
|
|
62
|
+
# below.
|
|
63
|
+
# - `~/.cursor/hooks.json` uses a DIFFERENT per-group shape (the group
|
|
64
|
+
# itself IS the leaf hook -- `{ command, timeout }`, no nested `hooks`
|
|
65
|
+
# array; see global-surface-sweep.ts's own `json-hook-map` doc comment,
|
|
66
|
+
# confirmed against this machine's real `~/.cursor/hooks.json`, which
|
|
67
|
+
# carries no lean-ctx entries at all) -- NOT covered.
|
|
68
|
+
# - `~/.kimi-code/config.toml`'s hooks are a single flat `[[hooks]]`
|
|
69
|
+
# array-of-tables (packages/agent-settings/src/kimi-hooks.ts), and every
|
|
70
|
+
# command it ever writes is wrapped as `adl hook lean-ctx ... --host=kimi`
|
|
71
|
+
# (confirmed against this machine's real config) -- never a raw
|
|
72
|
+
# `lean-ctx hook <subcommand>` string -- NOT covered.
|
|
73
|
+
# - `~/.codex/config.toml` CAN structurally carry the same
|
|
74
|
+
# `[[hooks.<Event>]]` / `hooks = [{ command = ... }]` shape
|
|
75
|
+
# (`/etc/codex/requirements.toml`, the admin-tier twin of this exact per-
|
|
76
|
+
# user schema, proves the shape once carried `observe`), but on this
|
|
77
|
+
# machine it is empty of any `[hooks.*]` table, and no code path in this
|
|
78
|
+
# repo writes hooks into a per-user `~/.codex/config.toml` -- the real
|
|
79
|
+
# per-user Codex hook carrier is `~/.codex/hooks.json`, confirmed live on
|
|
80
|
+
# this machine with Orca's own entries -- NOT covered; flag for Tarun if
|
|
81
|
+
# that ever changes.
|
|
82
|
+
# - `~/.config/opencode/*` has no command-string hook carrier at all --
|
|
83
|
+
# OpenCode's carrier is a `.opencode/plugins/adl-repo.ts` JS/TS plugin
|
|
84
|
+
# file, structurally incapable of holding a raw `lean-ctx hook` shell-
|
|
85
|
+
# command string -- NOT covered.
|
|
86
|
+
#
|
|
87
|
+
# jq is a mandatory bootstrap tool for every caller of this file (checked at
|
|
88
|
+
# each caller's own top), so no jq-availability fallback is needed here.
|
|
89
|
+
|
|
90
|
+
# lean_ctx_observe_hook_valid <path> -- gate every caller runs before
|
|
91
|
+
# treating <path> as a document to filter. A 0-byte/whitespace-only file
|
|
92
|
+
# (jq's own parse error is silent-ish -- it just complains about no input)
|
|
93
|
+
# and a file carrying two or more concatenated JSON documents (jq's default
|
|
94
|
+
# single-value parse happily reads only the FIRST one and ignores the rest
|
|
95
|
+
# -- exactly the "passes silently" bug this closes) must both be loud
|
|
96
|
+
# failures, not a file that quietly gets treated as "no raw lean-ctx hook
|
|
97
|
+
# entries found". `jq -se` slurps the whole input into an array of every
|
|
98
|
+
# top-level JSON value it can parse: length 0 means empty/whitespace-only,
|
|
99
|
+
# length >1 means more than one document, and a length-1 array whose sole
|
|
100
|
+
# element is not a JSON object (a bare array, string, number, ...) is also
|
|
101
|
+
# rejected -- a per-user hook-map file is always `{ ... }` at the top.
|
|
102
|
+
# Returns non-zero (jq's own parse error, or the printed "false", both
|
|
103
|
+
# treated as invalid) on anything else; callers report that as a loud parse
|
|
104
|
+
# failure exactly like a malformed-JSON file already was.
|
|
105
|
+
lean_ctx_observe_hook_valid() {
|
|
106
|
+
local path="$1" verdict
|
|
107
|
+
verdict="$(jq -se 'length == 1 and (.[0] | type) == "object"' "$path" 2>/dev/null)" || return 1
|
|
108
|
+
[[ "$verdict" == "true" ]]
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
# lean_ctx_observe_hook_events <path> -- prints a comma-joined list of event
|
|
112
|
+
# names (the `hooks.<Event>` keys) that carry at least one hook group whose
|
|
113
|
+
# command matches "lean-ctx hook <subcommand>" -- a raw, unwrapped
|
|
114
|
+
# invocation of ANY lean-ctx hook subcommand (observe, rewrite, redirect,
|
|
115
|
+
# read-dedup, or any other). The jq `test` is a plain substring match, so
|
|
116
|
+
# any path spelling -- "/usr/local/bin/lean-ctx hook observe",
|
|
117
|
+
# "/Users/x/.local/bin/lean-ctx hook rewrite" -- matches; only the literal,
|
|
118
|
+
# adjacent "lean-ctx hook" phrase matters, which is exactly what
|
|
119
|
+
# distinguishes a raw invocation from the per-repo carrier's
|
|
120
|
+
# "adl hook lean-ctx ... --host=<x>" (reversed word order -- never matches)
|
|
121
|
+
# and from Orca's own hooks (no "lean-ctx" at all -- never matches). Prints
|
|
122
|
+
# nothing (empty string) when there are none. A malformed/unparseable JSON
|
|
123
|
+
# file, a 0-byte/whitespace-only file, or a file carrying more than one JSON
|
|
124
|
+
# document (lean_ctx_observe_hook_valid) is a loud failure (non-zero exit)
|
|
125
|
+
# -- callers must check the exit status and fail, never silently skip a file
|
|
126
|
+
# they could not read.
|
|
127
|
+
lean_ctx_observe_hook_events() {
|
|
128
|
+
local path="$1"
|
|
129
|
+
lean_ctx_observe_hook_valid "$path" || return 1
|
|
130
|
+
jq -r '
|
|
131
|
+
(.hooks // {}) | to_entries[]
|
|
132
|
+
| select(.value | type == "array")
|
|
133
|
+
# `any(...)` collapses to one boolean per event -- an EVENT with two or
|
|
134
|
+
# more matching groups (a real shape: this machine'"'"'s own
|
|
135
|
+
# ~/.claude/settings.json PostToolUse carries both a raw observe hook
|
|
136
|
+
# AND a raw read-dedup hook as separate groups) must still print its key
|
|
137
|
+
# exactly once. The earlier `select(.value[] | ...)` form used a
|
|
138
|
+
# generator as the select condition, which jq re-emits the input once
|
|
139
|
+
# per truthy match -- duplicating the event name in the printed list.
|
|
140
|
+
| select(.value | any(.[] | .hooks[]?.command? // ""; test("lean-ctx hook")))
|
|
141
|
+
| .key
|
|
142
|
+
' "$path" | paste -sd, -
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
# lean_ctx_observe_hook_filtered <path> <dst> -- writes the full document,
|
|
146
|
+
# with every hook whose command matches a raw "lean-ctx hook <subcommand>"
|
|
147
|
+
# invocation removed (see lean_ctx_observe_hook_events for exactly what
|
|
148
|
+
# matches and what never does), DIRECTLY to <dst> (jq's own stdout
|
|
149
|
+
# redirected straight to a file -- never captured into a bash variable via
|
|
150
|
+
# `$(...)`, which would silently strip jq's own trailing newline; final
|
|
151
|
+
# review finding 2). jq's output convention (exactly one trailing newline,
|
|
152
|
+
# always) makes this a non-issue for JSON specifically, but writing
|
|
153
|
+
# straight to a file removes the question entirely rather than relying on
|
|
154
|
+
# that convention holding. A hook GROUP is dropped entirely only when
|
|
155
|
+
# it HAD at least one hook and lost every one of them to this strip (never
|
|
156
|
+
# left as an empty `{ hooks: [] }`); an EVENT key is dropped entirely only
|
|
157
|
+
# when it HAD at least one group and lost every one of them the same way
|
|
158
|
+
# (never left as an empty array) -- matching `json-hook-map`'s own
|
|
159
|
+
# convention in global-surface-sweep.ts. Crucially, a group/event that was
|
|
160
|
+
# ALREADY empty before this ran (`{ "hooks": [] }`, `"Notification": []`,
|
|
161
|
+
# neither uncommon -- an editor or another tool can leave one behind) is
|
|
162
|
+
# UNRELATED to this strip and is left exactly as it was, not swept up by the
|
|
163
|
+
# same "empty means drop" rule: the `if ($before_len > 0) and (now empty)
|
|
164
|
+
# then drop` guard below only fires when there was something to remove.
|
|
165
|
+
# Every other top-level key, every other event, every other group and hook
|
|
166
|
+
# (the `adl hook lean-ctx ... --host=<x>` per-repo carrier and Orca's own
|
|
167
|
+
# conditional hook included) is left byte-for-byte untouched, in its
|
|
168
|
+
# original order -- `to_entries | map | from_entries` never reorders JSON
|
|
169
|
+
# object keys, and `.value |= (...)` / `.hooks |= (...)` update in place
|
|
170
|
+
# rather than reconstructing the object, so an unrelated field (e.g. a
|
|
171
|
+
# group's own `matcher`) survives untouched too. Callers must check the exit
|
|
172
|
+
# status (a malformed input file fails loudly, same as
|
|
173
|
+
# lean_ctx_observe_hook_events).
|
|
174
|
+
lean_ctx_observe_hook_filtered() {
|
|
175
|
+
local path="$1" dst="$2"
|
|
176
|
+
lean_ctx_observe_hook_valid "$path" || return 1
|
|
177
|
+
jq '
|
|
178
|
+
.hooks |= (
|
|
179
|
+
to_entries
|
|
180
|
+
| map(
|
|
181
|
+
if (.value | type) == "array" then
|
|
182
|
+
(.value | length) as $event_before_len
|
|
183
|
+
| .value |= (
|
|
184
|
+
map(
|
|
185
|
+
(.hooks // []) as $group_before
|
|
186
|
+
| (.hooks |= map(select((.command? // "") | test("lean-ctx hook") | not))) as $filtered_group
|
|
187
|
+
| if ($group_before | length) > 0 and (($filtered_group.hooks) | length) == 0
|
|
188
|
+
then empty
|
|
189
|
+
else $filtered_group
|
|
190
|
+
end
|
|
191
|
+
)
|
|
192
|
+
)
|
|
193
|
+
| if ($event_before_len > 0) and ((.value | length) == 0)
|
|
194
|
+
then empty
|
|
195
|
+
else .
|
|
196
|
+
end
|
|
197
|
+
else
|
|
198
|
+
.
|
|
199
|
+
end
|
|
200
|
+
)
|
|
201
|
+
| from_entries
|
|
202
|
+
)
|
|
203
|
+
' "$path" > "$dst"
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
# ---------------------------------------------------------------------------
|
|
207
|
+
# The ONE safe writer both callers use to rewrite a target file in place,
|
|
208
|
+
# replacing each caller's own former `printf ... >"$path.new"; mv -f
|
|
209
|
+
# "$path.new" "$path"` pattern. Three bugs that pattern had, all closed here:
|
|
210
|
+
#
|
|
211
|
+
# 1. Symlinked target: `mv -f` REPLACES the symlink with a regular file --
|
|
212
|
+
# the inode `$path` used to point at (a dotfile-manager-managed config,
|
|
213
|
+
# for instance) is left completely unchanged, and `$path` itself stops
|
|
214
|
+
# being a symlink at all. lean_ctx_observe_hook_resolve_target below
|
|
215
|
+
# resolves the real target FIRST; the write goes through to that file,
|
|
216
|
+
# and the symlink survives, still pointing at it, exactly as before.
|
|
217
|
+
# 2. Mode/ownership: a fresh `>` redirection creates its file at whatever
|
|
218
|
+
# mode the process' umask produces -- a 0600 target file does not stay
|
|
219
|
+
# 0600. lean_ctx_observe_hook_write stats the resolved target's own
|
|
220
|
+
# mode and owner:group FIRST and chmod/chown's the temp file to match
|
|
221
|
+
# before the rename.
|
|
222
|
+
# 3. A failing write step reported as success: `strip_one "$path" ||
|
|
223
|
+
# status=1` (the caller-side idiom both scripts use to keep going
|
|
224
|
+
# after one target fails) disables `set -e` for everything
|
|
225
|
+
# strip_one/strip_user_lean_ctx_hooks itself runs -- a later command's
|
|
226
|
+
# non-zero exit does not abort the function on its own. Every step
|
|
227
|
+
# below is therefore its own explicit `if`, not a bare statement: a
|
|
228
|
+
# failure removes the temp file, prints one "FAILED:" line to stderr,
|
|
229
|
+
# and returns 1 -- never a partial write silently treated as done.
|
|
230
|
+
#
|
|
231
|
+
# Portable across macOS (BSD stat/readlink) and Linux (GNU): no `stat -f`
|
|
232
|
+
# (Linux), `stat -c` (macOS) or `readlink -f` (missing on macOS' BSD
|
|
233
|
+
# readlink) assumed to exist on both.
|
|
234
|
+
# ---------------------------------------------------------------------------
|
|
235
|
+
|
|
236
|
+
# lean_ctx_observe_hook_resolve_target <path> -- prints the real,
|
|
237
|
+
# non-symlink file <path> should be WRITTEN THROUGH TO: if <path> is a
|
|
238
|
+
# symlink (however many hops deep -- a relative link target is resolved
|
|
239
|
+
# against its own symlink's directory, matching normal filesystem
|
|
240
|
+
# semantics), the final target; otherwise <path> itself, unchanged. Does
|
|
241
|
+
# NOT require the target to already exist (a target that is about to be
|
|
242
|
+
# created for the first time resolves to itself, same as a non-symlink
|
|
243
|
+
# path).
|
|
244
|
+
lean_ctx_observe_hook_resolve_target() {
|
|
245
|
+
local p="$1" link dir
|
|
246
|
+
while [[ -L "$p" ]]; do
|
|
247
|
+
link="$(readlink "$p")"
|
|
248
|
+
case "$link" in
|
|
249
|
+
/*) p="$link" ;;
|
|
250
|
+
*)
|
|
251
|
+
dir="$(dirname "$p")"
|
|
252
|
+
p="$dir/$link"
|
|
253
|
+
;;
|
|
254
|
+
esac
|
|
255
|
+
done
|
|
256
|
+
printf '%s\n' "$p"
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
# lean_ctx_observe_hook_stat_mode <path> -- prints <path>'s permission bits
|
|
260
|
+
# as a plain octal string (e.g. "600"), suitable for `chmod` as-is. Tries
|
|
261
|
+
# BSD `stat -f` first (macOS), falls back to GNU `stat -c` (Linux).
|
|
262
|
+
#
|
|
263
|
+
# The two attempts are deliberately captured in SEPARATE command
|
|
264
|
+
# substitutions, not chained as `stat -f ... || stat -c ...` inside one
|
|
265
|
+
# `$(...)`. GNU coreutils' stat also accepts `-f`, but as its OWN flag
|
|
266
|
+
# ("file system status" instead of "file status") -- it does not reject the
|
|
267
|
+
# BSD spelling, it silently does something else: it treats the format string
|
|
268
|
+
# ("%Lp") as a FILE argument, fails on that with a permission error (a
|
|
269
|
+
# non-zero exit, so the naive `||` fallback does still fire), but ALSO
|
|
270
|
+
# prints a multi-line filesystem-info block for "$1" to stdout before it
|
|
271
|
+
# exits. Inside one shared `$(cmd1 || cmd2)`, that stray stdout output is
|
|
272
|
+
# captured right alongside cmd2's real "%a" output, silently corrupting the
|
|
273
|
+
# mode string. Capturing cmd1 in its own `out=$(...)` isolates its stdout
|
|
274
|
+
# from the fallback and only ever uses it when cmd1 itself reported success.
|
|
275
|
+
lean_ctx_observe_hook_stat_mode() {
|
|
276
|
+
local out
|
|
277
|
+
if out="$(stat -f '%Lp' "$1" 2>/dev/null)"; then
|
|
278
|
+
printf '%s\n' "$out"
|
|
279
|
+
return 0
|
|
280
|
+
fi
|
|
281
|
+
stat -c '%a' "$1"
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
# lean_ctx_observe_hook_stat_owner <path> -- prints "<uid>:<gid>" of <path>,
|
|
285
|
+
# suitable for `chown` as-is. Same BSD-then-GNU portability story, and the
|
|
286
|
+
# same isolated-capture fix as lean_ctx_observe_hook_stat_mode above (GNU
|
|
287
|
+
# stat's own `-f` meaning would otherwise leak a filesystem-info block into
|
|
288
|
+
# the captured value here too).
|
|
289
|
+
lean_ctx_observe_hook_stat_owner() {
|
|
290
|
+
local out
|
|
291
|
+
if out="$(stat -f '%u:%g' "$1" 2>/dev/null)"; then
|
|
292
|
+
printf '%s\n' "$out"
|
|
293
|
+
return 0
|
|
294
|
+
fi
|
|
295
|
+
stat -c '%u:%g' "$1"
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
# lean_ctx_observe_hook_write <path> <content_src> -- writes the BYTES of
|
|
299
|
+
# <content_src> (a file -- final review finding 2: a bash string argument
|
|
300
|
+
# here, written back with `printf '%s\n'`, silently drops any trailing
|
|
301
|
+
# blank lines the original had and adds a final newline where the original
|
|
302
|
+
# had none; a file-to-file copy has no such normalization) through to
|
|
303
|
+
# <path>'s resolved real target (lean_ctx_observe_hook_resolve_target),
|
|
304
|
+
# preserving that target's existing mode and owner:group, via a same-
|
|
305
|
+
# directory temp file and an atomic rename. Prints nothing on success;
|
|
306
|
+
# prints one "FAILED: ..." line to stderr and returns 1 on any failed step,
|
|
307
|
+
# with the temp file removed either way -- never a half-written target, and
|
|
308
|
+
# never a failure that looks like success to a caller that only checks
|
|
309
|
+
# whether output changed. <path> keeps being a symlink (untouched) when it
|
|
310
|
+
# was one; the file it points to carries the new content.
|
|
311
|
+
#
|
|
312
|
+
# The temp file itself is created with `mktemp` using the portable
|
|
313
|
+
# same-directory dotfile template (`.$(basename).XXXXXX`, works identically
|
|
314
|
+
# under BSD and GNU mktemp -- final review finding 5), not the previous
|
|
315
|
+
# `$resolved.new.$$` -- a PID-suffixed name is predictable, `mktemp`'s is
|
|
316
|
+
# not, and mktemp creates the file atomically (O_EXCL) rather than merely
|
|
317
|
+
# naming one.
|
|
318
|
+
lean_ctx_observe_hook_write() {
|
|
319
|
+
local path="$1" content_src="$2"
|
|
320
|
+
local resolved mode owner tmp
|
|
321
|
+
resolved="$(lean_ctx_observe_hook_resolve_target "$path")"
|
|
322
|
+
mode="$(lean_ctx_observe_hook_stat_mode "$resolved")" || {
|
|
323
|
+
echo "FAILED: could not stat mode of $resolved" >&2
|
|
324
|
+
return 1
|
|
325
|
+
}
|
|
326
|
+
owner="$(lean_ctx_observe_hook_stat_owner "$resolved")" || {
|
|
327
|
+
echo "FAILED: could not stat owner of $resolved" >&2
|
|
328
|
+
return 1
|
|
329
|
+
}
|
|
330
|
+
tmp="$(mktemp "$(dirname "$resolved")/.$(basename "$resolved").XXXXXX" 2>/dev/null)" || {
|
|
331
|
+
echo "FAILED: mktemp for $resolved failed" >&2
|
|
332
|
+
return 1
|
|
333
|
+
}
|
|
334
|
+
if ! cat "$content_src" >"$tmp" 2>/dev/null; then
|
|
335
|
+
echo "FAILED: writing $tmp failed" >&2
|
|
336
|
+
rm -f "$tmp" 2>/dev/null
|
|
337
|
+
return 1
|
|
338
|
+
fi
|
|
339
|
+
if ! chmod "$mode" "$tmp" 2>/dev/null; then
|
|
340
|
+
echo "FAILED: chmod $mode $tmp failed" >&2
|
|
341
|
+
rm -f "$tmp" 2>/dev/null
|
|
342
|
+
return 1
|
|
343
|
+
fi
|
|
344
|
+
if ! chown "$owner" "$tmp" 2>/dev/null; then
|
|
345
|
+
echo "FAILED: chown $owner $tmp failed" >&2
|
|
346
|
+
rm -f "$tmp" 2>/dev/null
|
|
347
|
+
return 1
|
|
348
|
+
fi
|
|
349
|
+
if ! mv -f "$tmp" "$resolved" 2>/dev/null; then
|
|
350
|
+
echo "FAILED: mv $tmp -> $resolved failed" >&2
|
|
351
|
+
rm -f "$tmp" 2>/dev/null
|
|
352
|
+
return 1
|
|
353
|
+
fi
|
|
354
|
+
return 0
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
# ---------------------------------------------------------------------------
|
|
358
|
+
# Second carrier (2026-09-29, Tarun, relayed through the orchestrator,
|
|
359
|
+
# same STATUS.md 12p item 13): THREE marker-block shapes `lean-ctx setup`
|
|
360
|
+
# writes into shell rc/env files, all confirmed live against a real
|
|
361
|
+
# (throwaway, HOME-overridden) `lean-ctx setup --non-interactive --yes` run
|
|
362
|
+
# of the actually-installed `/usr/local/bin/lean-ctx` (3.10.5) -- byte-level
|
|
363
|
+
# (`python3 -c "open(...,'rb').read()"`), not guessed from the task
|
|
364
|
+
# description, and not assumed unchanged from an earlier, less precise
|
|
365
|
+
# `cat -A` read (that read rendered the em dash below ambiguously; the byte
|
|
366
|
+
# dump settled it as literal UTF-8 U+2014, not the text "\u{2014}"):
|
|
367
|
+
#
|
|
368
|
+
# 1. The universal shell hook, written into `~/.zshenv` and `~/.bashenv`:
|
|
369
|
+
# # >>> lean-ctx shell hook >>>
|
|
370
|
+
# ...body...
|
|
371
|
+
# # <<< lean-ctx shell hook <<<
|
|
372
|
+
# 2. `~/.zshrc`'s OWN differently-shaped block (an em dash, not `>>>`/
|
|
373
|
+
# `<<<`), sourcing a separate `~/.config/lean-ctx/shell-hook.zsh`:
|
|
374
|
+
# # lean-ctx shell hook — begin
|
|
375
|
+
# if [ -f "$HOME/.config/lean-ctx/shell-hook.zsh" ]; then
|
|
376
|
+
# . "$HOME/.config/lean-ctx/shell-hook.zsh"
|
|
377
|
+
# fi
|
|
378
|
+
# # lean-ctx shell hook — end
|
|
379
|
+
# 3. `~/.bashrc` and `~/.zshrc`'s agent-launcher aliases:
|
|
380
|
+
# # >>> lean-ctx agent aliases >>>
|
|
381
|
+
# alias claude='LEAN_CTX_AGENT=1 BASH_ENV="$HOME/.bashenv" claude'
|
|
382
|
+
# ...codebuddy/codex/gemini, same shape...
|
|
383
|
+
# # <<< lean-ctx agent aliases <<<
|
|
384
|
+
# Tarun's OWN unmarked aliases in his real `~/.zshrc` (no `LEAN_CTX_
|
|
385
|
+
# AGENT=1` prefix -- he already hand-edited them once) sit right next
|
|
386
|
+
# to where a marked block like this would live and MUST survive
|
|
387
|
+
# byte-for-byte; the strip below matches ONLY the exact marker lines,
|
|
388
|
+
# never alias syntax in general, so it cannot catch them.
|
|
389
|
+
#
|
|
390
|
+
# `~/.config/lean-ctx/` itself (the directory shape 2 above sources) is
|
|
391
|
+
# deliberately left alone -- Tarun uses the global CLI directly from his
|
|
392
|
+
# own terminal -- flagged in this header and in STATUS.md, not stripped.
|
|
393
|
+
LEAN_CTX_SHELL_HOOK_OPEN_MARKER='# >>> lean-ctx shell hook >>>'
|
|
394
|
+
LEAN_CTX_SHELL_HOOK_CLOSE_MARKER='# <<< lean-ctx shell hook <<<'
|
|
395
|
+
LEAN_CTX_ZSHRC_HOOK_OPEN_MARKER='# lean-ctx shell hook — begin'
|
|
396
|
+
LEAN_CTX_ZSHRC_HOOK_CLOSE_MARKER='# lean-ctx shell hook — end'
|
|
397
|
+
LEAN_CTX_AGENT_ALIASES_OPEN_MARKER='# >>> lean-ctx agent aliases >>>'
|
|
398
|
+
LEAN_CTX_AGENT_ALIASES_CLOSE_MARKER='# <<< lean-ctx agent aliases <<<'
|
|
399
|
+
|
|
400
|
+
# lean_ctx_shell_rc_scan_and_filter <src> <dst> <report_file> -- the ONE
|
|
401
|
+
# single-pass engine covering all three marker shapes above, replacing an
|
|
402
|
+
# earlier design that chained three separate awk invocations through bash
|
|
403
|
+
# STRING variables (`$(...)` captures). That design had two review findings
|
|
404
|
+
# against it, both closed here:
|
|
405
|
+
#
|
|
406
|
+
# Finding 2 (byte fidelity): `$(...)` unconditionally strips ALL trailing
|
|
407
|
+
# newlines from whatever it captures, and the old writer re-added exactly
|
|
408
|
+
# one via `printf '%s\n'` -- so a file with two trailing blank lines lost
|
|
409
|
+
# one, and a file with NO trailing newline gained one it never had. This
|
|
410
|
+
# version never round-trips content through a bash string at all: awk
|
|
411
|
+
# reads <src> and writes <dst> directly (`awk '...' "$src" > "$dst"`),
|
|
412
|
+
# which is already byte-exact for everything except awk's own `print`
|
|
413
|
+
# unconditionally appending an ORS to its LAST output record -- the one
|
|
414
|
+
# remaining gap, closed by the `had_trailing_nl` flag below (computed
|
|
415
|
+
# from <src>'s own true last byte, via `tail -c1`, never through a
|
|
416
|
+
# content-losing capture) and used ONLY for the final `held` value in
|
|
417
|
+
# END, which by construction is either empty or is exactly <src>'s own
|
|
418
|
+
# true final record (anything printed earlier, mid-stream, already had
|
|
419
|
+
# something come after it in the source, so it was always genuinely
|
|
420
|
+
# newline-terminated and needs no special-casing).
|
|
421
|
+
#
|
|
422
|
+
# Finding 4 (malformed nesting): a SINGLE pass with one `in_shape` state
|
|
423
|
+
# (0, or 1/2/3 for "inside shape N's block") can directly detect a
|
|
424
|
+
# duplicate/nested opening marker (any shape's open line seen while
|
|
425
|
+
# `in_shape != 0`) and an orphan closing marker (any shape's close line
|
|
426
|
+
# seen while NOT inside that shape's own block) -- both loud failures,
|
|
427
|
+
# naming <src> and the 1-based line number, before any write; the old
|
|
428
|
+
# three-separate-passes design could not see shape 2's open marker while
|
|
429
|
+
# evaluating shape 1's pass, so nothing could ever have caught this.
|
|
430
|
+
#
|
|
431
|
+
# Finding 3 (silent misses) is also closed here: every marker comparison
|
|
432
|
+
# trims trailing `[ \t\r]` first (a marker line with a trailing space, or
|
|
433
|
+
# from a CRLF file, still matches -- SPACES/TABS/CR are the only ones
|
|
434
|
+
# trimmed; a byte-for-byte different marker string is still a genuine
|
|
435
|
+
# non-match), and any line that MENTIONS "lean-ctx shell hook" or
|
|
436
|
+
# "lean-ctx agent aliases" without exactly matching one of the six known
|
|
437
|
+
# marker lines (open/close x 3 shapes) is ALSO a loud, named failure --
|
|
438
|
+
# closing the silent-miss risk of a near-miss marker (trailing space, wrong
|
|
439
|
+
# case, a stray character) leaving its carrier un-stripped with no signal
|
|
440
|
+
# at all. The trailing-`\r` trim is comparison-only: raw `$0`/`line` (never
|
|
441
|
+
# the trimmed `norm`) is what gets held/printed, so byte-for-byte
|
|
442
|
+
# preservation of surviving content -- CRLF line endings included -- holds
|
|
443
|
+
# for the marker-recognition widening too.
|
|
444
|
+
#
|
|
445
|
+
# Reports which of the three shapes were found via <report_file> (three
|
|
446
|
+
# lines, "1:present"/"1:absent", "2:...", "3:..."), a plain side file (not
|
|
447
|
+
# awk's main output stream, which is the filtered <dst>) the caller reads
|
|
448
|
+
# back to decide what to print and whether anything needs backing up.
|
|
449
|
+
lean_ctx_shell_rc_scan_and_filter() {
|
|
450
|
+
local src="$1" dst="$2" report_file="$3"
|
|
451
|
+
local had_trailing_nl=1
|
|
452
|
+
if [[ -s "$src" ]] && [[ -n "$(tail -c1 "$src" 2>/dev/null)" ]]; then
|
|
453
|
+
had_trailing_nl=0
|
|
454
|
+
fi
|
|
455
|
+
# NOTE: awk variables are openN/closeN, not open/close -- `close` is a
|
|
456
|
+
# POSIX awk BUILT-IN function name (closes a getline/print stream), and
|
|
457
|
+
# BSD awk (macOS's /usr/bin/awk) refuses to parse it as a plain variable
|
|
458
|
+
# -- a real syntax error found by actually running this on macOS.
|
|
459
|
+
awk \
|
|
460
|
+
-v srcname="$src" \
|
|
461
|
+
-v report_file="$report_file" \
|
|
462
|
+
-v had_trailing_nl="$had_trailing_nl" \
|
|
463
|
+
-v open1="$LEAN_CTX_SHELL_HOOK_OPEN_MARKER" -v close1="$LEAN_CTX_SHELL_HOOK_CLOSE_MARKER" \
|
|
464
|
+
-v open2="$LEAN_CTX_ZSHRC_HOOK_OPEN_MARKER" -v close2="$LEAN_CTX_ZSHRC_HOOK_CLOSE_MARKER" \
|
|
465
|
+
-v open3="$LEAN_CTX_AGENT_ALIASES_OPEN_MARKER" -v close3="$LEAN_CTX_AGENT_ALIASES_CLOSE_MARKER" \
|
|
466
|
+
'
|
|
467
|
+
BEGIN { in_shape = 0; have_held = 0; malformed = 0 }
|
|
468
|
+
{
|
|
469
|
+
line = $0
|
|
470
|
+
norm = line
|
|
471
|
+
sub(/[ \t\r]+$/, "", norm)
|
|
472
|
+
|
|
473
|
+
is_open1 = (norm == open1); is_close1 = (norm == close1)
|
|
474
|
+
is_open2 = (norm == open2); is_close2 = (norm == close2)
|
|
475
|
+
is_open3 = (norm == open3); is_close3 = (norm == close3)
|
|
476
|
+
is_any_open = is_open1 || is_open2 || is_open3
|
|
477
|
+
is_any_close = is_close1 || is_close2 || is_close3
|
|
478
|
+
is_known_marker = is_any_open || is_any_close
|
|
479
|
+
|
|
480
|
+
mentions = (index(norm, "lean-ctx shell hook") > 0) || (index(norm, "lean-ctx agent aliases") > 0)
|
|
481
|
+
if (mentions && !is_known_marker) {
|
|
482
|
+
printf "lean-ctx-observe-strip: %s:%d: unrecognized lean-ctx marker-like line (mentions the marker phrase but is not exactly a known marker line): %s\n", srcname, NR, line > "/dev/stderr"
|
|
483
|
+
malformed = 1
|
|
484
|
+
exit 1
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
if (in_shape != 0) {
|
|
488
|
+
if ((in_shape == 1 && is_close1) || (in_shape == 2 && is_close2) || (in_shape == 3 && is_close3)) {
|
|
489
|
+
in_shape = 0
|
|
490
|
+
next
|
|
491
|
+
}
|
|
492
|
+
if (is_any_open) {
|
|
493
|
+
printf "lean-ctx-observe-strip: %s:%d: malformed nesting -- an opening marker appears while already inside a lean-ctx marker block: %s\n", srcname, NR, line > "/dev/stderr"
|
|
494
|
+
malformed = 1
|
|
495
|
+
exit 1
|
|
496
|
+
}
|
|
497
|
+
if (is_any_close) {
|
|
498
|
+
printf "lean-ctx-observe-strip: %s:%d: malformed marker -- a closing marker for a different lean-ctx block appears here, while a different block is still open: %s\n", srcname, NR, line > "/dev/stderr"
|
|
499
|
+
malformed = 1
|
|
500
|
+
exit 1
|
|
501
|
+
}
|
|
502
|
+
next
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
if (is_any_close) {
|
|
506
|
+
printf "lean-ctx-observe-strip: %s:%d: malformed marker -- an orphan closing marker with no matching opening marker: %s\n", srcname, NR, line > "/dev/stderr"
|
|
507
|
+
malformed = 1
|
|
508
|
+
exit 1
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
shape = is_open1 ? 1 : (is_open2 ? 2 : (is_open3 ? 3 : 0))
|
|
512
|
+
if (shape != 0) {
|
|
513
|
+
held_blank = held
|
|
514
|
+
sub(/\r$/, "", held_blank)
|
|
515
|
+
if (have_held && held_blank != "") { print held }
|
|
516
|
+
have_held = 0
|
|
517
|
+
in_shape = shape
|
|
518
|
+
found[shape] = 1
|
|
519
|
+
next
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
if (have_held) { print held }
|
|
523
|
+
held = line
|
|
524
|
+
have_held = 1
|
|
525
|
+
}
|
|
526
|
+
END {
|
|
527
|
+
if (malformed) { exit 1 }
|
|
528
|
+
if (in_shape != 0) {
|
|
529
|
+
shape_label = (in_shape == 1) ? "lean-ctx shell hook" : ((in_shape == 2) ? "lean-ctx shell hook (zshrc begin/end form)" : "lean-ctx agent aliases")
|
|
530
|
+
printf "lean-ctx-observe-strip: %s: unclosed %s marker block -- opening line with no closing line before EOF\n", srcname, shape_label > "/dev/stderr"
|
|
531
|
+
exit 1
|
|
532
|
+
}
|
|
533
|
+
if (have_held) {
|
|
534
|
+
if (had_trailing_nl) { print held } else { printf "%s", held }
|
|
535
|
+
}
|
|
536
|
+
printf "1:%s\n", (found[1] ? "present" : "absent") > report_file
|
|
537
|
+
printf "2:%s\n", (found[2] ? "present" : "absent") > report_file
|
|
538
|
+
printf "3:%s\n", (found[3] ? "present" : "absent") > report_file
|
|
539
|
+
close(report_file)
|
|
540
|
+
}
|
|
541
|
+
' "$src" > "$dst"
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
# ---------------------------------------------------------------------------
|
|
545
|
+
# Third carrier, same item: global lean-ctx SKILL.md directories written by
|
|
546
|
+
# `lean-ctx setup` (confirmed live, same throwaway run as above, with
|
|
547
|
+
# auto_inject_skills enabled): $HOME/.claude/skills/lean-ctx,
|
|
548
|
+
# $HOME/.codex/skills/lean-ctx, $HOME/.cursor/skills/lean-ctx,
|
|
549
|
+
# $HOME/.config/opencode/skills/lean-ctx, $HOME/.agents/skills/lean-ctx --
|
|
550
|
+
# each a directory whose SKILL.md starts with a YAML frontmatter block
|
|
551
|
+
# whose `name:` key is exactly `lean-ctx` (confirmed verbatim:
|
|
552
|
+
# `---\nname: lean-ctx\ndescription: ...\n---`). Never deleted, only moved
|
|
553
|
+
# (this strip's directory-level unit of change is the whole directory, not
|
|
554
|
+
# individual file content, so there is no write-through-symlink story here
|
|
555
|
+
# the way there is for the JSON and shell-hook carriers above -- a
|
|
556
|
+
# symlinked skill directory is relocated by moving the symlink itself,
|
|
557
|
+
# which correctly leaves whatever real directory it pointed at completely
|
|
558
|
+
# untouched on disk, exactly as "never delete" requires).
|
|
559
|
+
LEAN_CTX_SKILL_FRONTMATTER_NAME='lean-ctx'
|
|
560
|
+
|
|
561
|
+
# lean_ctx_skill_frontmatter_name <SKILL.md path> -- prints the trimmed,
|
|
562
|
+
# quote-stripped value of the frontmatter `name:` key, or nothing if
|
|
563
|
+
# <path> does not open with a `---` frontmatter fence, or the fence closes
|
|
564
|
+
# before any `name:` key is found. Never fails (a missing/unreadable file
|
|
565
|
+
# is indistinguishable from "no name found" here -- the caller already
|
|
566
|
+
# gates on the file's existence before calling this). Every comparison
|
|
567
|
+
# strips a trailing `\r` first (final review finding 3: a CRLF-saved
|
|
568
|
+
# SKILL.md -- `---\r\n`, `name: lean-ctx\r\n` -- must still be recognized;
|
|
569
|
+
# `$0 == "---"` and the `name:` match would both silently miss a bare
|
|
570
|
+
# trailing `\r` otherwise, reporting "no name found" instead of the real
|
|
571
|
+
# value).
|
|
572
|
+
lean_ctx_skill_frontmatter_name() {
|
|
573
|
+
local path="$1"
|
|
574
|
+
awk '
|
|
575
|
+
{
|
|
576
|
+
line = $0
|
|
577
|
+
sub(/\r$/, "", line)
|
|
578
|
+
}
|
|
579
|
+
NR == 1 {
|
|
580
|
+
if (line == "---") { infm = 1; next }
|
|
581
|
+
exit
|
|
582
|
+
}
|
|
583
|
+
infm {
|
|
584
|
+
if (line == "---") { exit }
|
|
585
|
+
if (line ~ /^name:[ \t]*/) {
|
|
586
|
+
val = line
|
|
587
|
+
sub(/^name:[ \t]*/, "", val)
|
|
588
|
+
gsub(/^[\"'"'"' \t]+|[\"'"'"' \t]+$/, "", val)
|
|
589
|
+
print val
|
|
590
|
+
exit
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
' "$path" 2>/dev/null
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
# ---------------------------------------------------------------------------
|
|
597
|
+
# Final review finding 5 (defence in depth): bin/reconcile's apply path
|
|
598
|
+
# never runs this script as literal root against another user's home --
|
|
599
|
+
# macOS drops to `sudo -u "$administrator"` first (bin/reconcile:2518, the
|
|
600
|
+
# `--home "$administrator_home"` in that same call is always that SAME
|
|
601
|
+
# administrator's own home); Linux's administrator IS root, with home
|
|
602
|
+
# `/root` (`sudo -u root` is a no-op privilege-wise, and `--home` matches).
|
|
603
|
+
# This guard catches the ONE misuse those two shapes never produce: running
|
|
604
|
+
# this script directly as literal root (EUID 0) with `--home` pointing at
|
|
605
|
+
# a home it does NOT own -- which would write files owned by root into
|
|
606
|
+
# another user's per-user config, silently breaking that user's own tools.
|
|
607
|
+
# ---------------------------------------------------------------------------
|
|
608
|
+
|
|
609
|
+
# lean_ctx_observe_strip_guard_euid <euid> <home> -- prints a "refusing"
|
|
610
|
+
# message to stderr and returns 1 when <euid> is 0 (root) but <home>'s
|
|
611
|
+
# OWNER uid is not also 0; returns 0 (silent) in every other case,
|
|
612
|
+
# including <euid> != 0 (the ordinary macOS shape -- reconcile has already
|
|
613
|
+
# dropped to the administrator before this script ever runs) and <euid> ==
|
|
614
|
+
# 0 with a root-owned <home> (the ordinary Linux shape -- administrator IS
|
|
615
|
+
# root, home IS /root). A pure function of its two arguments, not of the
|
|
616
|
+
# process' own real $EUID, specifically so it can be exercised directly
|
|
617
|
+
# with fabricated uid/home pairs -- bin/lean-ctx-observe-strip itself calls
|
|
618
|
+
# it with the process' real $EUID, which is the one line that cannot be
|
|
619
|
+
# exercised without actually running as root (not available in this
|
|
620
|
+
# sandboxed test environment; per the review's own instruction, no new env
|
|
621
|
+
# var was invented to fake it -- this function signature, taking the uid as
|
|
622
|
+
# a plain argument, is the seam instead).
|
|
623
|
+
lean_ctx_observe_strip_guard_euid() {
|
|
624
|
+
local euid="$1" home="$2" owner
|
|
625
|
+
[[ "$euid" == 0 ]] || return 0
|
|
626
|
+
owner="$(lean_ctx_observe_hook_stat_owner "$home" 2>/dev/null)" || {
|
|
627
|
+
echo "lean-ctx-observe-strip: refusing -- running as root (EUID=0) but could not determine the owner of --home $home" >&2
|
|
628
|
+
return 1
|
|
629
|
+
}
|
|
630
|
+
local owner_uid="${owner%%:*}"
|
|
631
|
+
[[ "$owner_uid" == 0 ]] && return 0
|
|
632
|
+
echo "lean-ctx-observe-strip: refusing -- running as root (EUID=0) against --home $home, owned by uid $owner_uid, not root. bin/reconcile's apply path always runs this script via 'sudo -u <administrator>' (or, on Linux, as root against root's own /root), so it should never execute as literal root against a non-root user's home. Re-run as that user, or via 'sudo -u <that user> lean-ctx-observe-strip --home $home --mode ...'." >&2
|
|
633
|
+
return 1
|
|
634
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
export PATH="/usr/local/bin:/opt/homebrew/bin:/home/linuxbrew/.linuxbrew/bin:/usr/bin:/bin:/usr/sbin:/sbin"
|
|
5
|
+
|
|
6
|
+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
7
|
+
repo_root="$(cd "$script_dir/.." && pwd)"
|
|
8
|
+
|
|
9
|
+
command -v bun >/dev/null 2>&1 || {
|
|
10
|
+
echo "managed-settings requires bun; reconcile the global-tools manifest first" >&2
|
|
11
|
+
exit 1
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exec bun "$repo_root/packages/fleet/src/managed-settings.ts" "$@"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
export PATH="/usr/local/bin:/opt/homebrew/bin:/home/linuxbrew/.linuxbrew/bin:/usr/bin:/bin:/usr/sbin:/sbin"
|
|
5
|
+
|
|
6
|
+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
7
|
+
repo_root="$(cd "$script_dir/.." && pwd)"
|
|
8
|
+
|
|
9
|
+
command -v bun >/dev/null 2>&1 || {
|
|
10
|
+
echo "opencode-hooks requires bun; reconcile the global-tools manifest first" >&2
|
|
11
|
+
exit 1
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exec bun "$repo_root/packages/agent-settings/src/opencode-hooks.ts" "$@"
|