codictator 0.0.0 → 0.1.3
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/passing/exported/case.json +8 -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 +11 -0
- package/dist/cli/gate-scope.js +93 -0
- package/dist/cli/git-hook.d.ts +3 -0
- package/dist/cli/git-hook.js +184 -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 +2 -0
- package/dist/cli/plan-launcher.js +272 -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 +4 -0
- package/dist/features/adapters/claude-shaped.js +174 -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 +200 -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 +210 -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 +172 -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 +101 -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 +187 -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 +158 -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 +131 -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 +124 -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 +170 -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 +131 -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 +129 -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/engine-version-guards.d.ts +6 -0
- package/dist/features/packs/enforcers/engine-version-guards.js +42 -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 +206 -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 +109 -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 +11 -0
- package/dist/features/packs/enforcers/gate-guards.js +117 -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 +26 -0
- package/dist/features/packs/enforcers/health-measures.js +223 -0
- package/dist/features/packs/enforcers/health-refs.d.ts +5 -0
- package/dist/features/packs/enforcers/health-refs.js +76 -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 +6 -0
- package/dist/features/packs/enforcers/secret-scan.js +173 -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 +147 -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 +97 -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-decl.d.ts +13 -0
- package/dist/features/packs/manifest-decl.js +121 -0
- package/dist/features/packs/manifest.d.ts +7 -0
- package/dist/features/packs/manifest.js +95 -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 +144 -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 +142 -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 +112 -0
- package/dist/features/testing/tap-parser.d.ts +9 -0
- package/dist/features/testing/tap-parser.js +96 -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 +184 -0
- package/dist/features/workflow/review.d.ts +25 -0
- package/dist/features/workflow/review.js +119 -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 +128 -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 +150 -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 +70 -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 +213 -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,223 @@
|
|
|
1
|
+
// SPEC §4.9.2: doc shape checks — router/leaf topology, size, breadth.
|
|
2
|
+
// Line vocabulary lives in docs-lines.ts. All functions are pure over
|
|
3
|
+
// caller-supplied trees; this module never touches the filesystem
|
|
4
|
+
// (SPEC §3.3, §10.3 item 3).
|
|
5
|
+
import { normalizeText } from "../../kernel/index.js";
|
|
6
|
+
import { isHeading, isLinkOnlyLine, isTableRow, stripFences, } from "./docs-lines.js";
|
|
7
|
+
export { isTableRow } from "./docs-lines.js";
|
|
8
|
+
// SPEC §5.10: the tunable defaults the limits ship with.
|
|
9
|
+
export const DEFAULT_DOC_LIMITS = {
|
|
10
|
+
maxBytes: 40000,
|
|
11
|
+
maxLines: 500,
|
|
12
|
+
maxH2: 15,
|
|
13
|
+
maxFilesPerFolder: 40,
|
|
14
|
+
maxSentenceWords: 40,
|
|
15
|
+
maxParagraphSentences: 6,
|
|
16
|
+
};
|
|
17
|
+
const LEAF_NAME_PATTERN = /^\d{2}(-\d{2})?-[A-Z0-9]+(-[A-Z0-9]+)*\.md$/;
|
|
18
|
+
function routerLinkTargets(routerText) {
|
|
19
|
+
const targets = [];
|
|
20
|
+
const pattern = /\[[^\]]*\]\(([^)#\s]+\.md)(?:#[^)\s]*)?\)/g;
|
|
21
|
+
let match = pattern.exec(routerText);
|
|
22
|
+
while (match !== null) {
|
|
23
|
+
targets.push(match[1] ?? "");
|
|
24
|
+
match = pattern.exec(routerText);
|
|
25
|
+
}
|
|
26
|
+
return targets;
|
|
27
|
+
}
|
|
28
|
+
function expectedNavLine(routerPath, previous, next) {
|
|
29
|
+
const routerName = routerPath.split("/").pop() ?? routerPath;
|
|
30
|
+
const prev = previous === undefined ? "(first)" : `[◀ ${previous}](${previous})`;
|
|
31
|
+
const following = next === undefined ? "(last)" : `[${next} ▶](${next})`;
|
|
32
|
+
return `**${prev}** · [${routerName}](${routerPath}) · **${following}**`;
|
|
33
|
+
}
|
|
34
|
+
function firstContentLine(text) {
|
|
35
|
+
for (const raw of normalizeText(text).split("\n")) {
|
|
36
|
+
const line = raw.trim();
|
|
37
|
+
if (line !== "" && !isHeading(raw)) {
|
|
38
|
+
return raw;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return "";
|
|
42
|
+
}
|
|
43
|
+
function navSlots(line) {
|
|
44
|
+
const slots = [];
|
|
45
|
+
const pattern = /\[[^\]]*\]\(([^)#\s]+)(?:#[^)\s]*)?\)|\(\s*(first|last)\s*\)/g;
|
|
46
|
+
let match = pattern.exec(line);
|
|
47
|
+
while (match !== null) {
|
|
48
|
+
if (match[1] !== undefined) {
|
|
49
|
+
slots.push(match[1].split("/").pop() ?? match[1]);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
slots.push(`(${match[2] ?? ""})`);
|
|
53
|
+
}
|
|
54
|
+
match = pattern.exec(line);
|
|
55
|
+
}
|
|
56
|
+
return slots;
|
|
57
|
+
}
|
|
58
|
+
function routerIntroFindings(tree) {
|
|
59
|
+
const routerName = tree.routerPath.split("/").pop() ?? tree.routerPath;
|
|
60
|
+
const prose = normalizeText(tree.routerText)
|
|
61
|
+
.split("\n")
|
|
62
|
+
.filter((line) => line.trim() !== "" &&
|
|
63
|
+
!isHeading(line) &&
|
|
64
|
+
!isTableRow(line) &&
|
|
65
|
+
!isLinkOnlyLine(line));
|
|
66
|
+
if (prose.length <= 1) {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
return [
|
|
70
|
+
{
|
|
71
|
+
ruleId: "core/doc-router-leaf",
|
|
72
|
+
path: tree.routerPath,
|
|
73
|
+
message: `router holds prose beyond its one-line intro: ${routerName}`,
|
|
74
|
+
remediation: `Keep only the H1, a single intro line and tables in ${tree.routerPath}; move the paragraph to a leaf.`,
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
function leafNameFindings(tree) {
|
|
79
|
+
const findings = [];
|
|
80
|
+
for (const leaf of tree.leaves) {
|
|
81
|
+
if (LEAF_NAME_PATTERN.test(leaf.name)) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
findings.push({
|
|
85
|
+
ruleId: "core/doc-router-leaf",
|
|
86
|
+
path: `${tree.routerPath}`,
|
|
87
|
+
message: `leaf name outside the router pattern: ${leaf.name}`,
|
|
88
|
+
remediation: `Rename the leaf to NN-NAME.md or NN-MM-NAME.md with uppercase segments, e.g. 04-09-RECORDS.md.`,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return findings;
|
|
92
|
+
}
|
|
93
|
+
function leafLinkFindings(tree, leafNames, linked) {
|
|
94
|
+
const findings = [];
|
|
95
|
+
for (const name of leafNames) {
|
|
96
|
+
const seen = linked.filter((target) => (target.split("/").pop() ?? target) === name).length;
|
|
97
|
+
if (seen === 1) {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
const detail = seen === 0 ? "missing from router" : `linked ${seen} times in router`;
|
|
101
|
+
findings.push({
|
|
102
|
+
ruleId: "core/doc-router-leaf",
|
|
103
|
+
path: tree.routerPath,
|
|
104
|
+
message: `leaf ${detail}: ${name}`,
|
|
105
|
+
remediation: `Link [${name}](${name}) exactly once in ${tree.routerPath}, in file-name order.`,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
const routerName = tree.routerPath.split("/").pop() ?? tree.routerPath;
|
|
109
|
+
const ordered = linked
|
|
110
|
+
.map((target) => target.split("/").pop() ?? target)
|
|
111
|
+
.filter((leaf) => leafNames.includes(leaf));
|
|
112
|
+
const expectedOrder = leafNames.filter((leaf) => ordered.includes(leaf));
|
|
113
|
+
if (ordered.join("\n") !== expectedOrder.join("\n")) {
|
|
114
|
+
findings.push({
|
|
115
|
+
ruleId: "core/doc-router-leaf",
|
|
116
|
+
path: tree.routerPath,
|
|
117
|
+
message: `router leaf links out of file-name order in ${routerName}`,
|
|
118
|
+
remediation: `Order the leaf links in ${tree.routerPath} as: ${expectedOrder.join(", ")}.`,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return findings;
|
|
122
|
+
}
|
|
123
|
+
// Slots are previous (link or "(first)"), the router link, next
|
|
124
|
+
// (link or "(last)"), matching router order.
|
|
125
|
+
function navExpected(routerPath, previous, next) {
|
|
126
|
+
const routerBase = routerPath.split("/").pop() ?? routerPath;
|
|
127
|
+
const first = previous === undefined ? "(first)" : previous;
|
|
128
|
+
const last = next === undefined ? "(last)" : next;
|
|
129
|
+
return [first, routerBase, last];
|
|
130
|
+
}
|
|
131
|
+
function checkNavLines(tree, leafNames) {
|
|
132
|
+
const findings = [];
|
|
133
|
+
for (const [index, name] of leafNames.entries()) {
|
|
134
|
+
const leaf = tree.leaves.find((entry) => entry.name === name);
|
|
135
|
+
if (leaf === undefined) {
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
const previous = index === 0 ? undefined : leafNames[index - 1];
|
|
139
|
+
const next = index === leafNames.length - 1 ? undefined : leafNames[index + 1];
|
|
140
|
+
const expected = navExpected(tree.routerPath, previous, next);
|
|
141
|
+
const actual = navSlots(firstContentLine(leaf.text)).slice(0, 3);
|
|
142
|
+
if (actual.join("\n") === expected.join("\n")) {
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
findings.push({
|
|
146
|
+
ruleId: "core/doc-router-leaf",
|
|
147
|
+
path: tree.routerPath,
|
|
148
|
+
message: `nav line of ${name} points at the wrong neighbours`,
|
|
149
|
+
remediation: expectedNavLine(tree.routerPath, previous, next),
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
return findings;
|
|
153
|
+
}
|
|
154
|
+
// SPEC §4.9.2 core/doc-router-leaf: the router holds only an H1, an
|
|
155
|
+
// optional one-line intro and tables; every leaf links exactly once in
|
|
156
|
+
// file-name order; every leaf carries the matching nav line.
|
|
157
|
+
export function checkDocRouterLeaf(tree) {
|
|
158
|
+
const leafNames = tree.leaves.map((leaf) => leaf.name).sort();
|
|
159
|
+
const linked = routerLinkTargets(tree.routerText).filter((target) => target.split("/").pop());
|
|
160
|
+
return [
|
|
161
|
+
...routerIntroFindings(tree),
|
|
162
|
+
...leafNameFindings(tree),
|
|
163
|
+
...leafLinkFindings(tree, leafNames, linked),
|
|
164
|
+
...checkNavLines(tree, leafNames),
|
|
165
|
+
];
|
|
166
|
+
}
|
|
167
|
+
// SPEC §4.9.2 core/doc-size: bytes and lines per file.
|
|
168
|
+
export function checkDocSize(files, limits = DEFAULT_DOC_LIMITS) {
|
|
169
|
+
const findings = [];
|
|
170
|
+
for (const file of files) {
|
|
171
|
+
const text = normalizeText(file.text);
|
|
172
|
+
const bytes = new TextEncoder().encode(text).length;
|
|
173
|
+
const lines = text === "" ? 0 : text.split("\n").length;
|
|
174
|
+
if (bytes > limits.maxBytes) {
|
|
175
|
+
findings.push({
|
|
176
|
+
ruleId: "core/doc-size",
|
|
177
|
+
path: file.path,
|
|
178
|
+
message: `doc over the byte limit: ${file.path} holds ${bytes} bytes, limit ${limits.maxBytes}`,
|
|
179
|
+
remediation: `Split ${file.path} under ${limits.maxBytes} bytes; one fact lives in one leaf (SPEC §1.4).`,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
if (lines > limits.maxLines) {
|
|
183
|
+
findings.push({
|
|
184
|
+
ruleId: "core/doc-size",
|
|
185
|
+
path: file.path,
|
|
186
|
+
message: `doc over the line limit: ${file.path} holds ${lines} lines, limit ${limits.maxLines}`,
|
|
187
|
+
remediation: `Split ${file.path} under ${limits.maxLines} lines; one fact lives in one leaf (SPEC §1.4).`,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return findings;
|
|
192
|
+
}
|
|
193
|
+
// SPEC §4.9.2 core/doc-breadth: ## headings per file, files per folder.
|
|
194
|
+
export function checkDocBreadth(files, filesPerFolder = {}, limits = DEFAULT_DOC_LIMITS) {
|
|
195
|
+
const findings = [];
|
|
196
|
+
for (const file of files) {
|
|
197
|
+
let headings = 0;
|
|
198
|
+
for (const line of stripFences(file.text).split("\n")) {
|
|
199
|
+
if (/^##(?!#)\s/.test(line.trimStart())) {
|
|
200
|
+
headings += 1;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if (headings > limits.maxH2) {
|
|
204
|
+
findings.push({
|
|
205
|
+
ruleId: "core/doc-breadth",
|
|
206
|
+
path: file.path,
|
|
207
|
+
message: `doc over the heading limit: ${file.path} holds ${headings} ## headings, limit ${limits.maxH2}`,
|
|
208
|
+
remediation: `Split ${file.path} under ${limits.maxH2} ## headings; one fact lives in one leaf (SPEC §1.4).`,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
for (const [folder, count] of Object.entries(filesPerFolder)) {
|
|
213
|
+
if (count > limits.maxFilesPerFolder) {
|
|
214
|
+
findings.push({
|
|
215
|
+
ruleId: "core/doc-breadth",
|
|
216
|
+
path: folder,
|
|
217
|
+
message: `folder over the file limit: ${folder} holds ${count} markdown files, limit ${limits.maxFilesPerFolder}`,
|
|
218
|
+
remediation: `Split ${folder} under ${limits.maxFilesPerFolder} markdown files.`,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return findings;
|
|
223
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CheckContext, Finding } from "../engine/index.ts";
|
|
2
|
+
import type { DocFile } from "./docs-structure.ts";
|
|
3
|
+
export type DocClass = "record" | "managed" | "router" | "leaf" | "single";
|
|
4
|
+
export declare function classifyDoc(path: string, knownDirs?: ReadonlySet<string>, managed?: ReadonlySet<string>): DocClass;
|
|
5
|
+
export declare function checkDocPlacement(paths: ReadonlyArray<string>, allowedGlobs?: ReadonlyArray<string>): Array<Finding>;
|
|
6
|
+
export declare function checkDocOneLevel(paths: ReadonlyArray<string>): Array<Finding>;
|
|
7
|
+
export declare function checkDocNoInlineChangelog(files: ReadonlyArray<DocFile>): Array<Finding>;
|
|
8
|
+
export declare function checkDocSingleOwner(files: ReadonlyArray<DocFile>): Array<Finding>;
|
|
9
|
+
export declare function checkDocs(_ctx: CheckContext, paths: ReadonlyArray<string>, contents?: Readonly<Record<string, string>>): Promise<Array<Finding>>;
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
// SPEC §4.9.1–§4.9.2: doc classification, placement, changelog and
|
|
2
|
+
// single-owner checks plus the evaluation-path entry. Shape checks live in
|
|
3
|
+
// docs-structure.ts, prose checks in docs-prose.ts. All functions are pure
|
|
4
|
+
// over caller-supplied trees: the evaluation path passes the staged file
|
|
5
|
+
// list plus the contents the layer already read (SPEC §3.3, §10.3 item 3).
|
|
6
|
+
import { globMatch, normalizeText } from "../../kernel/index.js";
|
|
7
|
+
import { checkDocDensity, checkDocLinksValid, checkDocNoCorpusCounts, densityParagraphs, splitSentences, wordsOf, } from "./docs-prose.js";
|
|
8
|
+
import { checkDocBreadth, checkDocRouterLeaf, checkDocSize, isTableRow, } from "./docs-structure.js";
|
|
9
|
+
const ROOT_DOCS = new Set([
|
|
10
|
+
"README.md",
|
|
11
|
+
"AGENTS.md",
|
|
12
|
+
"CLAUDE.md",
|
|
13
|
+
"CHANGELOG.md",
|
|
14
|
+
"CONTRIBUTING.md",
|
|
15
|
+
"SECURITY.md",
|
|
16
|
+
"CODE_OF_CONDUCT.md",
|
|
17
|
+
]);
|
|
18
|
+
const HARNESS_DIRS = [
|
|
19
|
+
".agents",
|
|
20
|
+
".claude",
|
|
21
|
+
".github",
|
|
22
|
+
".cursor",
|
|
23
|
+
".gemini",
|
|
24
|
+
".opencode",
|
|
25
|
+
".muse",
|
|
26
|
+
];
|
|
27
|
+
// SPEC §4.9.1: first match wins. knownDirs holds the repo's directory set so
|
|
28
|
+
// a router is recognised without filesystem access; managed holds the
|
|
29
|
+
// guardrail manifest paths (§4.14.1).
|
|
30
|
+
export function classifyDoc(path, knownDirs = new Set(), managed = new Set()) {
|
|
31
|
+
if (managed.has(path)) {
|
|
32
|
+
return "managed";
|
|
33
|
+
}
|
|
34
|
+
if (path.startsWith("docs/HISTORY/") || path.startsWith("docs/BUGS/")) {
|
|
35
|
+
return "record";
|
|
36
|
+
}
|
|
37
|
+
const routerMatch = /^docs\/([^/]+)\.md$/.exec(path);
|
|
38
|
+
if (routerMatch !== null) {
|
|
39
|
+
const name = routerMatch[1] ?? "";
|
|
40
|
+
return knownDirs.has(`docs/${name}`) ? "router" : "single";
|
|
41
|
+
}
|
|
42
|
+
if (/^docs\/[^/]+\/.+/.test(path)) {
|
|
43
|
+
return "leaf";
|
|
44
|
+
}
|
|
45
|
+
return "single";
|
|
46
|
+
}
|
|
47
|
+
function placementFinding(path, reason) {
|
|
48
|
+
return {
|
|
49
|
+
ruleId: "core/doc-placement",
|
|
50
|
+
path,
|
|
51
|
+
message: `markdown file outside its placed locations: ${path} (${reason})`,
|
|
52
|
+
remediation: `Move ${path} to docs/, docs/<NAME>/, packages/*/README.md or an allowed glob, or add an allowedGlobs entry.`,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
// SPEC §4.9.2 core/doc-placement: the never-files docs/HISTORY.md and
|
|
56
|
+
// docs/BUGS.md are rejected even though docs/*.md is otherwise allowed.
|
|
57
|
+
export function checkDocPlacement(paths, allowedGlobs = []) {
|
|
58
|
+
const findings = [];
|
|
59
|
+
for (const path of paths) {
|
|
60
|
+
if (!path.endsWith(".md")) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (path === "docs/HISTORY.md" || path === "docs/BUGS.md") {
|
|
64
|
+
findings.push(placementFinding(path, "record folders have no top-level file"));
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (!path.includes("/") && ROOT_DOCS.has(path)) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (/^docs\/[^/]+\.md$/.test(path) || /^docs\/[^/]+\/.+/.test(path)) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (/^packages\/[^/]+\/README\.md$/.test(path)) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (HARNESS_DIRS.some((dir) => path === dir || path.startsWith(`${dir}/`)) ||
|
|
77
|
+
path.startsWith(".codictator/")) {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if (allowedGlobs.some((glob) => globMatch(glob, path))) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
findings.push(placementFinding(path, "outside its allowed locations"));
|
|
84
|
+
}
|
|
85
|
+
return findings;
|
|
86
|
+
}
|
|
87
|
+
// SPEC §4.9.2 core/doc-one-level: no folder below docs/<NAME>/.
|
|
88
|
+
export function checkDocOneLevel(paths) {
|
|
89
|
+
const findings = [];
|
|
90
|
+
for (const path of paths) {
|
|
91
|
+
if (!path.endsWith(".md")) {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
const match = /^docs\/([^/]+)\/([^/]+)\//.exec(path);
|
|
95
|
+
if (match === null) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
const folder = match[1] ?? "";
|
|
99
|
+
if (folder === "HISTORY" || folder === "BUGS") {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
findings.push({
|
|
103
|
+
ruleId: "core/doc-one-level",
|
|
104
|
+
path,
|
|
105
|
+
message: `doc nested below docs/${folder}/: ${path}`,
|
|
106
|
+
remediation: `Move ${path} directly under docs/${folder}/; docs/<NAME>/ takes no subfolders.`,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return findings;
|
|
110
|
+
}
|
|
111
|
+
// \x27 keeps the apostrophe out of the literal: the pack lexer blanks
|
|
112
|
+
// strings without regex awareness, so a quote char would hide later code.
|
|
113
|
+
const CHANGELOG_HEADING = /^(change ?log|history|revisions?|what\x27s new|updates?)$/i;
|
|
114
|
+
const CHANGELOG_LINE = /^[-*]?\s*(updated|changed|added|revised|amended)( on)?\s+\d{4}-\d{2}-\d{2}/i;
|
|
115
|
+
// SPEC §4.9.2 core/doc-no-inline-changelog: the per-doc changelog lives in
|
|
116
|
+
// the history entry (Docs field), never inline.
|
|
117
|
+
export function checkDocNoInlineChangelog(files) {
|
|
118
|
+
const findings = [];
|
|
119
|
+
for (const file of files) {
|
|
120
|
+
normalizeText(file.text)
|
|
121
|
+
.split("\n")
|
|
122
|
+
.forEach((line, index) => {
|
|
123
|
+
const heading = /^#{1,6}\s+(.+?)\s*$/.exec(line.trim());
|
|
124
|
+
if (heading !== null && CHANGELOG_HEADING.test(heading[1] ?? "")) {
|
|
125
|
+
findings.push({
|
|
126
|
+
ruleId: "core/doc-no-inline-changelog",
|
|
127
|
+
path: file.path,
|
|
128
|
+
line: index + 1,
|
|
129
|
+
message: `inline changelog heading in ${file.path} line ${index + 1}`,
|
|
130
|
+
remediation: `Remove the changelog section from ${file.path}; record the change in the history entry Docs field.`,
|
|
131
|
+
});
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (!isTableRow(line) && CHANGELOG_LINE.test(line.trim())) {
|
|
135
|
+
findings.push({
|
|
136
|
+
ruleId: "core/doc-no-inline-changelog",
|
|
137
|
+
path: file.path,
|
|
138
|
+
line: index + 1,
|
|
139
|
+
message: `inline changelog line in ${file.path} line ${index + 1}`,
|
|
140
|
+
remediation: `Remove the dated change line from ${file.path}; record the change in the history entry Docs field.`,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return findings;
|
|
146
|
+
}
|
|
147
|
+
function normaliseSentence(sentence) {
|
|
148
|
+
return sentence.replace(/\s+/g, " ").trim().toLowerCase();
|
|
149
|
+
}
|
|
150
|
+
// SPEC §4.9.2 core/doc-single-owner: no sentence of twelve or more words
|
|
151
|
+
// repeats across two non-record docs. Record docs hold generated history,
|
|
152
|
+
// so they are exempt both as sources and as carriers.
|
|
153
|
+
export function checkDocSingleOwner(files) {
|
|
154
|
+
const seen = new Map();
|
|
155
|
+
const findings = [];
|
|
156
|
+
for (const file of [...files].sort((a, b) => (a.path < b.path ? -1 : 1))) {
|
|
157
|
+
for (const paragraph of densityParagraphs(file.text)) {
|
|
158
|
+
for (const sentence of splitSentences(paragraph)) {
|
|
159
|
+
if (wordsOf(sentence).length < 12) {
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
const key = normaliseSentence(sentence);
|
|
163
|
+
const owner = seen.get(key);
|
|
164
|
+
if (owner === undefined) {
|
|
165
|
+
seen.set(key, file.path);
|
|
166
|
+
}
|
|
167
|
+
else if (owner !== file.path) {
|
|
168
|
+
findings.push({
|
|
169
|
+
ruleId: "core/doc-single-owner",
|
|
170
|
+
path: file.path,
|
|
171
|
+
message: `sentence of twelve or more words repeats ${owner} in ${file.path}`,
|
|
172
|
+
remediation: `Keep the fact in ${owner} and link to it from ${file.path} (SPEC §1.4: one fact, one owner).`,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return findings;
|
|
179
|
+
}
|
|
180
|
+
// The evaluation-path entry: path-decidable checks always run; content
|
|
181
|
+
// checks run on the supplied tree, with routers inferred from the union of
|
|
182
|
+
// staged paths and supplied contents.
|
|
183
|
+
export function checkDocs(_ctx, paths, contents = {}) {
|
|
184
|
+
const findings = [
|
|
185
|
+
...checkDocPlacement(paths),
|
|
186
|
+
...checkDocOneLevel(paths),
|
|
187
|
+
];
|
|
188
|
+
const texts = new Map(Object.entries(contents));
|
|
189
|
+
if (texts.size === 0) {
|
|
190
|
+
return Promise.resolve(findings);
|
|
191
|
+
}
|
|
192
|
+
const knownDirs = new Set();
|
|
193
|
+
for (const path of [...paths, ...texts.keys()]) {
|
|
194
|
+
const pieces = path.split("/");
|
|
195
|
+
for (let depth = 1; depth < pieces.length; depth += 1) {
|
|
196
|
+
knownDirs.add(pieces.slice(0, depth).join("/"));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
const byClass = new Map();
|
|
200
|
+
for (const path of texts.keys()) {
|
|
201
|
+
byClass.set(path, classifyDoc(path, knownDirs));
|
|
202
|
+
}
|
|
203
|
+
const routers = [...texts.keys()].filter((path) => byClass.get(path) === "router");
|
|
204
|
+
for (const routerPath of routers) {
|
|
205
|
+
const prefix = routerPath.replace(/\.md$/, "/");
|
|
206
|
+
const leaves = [...texts.entries()]
|
|
207
|
+
.filter(([path]) => path.startsWith(prefix))
|
|
208
|
+
.map(([path, text]) => ({
|
|
209
|
+
name: path.slice(prefix.length),
|
|
210
|
+
text,
|
|
211
|
+
}))
|
|
212
|
+
.filter((leaf) => !leaf.name.includes("/"));
|
|
213
|
+
findings.push(...checkDocRouterLeaf({
|
|
214
|
+
routerPath,
|
|
215
|
+
routerText: texts.get(routerPath) ?? "",
|
|
216
|
+
leaves,
|
|
217
|
+
}));
|
|
218
|
+
}
|
|
219
|
+
const known = new Map(texts.entries());
|
|
220
|
+
const leafFiles = [];
|
|
221
|
+
const singleFiles = [];
|
|
222
|
+
for (const [path, text] of texts.entries()) {
|
|
223
|
+
const kind = byClass.get(path);
|
|
224
|
+
if (kind === "leaf") {
|
|
225
|
+
leafFiles.push({ path, text });
|
|
226
|
+
}
|
|
227
|
+
else if (kind === "single") {
|
|
228
|
+
singleFiles.push({ path, text });
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
for (const file of [...leafFiles, ...singleFiles]) {
|
|
232
|
+
findings.push(...checkDocSize([file]), ...checkDocBreadth([file]), ...checkDocDensity([file]), ...checkDocLinksValid([file], known), ...checkDocNoInlineChangelog([file]), ...checkDocNoCorpusCounts([file]));
|
|
233
|
+
}
|
|
234
|
+
findings.push(...checkDocSingleOwner([...leafFiles, ...singleFiles]), ...checkDocSize([...texts.entries()]
|
|
235
|
+
.filter(([path]) => byClass.get(path) === "record")
|
|
236
|
+
.map(([path, text]) => ({ path, text }))));
|
|
237
|
+
return Promise.resolve(findings);
|
|
238
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Finding } from "../engine/index.ts";
|
|
2
|
+
import type { HistoryEntry } from "./history-parse.ts";
|
|
3
|
+
export declare function entryFinding(ruleId: string, message: string, path: string): Finding;
|
|
4
|
+
export declare function checkHistoryEntryCount(text: string, path: string, commitSubject?: string): Array<Finding>;
|
|
5
|
+
export declare function checkHistoryEntryComplete(entry: HistoryEntry, path: string): Array<Finding>;
|
|
6
|
+
export declare function checkHistoryAppendOnly(baseText: string, headText: string, path: string): Array<Finding>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// SPEC §4.9.3: history entry checks (count, completeness, append-only).
|
|
2
|
+
// Pure over caller-supplied text.
|
|
3
|
+
import { normalizeText } from "../../kernel/index.js";
|
|
4
|
+
import { FILE_TITLE, parseHistoryEntries } from "./history-parse.js";
|
|
5
|
+
export function entryFinding(ruleId, message, path) {
|
|
6
|
+
return {
|
|
7
|
+
ruleId,
|
|
8
|
+
path,
|
|
9
|
+
message,
|
|
10
|
+
remediation: `Add exactly one history entry whose Subject equals the commit subject, with the Kind, Task, Why and kind-required fields of SPEC §7.7, to ${path}.`,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
// SPEC §4.9.3 core/history-entry: the staged diff adds exactly one entry
|
|
14
|
+
// whose Subject equals the message subject.
|
|
15
|
+
export function checkHistoryEntryCount(text, path, commitSubject) {
|
|
16
|
+
const parsed = parseHistoryEntries(text);
|
|
17
|
+
const problems = [...parsed.errors];
|
|
18
|
+
if (parsed.entries.length !== 1) {
|
|
19
|
+
return [
|
|
20
|
+
entryFinding("core/history-entry", `history change holds ${parsed.entries.length} entries, want exactly one: ${path}`, path),
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
if (commitSubject !== undefined &&
|
|
24
|
+
parsed.entries[0]?.subject !== commitSubject) {
|
|
25
|
+
return [
|
|
26
|
+
entryFinding("core/history-entry", `history Subject "${parsed.entries[0]?.subject ?? ""}" differs from the commit subject "${commitSubject}"`, path),
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
return problems.map((message) => entryFinding("core/history-entry", message, path));
|
|
30
|
+
}
|
|
31
|
+
// SPEC §4.9.3 core/history-entry-complete: the kind-required fields are
|
|
32
|
+
// present and non-empty. Bug is required by the registry check, which knows
|
|
33
|
+
// the commit type; completeness covers the kind shape only.
|
|
34
|
+
export function checkHistoryEntryComplete(entry, path) {
|
|
35
|
+
const required = entry.kind === "code"
|
|
36
|
+
? ["Kind", "Task", "Why", "What went wrong", "Trade-offs", "Lessons"]
|
|
37
|
+
: entry.kind === "docs"
|
|
38
|
+
? ["Kind", "Task", "Why", "Docs"]
|
|
39
|
+
: entry.kind === "deps"
|
|
40
|
+
? ["Kind", "Task", "Why"]
|
|
41
|
+
: entry.kind === "guardrail"
|
|
42
|
+
? ["Kind", "Task", "Why"]
|
|
43
|
+
: ["Kind", "Task", "Why"];
|
|
44
|
+
const findings = [];
|
|
45
|
+
for (const name of required) {
|
|
46
|
+
const value = entry.fields.get(name);
|
|
47
|
+
if (value === undefined || value.trim() === "") {
|
|
48
|
+
findings.push({
|
|
49
|
+
ruleId: "core/history-entry-complete",
|
|
50
|
+
path,
|
|
51
|
+
message: `history entry misses its ${name} field: ${entry.subject}`,
|
|
52
|
+
remediation: `Fill the ${name} field of the "${entry.subject}" entry in ${path}; a field not required is omitted, a required one is never empty.`,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (entry.kind === "deps" && entry.depsLines.length === 0) {
|
|
57
|
+
findings.push({
|
|
58
|
+
ruleId: "core/history-entry-complete",
|
|
59
|
+
path,
|
|
60
|
+
message: `deps history entry holds no Deps line: ${entry.subject}`,
|
|
61
|
+
remediation: `Add one Deps line per dependency change to the "${entry.subject}" entry in ${path}.`,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return findings;
|
|
65
|
+
}
|
|
66
|
+
// SPEC §4.9.3 core/history-append-only: the base content after the title
|
|
67
|
+
// line is a suffix of the head content after normalisation, so new entries
|
|
68
|
+
// are prepended directly under the title and existing entries are never
|
|
69
|
+
// edited.
|
|
70
|
+
function bodyAfterTitle(text) {
|
|
71
|
+
const end = text.indexOf("\n");
|
|
72
|
+
if (end < 0) {
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
if (FILE_TITLE.exec(text.slice(0, end).trim()) === null) {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
return text.slice(end + 1);
|
|
79
|
+
}
|
|
80
|
+
export function checkHistoryAppendOnly(baseText, headText, path) {
|
|
81
|
+
const baseBody = bodyAfterTitle(normalizeText(baseText));
|
|
82
|
+
const headBody = bodyAfterTitle(normalizeText(headText));
|
|
83
|
+
if (baseBody !== undefined && headBody?.endsWith(baseBody) === true) {
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
return [
|
|
87
|
+
{
|
|
88
|
+
ruleId: "core/history-append-only",
|
|
89
|
+
path,
|
|
90
|
+
message: `history file edited in place: ${path} head no longer holds its base entries untouched under the title`,
|
|
91
|
+
remediation: `Prepend the new entry directly under the title of ${path} without touching earlier entries; history is newest-first.`,
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type HistoryKind = "code" | "docs" | "deps" | "guardrail";
|
|
2
|
+
export interface HistoryEntry {
|
|
3
|
+
readonly date: string;
|
|
4
|
+
readonly subject: string;
|
|
5
|
+
readonly kind: HistoryKind | undefined;
|
|
6
|
+
readonly task: string | undefined;
|
|
7
|
+
readonly bug: string | undefined;
|
|
8
|
+
readonly fields: ReadonlyMap<string, string>;
|
|
9
|
+
readonly depsLines: ReadonlyArray<string>;
|
|
10
|
+
}
|
|
11
|
+
export interface HistoryParse {
|
|
12
|
+
readonly entries: ReadonlyArray<HistoryEntry>;
|
|
13
|
+
readonly errors: ReadonlyArray<string>;
|
|
14
|
+
}
|
|
15
|
+
export declare const FILE_TITLE: RegExp;
|
|
16
|
+
export declare function parseHistoryEntries(text: string): HistoryParse;
|