@dommaker/harness 2.0.0 → 4.0.0
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/README.md +7 -7
- package/dist/agents/index.d.ts +1 -3
- package/dist/agents/index.js +0 -1
- package/dist/agents/lifecycle.d.ts +2 -35
- package/dist/agents/lifecycle.js +1 -101
- package/dist/agents/types.d.ts +1 -20
- package/dist/agents/types.js +0 -1
- package/dist/{hooks → bootstrap}/bootstrap.d.ts +9 -4
- package/dist/{hooks → bootstrap}/bootstrap.js +26 -31
- package/dist/{hooks → bootstrap}/index.d.ts +3 -3
- package/dist/{hooks → bootstrap}/index.js +3 -3
- package/dist/cli/command-contract.d.ts +0 -1
- package/dist/cli/command-contract.js +0 -1
- package/dist/cli/commands/__tests__/gate-decision.d.ts +0 -1
- package/dist/cli/commands/__tests__/gate-decision.js +0 -1
- package/dist/cli/commands/acceptance.d.ts +0 -1
- package/dist/cli/commands/acceptance.js +3 -3
- package/dist/cli/commands/check.d.ts +1 -2
- package/dist/cli/commands/check.js +12 -6
- package/dist/cli/commands/command.d.ts +0 -1
- package/dist/cli/commands/command.js +9 -6
- package/dist/cli/commands/constraints-disable.d.ts +0 -1
- package/dist/cli/commands/constraints-disable.js +0 -1
- package/dist/cli/commands/constraints-pack-proposal.d.ts +0 -1
- package/dist/cli/commands/constraints-pack-proposal.js +11 -9
- package/dist/cli/commands/constraints-reactivate.d.ts +10 -3
- package/dist/cli/commands/constraints-reactivate.js +2 -7
- package/dist/cli/commands/constraints-report.d.ts +0 -1
- package/dist/cli/commands/constraints-report.js +4 -4
- package/dist/cli/commands/constraints-retire.d.ts +23 -6
- package/dist/cli/commands/constraints-retire.js +17 -9
- package/dist/cli/commands/constraints.d.ts +0 -1
- package/dist/cli/commands/constraints.js +0 -1
- package/dist/cli/commands/contract.d.ts +0 -1
- package/dist/cli/commands/contract.js +7 -9
- package/dist/cli/commands/definitions.d.ts +2 -74
- package/dist/cli/commands/definitions.js +2 -8
- package/dist/cli/commands/failure.d.ts +0 -1
- package/dist/cli/commands/failure.js +5 -7
- package/dist/cli/commands/init/ci-platform.d.ts +0 -1
- package/dist/cli/commands/init/ci-platform.js +0 -1
- package/dist/cli/commands/init/ci-wiring.d.ts +0 -1
- package/dist/cli/commands/init/ci-wiring.js +0 -1
- package/dist/cli/commands/init/git-hooks.d.ts +0 -1
- package/dist/cli/commands/init/git-hooks.js +0 -1
- package/dist/cli/commands/init/governance.d.ts +0 -1
- package/dist/cli/commands/init/governance.js +0 -1
- package/dist/cli/commands/init/index.d.ts +0 -1
- package/dist/cli/commands/init/index.js +2 -3
- package/dist/cli/commands/init/output-style.d.ts +0 -1
- package/dist/cli/commands/init/output-style.js +0 -1
- package/dist/cli/commands/init/presets.d.ts +0 -1
- package/dist/cli/commands/init/presets.js +0 -1
- package/dist/cli/commands/init/snippets.d.ts +0 -1
- package/dist/cli/commands/init/snippets.js +0 -1
- package/dist/cli/commands/knowledge/audit.d.ts +0 -1
- package/dist/cli/commands/knowledge/audit.js +0 -1
- package/dist/cli/commands/knowledge/decay.d.ts +0 -1
- package/dist/cli/commands/knowledge/decay.js +0 -1
- package/dist/cli/commands/knowledge/health.d.ts +4 -3
- package/dist/cli/commands/knowledge/health.js +25 -20
- package/dist/cli/commands/knowledge/import.d.ts +1 -2
- package/dist/cli/commands/knowledge/import.js +14 -3
- package/dist/cli/commands/knowledge/index.d.ts +0 -1
- package/dist/cli/commands/knowledge/index.js +0 -1
- package/dist/cli/commands/knowledge/list.d.ts +0 -1
- package/dist/cli/commands/knowledge/list.js +18 -1
- package/dist/cli/commands/knowledge/search.d.ts +0 -1
- package/dist/cli/commands/knowledge/search.js +1 -3
- package/dist/cli/commands/knowledge/shared.d.ts +0 -1
- package/dist/cli/commands/knowledge/shared.js +0 -1
- package/dist/cli/commands/knowledge/snapshot.d.ts +0 -1
- package/dist/cli/commands/knowledge/snapshot.js +0 -1
- package/dist/cli/commands/knowledge/stats.d.ts +0 -1
- package/dist/cli/commands/knowledge/stats.js +4 -9
- package/dist/cli/commands/knowledge/store-access.d.ts +24 -0
- package/dist/cli/commands/knowledge/store-access.js +68 -0
- package/dist/cli/commands/knowledge-view.d.ts +6 -19
- package/dist/cli/commands/knowledge-view.js +10 -62
- package/dist/cli/commands/passes-gate.d.ts +0 -1
- package/dist/cli/commands/passes-gate.js +11 -47
- package/dist/cli/commands/performance.d.ts +0 -1
- package/dist/cli/commands/performance.js +0 -1
- package/dist/cli/commands/release.d.ts +1 -2
- package/dist/cli/commands/release.js +14 -20
- package/dist/cli/commands/report.d.ts +0 -1
- package/dist/cli/commands/report.js +0 -1
- package/dist/cli/commands/review.d.ts +0 -1
- package/dist/cli/commands/review.js +18 -7
- package/dist/cli/commands/scaffold-templates.d.ts +0 -1
- package/dist/cli/commands/scaffold-templates.js +1 -2
- package/dist/cli/commands/scaffold.d.ts +0 -1
- package/dist/cli/commands/scaffold.js +0 -1
- package/dist/cli/commands/sdd.d.ts +0 -1
- package/dist/cli/commands/sdd.js +0 -1
- package/dist/cli/commands/security.d.ts +0 -1
- package/dist/cli/commands/security.js +8 -2
- package/dist/{core → cli/commands}/spec/validator.d.ts +12 -19
- package/dist/{core → cli/commands}/spec/validator.js +22 -54
- package/dist/cli/commands/spec-baseline-check.d.ts +8 -42
- package/dist/cli/commands/spec-baseline-check.js +53 -243
- package/dist/cli/commands/spec.d.ts +1 -2
- package/dist/cli/commands/spec.js +14 -12
- package/dist/cli/commands/status.d.ts +0 -3
- package/dist/cli/commands/status.js +0 -1
- package/dist/cli/commands/sync-docs/agents-syncer.d.ts +0 -1
- package/dist/cli/commands/sync-docs/agents-syncer.js +0 -1
- package/dist/cli/commands/sync-docs/capabilities-syncer.d.ts +1 -2
- package/dist/cli/commands/sync-docs/capabilities-syncer.js +5 -11
- package/dist/cli/commands/sync-docs/compact.d.ts +0 -1
- package/dist/cli/commands/sync-docs/compact.js +15 -16
- package/dist/cli/commands/sync-docs/context-syncer.d.ts +0 -1
- package/dist/cli/commands/sync-docs/context-syncer.js +0 -1
- package/dist/cli/commands/sync-docs/gate.d.ts +0 -1
- package/dist/cli/commands/sync-docs/gate.js +0 -1
- package/dist/cli/commands/sync-docs/head-gate.d.ts +0 -1
- package/dist/cli/commands/sync-docs/head-gate.js +0 -1
- package/dist/cli/commands/sync-docs/index.d.ts +0 -1
- package/dist/cli/commands/sync-docs/index.js +0 -1
- package/dist/cli/commands/sync-docs/main-flow.d.ts +7 -24
- package/dist/cli/commands/sync-docs/main-flow.js +27 -420
- package/dist/cli/commands/sync-docs/preserve-block.d.ts +0 -1
- package/dist/cli/commands/sync-docs/preserve-block.js +0 -1
- package/dist/cli/commands/sync-docs/project-reader.d.ts +0 -1
- package/dist/cli/commands/sync-docs/project-reader.js +2 -2
- package/dist/cli/commands/sync-docs/sync-output.d.ts +14 -0
- package/dist/cli/commands/sync-docs/sync-output.js +232 -0
- package/dist/cli/commands/sync-docs/sync-state.d.ts +70 -0
- package/dist/cli/commands/sync-docs/sync-state.js +273 -0
- package/dist/cli/commands/sync-docs/sync-writes.d.ts +11 -0
- package/dist/cli/commands/sync-docs/sync-writes.js +71 -0
- package/dist/cli/commands/validate.d.ts +0 -3
- package/dist/cli/commands/validate.js +17 -8
- package/dist/cli/gate-command.d.ts +0 -1
- package/dist/cli/gate-command.js +2 -2
- package/dist/cli/state-io.d.ts +0 -1
- package/dist/cli/state-io.js +0 -1
- package/dist/completion-checkers/classify.d.ts +0 -1
- package/dist/completion-checkers/classify.js +0 -1
- package/dist/completion-checkers/contract-presence.d.ts +0 -1
- package/dist/completion-checkers/contract-presence.js +0 -1
- package/dist/completion-checkers/glob-match.d.ts +0 -1
- package/dist/completion-checkers/glob-match.js +0 -1
- package/dist/completion-checkers/index.d.ts +0 -1
- package/dist/completion-checkers/index.js +0 -1
- package/dist/completion-checkers/phase-format.d.ts +0 -1
- package/dist/completion-checkers/phase-format.js +0 -1
- package/dist/completion-checkers/tdd-chain.d.ts +0 -1
- package/dist/completion-checkers/tdd-chain.js +0 -1
- package/dist/completion-checkers/types.d.ts +0 -1
- package/dist/completion-checkers/types.js +0 -1
- package/dist/context/index.d.ts +1 -2
- package/dist/context/index.js +0 -1
- package/dist/context/session-manager.d.ts +0 -5
- package/dist/context/session-manager.js +0 -37
- package/dist/context/types.d.ts +2 -25
- package/dist/context/types.js +2 -2
- package/dist/core/app-constraints-loader.d.ts +1 -2
- package/dist/core/app-constraints-loader.js +9 -26
- package/dist/core/constraint-lifecycle.d.ts +3 -9
- package/dist/core/constraint-lifecycle.js +26 -31
- package/dist/core/constraints/capabilities-parser.d.ts +0 -1
- package/dist/core/constraints/capabilities-parser.js +0 -1
- package/dist/core/constraints/capabilities-reconcile.d.ts +0 -1
- package/dist/core/constraints/capabilities-reconcile.js +0 -1
- package/dist/core/constraints/check-cache.d.ts +4 -44
- package/dist/core/constraints/check-cache.js +6 -52
- package/dist/core/constraints/checker.d.ts +0 -18
- package/dist/core/constraints/checker.js +24 -68
- package/dist/core/constraints/checkers/capability-sync.d.ts +0 -1
- package/dist/core/constraints/checkers/capability-sync.js +5 -5
- package/dist/core/constraints/checkers/context-doc-sync.d.ts +0 -1
- package/dist/core/constraints/checkers/context-doc-sync.js +2 -3
- package/dist/core/constraints/checkers/docs-freshness.d.ts +0 -1
- package/dist/core/constraints/checkers/docs-freshness.js +7 -7
- package/dist/core/constraints/checkers/governance-presence.d.ts +0 -1
- package/dist/core/constraints/checkers/governance-presence.js +0 -1
- package/dist/core/constraints/checkers/index.d.ts +17 -4
- package/dist/core/constraints/checkers/index.js +22 -11
- package/dist/core/constraints/checkers/no-completion-without-verification.d.ts +0 -1
- package/dist/core/constraints/checkers/no-completion-without-verification.js +2 -2
- package/dist/core/constraints/checkers/no-hardcoded-credentials.d.ts +0 -1
- package/dist/core/constraints/checkers/no-hardcoded-credentials.js +5 -35
- package/dist/core/constraints/checkers/no-test-simplification.d.ts +0 -1
- package/dist/core/constraints/checkers/no-test-simplification.js +13 -35
- package/dist/core/constraints/checkers/templated/exec.d.ts +0 -1
- package/dist/core/constraints/checkers/templated/exec.js +3 -9
- package/dist/core/constraints/checkers/templated/file-exists.d.ts +3 -2
- package/dist/core/constraints/checkers/templated/file-exists.js +14 -40
- package/dist/core/constraints/checkers/templated/glob.d.ts +0 -1
- package/dist/core/constraints/checkers/templated/glob.js +0 -1
- package/dist/core/constraints/checkers/templated/index.d.ts +0 -1
- package/dist/core/constraints/checkers/templated/index.js +0 -1
- package/dist/core/constraints/checkers/templated/regex-scan.d.ts +0 -1
- package/dist/core/constraints/checkers/templated/regex-scan.js +10 -28
- package/dist/core/constraints/checkers/types.d.ts +10 -34
- package/dist/core/constraints/checkers/types.js +6 -47
- package/dist/core/constraints/construction-sites.d.ts +0 -1
- package/dist/core/constraints/construction-sites.js +0 -1
- package/dist/core/constraints/context-builder.d.ts +8 -27
- package/dist/core/constraints/context-builder.js +9 -82
- package/dist/core/constraints/context-reconcile.d.ts +0 -1
- package/dist/core/constraints/context-reconcile.js +0 -1
- package/dist/core/constraints/definitions/{iron-laws.d.ts → errors.d.ts} +0 -2
- package/dist/core/constraints/definitions/{iron-laws.js → errors.js} +0 -5
- package/dist/core/constraints/definitions/{guidelines.d.ts → warnings.d.ts} +0 -2
- package/dist/core/constraints/definitions/{guidelines.js → warnings.js} +0 -6
- package/dist/core/constraints/definitions.d.ts +3 -7
- package/dist/core/constraints/definitions.js +6 -16
- package/dist/core/constraints/doc-freshness/check-changelog-version.d.ts +8 -0
- package/dist/core/constraints/doc-freshness/check-changelog-version.js +39 -0
- package/dist/core/constraints/doc-freshness/check-context-docs.d.ts +8 -0
- package/dist/core/constraints/doc-freshness/check-context-docs.js +32 -0
- package/dist/core/constraints/doc-freshness/check-doc-dir.d.ts +8 -0
- package/dist/core/constraints/doc-freshness/check-doc-dir.js +138 -0
- package/dist/core/constraints/doc-freshness/check-doc-regex-count.d.ts +16 -0
- package/dist/core/constraints/doc-freshness/check-doc-regex-count.js +131 -0
- package/dist/core/constraints/doc-freshness/runner.d.ts +8 -30
- package/dist/core/constraints/doc-freshness/runner.js +19 -314
- package/dist/core/constraints/find-constraint.d.ts +13 -0
- package/dist/core/constraints/find-constraint.js +24 -0
- package/dist/core/constraints/git-evidence.d.ts +0 -1
- package/dist/core/constraints/git-evidence.js +0 -1
- package/dist/core/constraints/governance-accessors.d.ts +53 -0
- package/dist/core/constraints/governance-accessors.js +61 -0
- package/dist/core/constraints/index.d.ts +5 -6
- package/dist/core/constraints/index.js +1 -7
- package/dist/core/constraints/injection-writer.d.ts +0 -13
- package/dist/core/constraints/injection-writer.js +0 -16
- package/dist/core/constraints/meta.d.ts +0 -1
- package/dist/core/constraints/meta.js +0 -1
- package/dist/core/constraints/pack-proposal.d.ts +0 -1
- package/dist/core/constraints/pack-proposal.js +8 -19
- package/dist/core/constraints/run-env.d.ts +1 -14
- package/dist/core/constraints/run-env.js +3 -25
- package/dist/core/constraints/triggers.d.ts +10 -7
- package/dist/core/constraints/triggers.js +11 -6
- package/dist/core/constraints/usage-report.d.ts +0 -18
- package/dist/core/constraints/usage-report.js +0 -25
- package/dist/core/effective-constraints.d.ts +0 -1
- package/dist/core/effective-constraints.js +0 -1
- package/dist/core/effective-set.d.ts +0 -1
- package/dist/core/effective-set.js +0 -1
- package/dist/core/project-config-loader.d.ts +5 -44
- package/dist/core/project-config-loader.js +4 -50
- package/dist/core/retired-constraints.d.ts +0 -1
- package/dist/core/retired-constraints.js +0 -1
- package/dist/core/spec/baseline-check.d.ts +58 -0
- package/dist/core/spec/baseline-check.js +260 -0
- package/dist/core/validators/check-handlers/command.d.ts +3 -4
- package/dist/core/validators/check-handlers/command.js +7 -22
- package/dist/core/validators/check-handlers/fail-result.d.ts +11 -0
- package/dist/core/validators/check-handlers/fail-result.js +15 -0
- package/dist/core/validators/check-handlers/file.d.ts +5 -6
- package/dist/core/validators/check-handlers/file.js +35 -12
- package/dist/core/validators/check-handlers/http.d.ts +3 -4
- package/dist/core/validators/check-handlers/http.js +7 -22
- package/dist/core/validators/check-handlers/output.d.ts +5 -6
- package/dist/core/validators/check-handlers/output.js +8 -28
- package/dist/core/validators/checkpoint.d.ts +12 -14
- package/dist/core/validators/checkpoint.js +112 -80
- package/dist/core/validators/cso.d.ts +1 -5
- package/dist/core/validators/cso.js +1 -10
- package/dist/core/validators/index.d.ts +1 -2
- package/dist/core/validators/index.js +1 -3
- package/dist/core/validators/passes-gate.d.ts +0 -9
- package/dist/core/validators/passes-gate.js +2 -18
- package/dist/core/validators/test-output.d.ts +0 -1
- package/dist/core/validators/test-output.js +0 -1
- package/dist/failure/classifier.d.ts +2 -22
- package/dist/failure/classifier.js +7 -43
- package/dist/failure/error-types.d.ts +91 -0
- package/dist/failure/error-types.js +123 -0
- package/dist/failure/index.d.ts +5 -5
- package/dist/failure/index.js +10 -12
- package/dist/failure/recorder.d.ts +8 -29
- package/dist/failure/recorder.js +11 -65
- package/dist/gates/acceptance.d.ts +7 -38
- package/dist/gates/acceptance.js +32 -92
- package/dist/gates/blacklist-rules.d.ts +12 -0
- package/dist/gates/blacklist-rules.js +227 -0
- package/dist/gates/command.d.ts +1 -21
- package/dist/gates/command.js +5 -248
- package/dist/gates/contract.d.ts +0 -9
- package/dist/gates/contract.js +3 -18
- package/dist/gates/coverage.d.ts +13 -0
- package/dist/gates/coverage.js +63 -0
- package/dist/gates/decision.d.ts +0 -1
- package/dist/gates/decision.js +0 -1
- package/dist/gates/definitions.d.ts +5 -5
- package/dist/gates/definitions.js +4 -4
- package/dist/gates/performance.d.ts +1 -16
- package/dist/gates/performance.js +6 -31
- package/dist/gates/review.d.ts +23 -10
- package/dist/gates/review.js +24 -20
- package/dist/gates/security.d.ts +2 -10
- package/dist/gates/security.js +16 -36
- package/dist/gates/tasks-file.d.ts +41 -0
- package/dist/gates/tasks-file.js +63 -0
- package/dist/gates/types.d.ts +0 -1
- package/dist/gates/types.js +2 -2
- package/dist/index.d.ts +18 -20
- package/dist/index.js +7 -32
- package/dist/knowledge/audit-dimensions.d.ts +0 -1
- package/dist/knowledge/audit-dimensions.js +0 -1
- package/dist/knowledge/audit-rules.d.ts +2 -1
- package/dist/knowledge/audit-rules.js +10 -8
- package/dist/knowledge/audit-scoring.d.ts +0 -1
- package/dist/knowledge/audit-scoring.js +0 -1
- package/dist/knowledge/audit.d.ts +0 -1
- package/dist/knowledge/audit.js +3 -2
- package/dist/knowledge/{import.d.ts → cold-start.d.ts} +1 -3
- package/dist/knowledge/{import.js → cold-start.js} +138 -184
- package/dist/knowledge/flywheel-metrics.d.ts +0 -1
- package/dist/knowledge/flywheel-metrics.js +0 -1
- package/dist/knowledge/index-generator.d.ts +0 -1
- package/dist/knowledge/index-generator.js +8 -9
- package/dist/knowledge/index.d.ts +3 -6
- package/dist/knowledge/index.js +3 -10
- package/dist/knowledge/ingest.d.ts +29 -2
- package/dist/knowledge/ingest.js +97 -8
- package/dist/knowledge/lifecycle.d.ts +0 -6
- package/dist/knowledge/lifecycle.js +12 -20
- package/dist/knowledge/query.d.ts +0 -1
- package/dist/knowledge/query.js +1 -2
- package/dist/knowledge/store.d.ts +4 -8
- package/dist/knowledge/store.js +23 -38
- package/dist/knowledge/token-estimate.d.ts +0 -1
- package/dist/knowledge/token-estimate.js +0 -1
- package/dist/knowledge/tree-walker.d.ts +0 -1
- package/dist/knowledge/tree-walker.js +0 -1
- package/dist/knowledge/types.d.ts +2 -37
- package/dist/knowledge/types.js +2 -4
- package/dist/monitoring/index.d.ts +1 -2
- package/dist/monitoring/index.js +1 -3
- package/dist/monitoring/trace-analyzer.d.ts +1 -53
- package/dist/monitoring/trace-analyzer.js +34 -137
- package/dist/monitoring/traces.d.ts +1 -29
- package/dist/monitoring/traces.js +4 -42
- package/dist/presets/index.d.ts +0 -1
- package/dist/presets/index.js +0 -1
- package/dist/presets/standard.d.ts +0 -1
- package/dist/presets/standard.js +0 -1
- package/dist/pretool-use-hook.d.ts +0 -1
- package/dist/pretool-use-hook.js +0 -1
- package/dist/release/index.d.ts +0 -1
- package/dist/release/index.js +0 -1
- package/dist/release/integrity.d.ts +0 -1
- package/dist/release/integrity.js +0 -1
- package/dist/sdd/index-generator.d.ts +0 -2
- package/dist/sdd/index-generator.js +2 -5
- package/dist/types/checkpoint.d.ts +105 -33
- package/dist/types/checkpoint.js +0 -1
- package/dist/types/command-definition.d.ts +80 -0
- package/dist/types/command-definition.js +9 -0
- package/dist/types/command-io.d.ts +0 -1
- package/dist/types/command-io.js +0 -1
- package/dist/types/constraint.d.ts +3 -25
- package/dist/types/constraint.js +0 -1
- package/dist/types/cso.d.ts +0 -1
- package/dist/types/cso.js +0 -1
- package/dist/types/failure.d.ts +5 -86
- package/dist/types/failure.js +6 -116
- package/dist/types/gate.d.ts +0 -1
- package/dist/types/gate.js +0 -1
- package/dist/types/passes-gate.d.ts +10 -4
- package/dist/types/passes-gate.js +0 -1
- package/dist/types/project-config.d.ts +0 -1
- package/dist/types/project-config.js +0 -1
- package/dist/types/spec.d.ts +0 -11
- package/dist/types/spec.js +0 -1
- package/dist/types/trace.d.ts +0 -5
- package/dist/types/trace.js +0 -1
- package/dist/utils/attempt.d.ts +0 -1
- package/dist/utils/attempt.js +0 -1
- package/dist/utils/clip.d.ts +7 -0
- package/dist/utils/clip.js +14 -0
- package/dist/utils/date.d.ts +10 -0
- package/dist/utils/date.js +18 -0
- package/dist/utils/detect-source-roots.d.ts +0 -1
- package/dist/utils/detect-source-roots.js +0 -1
- package/dist/utils/diff-parse.d.ts +30 -0
- package/dist/utils/diff-parse.js +71 -0
- package/dist/utils/error.d.ts +10 -0
- package/dist/utils/error.js +15 -0
- package/dist/utils/exec.d.ts +0 -1
- package/dist/utils/exec.js +0 -1
- package/dist/utils/file-walk.d.ts +12 -3
- package/dist/utils/file-walk.js +20 -3
- package/dist/utils/frontmatter.d.ts +0 -1
- package/dist/utils/frontmatter.js +4 -4
- package/dist/utils/glob-match.d.ts +0 -1
- package/dist/utils/glob-match.js +0 -1
- package/dist/utils/guards.d.ts +5 -0
- package/dist/utils/guards.js +10 -0
- package/dist/utils/json-doc.d.ts +13 -0
- package/dist/utils/json-doc.js +54 -0
- package/dist/utils/jsonl.d.ts +0 -13
- package/dist/utils/jsonl.js +0 -13
- package/dist/utils/log-rotate.d.ts +13 -0
- package/dist/utils/log-rotate.js +73 -0
- package/dist/utils/numeric-flag.d.ts +10 -3
- package/dist/utils/numeric-flag.js +17 -3
- package/dist/utils/package-json.d.ts +1 -2
- package/dist/utils/package-json.js +1 -2
- package/dist/utils/package-version.d.ts +0 -1
- package/dist/utils/package-version.js +0 -1
- package/dist/utils/text.d.ts +18 -0
- package/dist/utils/text.js +26 -0
- package/dist/utils/yaml-edit.d.ts +2 -3
- package/dist/utils/yaml-edit.js +4 -5
- package/dist/utils/yaml.d.ts +13 -0
- package/dist/utils/yaml.js +19 -0
- package/package.json +2 -21
- package/CHANGELOG.md +0 -582
- package/dist/agents/index.d.ts.map +0 -1
- package/dist/agents/index.js.map +0 -1
- package/dist/agents/lifecycle.d.ts.map +0 -1
- package/dist/agents/lifecycle.js.map +0 -1
- package/dist/agents/types.d.ts.map +0 -1
- package/dist/agents/types.js.map +0 -1
- package/dist/cli/command-contract.d.ts.map +0 -1
- package/dist/cli/command-contract.js.map +0 -1
- package/dist/cli/commands/__tests__/gate-decision.d.ts.map +0 -1
- package/dist/cli/commands/__tests__/gate-decision.js.map +0 -1
- package/dist/cli/commands/acceptance.d.ts.map +0 -1
- package/dist/cli/commands/acceptance.js.map +0 -1
- package/dist/cli/commands/check.d.ts.map +0 -1
- package/dist/cli/commands/check.js.map +0 -1
- package/dist/cli/commands/command.d.ts.map +0 -1
- package/dist/cli/commands/command.js.map +0 -1
- package/dist/cli/commands/constraints-disable.d.ts.map +0 -1
- package/dist/cli/commands/constraints-disable.js.map +0 -1
- package/dist/cli/commands/constraints-pack-proposal.d.ts.map +0 -1
- package/dist/cli/commands/constraints-pack-proposal.js.map +0 -1
- package/dist/cli/commands/constraints-reactivate.d.ts.map +0 -1
- package/dist/cli/commands/constraints-reactivate.js.map +0 -1
- package/dist/cli/commands/constraints-report.d.ts.map +0 -1
- package/dist/cli/commands/constraints-report.js.map +0 -1
- package/dist/cli/commands/constraints-retire.d.ts.map +0 -1
- package/dist/cli/commands/constraints-retire.js.map +0 -1
- package/dist/cli/commands/constraints.d.ts.map +0 -1
- package/dist/cli/commands/constraints.js.map +0 -1
- package/dist/cli/commands/contract.d.ts.map +0 -1
- package/dist/cli/commands/contract.js.map +0 -1
- package/dist/cli/commands/definitions.d.ts.map +0 -1
- package/dist/cli/commands/definitions.js.map +0 -1
- package/dist/cli/commands/failure.d.ts.map +0 -1
- package/dist/cli/commands/failure.js.map +0 -1
- package/dist/cli/commands/init/ci-platform.d.ts.map +0 -1
- package/dist/cli/commands/init/ci-platform.js.map +0 -1
- package/dist/cli/commands/init/ci-wiring.d.ts.map +0 -1
- package/dist/cli/commands/init/ci-wiring.js.map +0 -1
- package/dist/cli/commands/init/git-hooks.d.ts.map +0 -1
- package/dist/cli/commands/init/git-hooks.js.map +0 -1
- package/dist/cli/commands/init/governance.d.ts.map +0 -1
- package/dist/cli/commands/init/governance.js.map +0 -1
- package/dist/cli/commands/init/index.d.ts.map +0 -1
- package/dist/cli/commands/init/index.js.map +0 -1
- package/dist/cli/commands/init/output-style.d.ts.map +0 -1
- package/dist/cli/commands/init/output-style.js.map +0 -1
- package/dist/cli/commands/init/presets.d.ts.map +0 -1
- package/dist/cli/commands/init/presets.js.map +0 -1
- package/dist/cli/commands/init/snippets.d.ts.map +0 -1
- package/dist/cli/commands/init/snippets.js.map +0 -1
- package/dist/cli/commands/knowledge/audit.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/audit.js.map +0 -1
- package/dist/cli/commands/knowledge/decay.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/decay.js.map +0 -1
- package/dist/cli/commands/knowledge/health.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/health.js.map +0 -1
- package/dist/cli/commands/knowledge/import.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/import.js.map +0 -1
- package/dist/cli/commands/knowledge/index.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/index.js.map +0 -1
- package/dist/cli/commands/knowledge/list.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/list.js.map +0 -1
- package/dist/cli/commands/knowledge/migrate.d.ts +0 -21
- package/dist/cli/commands/knowledge/migrate.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/migrate.js +0 -48
- package/dist/cli/commands/knowledge/migrate.js.map +0 -1
- package/dist/cli/commands/knowledge/search.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/search.js.map +0 -1
- package/dist/cli/commands/knowledge/shared.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/shared.js.map +0 -1
- package/dist/cli/commands/knowledge/snapshot.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/snapshot.js.map +0 -1
- package/dist/cli/commands/knowledge/stats.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/stats.js.map +0 -1
- package/dist/cli/commands/knowledge/sync-rag.d.ts +0 -19
- package/dist/cli/commands/knowledge/sync-rag.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/sync-rag.js +0 -77
- package/dist/cli/commands/knowledge/sync-rag.js.map +0 -1
- package/dist/cli/commands/knowledge-view.d.ts.map +0 -1
- package/dist/cli/commands/knowledge-view.js.map +0 -1
- package/dist/cli/commands/passes-gate.d.ts.map +0 -1
- package/dist/cli/commands/passes-gate.js.map +0 -1
- package/dist/cli/commands/performance.d.ts.map +0 -1
- package/dist/cli/commands/performance.js.map +0 -1
- package/dist/cli/commands/release.d.ts.map +0 -1
- package/dist/cli/commands/release.js.map +0 -1
- package/dist/cli/commands/report.d.ts.map +0 -1
- package/dist/cli/commands/report.js.map +0 -1
- package/dist/cli/commands/review.d.ts.map +0 -1
- package/dist/cli/commands/review.js.map +0 -1
- package/dist/cli/commands/scaffold-templates.d.ts.map +0 -1
- package/dist/cli/commands/scaffold-templates.js.map +0 -1
- package/dist/cli/commands/scaffold.d.ts.map +0 -1
- package/dist/cli/commands/scaffold.js.map +0 -1
- package/dist/cli/commands/sdd.d.ts.map +0 -1
- package/dist/cli/commands/sdd.js.map +0 -1
- package/dist/cli/commands/security.d.ts.map +0 -1
- package/dist/cli/commands/security.js.map +0 -1
- package/dist/cli/commands/spec-baseline-check.d.ts.map +0 -1
- package/dist/cli/commands/spec-baseline-check.js.map +0 -1
- package/dist/cli/commands/spec.d.ts.map +0 -1
- package/dist/cli/commands/spec.js.map +0 -1
- package/dist/cli/commands/status.d.ts.map +0 -1
- package/dist/cli/commands/status.js.map +0 -1
- package/dist/cli/commands/sync-docs/agents-syncer.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/agents-syncer.js.map +0 -1
- package/dist/cli/commands/sync-docs/capabilities-syncer.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/capabilities-syncer.js.map +0 -1
- package/dist/cli/commands/sync-docs/compact.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/compact.js.map +0 -1
- package/dist/cli/commands/sync-docs/context-syncer.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/context-syncer.js.map +0 -1
- package/dist/cli/commands/sync-docs/gate.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/gate.js.map +0 -1
- package/dist/cli/commands/sync-docs/head-gate.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/head-gate.js.map +0 -1
- package/dist/cli/commands/sync-docs/index.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/index.js.map +0 -1
- package/dist/cli/commands/sync-docs/main-flow.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/main-flow.js.map +0 -1
- package/dist/cli/commands/sync-docs/preserve-block.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/preserve-block.js.map +0 -1
- package/dist/cli/commands/sync-docs/project-reader.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/project-reader.js.map +0 -1
- package/dist/cli/commands/validate.d.ts.map +0 -1
- package/dist/cli/commands/validate.js.map +0 -1
- package/dist/cli/gate-command.d.ts.map +0 -1
- package/dist/cli/gate-command.js.map +0 -1
- package/dist/cli/state-io.d.ts.map +0 -1
- package/dist/cli/state-io.js.map +0 -1
- package/dist/completion-checkers/classify.d.ts.map +0 -1
- package/dist/completion-checkers/classify.js.map +0 -1
- package/dist/completion-checkers/contract-presence.d.ts.map +0 -1
- package/dist/completion-checkers/contract-presence.js.map +0 -1
- package/dist/completion-checkers/glob-match.d.ts.map +0 -1
- package/dist/completion-checkers/glob-match.js.map +0 -1
- package/dist/completion-checkers/index.d.ts.map +0 -1
- package/dist/completion-checkers/index.js.map +0 -1
- package/dist/completion-checkers/phase-format.d.ts.map +0 -1
- package/dist/completion-checkers/phase-format.js.map +0 -1
- package/dist/completion-checkers/tdd-chain.d.ts.map +0 -1
- package/dist/completion-checkers/tdd-chain.js.map +0 -1
- package/dist/completion-checkers/types.d.ts.map +0 -1
- package/dist/completion-checkers/types.js.map +0 -1
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js.map +0 -1
- package/dist/context/session-manager.d.ts.map +0 -1
- package/dist/context/session-manager.js.map +0 -1
- package/dist/context/types.d.ts.map +0 -1
- package/dist/context/types.js.map +0 -1
- package/dist/core/app-constraints-loader.d.ts.map +0 -1
- package/dist/core/app-constraints-loader.js.map +0 -1
- package/dist/core/config-files.d.ts +0 -21
- package/dist/core/config-files.d.ts.map +0 -1
- package/dist/core/config-files.js +0 -75
- package/dist/core/config-files.js.map +0 -1
- package/dist/core/constraint-lifecycle.d.ts.map +0 -1
- package/dist/core/constraint-lifecycle.js.map +0 -1
- package/dist/core/constraints/capabilities-parser.d.ts.map +0 -1
- package/dist/core/constraints/capabilities-parser.js.map +0 -1
- package/dist/core/constraints/capabilities-reconcile.d.ts.map +0 -1
- package/dist/core/constraints/capabilities-reconcile.js.map +0 -1
- package/dist/core/constraints/check-cache.d.ts.map +0 -1
- package/dist/core/constraints/check-cache.js.map +0 -1
- package/dist/core/constraints/checker.d.ts.map +0 -1
- package/dist/core/constraints/checker.js.map +0 -1
- package/dist/core/constraints/checkers/capability-sync.d.ts.map +0 -1
- package/dist/core/constraints/checkers/capability-sync.js.map +0 -1
- package/dist/core/constraints/checkers/context-doc-sync.d.ts.map +0 -1
- package/dist/core/constraints/checkers/context-doc-sync.js.map +0 -1
- package/dist/core/constraints/checkers/docs-freshness.d.ts.map +0 -1
- package/dist/core/constraints/checkers/docs-freshness.js.map +0 -1
- package/dist/core/constraints/checkers/governance-presence.d.ts.map +0 -1
- package/dist/core/constraints/checkers/governance-presence.js.map +0 -1
- package/dist/core/constraints/checkers/index.d.ts.map +0 -1
- package/dist/core/constraints/checkers/index.js.map +0 -1
- package/dist/core/constraints/checkers/no-completion-without-verification.d.ts.map +0 -1
- package/dist/core/constraints/checkers/no-completion-without-verification.js.map +0 -1
- package/dist/core/constraints/checkers/no-hardcoded-credentials.d.ts.map +0 -1
- package/dist/core/constraints/checkers/no-hardcoded-credentials.js.map +0 -1
- package/dist/core/constraints/checkers/no-test-simplification.d.ts.map +0 -1
- package/dist/core/constraints/checkers/no-test-simplification.js.map +0 -1
- package/dist/core/constraints/checkers/templated/exec.d.ts.map +0 -1
- package/dist/core/constraints/checkers/templated/exec.js.map +0 -1
- package/dist/core/constraints/checkers/templated/file-exists.d.ts.map +0 -1
- package/dist/core/constraints/checkers/templated/file-exists.js.map +0 -1
- package/dist/core/constraints/checkers/templated/glob.d.ts.map +0 -1
- package/dist/core/constraints/checkers/templated/glob.js.map +0 -1
- package/dist/core/constraints/checkers/templated/index.d.ts.map +0 -1
- package/dist/core/constraints/checkers/templated/index.js.map +0 -1
- package/dist/core/constraints/checkers/templated/regex-scan.d.ts.map +0 -1
- package/dist/core/constraints/checkers/templated/regex-scan.js.map +0 -1
- package/dist/core/constraints/checkers/templates-registry.d.ts +0 -18
- package/dist/core/constraints/checkers/templates-registry.d.ts.map +0 -1
- package/dist/core/constraints/checkers/templates-registry.js +0 -25
- package/dist/core/constraints/checkers/templates-registry.js.map +0 -1
- package/dist/core/constraints/checkers/types.d.ts.map +0 -1
- package/dist/core/constraints/checkers/types.js.map +0 -1
- package/dist/core/constraints/construction-sites.d.ts.map +0 -1
- package/dist/core/constraints/construction-sites.js.map +0 -1
- package/dist/core/constraints/context-builder.d.ts.map +0 -1
- package/dist/core/constraints/context-builder.js.map +0 -1
- package/dist/core/constraints/context-reconcile.d.ts.map +0 -1
- package/dist/core/constraints/context-reconcile.js.map +0 -1
- package/dist/core/constraints/definitions/guidelines.d.ts.map +0 -1
- package/dist/core/constraints/definitions/guidelines.js.map +0 -1
- package/dist/core/constraints/definitions/iron-laws.d.ts.map +0 -1
- package/dist/core/constraints/definitions/iron-laws.js.map +0 -1
- package/dist/core/constraints/definitions.d.ts.map +0 -1
- package/dist/core/constraints/definitions.js.map +0 -1
- package/dist/core/constraints/doc-freshness/runner.d.ts.map +0 -1
- package/dist/core/constraints/doc-freshness/runner.js.map +0 -1
- package/dist/core/constraints/git-evidence.d.ts.map +0 -1
- package/dist/core/constraints/git-evidence.js.map +0 -1
- package/dist/core/constraints/index.d.ts.map +0 -1
- package/dist/core/constraints/index.js.map +0 -1
- package/dist/core/constraints/injection-writer.d.ts.map +0 -1
- package/dist/core/constraints/injection-writer.js.map +0 -1
- package/dist/core/constraints/meta.d.ts.map +0 -1
- package/dist/core/constraints/meta.js.map +0 -1
- package/dist/core/constraints/pack-proposal.d.ts.map +0 -1
- package/dist/core/constraints/pack-proposal.js.map +0 -1
- package/dist/core/constraints/run-env.d.ts.map +0 -1
- package/dist/core/constraints/run-env.js.map +0 -1
- package/dist/core/constraints/triggers.d.ts.map +0 -1
- package/dist/core/constraints/triggers.js.map +0 -1
- package/dist/core/constraints/usage-report.d.ts.map +0 -1
- package/dist/core/constraints/usage-report.js.map +0 -1
- package/dist/core/effective-constraints.d.ts.map +0 -1
- package/dist/core/effective-constraints.js.map +0 -1
- package/dist/core/effective-set.d.ts.map +0 -1
- package/dist/core/effective-set.js.map +0 -1
- package/dist/core/index.d.ts +0 -15
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -43
- package/dist/core/index.js.map +0 -1
- package/dist/core/project-config-loader.d.ts.map +0 -1
- package/dist/core/project-config-loader.js.map +0 -1
- package/dist/core/retired-constraints.d.ts.map +0 -1
- package/dist/core/retired-constraints.js.map +0 -1
- package/dist/core/spec/validator.d.ts.map +0 -1
- package/dist/core/spec/validator.js.map +0 -1
- package/dist/core/validators/check-handlers/command.d.ts.map +0 -1
- package/dist/core/validators/check-handlers/command.js.map +0 -1
- package/dist/core/validators/check-handlers/file.d.ts.map +0 -1
- package/dist/core/validators/check-handlers/file.js.map +0 -1
- package/dist/core/validators/check-handlers/http.d.ts.map +0 -1
- package/dist/core/validators/check-handlers/http.js.map +0 -1
- package/dist/core/validators/check-handlers/output.d.ts.map +0 -1
- package/dist/core/validators/check-handlers/output.js.map +0 -1
- package/dist/core/validators/checkpoint.d.ts.map +0 -1
- package/dist/core/validators/checkpoint.js.map +0 -1
- package/dist/core/validators/cso.d.ts.map +0 -1
- package/dist/core/validators/cso.js.map +0 -1
- package/dist/core/validators/index.d.ts.map +0 -1
- package/dist/core/validators/index.js.map +0 -1
- package/dist/core/validators/passes-gate.d.ts.map +0 -1
- package/dist/core/validators/passes-gate.js.map +0 -1
- package/dist/core/validators/test-output.d.ts.map +0 -1
- package/dist/core/validators/test-output.js.map +0 -1
- package/dist/failure/classifier.d.ts.map +0 -1
- package/dist/failure/classifier.js.map +0 -1
- package/dist/failure/index.d.ts.map +0 -1
- package/dist/failure/index.js.map +0 -1
- package/dist/failure/recorder.d.ts.map +0 -1
- package/dist/failure/recorder.js.map +0 -1
- package/dist/gates/acceptance.d.ts.map +0 -1
- package/dist/gates/acceptance.js.map +0 -1
- package/dist/gates/checker-gate.d.ts +0 -27
- package/dist/gates/checker-gate.d.ts.map +0 -1
- package/dist/gates/checker-gate.js +0 -52
- package/dist/gates/checker-gate.js.map +0 -1
- package/dist/gates/command.d.ts.map +0 -1
- package/dist/gates/command.js.map +0 -1
- package/dist/gates/contract.d.ts.map +0 -1
- package/dist/gates/contract.js.map +0 -1
- package/dist/gates/decision.d.ts.map +0 -1
- package/dist/gates/decision.js.map +0 -1
- package/dist/gates/definitions.d.ts.map +0 -1
- package/dist/gates/definitions.js.map +0 -1
- package/dist/gates/performance.d.ts.map +0 -1
- package/dist/gates/performance.js.map +0 -1
- package/dist/gates/registry.d.ts +0 -32
- package/dist/gates/registry.d.ts.map +0 -1
- package/dist/gates/registry.js +0 -94
- package/dist/gates/registry.js.map +0 -1
- package/dist/gates/review.d.ts.map +0 -1
- package/dist/gates/review.js.map +0 -1
- package/dist/gates/security.d.ts.map +0 -1
- package/dist/gates/security.js.map +0 -1
- package/dist/gates/types.d.ts.map +0 -1
- package/dist/gates/types.js.map +0 -1
- package/dist/hooks/bootstrap.d.ts.map +0 -1
- package/dist/hooks/bootstrap.js.map +0 -1
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/knowledge/audit-dimensions.d.ts.map +0 -1
- package/dist/knowledge/audit-dimensions.js.map +0 -1
- package/dist/knowledge/audit-rules.d.ts.map +0 -1
- package/dist/knowledge/audit-rules.js.map +0 -1
- package/dist/knowledge/audit-scoring.d.ts.map +0 -1
- package/dist/knowledge/audit-scoring.js.map +0 -1
- package/dist/knowledge/audit.d.ts.map +0 -1
- package/dist/knowledge/audit.js.map +0 -1
- package/dist/knowledge/doctor.d.ts +0 -37
- package/dist/knowledge/doctor.d.ts.map +0 -1
- package/dist/knowledge/doctor.js +0 -81
- package/dist/knowledge/doctor.js.map +0 -1
- package/dist/knowledge/flywheel-metrics.d.ts.map +0 -1
- package/dist/knowledge/flywheel-metrics.js.map +0 -1
- package/dist/knowledge/import.d.ts.map +0 -1
- package/dist/knowledge/import.js.map +0 -1
- package/dist/knowledge/index-generator.d.ts.map +0 -1
- package/dist/knowledge/index-generator.js.map +0 -1
- package/dist/knowledge/index.d.ts.map +0 -1
- package/dist/knowledge/index.js.map +0 -1
- package/dist/knowledge/ingest.d.ts.map +0 -1
- package/dist/knowledge/ingest.js.map +0 -1
- package/dist/knowledge/lifecycle.d.ts.map +0 -1
- package/dist/knowledge/lifecycle.js.map +0 -1
- package/dist/knowledge/lint.d.ts +0 -90
- package/dist/knowledge/lint.d.ts.map +0 -1
- package/dist/knowledge/lint.js +0 -412
- package/dist/knowledge/lint.js.map +0 -1
- package/dist/knowledge/migration.d.ts +0 -28
- package/dist/knowledge/migration.d.ts.map +0 -1
- package/dist/knowledge/migration.js +0 -105
- package/dist/knowledge/migration.js.map +0 -1
- package/dist/knowledge/query.d.ts.map +0 -1
- package/dist/knowledge/query.js.map +0 -1
- package/dist/knowledge/reference-tracker.d.ts +0 -31
- package/dist/knowledge/reference-tracker.d.ts.map +0 -1
- package/dist/knowledge/reference-tracker.js +0 -122
- package/dist/knowledge/reference-tracker.js.map +0 -1
- package/dist/knowledge/store.d.ts.map +0 -1
- package/dist/knowledge/store.js.map +0 -1
- package/dist/knowledge/token-estimate.d.ts.map +0 -1
- package/dist/knowledge/token-estimate.js.map +0 -1
- package/dist/knowledge/tree-walker.d.ts.map +0 -1
- package/dist/knowledge/tree-walker.js.map +0 -1
- package/dist/knowledge/types.d.ts.map +0 -1
- package/dist/knowledge/types.js.map +0 -1
- package/dist/monitoring/analyzer-base.d.ts +0 -38
- package/dist/monitoring/analyzer-base.d.ts.map +0 -1
- package/dist/monitoring/analyzer-base.js +0 -105
- package/dist/monitoring/analyzer-base.js.map +0 -1
- package/dist/monitoring/index.d.ts.map +0 -1
- package/dist/monitoring/index.js.map +0 -1
- package/dist/monitoring/trace-analyzer.d.ts.map +0 -1
- package/dist/monitoring/trace-analyzer.js.map +0 -1
- package/dist/monitoring/traces.d.ts.map +0 -1
- package/dist/monitoring/traces.js.map +0 -1
- package/dist/presets/index.d.ts.map +0 -1
- package/dist/presets/index.js.map +0 -1
- package/dist/presets/standard.d.ts.map +0 -1
- package/dist/presets/standard.js.map +0 -1
- package/dist/pretool-use-hook.d.ts.map +0 -1
- package/dist/pretool-use-hook.js.map +0 -1
- package/dist/release/index.d.ts.map +0 -1
- package/dist/release/index.js.map +0 -1
- package/dist/release/integrity.d.ts.map +0 -1
- package/dist/release/integrity.js.map +0 -1
- package/dist/sdd/index-generator.d.ts.map +0 -1
- package/dist/sdd/index-generator.js.map +0 -1
- package/dist/test-setup/jsonl-fake-fs.d.ts +0 -30
- package/dist/test-setup/jsonl-fake-fs.d.ts.map +0 -1
- package/dist/test-setup/jsonl-fake-fs.js +0 -49
- package/dist/test-setup/jsonl-fake-fs.js.map +0 -1
- package/dist/test-setup/mkdtemp-cleanup.d.ts +0 -9
- package/dist/test-setup/mkdtemp-cleanup.d.ts.map +0 -1
- package/dist/test-setup/mkdtemp-cleanup.js +0 -90
- package/dist/test-setup/mkdtemp-cleanup.js.map +0 -1
- package/dist/test-setup/project-fixture.d.ts +0 -48
- package/dist/test-setup/project-fixture.d.ts.map +0 -1
- package/dist/test-setup/project-fixture.js +0 -106
- package/dist/test-setup/project-fixture.js.map +0 -1
- package/dist/types/checkpoint.d.ts.map +0 -1
- package/dist/types/checkpoint.js.map +0 -1
- package/dist/types/command-io.d.ts.map +0 -1
- package/dist/types/command-io.js.map +0 -1
- package/dist/types/constraint.d.ts.map +0 -1
- package/dist/types/constraint.js.map +0 -1
- package/dist/types/cso.d.ts.map +0 -1
- package/dist/types/cso.js.map +0 -1
- package/dist/types/failure.d.ts.map +0 -1
- package/dist/types/failure.js.map +0 -1
- package/dist/types/gate.d.ts.map +0 -1
- package/dist/types/gate.js.map +0 -1
- package/dist/types/passes-gate.d.ts.map +0 -1
- package/dist/types/passes-gate.js.map +0 -1
- package/dist/types/project-config.d.ts.map +0 -1
- package/dist/types/project-config.js.map +0 -1
- package/dist/types/spec.d.ts.map +0 -1
- package/dist/types/spec.js.map +0 -1
- package/dist/types/trace.d.ts.map +0 -1
- package/dist/types/trace.js.map +0 -1
- package/dist/utils/attempt.d.ts.map +0 -1
- package/dist/utils/attempt.js.map +0 -1
- package/dist/utils/detect-source-roots.d.ts.map +0 -1
- package/dist/utils/detect-source-roots.js.map +0 -1
- package/dist/utils/exec.d.ts.map +0 -1
- package/dist/utils/exec.js.map +0 -1
- package/dist/utils/file-walk.d.ts.map +0 -1
- package/dist/utils/file-walk.js.map +0 -1
- package/dist/utils/frontmatter.d.ts.map +0 -1
- package/dist/utils/frontmatter.js.map +0 -1
- package/dist/utils/glob-match.d.ts.map +0 -1
- package/dist/utils/glob-match.js.map +0 -1
- package/dist/utils/jsonl.d.ts.map +0 -1
- package/dist/utils/jsonl.js.map +0 -1
- package/dist/utils/numeric-flag.d.ts.map +0 -1
- package/dist/utils/numeric-flag.js.map +0 -1
- package/dist/utils/package-json.d.ts.map +0 -1
- package/dist/utils/package-json.js.map +0 -1
- package/dist/utils/package-version.d.ts.map +0 -1
- package/dist/utils/package-version.js.map +0 -1
- package/dist/utils/yaml-edit.d.ts.map +0 -1
- package/dist/utils/yaml-edit.js.map +0 -1
- package/src/CONTEXT.md +0 -64
- package/src/__tests__/acceptance-gate.test.ts +0 -339
- package/src/__tests__/app-constraints-loader.test.ts +0 -303
- package/src/__tests__/checker-extra.test.ts +0 -371
- package/src/__tests__/checker-primitives-sdk.test.ts +0 -70
- package/src/__tests__/checker.test.ts +0 -120
- package/src/__tests__/checkpoint.test.ts +0 -714
- package/src/__tests__/context-files-resolution.test.ts +0 -130
- package/src/__tests__/contract-gate.test.ts +0 -300
- package/src/__tests__/cso-validator.test.ts +0 -205
- package/src/__tests__/detect-source-roots.test.ts +0 -99
- package/src/__tests__/effective-constraints.test.ts +0 -116
- package/src/__tests__/error-classifier.test.ts +0 -304
- package/src/__tests__/exec-checker-full-chain.test.ts +0 -118
- package/src/__tests__/exec.test.ts +0 -55
- package/src/__tests__/failure-recorder.test.ts +0 -346
- package/src/__tests__/install-precommit-hook.test.ts +0 -61
- package/src/__tests__/iron-laws.test.ts +0 -228
- package/src/__tests__/layering.test.ts +0 -345
- package/src/__tests__/no-studio-references.test.ts +0 -62
- package/src/__tests__/passes-gate-check.test.ts +0 -154
- package/src/__tests__/passes-gate.test.ts +0 -171
- package/src/__tests__/performance-gate.test.ts +0 -54
- package/src/__tests__/pretool-use-hook.test.ts +0 -289
- package/src/__tests__/project-config-loader-extra.test.ts +0 -172
- package/src/__tests__/project-config-loader.test.ts +0 -140
- package/src/__tests__/public-exports.test.ts +0 -379
- package/src/__tests__/public-type-surface.test.ts +0 -326
- package/src/__tests__/public-value-surface.test.ts +0 -150
- package/src/__tests__/retired-constraints.test.ts +0 -99
- package/src/__tests__/review-gate.test.ts +0 -90
- package/src/__tests__/security-gate.test.ts +0 -85
- package/src/__tests__/skip-semantics.test.ts +0 -288
- package/src/__tests__/spec-validator.test.ts +0 -58
- package/src/__tests__/sub-barrels-explicit.test.ts +0 -87
- package/src/__tests__/test-fixture-hygiene.test.ts +0 -53
- package/src/__tests__/trace-analyzer-extra.test.ts +0 -217
- package/src/__tests__/trace-analyzer.test.ts +0 -182
- package/src/__tests__/trace-collector.test.ts +0 -249
- package/src/__tests__/traces.test.ts +0 -326
- package/src/__tests__/usage-report-public-export.test.ts +0 -21
- package/src/agents/CONTEXT.md +0 -21
- package/src/agents/__tests__/lifecycle.test.ts +0 -248
- package/src/agents/index.ts +0 -13
- package/src/agents/lifecycle.ts +0 -199
- package/src/agents/types.ts +0 -46
- package/src/cli/__tests__/command-contract.test.ts +0 -188
- package/src/cli/__tests__/gate-command.test.ts +0 -162
- package/src/cli/__tests__/state-io.test.ts +0 -50
- package/src/cli/command-contract.ts +0 -111
- package/src/cli/commands/CONTEXT.md +0 -83
- package/src/cli/commands/__tests__/acceptance.test.ts +0 -186
- package/src/cli/commands/__tests__/bin-exit-mapping.test.ts +0 -122
- package/src/cli/commands/__tests__/check-read-count.test.ts +0 -162
- package/src/cli/commands/__tests__/check-skip-output.test.ts +0 -124
- package/src/cli/commands/__tests__/check.test.ts +0 -600
- package/src/cli/commands/__tests__/command-gate-dead-options.test.ts +0 -60
- package/src/cli/commands/__tests__/command.test.ts +0 -180
- package/src/cli/commands/__tests__/constraints-disable.test.ts +0 -229
- package/src/cli/commands/__tests__/constraints-pack-proposal.test.ts +0 -142
- package/src/cli/commands/__tests__/constraints-reactivate.test.ts +0 -210
- package/src/cli/commands/__tests__/constraints-report-json-flag.test.ts +0 -101
- package/src/cli/commands/__tests__/constraints-report.test.ts +0 -457
- package/src/cli/commands/__tests__/constraints-retire.test.ts +0 -532
- package/src/cli/commands/__tests__/context-syncer.test.ts +0 -141
- package/src/cli/commands/__tests__/contract.test.ts +0 -144
- package/src/cli/commands/__tests__/failure.test.ts +0 -196
- package/src/cli/commands/__tests__/gate-decision.ts +0 -30
- package/src/cli/commands/__tests__/init-dead-options.test.ts +0 -50
- package/src/cli/commands/__tests__/init-governance-io.test.ts +0 -98
- package/src/cli/commands/__tests__/init-ondisk.test.ts +0 -859
- package/src/cli/commands/__tests__/init.test.ts +0 -479
- package/src/cli/commands/__tests__/knowledge-audit-threshold.test.ts +0 -152
- package/src/cli/commands/__tests__/knowledge-flywheel-consistency.test.ts +0 -109
- package/src/cli/commands/__tests__/knowledge-tone-mapping.test.ts +0 -244
- package/src/cli/commands/__tests__/knowledge-view.test.ts +0 -849
- package/src/cli/commands/__tests__/knowledge.test.ts +0 -394
- package/src/cli/commands/__tests__/numeric-flag-assembly.test.ts +0 -368
- package/src/cli/commands/__tests__/passes-gate-dead-options.test.ts +0 -158
- package/src/cli/commands/__tests__/passes-gate.test.ts +0 -334
- package/src/cli/commands/__tests__/performance.test.ts +0 -102
- package/src/cli/commands/__tests__/pre-push-hook.test.ts +0 -181
- package/src/cli/commands/__tests__/project-path-anchoring.test.ts +0 -250
- package/src/cli/commands/__tests__/project-path-convention.test.ts +0 -277
- package/src/cli/commands/__tests__/registry.test.ts +0 -325
- package/src/cli/commands/__tests__/release.test.ts +0 -334
- package/src/cli/commands/__tests__/report-app-constraints.test.ts +0 -67
- package/src/cli/commands/__tests__/report-extra.test.ts +0 -79
- package/src/cli/commands/__tests__/report-false-green.test.ts +0 -50
- package/src/cli/commands/__tests__/report.test.ts +0 -111
- package/src/cli/commands/__tests__/review.test.ts +0 -148
- package/src/cli/commands/__tests__/scaffold.test.ts +0 -495
- package/src/cli/commands/__tests__/security-default-scan.test.ts +0 -75
- package/src/cli/commands/__tests__/security.test.ts +0 -228
- package/src/cli/commands/__tests__/spec-baseline-check.test.ts +0 -236
- package/src/cli/commands/__tests__/spec-baseline-index-cap.test.ts +0 -131
- package/src/cli/commands/__tests__/spec-baseline-read-count.test.ts +0 -325
- package/src/cli/commands/__tests__/spec.test.ts +0 -205
- package/src/cli/commands/__tests__/status-analysis-wiring.test.ts +0 -68
- package/src/cli/commands/__tests__/status-extra.test.ts +0 -163
- package/src/cli/commands/__tests__/status-skipped-lines.test.ts +0 -72
- package/src/cli/commands/__tests__/status.test.ts +0 -235
- package/src/cli/commands/__tests__/sync-docs-agents.test.ts +0 -638
- package/src/cli/commands/__tests__/sync-docs-construction-sites.test.ts +0 -175
- package/src/cli/commands/__tests__/sync-docs-context-drift.test.ts +0 -232
- package/src/cli/commands/__tests__/sync-docs-gate.test.ts +0 -154
- package/src/cli/commands/__tests__/sync-docs-module-order.test.ts +0 -111
- package/src/cli/commands/__tests__/sync-docs-read-count.test.ts +0 -192
- package/src/cli/commands/__tests__/sync-docs-table-layout.test.ts +0 -259
- package/src/cli/commands/__tests__/sync-docs.test.ts +0 -691
- package/src/cli/commands/__tests__/validate.test.ts +0 -178
- package/src/cli/commands/acceptance.ts +0 -118
- package/src/cli/commands/check.ts +0 -285
- package/src/cli/commands/command.ts +0 -105
- package/src/cli/commands/constraints-disable.ts +0 -94
- package/src/cli/commands/constraints-pack-proposal.ts +0 -77
- package/src/cli/commands/constraints-reactivate.ts +0 -108
- package/src/cli/commands/constraints-report.ts +0 -224
- package/src/cli/commands/constraints-retire.ts +0 -289
- package/src/cli/commands/constraints.ts +0 -30
- package/src/cli/commands/contract.ts +0 -189
- package/src/cli/commands/definitions.ts +0 -418
- package/src/cli/commands/failure.ts +0 -138
- package/src/cli/commands/init/ci-platform.ts +0 -66
- package/src/cli/commands/init/ci-wiring.ts +0 -48
- package/src/cli/commands/init/git-hooks.ts +0 -31
- package/src/cli/commands/init/governance.ts +0 -127
- package/src/cli/commands/init/index.ts +0 -156
- package/src/cli/commands/init/output-style.ts +0 -82
- package/src/cli/commands/init/presets.ts +0 -105
- package/src/cli/commands/init/snippets.ts +0 -57
- package/src/cli/commands/knowledge/audit.ts +0 -155
- package/src/cli/commands/knowledge/decay.ts +0 -57
- package/src/cli/commands/knowledge/health.ts +0 -176
- package/src/cli/commands/knowledge/import.ts +0 -82
- package/src/cli/commands/knowledge/index.ts +0 -60
- package/src/cli/commands/knowledge/list.ts +0 -73
- package/src/cli/commands/knowledge/migrate.ts +0 -61
- package/src/cli/commands/knowledge/search.ts +0 -93
- package/src/cli/commands/knowledge/shared.ts +0 -13
- package/src/cli/commands/knowledge/snapshot.ts +0 -38
- package/src/cli/commands/knowledge/stats.ts +0 -112
- package/src/cli/commands/knowledge/sync-rag.ts +0 -48
- package/src/cli/commands/knowledge-view.ts +0 -206
- package/src/cli/commands/passes-gate.ts +0 -166
- package/src/cli/commands/performance.ts +0 -92
- package/src/cli/commands/release.ts +0 -235
- package/src/cli/commands/report.ts +0 -145
- package/src/cli/commands/review.ts +0 -123
- package/src/cli/commands/scaffold-templates.ts +0 -377
- package/src/cli/commands/scaffold.ts +0 -291
- package/src/cli/commands/sdd.ts +0 -46
- package/src/cli/commands/security.ts +0 -233
- package/src/cli/commands/spec-baseline-check.ts +0 -506
- package/src/cli/commands/spec.ts +0 -171
- package/src/cli/commands/status.ts +0 -164
- package/src/cli/commands/sync-docs/__tests__/construction-site-count.test.ts +0 -49
- package/src/cli/commands/sync-docs/__tests__/context-export-surface.test.ts +0 -102
- package/src/cli/commands/sync-docs/__tests__/module-descriptions.test.ts +0 -196
- package/src/cli/commands/sync-docs/agents-syncer.ts +0 -274
- package/src/cli/commands/sync-docs/capabilities-syncer.ts +0 -335
- package/src/cli/commands/sync-docs/compact.ts +0 -35
- package/src/cli/commands/sync-docs/context-syncer.ts +0 -241
- package/src/cli/commands/sync-docs/gate.ts +0 -78
- package/src/cli/commands/sync-docs/head-gate.ts +0 -87
- package/src/cli/commands/sync-docs/index.ts +0 -52
- package/src/cli/commands/sync-docs/main-flow.ts +0 -549
- package/src/cli/commands/sync-docs/preserve-block.ts +0 -59
- package/src/cli/commands/sync-docs/project-reader.ts +0 -210
- package/src/cli/commands/validate.ts +0 -112
- package/src/cli/gate-command.ts +0 -87
- package/src/cli/state-io.ts +0 -60
- package/src/completion-checkers/CONTEXT.md +0 -25
- package/src/completion-checkers/__tests__/contract-presence.test.ts +0 -44
- package/src/completion-checkers/__tests__/phase-format.test.ts +0 -60
- package/src/completion-checkers/__tests__/tdd-chain.test.ts +0 -99
- package/src/completion-checkers/classify.ts +0 -47
- package/src/completion-checkers/contract-presence.ts +0 -40
- package/src/completion-checkers/glob-match.ts +0 -22
- package/src/completion-checkers/index.ts +0 -28
- package/src/completion-checkers/phase-format.ts +0 -48
- package/src/completion-checkers/tdd-chain.ts +0 -63
- package/src/completion-checkers/types.ts +0 -84
- package/src/context/CONTEXT.md +0 -20
- package/src/context/__tests__/session-manager.test.ts +0 -227
- package/src/context/index.ts +0 -21
- package/src/context/session-manager.ts +0 -229
- package/src/context/types.ts +0 -70
- package/src/core/CONTEXT.md +0 -43
- package/src/core/__tests__/config-files.test.ts +0 -88
- package/src/core/__tests__/constraint-lifecycle.test.ts +0 -255
- package/src/core/__tests__/constraints-meta.test.ts +0 -26
- package/src/core/__tests__/effective-set.test.ts +0 -56
- package/src/core/__tests__/pack-proposal.test.ts +0 -95
- package/src/core/app-constraints-loader.ts +0 -180
- package/src/core/config-files.ts +0 -39
- package/src/core/constraint-lifecycle.ts +0 -435
- package/src/core/constraints/__tests__/capabilities-reconcile.test.ts +0 -200
- package/src/core/constraints/__tests__/capability-counts.test.ts +0 -94
- package/src/core/constraints/__tests__/check-cache.test.ts +0 -220
- package/src/core/constraints/__tests__/collect-constraints.test.ts +0 -122
- package/src/core/constraints/__tests__/construction-sites.test.ts +0 -147
- package/src/core/constraints/__tests__/context-reconcile.test.ts +0 -246
- package/src/core/constraints/__tests__/git-evidence.test.ts +0 -225
- package/src/core/constraints/__tests__/injection-writer.test.ts +0 -178
- package/src/core/constraints/__tests__/run-env.test.ts +0 -350
- package/src/core/constraints/__tests__/trace-injection.test.ts +0 -76
- package/src/core/constraints/__tests__/triggers.test.ts +0 -70
- package/src/core/constraints/__tests__/usage-report.test.ts +0 -184
- package/src/core/constraints/capabilities-parser.ts +0 -213
- package/src/core/constraints/capabilities-reconcile.ts +0 -190
- package/src/core/constraints/check-cache.ts +0 -168
- package/src/core/constraints/checker.ts +0 -458
- package/src/core/constraints/checkers/__tests__/capability-sync.test.ts +0 -291
- package/src/core/constraints/checkers/__tests__/check-outcome.test.ts +0 -173
- package/src/core/constraints/checkers/__tests__/context-doc-sync.test.ts +0 -90
- package/src/core/constraints/checkers/__tests__/docs-freshness-degraded.test.ts +0 -89
- package/src/core/constraints/checkers/__tests__/docs-freshness.test.ts +0 -128
- package/src/core/constraints/checkers/__tests__/exec-checker.test.ts +0 -99
- package/src/core/constraints/checkers/__tests__/fixtures/public-repo-sanitization.mjs +0 -40
- package/src/core/constraints/checkers/__tests__/governance-presence.test.ts +0 -181
- package/src/core/constraints/checkers/__tests__/input-contract.test.ts +0 -135
- package/src/core/constraints/checkers/__tests__/no-completion-without-verification.test.ts +0 -227
- package/src/core/constraints/checkers/__tests__/no-hardcoded-credentials.test.ts +0 -229
- package/src/core/constraints/checkers/__tests__/no-test-simplification.test.ts +0 -181
- package/src/core/constraints/checkers/__tests__/templated-checkers.test.ts +0 -180
- package/src/core/constraints/checkers/__tests__/templates-registry.test.ts +0 -81
- package/src/core/constraints/checkers/__tests__/three-state-consistency.test.ts +0 -157
- package/src/core/constraints/checkers/capability-sync.ts +0 -134
- package/src/core/constraints/checkers/context-doc-sync.ts +0 -42
- package/src/core/constraints/checkers/docs-freshness.ts +0 -156
- package/src/core/constraints/checkers/governance-presence.ts +0 -60
- package/src/core/constraints/checkers/index.ts +0 -129
- package/src/core/constraints/checkers/no-completion-without-verification.ts +0 -141
- package/src/core/constraints/checkers/no-hardcoded-credentials.ts +0 -212
- package/src/core/constraints/checkers/no-test-simplification.ts +0 -140
- package/src/core/constraints/checkers/templated/exec.ts +0 -139
- package/src/core/constraints/checkers/templated/file-exists.ts +0 -75
- package/src/core/constraints/checkers/templated/glob.ts +0 -13
- package/src/core/constraints/checkers/templated/index.ts +0 -13
- package/src/core/constraints/checkers/templated/regex-scan.ts +0 -132
- package/src/core/constraints/checkers/templates-registry.ts +0 -24
- package/src/core/constraints/checkers/types.ts +0 -292
- package/src/core/constraints/construction-sites.ts +0 -95
- package/src/core/constraints/context-builder.ts +0 -193
- package/src/core/constraints/context-reconcile.ts +0 -200
- package/src/core/constraints/definitions/guidelines.ts +0 -113
- package/src/core/constraints/definitions/iron-laws.ts +0 -73
- package/src/core/constraints/definitions.ts +0 -58
- package/src/core/constraints/doc-freshness/__tests__/runner.test.ts +0 -576
- package/src/core/constraints/doc-freshness/runner.ts +0 -478
- package/src/core/constraints/git-evidence.ts +0 -138
- package/src/core/constraints/index.ts +0 -57
- package/src/core/constraints/injection-writer.ts +0 -164
- package/src/core/constraints/meta.ts +0 -40
- package/src/core/constraints/pack-proposal.ts +0 -179
- package/src/core/constraints/run-env.ts +0 -176
- package/src/core/constraints/triggers.ts +0 -33
- package/src/core/constraints/usage-report.ts +0 -370
- package/src/core/effective-constraints.ts +0 -93
- package/src/core/effective-set.ts +0 -40
- package/src/core/index.ts +0 -85
- package/src/core/project-config-loader.ts +0 -226
- package/src/core/retired-constraints.ts +0 -77
- package/src/core/spec/__tests__/validator.test.ts +0 -455
- package/src/core/spec/validator.ts +0 -392
- package/src/core/validators/__tests__/command-success-output.test.ts +0 -56
- package/src/core/validators/__tests__/http-retry-sleep.test.ts +0 -231
- package/src/core/validators/__tests__/passes-gate-counts.test.ts +0 -52
- package/src/core/validators/__tests__/passes-gate.test.ts +0 -70
- package/src/core/validators/__tests__/test-output.test.ts +0 -372
- package/src/core/validators/check-handlers/command.ts +0 -101
- package/src/core/validators/check-handlers/file.ts +0 -104
- package/src/core/validators/check-handlers/http.ts +0 -101
- package/src/core/validators/check-handlers/output.ts +0 -166
- package/src/core/validators/checkpoint.ts +0 -174
- package/src/core/validators/cso.ts +0 -124
- package/src/core/validators/index.ts +0 -23
- package/src/core/validators/passes-gate.ts +0 -302
- package/src/core/validators/test-output.ts +0 -128
- package/src/failure/CONTEXT.md +0 -27
- package/src/failure/__tests__/recorder.test.ts +0 -168
- package/src/failure/classifier.ts +0 -156
- package/src/failure/index.ts +0 -37
- package/src/failure/recorder.ts +0 -203
- package/src/gates/CONTEXT.md +0 -49
- package/src/gates/__tests__/acceptance-types-single-source.test.ts +0 -71
- package/src/gates/__tests__/acceptance.test.ts +0 -498
- package/src/gates/__tests__/checker-gate.test.ts +0 -86
- package/src/gates/__tests__/command-single-predicate.test.ts +0 -135
- package/src/gates/__tests__/command.test.ts +0 -252
- package/src/gates/__tests__/contract.test.ts +0 -73
- package/src/gates/__tests__/decision.test.ts +0 -35
- package/src/gates/__tests__/gate-interface.test.ts +0 -182
- package/src/gates/__tests__/performance.test.ts +0 -300
- package/src/gates/__tests__/registry.test.ts +0 -87
- package/src/gates/__tests__/review.test.ts +0 -301
- package/src/gates/__tests__/security-default-scan.test.ts +0 -97
- package/src/gates/__tests__/security.test.ts +0 -307
- package/src/gates/__tests__/test-verdict-consistency.test.ts +0 -140
- package/src/gates/acceptance.ts +0 -496
- package/src/gates/checker-gate.ts +0 -52
- package/src/gates/command.ts +0 -447
- package/src/gates/contract.ts +0 -232
- package/src/gates/decision.ts +0 -27
- package/src/gates/definitions.ts +0 -186
- package/src/gates/performance.ts +0 -266
- package/src/gates/registry.ts +0 -110
- package/src/gates/review.ts +0 -187
- package/src/gates/security.ts +0 -251
- package/src/gates/types.ts +0 -208
- package/src/hooks/CONTEXT.md +0 -24
- package/src/hooks/__tests__/bootstrap.test.ts +0 -155
- package/src/hooks/bootstrap.ts +0 -113
- package/src/hooks/index.ts +0 -10
- package/src/index.ts +0 -393
- package/src/knowledge/CONTEXT.md +0 -69
- package/src/knowledge/__tests__/audit-labels.test.ts +0 -47
- package/src/knowledge/__tests__/audit-scoring.test.ts +0 -232
- package/src/knowledge/__tests__/audit-write-count.test.ts +0 -131
- package/src/knowledge/__tests__/audit.test.ts +0 -737
- package/src/knowledge/__tests__/doctor.test.ts +0 -300
- package/src/knowledge/__tests__/flywheel-metrics.test.ts +0 -135
- package/src/knowledge/__tests__/import.test.ts +0 -420
- package/src/knowledge/__tests__/index-generator.test.ts +0 -388
- package/src/knowledge/__tests__/ingest.test.ts +0 -530
- package/src/knowledge/__tests__/lifecycle.test.ts +0 -1040
- package/src/knowledge/__tests__/lint.test.ts +0 -536
- package/src/knowledge/__tests__/migration.test.ts +0 -185
- package/src/knowledge/__tests__/query.test.ts +0 -336
- package/src/knowledge/__tests__/reference-tracker.test.ts +0 -169
- package/src/knowledge/__tests__/store.test.ts +0 -865
- package/src/knowledge/__tests__/token-estimate.test.ts +0 -54
- package/src/knowledge/__tests__/tree-walker.test.ts +0 -132
- package/src/knowledge/audit-dimensions.ts +0 -190
- package/src/knowledge/audit-rules.ts +0 -335
- package/src/knowledge/audit-scoring.ts +0 -101
- package/src/knowledge/audit.ts +0 -147
- package/src/knowledge/doctor.ts +0 -103
- package/src/knowledge/flywheel-metrics.ts +0 -71
- package/src/knowledge/import.ts +0 -497
- package/src/knowledge/index-generator.ts +0 -230
- package/src/knowledge/index.ts +0 -47
- package/src/knowledge/ingest.ts +0 -309
- package/src/knowledge/lifecycle.ts +0 -465
- package/src/knowledge/lint.ts +0 -460
- package/src/knowledge/migration.ts +0 -82
- package/src/knowledge/query.ts +0 -253
- package/src/knowledge/reference-tracker.ts +0 -99
- package/src/knowledge/store.ts +0 -515
- package/src/knowledge/token-estimate.ts +0 -27
- package/src/knowledge/tree-walker.ts +0 -29
- package/src/knowledge/types.ts +0 -215
- package/src/monitoring/CONTEXT.md +0 -28
- package/src/monitoring/__tests__/prune-trace-logs.test.ts +0 -76
- package/src/monitoring/__tests__/skipped-lines-report.test.ts +0 -178
- package/src/monitoring/__tests__/trace-file-anchoring.test.ts +0 -80
- package/src/monitoring/__tests__/traces.test.ts +0 -221
- package/src/monitoring/analyzer-base.ts +0 -72
- package/src/monitoring/index.ts +0 -10
- package/src/monitoring/trace-analyzer.ts +0 -395
- package/src/monitoring/traces.ts +0 -342
- package/src/presets/__tests__/standard.test.ts +0 -65
- package/src/presets/index.ts +0 -12
- package/src/presets/standard.ts +0 -71
- package/src/pretool-use-hook.ts +0 -167
- package/src/release/CONTEXT.md +0 -24
- package/src/release/__tests__/barrel.test.ts +0 -60
- package/src/release/__tests__/integrity.test.ts +0 -162
- package/src/release/index.ts +0 -2
- package/src/release/integrity.ts +0 -138
- package/src/sdd/__tests__/index-generator.test.ts +0 -221
- package/src/sdd/index-generator.ts +0 -113
- package/src/test-setup/__tests__/jsonl-fake-fs.test.ts +0 -98
- package/src/test-setup/__tests__/mkdtemp-cleanup.test.ts +0 -45
- package/src/test-setup/__tests__/project-fixture.test.ts +0 -178
- package/src/test-setup/jsonl-fake-fs.ts +0 -59
- package/src/test-setup/mkdtemp-cleanup.ts +0 -83
- package/src/test-setup/project-fixture.ts +0 -87
- package/src/types/__tests__/types.test.ts +0 -53
- package/src/types/checkpoint.ts +0 -180
- package/src/types/command-io.ts +0 -14
- package/src/types/constraint.ts +0 -276
- package/src/types/cso.ts +0 -37
- package/src/types/failure.ts +0 -173
- package/src/types/gate.ts +0 -77
- package/src/types/passes-gate.ts +0 -130
- package/src/types/project-config.ts +0 -251
- package/src/types/spec.ts +0 -91
- package/src/types/trace.ts +0 -239
- package/src/utils/__tests__/attempt.test.ts +0 -94
- package/src/utils/__tests__/file-walk.test.ts +0 -54
- package/src/utils/__tests__/frontmatter.test.ts +0 -206
- package/src/utils/__tests__/glob-match.test.ts +0 -52
- package/src/utils/__tests__/jsonl-bounded-read.test.ts +0 -106
- package/src/utils/__tests__/jsonl-skip-disposition.test.ts +0 -177
- package/src/utils/__tests__/jsonl.test.ts +0 -234
- package/src/utils/__tests__/numeric-flag.test.ts +0 -80
- package/src/utils/__tests__/package-json.test.ts +0 -58
- package/src/utils/__tests__/package-version.test.ts +0 -116
- package/src/utils/__tests__/yaml-edit.test.ts +0 -62
- package/src/utils/attempt.ts +0 -35
- package/src/utils/detect-source-roots.ts +0 -90
- package/src/utils/exec.ts +0 -16
- package/src/utils/file-walk.ts +0 -103
- package/src/utils/frontmatter.ts +0 -121
- package/src/utils/glob-match.ts +0 -41
- package/src/utils/jsonl.ts +0 -306
- package/src/utils/numeric-flag.ts +0 -64
- package/src/utils/package-json.ts +0 -61
- package/src/utils/package-version.ts +0 -25
- package/src/utils/yaml-edit.ts +0 -67
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* validate 命令测试
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { validate } from '../validate';
|
|
6
|
-
import { captureIO, type CapturingIO } from '../../command-contract';
|
|
7
|
-
import * as fs from 'fs/promises';
|
|
8
|
-
import { CheckpointValidator } from '../../../core/validators/checkpoint';
|
|
9
|
-
import * as yaml from 'js-yaml';
|
|
10
|
-
|
|
11
|
-
// Mock fs/promises
|
|
12
|
-
jest.mock('fs/promises', () => ({
|
|
13
|
-
access: jest.fn(),
|
|
14
|
-
readFile: jest.fn(),
|
|
15
|
-
writeFile: jest.fn(),
|
|
16
|
-
mkdir: jest.fn(),
|
|
17
|
-
}));
|
|
18
|
-
|
|
19
|
-
// Mock CheckpointValidator
|
|
20
|
-
jest.mock('../../../core/validators/checkpoint', () => ({
|
|
21
|
-
CheckpointValidator: {
|
|
22
|
-
getInstance: jest.fn(),
|
|
23
|
-
},
|
|
24
|
-
}));
|
|
25
|
-
|
|
26
|
-
// Mock yaml
|
|
27
|
-
jest.mock('js-yaml', () => ({
|
|
28
|
-
load: jest.fn(),
|
|
29
|
-
dump: jest.fn(),
|
|
30
|
-
}));
|
|
31
|
-
|
|
32
|
-
// Mock chalk
|
|
33
|
-
jest.mock('chalk', () => ({
|
|
34
|
-
blue: jest.fn((str: string) => str),
|
|
35
|
-
yellow: jest.fn((str: string) => str),
|
|
36
|
-
green: jest.fn((str: string) => str),
|
|
37
|
-
gray: jest.fn((str: string) => str),
|
|
38
|
-
red: jest.fn((str: string) => str),
|
|
39
|
-
}));
|
|
40
|
-
|
|
41
|
-
const mockFs = fs as jest.Mocked<typeof fs>;
|
|
42
|
-
const MockCheckpointValidator = CheckpointValidator as jest.Mocked<typeof CheckpointValidator>;
|
|
43
|
-
const mockYaml = yaml as jest.Mocked<typeof yaml>;
|
|
44
|
-
|
|
45
|
-
describe('validate command', () => {
|
|
46
|
-
let io: CapturingIO;
|
|
47
|
-
|
|
48
|
-
beforeEach(() => {
|
|
49
|
-
|
|
50
|
-
io = captureIO();
|
|
51
|
-
jest.clearAllMocks();
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
describe('validate', () => {
|
|
55
|
-
it('应该跳过无检查点的情况', async () => {
|
|
56
|
-
mockFs.readFile.mockRejectedValue(new Error('file not found'));
|
|
57
|
-
|
|
58
|
-
const result = await validate({}, io);
|
|
59
|
-
|
|
60
|
-
expect(io.outText()).toContain('没有定义检查点');
|
|
61
|
-
expect(result).toEqual({ kind: 'skip', reason: expect.stringContaining('没有定义检查点') });
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it('应该通过所有检查点', async () => {
|
|
65
|
-
const mockCheckpoints = [
|
|
66
|
-
{ id: 'test-1', checks: [{ id: 'check-1', type: 'test' }] },
|
|
67
|
-
];
|
|
68
|
-
|
|
69
|
-
mockFs.readFile.mockResolvedValue('checkpoints content');
|
|
70
|
-
mockYaml.load.mockReturnValue({ checkpoints: mockCheckpoints });
|
|
71
|
-
|
|
72
|
-
const mockValidator = {
|
|
73
|
-
validate: jest.fn().mockResolvedValue({ passed: true, checks: [] }),
|
|
74
|
-
};
|
|
75
|
-
(MockCheckpointValidator.getInstance as jest.Mock).mockReturnValue(mockValidator);
|
|
76
|
-
|
|
77
|
-
const result = await validate({}, io);
|
|
78
|
-
|
|
79
|
-
expect(io.outText()).toContain('所有检查点验证通过');
|
|
80
|
-
expect(result).toEqual({ kind: 'ok' });
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('应该显示失败的检查点', async () => {
|
|
84
|
-
const mockCheckpoints = [
|
|
85
|
-
{ id: 'test-1', checks: [{ id: 'check-1', type: 'test' }] },
|
|
86
|
-
];
|
|
87
|
-
|
|
88
|
-
mockFs.readFile.mockResolvedValue('checkpoints content');
|
|
89
|
-
mockYaml.load.mockReturnValue({ checkpoints: mockCheckpoints });
|
|
90
|
-
|
|
91
|
-
const mockValidator = {
|
|
92
|
-
validate: jest.fn().mockResolvedValue({
|
|
93
|
-
passed: false,
|
|
94
|
-
checks: [{ checkId: 'check-1', passed: false, message: 'failed' }],
|
|
95
|
-
}),
|
|
96
|
-
};
|
|
97
|
-
(MockCheckpointValidator.getInstance as jest.Mock).mockReturnValue(mockValidator);
|
|
98
|
-
|
|
99
|
-
// 工单 23:检查点失败一律 exit 1(门控语义)
|
|
100
|
-
|
|
101
|
-
const result = await validate({}, io);
|
|
102
|
-
|
|
103
|
-
expect(io.outText()).toContain('失败');
|
|
104
|
-
expect(result).toEqual({ kind: 'fail', reason: '1 个检查点未通过: test-1' });
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it('失败原因与 message 不同时一并打出来(真因不被 message 吞)', async () => {
|
|
108
|
-
const mockCheckpoints = [
|
|
109
|
-
{ id: 'test-1', checks: [{ id: 'check-1', type: 'test' }] },
|
|
110
|
-
];
|
|
111
|
-
|
|
112
|
-
mockFs.readFile.mockResolvedValue('checkpoints content');
|
|
113
|
-
mockYaml.load.mockReturnValue({ checkpoints: mockCheckpoints });
|
|
114
|
-
|
|
115
|
-
const mockValidator = {
|
|
116
|
-
validate: jest.fn().mockResolvedValue({
|
|
117
|
-
passed: false,
|
|
118
|
-
checks: [{
|
|
119
|
-
checkId: 'check-1',
|
|
120
|
-
passed: false,
|
|
121
|
-
message: '命令执行失败: npm test(退出码 1)',
|
|
122
|
-
error: '输出末段:\nFAIL 某用例\nTests 1 failed',
|
|
123
|
-
}],
|
|
124
|
-
}),
|
|
125
|
-
};
|
|
126
|
-
(MockCheckpointValidator.getInstance as jest.Mock).mockReturnValue(mockValidator);
|
|
127
|
-
|
|
128
|
-
await validate({}, io);
|
|
129
|
-
|
|
130
|
-
expect(io.outText()).toContain('命令执行失败: npm test(退出码 1)');
|
|
131
|
-
expect(io.outText()).toContain('Tests 1 failed');
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
it('error 与 message 同文时不重复打', async () => {
|
|
135
|
-
const mockCheckpoints = [
|
|
136
|
-
{ id: 'test-1', checks: [{ id: 'check-1', type: 'test' }] },
|
|
137
|
-
];
|
|
138
|
-
|
|
139
|
-
mockFs.readFile.mockResolvedValue('checkpoints content');
|
|
140
|
-
mockYaml.load.mockReturnValue({ checkpoints: mockCheckpoints });
|
|
141
|
-
|
|
142
|
-
const mockValidator = {
|
|
143
|
-
validate: jest.fn().mockResolvedValue({
|
|
144
|
-
passed: false,
|
|
145
|
-
checks: [{ checkId: 'check-1', passed: false, message: '同一个原因', error: '同一个原因' }],
|
|
146
|
-
}),
|
|
147
|
-
};
|
|
148
|
-
(MockCheckpointValidator.getInstance as jest.Mock).mockReturnValue(mockValidator);
|
|
149
|
-
|
|
150
|
-
await validate({}, io);
|
|
151
|
-
|
|
152
|
-
const printed = io.outText().split('\n').filter(line => line.includes('同一个原因'));
|
|
153
|
-
expect(printed).toHaveLength(1);
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
it('应该在严格模式下退出', async () => {
|
|
157
|
-
const mockCheckpoints = [
|
|
158
|
-
{ id: 'test-1', checks: [{ id: 'check-1', type: 'test' }] },
|
|
159
|
-
];
|
|
160
|
-
|
|
161
|
-
mockFs.readFile.mockResolvedValue('checkpoints content');
|
|
162
|
-
mockYaml.load.mockReturnValue({ checkpoints: mockCheckpoints });
|
|
163
|
-
|
|
164
|
-
const mockValidator = {
|
|
165
|
-
validate: jest.fn().mockResolvedValue({
|
|
166
|
-
passed: false,
|
|
167
|
-
checks: [{ checkId: 'check-1', passed: false, message: 'failed' }],
|
|
168
|
-
}),
|
|
169
|
-
};
|
|
170
|
-
(MockCheckpointValidator.getInstance as jest.Mock).mockReturnValue(mockValidator);
|
|
171
|
-
|
|
172
|
-
const result = await validate({ strict: true }, io);
|
|
173
|
-
|
|
174
|
-
// 工单 23 语义:--strict 与否都是 fail;退出码映射在 bin
|
|
175
|
-
expect(result).toEqual({ kind: 'fail', reason: '1 个检查点未通过: test-1' });
|
|
176
|
-
});
|
|
177
|
-
});
|
|
178
|
-
});
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* harness acceptance 命令
|
|
3
|
-
*
|
|
4
|
-
* 验收标准门控,检查任务是否满足验收标准
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import chalk from 'chalk';
|
|
8
|
-
import * as fs from 'fs/promises';
|
|
9
|
-
import * as path from 'path';
|
|
10
|
-
import { SpecAcceptanceGate } from '../../gates/acceptance';
|
|
11
|
-
import { log, processIO, type CommandIO, type CommandResult } from '../command-contract';
|
|
12
|
-
import { reportGateDecision, reportGateError } from '../gate-command';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export interface AcceptanceOptions {
|
|
16
|
-
/** 任务 ID */
|
|
17
|
-
taskId?: string;
|
|
18
|
-
/** tasks.yml 路径 */
|
|
19
|
-
tasksPath?: string;
|
|
20
|
-
/** 项目路径 */
|
|
21
|
-
projectPath?: string;
|
|
22
|
-
/** 是否检查所有任务 */
|
|
23
|
-
checkAll?: boolean;
|
|
24
|
-
/** 是否运行 E2E 测试 */
|
|
25
|
-
runE2e?: boolean;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* 执行验收门控
|
|
30
|
-
*/
|
|
31
|
-
export async function acceptance(
|
|
32
|
-
options: AcceptanceOptions,
|
|
33
|
-
io: CommandIO = processIO,
|
|
34
|
-
): Promise<CommandResult> {
|
|
35
|
-
log(io, chalk.blue('📋 验收标准门控检查...'));
|
|
36
|
-
|
|
37
|
-
const projectPath = options.projectPath || process.cwd();
|
|
38
|
-
|
|
39
|
-
// 创建验收门控实例
|
|
40
|
-
const gate = new SpecAcceptanceGate({
|
|
41
|
-
tasksPath: options.tasksPath,
|
|
42
|
-
checkAllTasks: options.checkAll,
|
|
43
|
-
e2eTestCommand: options.runE2e ? 'npx playwright test' : undefined,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
try {
|
|
47
|
-
const decision = await gate.evaluate({
|
|
48
|
-
projectPath,
|
|
49
|
-
taskId: options.taskId,
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
return reportGateDecision(
|
|
53
|
-
io,
|
|
54
|
-
{
|
|
55
|
-
gateId: 'acceptance',
|
|
56
|
-
label: '验收标准',
|
|
57
|
-
onPass: (r) =>
|
|
58
|
-
r.details
|
|
59
|
-
? [
|
|
60
|
-
chalk.gray(` 通过项: ${r.details.checkedCriteria ?? 0}`),
|
|
61
|
-
chalk.gray(` 总项数: ${r.details.totalCriteria ?? 0}`),
|
|
62
|
-
]
|
|
63
|
-
: [],
|
|
64
|
-
onFail: (r) =>
|
|
65
|
-
r.details?.uncheckedCriteria
|
|
66
|
-
? (r.details.uncheckedCriteria as string[]).map((criteria: string) => chalk.red(` - ${criteria}`))
|
|
67
|
-
: [],
|
|
68
|
-
},
|
|
69
|
-
decision
|
|
70
|
-
);
|
|
71
|
-
} catch (error) {
|
|
72
|
-
return reportGateError(io, 'acceptance', '验收标准', error);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* 列出所有任务及其验收标准
|
|
78
|
-
*/
|
|
79
|
-
export async function listAcceptanceCriteria(
|
|
80
|
-
options: AcceptanceOptions,
|
|
81
|
-
io: CommandIO = processIO,
|
|
82
|
-
): Promise<CommandResult> {
|
|
83
|
-
log(io, chalk.blue('📋 任务验收标准列表...\n'));
|
|
84
|
-
|
|
85
|
-
const projectPath = options.projectPath || process.cwd();
|
|
86
|
-
const tasksPath = options.tasksPath || path.join(projectPath, 'tasks.yml');
|
|
87
|
-
|
|
88
|
-
try {
|
|
89
|
-
const content = await fs.readFile(tasksPath, 'utf-8');
|
|
90
|
-
const yaml = await import('js-yaml');
|
|
91
|
-
const tasks: unknown = yaml.load(content);
|
|
92
|
-
|
|
93
|
-
if (typeof tasks !== 'object' || tasks === null) {
|
|
94
|
-
log(io, chalk.yellow('⚠️ 未找到任务定义'));
|
|
95
|
-
return { kind: 'skip', reason: `未找到任务定义: ${tasksPath}` };
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
for (const [taskId, task] of Object.entries(tasks)) {
|
|
99
|
-
if (typeof task === 'object' && task !== null) {
|
|
100
|
-
log(io, chalk.cyan(`${taskId}:`));
|
|
101
|
-
const criteria = (task as { acceptanceCriteria?: unknown }).acceptanceCriteria;
|
|
102
|
-
if (Array.isArray(criteria)) {
|
|
103
|
-
criteria.forEach((c: unknown, i: number) => {
|
|
104
|
-
log(io, chalk.gray(` ${i + 1}. ${String(c)}`));
|
|
105
|
-
});
|
|
106
|
-
} else {
|
|
107
|
-
log(io, chalk.gray(' (无验收标准)'));
|
|
108
|
-
}
|
|
109
|
-
log(io);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return { kind: 'ok' };
|
|
113
|
-
} catch (error: unknown) {
|
|
114
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
115
|
-
log(io, chalk.red(`❌ 读取 tasks.yml 失败: ${message}`));
|
|
116
|
-
return { kind: 'skip', reason: `读取 tasks.yml 失败: ${message}` };
|
|
117
|
-
}
|
|
118
|
-
}
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* harness check 命令
|
|
3
|
-
*
|
|
4
|
-
* 检查约束是否满足(severity='error' 阻断 / severity='warning' 告警)
|
|
5
|
-
* 工单 23:触发条件与证据检测迁至 core/constraints/context-builder
|
|
6
|
-
* 约束集统一走 getMergedConstraintsConfig 生效集链路(preset/config 禁用)
|
|
7
|
-
* harness#88:本命令是 trace 记录器的组合根——core 不上行依赖 monitoring,
|
|
8
|
-
* 真实收集器在此经构造参数接线;#139:收集器锚根构造,trace 落点跟 --project-path 走
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import chalk from 'chalk';
|
|
12
|
-
import * as path from 'path';
|
|
13
|
-
import { ConstraintChecker } from '../../core/constraints/checker';
|
|
14
|
-
import { CONSTRAINTS } from '../../core/constraints/definitions';
|
|
15
|
-
import { getMergedConstraintsConfig } from '../../core/effective-constraints';
|
|
16
|
-
import { buildConstraintContext } from '../../core/constraints/context-builder';
|
|
17
|
-
import { createGitEvidence, type GitEvidence } from '../../core/constraints/git-evidence';
|
|
18
|
-
import { createRunEnv, type RunEnv } from '../../core/constraints/run-env';
|
|
19
|
-
import { TraceCollector } from '../../monitoring/traces';
|
|
20
|
-
import { readJsonl } from '../../utils/jsonl';
|
|
21
|
-
import { DEFAULT_TRACE_FILE, type ExecutionTrace } from '../../types/trace';
|
|
22
|
-
import type { ConstraintResult, ConstraintTrigger } from '../../types/constraint';
|
|
23
|
-
import { log, processIO, type CommandIO, type CommandResult } from '../command-contract';
|
|
24
|
-
import { fileStateIO, type StateIO } from '../state-io';
|
|
25
|
-
|
|
26
|
-
/** 证据行着色(与调用处所属结论块一致) */
|
|
27
|
-
const EVIDENCE_PAINT = {
|
|
28
|
-
red: chalk.red,
|
|
29
|
-
yellow: chalk.yellow,
|
|
30
|
-
gray: chalk.gray,
|
|
31
|
-
} as const;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* 打印 checker 的判定证据行(harness#119)
|
|
35
|
-
*
|
|
36
|
-
* 文案由 checker 自行措辞(每行自描述),CLI 只负责缩进与着色——
|
|
37
|
-
* 不在这里解释内容,否则证据形状与措辞会两头漂移。
|
|
38
|
-
* 传 id 时首行挂上约束 id(提示块里没有父级结论行可依附)。
|
|
39
|
-
*/
|
|
40
|
-
function logEvidence(
|
|
41
|
-
io: CommandIO,
|
|
42
|
-
result: ConstraintResult,
|
|
43
|
-
color: keyof typeof EVIDENCE_PAINT,
|
|
44
|
-
id?: string
|
|
45
|
-
): void {
|
|
46
|
-
const paint = EVIDENCE_PAINT[color];
|
|
47
|
-
(result.evidence ?? []).forEach((line, index) => {
|
|
48
|
-
log(io, paint(index === 0 && id ? ` - ${id}: ${line}` : ` ${line}`));
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface CheckOptions {
|
|
53
|
-
/** 预设名称;**不传 = 按项目 `.harness/config.yml` 的 preset**(CLI 不给缺省值,见 commands/definitions.ts) */
|
|
54
|
-
preset?: string;
|
|
55
|
-
/** 是否只检查暂存文件 */
|
|
56
|
-
staged: boolean;
|
|
57
|
-
/** 触发条件 */
|
|
58
|
-
trigger?: ConstraintTrigger;
|
|
59
|
-
/** 项目路径 */
|
|
60
|
-
projectPath?: string;
|
|
61
|
-
/**
|
|
62
|
-
* git 证据 adapter(非 CLI flag;#87)
|
|
63
|
-
*
|
|
64
|
-
* 缺省 = 本 run 独占一份真 git 证据。注入则与调用方共用同一证据快照,
|
|
65
|
-
* 测试据此断言"同一 run 内每条 git 命令至多执行一次"。
|
|
66
|
-
*/
|
|
67
|
-
evidence?: GitEvidence;
|
|
68
|
-
/**
|
|
69
|
-
* 运行级观察面(非 CLI flag;ADR-0023)
|
|
70
|
-
*
|
|
71
|
-
* 缺省 = 本 run 独占一份。注入则与调用方共用同一份上行数据读取,
|
|
72
|
-
* 测试据此断言「同一次运行内同一项目文件至多读一次」。
|
|
73
|
-
*/
|
|
74
|
-
runEnv?: RunEnv;
|
|
75
|
-
/**
|
|
76
|
-
* 状态文件接缝(非 CLI flag;ADR-0026)
|
|
77
|
-
*
|
|
78
|
-
* 缺省 = 真实 fs 实现(fileStateIO)。注入则 `.harness/.state.json` 的读写
|
|
79
|
-
* 走替身,测试据此不碰真文件系统。
|
|
80
|
-
*/
|
|
81
|
-
stateIO?: StateIO;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* 执行约束检查
|
|
86
|
-
*/
|
|
87
|
-
export async function check(
|
|
88
|
-
options: CheckOptions,
|
|
89
|
-
io: CommandIO = processIO,
|
|
90
|
-
): Promise<CommandResult> {
|
|
91
|
-
log(io, chalk.blue('🔍 检查约束...'));
|
|
92
|
-
log(io, chalk.gray(`预设: ${options.preset ?? '(按 config.yml,缺省 standard)'}`));
|
|
93
|
-
|
|
94
|
-
try {
|
|
95
|
-
const projectPath = options.projectPath || process.cwd();
|
|
96
|
-
// 一次 run 一份证据与观察面(#87 / ADR-0023):入口构造,沿生效集、context、checker 向下传
|
|
97
|
-
const evidence = options.evidence ?? createGitEvidence(projectPath);
|
|
98
|
-
const runEnv = options.runEnv ?? createRunEnv(projectPath);
|
|
99
|
-
const stateIO = options.stateIO ?? fileStateIO(projectPath);
|
|
100
|
-
|
|
101
|
-
// 生效约束集:内置 → preset → config.yml 禁用。
|
|
102
|
-
// --preset 仅在没有项目自定义配置时覆盖 config.yml 的 preset(工单 23 语义:
|
|
103
|
-
// 项目自定义配置优先于 CLI 预设),优先级规则收在 getMergedConstraintsConfig 一处。
|
|
104
|
-
// CLI 不给 -p 缺省值:没传 = 尊重 config.yml(ADR-0023 步骤 4.5,缺省值曾让两者不可区分)
|
|
105
|
-
const merged = getMergedConstraintsConfig(runEnv, { preset: options.preset });
|
|
106
|
-
if (merged.disabled.length > 0) {
|
|
107
|
-
log(io, chalk.gray(`已禁用约束: ${merged.disabled.join(', ')}`));
|
|
108
|
-
}
|
|
109
|
-
const unknownIds = merged.unknownIds ?? [];
|
|
110
|
-
if (unknownIds.length > 0) {
|
|
111
|
-
log(io, chalk.yellow(`⚠️ 配置中存在未知约束 id(已忽略,可清理): ${unknownIds.join(', ')}`));
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// 构建上下文(工单 23:触发条件与证据检测收敛至 core/constraints/context-builder)
|
|
115
|
-
// #87:一次 run 一份 git 证据——context-builder 与 checker 层共用同一实例
|
|
116
|
-
// ADR-0023:一次 run 一份运行级观察面——配置、源根探测、trace 证据探测全部共用同一份读取
|
|
117
|
-
const context = await buildConstraintContext({
|
|
118
|
-
projectPath: options.projectPath,
|
|
119
|
-
staged: options.staged,
|
|
120
|
-
trigger: options.trigger,
|
|
121
|
-
evidence,
|
|
122
|
-
runEnv,
|
|
123
|
-
});
|
|
124
|
-
const changedFiles = context.changedFiles ?? [];
|
|
125
|
-
if (changedFiles.length > 0) {
|
|
126
|
-
log(io, chalk.gray(`变更文件: ${changedFiles.length} 个`));
|
|
127
|
-
}
|
|
128
|
-
log(io, chalk.gray(`触发条件: ${[context.operation, ...(context.extraTriggers ?? [])].join(', ')}`));
|
|
129
|
-
|
|
130
|
-
// 执行约束检查(per-request 传 customConfig,避免单例状态污染;证据同 run 同源)
|
|
131
|
-
// trace 记录器经构造参数接线(harness#88):一次命令一个 checker 实例
|
|
132
|
-
// #139:收集器锚根构造——不传 projectPath 时 trace 会落进调用方 cwd,B 侧读不到
|
|
133
|
-
const checker = new ConstraintChecker(new TraceCollector({ projectPath }));
|
|
134
|
-
const result = await checker.checkConstraints(context, merged, evidence, runEnv);
|
|
135
|
-
|
|
136
|
-
// 输出结果
|
|
137
|
-
log(io);
|
|
138
|
-
|
|
139
|
-
// skipped(约定未采用/证据未接线)单独列示,不进 pass/fail 统计
|
|
140
|
-
const skippedResults = [
|
|
141
|
-
...result.errors,
|
|
142
|
-
...result.warnings,
|
|
143
|
-
].filter(r => r.skipped);
|
|
144
|
-
|
|
145
|
-
// severity='error'(违规即阻断)
|
|
146
|
-
const evaluatedErrors = result.errors.filter(r => !r.skipped);
|
|
147
|
-
const errorViolations = evaluatedErrors.filter(r => !r.satisfied);
|
|
148
|
-
if (errorViolations.length === 0 && evaluatedErrors.length > 0) {
|
|
149
|
-
log(io, chalk.green(`✅ error 级约束: 全部通过 (${evaluatedErrors.length} 条)`));
|
|
150
|
-
} else if (errorViolations.length > 0) {
|
|
151
|
-
log(io, chalk.red(`❌ error 级约束违规: ${errorViolations.length} 条`));
|
|
152
|
-
errorViolations.forEach(r => {
|
|
153
|
-
if (r.constraint) {
|
|
154
|
-
log(io, chalk.red(` - ${r.constraint.id}: ${r.constraint.message}`));
|
|
155
|
-
log(io, chalk.red(` ${r.constraint.rule}`));
|
|
156
|
-
logEvidence(io, r, 'red');
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
log(io);
|
|
160
|
-
log(io, chalk.red('🛑 error 级约束检查失败,请修复后再提交'));
|
|
161
|
-
return {
|
|
162
|
-
kind: 'fail',
|
|
163
|
-
reason: `error-severity constraint violated: ${errorViolations.map(r => r.constraint?.id ?? 'unknown').join(', ')}`,
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// severity='warning'(告警不阻断)
|
|
168
|
-
if (result.warningCount > 0) {
|
|
169
|
-
log(io, chalk.yellow(`⚠️ warning 级约束警告: ${result.warningCount} 条`));
|
|
170
|
-
result.warnings.filter(r => !r.satisfied).forEach(r => {
|
|
171
|
-
if (r.constraint) {
|
|
172
|
-
log(io, chalk.yellow(` - ${r.constraint.id}: ${r.constraint.message}`));
|
|
173
|
-
logEvidence(io, r, 'yellow');
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
} else if (result.warnings.length > 0) {
|
|
177
|
-
const evaluatedWarnings = result.warnings.filter(r => !r.skipped);
|
|
178
|
-
const passedWarnings = evaluatedWarnings.filter(r => r.satisfied).length;
|
|
179
|
-
log(io, chalk.green(`✅ warning 级约束: ${passedWarnings}/${evaluatedWarnings.length} 通过`));
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// 提示:通过但带证据(harness#119)——与本次变更无因果的仓库级漂移在此露出,
|
|
183
|
-
// 不判违规、不改 exit code,只保证「看得见且能自己修」
|
|
184
|
-
const hints = [...result.errors, ...result.warnings].filter(
|
|
185
|
-
r => !r.skipped && r.satisfied && (r.evidence?.length ?? 0) > 0
|
|
186
|
-
);
|
|
187
|
-
if (hints.length > 0) {
|
|
188
|
-
log(io, chalk.gray(`💡 提示: ${hints.length} 条(不判违规,供参考)`));
|
|
189
|
-
hints.forEach(r => logEvidence(io, r, 'gray', r.id));
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// Skipped:约定未采用 / 证据未接线 / 输入不可得,未评估(不计通过/失败;harness#182 起原因随行列出)
|
|
193
|
-
if (skippedResults.length > 0) {
|
|
194
|
-
log(io, chalk.gray(`⏭️ 跳过评估: ${skippedResults.length} 条(未评估,不计通过/失败)`));
|
|
195
|
-
skippedResults.forEach(r => {
|
|
196
|
-
log(io, chalk.gray(` - ${r.id}${r.skipReason ? `:${r.skipReason}` : ''}`));
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
log(io);
|
|
201
|
-
log(io, chalk.green('✅ 约束检查通过'));
|
|
202
|
-
|
|
203
|
-
// 智能提示
|
|
204
|
-
const hint = await getSmartHint(projectPath, stateIO);
|
|
205
|
-
if (hint) {
|
|
206
|
-
log(io);
|
|
207
|
-
log(io, chalk.gray('────────────────────────────────────'));
|
|
208
|
-
log(io, hint);
|
|
209
|
-
log(io, chalk.gray('────────────────────────────────────'));
|
|
210
|
-
}
|
|
211
|
-
return { kind: 'ok' };
|
|
212
|
-
} catch (error) {
|
|
213
|
-
log(io);
|
|
214
|
-
log(io, chalk.red(`❌ 约束检查异常: ${error instanceof Error ? error.message : String(error)}`));
|
|
215
|
-
return { kind: 'fail', reason: `check error: ${error instanceof Error ? error.message : String(error)}` };
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
/** 智能提示阈值:trace 累计条数首次达到此数才提示跑 status(判定只要「够不够」,不要总数) */
|
|
220
|
-
const TRACE_HINT_THRESHOLD = 50;
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* 智能提示:检查是否需要提示用户下一步操作
|
|
224
|
-
*
|
|
225
|
-
* 状态读写经 StateIO(ADR-0026):读-改-写,`status` 不再把 `shownHints` 抹掉,
|
|
226
|
-
* 「首次达到阈值」的去重自此真生效。
|
|
227
|
-
*/
|
|
228
|
-
async function getSmartHint(projectPath: string, stateIO: StateIO): Promise<string | null> {
|
|
229
|
-
const tracesPath = path.join(projectPath, DEFAULT_TRACE_FILE);
|
|
230
|
-
|
|
231
|
-
// 只读够 TRACE_HINT_THRESHOLD 行即停(坏行照旧占位,条数口径与改前的纯计数逐字一致)——
|
|
232
|
-
// traces.log 是 append-only 无上限文件,为一个比较符整读不成立
|
|
233
|
-
// 计数去向:豁免(harness#100)——本消费面只输出「够不够」的提示行,没有可挂坏行计数的输出位
|
|
234
|
-
const { records, skippedLines } = readJsonl<ExecutionTrace>(tracesPath, 'skip', {
|
|
235
|
-
head: TRACE_HINT_THRESHOLD,
|
|
236
|
-
});
|
|
237
|
-
const traceCount = records.length + skippedLines;
|
|
238
|
-
if (traceCount === 0) {
|
|
239
|
-
return null;
|
|
240
|
-
}
|
|
241
|
-
// 读取状态(经接缝;文件缺失 → {})
|
|
242
|
-
const state = stateIO.read();
|
|
243
|
-
state.shownHints = state.shownHints || [];
|
|
244
|
-
|
|
245
|
-
const hints: string[] = [];
|
|
246
|
-
|
|
247
|
-
// 条件 1: 记录数首次达到阈值
|
|
248
|
-
if (traceCount >= TRACE_HINT_THRESHOLD && !state.shownHints.includes('trace_50')) {
|
|
249
|
-
hints.push('📊 记录已足够,运行 harness status 查看统计');
|
|
250
|
-
state.shownHints.push('trace_50');
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// 保存状态
|
|
254
|
-
if (hints.length > 0) {
|
|
255
|
-
stateIO.write(state);
|
|
256
|
-
return hints.join('\n');
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
return null;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* 列出所有约束(按 severity 分组)
|
|
264
|
-
*/
|
|
265
|
-
/** optionRoutes 一律以 (options) 调用;--list 不消费检查选项,形参仅占位 */
|
|
266
|
-
export function listLaws(_options: Partial<CheckOptions> = {}, io: CommandIO = processIO): CommandResult {
|
|
267
|
-
log(io, chalk.blue('\n📜 所有约束:\n'));
|
|
268
|
-
|
|
269
|
-
const groups: Array<{ severity: 'error' | 'warning'; heading: string; paint: (s: string) => string }> = [
|
|
270
|
-
{ severity: 'error', heading: '🔴 error 级 - 违规即阻断,无例外:', paint: chalk.red },
|
|
271
|
-
{ severity: 'warning', heading: '🟡 warning 级 - 违规发警告但不阻止:', paint: chalk.yellow },
|
|
272
|
-
];
|
|
273
|
-
for (const group of groups) {
|
|
274
|
-
log(io, group.paint(group.heading + '\n'));
|
|
275
|
-
Object.values(CONSTRAINTS)
|
|
276
|
-
.filter(c => c.severity === group.severity)
|
|
277
|
-
.forEach(constraint => {
|
|
278
|
-
log(io, group.paint(` ${constraint.id}`));
|
|
279
|
-
log(io, chalk.gray(` ${constraint.rule}`));
|
|
280
|
-
log(io, chalk.gray(` ${constraint.message}`));
|
|
281
|
-
log(io);
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
return { kind: 'ok' };
|
|
285
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 命令黑名单检查
|
|
3
|
-
*
|
|
4
|
-
* 用法:
|
|
5
|
-
* harness command "rm -rf /"
|
|
6
|
-
* harness command --level "DROP TABLE users"
|
|
7
|
-
* harness command --list
|
|
8
|
-
*
|
|
9
|
-
* 判定经返回值外溢(架构评审候选7):风险等级/黑名单裁决译成 kind,
|
|
10
|
-
* 退出码映射收敛在 bin 一处。
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { createCommandGate, DEFAULT_COMMAND_BLACKLIST } from '../../gates/command';
|
|
14
|
-
import type { CommandBlacklistRule } from '../../types/gate';
|
|
15
|
-
import { log, logError, processIO, type CommandIO, type CommandResult } from '../command-contract';
|
|
16
|
-
import { gateCommandResult } from '../gate-command';
|
|
17
|
-
|
|
18
|
-
export interface CommandCheckOptions {
|
|
19
|
-
level?: boolean;
|
|
20
|
-
list?: boolean;
|
|
21
|
-
json?: boolean;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* 执行命令黑名单检查(供 bin/harness.js 调用)
|
|
26
|
-
*/
|
|
27
|
-
export async function executeCommand(
|
|
28
|
-
cmd: string | undefined,
|
|
29
|
-
options: CommandCheckOptions,
|
|
30
|
-
io: CommandIO = processIO,
|
|
31
|
-
): Promise<CommandResult> {
|
|
32
|
-
if (options.list) {
|
|
33
|
-
if (options.json) {
|
|
34
|
-
log(io, JSON.stringify(DEFAULT_COMMAND_BLACKLIST.map((r: CommandBlacklistRule) => ({
|
|
35
|
-
id: r.id,
|
|
36
|
-
level: r.level,
|
|
37
|
-
message: r.message,
|
|
38
|
-
category: r.category,
|
|
39
|
-
})), null, 2));
|
|
40
|
-
} else {
|
|
41
|
-
log(io, '\n命令黑名单规则:\n');
|
|
42
|
-
|
|
43
|
-
const byCategory = DEFAULT_COMMAND_BLACKLIST.reduce((acc: Record<string, CommandBlacklistRule[]>, rule: CommandBlacklistRule) => {
|
|
44
|
-
if (!acc[rule.category]) acc[rule.category] = [];
|
|
45
|
-
acc[rule.category].push(rule);
|
|
46
|
-
return acc;
|
|
47
|
-
}, {});
|
|
48
|
-
|
|
49
|
-
for (const [category, rules] of Object.entries(byCategory)) {
|
|
50
|
-
log(io, `[${category}]`);
|
|
51
|
-
for (const rule of rules as CommandBlacklistRule[]) {
|
|
52
|
-
const levelIcon = rule.level === 'block' ? '🚫' : rule.level === 'warn' ? '⚠️' : '📋';
|
|
53
|
-
log(io, ` ${levelIcon} ${rule.id}: ${rule.message} (${rule.level})`);
|
|
54
|
-
}
|
|
55
|
-
log(io);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
log(io, `共 ${DEFAULT_COMMAND_BLACKLIST.length} 条规则`);
|
|
59
|
-
}
|
|
60
|
-
return { kind: 'ok' };
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (!cmd) {
|
|
64
|
-
logError(io, '错误:请提供要检查的命令');
|
|
65
|
-
logError(io, '用法:harness command "your command"');
|
|
66
|
-
return { kind: 'usage-error', reason: '缺少要检查的命令参数' };
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const gate = createCommandGate();
|
|
70
|
-
// 命令门禁只判命令串、不读项目根;GateContext 仍要求项目根——本命令无 -p 旗帜,取真实 cwd
|
|
71
|
-
const decision = await gate.evaluate({ projectPath: process.cwd(), command: cmd });
|
|
72
|
-
const result = decision.result;
|
|
73
|
-
|
|
74
|
-
if (options.level) {
|
|
75
|
-
// 等级取自本命令创建的这台实例:与默认分支同一来源,配置不再中途丢失(#135)
|
|
76
|
-
const level = gate.getRiskLevel(cmd);
|
|
77
|
-
if (options.json) {
|
|
78
|
-
log(io, JSON.stringify({ level, command: cmd }));
|
|
79
|
-
} else {
|
|
80
|
-
const levelColors: Record<string, string> = {
|
|
81
|
-
high: '\x1b[31m',
|
|
82
|
-
medium: '\x1b[33m',
|
|
83
|
-
low: '\x1b[32m',
|
|
84
|
-
};
|
|
85
|
-
log(io, `${levelColors[level]}${level}\x1b[0m ${cmd}`);
|
|
86
|
-
}
|
|
87
|
-
// 严重级闸门(历史条件式):high → 非零退出
|
|
88
|
-
return level === 'high'
|
|
89
|
-
? { kind: 'fail', reason: `command risk level is high: ${cmd}` }
|
|
90
|
-
: { kind: 'ok' };
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (options.json) {
|
|
94
|
-
log(io, JSON.stringify({
|
|
95
|
-
command: cmd,
|
|
96
|
-
passed: result.passed,
|
|
97
|
-
message: result.message,
|
|
98
|
-
details: result.details,
|
|
99
|
-
}, null, 2));
|
|
100
|
-
} else {
|
|
101
|
-
log(io, result.passed ? `\x1b[32m✓\x1b[0m ${result.message}` : `\x1b[31m✗\x1b[0m ${result.message}`);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return gateCommandResult('command', decision);
|
|
105
|
-
}
|