@dommaker/harness 1.16.0 → 3.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/CHANGELOG.md +35 -0
- package/README.md +7 -7
- package/dist/agents/index.d.ts +1 -2
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/lifecycle.d.ts +2 -34
- package/dist/agents/lifecycle.d.ts.map +1 -1
- package/dist/agents/lifecycle.js +1 -103
- package/dist/agents/lifecycle.js.map +1 -1
- package/dist/agents/types.d.ts +1 -19
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/{hooks → bootstrap}/bootstrap.d.ts +9 -3
- package/dist/bootstrap/bootstrap.d.ts.map +1 -0
- package/dist/{hooks → bootstrap}/bootstrap.js +26 -30
- package/dist/bootstrap/bootstrap.js.map +1 -0
- package/dist/{hooks → bootstrap}/index.d.ts +3 -2
- package/dist/bootstrap/index.d.ts.map +1 -0
- package/dist/{hooks → bootstrap}/index.js +3 -2
- package/dist/bootstrap/index.js.map +1 -0
- package/dist/cli/command-contract.d.ts +6 -9
- package/dist/cli/command-contract.d.ts.map +1 -1
- package/dist/cli/command-contract.js +6 -0
- package/dist/cli/command-contract.js.map +1 -1
- package/dist/cli/commands/acceptance.d.ts.map +1 -1
- package/dist/cli/commands/acceptance.js +9 -8
- package/dist/cli/commands/acceptance.js.map +1 -1
- package/dist/cli/commands/check.d.ts +1 -1
- package/dist/cli/commands/check.d.ts.map +1 -1
- package/dist/cli/commands/check.js +12 -5
- package/dist/cli/commands/check.js.map +1 -1
- package/dist/cli/commands/command.d.ts.map +1 -1
- package/dist/cli/commands/command.js +9 -5
- package/dist/cli/commands/command.js.map +1 -1
- package/dist/cli/commands/constraints-pack-proposal.d.ts.map +1 -1
- package/dist/cli/commands/constraints-pack-proposal.js +11 -8
- package/dist/cli/commands/constraints-pack-proposal.js.map +1 -1
- package/dist/cli/commands/constraints-reactivate.d.ts +10 -2
- package/dist/cli/commands/constraints-reactivate.d.ts.map +1 -1
- package/dist/cli/commands/constraints-reactivate.js +2 -6
- package/dist/cli/commands/constraints-reactivate.js.map +1 -1
- package/dist/cli/commands/constraints-retire.d.ts +23 -5
- package/dist/cli/commands/constraints-retire.d.ts.map +1 -1
- package/dist/cli/commands/constraints-retire.js +19 -9
- package/dist/cli/commands/constraints-retire.js.map +1 -1
- package/dist/cli/commands/contract.d.ts.map +1 -1
- package/dist/cli/commands/contract.js +24 -16
- package/dist/cli/commands/contract.js.map +1 -1
- package/dist/cli/commands/definitions.d.ts +2 -73
- package/dist/cli/commands/definitions.d.ts.map +1 -1
- package/dist/cli/commands/definitions.js +13 -17
- package/dist/cli/commands/definitions.js.map +1 -1
- package/dist/cli/commands/failure.d.ts.map +1 -1
- package/dist/cli/commands/failure.js +5 -6
- package/dist/cli/commands/failure.js.map +1 -1
- package/dist/cli/commands/init/ci-platform.d.ts +35 -0
- package/dist/cli/commands/init/ci-platform.d.ts.map +1 -0
- package/dist/cli/commands/init/ci-platform.js +59 -0
- package/dist/cli/commands/init/ci-platform.js.map +1 -0
- package/dist/cli/commands/init/ci-wiring.d.ts +20 -0
- package/dist/cli/commands/init/ci-wiring.d.ts.map +1 -0
- package/dist/cli/commands/init/ci-wiring.js +72 -0
- package/dist/cli/commands/init/ci-wiring.js.map +1 -0
- package/dist/cli/commands/init/git-hooks.d.ts +15 -0
- package/dist/cli/commands/init/git-hooks.d.ts.map +1 -0
- package/dist/cli/commands/init/git-hooks.js +64 -0
- package/dist/cli/commands/init/git-hooks.js.map +1 -0
- package/dist/cli/commands/init/governance.d.ts +14 -0
- package/dist/cli/commands/init/governance.d.ts.map +1 -0
- package/dist/cli/commands/init/governance.js +132 -0
- package/dist/cli/commands/init/governance.js.map +1 -0
- package/dist/cli/commands/{init.d.ts → init/index.d.ts} +13 -14
- package/dist/cli/commands/init/index.d.ts.map +1 -0
- package/dist/cli/commands/init/index.js +148 -0
- package/dist/cli/commands/init/index.js.map +1 -0
- package/dist/cli/commands/init/output-style.d.ts +19 -0
- package/dist/cli/commands/init/output-style.d.ts.map +1 -0
- package/dist/cli/commands/init/output-style.js +110 -0
- package/dist/cli/commands/init/output-style.js.map +1 -0
- package/dist/cli/commands/init/presets.d.ts +26 -0
- package/dist/cli/commands/init/presets.d.ts.map +1 -0
- package/dist/cli/commands/init/presets.js +104 -0
- package/dist/cli/commands/init/presets.js.map +1 -0
- package/dist/cli/commands/init/snippets.d.ts +18 -0
- package/dist/cli/commands/init/snippets.d.ts.map +1 -0
- package/dist/cli/commands/init/snippets.js +49 -0
- package/dist/cli/commands/init/snippets.js.map +1 -0
- package/dist/cli/commands/knowledge/audit.d.ts +30 -0
- package/dist/cli/commands/knowledge/audit.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/audit.js +114 -0
- package/dist/cli/commands/knowledge/audit.js.map +1 -0
- package/dist/cli/commands/knowledge/decay.d.ts +19 -0
- package/dist/cli/commands/knowledge/decay.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/decay.js +48 -0
- package/dist/cli/commands/knowledge/decay.js.map +1 -0
- package/dist/cli/commands/knowledge/health.d.ts +38 -0
- package/dist/cli/commands/knowledge/health.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/health.js +178 -0
- package/dist/cli/commands/knowledge/health.js.map +1 -0
- package/dist/cli/commands/knowledge/import.d.ts +26 -0
- package/dist/cli/commands/knowledge/import.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/import.js +63 -0
- package/dist/cli/commands/knowledge/import.js.map +1 -0
- package/dist/cli/commands/knowledge/index.d.ts +25 -0
- package/dist/cli/commands/knowledge/index.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/index.js +84 -0
- package/dist/cli/commands/knowledge/index.js.map +1 -0
- package/dist/cli/commands/knowledge/list.d.ts +25 -0
- package/dist/cli/commands/knowledge/list.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/list.js +60 -0
- package/dist/cli/commands/knowledge/list.js.map +1 -0
- package/dist/cli/commands/knowledge/search.d.ts +32 -0
- package/dist/cli/commands/knowledge/search.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/search.js +72 -0
- package/dist/cli/commands/knowledge/search.js.map +1 -0
- package/dist/cli/commands/knowledge/shared.d.ts +14 -0
- package/dist/cli/commands/knowledge/shared.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/shared.js +6 -0
- package/dist/cli/commands/knowledge/shared.js.map +1 -0
- package/dist/cli/commands/knowledge/snapshot.d.ts +18 -0
- package/dist/cli/commands/knowledge/snapshot.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/snapshot.js +34 -0
- package/dist/cli/commands/knowledge/snapshot.js.map +1 -0
- package/dist/cli/commands/knowledge/stats.d.ts +26 -0
- package/dist/cli/commands/knowledge/stats.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/stats.js +132 -0
- package/dist/cli/commands/knowledge/stats.js.map +1 -0
- package/dist/cli/commands/knowledge/store-access.d.ts +25 -0
- package/dist/cli/commands/knowledge/store-access.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/store-access.js +69 -0
- package/dist/cli/commands/knowledge/store-access.js.map +1 -0
- package/dist/cli/commands/knowledge-view.d.ts +8 -19
- package/dist/cli/commands/knowledge-view.d.ts.map +1 -1
- package/dist/cli/commands/knowledge-view.js +12 -63
- package/dist/cli/commands/knowledge-view.js.map +1 -1
- package/dist/cli/commands/passes-gate.d.ts.map +1 -1
- package/dist/cli/commands/passes-gate.js +19 -8
- package/dist/cli/commands/passes-gate.js.map +1 -1
- package/dist/cli/commands/performance.js.map +1 -1
- package/dist/cli/commands/release.d.ts +1 -1
- package/dist/cli/commands/release.d.ts.map +1 -1
- package/dist/cli/commands/release.js +25 -59
- package/dist/cli/commands/release.js.map +1 -1
- package/dist/cli/commands/review.d.ts.map +1 -1
- package/dist/cli/commands/review.js +17 -5
- package/dist/cli/commands/review.js.map +1 -1
- package/dist/cli/commands/security.d.ts.map +1 -1
- package/dist/cli/commands/security.js +13 -8
- package/dist/cli/commands/security.js.map +1 -1
- package/dist/{core → cli/commands}/spec/validator.d.ts +10 -19
- package/dist/cli/commands/spec/validator.d.ts.map +1 -0
- package/dist/{core → cli/commands}/spec/validator.js +52 -78
- package/dist/cli/commands/spec/validator.js.map +1 -0
- package/dist/cli/commands/spec-baseline-check.d.ts +8 -41
- package/dist/cli/commands/spec-baseline-check.d.ts.map +1 -1
- package/dist/cli/commands/spec-baseline-check.js +32 -238
- package/dist/cli/commands/spec-baseline-check.js.map +1 -1
- package/dist/cli/commands/spec.d.ts +1 -1
- package/dist/cli/commands/spec.d.ts.map +1 -1
- package/dist/cli/commands/spec.js +14 -11
- package/dist/cli/commands/spec.js.map +1 -1
- package/dist/cli/commands/status.d.ts +0 -2
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +2 -2
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/sync-docs/agents-syncer.js +31 -55
- package/dist/cli/commands/sync-docs/agents-syncer.js.map +1 -1
- package/dist/cli/commands/sync-docs/capabilities-syncer.d.ts +1 -1
- package/dist/cli/commands/sync-docs/capabilities-syncer.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/capabilities-syncer.js +13 -13
- package/dist/cli/commands/sync-docs/capabilities-syncer.js.map +1 -1
- package/dist/cli/commands/sync-docs/compact.d.ts +9 -0
- package/dist/cli/commands/sync-docs/compact.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/compact.js +73 -0
- package/dist/cli/commands/sync-docs/compact.js.map +1 -0
- package/dist/cli/commands/sync-docs/context-syncer.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/context-syncer.js +17 -36
- package/dist/cli/commands/sync-docs/context-syncer.js.map +1 -1
- package/dist/cli/commands/sync-docs/gate.d.ts +27 -0
- package/dist/cli/commands/sync-docs/gate.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/gate.js +72 -0
- package/dist/cli/commands/sync-docs/gate.js.map +1 -0
- package/dist/cli/commands/sync-docs/index.d.ts +13 -27
- package/dist/cli/commands/sync-docs/index.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/index.js +19 -529
- package/dist/cli/commands/sync-docs/index.js.map +1 -1
- package/dist/cli/commands/sync-docs/main-flow.d.ts +21 -0
- package/dist/cli/commands/sync-docs/main-flow.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/main-flow.js +93 -0
- package/dist/cli/commands/sync-docs/main-flow.js.map +1 -0
- package/dist/cli/commands/sync-docs/project-reader.d.ts +1 -1
- package/dist/cli/commands/sync-docs/project-reader.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/project-reader.js +18 -26
- package/dist/cli/commands/sync-docs/project-reader.js.map +1 -1
- package/dist/cli/commands/sync-docs/sync-output.d.ts +15 -0
- package/dist/cli/commands/sync-docs/sync-output.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/sync-output.js +217 -0
- package/dist/cli/commands/sync-docs/sync-output.js.map +1 -0
- package/dist/cli/commands/sync-docs/sync-state.d.ts +71 -0
- package/dist/cli/commands/sync-docs/sync-state.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/sync-state.js +274 -0
- package/dist/cli/commands/sync-docs/sync-state.js.map +1 -0
- package/dist/cli/commands/sync-docs/sync-writes.d.ts +12 -0
- package/dist/cli/commands/sync-docs/sync-writes.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/sync-writes.js +72 -0
- package/dist/cli/commands/sync-docs/sync-writes.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +0 -2
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/commands/validate.js +13 -6
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/gate-command.d.ts +1 -1
- package/dist/cli/gate-command.d.ts.map +1 -1
- package/dist/context/index.d.ts +2 -4
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +2 -5
- package/dist/context/index.js.map +1 -1
- package/dist/context/session-manager.d.ts +2 -6
- package/dist/context/session-manager.d.ts.map +1 -1
- package/dist/context/session-manager.js +27 -84
- package/dist/context/session-manager.js.map +1 -1
- package/dist/context/types.d.ts +3 -25
- package/dist/context/types.d.ts.map +1 -1
- package/dist/context/types.js +2 -1
- package/dist/context/types.js.map +1 -1
- package/dist/core/app-constraints-loader.d.ts +1 -1
- package/dist/core/app-constraints-loader.d.ts.map +1 -1
- package/dist/core/app-constraints-loader.js +6 -23
- package/dist/core/app-constraints-loader.js.map +1 -1
- package/dist/core/constraint-lifecycle.d.ts +3 -8
- package/dist/core/constraint-lifecycle.d.ts.map +1 -1
- package/dist/core/constraint-lifecycle.js +27 -31
- package/dist/core/constraint-lifecycle.js.map +1 -1
- package/dist/core/constraints/capabilities-parser.d.ts +2 -1
- package/dist/core/constraints/capabilities-parser.d.ts.map +1 -1
- package/dist/core/constraints/capabilities-parser.js +4 -6
- package/dist/core/constraints/capabilities-parser.js.map +1 -1
- package/dist/core/constraints/check-cache.d.ts +4 -43
- package/dist/core/constraints/check-cache.d.ts.map +1 -1
- package/dist/core/constraints/check-cache.js +6 -51
- package/dist/core/constraints/check-cache.js.map +1 -1
- package/dist/core/constraints/checker.d.ts +0 -16
- package/dist/core/constraints/checker.d.ts.map +1 -1
- package/dist/core/constraints/checker.js +23 -64
- package/dist/core/constraints/checker.js.map +1 -1
- package/dist/core/constraints/checkers/capability-sync.js +3 -3
- package/dist/core/constraints/checkers/capability-sync.js.map +1 -1
- package/dist/core/constraints/checkers/context-doc-sync.js +2 -2
- package/dist/core/constraints/checkers/context-doc-sync.js.map +1 -1
- package/dist/core/constraints/checkers/docs-freshness.js +5 -5
- package/dist/core/constraints/checkers/docs-freshness.js.map +1 -1
- package/dist/core/constraints/checkers/index.d.ts +17 -3
- package/dist/core/constraints/checkers/index.d.ts.map +1 -1
- package/dist/core/constraints/checkers/index.js +22 -10
- package/dist/core/constraints/checkers/index.js.map +1 -1
- package/dist/core/constraints/checkers/no-hardcoded-credentials.d.ts.map +1 -1
- package/dist/core/constraints/checkers/no-hardcoded-credentials.js +5 -34
- package/dist/core/constraints/checkers/no-hardcoded-credentials.js.map +1 -1
- package/dist/core/constraints/checkers/no-test-simplification.d.ts.map +1 -1
- package/dist/core/constraints/checkers/no-test-simplification.js +11 -33
- package/dist/core/constraints/checkers/no-test-simplification.js.map +1 -1
- package/dist/core/constraints/checkers/templated/exec.d.ts.map +1 -1
- package/dist/core/constraints/checkers/templated/exec.js +4 -8
- package/dist/core/constraints/checkers/templated/exec.js.map +1 -1
- package/dist/core/constraints/checkers/templated/file-exists.js +1 -1
- package/dist/core/constraints/checkers/templated/file-exists.js.map +1 -1
- package/dist/core/constraints/checkers/templated/regex-scan.d.ts.map +1 -1
- package/dist/core/constraints/checkers/templated/regex-scan.js +8 -26
- package/dist/core/constraints/checkers/templated/regex-scan.js.map +1 -1
- package/dist/core/constraints/checkers/types.d.ts +10 -33
- package/dist/core/constraints/checkers/types.d.ts.map +1 -1
- package/dist/core/constraints/checkers/types.js +6 -46
- package/dist/core/constraints/checkers/types.js.map +1 -1
- package/dist/core/constraints/context-builder.d.ts +8 -26
- package/dist/core/constraints/context-builder.d.ts.map +1 -1
- package/dist/core/constraints/context-builder.js +9 -102
- package/dist/core/constraints/context-builder.js.map +1 -1
- package/dist/core/constraints/definitions/{iron-laws.d.ts → errors.d.ts} +1 -2
- package/dist/core/constraints/definitions/errors.d.ts.map +1 -0
- package/dist/core/constraints/definitions/{iron-laws.js → errors.js} +1 -21
- package/dist/core/constraints/definitions/errors.js.map +1 -0
- package/dist/core/constraints/definitions/{guidelines.d.ts → warnings.d.ts} +1 -2
- package/dist/core/constraints/definitions/warnings.d.ts.map +1 -0
- package/dist/core/constraints/definitions/{guidelines.js → warnings.js} +18 -5
- package/dist/core/constraints/definitions/warnings.js.map +1 -0
- package/dist/core/constraints/definitions.d.ts +2 -1
- package/dist/core/constraints/definitions.d.ts.map +1 -1
- package/dist/core/constraints/definitions.js +6 -5
- package/dist/core/constraints/definitions.js.map +1 -1
- package/dist/core/constraints/doc-freshness/runner.d.ts +0 -9
- package/dist/core/constraints/doc-freshness/runner.d.ts.map +1 -1
- package/dist/core/constraints/doc-freshness/runner.js +192 -224
- package/dist/core/constraints/doc-freshness/runner.js.map +1 -1
- package/dist/core/constraints/find-constraint.d.ts +14 -0
- package/dist/core/constraints/find-constraint.d.ts.map +1 -0
- package/dist/core/constraints/find-constraint.js +25 -0
- package/dist/core/constraints/find-constraint.js.map +1 -0
- package/dist/core/constraints/git-evidence.d.ts.map +1 -1
- package/dist/core/constraints/git-evidence.js +2 -0
- package/dist/core/constraints/git-evidence.js.map +1 -1
- package/dist/core/constraints/governance-accessors.d.ts +54 -0
- package/dist/core/constraints/governance-accessors.d.ts.map +1 -0
- package/dist/core/constraints/governance-accessors.js +62 -0
- package/dist/core/constraints/governance-accessors.js.map +1 -0
- package/dist/core/constraints/index.d.ts +4 -4
- package/dist/core/constraints/index.d.ts.map +1 -1
- package/dist/core/constraints/index.js +1 -4
- package/dist/core/constraints/index.js.map +1 -1
- package/dist/core/constraints/injection-writer.d.ts +1 -0
- package/dist/core/constraints/injection-writer.d.ts.map +1 -1
- package/dist/core/constraints/injection-writer.js +3 -6
- package/dist/core/constraints/injection-writer.js.map +1 -1
- package/dist/core/constraints/pack-proposal.d.ts.map +1 -1
- package/dist/core/constraints/pack-proposal.js +3 -14
- package/dist/core/constraints/pack-proposal.js.map +1 -1
- package/dist/core/constraints/run-env.d.ts +1 -13
- package/dist/core/constraints/run-env.d.ts.map +1 -1
- package/dist/core/constraints/run-env.js +2 -23
- package/dist/core/constraints/run-env.js.map +1 -1
- package/dist/core/constraints/triggers.d.ts +10 -6
- package/dist/core/constraints/triggers.d.ts.map +1 -1
- package/dist/core/constraints/triggers.js +11 -5
- package/dist/core/constraints/triggers.js.map +1 -1
- package/dist/core/constraints/usage-report.d.ts +0 -6
- package/dist/core/constraints/usage-report.d.ts.map +1 -1
- package/dist/core/constraints/usage-report.js +0 -9
- package/dist/core/constraints/usage-report.js.map +1 -1
- package/dist/core/index.d.ts +5 -4
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +7 -8
- package/dist/core/index.js.map +1 -1
- package/dist/core/project-config-loader.d.ts +5 -41
- package/dist/core/project-config-loader.d.ts.map +1 -1
- package/dist/core/project-config-loader.js +4 -49
- package/dist/core/project-config-loader.js.map +1 -1
- package/dist/core/spec/baseline-check.d.ts +54 -0
- package/dist/core/spec/baseline-check.d.ts.map +1 -0
- package/dist/core/spec/baseline-check.js +261 -0
- package/dist/core/spec/baseline-check.js.map +1 -0
- package/dist/core/validators/check-handlers/command.d.ts.map +1 -1
- package/dist/core/validators/check-handlers/command.js +7 -4
- package/dist/core/validators/check-handlers/command.js.map +1 -1
- package/dist/core/validators/check-handlers/file.d.ts.map +1 -1
- package/dist/core/validators/check-handlers/file.js +49 -5
- package/dist/core/validators/check-handlers/file.js.map +1 -1
- package/dist/core/validators/check-handlers/http.d.ts.map +1 -1
- package/dist/core/validators/check-handlers/http.js +6 -4
- package/dist/core/validators/check-handlers/http.js.map +1 -1
- package/dist/core/validators/check-handlers/output.d.ts +1 -1
- package/dist/core/validators/check-handlers/output.d.ts.map +1 -1
- package/dist/core/validators/check-handlers/output.js +2 -1
- package/dist/core/validators/check-handlers/output.js.map +1 -1
- package/dist/core/validators/checkpoint.d.ts +5 -13
- package/dist/core/validators/checkpoint.d.ts.map +1 -1
- package/dist/core/validators/checkpoint.js +53 -80
- package/dist/core/validators/checkpoint.js.map +1 -1
- package/dist/core/validators/cso.d.ts +1 -4
- package/dist/core/validators/cso.d.ts.map +1 -1
- package/dist/core/validators/cso.js +1 -9
- package/dist/core/validators/cso.js.map +1 -1
- package/dist/core/validators/passes-gate.d.ts +2 -5
- package/dist/core/validators/passes-gate.d.ts.map +1 -1
- package/dist/core/validators/passes-gate.js +21 -35
- package/dist/core/validators/passes-gate.js.map +1 -1
- package/dist/failure/classifier.d.ts +2 -21
- package/dist/failure/classifier.d.ts.map +1 -1
- package/dist/failure/classifier.js +7 -42
- package/dist/failure/classifier.js.map +1 -1
- package/dist/failure/error-types.d.ts +48 -0
- package/dist/failure/error-types.d.ts.map +1 -0
- package/dist/failure/error-types.js +122 -0
- package/dist/failure/error-types.js.map +1 -0
- package/dist/failure/index.d.ts +4 -3
- package/dist/failure/index.d.ts.map +1 -1
- package/dist/failure/index.js +8 -10
- package/dist/failure/index.js.map +1 -1
- package/dist/failure/recorder.d.ts +7 -27
- package/dist/failure/recorder.d.ts.map +1 -1
- package/dist/failure/recorder.js +11 -64
- package/dist/failure/recorder.js.map +1 -1
- package/dist/gates/acceptance.d.ts +43 -19
- package/dist/gates/acceptance.d.ts.map +1 -1
- package/dist/gates/acceptance.js +148 -122
- package/dist/gates/acceptance.js.map +1 -1
- package/dist/gates/command.d.ts +1 -17
- package/dist/gates/command.d.ts.map +1 -1
- package/dist/gates/command.js +0 -29
- package/dist/gates/command.js.map +1 -1
- package/dist/gates/contract.d.ts +11 -10
- package/dist/gates/contract.d.ts.map +1 -1
- package/dist/gates/contract.js +55 -74
- package/dist/gates/contract.js.map +1 -1
- package/dist/gates/definitions.d.ts +1 -1
- package/dist/gates/performance.d.ts +2 -16
- package/dist/gates/performance.d.ts.map +1 -1
- package/dist/gates/performance.js +18 -27
- package/dist/gates/performance.js.map +1 -1
- package/dist/gates/registry.d.ts.map +1 -1
- package/dist/gates/registry.js +3 -2
- package/dist/gates/registry.js.map +1 -1
- package/dist/gates/review.d.ts +1 -9
- package/dist/gates/review.d.ts.map +1 -1
- package/dist/gates/review.js +38 -21
- package/dist/gates/review.js.map +1 -1
- package/dist/gates/security.d.ts +6 -9
- package/dist/gates/security.d.ts.map +1 -1
- package/dist/gates/security.js +42 -76
- package/dist/gates/security.js.map +1 -1
- package/dist/gates/types.d.ts +11 -78
- package/dist/gates/types.d.ts.map +1 -1
- package/dist/gates/types.js +5 -1
- package/dist/gates/types.js.map +1 -1
- package/dist/index.d.ts +20 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -18
- package/dist/index.js.map +1 -1
- package/dist/knowledge/audit-dimensions.d.ts +45 -0
- package/dist/knowledge/audit-dimensions.d.ts.map +1 -0
- package/dist/knowledge/audit-dimensions.js +144 -0
- package/dist/knowledge/audit-dimensions.js.map +1 -0
- package/dist/knowledge/audit-rules.d.ts +43 -0
- package/dist/knowledge/audit-rules.d.ts.map +1 -0
- package/dist/knowledge/audit-rules.js +272 -0
- package/dist/knowledge/audit-rules.js.map +1 -0
- package/dist/knowledge/audit-scoring.d.ts +6 -60
- package/dist/knowledge/audit-scoring.d.ts.map +1 -1
- package/dist/knowledge/audit-scoring.js +8 -391
- package/dist/knowledge/audit-scoring.js.map +1 -1
- package/dist/knowledge/audit.d.ts +6 -3
- package/dist/knowledge/audit.d.ts.map +1 -1
- package/dist/knowledge/audit.js +12 -7
- package/dist/knowledge/audit.js.map +1 -1
- package/dist/knowledge/{import.d.ts → cold-start.d.ts} +2 -3
- package/dist/knowledge/cold-start.d.ts.map +1 -0
- package/dist/knowledge/{import.js → cold-start.js} +136 -182
- package/dist/knowledge/cold-start.js.map +1 -0
- package/dist/knowledge/index-generator.d.ts +2 -0
- package/dist/knowledge/index-generator.d.ts.map +1 -1
- package/dist/knowledge/index-generator.js +43 -50
- package/dist/knowledge/index-generator.js.map +1 -1
- package/dist/knowledge/index.d.ts +7 -7
- package/dist/knowledge/index.d.ts.map +1 -1
- package/dist/knowledge/index.js +4 -9
- package/dist/knowledge/index.js.map +1 -1
- package/dist/knowledge/ingest.d.ts +50 -6
- package/dist/knowledge/ingest.d.ts.map +1 -1
- package/dist/knowledge/ingest.js +109 -16
- package/dist/knowledge/ingest.js.map +1 -1
- package/dist/knowledge/lifecycle.d.ts +0 -5
- package/dist/knowledge/lifecycle.d.ts.map +1 -1
- package/dist/knowledge/lifecycle.js +29 -41
- package/dist/knowledge/lifecycle.js.map +1 -1
- package/dist/knowledge/query.d.ts +1 -1
- package/dist/knowledge/query.d.ts.map +1 -1
- package/dist/knowledge/query.js +8 -8
- package/dist/knowledge/query.js.map +1 -1
- package/dist/knowledge/store.d.ts +4 -7
- package/dist/knowledge/store.d.ts.map +1 -1
- package/dist/knowledge/store.js +26 -63
- package/dist/knowledge/store.js.map +1 -1
- package/dist/knowledge/types.d.ts +2 -36
- package/dist/knowledge/types.d.ts.map +1 -1
- package/dist/knowledge/types.js +2 -3
- package/dist/knowledge/types.js.map +1 -1
- package/dist/monitoring/analyzer-base.d.ts +1 -10
- package/dist/monitoring/analyzer-base.d.ts.map +1 -1
- package/dist/monitoring/analyzer-base.js +1 -58
- package/dist/monitoring/analyzer-base.js.map +1 -1
- package/dist/monitoring/trace-analyzer.d.ts +3 -54
- package/dist/monitoring/trace-analyzer.d.ts.map +1 -1
- package/dist/monitoring/trace-analyzer.js +9 -136
- package/dist/monitoring/trace-analyzer.js.map +1 -1
- package/dist/monitoring/traces.d.ts +1 -14
- package/dist/monitoring/traces.d.ts.map +1 -1
- package/dist/monitoring/traces.js +9 -29
- package/dist/monitoring/traces.js.map +1 -1
- package/dist/pretool-use-hook.d.ts +1 -1
- package/dist/pretool-use-hook.d.ts.map +1 -1
- package/dist/pretool-use-hook.js +12 -19
- package/dist/pretool-use-hook.js.map +1 -1
- package/dist/release/integrity.d.ts.map +1 -1
- package/dist/release/integrity.js +8 -8
- package/dist/release/integrity.js.map +1 -1
- package/dist/sdd/index-generator.d.ts.map +1 -1
- package/dist/sdd/index-generator.js +4 -0
- package/dist/sdd/index-generator.js.map +1 -1
- package/dist/types/checkpoint.d.ts +8 -8
- package/dist/types/checkpoint.d.ts.map +1 -1
- package/dist/types/command-definition.d.ts +81 -0
- package/dist/types/command-definition.d.ts.map +1 -0
- package/dist/types/command-definition.js +10 -0
- package/dist/types/command-definition.js.map +1 -0
- package/dist/types/command-io.d.ts +19 -0
- package/dist/types/command-io.d.ts.map +1 -0
- package/dist/types/command-io.js +3 -0
- package/dist/types/command-io.js.map +1 -0
- package/dist/types/constraint.d.ts +3 -24
- package/dist/types/constraint.d.ts.map +1 -1
- package/dist/types/constraint.js.map +1 -1
- package/dist/types/failure.d.ts +6 -39
- package/dist/types/failure.d.ts.map +1 -1
- package/dist/types/failure.js +6 -112
- package/dist/types/failure.js.map +1 -1
- package/dist/types/gate.d.ts +72 -0
- package/dist/types/gate.d.ts.map +1 -0
- package/dist/types/gate.js +13 -0
- package/dist/types/gate.js.map +1 -0
- package/dist/types/spec.d.ts +0 -4
- package/dist/types/spec.d.ts.map +1 -1
- package/dist/types/trace.d.ts +0 -4
- package/dist/types/trace.d.ts.map +1 -1
- package/dist/utils/attempt.d.ts +22 -0
- package/dist/utils/attempt.d.ts.map +1 -0
- package/dist/utils/attempt.js +40 -0
- package/dist/utils/attempt.js.map +1 -0
- package/dist/utils/clip.d.ts +8 -0
- package/dist/utils/clip.d.ts.map +1 -0
- package/dist/utils/clip.js +15 -0
- package/dist/utils/clip.js.map +1 -0
- package/dist/utils/detect-source-roots.d.ts.map +1 -1
- package/dist/utils/detect-source-roots.js +42 -51
- package/dist/utils/detect-source-roots.js.map +1 -1
- package/dist/utils/diff-parse.d.ts +31 -0
- package/dist/utils/diff-parse.d.ts.map +1 -0
- package/dist/utils/diff-parse.js +72 -0
- package/dist/utils/diff-parse.js.map +1 -0
- package/dist/utils/file-walk.d.ts +2 -1
- package/dist/utils/file-walk.d.ts.map +1 -1
- package/dist/utils/file-walk.js +3 -8
- package/dist/utils/file-walk.js.map +1 -1
- package/dist/utils/guards.d.ts +6 -0
- package/dist/utils/guards.d.ts.map +1 -0
- package/dist/utils/guards.js +11 -0
- package/dist/utils/guards.js.map +1 -0
- package/dist/utils/jsonl.d.ts +0 -12
- package/dist/utils/jsonl.d.ts.map +1 -1
- package/dist/utils/jsonl.js +0 -12
- package/dist/utils/jsonl.js.map +1 -1
- package/dist/utils/log-rotate.d.ts +14 -0
- package/dist/utils/log-rotate.d.ts.map +1 -0
- package/dist/utils/log-rotate.js +74 -0
- package/dist/utils/log-rotate.js.map +1 -0
- package/dist/utils/numeric-flag.d.ts +10 -2
- package/dist/utils/numeric-flag.d.ts.map +1 -1
- package/dist/utils/numeric-flag.js +17 -2
- package/dist/utils/numeric-flag.js.map +1 -1
- package/dist/utils/package-json.d.ts +49 -0
- package/dist/utils/package-json.d.ts.map +1 -0
- package/dist/utils/package-json.js +78 -0
- package/dist/utils/package-json.js.map +1 -0
- package/dist/utils/package-version.d.ts +5 -2
- package/dist/utils/package-version.d.ts.map +1 -1
- package/dist/utils/package-version.js +8 -11
- package/dist/utils/package-version.js.map +1 -1
- package/package.json +1 -6
- package/src/CONTEXT.md +12 -11
- package/src/__tests__/acceptance-gate.test.ts +23 -51
- package/src/__tests__/app-constraints-loader.test.ts +5 -7
- package/src/__tests__/checker-extra.test.ts +12 -80
- package/src/__tests__/checker-primitives-sdk.test.ts +3 -18
- package/src/__tests__/checker.test.ts +5 -7
- package/src/__tests__/checkpoint.test.ts +45 -59
- package/src/__tests__/context-files-resolution.test.ts +3 -2
- package/src/__tests__/contract-gate.test.ts +1 -33
- package/src/__tests__/cso-validator.test.ts +1 -9
- package/src/__tests__/effective-constraints.test.ts +1 -3
- package/src/__tests__/error-classifier.test.ts +1 -42
- package/src/__tests__/failure-recorder.test.ts +45 -114
- package/src/__tests__/install-precommit-hook.test.ts +61 -0
- package/src/__tests__/iron-laws.test.ts +14 -21
- package/src/__tests__/layering.test.ts +4 -4
- package/src/__tests__/project-config-loader.test.ts +2 -1
- package/src/__tests__/public-exports.test.ts +5 -16
- package/src/__tests__/public-type-surface.test.ts +10 -41
- package/src/__tests__/public-value-surface.test.ts +9 -20
- package/src/__tests__/review-gate.test.ts +0 -17
- package/src/__tests__/security-gate.test.ts +0 -18
- package/src/__tests__/skip-semantics.test.ts +9 -11
- package/src/__tests__/trace-analyzer-extra.test.ts +13 -129
- package/src/__tests__/trace-analyzer.test.ts +7 -7
- package/src/__tests__/trace-collector.test.ts +0 -43
- package/src/__tests__/traces.test.ts +7 -39
- package/src/agents/CONTEXT.md +2 -4
- package/src/agents/__tests__/lifecycle.test.ts +4 -155
- package/src/agents/index.ts +0 -3
- package/src/agents/lifecycle.ts +1 -116
- package/src/agents/types.ts +1 -21
- package/src/{hooks → bootstrap}/CONTEXT.md +5 -5
- package/src/{hooks → bootstrap}/bootstrap.ts +32 -39
- package/src/{hooks → bootstrap}/index.ts +3 -2
- package/src/cli/__tests__/command-contract.test.ts +18 -0
- package/src/cli/command-contract.ts +8 -5
- package/src/cli/commands/CONTEXT.md +21 -21
- package/src/cli/commands/__tests__/check-read-count.test.ts +4 -7
- package/src/cli/commands/__tests__/check-skip-output.test.ts +0 -1
- package/src/cli/commands/__tests__/check.test.ts +1 -1
- package/src/cli/commands/__tests__/command-gate-dead-options.test.ts +7 -5
- package/src/cli/commands/__tests__/constraints-pack-proposal.test.ts +0 -1
- package/src/cli/commands/__tests__/constraints-report.test.ts +2 -2
- package/src/cli/commands/__tests__/constraints-retire.test.ts +5 -3
- package/src/cli/commands/__tests__/contract.test.ts +11 -4
- package/src/cli/commands/__tests__/failure.test.ts +9 -9
- package/src/cli/commands/__tests__/init-governance-io.test.ts +7 -2
- package/src/cli/commands/__tests__/init.test.ts +1 -1
- package/src/cli/commands/__tests__/knowledge-audit-threshold.test.ts +14 -8
- package/src/cli/commands/__tests__/knowledge-flywheel-consistency.test.ts +2 -1
- package/src/cli/commands/__tests__/knowledge-view.test.ts +52 -172
- package/src/cli/commands/__tests__/knowledge.test.ts +30 -6
- package/src/cli/commands/__tests__/numeric-flag-assembly.test.ts +3 -2
- package/src/cli/commands/__tests__/passes-gate.test.ts +105 -29
- package/src/cli/commands/__tests__/project-path-anchoring.test.ts +3 -6
- package/src/cli/commands/__tests__/project-path-convention.test.ts +4 -21
- package/src/cli/commands/__tests__/registry.test.ts +5 -2
- package/src/cli/commands/__tests__/release.test.ts +25 -3
- package/src/cli/commands/__tests__/report-false-green.test.ts +10 -6
- package/src/cli/commands/__tests__/review.test.ts +20 -6
- package/src/cli/commands/__tests__/security.test.ts +14 -0
- package/src/cli/commands/__tests__/spec-baseline-read-count.test.ts +2 -2
- package/src/cli/commands/__tests__/spec.test.ts +33 -23
- package/src/cli/commands/__tests__/validate.test.ts +32 -15
- package/src/cli/commands/acceptance.ts +11 -10
- package/src/cli/commands/check.ts +12 -6
- package/src/cli/commands/command.ts +8 -7
- package/src/cli/commands/constraints-pack-proposal.ts +10 -8
- package/src/cli/commands/constraints-reactivate.ts +13 -9
- package/src/cli/commands/constraints-retire.ts +33 -12
- package/src/cli/commands/contract.ts +33 -20
- package/src/cli/commands/definitions.ts +23 -94
- package/src/cli/commands/failure.ts +7 -8
- package/src/cli/commands/init/ci-platform.ts +66 -0
- package/src/cli/commands/init/ci-wiring.ts +48 -0
- package/src/cli/commands/init/git-hooks.ts +31 -0
- package/src/cli/commands/init/governance.ts +127 -0
- package/src/cli/commands/init/index.ts +156 -0
- package/src/cli/commands/init/output-style.ts +82 -0
- package/src/cli/commands/init/presets.ts +105 -0
- package/src/cli/commands/init/snippets.ts +57 -0
- package/src/cli/commands/knowledge/audit.ts +155 -0
- package/src/cli/commands/knowledge/decay.ts +57 -0
- package/src/cli/commands/knowledge/health.ts +180 -0
- package/src/cli/commands/knowledge/import.ts +82 -0
- package/src/cli/commands/knowledge/index.ts +60 -0
- package/src/cli/commands/knowledge/list.ts +73 -0
- package/src/cli/commands/knowledge/search.ts +92 -0
- package/src/cli/commands/knowledge/shared.ts +13 -0
- package/src/cli/commands/knowledge/snapshot.ts +38 -0
- package/src/cli/commands/knowledge/stats.ts +112 -0
- package/src/cli/commands/knowledge/store-access.ts +40 -0
- package/src/cli/commands/knowledge-view.ts +11 -34
- package/src/cli/commands/passes-gate.ts +23 -10
- package/src/cli/commands/performance.ts +2 -2
- package/src/cli/commands/release.ts +26 -22
- package/src/cli/commands/review.ts +19 -7
- package/src/cli/commands/security.ts +17 -11
- package/src/{core → cli/commands}/spec/__tests__/validator.test.ts +75 -61
- package/src/{core → cli/commands}/spec/validator.ts +65 -94
- package/src/cli/commands/spec-baseline-check.ts +37 -315
- package/src/cli/commands/spec.ts +15 -11
- package/src/cli/commands/status.ts +2 -4
- package/src/cli/commands/sync-docs/agents-syncer.ts +28 -47
- package/src/cli/commands/sync-docs/capabilities-syncer.ts +14 -13
- package/src/cli/commands/sync-docs/compact.ts +36 -0
- package/src/cli/commands/sync-docs/context-syncer.ts +15 -31
- package/src/cli/commands/sync-docs/gate.ts +78 -0
- package/src/cli/commands/sync-docs/index.ts +21 -585
- package/src/cli/commands/sync-docs/main-flow.ts +109 -0
- package/src/cli/commands/sync-docs/project-reader.ts +23 -25
- package/src/cli/commands/sync-docs/sync-output.ts +218 -0
- package/src/cli/commands/sync-docs/sync-state.ts +327 -0
- package/src/cli/commands/sync-docs/sync-writes.ts +49 -0
- package/src/cli/commands/validate.ts +13 -8
- package/src/cli/gate-command.ts +1 -1
- package/src/context/CONTEXT.md +6 -6
- package/src/context/__tests__/session-manager.test.ts +1 -41
- package/src/context/index.ts +1 -10
- package/src/context/session-manager.ts +30 -90
- package/src/context/types.ts +3 -38
- package/src/core/CONTEXT.md +11 -11
- package/src/core/app-constraints-loader.ts +5 -23
- package/src/core/constraint-lifecycle.ts +31 -40
- package/src/core/constraints/__tests__/check-cache.test.ts +2 -124
- package/src/core/constraints/__tests__/collect-constraints.test.ts +0 -6
- package/src/core/constraints/__tests__/run-env.test.ts +26 -114
- package/src/core/constraints/__tests__/triggers.test.ts +3 -2
- package/src/core/constraints/__tests__/usage-report.test.ts +3 -6
- package/src/core/constraints/capabilities-parser.ts +4 -6
- package/src/core/constraints/check-cache.ts +4 -70
- package/src/core/constraints/checker.ts +25 -75
- package/src/core/constraints/checkers/__tests__/capability-sync.test.ts +1 -0
- package/src/core/constraints/checkers/__tests__/check-outcome.test.ts +0 -1
- package/src/core/constraints/checkers/__tests__/docs-freshness-degraded.test.ts +2 -0
- package/src/core/constraints/checkers/__tests__/docs-freshness.test.ts +1 -0
- package/src/core/constraints/checkers/__tests__/governance-presence.test.ts +1 -0
- package/src/core/constraints/checkers/__tests__/input-contract.test.ts +1 -25
- package/src/core/constraints/checkers/__tests__/no-completion-without-verification.test.ts +3 -2
- package/src/core/constraints/checkers/__tests__/no-hardcoded-credentials.test.ts +3 -0
- package/src/core/constraints/checkers/__tests__/no-test-simplification.test.ts +1 -0
- package/src/core/constraints/checkers/__tests__/templated-checkers.test.ts +1 -0
- package/src/core/constraints/checkers/__tests__/templates-registry.test.ts +0 -2
- package/src/core/constraints/checkers/__tests__/three-state-consistency.test.ts +1 -0
- package/src/core/constraints/checkers/capability-sync.ts +2 -2
- package/src/core/constraints/checkers/context-doc-sync.ts +1 -1
- package/src/core/constraints/checkers/docs-freshness.ts +1 -1
- package/src/core/constraints/checkers/index.ts +21 -8
- package/src/core/constraints/checkers/no-hardcoded-credentials.ts +5 -32
- package/src/core/constraints/checkers/no-test-simplification.ts +10 -32
- package/src/core/constraints/checkers/templated/exec.ts +2 -7
- package/src/core/constraints/checkers/templated/file-exists.ts +1 -1
- package/src/core/constraints/checkers/templated/regex-scan.ts +6 -25
- package/src/core/constraints/checkers/types.ts +12 -65
- package/src/core/constraints/context-builder.ts +11 -102
- package/src/core/constraints/definitions/{iron-laws.ts → errors.ts} +0 -21
- package/src/core/constraints/definitions/{guidelines.ts → warnings.ts} +18 -4
- package/src/core/constraints/definitions.ts +4 -3
- package/src/core/constraints/doc-freshness/runner.ts +201 -232
- package/src/core/constraints/find-constraint.ts +24 -0
- package/src/core/constraints/git-evidence.ts +2 -0
- package/src/core/constraints/governance-accessors.ts +74 -0
- package/src/core/constraints/index.ts +0 -5
- package/src/core/constraints/injection-writer.ts +3 -6
- package/src/core/constraints/pack-proposal.ts +4 -15
- package/src/core/constraints/run-env.ts +1 -26
- package/src/core/constraints/triggers.ts +11 -6
- package/src/core/constraints/usage-report.ts +0 -9
- package/src/core/index.ts +5 -10
- package/src/core/project-config-loader.ts +5 -67
- package/src/core/spec/baseline-check.ts +300 -0
- package/src/core/validators/__tests__/http-retry-sleep.test.ts +1 -1
- package/src/core/validators/__tests__/passes-gate-counts.test.ts +52 -0
- package/src/core/validators/check-handlers/command.ts +9 -6
- package/src/core/validators/check-handlers/file.ts +48 -5
- package/src/core/validators/check-handlers/http.ts +8 -6
- package/src/core/validators/check-handlers/output.ts +7 -6
- package/src/core/validators/checkpoint.ts +52 -85
- package/src/core/validators/cso.ts +1 -12
- package/src/core/validators/passes-gate.ts +27 -38
- package/src/failure/CONTEXT.md +1 -1
- package/src/failure/__tests__/recorder.test.ts +2 -1
- package/src/failure/classifier.ts +2 -42
- package/src/failure/error-types.ts +122 -0
- package/src/failure/index.ts +9 -9
- package/src/failure/recorder.ts +12 -77
- package/src/gates/CONTEXT.md +9 -10
- package/src/gates/__tests__/acceptance-types-single-source.test.ts +16 -14
- package/src/gates/__tests__/acceptance.test.ts +69 -94
- package/src/gates/__tests__/command-single-predicate.test.ts +16 -61
- package/src/gates/__tests__/command.test.ts +23 -25
- package/src/gates/__tests__/gate-interface.test.ts +5 -10
- package/src/gates/__tests__/performance.test.ts +8 -54
- package/src/gates/__tests__/review.test.ts +27 -50
- package/src/gates/__tests__/security-default-scan.test.ts +6 -3
- package/src/gates/__tests__/security.test.ts +30 -61
- package/src/gates/acceptance.ts +199 -156
- package/src/gates/command.ts +1 -34
- package/src/gates/contract.ts +83 -93
- package/src/gates/definitions.ts +1 -1
- package/src/gates/performance.ts +36 -43
- package/src/gates/registry.ts +4 -3
- package/src/gates/review.ts +68 -31
- package/src/gates/security.ts +69 -96
- package/src/gates/types.ts +22 -84
- package/src/index.ts +11 -32
- package/src/knowledge/CONTEXT.md +21 -25
- package/src/knowledge/__tests__/audit-labels.test.ts +3 -3
- package/src/knowledge/__tests__/audit-scoring.test.ts +9 -7
- package/src/knowledge/__tests__/audit.test.ts +1 -1
- package/src/knowledge/__tests__/import.test.ts +1 -1
- package/src/knowledge/__tests__/ingest-validate-entry.test.ts +235 -0
- package/src/knowledge/__tests__/ingest.test.ts +19 -20
- package/src/knowledge/__tests__/store.test.ts +6 -10
- package/src/knowledge/__tests__/tree-walker.test.ts +5 -13
- package/src/knowledge/audit-dimensions.ts +190 -0
- package/src/knowledge/audit-rules.ts +339 -0
- package/src/knowledge/audit-scoring.ts +7 -495
- package/src/knowledge/audit.ts +12 -12
- package/src/knowledge/{import.ts → cold-start.ts} +150 -192
- package/src/knowledge/index-generator.ts +48 -53
- package/src/knowledge/index.ts +6 -11
- package/src/knowledge/ingest.ts +137 -19
- package/src/knowledge/lifecycle.ts +28 -38
- package/src/knowledge/query.ts +8 -7
- package/src/knowledge/store.ts +29 -66
- package/src/knowledge/types.ts +2 -48
- package/src/monitoring/CONTEXT.md +3 -3
- package/src/monitoring/__tests__/skipped-lines-report.test.ts +3 -16
- package/src/monitoring/__tests__/traces.test.ts +1 -27
- package/src/monitoring/analyzer-base.ts +1 -28
- package/src/monitoring/trace-analyzer.ts +12 -168
- package/src/monitoring/traces.ts +11 -35
- package/src/pretool-use-hook.ts +26 -21
- package/src/release/CONTEXT.md +1 -1
- package/src/release/__tests__/integrity.test.ts +0 -2
- package/src/release/integrity.ts +8 -9
- package/src/sdd/index-generator.ts +4 -0
- package/src/types/checkpoint.ts +8 -8
- package/src/types/command-definition.ts +85 -0
- package/src/types/command-io.ts +14 -0
- package/src/types/constraint.ts +3 -32
- package/src/types/failure.ts +7 -113
- package/src/types/gate.ts +77 -0
- package/src/types/spec.ts +0 -4
- package/src/types/trace.ts +0 -6
- package/src/utils/__tests__/attempt.test.ts +94 -0
- package/src/utils/__tests__/jsonl-skip-disposition.test.ts +4 -7
- package/src/utils/__tests__/package-json.test.ts +58 -0
- package/src/utils/__tests__/package-version.test.ts +21 -2
- package/src/utils/attempt.ts +35 -0
- package/src/utils/clip.ts +12 -0
- package/src/utils/detect-source-roots.ts +38 -44
- package/src/utils/diff-parse.ts +80 -0
- package/src/utils/file-walk.ts +3 -7
- package/src/utils/guards.ts +8 -0
- package/src/utils/jsonl.ts +0 -30
- package/src/utils/log-rotate.ts +43 -0
- package/src/utils/numeric-flag.ts +24 -2
- package/src/utils/package-json.ts +61 -0
- package/src/utils/package-version.ts +8 -10
- package/dist/cli/commands/init.d.ts.map +0 -1
- package/dist/cli/commands/init.js +0 -502
- package/dist/cli/commands/init.js.map +0 -1
- package/dist/cli/commands/knowledge.d.ts +0 -169
- package/dist/cli/commands/knowledge.d.ts.map +0 -1
- package/dist/cli/commands/knowledge.js +0 -700
- package/dist/cli/commands/knowledge.js.map +0 -1
- package/dist/context/knowledge-injector.d.ts +0 -51
- package/dist/context/knowledge-injector.d.ts.map +0 -1
- package/dist/context/knowledge-injector.js +0 -128
- package/dist/context/knowledge-injector.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/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/spec/validator.d.ts.map +0 -1
- package/dist/core/spec/validator.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/index.d.ts +0 -10
- package/dist/gates/index.d.ts.map +0 -1
- package/dist/gates/index.js +0 -11
- package/dist/gates/index.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/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/import.d.ts.map +0 -1
- package/dist/knowledge/import.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/reference-tracker.d.ts +0 -31
- package/dist/knowledge/reference-tracker.d.ts.map +0 -1
- package/dist/knowledge/reference-tracker.js +0 -125
- package/dist/knowledge/reference-tracker.js.map +0 -1
- package/src/__tests__/spec-validator.test.ts +0 -58
- package/src/cli/commands/init.ts +0 -590
- package/src/cli/commands/knowledge.ts +0 -820
- package/src/context/__tests__/knowledge-injector.test.ts +0 -197
- package/src/context/knowledge-injector.ts +0 -174
- package/src/core/constraints/checkers/templates-registry.ts +0 -24
- package/src/gates/__tests__/checker-gate.test.ts +0 -86
- package/src/gates/checker-gate.ts +0 -52
- package/src/gates/index.ts +0 -11
- package/src/knowledge/__tests__/doctor.test.ts +0 -300
- package/src/knowledge/__tests__/lint.test.ts +0 -536
- package/src/knowledge/__tests__/migration.test.ts +0 -185
- package/src/knowledge/__tests__/reference-tracker.test.ts +0 -169
- package/src/knowledge/doctor.ts +0 -103
- package/src/knowledge/lint.ts +0 -460
- package/src/knowledge/migration.ts +0 -82
- package/src/knowledge/reference-tracker.ts +0 -101
- /package/src/{hooks → bootstrap}/__tests__/bootstrap.test.ts +0 -0
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { describe, it, expect, beforeAll, afterAll, beforeEach } from '@jest/globals';
|
|
6
|
-
import { FailureRecorder
|
|
7
|
-
import { ErrorType, FailureLevel } from '../types
|
|
6
|
+
import { FailureRecorder } from '../failure/recorder';
|
|
7
|
+
import { ErrorType, FailureLevel } from '../failure/error-types';
|
|
8
8
|
import * as fs from 'fs';
|
|
9
9
|
import * as path from 'path';
|
|
10
10
|
import * as os from 'os';
|
|
@@ -35,7 +35,7 @@ describe('FailureRecorder', () => {
|
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
describe('record', () => {
|
|
38
|
-
it('应该记录失败',
|
|
38
|
+
it('应该记录失败', () => {
|
|
39
39
|
const record: FailureRecord = {
|
|
40
40
|
type: ErrorType.TEST_FAILED,
|
|
41
41
|
level: FailureLevel.L1,
|
|
@@ -43,14 +43,14 @@ describe('FailureRecorder', () => {
|
|
|
43
43
|
timestamp: Date.now(),
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
recorder.record(record);
|
|
47
47
|
|
|
48
48
|
const content = fs.readFileSync(logFile, 'utf-8');
|
|
49
49
|
expect(content).toContain('TEST_FAILED');
|
|
50
50
|
expect(content).toContain('Test failed');
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
it('应该追加多条记录',
|
|
53
|
+
it('应该追加多条记录', () => {
|
|
54
54
|
const record1: FailureRecord = {
|
|
55
55
|
type: ErrorType.NETWORK_ERROR,
|
|
56
56
|
level: FailureLevel.L1,
|
|
@@ -64,29 +64,29 @@ describe('FailureRecorder', () => {
|
|
|
64
64
|
timestamp: Date.now(),
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
recorder.record(record1);
|
|
68
|
+
recorder.record(record2);
|
|
69
69
|
|
|
70
70
|
const content = fs.readFileSync(logFile, 'utf-8');
|
|
71
71
|
expect(content).toContain('NETWORK_ERROR');
|
|
72
72
|
expect(content).toContain('TIMEOUT');
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
-
it('应该记录完整字段',
|
|
75
|
+
it('应该记录完整字段', () => {
|
|
76
76
|
const record: FailureRecord = {
|
|
77
77
|
type: ErrorType.VALIDATION_ERROR,
|
|
78
78
|
level: FailureLevel.L3,
|
|
79
79
|
message: 'Validation error with details',
|
|
80
80
|
timestamp: 1234567890,
|
|
81
|
-
metadata: {
|
|
82
|
-
file: 'test.ts',
|
|
81
|
+
metadata: {
|
|
82
|
+
file: 'test.ts',
|
|
83
83
|
line: 42,
|
|
84
84
|
stack: 'Error at line 42',
|
|
85
|
-
userId: 'user-001'
|
|
85
|
+
userId: 'user-001'
|
|
86
86
|
},
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
recorder.record(record);
|
|
90
90
|
|
|
91
91
|
const content = fs.readFileSync(logFile, 'utf-8');
|
|
92
92
|
expect(content).toContain('VALIDATION_ERROR');
|
|
@@ -96,112 +96,51 @@ describe('FailureRecorder', () => {
|
|
|
96
96
|
});
|
|
97
97
|
});
|
|
98
98
|
|
|
99
|
-
describe('recordBatch', () => {
|
|
100
|
-
it('应该批量记录', async () => {
|
|
101
|
-
const records: FailureRecord[] = [
|
|
102
|
-
{ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'Test 1', timestamp: Date.now() },
|
|
103
|
-
{ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'Test 2', timestamp: Date.now() },
|
|
104
|
-
{ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'Test 3', timestamp: Date.now() },
|
|
105
|
-
];
|
|
106
|
-
|
|
107
|
-
await recorder.recordBatch(records);
|
|
108
|
-
|
|
109
|
-
const history = await recorder.getHistory();
|
|
110
|
-
expect(history.length).toBe(3);
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
|
|
114
99
|
describe('getHistory', () => {
|
|
115
|
-
it('应该读取所有记录',
|
|
116
|
-
|
|
117
|
-
|
|
100
|
+
it('应该读取所有记录', () => {
|
|
101
|
+
recorder.record({ type: ErrorType.VALIDATION_ERROR, level: FailureLevel.L2, message: 'V1', timestamp: Date.now() });
|
|
102
|
+
recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'T1', timestamp: Date.now() });
|
|
118
103
|
|
|
119
|
-
const records =
|
|
104
|
+
const records = recorder.getHistory();
|
|
120
105
|
expect(records.length).toBe(2);
|
|
121
106
|
});
|
|
122
107
|
|
|
123
|
-
it('应该支持 limit 参数',
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
108
|
+
it('应该支持 limit 参数', () => {
|
|
109
|
+
recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'T1', timestamp: Date.now() });
|
|
110
|
+
recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'T2', timestamp: Date.now() });
|
|
111
|
+
recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'T3', timestamp: Date.now() });
|
|
127
112
|
|
|
128
|
-
const records =
|
|
113
|
+
const records = recorder.getHistory(2);
|
|
129
114
|
expect(records.length).toBe(2);
|
|
130
115
|
// 应该返回最后 2 条
|
|
131
116
|
expect(records[0].message).toBe('T2');
|
|
132
117
|
expect(records[1].message).toBe('T3');
|
|
133
118
|
});
|
|
134
119
|
|
|
135
|
-
it('空文件应该返回空数组',
|
|
120
|
+
it('空文件应该返回空数组', () => {
|
|
136
121
|
const emptyLogFile = path.join(tempDir, 'empty.log');
|
|
137
122
|
fs.writeFileSync(emptyLogFile, '');
|
|
138
123
|
|
|
139
124
|
const emptyRecorder = new FailureRecorder({ logFile: emptyLogFile });
|
|
140
|
-
const records =
|
|
125
|
+
const records = emptyRecorder.getHistory();
|
|
141
126
|
|
|
142
127
|
expect(records).toEqual([]);
|
|
143
128
|
});
|
|
144
129
|
|
|
145
|
-
it('文件不存在应该返回空数组',
|
|
130
|
+
it('文件不存在应该返回空数组', () => {
|
|
146
131
|
const nonexistentRecorder = new FailureRecorder({ logFile: path.join(tempDir, 'nonexistent.log') });
|
|
147
|
-
const records =
|
|
132
|
+
const records = nonexistentRecorder.getHistory();
|
|
148
133
|
expect(records).toEqual([]);
|
|
149
134
|
});
|
|
150
135
|
});
|
|
151
136
|
|
|
152
|
-
describe('getByType', () => {
|
|
153
|
-
it('应该按类型过滤记录', async () => {
|
|
154
|
-
await recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'Test 1', timestamp: Date.now() });
|
|
155
|
-
await recorder.record({ type: ErrorType.NETWORK_ERROR, level: FailureLevel.L1, message: 'Network 1', timestamp: Date.now() });
|
|
156
|
-
await recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'Test 2', timestamp: Date.now() });
|
|
157
|
-
|
|
158
|
-
const testRecords = await recorder.getByType(ErrorType.TEST_FAILED);
|
|
159
|
-
expect(testRecords.length).toBe(2);
|
|
160
|
-
|
|
161
|
-
const networkRecords = await recorder.getByType(ErrorType.NETWORK_ERROR);
|
|
162
|
-
expect(networkRecords.length).toBe(1);
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
it('应该支持 limit 参数', async () => {
|
|
166
|
-
await recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'T1', timestamp: Date.now() });
|
|
167
|
-
await recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'T2', timestamp: Date.now() });
|
|
168
|
-
await recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'T3', timestamp: Date.now() });
|
|
169
|
-
|
|
170
|
-
const records = await recorder.getByType(ErrorType.TEST_FAILED, 2);
|
|
171
|
-
expect(records.length).toBe(2);
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
describe('getByLevel', () => {
|
|
176
|
-
it('应该按等级过滤记录', async () => {
|
|
177
|
-
await recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'L1 error', timestamp: Date.now() });
|
|
178
|
-
await recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L2, message: 'L2 error', timestamp: Date.now() });
|
|
179
|
-
await recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'Another L1', timestamp: Date.now() });
|
|
180
|
-
|
|
181
|
-
const l1Records = await recorder.getByLevel(FailureLevel.L1);
|
|
182
|
-
expect(l1Records.length).toBe(2);
|
|
183
|
-
|
|
184
|
-
const l2Records = await recorder.getByLevel(FailureLevel.L2);
|
|
185
|
-
expect(l2Records.length).toBe(1);
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
it('应该支持 limit 参数', async () => {
|
|
189
|
-
await recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'L1-1', timestamp: Date.now() });
|
|
190
|
-
await recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'L1-2', timestamp: Date.now() });
|
|
191
|
-
await recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'L1-3', timestamp: Date.now() });
|
|
192
|
-
|
|
193
|
-
const records = await recorder.getByLevel(FailureLevel.L1, 2);
|
|
194
|
-
expect(records.length).toBe(2);
|
|
195
|
-
});
|
|
196
|
-
});
|
|
197
|
-
|
|
198
137
|
describe('getStats', () => {
|
|
199
|
-
it('应该返回统计信息',
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
138
|
+
it('应该返回统计信息', () => {
|
|
139
|
+
recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'T1', timestamp: Date.now() });
|
|
140
|
+
recorder.record({ type: ErrorType.NETWORK_ERROR, level: FailureLevel.L2, message: 'N1', timestamp: Date.now() });
|
|
141
|
+
recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'T2', timestamp: Date.now() });
|
|
203
142
|
|
|
204
|
-
const stats =
|
|
143
|
+
const stats = recorder.getStats();
|
|
205
144
|
|
|
206
145
|
expect(stats.total).toBe(3);
|
|
207
146
|
expect(stats.byType[ErrorType.TEST_FAILED]).toBe(2);
|
|
@@ -210,8 +149,8 @@ describe('FailureRecorder', () => {
|
|
|
210
149
|
expect(stats.byLevel[FailureLevel.L2]).toBe(1);
|
|
211
150
|
});
|
|
212
151
|
|
|
213
|
-
it('空记录应该返回零统计',
|
|
214
|
-
const stats =
|
|
152
|
+
it('空记录应该返回零统计', () => {
|
|
153
|
+
const stats = recorder.getStats();
|
|
215
154
|
expect(stats.total).toBe(0);
|
|
216
155
|
expect(Object.keys(stats.byType).length).toBe(0);
|
|
217
156
|
expect(Object.keys(stats.byLevel).length).toBe(0);
|
|
@@ -219,24 +158,24 @@ describe('FailureRecorder', () => {
|
|
|
219
158
|
});
|
|
220
159
|
|
|
221
160
|
describe('clear', () => {
|
|
222
|
-
it('应该清空记录',
|
|
223
|
-
|
|
224
|
-
|
|
161
|
+
it('应该清空记录', () => {
|
|
162
|
+
recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'Test', timestamp: Date.now() });
|
|
163
|
+
recorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: 'Test 2', timestamp: Date.now() });
|
|
225
164
|
|
|
226
|
-
|
|
165
|
+
recorder.clear();
|
|
227
166
|
|
|
228
|
-
const records =
|
|
167
|
+
const records = recorder.getHistory();
|
|
229
168
|
expect(records).toEqual([]);
|
|
230
169
|
});
|
|
231
170
|
|
|
232
|
-
it('文件不存在时清空不应报错',
|
|
171
|
+
it('文件不存在时清空不应报错', () => {
|
|
233
172
|
const newRecorder = new FailureRecorder({ logFile: path.join(tempDir, 'new.log') });
|
|
234
|
-
|
|
173
|
+
expect(() => newRecorder.clear()).not.toThrow();
|
|
235
174
|
});
|
|
236
175
|
});
|
|
237
176
|
|
|
238
177
|
describe('文件滚动', () => {
|
|
239
|
-
it('文件超过大小限制时应该滚动',
|
|
178
|
+
it('文件超过大小限制时应该滚动', () => {
|
|
240
179
|
const smallLogFile = path.join(tempDir, 'small.log');
|
|
241
180
|
const smallRecorder = new FailureRecorder({
|
|
242
181
|
logFile: smallLogFile,
|
|
@@ -246,7 +185,7 @@ describe('FailureRecorder', () => {
|
|
|
246
185
|
|
|
247
186
|
// 写入超过 100 bytes 的数据
|
|
248
187
|
const largeMessage = 'x'.repeat(150);
|
|
249
|
-
|
|
188
|
+
smallRecorder.record({ type: ErrorType.TEST_FAILED, level: FailureLevel.L1, message: largeMessage, timestamp: Date.now() });
|
|
250
189
|
|
|
251
190
|
// 检查是否创建了历史文件
|
|
252
191
|
const historyFile1 = smallLogFile.replace('.log', '.1.log');
|
|
@@ -255,7 +194,7 @@ describe('FailureRecorder', () => {
|
|
|
255
194
|
expect(fileExists || fs.existsSync(smallLogFile)).toBe(true);
|
|
256
195
|
});
|
|
257
196
|
|
|
258
|
-
it('应该限制历史文件数量',
|
|
197
|
+
it('应该限制历史文件数量', () => {
|
|
259
198
|
const rotateLogFile = path.join(tempDir, 'rotate.log');
|
|
260
199
|
const rotateRecorder = new FailureRecorder({
|
|
261
200
|
logFile: rotateLogFile,
|
|
@@ -265,7 +204,7 @@ describe('FailureRecorder', () => {
|
|
|
265
204
|
|
|
266
205
|
// 多次写入触发滚动
|
|
267
206
|
for (let i = 0; i < 5; i++) {
|
|
268
|
-
|
|
207
|
+
rotateRecorder.record({
|
|
269
208
|
type: ErrorType.TEST_FAILED,
|
|
270
209
|
level: FailureLevel.L1,
|
|
271
210
|
message: 'x'.repeat(100),
|
|
@@ -307,7 +246,7 @@ describe('FailureRecorder', () => {
|
|
|
307
246
|
});
|
|
308
247
|
|
|
309
248
|
describe('元数据', () => {
|
|
310
|
-
it('应该记录元数据',
|
|
249
|
+
it('应该记录元数据', () => {
|
|
311
250
|
const record: FailureRecord = {
|
|
312
251
|
type: ErrorType.GATE_FAILED,
|
|
313
252
|
level: FailureLevel.L2,
|
|
@@ -319,21 +258,13 @@ describe('FailureRecorder', () => {
|
|
|
319
258
|
},
|
|
320
259
|
};
|
|
321
260
|
|
|
322
|
-
|
|
261
|
+
recorder.record(record);
|
|
323
262
|
|
|
324
263
|
const content = fs.readFileSync(logFile, 'utf-8');
|
|
325
264
|
expect(content).toContain('passes-gate');
|
|
326
265
|
expect(content).toContain('TASK-001');
|
|
327
266
|
});
|
|
328
267
|
});
|
|
329
|
-
|
|
330
|
-
describe('createFailureRecorder', () => {
|
|
331
|
-
it('便捷函数应该创建 recorder', () => {
|
|
332
|
-
const r = createFailureRecorder({ logFile: path.join(tempDir, 'create.log') });
|
|
333
|
-
expect(r).toBeDefined();
|
|
334
|
-
expect(r).toBeInstanceOf(FailureRecorder);
|
|
335
|
-
});
|
|
336
|
-
});
|
|
337
268
|
});
|
|
338
269
|
|
|
339
270
|
describe('DEFAULT_FAILURE_LOG_FILE', () => {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bin/install-precommit-hook.sh 测试(工单 36)
|
|
3
|
+
*
|
|
4
|
+
* .git/hooks 不进版本库、新 clone 不带钩子,且裸名 npx harness 会解析到
|
|
5
|
+
* npm 同名陌生包(rsdoiel/harness@0.0.6)。安装脚本是钩子的跟踪生成源,
|
|
6
|
+
* 保证新 clone 一条命令装回 dogfood 当前 HEAD 的 node bin/harness.js 版钩子。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { execFileSync } from 'child_process';
|
|
10
|
+
import * as fs from 'fs';
|
|
11
|
+
import * as os from 'os';
|
|
12
|
+
import * as path from 'path';
|
|
13
|
+
|
|
14
|
+
const REPO_ROOT = path.resolve(__dirname, '..', '..');
|
|
15
|
+
const INSTALLER = path.join(REPO_ROOT, 'bin', 'install-precommit-hook.sh');
|
|
16
|
+
|
|
17
|
+
function install(gitDir: string): void {
|
|
18
|
+
execFileSync('bash', [INSTALLER, gitDir], { cwd: REPO_ROOT, stdio: 'pipe' });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
describe('bin/install-precommit-hook.sh', () => {
|
|
22
|
+
let tmpRoot: string;
|
|
23
|
+
let hookPath: string;
|
|
24
|
+
|
|
25
|
+
beforeEach(() => {
|
|
26
|
+
tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-hook-'));
|
|
27
|
+
hookPath = path.join(tmpRoot, '.git', 'hooks', 'pre-commit');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
afterEach(() => {
|
|
31
|
+
fs.rmSync(tmpRoot, { recursive: true, force: true });
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('创建 hooks 目录并落盘可执行钩子', () => {
|
|
35
|
+
install(path.join(tmpRoot, '.git'));
|
|
36
|
+
|
|
37
|
+
expect(fs.existsSync(hookPath)).toBe(true);
|
|
38
|
+
expect(fs.statSync(hookPath).mode & 0o111).not.toBe(0);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('钩子用 node bin/harness.js 检查,无裸名 npx harness 命令调用', () => {
|
|
42
|
+
install(path.join(tmpRoot, '.git'));
|
|
43
|
+
|
|
44
|
+
const content = fs.readFileSync(hookPath, 'utf-8');
|
|
45
|
+
expect(content).toContain('set -e');
|
|
46
|
+
expect(content).toContain('CHECK_OUTPUT=$(node bin/harness.js check --staged 2>&1)');
|
|
47
|
+
// 只允许注释里解释性出现裸名,不允许任何命令式调用
|
|
48
|
+
expect(content).not.toMatch(/npx harness\s+[a-z-]+/);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('重复安装幂等覆盖(漂移内容被清除)', () => {
|
|
52
|
+
install(path.join(tmpRoot, '.git'));
|
|
53
|
+
fs.appendFileSync(hookPath, '\n# manual drift\n');
|
|
54
|
+
|
|
55
|
+
install(path.join(tmpRoot, '.git'));
|
|
56
|
+
|
|
57
|
+
const content = fs.readFileSync(hookPath, 'utf-8');
|
|
58
|
+
expect(content).not.toContain('manual drift');
|
|
59
|
+
expect(content).toContain('node bin/harness.js check --staged');
|
|
60
|
+
});
|
|
61
|
+
});
|
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
CONSTRAINTS,
|
|
8
8
|
getAllConstraints,
|
|
9
9
|
findConstraintsByTrigger,
|
|
10
|
-
getConstraint
|
|
10
|
+
getConstraint,
|
|
11
|
+
isGateConstraint
|
|
11
12
|
} from '../core/constraints/definitions';
|
|
12
13
|
import { constraintChecker } from '../core/constraints/checker';
|
|
13
14
|
import { getConstraintCheck, registeredCheckCount } from '../core/constraints/checkers';
|
|
@@ -17,21 +18,17 @@ import * as path from 'path';
|
|
|
17
18
|
import * as os from 'os';
|
|
18
19
|
|
|
19
20
|
describe('Constraint System', () => {
|
|
20
|
-
describe('清单构成(ADR-0029:16 → 7
|
|
21
|
-
it('getAllConstraints 返回 7
|
|
21
|
+
describe('清单构成(ADR-0029:16 → 7)', () => {
|
|
22
|
+
it('getAllConstraints 返回 7 条约束', () => {
|
|
22
23
|
const all = getAllConstraints();
|
|
23
24
|
expect(all).toHaveLength(7);
|
|
24
|
-
expect(all.every(c => c.kind === 'check')).toBe(true);
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
it('severity 分桶 =
|
|
27
|
+
it('severity 分桶 = 3 error + 4 warning(ADR-0032:凭证扫描升 error、docs_freshness 降 warning)', () => {
|
|
28
28
|
const errors = Object.values(CONSTRAINTS).filter(c => c.severity === 'error');
|
|
29
29
|
const warnings = Object.values(CONSTRAINTS).filter(c => c.severity === 'warning');
|
|
30
|
-
expect(errors).toHaveLength(
|
|
31
|
-
expect(warnings).toHaveLength(
|
|
32
|
-
Object.values(CONSTRAINTS).forEach(c => {
|
|
33
|
-
expect(c.kind).toBe('check');
|
|
34
|
-
});
|
|
30
|
+
expect(errors).toHaveLength(3);
|
|
31
|
+
expect(warnings).toHaveLength(4);
|
|
35
32
|
});
|
|
36
33
|
|
|
37
34
|
it('prompt 面字段已删除(promptInjection / injectPrompt / appliesTo 不存在)', () => {
|
|
@@ -121,15 +118,15 @@ describe('Constraint System', () => {
|
|
|
121
118
|
});
|
|
122
119
|
|
|
123
120
|
describe('注册表闭环', () => {
|
|
124
|
-
it('每条
|
|
125
|
-
const checks = getAllConstraints().filter(
|
|
121
|
+
it('每条 gate 通道约束都有已注册 checker', () => {
|
|
122
|
+
const checks = getAllConstraints().filter(isGateConstraint);
|
|
126
123
|
for (const c of checks) {
|
|
127
124
|
expect(getConstraintCheck(c.id)).toBeDefined();
|
|
128
125
|
}
|
|
129
126
|
});
|
|
130
127
|
|
|
131
|
-
it('注册表数量与
|
|
132
|
-
const checkCount = getAllConstraints().filter(
|
|
128
|
+
it('注册表数量与 gate 约束数量一致(无孤儿 checker)', () => {
|
|
129
|
+
const checkCount = getAllConstraints().filter(isGateConstraint).length;
|
|
133
130
|
expect(registeredCheckCount()).toBe(checkCount);
|
|
134
131
|
});
|
|
135
132
|
});
|
|
@@ -143,7 +140,6 @@ describe('Constraint System', () => {
|
|
|
143
140
|
it('should get single constraint by id', () => {
|
|
144
141
|
const constraint = getConstraint('no_completion_without_verification');
|
|
145
142
|
expect(constraint).toBeDefined();
|
|
146
|
-
expect(constraint?.kind).toBe('check');
|
|
147
143
|
expect(constraint?.severity).toBe('error');
|
|
148
144
|
});
|
|
149
145
|
|
|
@@ -169,7 +165,7 @@ describe('Constraint Checker', () => {
|
|
|
169
165
|
expect(result.errors.length + result.warnings.length).toBeGreaterThan(0);
|
|
170
166
|
});
|
|
171
167
|
|
|
172
|
-
it('
|
|
168
|
+
it('gate 通道但未注册 checker 的约束应抛错(不许静默 pass)', async () => {
|
|
173
169
|
const context: ConstraintContext = {
|
|
174
170
|
operation: 'code_implementation',
|
|
175
171
|
};
|
|
@@ -178,7 +174,6 @@ describe('Constraint Checker', () => {
|
|
|
178
174
|
constraintChecker.check(
|
|
179
175
|
{
|
|
180
176
|
id: 'ghost_check_constraint',
|
|
181
|
-
kind: 'check',
|
|
182
177
|
severity: 'warning',
|
|
183
178
|
rule: 'GHOST',
|
|
184
179
|
message: 'test',
|
|
@@ -199,8 +194,6 @@ describe('Constraint Checker', () => {
|
|
|
199
194
|
operation: 'code_implementation',
|
|
200
195
|
projectPath,
|
|
201
196
|
changedFiles: [],
|
|
202
|
-
hasRequirement: true,
|
|
203
|
-
hasSingleTask: true,
|
|
204
197
|
};
|
|
205
198
|
|
|
206
199
|
const result = await constraintChecker.checkConstraints(context);
|
|
@@ -215,13 +208,13 @@ describe('Constraint Checker', () => {
|
|
|
215
208
|
|
|
216
209
|
describe('Constraint Severity', () => {
|
|
217
210
|
it('error 级约束 severity 均为 error', () => {
|
|
218
|
-
['no_completion_without_verification', 'no_test_simplification', '
|
|
211
|
+
['no_completion_without_verification', 'no_test_simplification', 'no_hardcoded_credentials'].forEach(id => {
|
|
219
212
|
expect(CONSTRAINTS[id].severity).toBe('error');
|
|
220
213
|
});
|
|
221
214
|
});
|
|
222
215
|
|
|
223
216
|
it('warning 级约束 severity 均为 warning', () => {
|
|
224
|
-
['capability_sync', 'context_doc_sync', 'governance_presence'].forEach(id => {
|
|
217
|
+
['capability_sync', 'context_doc_sync', 'governance_presence', 'docs_freshness'].forEach(id => {
|
|
225
218
|
expect(CONSTRAINTS[id].severity).toBe('warning');
|
|
226
219
|
});
|
|
227
220
|
});
|
|
@@ -68,14 +68,14 @@ const DOWNSTREAM: Record<string, string[]> = {
|
|
|
68
68
|
gates: ['core', 'types', 'utils'],
|
|
69
69
|
knowledge: ['types', 'utils'],
|
|
70
70
|
monitoring: ['types', 'utils'],
|
|
71
|
-
release: [], //
|
|
71
|
+
release: ['utils'], // utils 边 = readPackageJson 正本(重构 Phase 5 收口),release/CONTEXT.md 自我声明同步更新
|
|
72
72
|
sdd: ['types', 'utils'],
|
|
73
73
|
// 同层互 import(现状冻结,不是许可):context 注入取知识、SessionManager 取 trace 采集器。
|
|
74
74
|
// 收口方向同 harness#88 对 core 的裁决——改注入,另票评估
|
|
75
75
|
context: ['knowledge', 'monitoring', 'types', 'utils'],
|
|
76
76
|
// bootstrapHarness 是本包组合根(装配 checker / SessionManager / TraceCollector),
|
|
77
77
|
// monitoring 对它是下行而非债
|
|
78
|
-
|
|
78
|
+
bootstrap: ['context', 'core', 'monitoring', 'types', 'utils'],
|
|
79
79
|
|
|
80
80
|
// ── 测试夹具:被各目录的测试依赖,故排在它们之下 ──
|
|
81
81
|
'test-setup': ['types', 'utils'],
|
|
@@ -84,7 +84,7 @@ const DOWNSTREAM: Record<string, string[]> = {
|
|
|
84
84
|
cli: [ANY], // CLI 是唯一的上层,per-command 懒加载各命令实现
|
|
85
85
|
'index.ts': [ANY], // 包根 barrel(ADR-0003 显式清单)
|
|
86
86
|
// 钩子入口:PreToolUse 决策取 CommandGate;P1-7(ADR-0031)命中留痕经
|
|
87
|
-
// TraceCollector 写 traces——与
|
|
87
|
+
// TraceCollector 写 traces——与 bootstrap 组合根 → monitoring 同方向,是下行不是债
|
|
88
88
|
'pretool-use-hook.ts': ['gates', 'monitoring', 'types', 'utils'],
|
|
89
89
|
__tests__: [ANY], // 根测试面:跨目录取生产码是本职
|
|
90
90
|
};
|
|
@@ -280,7 +280,7 @@ describe('逐目录单向分层(harness#88 / #137)', () => {
|
|
|
280
280
|
['types/probe.ts', `import type { RunEnv } from '../core/constraints/run-env';`],
|
|
281
281
|
['knowledge/probe.ts', `import { DEFAULT_DECAY_CONFIG } from './types';`],
|
|
282
282
|
['context/probe.ts', `import { KnowledgeQuery } from '../knowledge/query';`],
|
|
283
|
-
['
|
|
283
|
+
['bootstrap/probe.ts', `import { TraceCollector } from '../monitoring/traces';`],
|
|
284
284
|
['core/probe.ts', `import { PRESETS_BY_NAME } from '../presets';`],
|
|
285
285
|
['failure/__tests__/probe.test.ts', `import { failureList } from '../../cli/commands/failure';`],
|
|
286
286
|
['core/constraints/__tests__/probe.test.ts', `import { checkConstraints } from '../../index';`],
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { describe, it, expect, beforeAll, afterAll } from '@jest/globals';
|
|
6
|
-
import { ProjectConfigLoader
|
|
6
|
+
import { ProjectConfigLoader } from '../core/project-config-loader';
|
|
7
|
+
import { getCapabilitiesMode } from '../core/constraints/governance-accessors';
|
|
7
8
|
import * as fs from 'fs';
|
|
8
9
|
import * as path from 'path';
|
|
9
10
|
import * as os from 'os';
|
|
@@ -33,6 +33,7 @@ const EXPECTED_RUNTIME_EXPORTS = [
|
|
|
33
33
|
'DEFAULT_NONCODE_GLOBS',
|
|
34
34
|
'DEFAULT_TEST_GLOBS',
|
|
35
35
|
'DEFAULT_TRACE_FILE',
|
|
36
|
+
'EXTERNAL_SOURCE_MARKER',
|
|
36
37
|
'ErrorClassifier',
|
|
37
38
|
'ErrorType',
|
|
38
39
|
'FailureLevel',
|
|
@@ -40,14 +41,10 @@ const EXPECTED_RUNTIME_EXPORTS = [
|
|
|
40
41
|
'FileKnowledgeStore',
|
|
41
42
|
'HARNESS_CONFIG_FILES',
|
|
42
43
|
'KnowledgeAudit',
|
|
43
|
-
'KnowledgeHealthScorer',
|
|
44
44
|
'KnowledgeIngest',
|
|
45
|
-
'KnowledgeInjector',
|
|
46
45
|
'KnowledgeLifecycle',
|
|
47
|
-
'KnowledgeLinter',
|
|
48
46
|
'KnowledgeQuery',
|
|
49
47
|
'PHASE_SUBJECT_RE', 'PassesGate',
|
|
50
|
-
'ReferenceTracker',
|
|
51
48
|
'SessionManager',
|
|
52
49
|
'TESTED_BY_RE',
|
|
53
50
|
'TESTS_NONE_RE',
|
|
@@ -57,18 +54,12 @@ const EXPECTED_RUNTIME_EXPORTS = [
|
|
|
57
54
|
'bootstrapHarnessSync',
|
|
58
55
|
'buildCheckEnv',
|
|
59
56
|
'buildConstraintsUsageReport',
|
|
60
|
-
'checkBeforeExecution',
|
|
61
57
|
'checkConstraint',
|
|
62
58
|
'checkConstraints',
|
|
63
59
|
'classifyCommitFiles',
|
|
64
|
-
'classifyError',
|
|
65
60
|
'collectConstraints',
|
|
66
61
|
'collectProposalMaterial',
|
|
67
62
|
'collectUsageByConstraint',
|
|
68
|
-
'contextEvidenceFlag',
|
|
69
|
-
'contextFlag',
|
|
70
|
-
'createErrorClassifier',
|
|
71
|
-
'createFailureRecorder',
|
|
72
63
|
'createPassesGate',
|
|
73
64
|
'diagnoseRetireCandidates',
|
|
74
65
|
'disableConstraint',
|
|
@@ -80,7 +71,6 @@ const EXPECTED_RUNTIME_EXPORTS = [
|
|
|
80
71
|
'getConstraintsMeta',
|
|
81
72
|
'getCriticalArtifacts',
|
|
82
73
|
'getEffectiveConstraints',
|
|
83
|
-
'getFailureLevel',
|
|
84
74
|
'listRetiredConstraints',
|
|
85
75
|
'matchAnyGlob',
|
|
86
76
|
'matchGlob',
|
|
@@ -90,7 +80,6 @@ const EXPECTED_RUNTIME_EXPORTS = [
|
|
|
90
80
|
'proposalMaterialPath',
|
|
91
81
|
'pruneTraceLogs',
|
|
92
82
|
'reactivateConstraint',
|
|
93
|
-
'readProjectTraces',
|
|
94
83
|
'readProjectTracesReport',
|
|
95
84
|
'renderProposalMarkdown',
|
|
96
85
|
'resolveGlobs',
|
|
@@ -172,7 +161,7 @@ describe('包根类型面(ADR-0022 关联类型随迁)', () => {
|
|
|
172
161
|
* 两道全量清单闸钉的是「码与名单不符」,本钉直接钉「barrel 源里不再出现这些名字」——
|
|
173
162
|
* 回灌时红名指到 barrel 本身,不必从清单 diff 反推。barrel 源形状即全可达面:
|
|
174
163
|
* `export *` 已被 `sub-barrels-explicit.test.ts` 禁到 src 下全部目录 barrel,
|
|
175
|
-
* 且 `./hooks
|
|
164
|
+
* 且 `./bootstrap`(原 `./hooks`)不在 `package.json` 的 `exports` 内(无子路径入口可绕)。
|
|
176
165
|
*/
|
|
177
166
|
const ADR0027_DELETED_SYMBOLS = [
|
|
178
167
|
'HookRegistry',
|
|
@@ -189,7 +178,7 @@ describe('包根类型面(ADR-0022 关联类型随迁)', () => {
|
|
|
189
178
|
'PipelineResult',
|
|
190
179
|
];
|
|
191
180
|
|
|
192
|
-
for (const rel of ['../
|
|
181
|
+
for (const rel of ['../bootstrap/index.ts', '../index.ts']) {
|
|
193
182
|
it(`${rel} 不再提及 ADR-0027 已删的管线面符号(保留面 bootstrapHarness* 不受影响)`, () => {
|
|
194
183
|
const source = fs.readFileSync(path.join(__dirname, rel), 'utf-8');
|
|
195
184
|
expect(ADR0027_DELETED_SYMBOLS.filter((name) => source.includes(name))).toEqual([]);
|
|
@@ -356,7 +345,7 @@ describe('包根类型面(ADR-0022 关联类型随迁)', () => {
|
|
|
356
345
|
|
|
357
346
|
it('#199 保留面仍可经包根导入(防止删多:下游仓真实消费的三类 + spec 面相邻活类型)', () => {
|
|
358
347
|
const liveCollector: import('../index').TraceCollectorConfig = {};
|
|
359
|
-
const liveAnalyzer: import('../index').TraceAnalyzerConfig = {
|
|
348
|
+
const liveAnalyzer: import('../index').TraceAnalyzerConfig = { thresholds: { failRate: 0.5 } };
|
|
360
349
|
const liveTrace: import('../index').ExecutionTrace = {
|
|
361
350
|
constraintId: 'c',
|
|
362
351
|
severity: 'error',
|
|
@@ -364,7 +353,7 @@ describe('包根类型面(ADR-0022 关联类型随迁)', () => {
|
|
|
364
353
|
result: 'pass',
|
|
365
354
|
};
|
|
366
355
|
expect(liveCollector).toEqual({});
|
|
367
|
-
expect(liveAnalyzer.
|
|
356
|
+
expect(liveAnalyzer.thresholds?.failRate).toBe(0.5);
|
|
368
357
|
expect(liveTrace.result).toBe('pass');
|
|
369
358
|
});
|
|
370
359
|
|