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,180 @@
|
|
|
1
|
+
export const CODICTATOR_PROFILE = "app";
|
|
2
|
+
export const CODICTATOR_MODULES = [
|
|
3
|
+
{ name: "kernel", path: "src/kernel/**", kind: "kernel", dependsOn: [] },
|
|
4
|
+
{
|
|
5
|
+
name: "config",
|
|
6
|
+
path: "src/features/config/**",
|
|
7
|
+
kind: "feature",
|
|
8
|
+
dependsOn: ["kernel"],
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "engine",
|
|
12
|
+
path: "src/features/engine/**",
|
|
13
|
+
kind: "feature",
|
|
14
|
+
dependsOn: ["kernel", "config", "audit"],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "packs",
|
|
18
|
+
path: "src/features/packs/**",
|
|
19
|
+
kind: "feature",
|
|
20
|
+
dependsOn: ["kernel", "config", "engine"],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "adapters",
|
|
24
|
+
path: "src/features/adapters/**",
|
|
25
|
+
kind: "feature",
|
|
26
|
+
dependsOn: ["kernel", "config", "engine", "steering"],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "steering",
|
|
30
|
+
path: "src/features/steering/**",
|
|
31
|
+
kind: "feature",
|
|
32
|
+
dependsOn: ["kernel", "config", "engine", "workflow"],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "security",
|
|
36
|
+
path: "src/features/security/**",
|
|
37
|
+
kind: "feature",
|
|
38
|
+
dependsOn: ["kernel", "engine"],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "deps",
|
|
42
|
+
path: "src/features/deps/**",
|
|
43
|
+
kind: "feature",
|
|
44
|
+
dependsOn: ["kernel", "config", "engine"],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "records",
|
|
48
|
+
path: "src/features/records/**",
|
|
49
|
+
kind: "feature",
|
|
50
|
+
dependsOn: ["kernel", "engine"],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "testing",
|
|
54
|
+
path: "src/features/testing/**",
|
|
55
|
+
kind: "feature",
|
|
56
|
+
dependsOn: ["kernel", "config", "engine"],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "arch",
|
|
60
|
+
path: "src/features/arch/**",
|
|
61
|
+
kind: "feature",
|
|
62
|
+
dependsOn: ["kernel", "config", "engine"],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "workflow",
|
|
66
|
+
path: "src/features/workflow/**",
|
|
67
|
+
kind: "feature",
|
|
68
|
+
dependsOn: ["kernel", "config", "engine", "testing", "audit"],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "remediation",
|
|
72
|
+
path: "src/features/remediation/**",
|
|
73
|
+
kind: "feature",
|
|
74
|
+
dependsOn: ["kernel", "config", "engine", "deps", "arch", "workflow"],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "integrity",
|
|
78
|
+
path: "src/features/integrity/**",
|
|
79
|
+
kind: "feature",
|
|
80
|
+
dependsOn: ["kernel", "config", "engine"],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "ci",
|
|
84
|
+
path: "src/features/ci/**",
|
|
85
|
+
kind: "feature",
|
|
86
|
+
dependsOn: ["kernel", "config", "engine"],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "generator",
|
|
90
|
+
path: "src/features/generator/**",
|
|
91
|
+
kind: "feature",
|
|
92
|
+
dependsOn: ["kernel", "config", "packs", "llm"],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: "llm",
|
|
96
|
+
path: "src/features/llm/**",
|
|
97
|
+
kind: "feature",
|
|
98
|
+
dependsOn: ["kernel"],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "audit",
|
|
102
|
+
path: "src/features/audit/**",
|
|
103
|
+
kind: "feature",
|
|
104
|
+
dependsOn: ["kernel"],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: "builtin-packs/core",
|
|
108
|
+
path: "src/builtin-packs/core/**",
|
|
109
|
+
dependsOn: [
|
|
110
|
+
"kernel",
|
|
111
|
+
"engine",
|
|
112
|
+
"security",
|
|
113
|
+
"deps",
|
|
114
|
+
"records",
|
|
115
|
+
"testing",
|
|
116
|
+
"arch",
|
|
117
|
+
"workflow",
|
|
118
|
+
"integrity",
|
|
119
|
+
"steering",
|
|
120
|
+
"ci",
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: "builtin-packs/typescript",
|
|
125
|
+
path: "src/builtin-packs/typescript/**",
|
|
126
|
+
dependsOn: [
|
|
127
|
+
"kernel",
|
|
128
|
+
"engine",
|
|
129
|
+
"security",
|
|
130
|
+
"deps",
|
|
131
|
+
"records",
|
|
132
|
+
"testing",
|
|
133
|
+
"arch",
|
|
134
|
+
"workflow",
|
|
135
|
+
"integrity",
|
|
136
|
+
"steering",
|
|
137
|
+
"ci",
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "builtin-packs/dotnet",
|
|
142
|
+
path: "src/builtin-packs/dotnet/**",
|
|
143
|
+
dependsOn: [
|
|
144
|
+
"kernel",
|
|
145
|
+
"engine",
|
|
146
|
+
"security",
|
|
147
|
+
"deps",
|
|
148
|
+
"records",
|
|
149
|
+
"testing",
|
|
150
|
+
"arch",
|
|
151
|
+
"workflow",
|
|
152
|
+
"integrity",
|
|
153
|
+
"steering",
|
|
154
|
+
"ci",
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "builtin-packs/python",
|
|
159
|
+
path: "src/builtin-packs/python/**",
|
|
160
|
+
dependsOn: [
|
|
161
|
+
"kernel",
|
|
162
|
+
"engine",
|
|
163
|
+
"security",
|
|
164
|
+
"deps",
|
|
165
|
+
"records",
|
|
166
|
+
"testing",
|
|
167
|
+
"arch",
|
|
168
|
+
"workflow",
|
|
169
|
+
"integrity",
|
|
170
|
+
"steering",
|
|
171
|
+
"ci",
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: "cli",
|
|
176
|
+
path: "src/cli/**",
|
|
177
|
+
kind: "composition",
|
|
178
|
+
dependsOn: ["*"],
|
|
179
|
+
},
|
|
180
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function findModuleCycle(names: ReadonlyArray<string>, depends: ReadonlyMap<string, ReadonlyArray<string>>, shouldSkip?: (dep: string) => boolean): Array<string> | undefined;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// SPEC §4.11: shared depth-first cycle walk over a module dependency map.
|
|
2
|
+
// Both the evaluation-path check (checks.ts) and the config validation
|
|
3
|
+
// (module-map-validation.ts) judge acyclicity the same way; this single
|
|
4
|
+
// helper keeps the two call sites behavior-identical.
|
|
5
|
+
export function findModuleCycle(names, depends, shouldSkip) {
|
|
6
|
+
const visiting = new Set();
|
|
7
|
+
const done = new Set();
|
|
8
|
+
const walk = (name, trail) => {
|
|
9
|
+
if (done.has(name)) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
if (visiting.has(name)) {
|
|
13
|
+
return [...trail.slice(trail.indexOf(name)), name];
|
|
14
|
+
}
|
|
15
|
+
visiting.add(name);
|
|
16
|
+
for (const dep of depends.get(name) ?? []) {
|
|
17
|
+
if (shouldSkip?.(dep) === true) {
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
const found = walk(dep, [...trail, name]);
|
|
21
|
+
if (found !== undefined) {
|
|
22
|
+
return found;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
visiting.delete(name);
|
|
26
|
+
done.add(name);
|
|
27
|
+
return undefined;
|
|
28
|
+
};
|
|
29
|
+
for (const name of names) {
|
|
30
|
+
const found = walk(name, []);
|
|
31
|
+
if (found !== undefined) {
|
|
32
|
+
return found;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Finding } from "../engine/index.ts";
|
|
2
|
+
import type { ModuleNode } from "./index.ts";
|
|
3
|
+
import { type ArchDenyRule } from "./module-mapping.ts";
|
|
4
|
+
export interface ResolvedEdge {
|
|
5
|
+
readonly from: string;
|
|
6
|
+
readonly line: number;
|
|
7
|
+
readonly to: string;
|
|
8
|
+
readonly fromMod: ModuleNode | undefined;
|
|
9
|
+
readonly toMod: ModuleNode | undefined;
|
|
10
|
+
readonly external: "entry" | "deep" | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare function resolveEdge(modules: ReadonlyArray<ModuleNode>, from: string, line: number, spec: string): ResolvedEdge;
|
|
13
|
+
export declare function checkResolvedEdge(edge: ResolvedEdge, profile: string, layerDirs: ReadonlyArray<string>, deny: ReadonlyArray<ArchDenyRule>): Array<Finding>;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { isArchProfile } from "./arch-profiles.js";
|
|
2
|
+
import { assignModule, isBuiltinSpecifier, moduleBase, normalizeSeparators, resolveImportTarget, } from "./graph.js";
|
|
3
|
+
import { layerMayImport, resolveLayer } from "./layer-rules.js";
|
|
4
|
+
import { dependsAllowed, isPublicEntryTarget, mappedFinding, moduleEntry, profileAllowsEdge, } from "./module-mapping.js";
|
|
5
|
+
function isExternalEntrySpecifier(spec) {
|
|
6
|
+
const target = normalizeSeparators(spec);
|
|
7
|
+
if (target.startsWith("@")) {
|
|
8
|
+
const rest = target.slice(1);
|
|
9
|
+
const slash = rest.indexOf("/");
|
|
10
|
+
if (slash < 0) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
return rest.indexOf("/", slash + 1) < 0;
|
|
14
|
+
}
|
|
15
|
+
return !target.includes("/");
|
|
16
|
+
}
|
|
17
|
+
// A bare specifier with a subpath is a deep import past the package entry
|
|
18
|
+
// (SPEC §4.11 EC-9); built-ins stay external nodes for the item-3 scan.
|
|
19
|
+
function boundaryFinding(from, line, message) {
|
|
20
|
+
return {
|
|
21
|
+
ruleId: "core/arch-boundaries",
|
|
22
|
+
path: from,
|
|
23
|
+
line,
|
|
24
|
+
message,
|
|
25
|
+
remediation: "Declare the edge in config.architecture modules[].dependsOn, or remove the import.",
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function entryFinding(from, line, target, entry) {
|
|
29
|
+
return {
|
|
30
|
+
ruleId: "core/arch-public-entry",
|
|
31
|
+
path: from,
|
|
32
|
+
line,
|
|
33
|
+
message: `cross-module import targets ${target}, outside the public entry ${entry}`,
|
|
34
|
+
remediation: `Import from the module entry ${entry}, or move the shared code there.`,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function resolveEdge(modules, from, line, spec) {
|
|
38
|
+
const source = normalizeSeparators(from);
|
|
39
|
+
const raw = normalizeSeparators(spec);
|
|
40
|
+
if (raw === "dynamic:expr") {
|
|
41
|
+
return {
|
|
42
|
+
from: source,
|
|
43
|
+
line,
|
|
44
|
+
to: raw,
|
|
45
|
+
fromMod: undefined,
|
|
46
|
+
toMod: undefined,
|
|
47
|
+
external: undefined,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const resolved = resolveImportTarget(modules, source, raw);
|
|
51
|
+
const fromMod = assignModule(modules, source);
|
|
52
|
+
if (isBuiltinSpecifier(raw)) {
|
|
53
|
+
return {
|
|
54
|
+
from: source,
|
|
55
|
+
line,
|
|
56
|
+
to: resolved,
|
|
57
|
+
fromMod,
|
|
58
|
+
toMod: undefined,
|
|
59
|
+
external: "entry",
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const assigned = assignModule(modules, resolved);
|
|
63
|
+
if (assigned !== undefined) {
|
|
64
|
+
return {
|
|
65
|
+
from: source,
|
|
66
|
+
line,
|
|
67
|
+
to: resolved,
|
|
68
|
+
fromMod,
|
|
69
|
+
toMod: assigned,
|
|
70
|
+
external: undefined,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (isRepoPath(resolved) ||
|
|
74
|
+
raw.startsWith("./") ||
|
|
75
|
+
raw.startsWith("../") ||
|
|
76
|
+
raw.startsWith("/")) {
|
|
77
|
+
return {
|
|
78
|
+
from: source,
|
|
79
|
+
line,
|
|
80
|
+
to: resolved,
|
|
81
|
+
fromMod,
|
|
82
|
+
toMod: undefined,
|
|
83
|
+
external: undefined,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
if (isExternalEntrySpecifier(raw)) {
|
|
87
|
+
return {
|
|
88
|
+
from: source,
|
|
89
|
+
line,
|
|
90
|
+
to: resolved,
|
|
91
|
+
fromMod,
|
|
92
|
+
toMod: undefined,
|
|
93
|
+
external: "entry",
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
from: source,
|
|
98
|
+
line,
|
|
99
|
+
to: resolved,
|
|
100
|
+
fromMod,
|
|
101
|
+
toMod: undefined,
|
|
102
|
+
external: "deep",
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function isRepoPath(value) {
|
|
106
|
+
return value.startsWith("src/");
|
|
107
|
+
}
|
|
108
|
+
// SPEC §4.11.5 EC-5: a non-literal dynamic target is unresolvable. The
|
|
109
|
+
// finding blocks in kernel and domain code and advises elsewhere.
|
|
110
|
+
function dynamicFinding(edge, fromMod) {
|
|
111
|
+
const strict = fromMod?.kind === "kernel";
|
|
112
|
+
return {
|
|
113
|
+
ruleId: "core/arch-boundaries",
|
|
114
|
+
code: "unresolvable-dynamic-import",
|
|
115
|
+
path: edge.from,
|
|
116
|
+
line: edge.line,
|
|
117
|
+
message: strict
|
|
118
|
+
? `unresolvable dynamic import in ${fromMod?.name ?? "unknown"}: kernel code must use static imports`
|
|
119
|
+
: `unresolvable dynamic import at ${edge.from}:${edge.line}: the arch guard cannot judge a non-literal target`,
|
|
120
|
+
remediation: "Replace the expression with a literal specifier so the import graph can resolve it.",
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function layerFinding(from, line, fromLayer, toLayer) {
|
|
124
|
+
return {
|
|
125
|
+
ruleId: "core/arch-boundaries",
|
|
126
|
+
path: from,
|
|
127
|
+
line,
|
|
128
|
+
message: `layer ${fromLayer} must not import layer ${toLayer}`,
|
|
129
|
+
remediation: "Point the import down the layer direction (domain <- application <- infrastructure/ui), or move the shared code.",
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function checkLayerEdge(edge, fromMod, toMod, profile, layerDirs) {
|
|
133
|
+
if (fromMod.name !== toMod.name || layerDirs.length === 0) {
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
const base = moduleBase(fromMod);
|
|
137
|
+
const fromLayer = resolveLayer(edge.from, base, layerDirs);
|
|
138
|
+
const toLayer = resolveLayer(edge.to, base, layerDirs);
|
|
139
|
+
if (fromLayer === undefined || toLayer === undefined) {
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
if (fromLayer !== toLayer &&
|
|
143
|
+
!layerMayImport(fromLayer, toLayer, isArchProfile(profile) ? profile : "app")) {
|
|
144
|
+
return layerFinding(edge.from, edge.line, fromLayer, toLayer);
|
|
145
|
+
}
|
|
146
|
+
return undefined;
|
|
147
|
+
}
|
|
148
|
+
export function checkResolvedEdge(edge, profile, layerDirs, deny) {
|
|
149
|
+
const findings = [];
|
|
150
|
+
const fromMod = edge.fromMod;
|
|
151
|
+
if (fromMod === undefined) {
|
|
152
|
+
return findings;
|
|
153
|
+
}
|
|
154
|
+
if (edge.to === "dynamic:expr") {
|
|
155
|
+
findings.push(dynamicFinding(edge, fromMod));
|
|
156
|
+
return findings;
|
|
157
|
+
}
|
|
158
|
+
if (edge.external === "entry") {
|
|
159
|
+
return findings;
|
|
160
|
+
}
|
|
161
|
+
if (edge.external === "deep") {
|
|
162
|
+
findings.push(entryFinding(edge.from, edge.line, edge.to, `${edge.to} entry`));
|
|
163
|
+
return findings;
|
|
164
|
+
}
|
|
165
|
+
const toMod = edge.toMod;
|
|
166
|
+
if (toMod === undefined) {
|
|
167
|
+
findings.push(mappedFinding(edge.from, edge.line, `import target ${edge.to} sits outside every architecture module`));
|
|
168
|
+
return findings;
|
|
169
|
+
}
|
|
170
|
+
if (toMod.name === fromMod.name) {
|
|
171
|
+
const layered = checkLayerEdge(edge, fromMod, toMod, profile, layerDirs);
|
|
172
|
+
if (layered !== undefined) {
|
|
173
|
+
findings.push(layered);
|
|
174
|
+
}
|
|
175
|
+
return findings;
|
|
176
|
+
}
|
|
177
|
+
const entry = moduleEntry(toMod);
|
|
178
|
+
if (!isPublicEntryTarget(toMod, edge.to)) {
|
|
179
|
+
findings.push(entryFinding(edge.from, edge.line, edge.to, entry));
|
|
180
|
+
}
|
|
181
|
+
if (!dependsAllowed(fromMod, toMod, deny) ||
|
|
182
|
+
!profileAllowsEdge(profile, fromMod, toMod)) {
|
|
183
|
+
findings.push(boundaryFinding(edge.from, edge.line, `module ${fromMod.name} must not import module ${toMod.name}`));
|
|
184
|
+
}
|
|
185
|
+
return findings;
|
|
186
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type Result } from "../../kernel/index.ts";
|
|
2
|
+
import type { ImportRef, ModuleNode } from "./index.ts";
|
|
3
|
+
export declare function normalizeSeparators(path: string): string;
|
|
4
|
+
export declare function normalizeImportPath(path: string): string;
|
|
5
|
+
export declare function resolveRelativeSpecifier(fromPath: string, spec: string): string;
|
|
6
|
+
export declare function isRelativeSpecifier(spec: string): boolean;
|
|
7
|
+
export declare function isBuiltinSpecifier(spec: string): boolean;
|
|
8
|
+
export declare function moduleBase(mod: ModuleNode): string;
|
|
9
|
+
export declare function assignModule(modules: ReadonlyArray<ModuleNode>, file: string): ModuleNode | undefined;
|
|
10
|
+
export declare function resolveAliasSpecifier(modules: ReadonlyArray<ModuleNode>, spec: string): string | undefined;
|
|
11
|
+
export declare function resolveImportTarget(modules: ReadonlyArray<ModuleNode>, from: string, spec: string): string;
|
|
12
|
+
export declare function buildGraph(modules: ReadonlyArray<ModuleNode>, refs: ReadonlyArray<ImportRef>): Array<ImportRef>;
|
|
13
|
+
export interface GraphCacheEntry {
|
|
14
|
+
readonly hash: string;
|
|
15
|
+
readonly refs: ReadonlyArray<ImportRef>;
|
|
16
|
+
}
|
|
17
|
+
export interface GraphCacheState {
|
|
18
|
+
readonly version: 1;
|
|
19
|
+
readonly entries: Readonly<Record<string, GraphCacheEntry>>;
|
|
20
|
+
}
|
|
21
|
+
export declare const EMPTY_GRAPH_CACHE: GraphCacheState;
|
|
22
|
+
export declare function hashGraphContent(text: string): string;
|
|
23
|
+
export declare function parseGraphCache(text: string): Result<GraphCacheState>;
|
|
24
|
+
export declare function serializeGraphCache(cache: GraphCacheState): string;
|
|
25
|
+
export interface GraphCacheFile {
|
|
26
|
+
readonly path: string;
|
|
27
|
+
readonly text: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function updateGraphCache(cache: GraphCacheState, files: ReadonlyArray<GraphCacheFile>, extract: (path: string, text: string) => ReadonlyArray<ImportRef>): {
|
|
30
|
+
readonly cache: GraphCacheState;
|
|
31
|
+
readonly refs: Array<ImportRef>;
|
|
32
|
+
};
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
// SPEC §4.11.3: the language-neutral import graph. Path handling,
|
|
2
|
+
// module assignment and the content-hash cache live here; the per-language
|
|
3
|
+
// lexers feed it through the ImportExtractor contract (§3.4).
|
|
4
|
+
import { err, makeError, normalizeText, ok, parseJson, sha256Text, stableStringify, } from "../../kernel/index.js";
|
|
5
|
+
// SPEC §4.11 EC-13: Windows separators normalise before resolution.
|
|
6
|
+
export function normalizeSeparators(path) {
|
|
7
|
+
return path.split("\\").join("/");
|
|
8
|
+
}
|
|
9
|
+
function splitSegments(path) {
|
|
10
|
+
return path.split("/");
|
|
11
|
+
}
|
|
12
|
+
function joinSegments(parts) {
|
|
13
|
+
return parts.join("/");
|
|
14
|
+
}
|
|
15
|
+
// Lexical `.`/`..` collapsing over posix segments; never touches the disk.
|
|
16
|
+
export function normalizeImportPath(path) {
|
|
17
|
+
const absolute = path.startsWith("/");
|
|
18
|
+
const kept = [];
|
|
19
|
+
for (const part of splitSegments(path)) {
|
|
20
|
+
if (part === "" || part === ".") {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if (part === "..") {
|
|
24
|
+
kept.pop();
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
kept.push(part);
|
|
28
|
+
}
|
|
29
|
+
const joined = joinSegments(kept);
|
|
30
|
+
return absolute ? `/${joined}` : joined;
|
|
31
|
+
}
|
|
32
|
+
function parentDir(path) {
|
|
33
|
+
const slash = path.lastIndexOf("/");
|
|
34
|
+
if (slash < 0) {
|
|
35
|
+
return ".";
|
|
36
|
+
}
|
|
37
|
+
if (slash === 0) {
|
|
38
|
+
return "/";
|
|
39
|
+
}
|
|
40
|
+
return path.slice(0, slash);
|
|
41
|
+
}
|
|
42
|
+
// Relative resolution against the importing file, separators normalised.
|
|
43
|
+
export function resolveRelativeSpecifier(fromPath, spec) {
|
|
44
|
+
const from = normalizeSeparators(fromPath);
|
|
45
|
+
const target = normalizeSeparators(spec);
|
|
46
|
+
const joined = parentDir(from) === "." ? target : `${parentDir(from)}/${target}`;
|
|
47
|
+
return normalizeImportPath(joined);
|
|
48
|
+
}
|
|
49
|
+
export function isRelativeSpecifier(spec) {
|
|
50
|
+
return (spec.startsWith("./") ||
|
|
51
|
+
spec.startsWith("../") ||
|
|
52
|
+
spec === "." ||
|
|
53
|
+
spec === "..");
|
|
54
|
+
}
|
|
55
|
+
export function isBuiltinSpecifier(spec) {
|
|
56
|
+
return spec.startsWith("node:") || spec === "node";
|
|
57
|
+
}
|
|
58
|
+
// The `path` glob is a literal prefix ending in `/**`; the first module
|
|
59
|
+
// whose prefix holds the file owns it (§4.11.3 Assign).
|
|
60
|
+
export function moduleBase(mod) {
|
|
61
|
+
const raw = normalizeSeparators(mod.path);
|
|
62
|
+
return raw.endsWith("/**") ? raw.slice(0, -3) : raw;
|
|
63
|
+
}
|
|
64
|
+
export function assignModule(modules, file) {
|
|
65
|
+
const candidate = normalizeSeparators(file);
|
|
66
|
+
for (const mod of modules) {
|
|
67
|
+
const base = moduleBase(mod);
|
|
68
|
+
if (candidate === base || candidate.startsWith(`${base}/`)) {
|
|
69
|
+
return mod;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
// An "@name/..." specifier names a module only when the map declares it;
|
|
75
|
+
// otherwise the checks judge it as an external package specifier.
|
|
76
|
+
export function resolveAliasSpecifier(modules, spec) {
|
|
77
|
+
const target = normalizeSeparators(spec);
|
|
78
|
+
if (!target.startsWith("@")) {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
const rest = target.slice(1);
|
|
82
|
+
const slash = rest.indexOf("/");
|
|
83
|
+
if (slash < 0) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
const name = rest.slice(0, slash);
|
|
87
|
+
const tail = rest.slice(slash + 1);
|
|
88
|
+
const mod = modules.find((entry) => entry.name === name || entry.name.endsWith(`/${name}`));
|
|
89
|
+
if (mod === undefined) {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
return tail === "" ? moduleBase(mod) : `${moduleBase(mod)}/${tail}`;
|
|
93
|
+
}
|
|
94
|
+
// SPEC §4.11.3 Extract+Resolve: separators first, then relative targets
|
|
95
|
+
// resolve against the importer. External package targets stay as written so
|
|
96
|
+
// the checks judge entry versus deep imports on the specifier.
|
|
97
|
+
export function resolveImportTarget(modules, from, spec) {
|
|
98
|
+
const source = normalizeSeparators(from);
|
|
99
|
+
const target = normalizeSeparators(spec);
|
|
100
|
+
if (isRelativeSpecifier(target)) {
|
|
101
|
+
return resolveRelativeSpecifier(source, target);
|
|
102
|
+
}
|
|
103
|
+
const aliased = resolveAliasSpecifier(modules, target);
|
|
104
|
+
if (aliased !== undefined) {
|
|
105
|
+
return normalizeImportPath(aliased);
|
|
106
|
+
}
|
|
107
|
+
if (!target.includes("/") || target.startsWith("@")) {
|
|
108
|
+
return target;
|
|
109
|
+
}
|
|
110
|
+
if (target.includes("://") || target.startsWith("/")) {
|
|
111
|
+
return normalizeImportPath(target);
|
|
112
|
+
}
|
|
113
|
+
return normalizeImportPath(target);
|
|
114
|
+
}
|
|
115
|
+
// SPEC §4.11.3: import graph construction over the module map. Pure:
|
|
116
|
+
// normalise, resolve, then hand the resolved edges to the checks. Cyclic
|
|
117
|
+
// dependsOn is a config error (CDX-E105 at validation); the graph itself
|
|
118
|
+
// never throws so L1 can judge a single new edge.
|
|
119
|
+
export function buildGraph(modules, refs) {
|
|
120
|
+
const seen = new Set();
|
|
121
|
+
const edges = [];
|
|
122
|
+
for (const ref of refs) {
|
|
123
|
+
const from = normalizeSeparators(ref.from);
|
|
124
|
+
const to = resolveImportTarget(modules, ref.from, ref.to);
|
|
125
|
+
const key = JSON.stringify([from, to, ref.line]);
|
|
126
|
+
if (seen.has(key)) {
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
seen.add(key);
|
|
130
|
+
edges.push({ from, to, line: ref.line });
|
|
131
|
+
}
|
|
132
|
+
edges.sort((left, right) => left.from < right.from
|
|
133
|
+
? -1
|
|
134
|
+
: left.from > right.from
|
|
135
|
+
? 1
|
|
136
|
+
: left.to < right.to
|
|
137
|
+
? -1
|
|
138
|
+
: left.to > right.to
|
|
139
|
+
? 1
|
|
140
|
+
: left.line - right.line);
|
|
141
|
+
return edges;
|
|
142
|
+
}
|
|
143
|
+
export const EMPTY_GRAPH_CACHE = { version: 1, entries: {} };
|
|
144
|
+
export function hashGraphContent(text) {
|
|
145
|
+
return sha256Text(normalizeText(text));
|
|
146
|
+
}
|
|
147
|
+
function isRecord(value) {
|
|
148
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
149
|
+
}
|
|
150
|
+
// Bracket access through a variable keeps noPropertyAccessFromIndexSignature
|
|
151
|
+
// satisfied without tripping useLiteralKeys (the config validate.ts pattern).
|
|
152
|
+
function field(record, name) {
|
|
153
|
+
return record[name];
|
|
154
|
+
}
|
|
155
|
+
function isGraphCacheState(value) {
|
|
156
|
+
if (!isRecord(value)) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
if (field(value, "version") !== 1) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
const entries = field(value, "entries");
|
|
163
|
+
return typeof entries === "object" && entries !== null;
|
|
164
|
+
}
|
|
165
|
+
export function parseGraphCache(text) {
|
|
166
|
+
const parsed = parseJson(text);
|
|
167
|
+
if (!parsed.ok) {
|
|
168
|
+
return parsed;
|
|
169
|
+
}
|
|
170
|
+
if (!isGraphCacheState(parsed.value)) {
|
|
171
|
+
return err(makeError("CDX-E101", "graph cache is not a version 1 cache state", "Delete .codictator/cache/graph.json so the arch guard rebuilds it, then retry."));
|
|
172
|
+
}
|
|
173
|
+
return ok(parsed.value);
|
|
174
|
+
}
|
|
175
|
+
export function serializeGraphCache(cache) {
|
|
176
|
+
return stableStringify(cache);
|
|
177
|
+
}
|
|
178
|
+
// Re-lex only added and changed files; dropped files leave the cache.
|
|
179
|
+
export function updateGraphCache(cache, files, extract) {
|
|
180
|
+
const entries = {};
|
|
181
|
+
const refs = [];
|
|
182
|
+
const seen = new Set();
|
|
183
|
+
for (const file of files) {
|
|
184
|
+
const path = normalizeSeparators(file.path);
|
|
185
|
+
if (seen.has(path)) {
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
seen.add(path);
|
|
189
|
+
const hash = hashGraphContent(file.text);
|
|
190
|
+
const cached = cache.entries[path];
|
|
191
|
+
const fileRefs = cached !== undefined && cached.hash === hash
|
|
192
|
+
? cached.refs
|
|
193
|
+
: [...extract(path, file.text)].map((ref) => ({
|
|
194
|
+
from: normalizeSeparators(ref.from),
|
|
195
|
+
to: normalizeSeparators(ref.to),
|
|
196
|
+
line: ref.line,
|
|
197
|
+
}));
|
|
198
|
+
entries[path] = { hash, refs: fileRefs };
|
|
199
|
+
refs.push(...fileRefs);
|
|
200
|
+
}
|
|
201
|
+
return { cache: { version: 1, entries }, refs };
|
|
202
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CheckContext, Finding } from "../engine/index.ts";
|
|
2
|
+
import { ARCH_PROFILES, type ArchProfile, isArchProfile } from "./arch-profiles.ts";
|
|
3
|
+
import { type ArchCheckOptions, checkArchProfile, checkModuleSize, type ModuleSizeLimits, type ModuleSizeSummary } from "./checks.ts";
|
|
4
|
+
import { CODICTATOR_MODULES, CODICTATOR_PROFILE } from "./codictator-modules.ts";
|
|
5
|
+
import { EMPTY_GRAPH_CACHE, type GraphCacheEntry, type GraphCacheFile, type GraphCacheState, hashGraphContent, normalizeSeparators, parseGraphCache, resolveImportTarget, serializeGraphCache, updateGraphCache } from "./graph.ts";
|
|
6
|
+
import { layerMayImport, resolveLayer } from "./layer-rules.ts";
|
|
7
|
+
import { validateModuleMap } from "./module-map-validation.ts";
|
|
8
|
+
import { deriveModules, isPublicEntryTarget } from "./module-mapping.ts";
|
|
9
|
+
export interface ImportRef {
|
|
10
|
+
readonly from: string;
|
|
11
|
+
readonly to: string;
|
|
12
|
+
readonly line: number;
|
|
13
|
+
}
|
|
14
|
+
export interface ImportExtractor {
|
|
15
|
+
readonly language: string;
|
|
16
|
+
readonly extensions: ReadonlyArray<string>;
|
|
17
|
+
readonly extract: (path: string, text: string) => Array<ImportRef>;
|
|
18
|
+
}
|
|
19
|
+
export interface ModuleNode {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly path: string;
|
|
22
|
+
readonly kind?: string;
|
|
23
|
+
readonly entry?: string;
|
|
24
|
+
readonly dependsOn: ReadonlyArray<string>;
|
|
25
|
+
}
|
|
26
|
+
export type { ArchCheckOptions, ArchProfile, GraphCacheEntry, GraphCacheFile, GraphCacheState, ModuleSizeLimits, ModuleSizeSummary, };
|
|
27
|
+
export { ARCH_PROFILES, CODICTATOR_MODULES, CODICTATOR_PROFILE, checkArchProfile, checkModuleSize, deriveModules, EMPTY_GRAPH_CACHE, hashGraphContent, isArchProfile, isPublicEntryTarget, layerMayImport, normalizeSeparators, parseGraphCache, resolveImportTarget, resolveLayer, serializeGraphCache, updateGraphCache, validateModuleMap, };
|
|
28
|
+
export declare function buildGraph(modules: ReadonlyArray<ModuleNode>, refs: ReadonlyArray<ImportRef>): Array<ImportRef>;
|
|
29
|
+
export declare function checkArch(ctx: CheckContext, refs: ReadonlyArray<ImportRef>, options?: ArchCheckOptions): Promise<Array<Finding>>;
|