@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,392 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spec 验证器
|
|
3
|
-
*
|
|
4
|
-
* 框架提供验证机制,项目定义自己的 Spec Schema
|
|
5
|
-
*
|
|
6
|
-
* 设计原则:
|
|
7
|
-
* - 框架不包含具体 Schema 定义
|
|
8
|
-
* - 动态加载项目的 Schema
|
|
9
|
-
* - 支持 Zod / JSON Schema / 自定义验证器
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import * as fs from 'fs/promises';
|
|
13
|
-
import * as path from 'path';
|
|
14
|
-
import * as glob from 'fast-glob';
|
|
15
|
-
import { createGitEvidence, splitFileNames, type GitCommandRunner } from '../constraints/git-evidence';
|
|
16
|
-
import type {
|
|
17
|
-
SpecValidatorConfig,
|
|
18
|
-
SpecValidationResult,
|
|
19
|
-
BatchSpecValidationResult,
|
|
20
|
-
SpecSchemaDefinition,
|
|
21
|
-
SpecType,
|
|
22
|
-
SpecValidationError,
|
|
23
|
-
} from '../../types/spec';
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* 默认配置
|
|
27
|
-
*/
|
|
28
|
-
const DEFAULT_CONFIG: SpecValidatorConfig = {
|
|
29
|
-
enabled: true,
|
|
30
|
-
schemaPath: './specs/schemas',
|
|
31
|
-
files: ['ARCHITECTURE.md', 'specs/**/*.yml', 'specs/**/*.yaml'],
|
|
32
|
-
failureLevel: 'error',
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* 动态导入的 Schema 模块形状守卫:只认「带 validate 函数的对象」,
|
|
37
|
-
* name/version 是否合法字符串由调用点各自窄化(坏形状按「无 Schema」处理,不 any 穿透)
|
|
38
|
-
*/
|
|
39
|
-
function isSchemaModule(m: unknown): m is { name?: unknown; version?: unknown; validate: SpecSchemaDefinition['validate'] } {
|
|
40
|
-
return (
|
|
41
|
-
typeof m === 'object' &&
|
|
42
|
-
m !== null &&
|
|
43
|
-
'validate' in m &&
|
|
44
|
-
typeof (m as { validate?: unknown }).validate === 'function'
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Spec 验证器
|
|
50
|
-
*/
|
|
51
|
-
export class SpecValidator {
|
|
52
|
-
private static instance: SpecValidator;
|
|
53
|
-
private config: SpecValidatorConfig;
|
|
54
|
-
private schemaCache: Map<string, SpecSchemaDefinition> = new Map();
|
|
55
|
-
|
|
56
|
-
private constructor(config?: Partial<SpecValidatorConfig>) {
|
|
57
|
-
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* 获取单例实例
|
|
62
|
-
*/
|
|
63
|
-
static getInstance(config?: Partial<SpecValidatorConfig>): SpecValidator {
|
|
64
|
-
if (!SpecValidator.instance) {
|
|
65
|
-
SpecValidator.instance = new SpecValidator(config);
|
|
66
|
-
}
|
|
67
|
-
return SpecValidator.instance;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* 更新配置
|
|
72
|
-
*/
|
|
73
|
-
setConfig(config: Partial<SpecValidatorConfig>): void {
|
|
74
|
-
this.config = { ...this.config, ...config };
|
|
75
|
-
this.schemaCache.clear();
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* 加载项目的 Schema
|
|
80
|
-
*
|
|
81
|
-
* 支持两种方式:
|
|
82
|
-
* 1. 指定 schemaPath 目录,自动加载 index.ts/js
|
|
83
|
-
* 2. 使用 --schema 参数指定路径
|
|
84
|
-
*/
|
|
85
|
-
async loadSchema(schemaPath: string): Promise<SpecSchemaDefinition | null> {
|
|
86
|
-
const cached = this.schemaCache.get(schemaPath);
|
|
87
|
-
if (cached) return cached;
|
|
88
|
-
|
|
89
|
-
const absolutePath = path.resolve(schemaPath);
|
|
90
|
-
|
|
91
|
-
// 无自定义 Schema 是正常情况(三个候选都不在场 → null);
|
|
92
|
-
// 候选在场但加载/解析失败 → 抛出(fail-fast:坏 Schema 不装成「没有 Schema」)
|
|
93
|
-
const indexPath = path.join(absolutePath, 'index.ts');
|
|
94
|
-
const indexPathJs = path.join(absolutePath, 'index.js');
|
|
95
|
-
|
|
96
|
-
let schemaModule: unknown;
|
|
97
|
-
|
|
98
|
-
if (await this.fileExists(indexPath)) {
|
|
99
|
-
// 动态导入 TypeScript 模块(需要 tsx 或编译后的 .js)
|
|
100
|
-
schemaModule = await this.dynamicImport(indexPath);
|
|
101
|
-
} else if (await this.fileExists(indexPathJs)) {
|
|
102
|
-
schemaModule = await this.dynamicImport(indexPathJs);
|
|
103
|
-
} else if (await this.fileExists(absolutePath)) {
|
|
104
|
-
// 尝试直接加载指定文件
|
|
105
|
-
schemaModule = await this.dynamicImport(absolutePath);
|
|
106
|
-
} else {
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (isSchemaModule(schemaModule)) {
|
|
111
|
-
const schema: SpecSchemaDefinition = {
|
|
112
|
-
name: typeof schemaModule.name === 'string' ? schemaModule.name : 'custom',
|
|
113
|
-
version: typeof schemaModule.version === 'string' ? schemaModule.version : undefined,
|
|
114
|
-
validate: schemaModule.validate,
|
|
115
|
-
};
|
|
116
|
-
this.schemaCache.set(schemaPath, schema);
|
|
117
|
-
return schema;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* 检测 Spec 类型
|
|
125
|
-
*/
|
|
126
|
-
detectSpecType(filePath: string): SpecType {
|
|
127
|
-
const basename = path.basename(filePath).toLowerCase();
|
|
128
|
-
|
|
129
|
-
if (basename === 'architecture.md') {
|
|
130
|
-
return 'architecture';
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (filePath.includes('module') || filePath.includes('modules')) {
|
|
134
|
-
return 'module';
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
if (filePath.includes('api') || filePath.includes('apis')) {
|
|
138
|
-
return 'api';
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return 'custom';
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* 验证单个文件
|
|
146
|
-
*/
|
|
147
|
-
async validateFile(
|
|
148
|
-
filePath: string,
|
|
149
|
-
schema?: SpecSchemaDefinition
|
|
150
|
-
): Promise<SpecValidationResult> {
|
|
151
|
-
const specType = this.detectSpecType(filePath);
|
|
152
|
-
const absolutePath = path.resolve(filePath);
|
|
153
|
-
|
|
154
|
-
// 检查文件是否存在
|
|
155
|
-
if (!(await this.fileExists(absolutePath))) {
|
|
156
|
-
return {
|
|
157
|
-
valid: false,
|
|
158
|
-
file: filePath,
|
|
159
|
-
type: specType,
|
|
160
|
-
errors: [{ path: '', message: `文件不存在: ${filePath}`, severity: 'error' }],
|
|
161
|
-
warnings: [],
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// 如果没有传入 Schema,尝试加载项目的 Schema
|
|
166
|
-
let schemaToUse = schema;
|
|
167
|
-
if (!schemaToUse) {
|
|
168
|
-
const loadedSchema = await this.loadSchema(this.config.schemaPath);
|
|
169
|
-
schemaToUse = loadedSchema ?? undefined;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// 如果没有 Schema,使用基础验证
|
|
173
|
-
if (!schemaToUse) {
|
|
174
|
-
return this.basicValidation(filePath, specType);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// 使用项目的 Schema 验证
|
|
178
|
-
try {
|
|
179
|
-
const content = await fs.readFile(absolutePath, 'utf-8');
|
|
180
|
-
const result = await schemaToUse.validate(content, filePath);
|
|
181
|
-
return result;
|
|
182
|
-
} catch (error) {
|
|
183
|
-
return {
|
|
184
|
-
valid: false,
|
|
185
|
-
file: filePath,
|
|
186
|
-
type: specType,
|
|
187
|
-
errors: [{
|
|
188
|
-
path: '',
|
|
189
|
-
message: `验证失败: ${error instanceof Error ? error.message : String(error)}`,
|
|
190
|
-
severity: 'error',
|
|
191
|
-
}],
|
|
192
|
-
warnings: [],
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* 基础验证(无 Schema 时)
|
|
199
|
-
*/
|
|
200
|
-
private async basicValidation(filePath: string, specType: SpecType): Promise<SpecValidationResult> {
|
|
201
|
-
const absolutePath = path.resolve(filePath);
|
|
202
|
-
const content = await fs.readFile(absolutePath, 'utf-8');
|
|
203
|
-
const errors: SpecValidationError[] = [];
|
|
204
|
-
const warnings: SpecValidationError[] = [];
|
|
205
|
-
|
|
206
|
-
// ARCHITECTURE.md 基础检查
|
|
207
|
-
if (specType === 'architecture') {
|
|
208
|
-
if (!content.includes('# ') && !content.includes('## ')) {
|
|
209
|
-
errors.push({
|
|
210
|
-
path: '',
|
|
211
|
-
message: 'ARCHITECTURE.md 应包含标题和章节',
|
|
212
|
-
severity: 'warning' as const,
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// YAML 文件基础检查
|
|
218
|
-
if (filePath.endsWith('.yml') || filePath.endsWith('.yaml')) {
|
|
219
|
-
try {
|
|
220
|
-
const yaml = await import('js-yaml');
|
|
221
|
-
yaml.load(content);
|
|
222
|
-
} catch (e) {
|
|
223
|
-
errors.push({
|
|
224
|
-
path: '',
|
|
225
|
-
message: `YAML 解析失败: ${e instanceof Error ? e.message : String(e)}`,
|
|
226
|
-
severity: 'error' as const,
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
return {
|
|
232
|
-
valid: errors.length === 0,
|
|
233
|
-
file: filePath,
|
|
234
|
-
type: specType,
|
|
235
|
-
errors,
|
|
236
|
-
warnings,
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* 批量验证
|
|
242
|
-
*/
|
|
243
|
-
async validateAll(
|
|
244
|
-
projectPath?: string,
|
|
245
|
-
staged?: boolean
|
|
246
|
-
): Promise<BatchSpecValidationResult> {
|
|
247
|
-
const cwd = projectPath || process.cwd();
|
|
248
|
-
const results: SpecValidationResult[] = [];
|
|
249
|
-
|
|
250
|
-
// 加载项目的 Schema
|
|
251
|
-
const loadedSchema = await this.loadSchema(this.config.schemaPath);
|
|
252
|
-
const schema = loadedSchema ?? undefined;
|
|
253
|
-
|
|
254
|
-
// 获取要验证的文件
|
|
255
|
-
let files: string[];
|
|
256
|
-
|
|
257
|
-
if (staged) {
|
|
258
|
-
files = await this.getStagedFiles(cwd);
|
|
259
|
-
} else {
|
|
260
|
-
files = await this.getSpecFiles(cwd);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
// 过滤只保留 Spec 相关文件
|
|
264
|
-
const specFiles = files.filter(f => this.isSpecFile(f));
|
|
265
|
-
|
|
266
|
-
// 验证每个文件
|
|
267
|
-
for (const file of specFiles) {
|
|
268
|
-
const result = await this.validateFile(file, schema);
|
|
269
|
-
results.push(result);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
// 统计结果
|
|
273
|
-
const passed = results.filter(r => r.valid).length;
|
|
274
|
-
const failed = results.filter(r => !r.valid).length;
|
|
275
|
-
const warnings = results.reduce((sum, r) => sum + r.warnings.length, 0);
|
|
276
|
-
|
|
277
|
-
return {
|
|
278
|
-
total: specFiles.length,
|
|
279
|
-
passed,
|
|
280
|
-
failed,
|
|
281
|
-
warnings,
|
|
282
|
-
results,
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* 获取 Spec 文件
|
|
288
|
-
*/
|
|
289
|
-
private async getSpecFiles(cwd: string): Promise<string[]> {
|
|
290
|
-
const allFiles: string[] = [];
|
|
291
|
-
|
|
292
|
-
for (const pattern of this.config.files) {
|
|
293
|
-
const files = await glob.glob(pattern, {
|
|
294
|
-
cwd,
|
|
295
|
-
absolute: true,
|
|
296
|
-
ignore: ['node_modules/**', 'dist/**', '.git/**'],
|
|
297
|
-
});
|
|
298
|
-
allFiles.push(...files);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
return [...new Set(allFiles)];
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* 获取暂存的 Spec 文件
|
|
306
|
-
*
|
|
307
|
-
* git 事实经 GitEvidence adapter(ADR-0021);`run` 缺省真 git,测试注入替身。
|
|
308
|
-
*/
|
|
309
|
-
private async getStagedFiles(cwd: string, run?: GitCommandRunner): Promise<string[]> {
|
|
310
|
-
const evidence = createGitEvidence(cwd, run);
|
|
311
|
-
return splitFileNames(evidence.changedFileNames(true))
|
|
312
|
-
.filter(f => this.isSpecFile(f))
|
|
313
|
-
.map(f => path.resolve(cwd, f));
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* 判断是否为 Spec 文件
|
|
318
|
-
*/
|
|
319
|
-
private isSpecFile(filePath: string): boolean {
|
|
320
|
-
const basename = path.basename(filePath).toLowerCase();
|
|
321
|
-
|
|
322
|
-
// ARCHITECTURE.md
|
|
323
|
-
if (basename === 'architecture.md') return true;
|
|
324
|
-
|
|
325
|
-
// specs 目录下的文件
|
|
326
|
-
if (filePath.includes('specs/') || filePath.includes('spec/')) return true;
|
|
327
|
-
|
|
328
|
-
// 符合配置的文件模式
|
|
329
|
-
for (const pattern of this.config.files) {
|
|
330
|
-
if (pattern.startsWith('specs/')) {
|
|
331
|
-
// 检查路径是否匹配
|
|
332
|
-
if (filePath.includes('/specs/')) return true;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
return false;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* 检查文件是否存在
|
|
341
|
-
*/
|
|
342
|
-
private async fileExists(filePath: string): Promise<boolean> {
|
|
343
|
-
try {
|
|
344
|
-
await fs.access(filePath);
|
|
345
|
-
return true;
|
|
346
|
-
} catch {
|
|
347
|
-
return false;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* 动态导入模块(fail-fast:导入失败抛出;唯一回退 = .ts 导入失败试编译后的同名 .js)
|
|
353
|
-
*/
|
|
354
|
-
private async dynamicImport(modulePath: string): Promise<unknown> {
|
|
355
|
-
try {
|
|
356
|
-
// 尝试直接导入
|
|
357
|
-
return await import(modulePath);
|
|
358
|
-
} catch (err) {
|
|
359
|
-
// 如果是 TypeScript 文件,尝试加载编译后的 JS
|
|
360
|
-
if (modulePath.endsWith('.ts')) {
|
|
361
|
-
const jsPath = modulePath.replace(/\.ts$/, '.js');
|
|
362
|
-
if (await this.fileExists(jsPath)) {
|
|
363
|
-
return import(jsPath);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
throw err;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* 便捷函数
|
|
373
|
-
*/
|
|
374
|
-
export async function validateSpec(
|
|
375
|
-
filePath: string,
|
|
376
|
-
schemaPath?: string
|
|
377
|
-
): Promise<SpecValidationResult> {
|
|
378
|
-
const validator = SpecValidator.getInstance();
|
|
379
|
-
if (schemaPath) {
|
|
380
|
-
const loadedSchema = await validator.loadSchema(schemaPath);
|
|
381
|
-
return validator.validateFile(filePath, loadedSchema ?? undefined);
|
|
382
|
-
}
|
|
383
|
-
return validator.validateFile(filePath);
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
export async function validateAllSpecs(
|
|
387
|
-
projectPath?: string,
|
|
388
|
-
staged?: boolean
|
|
389
|
-
): Promise<BatchSpecValidationResult> {
|
|
390
|
-
const validator = SpecValidator.getInstance();
|
|
391
|
-
return validator.validateAll(projectPath, staged);
|
|
392
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* command_success 判据与输出体量解耦(回归钉)
|
|
3
|
-
*
|
|
4
|
-
* 旧实现走 exec(缺省 maxBuffer 1MiB):被测命令输出超线即被砍进程并报
|
|
5
|
-
* `stdout maxBuffer length exceeded`,于是**跑成功的命令被判失败**,且 message 只剩
|
|
6
|
-
* 「命令执行失败: <command>」看不见真因。现场:消费方仓全量测试 1.16MiB stdout 撞此坑,
|
|
7
|
-
* pre-push 钩子连烧 10 轮全量测试。判成败只看退出码,输出只回带有界末段。
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { describe, it, expect } from '@jest/globals';
|
|
11
|
-
import { checkCommandSuccess } from '../check-handlers/command';
|
|
12
|
-
import type { CheckpointCheck, CheckpointContext } from '../../../types/checkpoint';
|
|
13
|
-
|
|
14
|
-
function check(command: string): CheckpointCheck {
|
|
15
|
-
return { id: 'c-1', type: 'command_success', config: { command } } as CheckpointCheck;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const context = { workdir: process.cwd(), projectPath: process.cwd() } as CheckpointContext;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* 写 n 字节到 stdout 后按 code 退出(0 = 成功命令的常态:又吵又绿)。
|
|
22
|
-
* 用 exitCode 而非 process.exit():后者对管道写入不 flush 缓冲,末段会被截掉。
|
|
23
|
-
*/
|
|
24
|
-
function loudExit(code: number, mb: number, marker = ''): string {
|
|
25
|
-
return `node -e 'process.stdout.write("a".repeat(${mb * 1024 * 1024}));process.stdout.write("${marker}");process.exitCode=${code}'`;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
describe('command_success 不被输出体量左右', () => {
|
|
29
|
-
it('输出 2MiB 且退出 0 → 通过(旧实现在此判失败)', async () => {
|
|
30
|
-
const result = await checkCommandSuccess(check(loudExit(0, 2)), context);
|
|
31
|
-
|
|
32
|
-
expect(result.passed).toBe(true);
|
|
33
|
-
expect(result.message).toBe('命令执行成功: ' + loudExit(0, 2));
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('输出 3MiB 且退出 1 → 失败,message 带退出码', async () => {
|
|
37
|
-
const command = loudExit(1, 3, 'FAIL_SUMMARY_TAIL');
|
|
38
|
-
const result = await checkCommandSuccess(check(command), context);
|
|
39
|
-
|
|
40
|
-
expect(result.passed).toBe(false);
|
|
41
|
-
expect(result.message).toContain('退出码 1');
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('失败时回带输出末段,且体积有界(不缓冲全量)', async () => {
|
|
45
|
-
const result = await checkCommandSuccess(check(loudExit(1, 3, 'LAST_LINE_SUMMARY')), context);
|
|
46
|
-
|
|
47
|
-
expect(result.error).toContain('LAST_LINE_SUMMARY');
|
|
48
|
-
expect(result.error!.length).toBeLessThan(8192);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('命令不存在 → 失败但不抛(exit 路径归一)', async () => {
|
|
52
|
-
const result = await checkCommandSuccess(check('definitely-not-a-command-xyzzy'), context);
|
|
53
|
-
|
|
54
|
-
expect(result.passed).toBe(false);
|
|
55
|
-
});
|
|
56
|
-
});
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* http 检查项的重试退避等待注入(工单 #136)
|
|
3
|
-
*
|
|
4
|
-
* 退避等待经 CheckpointContext.sleep 注入后,重试语义(尝试次数、退避序列)由记录
|
|
5
|
-
* 替身钉住,不再靠真 sleep 证明;未注入的缺省路径同时钉住「走真定时器、序列不变」。
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { describe, it, expect, afterEach, jest } from '@jest/globals';
|
|
9
|
-
import { CheckpointValidator } from '../checkpoint';
|
|
10
|
-
import { checkHttpBody, checkHttpStatus } from '../check-handlers/http';
|
|
11
|
-
import type { CheckConfig, CheckType } from '../../../types/checkpoint';
|
|
12
|
-
import type { CheckpointCheck, CheckpointContext } from '../../../types/checkpoint';
|
|
13
|
-
|
|
14
|
-
const realFetch = globalThis.fetch;
|
|
15
|
-
|
|
16
|
-
afterEach(() => {
|
|
17
|
-
globalThis.fetch = realFetch;
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
function makeContext(overrides: Partial<CheckpointContext> = {}): CheckpointContext {
|
|
21
|
-
return { projectPath: process.cwd(), workdir: process.cwd(), ...overrides };
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function makeCheck(id: string, type: CheckType, config: CheckConfig): CheckpointCheck {
|
|
25
|
-
return { id, type, config };
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
type InjectedSleep = NonNullable<CheckpointContext['sleep']>;
|
|
29
|
-
|
|
30
|
-
/** 记录型零等待替身:记下每次退避请求的毫秒数 */
|
|
31
|
-
function recordingSleep(): { waits: number[]; sleep: InjectedSleep } {
|
|
32
|
-
const waits: number[] = [];
|
|
33
|
-
const sleep: InjectedSleep = async (ms: number) => {
|
|
34
|
-
waits.push(ms);
|
|
35
|
-
};
|
|
36
|
-
return { waits, sleep };
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** 按脚本依次出牌的 fetch 替身:条目耗尽后重复最后一张;返回调用记录 */
|
|
40
|
-
function scriptedFetch(script: Array<number | Error>): string[] {
|
|
41
|
-
const calls: string[] = [];
|
|
42
|
-
globalThis.fetch = (async (url: string | URL) => {
|
|
43
|
-
calls.push(String(url));
|
|
44
|
-
const next = script[Math.min(calls.length - 1, script.length - 1)];
|
|
45
|
-
if (next instanceof Error) throw next;
|
|
46
|
-
return new Response(null, { status: next });
|
|
47
|
-
}) as unknown as typeof fetch;
|
|
48
|
-
return calls;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const URL_OK = 'https://example.com';
|
|
52
|
-
|
|
53
|
-
describe('http_status 重试退避(注入 sleep)', () => {
|
|
54
|
-
it('fetch 持续抛错:尝试 4 次、退避 2000/4000/6000、全程零真等待', async () => {
|
|
55
|
-
const { waits, sleep } = recordingSleep();
|
|
56
|
-
const calls = scriptedFetch([new Error('Network error')]);
|
|
57
|
-
|
|
58
|
-
const startedAt = Date.now();
|
|
59
|
-
const result = await checkHttpStatus(
|
|
60
|
-
makeCheck('c-reject', 'http_status', { url: URL_OK, expectedStatus: 200 }),
|
|
61
|
-
makeContext({ sleep })
|
|
62
|
-
);
|
|
63
|
-
const elapsed = Date.now() - startedAt;
|
|
64
|
-
|
|
65
|
-
expect(elapsed).toBeLessThan(2000);
|
|
66
|
-
expect(calls).toHaveLength(4);
|
|
67
|
-
expect(waits).toEqual([2000, 4000, 6000]);
|
|
68
|
-
expect(result.passed).toBe(false);
|
|
69
|
-
expect(result.message).toContain('请求失败');
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('5xx 后恢复:尝试 2 次、只退避一次 2000', async () => {
|
|
73
|
-
const { waits, sleep } = recordingSleep();
|
|
74
|
-
const calls = scriptedFetch([503, 200]);
|
|
75
|
-
|
|
76
|
-
const result = await checkHttpStatus(
|
|
77
|
-
makeCheck('c-503', 'http_status', { url: URL_OK, expectedStatus: 200 }),
|
|
78
|
-
makeContext({ sleep })
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
expect(calls).toHaveLength(2);
|
|
82
|
-
expect(waits).toEqual([2000]);
|
|
83
|
-
expect(result.passed).toBe(true);
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
it('429 后恢复:尝试 2 次、只退避一次 2000', async () => {
|
|
87
|
-
const { waits, sleep } = recordingSleep();
|
|
88
|
-
const calls = scriptedFetch([429, 200]);
|
|
89
|
-
|
|
90
|
-
const result = await checkHttpStatus(
|
|
91
|
-
makeCheck('c-429', 'http_status', { url: URL_OK, expectedStatus: 200 }),
|
|
92
|
-
makeContext({ sleep })
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
expect(calls).toHaveLength(2);
|
|
96
|
-
expect(waits).toEqual([2000]);
|
|
97
|
-
expect(result.passed).toBe(true);
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('5xx 不恢复:退避用尽后返回最后响应,判状态码不匹配', async () => {
|
|
101
|
-
const { waits, sleep } = recordingSleep();
|
|
102
|
-
const calls = scriptedFetch([500]);
|
|
103
|
-
|
|
104
|
-
const result = await checkHttpStatus(
|
|
105
|
-
makeCheck('c-500', 'http_status', { url: URL_OK, expectedStatus: 200 }),
|
|
106
|
-
makeContext({ sleep })
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
expect(calls).toHaveLength(4);
|
|
110
|
-
expect(waits).toEqual([2000, 4000, 6000]);
|
|
111
|
-
expect(result.passed).toBe(false);
|
|
112
|
-
expect(result.actual).toBe(500);
|
|
113
|
-
expect(result.message).toContain('不匹配');
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it('404 非可重试状态码:只尝试 1 次、零退避', async () => {
|
|
117
|
-
const { waits, sleep } = recordingSleep();
|
|
118
|
-
const calls = scriptedFetch([404]);
|
|
119
|
-
|
|
120
|
-
const result = await checkHttpStatus(
|
|
121
|
-
makeCheck('c-404', 'http_status', { url: URL_OK, expectedStatus: 200 }),
|
|
122
|
-
makeContext({ sleep })
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
expect(calls).toHaveLength(1);
|
|
126
|
-
expect(waits).toEqual([]);
|
|
127
|
-
expect(result.passed).toBe(false);
|
|
128
|
-
expect(result.message).toContain('不匹配');
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
it('首次即成功:不产生任何退避', async () => {
|
|
132
|
-
const { waits, sleep } = recordingSleep();
|
|
133
|
-
const calls = scriptedFetch([200]);
|
|
134
|
-
|
|
135
|
-
const result = await checkHttpStatus(
|
|
136
|
-
makeCheck('c-200', 'http_status', { url: URL_OK, expectedStatus: 200 }),
|
|
137
|
-
makeContext({ sleep })
|
|
138
|
-
);
|
|
139
|
-
|
|
140
|
-
expect(calls).toHaveLength(1);
|
|
141
|
-
expect(waits).toEqual([]);
|
|
142
|
-
expect(result.passed).toBe(true);
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
describe('http_body 重试退避(注入 sleep)', () => {
|
|
147
|
-
it('fetch 持续抛错:尝试 4 次、退避 2000/4000/6000、全程零真等待', async () => {
|
|
148
|
-
const { waits, sleep } = recordingSleep();
|
|
149
|
-
const calls = scriptedFetch([new Error('Network error')]);
|
|
150
|
-
|
|
151
|
-
const startedAt = Date.now();
|
|
152
|
-
const result = await checkHttpBody(
|
|
153
|
-
makeCheck('c-body-reject', 'http_body', { url: URL_OK, expected: 'test' }),
|
|
154
|
-
makeContext({ sleep })
|
|
155
|
-
);
|
|
156
|
-
const elapsed = Date.now() - startedAt;
|
|
157
|
-
|
|
158
|
-
expect(elapsed).toBeLessThan(2000);
|
|
159
|
-
expect(calls).toHaveLength(4);
|
|
160
|
-
expect(waits).toEqual([2000, 4000, 6000]);
|
|
161
|
-
expect(result.passed).toBe(false);
|
|
162
|
-
expect(result.message).toContain('请求失败');
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
it('响应体不含期望值:不重试、只尝试 1 次', async () => {
|
|
166
|
-
const { waits, sleep } = recordingSleep();
|
|
167
|
-
globalThis.fetch = (async () => new Response('{"data": "test"}', { status: 200 })) as unknown as typeof fetch;
|
|
168
|
-
|
|
169
|
-
const result = await checkHttpBody(
|
|
170
|
-
makeCheck('c-body-miss', 'http_body', { url: URL_OK, expected: 'NONEXISTENT' }),
|
|
171
|
-
makeContext({ sleep })
|
|
172
|
-
);
|
|
173
|
-
|
|
174
|
-
expect(waits).toEqual([]);
|
|
175
|
-
expect(result.passed).toBe(false);
|
|
176
|
-
expect(result.message).toContain('不包含');
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
describe('未注入 sleep 的缺省路径(生产行为逐字不变)', () => {
|
|
181
|
-
it('退避仍走真 setTimeout,且序列为 2000/4000/6000', async () => {
|
|
182
|
-
// 替身把 setTimeout 改成同步触发:缺省路径的「真定时器 + 退避毫秒数」一并钉住且不真等
|
|
183
|
-
// (AbortSignal.timeout 走 Node 内部计时器、不经 globalThis.setTimeout,实测收不到干扰)
|
|
184
|
-
const delays: number[] = [];
|
|
185
|
-
const spy = jest.spyOn(globalThis, 'setTimeout').mockImplementation((
|
|
186
|
-
(callback: (...args: unknown[]) => void, ms?: number) => {
|
|
187
|
-
delays.push(ms ?? 0);
|
|
188
|
-
callback();
|
|
189
|
-
return 0 as unknown as ReturnType<typeof setTimeout>;
|
|
190
|
-
}
|
|
191
|
-
) as unknown as typeof setTimeout);
|
|
192
|
-
|
|
193
|
-
try {
|
|
194
|
-
const calls = scriptedFetch([new Error('Network error')]);
|
|
195
|
-
const startedAt = Date.now();
|
|
196
|
-
const result = await checkHttpStatus(
|
|
197
|
-
makeCheck('c-default', 'http_status', { url: URL_OK, expectedStatus: 200 }),
|
|
198
|
-
makeContext()
|
|
199
|
-
);
|
|
200
|
-
const elapsed = Date.now() - startedAt;
|
|
201
|
-
|
|
202
|
-
expect(calls).toHaveLength(4);
|
|
203
|
-
expect(delays).toEqual([2000, 4000, 6000]);
|
|
204
|
-
expect(elapsed).toBeLessThan(2000);
|
|
205
|
-
expect(result.passed).toBe(false);
|
|
206
|
-
expect(result.message).toContain('请求失败');
|
|
207
|
-
} finally {
|
|
208
|
-
spy.mockRestore();
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
describe('CheckpointValidator → http handler 的 context 接线', () => {
|
|
214
|
-
it('validate() 传入的 sleep 抵达 handler:重试全程零真等待', async () => {
|
|
215
|
-
const { waits, sleep } = recordingSleep();
|
|
216
|
-
const calls = scriptedFetch([new Error('Network error')]);
|
|
217
|
-
|
|
218
|
-
const result = await CheckpointValidator.getInstance().validate(
|
|
219
|
-
{
|
|
220
|
-
id: 'cp-wiring',
|
|
221
|
-
checks: [makeCheck('c-wiring', 'http_status', { url: URL_OK, expectedStatus: 200 })],
|
|
222
|
-
},
|
|
223
|
-
makeContext({ sleep })
|
|
224
|
-
);
|
|
225
|
-
|
|
226
|
-
expect(calls).toHaveLength(4);
|
|
227
|
-
expect(waits).toEqual([2000, 4000, 6000]);
|
|
228
|
-
expect(result.passed).toBe(false);
|
|
229
|
-
expect(result.checks[0].message).toContain('请求失败');
|
|
230
|
-
});
|
|
231
|
-
});
|