@dommaker/harness 2.0.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 +19 -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 -100
- 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/commands/acceptance.d.ts.map +1 -1
- package/dist/cli/commands/acceptance.js +1 -1
- 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 +17 -8
- 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 +4 -6
- 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 +2 -7
- 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/knowledge/health.d.ts +4 -2
- package/dist/cli/commands/knowledge/health.d.ts.map +1 -1
- package/dist/cli/commands/knowledge/health.js +25 -19
- package/dist/cli/commands/knowledge/health.js.map +1 -1
- package/dist/cli/commands/knowledge/import.d.ts +1 -1
- package/dist/cli/commands/knowledge/import.js +2 -2
- package/dist/cli/commands/knowledge/import.js.map +1 -1
- package/dist/cli/commands/knowledge/search.d.ts.map +1 -1
- package/dist/cli/commands/knowledge/search.js +1 -2
- package/dist/cli/commands/knowledge/search.js.map +1 -1
- 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 +6 -18
- package/dist/cli/commands/knowledge-view.d.ts.map +1 -1
- package/dist/cli/commands/knowledge-view.js +10 -61
- 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 +7 -6
- package/dist/cli/commands/passes-gate.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 +12 -18
- 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 +15 -4
- 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 +6 -0
- package/dist/cli/commands/security.js.map +1 -1
- package/dist/{core → cli/commands}/spec/validator.d.ts +9 -18
- package/dist/cli/commands/spec/validator.d.ts.map +1 -0
- package/dist/{core → cli/commands}/spec/validator.js +11 -42
- 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 +31 -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.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 +3 -9
- package/dist/cli/commands/sync-docs/capabilities-syncer.js.map +1 -1
- package/dist/cli/commands/sync-docs/compact.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/compact.js +15 -15
- package/dist/cli/commands/sync-docs/compact.js.map +1 -1
- package/dist/cli/commands/sync-docs/main-flow.d.ts +7 -23
- package/dist/cli/commands/sync-docs/main-flow.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/main-flow.js +27 -419
- package/dist/cli/commands/sync-docs/main-flow.js.map +1 -1
- package/dist/cli/commands/sync-docs/project-reader.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/project-reader.js +2 -1
- 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/context/index.d.ts +1 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/context/session-manager.d.ts +0 -4
- package/dist/context/session-manager.d.ts.map +1 -1
- package/dist/context/session-manager.js +0 -36
- package/dist/context/session-manager.js.map +1 -1
- package/dist/context/types.d.ts +2 -24
- 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 +26 -30
- package/dist/core/constraint-lifecycle.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 +3 -8
- package/dist/core/constraints/checkers/templated/exec.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 -81
- 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 -5
- 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} +1 -6
- 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 +0 -1
- 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/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/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 -43
- 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/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/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 +0 -4
- package/dist/core/validators/passes-gate.d.ts.map +1 -1
- package/dist/core/validators/passes-gate.js +0 -9
- 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 +7 -2
- package/dist/gates/acceptance.d.ts.map +1 -1
- package/dist/gates/acceptance.js +30 -36
- package/dist/gates/acceptance.js.map +1 -1
- package/dist/gates/command.d.ts +0 -16
- 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 +0 -8
- package/dist/gates/contract.d.ts.map +1 -1
- package/dist/gates/contract.js +3 -17
- package/dist/gates/contract.js.map +1 -1
- package/dist/gates/definitions.d.ts +1 -1
- package/dist/gates/performance.d.ts +1 -15
- package/dist/gates/performance.d.ts.map +1 -1
- package/dist/gates/performance.js +0 -19
- package/dist/gates/performance.js.map +1 -1
- package/dist/gates/registry.d.ts.map +1 -1
- package/dist/gates/registry.js +2 -5
- 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 +22 -19
- package/dist/gates/review.js.map +1 -1
- package/dist/gates/security.d.ts +2 -9
- package/dist/gates/security.d.ts.map +1 -1
- package/dist/gates/security.js +7 -35
- package/dist/gates/security.js.map +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -16
- package/dist/index.js.map +1 -1
- package/dist/knowledge/audit-rules.d.ts +2 -0
- package/dist/knowledge/audit-rules.d.ts.map +1 -1
- package/dist/knowledge/audit-rules.js +10 -7
- package/dist/knowledge/audit-rules.js.map +1 -1
- package/dist/knowledge/audit.d.ts.map +1 -1
- package/dist/knowledge/audit.js +3 -1
- 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} +135 -182
- package/dist/knowledge/cold-start.js.map +1 -0
- package/dist/knowledge/index.d.ts +3 -5
- package/dist/knowledge/index.d.ts.map +1 -1
- package/dist/knowledge/index.js +3 -9
- package/dist/knowledge/index.js.map +1 -1
- package/dist/knowledge/ingest.d.ts +29 -1
- package/dist/knowledge/ingest.d.ts.map +1 -1
- package/dist/knowledge/ingest.js +97 -7
- 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 +12 -19
- package/dist/knowledge/lifecycle.js.map +1 -1
- package/dist/knowledge/query.js +1 -1
- 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 +9 -27
- 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 +1 -52
- package/dist/monitoring/trace-analyzer.d.ts.map +1 -1
- package/dist/monitoring/trace-analyzer.js +2 -131
- 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 +3 -25
- package/dist/monitoring/traces.js.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/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/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/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/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/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 +1 -1
- package/dist/utils/package-json.js +1 -1
- package/package.json +1 -1
- package/src/CONTEXT.md +9 -9
- 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 +0 -32
- 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__/iron-laws.test.ts +9 -16
- package/src/__tests__/layering.test.ts +3 -3
- package/src/__tests__/project-config-loader.test.ts +2 -1
- package/src/__tests__/public-exports.test.ts +4 -15
- package/src/__tests__/public-type-surface.test.ts +1 -22
- package/src/__tests__/public-value-surface.test.ts +0 -3
- 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 +4 -7
- 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 -114
- 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/commands/CONTEXT.md +11 -11
- 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__/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__/contract.test.ts +11 -4
- package/src/cli/commands/__tests__/failure.test.ts +9 -9
- package/src/cli/commands/__tests__/knowledge-view.test.ts +28 -158
- package/src/cli/commands/__tests__/knowledge.test.ts +24 -4
- package/src/cli/commands/__tests__/numeric-flag-assembly.test.ts +2 -1
- package/src/cli/commands/__tests__/passes-gate.test.ts +5 -5
- package/src/cli/commands/__tests__/project-path-convention.test.ts +4 -21
- package/src/cli/commands/__tests__/registry.test.ts +2 -0
- package/src/cli/commands/__tests__/release.test.ts +1 -1
- 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 +1 -1
- package/src/cli/commands/check.ts +12 -6
- package/src/cli/commands/command.ts +7 -6
- 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 +30 -10
- package/src/cli/commands/contract.ts +4 -6
- package/src/cli/commands/definitions.ts +12 -84
- package/src/cli/commands/failure.ts +7 -8
- package/src/cli/commands/knowledge/health.ts +25 -21
- package/src/cli/commands/knowledge/import.ts +1 -1
- package/src/cli/commands/knowledge/search.ts +2 -3
- package/src/cli/commands/knowledge/store-access.ts +40 -0
- package/src/cli/commands/knowledge-view.ts +8 -32
- package/src/cli/commands/passes-gate.ts +9 -8
- package/src/cli/commands/release.ts +12 -13
- package/src/cli/commands/review.ts +15 -4
- package/src/cli/commands/security.ts +7 -0
- package/src/{core → cli/commands}/spec/__tests__/validator.test.ts +15 -53
- package/src/{core → cli/commands}/spec/validator.ts +15 -54
- package/src/cli/commands/spec-baseline-check.ts +36 -313
- package/src/cli/commands/spec.ts +15 -11
- package/src/cli/commands/status.ts +0 -2
- package/src/cli/commands/sync-docs/capabilities-syncer.ts +4 -10
- package/src/cli/commands/sync-docs/compact.ts +12 -11
- package/src/cli/commands/sync-docs/main-flow.ts +32 -472
- package/src/cli/commands/sync-docs/project-reader.ts +2 -1
- 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/context/CONTEXT.md +2 -2
- package/src/context/__tests__/session-manager.test.ts +1 -59
- package/src/context/index.ts +0 -5
- package/src/context/session-manager.ts +0 -44
- package/src/context/types.ts +2 -37
- package/src/core/CONTEXT.md +9 -9
- package/src/core/app-constraints-loader.ts +5 -23
- package/src/core/constraint-lifecycle.ts +30 -39
- 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/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 +1 -7
- 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 -85
- package/src/core/constraints/definitions/{iron-laws.ts → errors.ts} +0 -4
- package/src/core/constraints/definitions/{guidelines.ts → warnings.ts} +0 -5
- package/src/core/constraints/definitions.ts +4 -3
- package/src/core/constraints/doc-freshness/runner.ts +63 -70
- package/src/core/constraints/find-constraint.ts +24 -0
- package/src/core/constraints/governance-accessors.ts +74 -0
- package/src/core/constraints/index.ts +0 -5
- 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 -68
- 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/check-handlers/file.ts +48 -5
- package/src/core/validators/checkpoint.ts +52 -85
- package/src/core/validators/cso.ts +1 -12
- package/src/core/validators/passes-gate.ts +0 -10
- 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 +2 -4
- package/src/gates/__tests__/command-single-predicate.test.ts +15 -60
- package/src/gates/__tests__/command.test.ts +0 -13
- package/src/gates/__tests__/gate-interface.test.ts +3 -5
- package/src/gates/__tests__/performance.test.ts +5 -51
- 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 +25 -44
- package/src/gates/acceptance.ts +31 -33
- package/src/gates/command.ts +0 -33
- package/src/gates/contract.ts +1 -18
- package/src/gates/definitions.ts +1 -1
- package/src/gates/performance.ts +0 -23
- package/src/gates/registry.ts +2 -4
- package/src/gates/review.ts +30 -21
- package/src/gates/security.ts +4 -44
- package/src/index.ts +3 -28
- package/src/knowledge/CONTEXT.md +14 -20
- 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 +2 -3
- package/src/knowledge/__tests__/store.test.ts +2 -4
- package/src/knowledge/__tests__/tree-walker.test.ts +5 -13
- package/src/knowledge/audit-rules.ts +10 -6
- package/src/knowledge/audit.ts +3 -1
- package/src/knowledge/{import.ts → cold-start.ts} +148 -191
- package/src/knowledge/index.ts +2 -9
- package/src/knowledge/ingest.ts +110 -7
- package/src/knowledge/lifecycle.ts +11 -19
- package/src/knowledge/query.ts +1 -1
- package/src/knowledge/store.ts +12 -34
- 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 +2 -161
- package/src/monitoring/traces.ts +3 -29
- package/src/types/command-definition.ts +85 -0
- package/src/types/constraint.ts +3 -32
- package/src/types/failure.ts +7 -113
- package/src/types/spec.ts +0 -4
- package/src/types/trace.ts +0 -6
- package/src/utils/__tests__/jsonl-skip-disposition.test.ts +4 -7
- package/src/utils/clip.ts +12 -0
- package/src/utils/diff-parse.ts +80 -0
- 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 +1 -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/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/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/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 -122
- package/dist/knowledge/reference-tracker.js.map +0 -1
- package/src/__tests__/spec-validator.test.ts +0 -58
- package/src/cli/commands/knowledge/migrate.ts +0 -61
- package/src/cli/commands/knowledge/sync-rag.ts +0 -48
- 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/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 -99
- /package/src/{hooks → bootstrap}/__tests__/bootstrap.test.ts +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { describe, it, expect } from '@jest/globals';
|
|
6
6
|
import { ErrorClassifier } from '../failure/classifier';
|
|
7
|
-
import { ErrorType, FailureLevel } from '../types
|
|
7
|
+
import { ErrorType, FailureLevel } from '../failure/error-types';
|
|
8
8
|
|
|
9
9
|
describe('ErrorClassifier', () => {
|
|
10
10
|
const classifier = new ErrorClassifier();
|
|
@@ -198,27 +198,6 @@ describe('ErrorClassifier', () => {
|
|
|
198
198
|
expect(level).toBe(FailureLevel.L2);
|
|
199
199
|
});
|
|
200
200
|
|
|
201
|
-
it('addRule 应该添加规则', () => {
|
|
202
|
-
const c = new ErrorClassifier();
|
|
203
|
-
c.addRule({
|
|
204
|
-
type: ErrorType.VALIDATION_ERROR,
|
|
205
|
-
keywords: ['my-custom-error'],
|
|
206
|
-
level: FailureLevel.L4,
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
const error = new Error('my-custom-error occurred');
|
|
210
|
-
const result = c.classify(error);
|
|
211
|
-
expect(result.type).toBe(ErrorType.VALIDATION_ERROR);
|
|
212
|
-
expect(result.level).toBe(FailureLevel.L4);
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
it('getRules 应该返回所有规则', () => {
|
|
216
|
-
const c = new ErrorClassifier();
|
|
217
|
-
const rules = c.getRules();
|
|
218
|
-
expect(Array.isArray(rules)).toBe(true);
|
|
219
|
-
expect(rules.length).toBeGreaterThan(0);
|
|
220
|
-
});
|
|
221
|
-
|
|
222
201
|
it('应该支持 pattern 匹配', () => {
|
|
223
202
|
const c = new ErrorClassifier({
|
|
224
203
|
rules: [
|
|
@@ -281,24 +260,4 @@ describe('ErrorClassifier', () => {
|
|
|
281
260
|
expect(result.type).not.toBe(ErrorType.VALIDATION_ERROR);
|
|
282
261
|
});
|
|
283
262
|
});
|
|
284
|
-
|
|
285
|
-
describe('快速函数', () => {
|
|
286
|
-
it('classifyError 应该快速分类', () => {
|
|
287
|
-
const { classifyError } = require('../failure/classifier');
|
|
288
|
-
const type = classifyError(new Error('test failed'));
|
|
289
|
-
expect(type).toBe(ErrorType.TEST_FAILED);
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
it('getFailureLevel 应该快速获取等级', () => {
|
|
293
|
-
const { getFailureLevel } = require('../failure/classifier');
|
|
294
|
-
const level = getFailureLevel(ErrorType.TEST_FAILED);
|
|
295
|
-
expect(level).toBe(FailureLevel.L1);
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
it('createErrorClassifier 应该创建实例', () => {
|
|
299
|
-
const { createErrorClassifier } = require('../failure/classifier');
|
|
300
|
-
const c = createErrorClassifier();
|
|
301
|
-
expect(c).toBeInstanceOf(ErrorClassifier);
|
|
302
|
-
});
|
|
303
|
-
});
|
|
304
263
|
});
|
|
@@ -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', () => {
|
|
@@ -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,11 +18,10 @@ 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
27
|
it('severity 分桶 = 3 error + 4 warning(ADR-0032:凭证扫描升 error、docs_freshness 降 warning)', () => {
|
|
@@ -29,9 +29,6 @@ describe('Constraint System', () => {
|
|
|
29
29
|
const warnings = Object.values(CONSTRAINTS).filter(c => c.severity === 'warning');
|
|
30
30
|
expect(errors).toHaveLength(3);
|
|
31
31
|
expect(warnings).toHaveLength(4);
|
|
32
|
-
Object.values(CONSTRAINTS).forEach(c => {
|
|
33
|
-
expect(c.kind).toBe('check');
|
|
34
|
-
});
|
|
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);
|
|
@@ -75,7 +75,7 @@ const DOWNSTREAM: Record<string, string[]> = {
|
|
|
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';
|
|
@@ -41,13 +41,10 @@ const EXPECTED_RUNTIME_EXPORTS = [
|
|
|
41
41
|
'FileKnowledgeStore',
|
|
42
42
|
'HARNESS_CONFIG_FILES',
|
|
43
43
|
'KnowledgeAudit',
|
|
44
|
-
'KnowledgeHealthScorer',
|
|
45
44
|
'KnowledgeIngest',
|
|
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
|
|