codictator 0.0.0-stage → 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 +4 -2
- 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 +20 -5
- 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,117 @@
|
|
|
1
|
+
import { ok } from "../../../kernel/index.js";
|
|
2
|
+
import { bindRule, findingFor, selectFiles } from "./binding.js";
|
|
3
|
+
import { baseEnforcer, limitOf, loadScopeText, parseMarkerInt, parseMarkers, } from "./health-measures.js";
|
|
4
|
+
// A skipped mandatory gate flags. The marker is a report line (`skipped:`
|
|
5
|
+
// at the line start, as the fixture measure report carries it), never a
|
|
6
|
+
// substring: status strings like "corrupt lines skipped: 2" and the
|
|
7
|
+
// guard's own source are not skipped gates.
|
|
8
|
+
export function resolveWorkflowGates(decl, rule, ports) {
|
|
9
|
+
const binding = bindRule(rule);
|
|
10
|
+
return ok(baseEnforcer(rule, binding, decl, async (ctx) => {
|
|
11
|
+
const findings = [];
|
|
12
|
+
for (const file of selectFiles(ctx.scope.files, binding.scopeGlobs)) {
|
|
13
|
+
const text = await loadScopeText(ports, binding, file, findings);
|
|
14
|
+
if (text === undefined || !/^[ \t]*skipped:/m.test(text)) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
findings.push(findingFor(binding, {
|
|
18
|
+
path: file,
|
|
19
|
+
message: `mandatory gate skipped in ${file}`,
|
|
20
|
+
vars: { path: file },
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
return findings;
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
// SPEC §5.9 core/writes-within-plan: a write no plan allows flags.
|
|
27
|
+
export function resolveWritesWithinPlan(decl, rule, ports) {
|
|
28
|
+
const binding = bindRule(rule);
|
|
29
|
+
return ok(baseEnforcer(rule, binding, decl, async (ctx) => {
|
|
30
|
+
const findings = [];
|
|
31
|
+
for (const file of selectFiles(ctx.scope.files, binding.scopeGlobs)) {
|
|
32
|
+
const text = await loadScopeText(ports, binding, file, findings);
|
|
33
|
+
if (text === undefined) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if ((parseMarkers(text).get("planned") ?? "") === "false") {
|
|
37
|
+
findings.push(findingFor(binding, {
|
|
38
|
+
path: file,
|
|
39
|
+
message: `write outside the plan in ${file}`,
|
|
40
|
+
vars: { path: file },
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return findings;
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
// SPEC §5.9 core/loop-breaker: repeats past the tunable cap flag.
|
|
48
|
+
export function resolveLoopBreaker(decl, rule, ports) {
|
|
49
|
+
const binding = bindRule(rule);
|
|
50
|
+
const maxRepeats = limitOf(binding, "maxRepeats", 3);
|
|
51
|
+
return ok(baseEnforcer(rule, binding, decl, async (ctx) => {
|
|
52
|
+
const findings = [];
|
|
53
|
+
for (const file of selectFiles(ctx.scope.files, binding.scopeGlobs)) {
|
|
54
|
+
const text = await loadScopeText(ports, binding, file, findings);
|
|
55
|
+
if (text === undefined) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const markers = parseMarkers(text);
|
|
59
|
+
const repeats = parseMarkerInt(markers, "repeats");
|
|
60
|
+
const cap = parseMarkerInt(markers, "limit") ?? maxRepeats;
|
|
61
|
+
if (repeats !== undefined && repeats > cap) {
|
|
62
|
+
findings.push(findingFor(binding, {
|
|
63
|
+
path: file,
|
|
64
|
+
message: `loop past ${String(cap)} repeats in ${file}`,
|
|
65
|
+
vars: { path: file, limit: String(cap) },
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return findings;
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
// SPEC §5.9 core/review-gate: landing with no review flags.
|
|
73
|
+
export function resolveReviewGate(decl, rule, ports) {
|
|
74
|
+
const binding = bindRule(rule);
|
|
75
|
+
return ok(baseEnforcer(rule, binding, decl, async (ctx) => {
|
|
76
|
+
const findings = [];
|
|
77
|
+
for (const file of selectFiles(ctx.scope.files, binding.scopeGlobs)) {
|
|
78
|
+
const text = await loadScopeText(ports, binding, file, findings);
|
|
79
|
+
if (text === undefined) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if ((parseMarkers(text).get("review") ?? "") === "none") {
|
|
83
|
+
findings.push(findingFor(binding, {
|
|
84
|
+
path: file,
|
|
85
|
+
message: `landing with no review in ${file}`,
|
|
86
|
+
vars: { path: file },
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return findings;
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
// SPEC §5.9 core/review-round-cap: rounds past the tunable cap flag.
|
|
94
|
+
export function resolveReviewRoundCap(decl, rule, ports) {
|
|
95
|
+
const binding = bindRule(rule);
|
|
96
|
+
const maxRounds = limitOf(binding, "maxRounds", 3);
|
|
97
|
+
return ok(baseEnforcer(rule, binding, decl, async (ctx) => {
|
|
98
|
+
const findings = [];
|
|
99
|
+
for (const file of selectFiles(ctx.scope.files, binding.scopeGlobs)) {
|
|
100
|
+
const text = await loadScopeText(ports, binding, file, findings);
|
|
101
|
+
if (text === undefined) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
const markers = parseMarkers(text);
|
|
105
|
+
const rounds = parseMarkerInt(markers, "rounds");
|
|
106
|
+
const cap = parseMarkerInt(markers, "cap") ?? maxRounds;
|
|
107
|
+
if (rounds !== undefined && rounds > cap) {
|
|
108
|
+
findings.push(findingFor(binding, {
|
|
109
|
+
path: file,
|
|
110
|
+
message: `review past ${String(cap)} rounds in ${file}`,
|
|
111
|
+
vars: { path: file, limit: String(cap) },
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return findings;
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Ports } from "../../../kernel/index.ts";
|
|
2
|
+
import type { CheckContext, Finding } from "../../engine/index.ts";
|
|
3
|
+
import type { PackRule } from "../index.ts";
|
|
4
|
+
import type { EnforcerDecl } from "../manifest.ts";
|
|
5
|
+
export declare function resolveWriteConfinement(decl: EnforcerDecl, rule: PackRule, ports: Ports): {
|
|
6
|
+
ok: true;
|
|
7
|
+
value: {
|
|
8
|
+
id: string;
|
|
9
|
+
kinds: readonly ("compact" | "post-tool" | "pre-tool" | "prompt" | "review" | "scheduled" | "startup")[];
|
|
10
|
+
budgetMs: number;
|
|
11
|
+
check: (ctx: CheckContext) => Promise<Array<Finding>>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// SPEC §4.7.3 core/write-confinement: tool.pre.write targets and shell
|
|
2
|
+
// redirection targets resolve, through symlinks, to inside the repo root
|
|
3
|
+
// or the OS temp dir; otherwise they block. Writes into .git/ are blocked
|
|
4
|
+
// except through git itself. Targets arrive as `write:` lines and shell
|
|
5
|
+
// sources of the scanned files; the Fs port resolves symlinks, so the
|
|
6
|
+
// fixture symlink case blocks with a real root and escapes block lexically.
|
|
7
|
+
import { analyseShell, isGitDirPath, toRepoPath, } from "../../../kernel/index.js";
|
|
8
|
+
import { bindRule, findingFor, readErrorFinding, readLossyText, selectFiles, } from "./binding.js";
|
|
9
|
+
import { extractShellSources } from "./shell-analyse.js";
|
|
10
|
+
function writeLineTarget(line) {
|
|
11
|
+
const trimmed = line.trimStart();
|
|
12
|
+
if (!trimmed.toLowerCase().startsWith("write:")) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
const target = trimmed.slice("write:".length).trim();
|
|
16
|
+
return target === "" ? undefined : target;
|
|
17
|
+
}
|
|
18
|
+
function escapeFinding(binding, file, target) {
|
|
19
|
+
return findingFor(binding, {
|
|
20
|
+
path: file,
|
|
21
|
+
code: "CDX-E701",
|
|
22
|
+
message: `write target escapes the repo root: ${target}`,
|
|
23
|
+
vars: { path: file },
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
// A `write:` line inside code is object syntax (`write: "write",` in an
|
|
27
|
+
// adapter capability table, `write: (chunk) => ...` in a fake), not a
|
|
28
|
+
// tool target. Real targets are paths, so anything carrying code
|
|
29
|
+
// characters is not a target at all and judges nothing; failing closed
|
|
30
|
+
// stays for real targets that cannot resolve.
|
|
31
|
+
const CODE_CHARS = /[-"'(){}[\];,=><|&$`]/;
|
|
32
|
+
function isPathLike(target) {
|
|
33
|
+
return !CODE_CHARS.test(target);
|
|
34
|
+
}
|
|
35
|
+
async function checkTarget(ports, binding, file, target, findings) {
|
|
36
|
+
if (!isPathLike(target)) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const rel = toRepoPath(target);
|
|
40
|
+
if (!rel.ok) {
|
|
41
|
+
findings.push(escapeFinding(binding, file, target));
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (isGitDirPath(rel.value)) {
|
|
45
|
+
findings.push(findingFor(binding, {
|
|
46
|
+
path: file,
|
|
47
|
+
message: `write target inside .git/ is only allowed through git: ${target}`,
|
|
48
|
+
vars: { path: file },
|
|
49
|
+
}));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const real = await ports.fs.realpath(target);
|
|
53
|
+
if (!real.ok) {
|
|
54
|
+
if (real.error.code === "CDX-E701") {
|
|
55
|
+
findings.push(escapeFinding(binding, file, target));
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
findings.push(readErrorFinding(binding, target, real.error, "resolve"));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// SPEC §4.7.3 L1: the hook scope carries lexical write targets (the
|
|
63
|
+
// tool file path and shell redirection targets), never disk files.
|
|
64
|
+
// They judge without a single disk read: realpath on a not-yet-existing
|
|
65
|
+
// file would fail benign writes closed, so only the lexical escape
|
|
66
|
+
// (EC-1/EC-2 shape) and the .git guard apply. Anything needing the
|
|
67
|
+
// filesystem (symlink escapes, EC-9) stays a disk-scope concern.
|
|
68
|
+
function checkProposedTarget(binding, target, findings) {
|
|
69
|
+
if (!isPathLike(target)) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const rel = toRepoPath(target);
|
|
73
|
+
if (!rel.ok) {
|
|
74
|
+
findings.push(escapeFinding(binding, "tool input", target));
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (isGitDirPath(rel.value)) {
|
|
78
|
+
findings.push(findingFor(binding, {
|
|
79
|
+
path: "tool input",
|
|
80
|
+
message: `write target inside .git/ is only allowed through git: ${target}`,
|
|
81
|
+
vars: { path: "tool input" },
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export function resolveWriteConfinement(decl, rule, ports) {
|
|
86
|
+
const binding = bindRule(rule);
|
|
87
|
+
return {
|
|
88
|
+
ok: true,
|
|
89
|
+
value: {
|
|
90
|
+
id: rule.id,
|
|
91
|
+
kinds: binding.triggers,
|
|
92
|
+
budgetMs: decl.budgetMs,
|
|
93
|
+
check: async (ctx) => {
|
|
94
|
+
const findings = [];
|
|
95
|
+
for (const file of selectFiles(ctx.scope.files, binding.scopeGlobs)) {
|
|
96
|
+
const targets = new Set([file]);
|
|
97
|
+
const loaded = await readLossyText(ports.fs, file);
|
|
98
|
+
if (!loaded.ok) {
|
|
99
|
+
findings.push(readErrorFinding(binding, file, loaded.error, "read"));
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
for (const line of loaded.value.text.split("\n")) {
|
|
103
|
+
const target = writeLineTarget(line);
|
|
104
|
+
if (target !== undefined) {
|
|
105
|
+
targets.add(target);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
for (const source of extractShellSources(loaded.value.text, file)) {
|
|
109
|
+
const parsed = analyseShell(source);
|
|
110
|
+
if (!parsed.ok) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
for (const target of parsed.value.writeTargets) {
|
|
114
|
+
targets.add(target);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
for (const target of [...targets].sort()) {
|
|
118
|
+
await checkTarget(ports, binding, file, target, findings);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// L1 hook targets are lexical only: no disk read, so benign
|
|
122
|
+
// writes to not-yet-existing files stay allowed while lexical
|
|
123
|
+
// escapes (EC-8 shape) still block.
|
|
124
|
+
for (const target of [...(ctx.scope.proposedPaths ?? [])].sort()) {
|
|
125
|
+
checkProposedTarget(binding, target, findings);
|
|
126
|
+
}
|
|
127
|
+
return findings;
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Fs, Result } from "../../kernel/index.ts";
|
|
2
|
+
import type { PackManifest } from "./index.ts";
|
|
3
|
+
export declare const ACCEPTED_NAME = "accepted.json";
|
|
4
|
+
export declare function packHashFor(fs: Fs, dir: string): Promise<Result<string>>;
|
|
5
|
+
export declare function selfTestHashFor(manifest: PackManifest): string;
|
|
6
|
+
export declare function verifyAcceptance(fs: Fs, dir: string, manifest: PackManifest, acceptedSchemaText: string): Promise<Result<void>>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { err, makeError, ok, parseJson, sha256Hex, sha256Text, stableStringify, validateSchema, } from "../../kernel/index.js";
|
|
2
|
+
import { field, isRecord } from "./manifest.js";
|
|
3
|
+
export const ACCEPTED_NAME = "accepted.json";
|
|
4
|
+
// SPEC §7.4: packHash covers every file in the pack except this one, sorted
|
|
5
|
+
// by path. Directories are skipped by stat; a stat or read failure fails
|
|
6
|
+
// closed instead of silently dropping the file.
|
|
7
|
+
export async function packHashFor(fs, dir) {
|
|
8
|
+
const listed = await fs.glob("**", dir);
|
|
9
|
+
if (!listed.ok) {
|
|
10
|
+
return err(listed.error);
|
|
11
|
+
}
|
|
12
|
+
const base = dir === "" ? "" : `${dir}/`;
|
|
13
|
+
const rels = [];
|
|
14
|
+
for (const full of listed.value) {
|
|
15
|
+
if (!full.startsWith(base)) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
const rel = full.slice(base.length);
|
|
19
|
+
if (rel === ACCEPTED_NAME) {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const st = await fs.stat(full);
|
|
23
|
+
if (!st.ok) {
|
|
24
|
+
return err(st.error);
|
|
25
|
+
}
|
|
26
|
+
if (st.value.isFile) {
|
|
27
|
+
rels.push(rel);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
rels.sort();
|
|
31
|
+
const entries = [];
|
|
32
|
+
for (const rel of rels) {
|
|
33
|
+
const content = await fs.read(`${base}${rel}`);
|
|
34
|
+
if (!content.ok) {
|
|
35
|
+
return err(content.error);
|
|
36
|
+
}
|
|
37
|
+
entries.push({ path: rel, hash: sha256Hex(content.value) });
|
|
38
|
+
}
|
|
39
|
+
return ok(sha256Text(stableStringify(entries)));
|
|
40
|
+
}
|
|
41
|
+
// The self-test record: the pack identity plus the sorted rules the
|
|
42
|
+
// self-test ran, so any rule, fixture or param change invalidates it.
|
|
43
|
+
export function selfTestHashFor(manifest) {
|
|
44
|
+
const rules = [...manifest.rules].sort((a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
|
|
45
|
+
return sha256Text(stableStringify({ pack: manifest.id, rules, version: manifest.version }));
|
|
46
|
+
}
|
|
47
|
+
// SPEC §4.4.4 and §4.4.7: a pack carrying accepted.json loads only while
|
|
48
|
+
// its content hash still matches. A pack never accepted loads without a
|
|
49
|
+
// gate; acceptance happens after `pack test` through acceptPack.
|
|
50
|
+
export async function verifyAcceptance(fs, dir, manifest, acceptedSchemaText) {
|
|
51
|
+
const acceptedPath = dir === "" ? ACCEPTED_NAME : `${dir}/${ACCEPTED_NAME}`;
|
|
52
|
+
const seen = await fs.exists(acceptedPath);
|
|
53
|
+
if (!seen.ok) {
|
|
54
|
+
return err(seen.error);
|
|
55
|
+
}
|
|
56
|
+
if (!seen.value) {
|
|
57
|
+
return ok(undefined);
|
|
58
|
+
}
|
|
59
|
+
const text = await fs.readText(acceptedPath);
|
|
60
|
+
if (!text.ok) {
|
|
61
|
+
return err(text.error);
|
|
62
|
+
}
|
|
63
|
+
const parsed = parseJson(text.value);
|
|
64
|
+
if (!parsed.ok) {
|
|
65
|
+
return err(parsed.error);
|
|
66
|
+
}
|
|
67
|
+
const checked = validateSchema(acceptedSchemaText, parsed.value);
|
|
68
|
+
if (!checked.ok) {
|
|
69
|
+
return err(checked.error);
|
|
70
|
+
}
|
|
71
|
+
const record = parsed.value;
|
|
72
|
+
const packHash = isRecord(record) ? field(record, "packHash") : undefined;
|
|
73
|
+
if (typeof packHash !== "string") {
|
|
74
|
+
return err(makeError("CDX-E203", `pack "${manifest.id}" accepted.json carries no packHash string`, "Re-run codictator pack test, then codictator pack accept, to rewrite accepted.json."));
|
|
75
|
+
}
|
|
76
|
+
const hashed = await packHashFor(fs, dir);
|
|
77
|
+
if (!hashed.ok) {
|
|
78
|
+
return err(hashed.error);
|
|
79
|
+
}
|
|
80
|
+
if (hashed.value !== packHash) {
|
|
81
|
+
return err(makeError("CDX-E203", `pack "${manifest.id}" changed after acceptance and is inert until re-accepted`, "Run codictator pack test, then codictator pack accept, to re-accept the pack."));
|
|
82
|
+
}
|
|
83
|
+
return ok(undefined);
|
|
84
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type { Pack, PackManifest, PackRule, PackRuleParam, } from "../../kernel/index.ts";
|
|
2
|
+
export interface PackAccepted {
|
|
3
|
+
readonly version: 1;
|
|
4
|
+
readonly packHash: string;
|
|
5
|
+
readonly selfTestHash: string;
|
|
6
|
+
readonly acceptedAt: string;
|
|
7
|
+
readonly acceptedBy: string;
|
|
8
|
+
}
|
|
9
|
+
export type { AcceptPackOptions } from "./accept.ts";
|
|
10
|
+
export { acceptPack } from "./accept.ts";
|
|
11
|
+
export { resolveCodeEnforcer } from "./enforcers/code.ts";
|
|
12
|
+
export { type ExternalArgs, type ExternalInput, type ExternalOptions, isExternalInput, type ToolDecl, type ToolEvent, type ToolVersion, } from "./enforcers/external.ts";
|
|
13
|
+
export { narrowExternalArgs, narrowToolDecl, } from "./enforcers/external-bind.ts";
|
|
14
|
+
export { resolveExternal } from "./enforcers/external-check.ts";
|
|
15
|
+
export { digestArgv, planRuns, safePath } from "./enforcers/external-runs.ts";
|
|
16
|
+
export { isParametricKind, resolveParametric } from "./enforcers/parametric.ts";
|
|
17
|
+
export { packHashFor, selfTestHashFor } from "./hashes.ts";
|
|
18
|
+
export type { LoadPackOptions } from "./loader.ts";
|
|
19
|
+
export { composePacks, loadBuiltinPack, loadPack } from "./loader.ts";
|
|
20
|
+
export { isBuiltinPackId } from "./manifest.ts";
|
|
21
|
+
export { resolveManifestEnforcers, resolvePackEnforcers } from "./registry.ts";
|
|
22
|
+
export { selfTest } from "./selftest.ts";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// SPEC §4.4: pack loading, composition, self-test, external tools. Owns
|
|
2
|
+
// the §7.3 pack.json and §7.4 accepted.json formats.
|
|
3
|
+
export { acceptPack } from "./accept.js";
|
|
4
|
+
export { resolveCodeEnforcer } from "./enforcers/code.js";
|
|
5
|
+
export { isExternalInput, } from "./enforcers/external.js";
|
|
6
|
+
export { narrowExternalArgs, narrowToolDecl, } from "./enforcers/external-bind.js";
|
|
7
|
+
export { resolveExternal } from "./enforcers/external-check.js";
|
|
8
|
+
export { digestArgv, planRuns, safePath } from "./enforcers/external-runs.js";
|
|
9
|
+
export { isParametricKind, resolveParametric } from "./enforcers/parametric.js";
|
|
10
|
+
export { packHashFor, selfTestHashFor } from "./hashes.js";
|
|
11
|
+
export { composePacks, loadBuiltinPack, loadPack } from "./loader.js";
|
|
12
|
+
export { isBuiltinPackId } from "./manifest.js";
|
|
13
|
+
export { resolveManifestEnforcers, resolvePackEnforcers } from "./registry.js";
|
|
14
|
+
// SPEC §4.4.4: self-test every rule against its fixtures before use.
|
|
15
|
+
export { selfTest } from "./selftest.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Ports, Result } from "../../kernel/index.ts";
|
|
2
|
+
import type { ExternalOptions } from "./enforcers/external.ts";
|
|
3
|
+
import type { Pack } from "./index.ts";
|
|
4
|
+
export interface LoadPackOptions {
|
|
5
|
+
readonly ports?: Ports;
|
|
6
|
+
readonly builtin?: boolean;
|
|
7
|
+
readonly skipAcceptance?: boolean;
|
|
8
|
+
readonly tools?: ReadonlyArray<unknown>;
|
|
9
|
+
readonly onToolEvent?: ExternalOptions["onToolEvent"];
|
|
10
|
+
}
|
|
11
|
+
export declare function loadPack(packPath: string, options?: LoadPackOptions): Promise<Result<Pack>>;
|
|
12
|
+
export declare function loadBuiltinPack(id: string, options?: LoadPackOptions): Promise<Result<Pack>>;
|
|
13
|
+
export declare function composePacks(packs: ReadonlyArray<Pack>): Result<ReadonlyArray<Pack>>;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
// SPEC §4.4.3: loading and composition. Reads pack.json (schema §7.3),
|
|
2
|
+
// applies the manifest checks, verifies custom-pack acceptance (§4.4.7),
|
|
3
|
+
// and resolves declared enforcers as deferred stubs that throw CDX-E901,
|
|
4
|
+
// so nothing silently passes until its owning module lands.
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
import { err, makeError, NodeFs, ok, parseJson, stableStringify, validateSchema, } from "../../kernel/index.js";
|
|
8
|
+
import { narrowToolDecl } from "./enforcers/external-bind.js";
|
|
9
|
+
import { verifyAcceptance } from "./hashes.js";
|
|
10
|
+
import { checkPack, field, isBuiltinPackId, isRecord, narrowEnforcerDecl, narrowManifest, } from "./manifest.js";
|
|
11
|
+
import { livePorts, resolvePackEnforcers } from "./registry.js";
|
|
12
|
+
// SPEC §4.4.1: the owning pack's directory holds pack.json beside fixtures/.
|
|
13
|
+
function builtinPackDir(id) {
|
|
14
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
15
|
+
return path.resolve(here, "..", "..", "builtin-packs", id);
|
|
16
|
+
}
|
|
17
|
+
function packageSchemaDir() {
|
|
18
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
19
|
+
return path.resolve(here, "..", "..", "..", "schema");
|
|
20
|
+
}
|
|
21
|
+
function toPosix(value) {
|
|
22
|
+
return value.split(path.sep).join("/");
|
|
23
|
+
}
|
|
24
|
+
function deepFreeze(value) {
|
|
25
|
+
if (typeof value !== "object" || value === null || Object.isFrozen(value)) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
for (const entry of Object.values(value)) {
|
|
29
|
+
deepFreeze(entry);
|
|
30
|
+
}
|
|
31
|
+
Object.freeze(value);
|
|
32
|
+
}
|
|
33
|
+
// The shipped schemas carry `$schema` and `title`, which are metadata
|
|
34
|
+
// with no validation semantics in the kernel subset (§4.1.2). Stripping
|
|
35
|
+
// them keeps schema/ as the single owner of the format without touching
|
|
36
|
+
// the kernel for pack loading.
|
|
37
|
+
function stripSchemaMetadata(value) {
|
|
38
|
+
if (Array.isArray(value)) {
|
|
39
|
+
return value.map((entry) => stripSchemaMetadata(entry));
|
|
40
|
+
}
|
|
41
|
+
if (isRecord(value)) {
|
|
42
|
+
const kept = {};
|
|
43
|
+
for (const key of Object.keys(value)) {
|
|
44
|
+
if (key === "$schema" || key === "title") {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
kept[key] = stripSchemaMetadata(field(value, key));
|
|
48
|
+
}
|
|
49
|
+
return kept;
|
|
50
|
+
}
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
async function readSchemaText(name) {
|
|
54
|
+
const absolute = path.join(packageSchemaDir(), name);
|
|
55
|
+
const root = path.parse(absolute).root;
|
|
56
|
+
const made = await NodeFs.create({ root });
|
|
57
|
+
if (!made.ok) {
|
|
58
|
+
return err(made.error);
|
|
59
|
+
}
|
|
60
|
+
const text = await made.value.readText(toPosix(path.relative(root, absolute)));
|
|
61
|
+
if (!text.ok) {
|
|
62
|
+
return err(text.error);
|
|
63
|
+
}
|
|
64
|
+
const parsed = parseJson(text.value);
|
|
65
|
+
if (!parsed.ok) {
|
|
66
|
+
return err(parsed.error);
|
|
67
|
+
}
|
|
68
|
+
return ok(stableStringify(stripSchemaMetadata(parsed.value)));
|
|
69
|
+
}
|
|
70
|
+
// SPEC §4.4.3: load one pack directory (pack.json plus accepted.json).
|
|
71
|
+
export async function loadPack(packPath, options = {}) {
|
|
72
|
+
const builtin = options.builtin ?? false;
|
|
73
|
+
const resolved = path.resolve(packPath);
|
|
74
|
+
// Injected ports read caller-form paths (the CLI passes repo-relative
|
|
75
|
+
// ones); without ports the loader resolves against the cwd and reads
|
|
76
|
+
// through a drive-rooted live port. The schema always ships with this
|
|
77
|
+
// package, so it always reads through a live port.
|
|
78
|
+
let fs;
|
|
79
|
+
let at;
|
|
80
|
+
let dirForm;
|
|
81
|
+
if (options.ports !== undefined) {
|
|
82
|
+
fs = options.ports.fs;
|
|
83
|
+
const base = toPosix(packPath);
|
|
84
|
+
at = (name) => `${base}/${name}`;
|
|
85
|
+
dirForm = base;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
const root = path.parse(resolved).root;
|
|
89
|
+
const made = await NodeFs.create({ root });
|
|
90
|
+
if (!made.ok) {
|
|
91
|
+
return err(made.error);
|
|
92
|
+
}
|
|
93
|
+
fs = made.value;
|
|
94
|
+
at = (name) => toPosix(path.relative(root, path.join(resolved, name)));
|
|
95
|
+
dirForm = toPosix(path.relative(root, resolved));
|
|
96
|
+
}
|
|
97
|
+
const seen = await fs.exists(at("pack.json"));
|
|
98
|
+
if (!seen.ok) {
|
|
99
|
+
return err(seen.error);
|
|
100
|
+
}
|
|
101
|
+
if (!seen.value) {
|
|
102
|
+
return err(makeError("CDX-E203", `no pack.json under ${resolved}: not a pack directory`, "Point the pack path at a directory holding pack.json (§4.4.1)."));
|
|
103
|
+
}
|
|
104
|
+
const text = await fs.readText(at("pack.json"));
|
|
105
|
+
if (!text.ok) {
|
|
106
|
+
return err(text.error);
|
|
107
|
+
}
|
|
108
|
+
const schemaText = await readSchemaText("pack.schema.json");
|
|
109
|
+
if (!schemaText.ok) {
|
|
110
|
+
return err(schemaText.error);
|
|
111
|
+
}
|
|
112
|
+
const parsed = parseJson(text.value);
|
|
113
|
+
if (!parsed.ok) {
|
|
114
|
+
return err(parsed.error);
|
|
115
|
+
}
|
|
116
|
+
const schemaChecked = validateSchema(schemaText.value, parsed.value);
|
|
117
|
+
if (!schemaChecked.ok) {
|
|
118
|
+
return err(schemaChecked.error);
|
|
119
|
+
}
|
|
120
|
+
const narrowed = narrowManifest(parsed.value);
|
|
121
|
+
if (!narrowed.ok) {
|
|
122
|
+
return err(narrowed.error);
|
|
123
|
+
}
|
|
124
|
+
const manifest = narrowed.value;
|
|
125
|
+
const checked = checkPack(manifest, builtin);
|
|
126
|
+
if (!checked.ok) {
|
|
127
|
+
return err(checked.error);
|
|
128
|
+
}
|
|
129
|
+
if (!(options.skipAcceptance ?? false)) {
|
|
130
|
+
const acceptedSchemaText = await readSchemaText("accepted.schema.json");
|
|
131
|
+
if (!acceptedSchemaText.ok) {
|
|
132
|
+
return err(acceptedSchemaText.error);
|
|
133
|
+
}
|
|
134
|
+
const accepted = await verifyAcceptance(fs, dirForm, manifest, acceptedSchemaText.value);
|
|
135
|
+
if (!accepted.ok) {
|
|
136
|
+
return err(accepted.error);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const decls = [];
|
|
140
|
+
for (const entry of manifest.enforcers) {
|
|
141
|
+
const narrowedDecl = narrowEnforcerDecl(entry);
|
|
142
|
+
if (!narrowedDecl.ok) {
|
|
143
|
+
return err(narrowedDecl.error);
|
|
144
|
+
}
|
|
145
|
+
decls.push(narrowedDecl.value);
|
|
146
|
+
}
|
|
147
|
+
decls.sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0));
|
|
148
|
+
const tools = [];
|
|
149
|
+
for (const entry of options.tools ?? []) {
|
|
150
|
+
const narrowedTool = narrowToolDecl(entry);
|
|
151
|
+
if (!narrowedTool.ok) {
|
|
152
|
+
return err(narrowedTool.error);
|
|
153
|
+
}
|
|
154
|
+
tools.push(narrowedTool.value);
|
|
155
|
+
}
|
|
156
|
+
let enforcerPorts;
|
|
157
|
+
if (options.ports !== undefined) {
|
|
158
|
+
enforcerPorts = options.ports;
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
const live = await livePorts(path.parse(resolved).root);
|
|
162
|
+
if (!live.ok) {
|
|
163
|
+
return err(live.error);
|
|
164
|
+
}
|
|
165
|
+
enforcerPorts = live.value;
|
|
166
|
+
}
|
|
167
|
+
const externalOptions = options.onToolEvent === undefined
|
|
168
|
+
? {}
|
|
169
|
+
: { onToolEvent: options.onToolEvent };
|
|
170
|
+
const enforcers = resolvePackEnforcers(manifest, decls, enforcerPorts, tools, externalOptions);
|
|
171
|
+
if (!enforcers.ok) {
|
|
172
|
+
return err(enforcers.error);
|
|
173
|
+
}
|
|
174
|
+
deepFreeze(manifest);
|
|
175
|
+
return ok({
|
|
176
|
+
manifest,
|
|
177
|
+
enforcers: enforcers.value,
|
|
178
|
+
drivers: manifest.drivers,
|
|
179
|
+
assets: manifest.assets,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
// SPEC §4.4.2: load a built-in pack by id from its own directory.
|
|
183
|
+
export function loadBuiltinPack(id, options = {}) {
|
|
184
|
+
if (!isBuiltinPackId(id)) {
|
|
185
|
+
return Promise.resolve(err(makeError("CDX-E203", `unknown built-in pack id "${id}"`, "Load core, typescript, dotnet or python.")));
|
|
186
|
+
}
|
|
187
|
+
return loadPack(builtinPackDir(id), { ...options, builtin: true });
|
|
188
|
+
}
|
|
189
|
+
// SPEC §4.4.3 steps 1–2 and 5: packs arrive in load order (core, language
|
|
190
|
+
// packs in config.packs order, custom packs); rule ids must be globally
|
|
191
|
+
// unique across them (CDX-E202). Extractor overlap reporting is status
|
|
192
|
+
// output (SPEC §4.4.8 EC-13) and lands with the CLI.
|
|
193
|
+
export function composePacks(packs) {
|
|
194
|
+
const owners = new Map();
|
|
195
|
+
for (const pack of packs) {
|
|
196
|
+
for (const rule of pack.manifest.rules) {
|
|
197
|
+
const owner = owners.get(rule.id);
|
|
198
|
+
if (owner !== undefined) {
|
|
199
|
+
return err(makeError("CDX-E202", `duplicate rule id "${rule.id}" in packs "${owner}" and "${pack.manifest.id}"`, "Keep rule ids globally unique across composed packs, then reload."));
|
|
200
|
+
}
|
|
201
|
+
owners.set(rule.id, pack.manifest.id);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return ok([...packs]);
|
|
205
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Result } from "../../kernel/index.ts";
|
|
2
|
+
import type { PackManifest } from "./index.ts";
|
|
3
|
+
export interface EnforcerDecl {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly kind: string;
|
|
6
|
+
readonly module?: string;
|
|
7
|
+
readonly budgetMs: number;
|
|
8
|
+
readonly tool?: string;
|
|
9
|
+
readonly ruleMap?: Readonly<Record<string, string>>;
|
|
10
|
+
readonly args?: unknown;
|
|
11
|
+
}
|
|
12
|
+
export declare function isBuiltinPackId(id: string): boolean;
|
|
13
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
14
|
+
export declare function field(record: Readonly<Record<string, unknown>>, name: string): unknown;
|
|
15
|
+
export declare function narrowEnforcerDecl(entry: unknown): Result<EnforcerDecl>;
|
|
16
|
+
export declare function narrowManifest(value: unknown): Result<PackManifest>;
|
|
17
|
+
export declare function checkPack(manifest: PackManifest, builtin: boolean): Result<void>;
|