codictator 0.0.0 → 0.1.2
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/LICENSE +9 -0
- package/README.md +5 -0
- package/dist/builtin-packs/core/fixtures/agent-assets-present/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/agent-assets-present/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/arch-boundaries/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/arch-boundaries/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/arch-module-mapped/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/arch-module-mapped/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/arch-module-size/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/arch-module-size/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/arch-no-cycles/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/arch-no-cycles/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/arch-profile-declared/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/arch-profile-declared/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/arch-public-entry/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/arch-public-entry/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/branch-protection/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/branch-protection/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/bug-registry/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/bug-registry/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/bug-rows-immutable/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/bug-rows-immutable/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/ci-actions-pinned/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/ci-actions-pinned/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/ci-present/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/ci-present/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/ci-required-check/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/ci-required-check/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/compiler-strict/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/compiler-strict/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/complexity/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/complexity/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/context-hard-band/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/context-hard-band/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/context-soft-band/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/context-soft-band/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/conventional-commit/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/conventional-commit/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/coverage-floor/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/coverage-floor/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/custom-pack-selftest/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/custom-pack-selftest/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dangerous-shell/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dangerous-shell/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dead-code/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dead-code/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dep-exact-pin/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dep-exact-pin/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dep-latest-stable/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dep-latest-stable/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dep-license/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dep-license/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dep-lockfile/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dep-lockfile/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dep-new-needs-reason/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dep-new-needs-reason/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dep-no-deprecated/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dep-no-deprecated/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dep-no-vulnerable/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dep-no-vulnerable/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dep-one-per-capability/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/dep-one-per-capability/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/diagnose-before-fix/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/diagnose-before-fix/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-breadth/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-breadth/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-density/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-density/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-links-valid/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-links-valid/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-no-corpus-counts/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-no-corpus-counts/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-no-inline-changelog/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-no-inline-changelog/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-one-level/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-one-level/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-placement/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-placement/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-router-leaf/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-router-leaf/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-single-owner/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-single-owner/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-size/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/doc-size/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/duplication/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/duplication/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/engine-version-match/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/engine-version-match/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/file-naming/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/file-naming/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/file-size/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/file-size/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/function-size/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/function-size/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/graph-before-scan/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/graph-before-scan/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/guardrail-manifest/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/guardrail-manifest/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/history-append-only/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/history-append-only/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/history-entry/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/history-entry/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/history-entry-complete/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/history-entry-complete/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/hooks-active/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/hooks-active/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/loop-breaker/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/loop-breaker/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/max-file-bytes/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/max-file-bytes/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/mcp-declared/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/mcp-declared/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-assertion-loss/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-assertion-loss/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-baseline-raise/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-baseline-raise/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-bypass/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-bypass/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-fixture-shrink/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-fixture-shrink/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-guard-removal/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-guard-removal/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-new-suppressions/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-new-suppressions/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-secret-reads/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-secret-reads/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-secrets/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-secrets/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-skipped-tests/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-skipped-tests/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-speculative-abstraction/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-speculative-abstraction/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-threshold-lowering/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/no-threshold-lowering/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/perf-budgets/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/perf-budgets/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/ratchet-touched-improves/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/ratchet-touched-improves/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/read-dedupe/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/read-dedupe/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/red-before-green/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/red-before-green/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/regression-test-for-fix/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/regression-test-for-fix/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/remediation-step-size/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/remediation-step-size/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/repo-hygiene/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/repo-hygiene/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/review-gate/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/review-gate/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/review-round-cap/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/review-round-cap/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/session-tool-call-limit/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/session-tool-call-limit/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/spec-trace/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/spec-trace/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/test-command-intact/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/test-command-intact/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/test-kinds-by-scenario/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/test-kinds-by-scenario/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/waivers-valid/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/waivers-valid/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/workflow-gates/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/workflow-gates/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/write-confinement/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/write-confinement/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/writes-within-plan/passing/basic/case.json +10 -0
- package/dist/builtin-packs/core/fixtures/writes-within-plan/violating/basic/case.json +10 -0
- package/dist/builtin-packs/core/index.ts +8 -0
- package/dist/builtin-packs/core/pack.json +2057 -0
- package/dist/builtin-packs/dotnet/index.ts +47 -0
- package/dist/builtin-packs/python/extract.ts +245 -0
- package/dist/builtin-packs/python/fixtures/lint/passing/basic/case.json +10 -0
- package/dist/builtin-packs/python/fixtures/lint/violating/basic/case.json +10 -0
- package/dist/builtin-packs/python/fixtures/no-phantom-import/passing/basic/case.json +12 -0
- package/dist/builtin-packs/python/fixtures/no-phantom-import/violating/basic/case.json +11 -0
- package/dist/builtin-packs/python/fixtures/security-patterns/passing/basic/case.json +10 -0
- package/dist/builtin-packs/python/fixtures/security-patterns/violating/basic/case.json +10 -0
- package/dist/builtin-packs/python/fixtures/typecheck/passing/basic/case.json +10 -0
- package/dist/builtin-packs/python/fixtures/typecheck/violating/basic/case.json +10 -0
- package/dist/builtin-packs/python/index.ts +57 -0
- package/dist/builtin-packs/python/pack.json +116 -0
- package/dist/builtin-packs/typescript/extract-clauses.ts +153 -0
- package/dist/builtin-packs/typescript/extract-literals.ts +111 -0
- package/dist/builtin-packs/typescript/extract-words.ts +79 -0
- package/dist/builtin-packs/typescript/extract.ts +77 -0
- package/dist/builtin-packs/typescript/fixtures/lint/passing/basic/case.json +10 -0
- package/dist/builtin-packs/typescript/fixtures/lint/violating/basic/case.json +10 -0
- package/dist/builtin-packs/typescript/fixtures/no-phantom-import/passing/basic/case.json +10 -0
- package/dist/builtin-packs/typescript/fixtures/no-phantom-import/passing/host-provided/case.json +10 -0
- package/dist/builtin-packs/typescript/fixtures/no-phantom-import/violating/basic/case.json +10 -0
- package/dist/builtin-packs/typescript/fixtures/no-phantom-import/violating/host-provided/case.json +10 -0
- package/dist/builtin-packs/typescript/fixtures/security-patterns/passing/basic/case.json +10 -0
- package/dist/builtin-packs/typescript/fixtures/security-patterns/violating/basic/case.json +10 -0
- package/dist/builtin-packs/typescript/fixtures/typecheck/passing/basic/case.json +10 -0
- package/dist/builtin-packs/typescript/fixtures/typecheck/violating/basic/case.json +10 -0
- package/dist/builtin-packs/typescript/index.ts +85 -0
- package/dist/builtin-packs/typescript/lex.ts +199 -0
- package/dist/builtin-packs/typescript/measures-exports.ts +173 -0
- package/dist/builtin-packs/typescript/measures-functions.ts +138 -0
- package/dist/builtin-packs/typescript/measures.ts +10 -0
- package/dist/builtin-packs/typescript/naming.ts +47 -0
- package/dist/builtin-packs/typescript/pack.json +169 -0
- package/dist/builtin-packs/typescript/patterns.ts +93 -0
- package/dist/builtin-packs/typescript/resolve.ts +224 -0
- package/dist/builtin-packs/typescript/strict.ts +177 -0
- package/dist/builtin-packs/typescript/titles.ts +184 -0
- package/dist/cli/baseline.d.ts +3 -0
- package/dist/cli/baseline.js +67 -0
- package/dist/cli/ci-bot-change.d.ts +3 -0
- package/dist/cli/ci-bot-change.js +54 -0
- package/dist/cli/ci-range.d.ts +18 -0
- package/dist/cli/ci-range.js +228 -0
- package/dist/cli/ci-summary.d.ts +3 -0
- package/dist/cli/ci-summary.js +45 -0
- package/dist/cli/ci.d.ts +4 -0
- package/dist/cli/ci.js +195 -0
- package/dist/cli/commands.d.ts +5 -0
- package/dist/cli/commands.js +39 -0
- package/dist/cli/deps.d.ts +3 -0
- package/dist/cli/deps.js +115 -0
- package/dist/cli/drift.d.ts +11 -0
- package/dist/cli/drift.js +91 -0
- package/dist/cli/evaluate.d.ts +20 -0
- package/dist/cli/evaluate.js +213 -0
- package/dist/cli/gate-scope.d.ts +10 -0
- package/dist/cli/gate-scope.js +82 -0
- package/dist/cli/git-hook.d.ts +3 -0
- package/dist/cli/git-hook.js +179 -0
- package/dist/cli/guardrail.d.ts +5 -0
- package/dist/cli/guardrail.js +190 -0
- package/dist/cli/index.d.ts +12 -0
- package/dist/cli/index.js +198 -0
- package/dist/cli/init-plan.d.ts +23 -0
- package/dist/cli/init-plan.js +135 -0
- package/dist/cli/init.d.ts +3 -0
- package/dist/cli/init.js +122 -0
- package/dist/cli/inspect-status.d.ts +8 -0
- package/dist/cli/inspect-status.js +164 -0
- package/dist/cli/inspect.d.ts +5 -0
- package/dist/cli/inspect.js +98 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +60 -0
- package/dist/cli/pack-adapters.d.ts +3 -0
- package/dist/cli/pack-adapters.js +81 -0
- package/dist/cli/packs.d.ts +6 -0
- package/dist/cli/packs.js +131 -0
- package/dist/cli/plan-launcher.d.ts +1 -0
- package/dist/cli/plan-launcher.js +222 -0
- package/dist/cli/plan.d.ts +25 -0
- package/dist/cli/plan.js +121 -0
- package/dist/cli/proofs-test.d.ts +3 -0
- package/dist/cli/proofs-test.js +77 -0
- package/dist/cli/proofs.d.ts +3 -0
- package/dist/cli/proofs.js +168 -0
- package/dist/cli/remediation.d.ts +3 -0
- package/dist/cli/remediation.js +107 -0
- package/dist/cli/report.d.ts +4 -0
- package/dist/cli/report.js +93 -0
- package/dist/cli/serve-eval.d.ts +2 -0
- package/dist/cli/serve-eval.js +165 -0
- package/dist/cli/serve-log.d.ts +2 -0
- package/dist/cli/serve-log.js +150 -0
- package/dist/cli/serve-methods.d.ts +2 -0
- package/dist/cli/serve-methods.js +181 -0
- package/dist/cli/serve-protocol.d.ts +35 -0
- package/dist/cli/serve-protocol.js +97 -0
- package/dist/cli/serve-run.d.ts +9 -0
- package/dist/cli/serve-run.js +135 -0
- package/dist/cli/serve-server.d.ts +5 -0
- package/dist/cli/serve-server.js +120 -0
- package/dist/cli/serve-shared.d.ts +34 -0
- package/dist/cli/serve-shared.js +20 -0
- package/dist/cli/serve-status.d.ts +2 -0
- package/dist/cli/serve-status.js +130 -0
- package/dist/cli/serve-transport.d.ts +2 -0
- package/dist/cli/serve-transport.js +114 -0
- package/dist/cli/shared.d.ts +35 -0
- package/dist/cli/shared.js +181 -0
- package/dist/cli/task-advance.d.ts +3 -0
- package/dist/cli/task-advance.js +144 -0
- package/dist/cli/task-phases.d.ts +3 -0
- package/dist/cli/task-phases.js +77 -0
- package/dist/cli/tasks.d.ts +12 -0
- package/dist/cli/tasks.js +176 -0
- package/dist/cli/transparency.d.ts +4 -0
- package/dist/cli/transparency.js +197 -0
- package/dist/cli/waivers.d.ts +3 -0
- package/dist/cli/waivers.js +195 -0
- package/dist/features/adapters/claude-code.d.ts +8 -0
- package/dist/features/adapters/claude-code.js +198 -0
- package/dist/features/adapters/claude-shaped.d.ts +3 -0
- package/dist/features/adapters/claude-shaped.js +176 -0
- package/dist/features/adapters/codex-cli.d.ts +8 -0
- package/dist/features/adapters/codex-cli.js +180 -0
- package/dist/features/adapters/contract.d.ts +104 -0
- package/dist/features/adapters/contract.js +17 -0
- package/dist/features/adapters/copilot-capabilities.d.ts +2 -0
- package/dist/features/adapters/copilot-capabilities.js +46 -0
- package/dist/features/adapters/copilot.d.ts +8 -0
- package/dist/features/adapters/copilot.js +207 -0
- package/dist/features/adapters/cursor.d.ts +8 -0
- package/dist/features/adapters/cursor.js +245 -0
- package/dist/features/adapters/custom-event.d.ts +3 -0
- package/dist/features/adapters/custom-event.js +180 -0
- package/dist/features/adapters/custom-load.d.ts +3 -0
- package/dist/features/adapters/custom-load.js +185 -0
- package/dist/features/adapters/custom-shape.d.ts +21 -0
- package/dist/features/adapters/custom-shape.js +87 -0
- package/dist/features/adapters/custom.d.ts +9 -0
- package/dist/features/adapters/custom.js +130 -0
- package/dist/features/adapters/effective-cache.d.ts +5 -0
- package/dist/features/adapters/effective-cache.js +45 -0
- package/dist/features/adapters/gemini-cli.d.ts +6 -0
- package/dist/features/adapters/gemini-cli.js +160 -0
- package/dist/features/adapters/gemini-tables.d.ts +7 -0
- package/dist/features/adapters/gemini-tables.js +104 -0
- package/dist/features/adapters/hook-dispatch.d.ts +7 -0
- package/dist/features/adapters/hook-dispatch.js +97 -0
- package/dist/features/adapters/hook-injection.d.ts +12 -0
- package/dist/features/adapters/hook-injection.js +75 -0
- package/dist/features/adapters/hook-load.d.ts +15 -0
- package/dist/features/adapters/hook-load.js +152 -0
- package/dist/features/adapters/hook-scope.d.ts +3 -0
- package/dist/features/adapters/hook-scope.js +54 -0
- package/dist/features/adapters/index.d.ts +22 -0
- package/dist/features/adapters/index.js +86 -0
- package/dist/features/adapters/muse-code.d.ts +8 -0
- package/dist/features/adapters/muse-code.js +223 -0
- package/dist/features/adapters/opencode-bridge.d.ts +1 -0
- package/dist/features/adapters/opencode-bridge.js +230 -0
- package/dist/features/adapters/opencode-capabilities.d.ts +2 -0
- package/dist/features/adapters/opencode-capabilities.js +47 -0
- package/dist/features/adapters/opencode-parse.d.ts +3 -0
- package/dist/features/adapters/opencode-parse.js +137 -0
- package/dist/features/adapters/opencode-tables.d.ts +5 -0
- package/dist/features/adapters/opencode-tables.js +63 -0
- package/dist/features/adapters/opencode.d.ts +10 -0
- package/dist/features/adapters/opencode.js +97 -0
- package/dist/features/adapters/runtime.d.ts +25 -0
- package/dist/features/adapters/runtime.js +148 -0
- package/dist/features/adapters/universal.d.ts +7 -0
- package/dist/features/adapters/universal.js +89 -0
- package/dist/features/arch/arch-profiles.d.ts +3 -0
- package/dist/features/arch/arch-profiles.js +5 -0
- package/dist/features/arch/checks.d.ts +25 -0
- package/dist/features/arch/checks.js +173 -0
- package/dist/features/arch/codictator-modules.d.ts +4 -0
- package/dist/features/arch/codictator-modules.js +180 -0
- package/dist/features/arch/cycle-walk.d.ts +1 -0
- package/dist/features/arch/cycle-walk.js +36 -0
- package/dist/features/arch/edge-checks.d.ts +13 -0
- package/dist/features/arch/edge-checks.js +186 -0
- package/dist/features/arch/graph.d.ts +32 -0
- package/dist/features/arch/graph.js +202 -0
- package/dist/features/arch/index.d.ts +29 -0
- package/dist/features/arch/index.js +16 -0
- package/dist/features/arch/layer-rules.d.ts +3 -0
- package/dist/features/arch/layer-rules.js +38 -0
- package/dist/features/arch/module-map-validation.d.ts +3 -0
- package/dist/features/arch/module-map-validation.js +30 -0
- package/dist/features/arch/module-mapping.d.ts +15 -0
- package/dist/features/arch/module-mapping.js +184 -0
- package/dist/features/arch/profiles.d.ts +4 -0
- package/dist/features/arch/profiles.js +8 -0
- package/dist/features/audit/append.d.ts +26 -0
- package/dist/features/audit/append.js +205 -0
- package/dist/features/audit/explain-table-tail.d.ts +2 -0
- package/dist/features/audit/explain-table-tail.js +29 -0
- package/dist/features/audit/explain-table.d.ts +8 -0
- package/dist/features/audit/explain-table.js +48 -0
- package/dist/features/audit/explain.d.ts +7 -0
- package/dist/features/audit/explain.js +87 -0
- package/dist/features/audit/index.d.ts +37 -0
- package/dist/features/audit/index.js +17 -0
- package/dist/features/audit/injection-event.d.ts +11 -0
- package/dist/features/audit/injection-event.js +17 -0
- package/dist/features/audit/read.d.ts +8 -0
- package/dist/features/audit/read.js +62 -0
- package/dist/features/audit/summarize.d.ts +1 -0
- package/dist/features/audit/summarize.js +41 -0
- package/dist/features/audit/surfaces.d.ts +47 -0
- package/dist/features/audit/surfaces.js +165 -0
- package/dist/features/audit/token-saver-evidence.d.ts +14 -0
- package/dist/features/audit/token-saver-evidence.js +85 -0
- package/dist/features/ci/changes.d.ts +28 -0
- package/dist/features/ci/changes.js +88 -0
- package/dist/features/ci/index.d.ts +22 -0
- package/dist/features/ci/index.js +75 -0
- package/dist/features/ci/protection-read.d.ts +3 -0
- package/dist/features/ci/protection-read.js +264 -0
- package/dist/features/ci/protection.d.ts +25 -0
- package/dist/features/ci/protection.js +77 -0
- package/dist/features/ci/workflow.d.ts +23 -0
- package/dist/features/ci/workflow.js +261 -0
- package/dist/features/config/human.d.ts +4 -0
- package/dist/features/config/human.js +31 -0
- package/dist/features/config/index.d.ts +37 -0
- package/dist/features/config/index.js +129 -0
- package/dist/features/config/pack-data.d.ts +18 -0
- package/dist/features/config/pack-data.js +116 -0
- package/dist/features/config/validate-sections.d.ts +6 -0
- package/dist/features/config/validate-sections.js +198 -0
- package/dist/features/config/validate-shared.d.ts +8 -0
- package/dist/features/config/validate-shared.js +69 -0
- package/dist/features/config/validate-tunables.d.ts +1 -0
- package/dist/features/config/validate-tunables.js +89 -0
- package/dist/features/config/validate.d.ts +2 -0
- package/dist/features/config/validate.js +57 -0
- package/dist/features/deps/bots.d.ts +5 -0
- package/dist/features/deps/bots.js +39 -0
- package/dist/features/deps/capabilities.d.ts +3 -0
- package/dist/features/deps/capabilities.js +91 -0
- package/dist/features/deps/check.d.ts +18 -0
- package/dist/features/deps/check.js +70 -0
- package/dist/features/deps/dependabot.d.ts +10 -0
- package/dist/features/deps/dependabot.js +154 -0
- package/dist/features/deps/eval.d.ts +41 -0
- package/dist/features/deps/eval.js +24 -0
- package/dist/features/deps/fields.d.ts +4 -0
- package/dist/features/deps/fields.js +18 -0
- package/dist/features/deps/index.d.ts +67 -0
- package/dist/features/deps/index.js +27 -0
- package/dist/features/deps/lockfile.d.ts +8 -0
- package/dist/features/deps/lockfile.js +87 -0
- package/dist/features/deps/npm.d.ts +22 -0
- package/dist/features/deps/npm.js +172 -0
- package/dist/features/deps/npmrc.d.ts +12 -0
- package/dist/features/deps/npmrc.js +50 -0
- package/dist/features/deps/nuget.d.ts +25 -0
- package/dist/features/deps/nuget.js +112 -0
- package/dist/features/deps/osv-ranges.d.ts +12 -0
- package/dist/features/deps/osv-ranges.js +83 -0
- package/dist/features/deps/osv.d.ts +16 -0
- package/dist/features/deps/osv.js +144 -0
- package/dist/features/deps/pypi-pyproject.d.ts +7 -0
- package/dist/features/deps/pypi-pyproject.js +118 -0
- package/dist/features/deps/pypi.d.ts +29 -0
- package/dist/features/deps/pypi.js +137 -0
- package/dist/features/deps/registry.d.ts +29 -0
- package/dist/features/deps/registry.js +147 -0
- package/dist/features/deps/renovate.d.ts +15 -0
- package/dist/features/deps/renovate.js +98 -0
- package/dist/features/deps/selection.d.ts +20 -0
- package/dist/features/deps/selection.js +150 -0
- package/dist/features/deps/snapshot-verdicts.d.ts +16 -0
- package/dist/features/deps/snapshot-verdicts.js +184 -0
- package/dist/features/deps/stable.d.ts +19 -0
- package/dist/features/deps/stable.js +106 -0
- package/dist/features/deps/step-size.d.ts +7 -0
- package/dist/features/deps/step-size.js +24 -0
- package/dist/features/deps/upgrade.d.ts +35 -0
- package/dist/features/deps/upgrade.js +114 -0
- package/dist/features/deps/verdicts.d.ts +21 -0
- package/dist/features/deps/verdicts.js +219 -0
- package/dist/features/engine/evaluate.d.ts +12 -0
- package/dist/features/engine/evaluate.js +165 -0
- package/dist/features/engine/index.d.ts +21 -0
- package/dist/features/engine/index.js +24 -0
- package/dist/features/engine/message.d.ts +3 -0
- package/dist/features/engine/message.js +69 -0
- package/dist/features/engine/ratchet.d.ts +1 -0
- package/dist/features/engine/ratchet.js +63 -0
- package/dist/features/engine/run-enforcer.d.ts +4 -0
- package/dist/features/engine/run-enforcer.js +82 -0
- package/dist/features/engine/waivers.d.ts +23 -0
- package/dist/features/engine/waivers.js +169 -0
- package/dist/features/generator/draft.d.ts +7 -0
- package/dist/features/generator/draft.js +148 -0
- package/dist/features/generator/index.d.ts +22 -0
- package/dist/features/generator/index.js +8 -0
- package/dist/features/generator/llm-draft.d.ts +3 -0
- package/dist/features/generator/llm-draft.js +93 -0
- package/dist/features/generator/prompt.d.ts +25 -0
- package/dist/features/generator/prompt.js +105 -0
- package/dist/features/generator/self-test.d.ts +12 -0
- package/dist/features/generator/self-test.js +65 -0
- package/dist/features/generator/templates.d.ts +26 -0
- package/dist/features/generator/templates.js +177 -0
- package/dist/features/integrity/drift.d.ts +19 -0
- package/dist/features/integrity/drift.js +168 -0
- package/dist/features/integrity/hooks.d.ts +19 -0
- package/dist/features/integrity/hooks.js +54 -0
- package/dist/features/integrity/index.d.ts +10 -0
- package/dist/features/integrity/index.js +14 -0
- package/dist/features/integrity/manifest.d.ts +15 -0
- package/dist/features/integrity/manifest.js +26 -0
- package/dist/features/integrity/self-protection.d.ts +12 -0
- package/dist/features/integrity/self-protection.js +144 -0
- package/dist/features/llm/attempt.d.ts +17 -0
- package/dist/features/llm/attempt.js +99 -0
- package/dist/features/llm/errors.d.ts +5 -0
- package/dist/features/llm/errors.js +18 -0
- package/dist/features/llm/index.d.ts +23 -0
- package/dist/features/llm/index.js +46 -0
- package/dist/features/llm/presets.d.ts +25 -0
- package/dist/features/llm/presets.js +159 -0
- package/dist/features/llm/wire.d.ts +17 -0
- package/dist/features/llm/wire.js +163 -0
- package/dist/features/packs/accept.d.ts +7 -0
- package/dist/features/packs/accept.js +73 -0
- package/dist/features/packs/enforcers/arch-guards.d.ts +12 -0
- package/dist/features/packs/enforcers/arch-guards.js +193 -0
- package/dist/features/packs/enforcers/binding.d.ts +31 -0
- package/dist/features/packs/enforcers/binding.js +157 -0
- package/dist/features/packs/enforcers/ci-guards.d.ts +10 -0
- package/dist/features/packs/enforcers/ci-guards.js +128 -0
- package/dist/features/packs/enforcers/code-health.d.ts +9 -0
- package/dist/features/packs/enforcers/code-health.js +180 -0
- package/dist/features/packs/enforcers/code.d.ts +5 -0
- package/dist/features/packs/enforcers/code.js +128 -0
- package/dist/features/packs/enforcers/command-forbid.d.ts +8 -0
- package/dist/features/packs/enforcers/command-forbid.js +61 -0
- package/dist/features/packs/enforcers/deps-guards.d.ts +15 -0
- package/dist/features/packs/enforcers/deps-guards.js +235 -0
- package/dist/features/packs/enforcers/deps-policy-guards.d.ts +9 -0
- package/dist/features/packs/enforcers/deps-policy-guards.js +135 -0
- package/dist/features/packs/enforcers/docs-guards-measures.d.ts +9 -0
- package/dist/features/packs/enforcers/docs-guards-measures.js +117 -0
- package/dist/features/packs/enforcers/docs-guards.d.ts +11 -0
- package/dist/features/packs/enforcers/docs-guards.js +180 -0
- package/dist/features/packs/enforcers/external-attribute.d.ts +18 -0
- package/dist/features/packs/enforcers/external-attribute.js +122 -0
- package/dist/features/packs/enforcers/external-bind.d.ts +4 -0
- package/dist/features/packs/enforcers/external-bind.js +172 -0
- package/dist/features/packs/enforcers/external-check.d.ts +7 -0
- package/dist/features/packs/enforcers/external-check.js +131 -0
- package/dist/features/packs/enforcers/external-output.d.ts +30 -0
- package/dist/features/packs/enforcers/external-output.js +144 -0
- package/dist/features/packs/enforcers/external-probe.d.ts +4 -0
- package/dist/features/packs/enforcers/external-probe.js +65 -0
- package/dist/features/packs/enforcers/external-runs.d.ts +33 -0
- package/dist/features/packs/enforcers/external-runs.js +162 -0
- package/dist/features/packs/enforcers/external-sarif.d.ts +3 -0
- package/dist/features/packs/enforcers/external-sarif.js +103 -0
- package/dist/features/packs/enforcers/external.d.ts +39 -0
- package/dist/features/packs/enforcers/external.js +11 -0
- package/dist/features/packs/enforcers/gate-guards.d.ts +12 -0
- package/dist/features/packs/enforcers/gate-guards.js +170 -0
- package/dist/features/packs/enforcers/health-abstraction.d.ts +5 -0
- package/dist/features/packs/enforcers/health-abstraction.js +126 -0
- package/dist/features/packs/enforcers/health-duplication.d.ts +5 -0
- package/dist/features/packs/enforcers/health-duplication.js +197 -0
- package/dist/features/packs/enforcers/health-lex-imports.d.ts +5 -0
- package/dist/features/packs/enforcers/health-lex-imports.js +225 -0
- package/dist/features/packs/enforcers/health-lex-template.d.ts +10 -0
- package/dist/features/packs/enforcers/health-lex-template.js +67 -0
- package/dist/features/packs/enforcers/health-lex.d.ts +8 -0
- package/dist/features/packs/enforcers/health-lex.js +227 -0
- package/dist/features/packs/enforcers/health-markers.d.ts +3 -0
- package/dist/features/packs/enforcers/health-markers.js +31 -0
- package/dist/features/packs/enforcers/health-measures.d.ts +24 -0
- package/dist/features/packs/enforcers/health-measures.js +214 -0
- package/dist/features/packs/enforcers/health-refs.d.ts +6 -0
- package/dist/features/packs/enforcers/health-refs.js +61 -0
- package/dist/features/packs/enforcers/integrity-guards-repo.d.ts +6 -0
- package/dist/features/packs/enforcers/integrity-guards-repo.js +189 -0
- package/dist/features/packs/enforcers/integrity-guards.d.ts +12 -0
- package/dist/features/packs/enforcers/integrity-guards.js +202 -0
- package/dist/features/packs/enforcers/jsonkey.d.ts +13 -0
- package/dist/features/packs/enforcers/jsonkey.js +95 -0
- package/dist/features/packs/enforcers/parametric.d.ts +7 -0
- package/dist/features/packs/enforcers/parametric.js +138 -0
- package/dist/features/packs/enforcers/pattern.d.ts +11 -0
- package/dist/features/packs/enforcers/pattern.js +88 -0
- package/dist/features/packs/enforcers/placement.d.ts +10 -0
- package/dist/features/packs/enforcers/placement.js +54 -0
- package/dist/features/packs/enforcers/py-checks.d.ts +7 -0
- package/dist/features/packs/enforcers/py-checks.js +131 -0
- package/dist/features/packs/enforcers/py-lex.d.ts +10 -0
- package/dist/features/packs/enforcers/py-lex.js +271 -0
- package/dist/features/packs/enforcers/py-phantom.d.ts +6 -0
- package/dist/features/packs/enforcers/py-phantom.js +163 -0
- package/dist/features/packs/enforcers/py-pins.d.ts +16 -0
- package/dist/features/packs/enforcers/py-pins.js +184 -0
- package/dist/features/packs/enforcers/py-security-patterns.d.ts +18 -0
- package/dist/features/packs/enforcers/py-security-patterns.js +70 -0
- package/dist/features/packs/enforcers/records-guards.d.ts +12 -0
- package/dist/features/packs/enforcers/records-guards.js +178 -0
- package/dist/features/packs/enforcers/remediation-guards.d.ts +6 -0
- package/dist/features/packs/enforcers/remediation-guards.js +42 -0
- package/dist/features/packs/enforcers/required.d.ts +10 -0
- package/dist/features/packs/enforcers/required.js +65 -0
- package/dist/features/packs/enforcers/secret-scan.d.ts +22 -0
- package/dist/features/packs/enforcers/secret-scan.js +179 -0
- package/dist/features/packs/enforcers/shell-analyse.d.ts +14 -0
- package/dist/features/packs/enforcers/shell-analyse.js +105 -0
- package/dist/features/packs/enforcers/sizes.d.ts +10 -0
- package/dist/features/packs/enforcers/sizes.js +82 -0
- package/dist/features/packs/enforcers/steering-guards.d.ts +11 -0
- package/dist/features/packs/enforcers/steering-guards.js +162 -0
- package/dist/features/packs/enforcers/testing-guards.d.ts +10 -0
- package/dist/features/packs/enforcers/testing-guards.js +118 -0
- package/dist/features/packs/enforcers/ts-checks.d.ts +7 -0
- package/dist/features/packs/enforcers/ts-checks.js +101 -0
- package/dist/features/packs/enforcers/ts-phantom-host.d.ts +11 -0
- package/dist/features/packs/enforcers/ts-phantom-host.js +155 -0
- package/dist/features/packs/enforcers/ts-phantom.d.ts +6 -0
- package/dist/features/packs/enforcers/ts-phantom.js +117 -0
- package/dist/features/packs/enforcers/ts-security-patterns.d.ts +18 -0
- package/dist/features/packs/enforcers/ts-security-patterns.js +93 -0
- package/dist/features/packs/enforcers/workflow-guards.d.ts +10 -0
- package/dist/features/packs/enforcers/workflow-guards.js +117 -0
- package/dist/features/packs/enforcers/write-confine.d.ts +13 -0
- package/dist/features/packs/enforcers/write-confine.js +131 -0
- package/dist/features/packs/hashes.d.ts +6 -0
- package/dist/features/packs/hashes.js +84 -0
- package/dist/features/packs/index.d.ts +22 -0
- package/dist/features/packs/index.js +15 -0
- package/dist/features/packs/loader.d.ts +13 -0
- package/dist/features/packs/loader.js +205 -0
- package/dist/features/packs/manifest.d.ts +17 -0
- package/dist/features/packs/manifest.js +180 -0
- package/dist/features/packs/params.d.ts +2 -0
- package/dist/features/packs/params.js +90 -0
- package/dist/features/packs/registry.d.ts +11 -0
- package/dist/features/packs/registry.js +136 -0
- package/dist/features/packs/selftest.d.ts +3 -0
- package/dist/features/packs/selftest.js +127 -0
- package/dist/features/records/bug-grammar.d.ts +17 -0
- package/dist/features/records/bug-grammar.js +128 -0
- package/dist/features/records/bug-registry.d.ts +9 -0
- package/dist/features/records/bug-registry.js +67 -0
- package/dist/features/records/bug-rows-immutable.d.ts +3 -0
- package/dist/features/records/bug-rows-immutable.js +52 -0
- package/dist/features/records/bugs.d.ts +2 -0
- package/dist/features/records/bugs.js +24 -0
- package/dist/features/records/docs-lines.d.ts +16 -0
- package/dist/features/records/docs-lines.js +36 -0
- package/dist/features/records/docs-prose.d.ts +14 -0
- package/dist/features/records/docs-prose.js +252 -0
- package/dist/features/records/docs-structure.d.ts +17 -0
- package/dist/features/records/docs-structure.js +223 -0
- package/dist/features/records/docs.d.ts +9 -0
- package/dist/features/records/docs.js +238 -0
- package/dist/features/records/history-checks.d.ts +6 -0
- package/dist/features/records/history-checks.js +94 -0
- package/dist/features/records/history-parse.d.ts +16 -0
- package/dist/features/records/history-parse.js +101 -0
- package/dist/features/records/history-scope.d.ts +5 -0
- package/dist/features/records/history-scope.js +86 -0
- package/dist/features/records/history.d.ts +3 -0
- package/dist/features/records/history.js +5 -0
- package/dist/features/records/index.d.ts +8 -0
- package/dist/features/records/index.js +11 -0
- package/dist/features/remediation/adoption.d.ts +32 -0
- package/dist/features/remediation/adoption.js +131 -0
- package/dist/features/remediation/index.d.ts +12 -0
- package/dist/features/remediation/index.js +21 -0
- package/dist/features/remediation/plan-chains.d.ts +3 -0
- package/dist/features/remediation/plan-chains.js +111 -0
- package/dist/features/remediation/plan-generate.d.ts +3 -0
- package/dist/features/remediation/plan-generate.js +129 -0
- package/dist/features/remediation/plan-kinds.d.ts +32 -0
- package/dist/features/remediation/plan-kinds.js +42 -0
- package/dist/features/remediation/plan-markers.d.ts +2 -0
- package/dist/features/remediation/plan-markers.js +155 -0
- package/dist/features/remediation/plan-merge.d.ts +6 -0
- package/dist/features/remediation/plan-merge.js +33 -0
- package/dist/features/remediation/plan.d.ts +4 -0
- package/dist/features/remediation/plan.js +7 -0
- package/dist/features/remediation/step-floor.d.ts +5 -0
- package/dist/features/remediation/step-floor.js +76 -0
- package/dist/features/remediation/step-gates.d.ts +18 -0
- package/dist/features/remediation/step-gates.js +77 -0
- package/dist/features/remediation/step-split.d.ts +12 -0
- package/dist/features/remediation/step-split.js +75 -0
- package/dist/features/remediation/steps.d.ts +3 -0
- package/dist/features/remediation/steps.js +6 -0
- package/dist/features/remediation/types.d.ts +37 -0
- package/dist/features/remediation/types.js +1 -0
- package/dist/features/security/index.d.ts +12 -0
- package/dist/features/security/index.js +142 -0
- package/dist/features/steering/agent-assets.d.ts +7 -0
- package/dist/features/steering/agent-assets.js +75 -0
- package/dist/features/steering/budgets.d.ts +20 -0
- package/dist/features/steering/budgets.js +86 -0
- package/dist/features/steering/checks.d.ts +7 -0
- package/dist/features/steering/checks.js +67 -0
- package/dist/features/steering/context-file.d.ts +11 -0
- package/dist/features/steering/context-file.js +107 -0
- package/dist/features/steering/graph-scan.d.ts +7 -0
- package/dist/features/steering/graph-scan.js +17 -0
- package/dist/features/steering/index.d.ts +30 -0
- package/dist/features/steering/index.js +45 -0
- package/dist/features/steering/injection.d.ts +23 -0
- package/dist/features/steering/injection.js +124 -0
- package/dist/features/steering/mcp.d.ts +2 -0
- package/dist/features/steering/mcp.js +18 -0
- package/dist/features/steering/precedence.d.ts +10 -0
- package/dist/features/steering/precedence.js +28 -0
- package/dist/features/steering/read-cache.d.ts +13 -0
- package/dist/features/steering/read-cache.js +51 -0
- package/dist/features/testing/base.d.ts +1 -0
- package/dist/features/testing/base.js +8 -0
- package/dist/features/testing/covers.d.ts +8 -0
- package/dist/features/testing/covers.js +50 -0
- package/dist/features/testing/evaluate.d.ts +19 -0
- package/dist/features/testing/evaluate.js +47 -0
- package/dist/features/testing/index.d.ts +10 -0
- package/dist/features/testing/index.js +13 -0
- package/dist/features/testing/integrity.d.ts +28 -0
- package/dist/features/testing/integrity.js +140 -0
- package/dist/features/testing/ledger.d.ts +11 -0
- package/dist/features/testing/ledger.js +51 -0
- package/dist/features/testing/proofs.d.ts +26 -0
- package/dist/features/testing/proofs.js +88 -0
- package/dist/features/testing/report.d.ts +6 -0
- package/dist/features/testing/report.js +16 -0
- package/dist/features/testing/scenarios.d.ts +34 -0
- package/dist/features/testing/scenarios.js +90 -0
- package/dist/features/testing/tap-parser.d.ts +9 -0
- package/dist/features/testing/tap-parser.js +84 -0
- package/dist/features/testing/trace.d.ts +23 -0
- package/dist/features/testing/trace.js +110 -0
- package/dist/features/workflow/index.d.ts +14 -0
- package/dist/features/workflow/index.js +19 -0
- package/dist/features/workflow/loop.d.ts +5 -0
- package/dist/features/workflow/loop.js +36 -0
- package/dist/features/workflow/phases.d.ts +10 -0
- package/dist/features/workflow/phases.js +181 -0
- package/dist/features/workflow/review.d.ts +25 -0
- package/dist/features/workflow/review.js +112 -0
- package/dist/features/workflow/tasks.d.ts +73 -0
- package/dist/features/workflow/tasks.js +80 -0
- package/dist/features/workflow/writes.d.ts +8 -0
- package/dist/features/workflow/writes.js +96 -0
- package/dist/kernel/clock.d.ts +4 -0
- package/dist/kernel/clock.js +5 -0
- package/dist/kernel/config-keys.d.ts +2 -0
- package/dist/kernel/config-keys.js +5 -0
- package/dist/kernel/config-toml-keys.d.ts +2 -0
- package/dist/kernel/config-toml-keys.js +237 -0
- package/dist/kernel/config-yaml-keys.d.ts +2 -0
- package/dist/kernel/config-yaml-keys.js +177 -0
- package/dist/kernel/contracts.d.ts +76 -0
- package/dist/kernel/contracts.js +9 -0
- package/dist/kernel/entry.d.ts +1 -0
- package/dist/kernel/entry.js +31 -0
- package/dist/kernel/env.d.ts +4 -0
- package/dist/kernel/env.js +5 -0
- package/dist/kernel/errors.d.ts +7 -0
- package/dist/kernel/errors.js +6 -0
- package/dist/kernel/fs-confine.d.ts +14 -0
- package/dist/kernel/fs-confine.js +129 -0
- package/dist/kernel/fs-errors.d.ts +8 -0
- package/dist/kernel/fs-errors.js +37 -0
- package/dist/kernel/fs.d.ts +28 -0
- package/dist/kernel/fs.js +245 -0
- package/dist/kernel/git.d.ts +16 -0
- package/dist/kernel/git.js +125 -0
- package/dist/kernel/glob.d.ts +1 -0
- package/dist/kernel/glob.js +178 -0
- package/dist/kernel/hash.d.ts +3 -0
- package/dist/kernel/hash.js +12 -0
- package/dist/kernel/host.d.ts +3 -0
- package/dist/kernel/host.js +48 -0
- package/dist/kernel/index.d.ts +115 -0
- package/dist/kernel/index.js +33 -0
- package/dist/kernel/json.d.ts +4 -0
- package/dist/kernel/json.js +68 -0
- package/dist/kernel/net-allow.d.ts +8 -0
- package/dist/kernel/net-allow.js +45 -0
- package/dist/kernel/net-fetch.d.ts +5 -0
- package/dist/kernel/net-fetch.js +135 -0
- package/dist/kernel/net.d.ts +10 -0
- package/dist/kernel/net.js +24 -0
- package/dist/kernel/path.d.ts +3 -0
- package/dist/kernel/path.js +40 -0
- package/dist/kernel/pattern.d.ts +2 -0
- package/dist/kernel/pattern.js +116 -0
- package/dist/kernel/proc.d.ts +6 -0
- package/dist/kernel/proc.js +207 -0
- package/dist/kernel/read-cache.d.ts +6 -0
- package/dist/kernel/read-cache.js +27 -0
- package/dist/kernel/redact.d.ts +1 -0
- package/dist/kernel/redact.js +206 -0
- package/dist/kernel/repo-root.d.ts +3 -0
- package/dist/kernel/repo-root.js +29 -0
- package/dist/kernel/result.d.ts +10 -0
- package/dist/kernel/result.js +6 -0
- package/dist/kernel/schema-helpers.d.ts +11 -0
- package/dist/kernel/schema-helpers.js +101 -0
- package/dist/kernel/schema.d.ts +2 -0
- package/dist/kernel/schema.js +203 -0
- package/dist/kernel/secret-paths.d.ts +3 -0
- package/dist/kernel/secret-paths.js +56 -0
- package/dist/kernel/shell-bypass.d.ts +4 -0
- package/dist/kernel/shell-bypass.js +151 -0
- package/dist/kernel/shell-cmd.d.ts +6 -0
- package/dist/kernel/shell-cmd.js +196 -0
- package/dist/kernel/shell-deny-cmd.d.ts +7 -0
- package/dist/kernel/shell-deny-cmd.js +35 -0
- package/dist/kernel/shell-deny-destroy.d.ts +7 -0
- package/dist/kernel/shell-deny-destroy.js +71 -0
- package/dist/kernel/shell-deny-escalate.d.ts +7 -0
- package/dist/kernel/shell-deny-escalate.js +96 -0
- package/dist/kernel/shell-deny-target.d.ts +4 -0
- package/dist/kernel/shell-deny-target.js +51 -0
- package/dist/kernel/shell-deny.d.ts +8 -0
- package/dist/kernel/shell-deny.js +171 -0
- package/dist/kernel/shell-scan.d.ts +3 -0
- package/dist/kernel/shell-scan.js +226 -0
- package/dist/kernel/shell-word.d.ts +15 -0
- package/dist/kernel/shell-word.js +216 -0
- package/dist/kernel/shell.d.ts +22 -0
- package/dist/kernel/shell.js +2 -0
- package/dist/kernel/stdin.d.ts +2 -0
- package/dist/kernel/stdin.js +59 -0
- package/dist/kernel/test-report.d.ts +7 -0
- package/dist/kernel/test-report.js +112 -0
- package/dist/kernel/version.d.ts +2 -0
- package/dist/kernel/version.js +46 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +19 -11
- package/schema/accepted.schema.json +20 -0
- package/schema/baseline.schema.json +17 -0
- package/schema/capability.schema.json +31 -0
- package/schema/cli/error.schema.json +15 -0
- package/schema/cli/explain.schema.json +19 -0
- package/schema/cli/report.schema.json +15 -0
- package/schema/cli/status.schema.json +51 -0
- package/schema/cli/verify.schema.json +15 -0
- package/schema/config.schema.json +43 -0
- package/schema/event-log.schema.json +52 -0
- package/schema/hook-decision.schema.json +13 -0
- package/schema/hook-event.schema.json +50 -0
- package/schema/manifest.schema.json +26 -0
- package/schema/pack-draft.schema.json +42 -0
- package/schema/pack.schema.json +70 -0
- package/schema/registry-snapshot.schema.json +41 -0
- package/schema/remediation-plan.schema.json +44 -0
- package/schema/review-findings.schema.json +25 -0
- package/schema/task-record.schema.json +49 -0
- package/schema/waivers.schema.json +29 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// SPEC §4.16.3: in-memory self-test of a drafted pack. Mirrors the §4.4.4
|
|
2
|
+
// semantics (each violating fixture must flag, each passing fixture must
|
|
3
|
+
// stay clean) without the loader, so draftPack stays pure and deterministic.
|
|
4
|
+
import { err, makeError, ok } from "../../kernel/index.js";
|
|
5
|
+
function compilePattern(spec) {
|
|
6
|
+
if (spec.pattern === undefined) {
|
|
7
|
+
return err(makeError("CDX-E205", `rule "${spec.id}" needs a pattern for a pattern enforcer`, "Give the rule a pattern in its template params, then retry the draft."));
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
return ok(new RegExp(spec.pattern));
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return err(makeError("CDX-E205", `rule "${spec.id}" carries a pattern the regex engine rejects`, "Fix the pattern so it compiles, then retry the draft."));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function testForbid(spec, expression) {
|
|
17
|
+
if (!expression.test(spec.violatingFixture)) {
|
|
18
|
+
return err(makeError("CDX-E212", `rule "${spec.id}" violating fixture yielded no finding with this rule id`, "Strengthen the drafted pattern so the violating case blocks, then retry the draft."));
|
|
19
|
+
}
|
|
20
|
+
if (expression.test(spec.passingFixture)) {
|
|
21
|
+
return err(makeError("CDX-E213", `rule "${spec.id}" passing fixture yielded a finding with this rule id`, "Narrow the drafted pattern so the passing case stays clean, then retry the draft."));
|
|
22
|
+
}
|
|
23
|
+
return ok(undefined);
|
|
24
|
+
}
|
|
25
|
+
function testRequire(spec, expression) {
|
|
26
|
+
if (expression.test(spec.violatingFixture)) {
|
|
27
|
+
return err(makeError("CDX-E212", `rule "${spec.id}" violating fixture should lack the required text`, "Fix the violating fixture so it misses the required pattern, then retry the draft."));
|
|
28
|
+
}
|
|
29
|
+
if (!expression.test(spec.passingFixture)) {
|
|
30
|
+
return err(makeError("CDX-E213", `rule "${spec.id}" passing fixture should carry the required text`, "Fix the passing fixture so it carries the required pattern, then retry the draft."));
|
|
31
|
+
}
|
|
32
|
+
return ok(undefined);
|
|
33
|
+
}
|
|
34
|
+
function testSpec(spec) {
|
|
35
|
+
if (spec.violatingFixture.length === 0) {
|
|
36
|
+
return err(makeError("CDX-E211", `rule "${spec.id}" has no violating fixture`, "Add a violating fixture, then retry the draft."));
|
|
37
|
+
}
|
|
38
|
+
if (spec.remediation.length === 0 || spec.remediation === spec.reason) {
|
|
39
|
+
return err(makeError("CDX-E214", `rule "${spec.id}" remediation is empty or repeats its reason`, "Write remediation as Do-instead text distinct from Why, then retry the draft."));
|
|
40
|
+
}
|
|
41
|
+
if (spec.kind !== "pattern-forbid" && spec.kind !== "pattern-require") {
|
|
42
|
+
return err(makeError("CDX-E205", `rule "${spec.id}" needs the loader-backed self-test for kind "${spec.kind}"`, "Draft a pattern template offline, or run the pack self-test after materialising."));
|
|
43
|
+
}
|
|
44
|
+
const compiled = compilePattern(spec);
|
|
45
|
+
if (!compiled.ok) {
|
|
46
|
+
return err(compiled.error);
|
|
47
|
+
}
|
|
48
|
+
if (spec.kind === "pattern-require") {
|
|
49
|
+
return testRequire(spec, compiled.value);
|
|
50
|
+
}
|
|
51
|
+
return testForbid(spec, compiled.value);
|
|
52
|
+
}
|
|
53
|
+
// SPEC §4.16.3: self-test every drafted rule; the first failure names its
|
|
54
|
+
// rule so the report says which fixture failed. Rules run in id order so the
|
|
55
|
+
// first failure is deterministic.
|
|
56
|
+
export function selfTestSpecs(specs) {
|
|
57
|
+
const ordered = [...specs].sort((a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
|
|
58
|
+
for (const spec of ordered) {
|
|
59
|
+
const tested = testSpec(spec);
|
|
60
|
+
if (!tested.ok) {
|
|
61
|
+
return err(tested.error);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return ok(undefined);
|
|
65
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Result } from "../../kernel/index.ts";
|
|
2
|
+
export interface TemplateDecl {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly kind: string;
|
|
5
|
+
readonly description: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function lookupTemplate(id: string): TemplateDecl | undefined;
|
|
8
|
+
export declare function catalogueSummary(): string;
|
|
9
|
+
export type DraftTier = "floor" | "tunable";
|
|
10
|
+
export interface DraftRule {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly template: string;
|
|
13
|
+
readonly params: Readonly<Record<string, unknown>>;
|
|
14
|
+
readonly statement: string;
|
|
15
|
+
readonly reason: string;
|
|
16
|
+
readonly remediation: string;
|
|
17
|
+
readonly tier: DraftTier;
|
|
18
|
+
readonly violatingFixture: string;
|
|
19
|
+
readonly passingFixture: string;
|
|
20
|
+
}
|
|
21
|
+
export interface PackDraft {
|
|
22
|
+
readonly packId: string;
|
|
23
|
+
readonly description: string;
|
|
24
|
+
readonly rules: ReadonlyArray<DraftRule>;
|
|
25
|
+
}
|
|
26
|
+
export declare function narrowPackDraft(value: unknown, expectedPackId: string, floorRuleId?: string): Result<PackDraft>;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// SPEC §4.16.2: the template catalogue and the pack-draft shape (§4.16.3).
|
|
2
|
+
// Validation here mirrors schema/pack-draft.schema.json so the LLM draft,
|
|
3
|
+
// the prompt and the offline checks agree on one definition.
|
|
4
|
+
import { checkPattern, err, makeError, ok, } from "../../kernel/index.js";
|
|
5
|
+
// SPEC §4.16.2: every template id the generator accepts, with the enforcer
|
|
6
|
+
// kind it materialises into. Only parametric data is ever produced (§11 S23:
|
|
7
|
+
// an LLM never authors executable enforcement code).
|
|
8
|
+
const TEMPLATE_CATALOGUE = [
|
|
9
|
+
{
|
|
10
|
+
id: "forbid-pattern",
|
|
11
|
+
kind: "pattern-forbid",
|
|
12
|
+
description: "forbid text matching a regex",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: "require-pattern",
|
|
16
|
+
kind: "pattern-require",
|
|
17
|
+
description: "require text matching a regex",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: "forbid-import",
|
|
21
|
+
kind: "import-forbid",
|
|
22
|
+
description: "forbid imports matching a module glob",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: "placement",
|
|
26
|
+
kind: "path-placement",
|
|
27
|
+
description: "confine files to allowed directories",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "max-size",
|
|
31
|
+
kind: "file-size",
|
|
32
|
+
description: "cap file lines or bytes",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "forbid-command",
|
|
36
|
+
kind: "command-forbid",
|
|
37
|
+
description: "forbid shell commands matching a pattern",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "require-file",
|
|
41
|
+
kind: "file-required",
|
|
42
|
+
description: "require a file with matching content",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "config-key",
|
|
46
|
+
kind: "json-key",
|
|
47
|
+
description: "require a config key and value",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "external",
|
|
51
|
+
kind: "external",
|
|
52
|
+
description: "delegate to a configured external tool",
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
export function lookupTemplate(id) {
|
|
56
|
+
return TEMPLATE_CATALOGUE.find((entry) => entry.id === id);
|
|
57
|
+
}
|
|
58
|
+
// SPEC §4.16.3: the catalogue line the LLM prompt carries.
|
|
59
|
+
export function catalogueSummary() {
|
|
60
|
+
return TEMPLATE_CATALOGUE.map((entry) => `${entry.id} -> ${entry.kind}`).join(", ");
|
|
61
|
+
}
|
|
62
|
+
function isRecord(value) {
|
|
63
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
64
|
+
}
|
|
65
|
+
// Bracket access through a variable keeps noPropertyAccessFromIndexSignature
|
|
66
|
+
// satisfied (kernel narrows the same way).
|
|
67
|
+
function field(record, name) {
|
|
68
|
+
return record[name];
|
|
69
|
+
}
|
|
70
|
+
function draftError(detail) {
|
|
71
|
+
return err(makeError("CDX-E853", `LLM draft is invalid: ${detail}`, "Draft offline with --template, or fix the generator prompt, then retry."));
|
|
72
|
+
}
|
|
73
|
+
function templateError(template) {
|
|
74
|
+
return err(makeError("CDX-E205", `draft references unknown template "${template}"`, "Use a template id from the §4.16.2 catalogue, then retry the draft."));
|
|
75
|
+
}
|
|
76
|
+
function ownerError(ruleId, packId) {
|
|
77
|
+
return err(makeError("CDX-E204", `draft rule "${ruleId}" is outside pack "${packId}"`, "Generated packs own only their own rule ids; rename the rule under the pack id, then retry."));
|
|
78
|
+
}
|
|
79
|
+
function nonEmptyText(value) {
|
|
80
|
+
return typeof value === "string" && value.length > 0;
|
|
81
|
+
}
|
|
82
|
+
function narrowRule(value, packId, floorRuleId) {
|
|
83
|
+
if (!isRecord(value)) {
|
|
84
|
+
return draftError("every rule must be a JSON object");
|
|
85
|
+
}
|
|
86
|
+
const id = field(value, "id");
|
|
87
|
+
const template = field(value, "template");
|
|
88
|
+
const params = field(value, "params");
|
|
89
|
+
const statement = field(value, "statement");
|
|
90
|
+
const reason = field(value, "reason");
|
|
91
|
+
const remediation = field(value, "remediation");
|
|
92
|
+
const tier = field(value, "tier");
|
|
93
|
+
const violatingFixture = field(value, "violatingFixture");
|
|
94
|
+
const passingFixture = field(value, "passingFixture");
|
|
95
|
+
if (!nonEmptyText(id)) {
|
|
96
|
+
return draftError("every rule needs a non-empty string id");
|
|
97
|
+
}
|
|
98
|
+
if (!id.startsWith(`${packId}/`)) {
|
|
99
|
+
return ownerError(id, packId);
|
|
100
|
+
}
|
|
101
|
+
if (typeof template !== "string" || lookupTemplate(template) === undefined) {
|
|
102
|
+
return templateError(typeof template === "string" ? template : "unknown");
|
|
103
|
+
}
|
|
104
|
+
if (!isRecord(params)) {
|
|
105
|
+
return draftError(`rule "${id}" needs a params object`);
|
|
106
|
+
}
|
|
107
|
+
if (!nonEmptyText(statement)) {
|
|
108
|
+
return draftError(`rule "${id}" needs a non-empty statement`);
|
|
109
|
+
}
|
|
110
|
+
if (!nonEmptyText(reason)) {
|
|
111
|
+
return draftError(`rule "${id}" needs a non-empty reason`);
|
|
112
|
+
}
|
|
113
|
+
if (!nonEmptyText(remediation) || remediation === reason) {
|
|
114
|
+
return draftError(`rule "${id}" needs remediation distinct from its reason`);
|
|
115
|
+
}
|
|
116
|
+
if (tier !== "floor" && tier !== "tunable") {
|
|
117
|
+
return draftError(`rule "${id}" tier must be floor or tunable`);
|
|
118
|
+
}
|
|
119
|
+
if (tier === "floor" && id !== floorRuleId) {
|
|
120
|
+
return draftError(`rule "${id}" is floor without --floor; strictness is a human choice`);
|
|
121
|
+
}
|
|
122
|
+
if (!nonEmptyText(violatingFixture)) {
|
|
123
|
+
return draftError(`rule "${id}" needs a violating fixture`);
|
|
124
|
+
}
|
|
125
|
+
if (!nonEmptyText(passingFixture)) {
|
|
126
|
+
return draftError(`rule "${id}" needs a passing fixture`);
|
|
127
|
+
}
|
|
128
|
+
// SPEC §4.16 EC-5 + §9.2: every drafted regex passes the kernel safety
|
|
129
|
+
// check before use; a catastrophic pattern fails the draft here.
|
|
130
|
+
const rawPattern = field(params, "pattern");
|
|
131
|
+
if (typeof rawPattern === "string") {
|
|
132
|
+
const safe = checkPattern(rawPattern);
|
|
133
|
+
if (!safe.ok) {
|
|
134
|
+
return err(safe.error);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return ok({
|
|
138
|
+
id,
|
|
139
|
+
template,
|
|
140
|
+
params,
|
|
141
|
+
statement,
|
|
142
|
+
reason,
|
|
143
|
+
remediation,
|
|
144
|
+
tier,
|
|
145
|
+
violatingFixture,
|
|
146
|
+
passingFixture,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
// SPEC §4.16.3: schema-check the draft. Pattern-safety failures keep their
|
|
150
|
+
// CDX-E902 so the caller can fail closed without a repair round; every other
|
|
151
|
+
// failure is repairable and returns CDX-E205, CDX-E204 or CDX-E853.
|
|
152
|
+
export function narrowPackDraft(value, expectedPackId, floorRuleId) {
|
|
153
|
+
if (!isRecord(value)) {
|
|
154
|
+
return draftError("the draft must be a JSON object");
|
|
155
|
+
}
|
|
156
|
+
const packId = field(value, "packId");
|
|
157
|
+
const description = field(value, "description");
|
|
158
|
+
const rules = field(value, "rules");
|
|
159
|
+
if (packId !== expectedPackId) {
|
|
160
|
+
return draftError("the draft packId must equal the requested pack id");
|
|
161
|
+
}
|
|
162
|
+
if (!nonEmptyText(description)) {
|
|
163
|
+
return draftError("the draft needs a non-empty description");
|
|
164
|
+
}
|
|
165
|
+
if (!Array.isArray(rules) || rules.length === 0) {
|
|
166
|
+
return draftError("the draft needs at least one rule");
|
|
167
|
+
}
|
|
168
|
+
const narrowed = [];
|
|
169
|
+
for (const entry of rules) {
|
|
170
|
+
const rule = narrowRule(entry, expectedPackId, floorRuleId);
|
|
171
|
+
if (!rule.ok) {
|
|
172
|
+
return err(rule.error);
|
|
173
|
+
}
|
|
174
|
+
narrowed.push(rule.value);
|
|
175
|
+
}
|
|
176
|
+
return ok({ packId: expectedPackId, description, rules: narrowed });
|
|
177
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CheckContext, Finding } from "../engine/index.ts";
|
|
2
|
+
import { type GuardrailManifest } from "./manifest.ts";
|
|
3
|
+
export interface FileContent {
|
|
4
|
+
readonly path: string;
|
|
5
|
+
readonly content: string;
|
|
6
|
+
}
|
|
7
|
+
export interface InstalledHook {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly executable: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface DriftSnapshot {
|
|
12
|
+
readonly files: ReadonlyArray<FileContent>;
|
|
13
|
+
readonly hooksPath?: string;
|
|
14
|
+
readonly hooksExecutable?: boolean;
|
|
15
|
+
readonly installedHooks?: ReadonlyArray<InstalledHook>;
|
|
16
|
+
readonly engineVersion?: string;
|
|
17
|
+
readonly expectedHooksPath?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function checkDrift(_ctx: CheckContext, manifest: GuardrailManifest, snapshot?: DriftSnapshot): Array<Finding>;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// SPEC §4.14.1–§4.14.2: drift (working tree vs manifest) and tamper checks.
|
|
2
|
+
// The caller supplies a snapshot of the working tree, so this module stays
|
|
3
|
+
// pure and port-free; the CLI builds the snapshot through kernel ports.
|
|
4
|
+
import { sha256Text } from "../../kernel/index.js";
|
|
5
|
+
import { EXPECTED_HOOKS_PATH } from "./hooks.js";
|
|
6
|
+
import { verifyManifest } from "./manifest.js";
|
|
7
|
+
// SPEC §4.6.2 managed-block markers, cited here for block-mode hashing.
|
|
8
|
+
const BLOCK_BEGIN = "<!-- codictator:begin -->";
|
|
9
|
+
const BLOCK_END = "<!-- codictator:end -->";
|
|
10
|
+
function manifestFinding(message, remediation) {
|
|
11
|
+
return {
|
|
12
|
+
ruleId: "core/guardrail-manifest",
|
|
13
|
+
code: "CDX-E501",
|
|
14
|
+
message,
|
|
15
|
+
remediation,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
// SPEC §4.14.6 EC-5: hashes normalize first, so autocrlf cannot fake drift.
|
|
19
|
+
function hashForMode(mode, content) {
|
|
20
|
+
if (mode === "file") {
|
|
21
|
+
return sha256Text(content);
|
|
22
|
+
}
|
|
23
|
+
if (mode === "entries") {
|
|
24
|
+
// SPEC §4.14.1: entries mode hashes the canonical projection of owned
|
|
25
|
+
// entries; the caller projects before snapshotting, so user additions
|
|
26
|
+
// outside the projection (EC-6) never reach this comparison.
|
|
27
|
+
return sha256Text(content);
|
|
28
|
+
}
|
|
29
|
+
const first = content.indexOf(BLOCK_BEGIN);
|
|
30
|
+
const last = content.indexOf(BLOCK_END);
|
|
31
|
+
if (first < 0 || last < 0 || first >= last) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
const repeats = content.indexOf(BLOCK_BEGIN, first + BLOCK_BEGIN.length) >= 0;
|
|
35
|
+
if (repeats) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
return sha256Text(content.slice(first, last + BLOCK_END.length));
|
|
39
|
+
}
|
|
40
|
+
function checkArtifact(path, mode, expected, actual) {
|
|
41
|
+
const content = actual.get(path);
|
|
42
|
+
if (content === undefined) {
|
|
43
|
+
return [
|
|
44
|
+
{
|
|
45
|
+
...manifestFinding(`generated artifact ${path} is missing from the working tree`, "Restore it with `codictator regen`; delete it only by dropping its owner from config first (§4.14 EC-10)."),
|
|
46
|
+
path,
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
const hash = hashForMode(mode, content);
|
|
51
|
+
if (hash === undefined) {
|
|
52
|
+
return [
|
|
53
|
+
{
|
|
54
|
+
...manifestFinding(`managed block markers in ${path} are malformed or duplicated`, "Restore the single managed block with `codictator regen` (§4.14 EC-6 keeps user text outside the block)."),
|
|
55
|
+
path,
|
|
56
|
+
code: "CDX-E501",
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
if (hash !== expected) {
|
|
61
|
+
return [
|
|
62
|
+
{
|
|
63
|
+
...manifestFinding(`generated artifact ${path} differs from its manifest hash`, "Never hand-edit generated artifacts; change config and run `codictator regen` (§4.14.5)."),
|
|
64
|
+
path,
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
const REQUIRED_HOOKS = ["pre-commit", "commit-msg", "pre-push"];
|
|
71
|
+
function hooksFinding(message, remediation) {
|
|
72
|
+
return { ruleId: "core/hooks-active", message, remediation };
|
|
73
|
+
}
|
|
74
|
+
function checkInstalledHooks(installed) {
|
|
75
|
+
const present = new Set(installed.map((hook) => hook.name));
|
|
76
|
+
for (const required of REQUIRED_HOOKS) {
|
|
77
|
+
if (!present.has(required)) {
|
|
78
|
+
// SPEC §4.14.6 EC-2: L0 and L4 report the deleted hook; L3 cannot.
|
|
79
|
+
return [
|
|
80
|
+
hooksFinding(`hook ${required} is missing from the installed hooks dir`, "Run `codictator install-hooks` to reinstall it (EC-2)."),
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
for (const hook of installed) {
|
|
85
|
+
if (!hook.executable) {
|
|
86
|
+
return [
|
|
87
|
+
hooksFinding(`hook ${hook.name} lost its executable bit (for example after a Windows commit)`, "Run `git update-index --chmod=+x` on the hook and keep the .gitattributes entry from install-hooks (§4.14 EC-12)."),
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return [];
|
|
92
|
+
}
|
|
93
|
+
function checkHooks(snapshot) {
|
|
94
|
+
const expected = snapshot.expectedHooksPath ?? EXPECTED_HOOKS_PATH;
|
|
95
|
+
if (snapshot.installedHooks !== undefined) {
|
|
96
|
+
const findings = checkInstalledHooks(snapshot.installedHooks);
|
|
97
|
+
if (findings.length > 0) {
|
|
98
|
+
return findings;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (snapshot.hooksPath === undefined) {
|
|
102
|
+
return [
|
|
103
|
+
{
|
|
104
|
+
ruleId: "core/hooks-active",
|
|
105
|
+
message: "hook state is unavailable: cannot confirm hooks are installed",
|
|
106
|
+
remediation: `Run \`codictator install-hooks\` to reinstall the hooks and point core.hooksPath at ${expected} (§4.14 EC-9).`,
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
if (snapshot.hooksPath !== expected) {
|
|
111
|
+
return [
|
|
112
|
+
{
|
|
113
|
+
ruleId: "core/hooks-active",
|
|
114
|
+
message: `core.hooksPath points at ${snapshot.hooksPath}, not the installed hooks dir ${expected}`,
|
|
115
|
+
remediation: `Run \`codictator install-hooks\` to reinstall the hooks (§4.14 EC-9).`,
|
|
116
|
+
},
|
|
117
|
+
];
|
|
118
|
+
}
|
|
119
|
+
if (snapshot.hooksExecutable === false) {
|
|
120
|
+
return [
|
|
121
|
+
{
|
|
122
|
+
ruleId: "core/hooks-active",
|
|
123
|
+
message: "a hook file lost its executable bit (for example after a Windows commit)",
|
|
124
|
+
remediation: "Run `git update-index --chmod=+x` on the hook and keep the .gitattributes entry from install-hooks (§4.14 EC-12).",
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
return [];
|
|
129
|
+
}
|
|
130
|
+
// SPEC §4.14.2: L0 detection blocks all tool calls except regen, status and
|
|
131
|
+
// reads, so an agent repairs guardrails before working. Every finding here
|
|
132
|
+
// is floor and is listed first in the CI summary.
|
|
133
|
+
export function checkDrift(_ctx, manifest, snapshot) {
|
|
134
|
+
const findings = [];
|
|
135
|
+
if (!verifyManifest(manifest)) {
|
|
136
|
+
findings.push(manifestFinding("the manifest itself was edited outside regen (self hash mismatch)", "Regenerate with `codictator regen`; guardrails change only through config (§4.14.5)."));
|
|
137
|
+
}
|
|
138
|
+
if (snapshot === undefined) {
|
|
139
|
+
// SPEC §10.3 fail-closed: with no working-tree evidence the hooks
|
|
140
|
+
// cannot be confirmed active, so report rather than allow.
|
|
141
|
+
findings.push(...checkHooks({ files: [] }));
|
|
142
|
+
return findings;
|
|
143
|
+
}
|
|
144
|
+
const actual = new Map();
|
|
145
|
+
for (const file of snapshot.files) {
|
|
146
|
+
actual.set(file.path.replaceAll("\\", "/"), file.content);
|
|
147
|
+
}
|
|
148
|
+
for (const artifact of manifest.artifacts) {
|
|
149
|
+
findings.push(...checkArtifact(artifact.path, artifact.mode, artifact.hash, actual));
|
|
150
|
+
}
|
|
151
|
+
findings.push(...checkHooks(snapshot));
|
|
152
|
+
if (snapshot.engineVersion !== undefined &&
|
|
153
|
+
snapshot.engineVersion !== manifest.codictator) {
|
|
154
|
+
findings.push({
|
|
155
|
+
ruleId: "core/engine-version-match",
|
|
156
|
+
message: `installed engine ${snapshot.engineVersion} does not match config ${manifest.codictator}`,
|
|
157
|
+
remediation: "Install the pinned engine version, then rerun `codictator regen` (§4.14.2).",
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
if (snapshot.engineVersion === undefined) {
|
|
161
|
+
findings.push({
|
|
162
|
+
ruleId: "core/engine-version-match",
|
|
163
|
+
message: "the launcher is missing: no installed engine found",
|
|
164
|
+
remediation: "Run `npm ci --ignore-scripts` (or install the tool dir) so the launcher resolves (§4.14.2).",
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
return findings;
|
|
168
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const EXPECTED_HOOKS_PATH = ".githooks";
|
|
2
|
+
export declare const HOOK_NAMES: readonly ["pre-commit", "commit-msg", "pre-push"];
|
|
3
|
+
export type HookName = (typeof HOOK_NAMES)[number];
|
|
4
|
+
export declare function renderHookScript(hook: HookName, minMajor?: number): string;
|
|
5
|
+
export declare const HUSKY_BEGIN = "# codictator:begin";
|
|
6
|
+
export declare const HUSKY_END = "# codictator:end";
|
|
7
|
+
export declare function renderHuskyBlock(hook: HookName): string;
|
|
8
|
+
export interface HookInstallPlan {
|
|
9
|
+
readonly files: ReadonlyArray<string>;
|
|
10
|
+
readonly mode: number;
|
|
11
|
+
readonly hooksPath: string;
|
|
12
|
+
readonly prepareScript: string;
|
|
13
|
+
readonly gitattributes: string;
|
|
14
|
+
readonly huskyBlocks: ReadonlyArray<string>;
|
|
15
|
+
}
|
|
16
|
+
export declare function hookInstallPlan(options?: {
|
|
17
|
+
readonly huskyPresent?: boolean;
|
|
18
|
+
readonly existingHooksPath?: string;
|
|
19
|
+
}): HookInstallPlan;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// SPEC §4.14.4: git-hook installation. Content generation is pure so unit
|
|
2
|
+
// tests assert the scripts without touching .git/; the CLI wires ports.
|
|
3
|
+
export const EXPECTED_HOOKS_PATH = ".githooks";
|
|
4
|
+
export const HOOK_NAMES = ["pre-commit", "commit-msg", "pre-push"];
|
|
5
|
+
// SPEC §4.14.4: each hook verifies node is on PATH and meets the minimum,
|
|
6
|
+
// else prints CDX-E001/CDX-E002 and exits 1; then execs the launcher.
|
|
7
|
+
export function renderHookScript(hook, minMajor = 24) {
|
|
8
|
+
const lines = [
|
|
9
|
+
"#!/bin/sh",
|
|
10
|
+
"# codictator:begin — managed by codictator; do not edit by hand.",
|
|
11
|
+
"# SPEC §4.14.4: generated hook; repair with `codictator install-hooks`.",
|
|
12
|
+
"if ! command -v node >/dev/null 2>&1; then",
|
|
13
|
+
' echo "CDX-E001: node is not on PATH; install Node.js to run Codictator hooks." >&2',
|
|
14
|
+
" exit 1",
|
|
15
|
+
"fi",
|
|
16
|
+
`if ! node -e "process.exit(Number(process.versions.node.split('.')[0]) >= ${minMajor} ? 0 : 1)" >/dev/null 2>&1; then`,
|
|
17
|
+
` echo "CDX-E002: node is older than the required v${minMajor}; upgrade Node.js." >&2`,
|
|
18
|
+
" exit 1",
|
|
19
|
+
"fi",
|
|
20
|
+
'ROOT="$(git rev-parse --show-toplevel 2>/dev/null)"',
|
|
21
|
+
`exec node "$ROOT/.codictator/bin/run.mjs" git ${hook} "$@"`,
|
|
22
|
+
"# codictator:end",
|
|
23
|
+
];
|
|
24
|
+
return `${lines.join("\n")}\n`;
|
|
25
|
+
}
|
|
26
|
+
export const HUSKY_BEGIN = "# codictator:begin";
|
|
27
|
+
export const HUSKY_END = "# codictator:end";
|
|
28
|
+
// SPEC §4.14.4: when .husky/ exists, Codictator inserts a managed block into
|
|
29
|
+
// Husky's hook files instead of taking over core.hooksPath.
|
|
30
|
+
export function renderHuskyBlock(hook) {
|
|
31
|
+
return (`${HUSKY_BEGIN} — managed by codictator; do not edit by hand.\n` +
|
|
32
|
+
`.codictator/bin/run.mjs git ${hook} "$@"\n` +
|
|
33
|
+
`${HUSKY_END}\n`);
|
|
34
|
+
}
|
|
35
|
+
// SPEC §4.14.4 + EC-9/EC-12: install-hooks writes the hooks (mode 755),
|
|
36
|
+
// points core.hooksPath at them, adds the npm prepare script, and records
|
|
37
|
+
// the gitattributes remediation for Windows commits without the exec bit.
|
|
38
|
+
export function hookInstallPlan(options) {
|
|
39
|
+
const husky = options?.huskyPresent === true;
|
|
40
|
+
const hooksPath = husky
|
|
41
|
+
? (options?.existingHooksPath ?? ".husky")
|
|
42
|
+
: EXPECTED_HOOKS_PATH;
|
|
43
|
+
const files = husky
|
|
44
|
+
? []
|
|
45
|
+
: HOOK_NAMES.map((hook) => `${EXPECTED_HOOKS_PATH}/${hook}`);
|
|
46
|
+
return {
|
|
47
|
+
files,
|
|
48
|
+
mode: 0o755,
|
|
49
|
+
hooksPath,
|
|
50
|
+
prepareScript: "codictator install-hooks",
|
|
51
|
+
gitattributes: `${EXPECTED_HOOKS_PATH}/* linguist-generated=false\n${EXPECTED_HOOKS_PATH}/* eol=lf\n`,
|
|
52
|
+
huskyBlocks: husky ? [...HOOK_NAMES] : [],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CheckContext, Finding } from "../engine/index.ts";
|
|
2
|
+
import { type DriftSnapshot, type FileContent, type InstalledHook } from "./drift.ts";
|
|
3
|
+
import { EXPECTED_HOOKS_PATH, HOOK_NAMES, type HookInstallPlan, type HookName, hookInstallPlan, renderHookScript, renderHuskyBlock } from "./hooks.ts";
|
|
4
|
+
import type { GuardrailManifest, ManifestArtifact } from "./manifest.ts";
|
|
5
|
+
import { buildManifest, manifestHash, verifyManifest } from "./manifest.ts";
|
|
6
|
+
import { type CommitInRange, checkCommitTrailers, checkPackageManifestEdit, isProtectedPath } from "./self-protection.ts";
|
|
7
|
+
export type { CommitInRange, DriftSnapshot, FileContent, GuardrailManifest, HookInstallPlan, HookName, InstalledHook, ManifestArtifact, };
|
|
8
|
+
export { buildManifest, checkCommitTrailers, checkPackageManifestEdit, EXPECTED_HOOKS_PATH, HOOK_NAMES, hookInstallPlan, isProtectedPath, manifestHash, renderHookScript, renderHuskyBlock, verifyManifest, };
|
|
9
|
+
export declare function checkDrift(ctx: CheckContext, manifest: GuardrailManifest, snapshot?: DriftSnapshot): Array<Finding>;
|
|
10
|
+
export declare function checkSelfProtection(ctx: CheckContext, command: ReadonlyArray<string>): Array<Finding>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { checkDrift as checkDriftImpl, } from "./drift.js";
|
|
2
|
+
import { EXPECTED_HOOKS_PATH, HOOK_NAMES, hookInstallPlan, renderHookScript, renderHuskyBlock, } from "./hooks.js";
|
|
3
|
+
import { buildManifest, manifestHash, verifyManifest } from "./manifest.js";
|
|
4
|
+
import { checkCommitTrailers, checkPackageManifestEdit, checkSelfProtection as checkProtection, isProtectedPath, } from "./self-protection.js";
|
|
5
|
+
export { buildManifest, checkCommitTrailers, checkPackageManifestEdit, EXPECTED_HOOKS_PATH, HOOK_NAMES, hookInstallPlan, isProtectedPath, manifestHash, renderHookScript, renderHuskyBlock, verifyManifest, };
|
|
6
|
+
// SPEC §4.14.1: manifest comparison for drift; without a snapshot only the
|
|
7
|
+
// manifest self hash and hook availability fail closed (§10.3).
|
|
8
|
+
export function checkDrift(ctx, manifest, snapshot) {
|
|
9
|
+
return checkDriftImpl(ctx, manifest, snapshot);
|
|
10
|
+
}
|
|
11
|
+
// SPEC §4.14.3: self-protection (no bypass of hooks or required checks).
|
|
12
|
+
export function checkSelfProtection(ctx, command) {
|
|
13
|
+
return checkProtection(ctx, command);
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ManifestArtifact {
|
|
2
|
+
readonly path: string;
|
|
3
|
+
readonly owner: string;
|
|
4
|
+
readonly mode: "file" | "block" | "entries";
|
|
5
|
+
readonly hash: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GuardrailManifest {
|
|
8
|
+
readonly version: 1;
|
|
9
|
+
readonly codictator: string;
|
|
10
|
+
readonly artifacts: ReadonlyArray<ManifestArtifact>;
|
|
11
|
+
readonly hash: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function manifestHash(artifacts: ReadonlyArray<ManifestArtifact>): string;
|
|
14
|
+
export declare function buildManifest(codictator: string, artifacts: ReadonlyArray<ManifestArtifact>): GuardrailManifest;
|
|
15
|
+
export declare function verifyManifest(manifest: GuardrailManifest): boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// SPEC §4.14.1 + §7.14: the guardrail lockfile. Generation is deterministic
|
|
2
|
+
// (artifacts sorted by path, stableStringify, no timestamps), so regen on
|
|
3
|
+
// unchanged config reproduces the manifest byte for byte (§4.14 EC-11).
|
|
4
|
+
import { sha256Text, stableStringify } from "../../kernel/index.js";
|
|
5
|
+
// SPEC §7.14: the manifest hash covers the sorted artifacts array, so any
|
|
6
|
+
// edit of the manifest itself outside regen is detectable (§4.14.2).
|
|
7
|
+
export function manifestHash(artifacts) {
|
|
8
|
+
const sorted = [...artifacts].sort((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
|
|
9
|
+
return sha256Text(stableStringify(sorted));
|
|
10
|
+
}
|
|
11
|
+
// SPEC §4.14.5: regen rebuilds the manifest from config; sorting here keeps
|
|
12
|
+
// the output independent of enumeration order and OS (EC-11).
|
|
13
|
+
export function buildManifest(codictator, artifacts) {
|
|
14
|
+
const sorted = [...artifacts].sort((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
|
|
15
|
+
return {
|
|
16
|
+
version: 1,
|
|
17
|
+
codictator,
|
|
18
|
+
artifacts: sorted,
|
|
19
|
+
hash: manifestHash(artifacts),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
// SPEC §4.14.2: recompute the self hash; a mismatch means the manifest was
|
|
23
|
+
// edited outside regen and every integrity finding that follows is floor.
|
|
24
|
+
export function verifyManifest(manifest) {
|
|
25
|
+
return manifest.hash === manifestHash(manifest.artifacts);
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { isProtectedPath } from "../../kernel/index.ts";
|
|
2
|
+
import type { CheckContext, Finding } from "../engine/index.ts";
|
|
3
|
+
export { isProtectedPath };
|
|
4
|
+
export declare function checkPackageManifestEdit(beforeText: string, afterText: string): Array<Finding>;
|
|
5
|
+
export interface CommitInRange {
|
|
6
|
+
readonly sha: string;
|
|
7
|
+
readonly message: string;
|
|
8
|
+
readonly author: string;
|
|
9
|
+
readonly isMerge: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function checkCommitTrailers(commits: ReadonlyArray<CommitInRange>, trailerExempt: ReadonlyArray<string>): Array<Finding>;
|
|
12
|
+
export declare function checkSelfProtection(_ctx: CheckContext, command: ReadonlyArray<string>): Array<Finding>;
|