@dommaker/harness 0.16.6 → 0.16.8
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 +15 -0
- package/README.md +54 -14
- package/bin/harness.js +56 -96
- package/dist/architecture/constraint-engine.d.ts.map +1 -1
- package/dist/architecture/constraint-engine.js +0 -4
- package/dist/architecture/constraint-engine.js.map +1 -1
- package/dist/architecture/cross-project-checker.d.ts.map +1 -1
- package/dist/architecture/cross-project-checker.js +5 -25
- package/dist/architecture/cross-project-checker.js.map +1 -1
- package/dist/cli/commands/analyze-sessions.d.ts +2 -0
- package/dist/cli/commands/analyze-sessions.d.ts.map +1 -1
- package/dist/cli/commands/analyze-sessions.js +25 -181
- package/dist/cli/commands/analyze-sessions.js.map +1 -1
- package/dist/cli/commands/check.d.ts +1 -0
- package/dist/cli/commands/check.d.ts.map +1 -1
- package/dist/cli/commands/check.js +24 -216
- package/dist/cli/commands/check.js.map +1 -1
- package/dist/cli/commands/doc-freshness-check.d.ts.map +1 -1
- package/dist/cli/commands/doc-freshness-check.js +14 -28
- package/dist/cli/commands/doc-freshness-check.js.map +1 -1
- package/dist/cli/commands/flow.d.ts.map +1 -1
- package/dist/cli/commands/flow.js +2 -1
- package/dist/cli/commands/flow.js.map +1 -1
- package/dist/cli/commands/init.js +2 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/posteval-plan.d.ts.map +1 -1
- package/dist/cli/commands/posteval-plan.js +0 -1
- package/dist/cli/commands/posteval-plan.js.map +1 -1
- package/dist/cli/commands/release.js +1 -1
- package/dist/cli/commands/release.js.map +1 -1
- package/dist/cli/commands/report.d.ts.map +1 -1
- package/dist/cli/commands/report.js +2 -0
- package/dist/cli/commands/report.js.map +1 -1
- package/dist/cli/commands/spec-baseline-check.d.ts.map +1 -1
- package/dist/cli/commands/spec-baseline-check.js +12 -23
- package/dist/cli/commands/spec-baseline-check.js.map +1 -1
- package/dist/cli/commands/sync-docs/agents-syncer.d.ts +19 -0
- package/dist/cli/commands/sync-docs/agents-syncer.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/agents-syncer.js +288 -0
- package/dist/cli/commands/sync-docs/agents-syncer.js.map +1 -0
- package/dist/cli/commands/sync-docs/capabilities-syncer.d.ts +37 -0
- package/dist/cli/commands/sync-docs/capabilities-syncer.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/capabilities-syncer.js +235 -0
- package/dist/cli/commands/sync-docs/capabilities-syncer.js.map +1 -0
- package/dist/cli/commands/sync-docs/context-syncer.d.ts +17 -0
- package/dist/cli/commands/sync-docs/context-syncer.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/context-syncer.js +143 -0
- package/dist/cli/commands/sync-docs/context-syncer.js.map +1 -0
- package/dist/cli/commands/{sync-docs.d.ts → sync-docs/index.d.ts} +9 -2
- package/dist/cli/commands/sync-docs/index.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/index.js +338 -0
- package/dist/cli/commands/sync-docs/index.js.map +1 -0
- package/dist/cli/commands/sync-docs/preserve-block.d.ts +24 -0
- package/dist/cli/commands/sync-docs/preserve-block.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/preserve-block.js +55 -0
- package/dist/cli/commands/sync-docs/preserve-block.js.map +1 -0
- package/dist/cli/commands/sync-docs/project-reader.d.ts +41 -0
- package/dist/cli/commands/sync-docs/project-reader.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/project-reader.js +183 -0
- package/dist/cli/commands/sync-docs/project-reader.js.map +1 -0
- package/dist/cli/commands/update-user-model.d.ts +2 -0
- package/dist/cli/commands/update-user-model.d.ts.map +1 -1
- package/dist/cli/commands/update-user-model.js +19 -90
- package/dist/cli/commands/update-user-model.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +3 -0
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/commands/validate.js +6 -39
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/session-mining/corrections.d.ts +17 -0
- package/dist/cli/session-mining/corrections.d.ts.map +1 -0
- package/dist/cli/session-mining/corrections.js +58 -0
- package/dist/cli/session-mining/corrections.js.map +1 -0
- package/dist/cli/session-mining/index.d.ts +13 -0
- package/dist/cli/session-mining/index.d.ts.map +1 -0
- package/dist/{core/spec → cli/session-mining}/index.js +9 -3
- package/dist/cli/session-mining/index.js.map +1 -0
- package/dist/cli/session-mining/text.d.ts +31 -0
- package/dist/cli/session-mining/text.d.ts.map +1 -0
- package/dist/cli/session-mining/text.js +126 -0
- package/dist/cli/session-mining/text.js.map +1 -0
- package/dist/cli/session-mining/transcript.d.ts +28 -0
- package/dist/cli/session-mining/transcript.d.ts.map +1 -0
- package/dist/cli/session-mining/transcript.js +123 -0
- package/dist/cli/session-mining/transcript.js.map +1 -0
- package/dist/constraints/lifecycle-runner.d.ts +1 -1
- package/dist/constraints/lifecycle-runner.d.ts.map +1 -1
- package/dist/context/compaction.d.ts.map +1 -1
- package/dist/context/compaction.js +2 -3
- package/dist/context/compaction.js.map +1 -1
- package/dist/context/knowledge-injector.d.ts.map +1 -1
- package/dist/context/tool-output-budget.d.ts +1 -1
- package/dist/context/tool-output-budget.d.ts.map +1 -1
- package/dist/context/tool-output-budget.js +1 -1
- package/dist/context/tool-output-budget.js.map +1 -1
- package/dist/core/constraints/capabilities-parser.d.ts +24 -0
- package/dist/core/constraints/capabilities-parser.d.ts.map +1 -0
- package/dist/core/constraints/capabilities-parser.js +95 -0
- package/dist/core/constraints/capabilities-parser.js.map +1 -0
- package/dist/core/constraints/checker.d.ts +37 -100
- package/dist/core/constraints/checker.d.ts.map +1 -1
- package/dist/core/constraints/checker.js +150 -737
- package/dist/core/constraints/checker.js.map +1 -1
- package/dist/core/constraints/checkers/always-pass.d.ts +17 -0
- package/dist/core/constraints/checkers/always-pass.d.ts.map +1 -0
- package/dist/core/constraints/checkers/always-pass.js +23 -0
- package/dist/core/constraints/checkers/always-pass.js.map +1 -0
- package/dist/core/constraints/checkers/capability-sync.d.ts +10 -0
- package/dist/core/constraints/checkers/capability-sync.d.ts.map +1 -0
- package/dist/core/constraints/checkers/capability-sync.js +60 -0
- package/dist/core/constraints/checkers/capability-sync.js.map +1 -0
- package/dist/core/constraints/checkers/context-doc-sync.d.ts +6 -0
- package/dist/core/constraints/checkers/context-doc-sync.d.ts.map +1 -0
- package/dist/core/constraints/checkers/context-doc-sync.js +35 -0
- package/dist/core/constraints/checkers/context-doc-sync.js.map +1 -0
- package/dist/core/constraints/checkers/docs-freshness.d.ts +10 -0
- package/dist/core/constraints/checkers/docs-freshness.d.ts.map +1 -0
- package/dist/core/constraints/checkers/docs-freshness.js +111 -0
- package/dist/core/constraints/checkers/docs-freshness.js.map +1 -0
- package/dist/core/constraints/checkers/guideline-flags.d.ts +9 -0
- package/dist/core/constraints/checkers/guideline-flags.d.ts.map +1 -0
- package/dist/core/constraints/checkers/guideline-flags.js +13 -0
- package/dist/core/constraints/checkers/guideline-flags.js.map +1 -0
- package/dist/core/constraints/checkers/index.d.ts +17 -0
- package/dist/core/constraints/checkers/index.d.ts.map +1 -0
- package/dist/core/constraints/checkers/index.js +82 -0
- package/dist/core/constraints/checkers/index.js.map +1 -0
- package/dist/core/constraints/checkers/iron-flags.d.ts +14 -0
- package/dist/core/constraints/checkers/iron-flags.d.ts.map +1 -0
- package/dist/core/constraints/checkers/iron-flags.js +24 -0
- package/dist/core/constraints/checkers/iron-flags.js.map +1 -0
- package/dist/core/constraints/checkers/no-any-type.d.ts +6 -0
- package/dist/core/constraints/checkers/no-any-type.d.ts.map +1 -0
- package/dist/core/constraints/checkers/no-any-type.js +42 -0
- package/dist/core/constraints/checkers/no-any-type.js.map +1 -0
- package/dist/core/constraints/checkers/no-bypass-checkpoint.d.ts +6 -0
- package/dist/core/constraints/checkers/no-bypass-checkpoint.d.ts.map +1 -0
- package/dist/core/constraints/checkers/no-bypass-checkpoint.js +40 -0
- package/dist/core/constraints/checkers/no-bypass-checkpoint.js.map +1 -0
- package/dist/core/constraints/checkers/no-excuse-patterns.d.ts +6 -0
- package/dist/core/constraints/checkers/no-excuse-patterns.d.ts.map +1 -0
- package/dist/core/constraints/checkers/no-excuse-patterns.js +25 -0
- package/dist/core/constraints/checkers/no-excuse-patterns.js.map +1 -0
- package/dist/core/constraints/checkers/no-fuzzy-completion-claim.d.ts +6 -0
- package/dist/core/constraints/checkers/no-fuzzy-completion-claim.d.ts.map +1 -0
- package/dist/core/constraints/checkers/no-fuzzy-completion-claim.js +34 -0
- package/dist/core/constraints/checkers/no-fuzzy-completion-claim.js.map +1 -0
- package/dist/core/constraints/checkers/no-performative-agreement.d.ts +8 -0
- package/dist/core/constraints/checkers/no-performative-agreement.d.ts.map +1 -0
- package/dist/core/constraints/checkers/no-performative-agreement.js +23 -0
- package/dist/core/constraints/checkers/no-performative-agreement.js.map +1 -0
- package/dist/core/constraints/checkers/no-simplification-without-approval.d.ts +6 -0
- package/dist/core/constraints/checkers/no-simplification-without-approval.d.ts.map +1 -0
- package/dist/core/constraints/checkers/no-simplification-without-approval.js +30 -0
- package/dist/core/constraints/checkers/no-simplification-without-approval.js.map +1 -0
- package/dist/core/constraints/checkers/no-test-simplification.d.ts +6 -0
- package/dist/core/constraints/checkers/no-test-simplification.d.ts.map +1 -0
- package/dist/core/constraints/checkers/no-test-simplification.js +29 -0
- package/dist/core/constraints/checkers/no-test-simplification.js.map +1 -0
- package/dist/core/constraints/checkers/test-coverage.d.ts +6 -0
- package/dist/core/constraints/checkers/test-coverage.d.ts.map +1 -0
- package/dist/core/constraints/checkers/test-coverage.js +33 -0
- package/dist/core/constraints/checkers/test-coverage.js.map +1 -0
- package/dist/core/constraints/checkers/types.d.ts +43 -0
- package/dist/core/constraints/checkers/types.d.ts.map +1 -0
- package/dist/core/constraints/checkers/types.js +23 -0
- package/dist/core/constraints/checkers/types.js.map +1 -0
- package/dist/core/constraints/checkers/yagni.d.ts +8 -0
- package/dist/core/constraints/checkers/yagni.d.ts.map +1 -0
- package/dist/core/constraints/checkers/yagni.js +96 -0
- package/dist/core/constraints/checkers/yagni.js.map +1 -0
- package/dist/core/constraints/context-builder.d.ts +67 -0
- package/dist/core/constraints/context-builder.d.ts.map +1 -0
- package/dist/core/constraints/context-builder.js +294 -0
- package/dist/core/constraints/context-builder.js.map +1 -0
- package/dist/core/constraints/definitions/guidelines.d.ts +7 -0
- package/dist/core/constraints/definitions/guidelines.d.ts.map +1 -0
- package/dist/core/constraints/definitions/guidelines.js +641 -0
- package/dist/core/constraints/definitions/guidelines.js.map +1 -0
- package/dist/core/constraints/definitions/iron-laws.d.ts +7 -0
- package/dist/core/constraints/definitions/iron-laws.d.ts.map +1 -0
- package/dist/core/constraints/definitions/iron-laws.js +322 -0
- package/dist/core/constraints/definitions/iron-laws.js.map +1 -0
- package/dist/core/constraints/definitions/tips.d.ts +7 -0
- package/dist/core/constraints/definitions/tips.d.ts.map +1 -0
- package/dist/core/constraints/definitions/tips.js +62 -0
- package/dist/core/constraints/definitions/tips.js.map +1 -0
- package/dist/core/constraints/definitions.d.ts +8 -21
- package/dist/core/constraints/definitions.d.ts.map +1 -1
- package/dist/core/constraints/definitions.js +15 -1048
- package/dist/core/constraints/definitions.js.map +1 -1
- 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/index.d.ts +4 -5
- package/dist/core/constraints/index.d.ts.map +1 -1
- package/dist/core/constraints/index.js +1 -16
- package/dist/core/constraints/index.js.map +1 -1
- package/dist/core/constraints/interceptor.d.ts.map +1 -1
- package/dist/core/constraints/interceptor.js.map +1 -1
- package/dist/core/index.js +0 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/project-config-loader.d.ts +6 -4
- package/dist/core/project-config-loader.d.ts.map +1 -1
- package/dist/core/project-config-loader.js +46 -13
- package/dist/core/project-config-loader.js.map +1 -1
- package/dist/core/validators/check-handlers/command.d.ts +7 -0
- package/dist/core/validators/check-handlers/command.d.ts.map +1 -0
- package/dist/core/validators/check-handlers/command.js +58 -0
- package/dist/core/validators/check-handlers/command.js.map +1 -0
- package/dist/core/validators/check-handlers/file.d.ts +10 -0
- package/dist/core/validators/check-handlers/file.d.ts.map +1 -0
- package/dist/core/validators/check-handlers/file.js +128 -0
- package/dist/core/validators/check-handlers/file.js.map +1 -0
- package/dist/core/validators/check-handlers/http.d.ts +7 -0
- package/dist/core/validators/check-handlers/http.d.ts.map +1 -0
- package/dist/core/validators/check-handlers/http.js +88 -0
- package/dist/core/validators/check-handlers/http.js.map +1 -0
- package/dist/core/validators/check-handlers/output.d.ts +15 -0
- package/dist/core/validators/check-handlers/output.d.ts.map +1 -0
- package/dist/core/validators/check-handlers/output.js +152 -0
- package/dist/core/validators/check-handlers/output.js.map +1 -0
- package/dist/core/validators/checkpoint.d.ts +4 -72
- package/dist/core/validators/checkpoint.d.ts.map +1 -1
- package/dist/core/validators/checkpoint.js +21 -400
- package/dist/core/validators/checkpoint.js.map +1 -1
- package/dist/core/validators/cso.js +1 -1
- package/dist/core/validators/cso.js.map +1 -1
- package/dist/core/validators/passes-gate.js +2 -2
- package/dist/core/validators/passes-gate.js.map +1 -1
- package/dist/dashboard/stats.d.ts.map +1 -1
- package/dist/dashboard/types.d.ts.map +1 -1
- package/dist/evolution/auto-evolve.d.ts +1 -2
- package/dist/evolution/auto-evolve.d.ts.map +1 -1
- package/dist/evolution/auto-evolve.js +2 -1
- package/dist/evolution/auto-evolve.js.map +1 -1
- package/dist/failure/types.d.ts +5 -85
- package/dist/failure/types.d.ts.map +1 -1
- package/dist/failure/types.js +19 -115
- package/dist/failure/types.js.map +1 -1
- package/dist/gates/contract.d.ts.map +1 -1
- package/dist/gates/contract.js.map +1 -1
- package/dist/gates/index.d.ts.map +1 -1
- package/dist/gates/index.js.map +1 -1
- package/dist/gates/performance.js +1 -1
- package/dist/gates/performance.js.map +1 -1
- package/dist/gates/security.d.ts.map +1 -1
- package/dist/gates/security.js +1 -1
- package/dist/gates/security.js.map +1 -1
- package/dist/hooks/bootstrap.d.ts.map +1 -1
- package/dist/hooks/bootstrap.js +6 -48
- package/dist/hooks/bootstrap.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/knowledge/audit.d.ts.map +1 -1
- package/dist/knowledge/doctor.d.ts.map +1 -1
- package/dist/knowledge/doctor.js.map +1 -1
- package/dist/knowledge/import.d.ts.map +1 -1
- package/dist/knowledge/import.js +1 -1
- package/dist/knowledge/import.js.map +1 -1
- package/dist/knowledge/index-generator.d.ts.map +1 -1
- package/dist/knowledge/index-generator.js +0 -1
- package/dist/knowledge/index-generator.js.map +1 -1
- package/dist/knowledge/ingest.d.ts.map +1 -1
- package/dist/knowledge/ingest.js +1 -1
- package/dist/knowledge/ingest.js.map +1 -1
- package/dist/knowledge/lint.d.ts +1 -1
- package/dist/knowledge/lint.d.ts.map +1 -1
- package/dist/knowledge/lint.js +2 -2
- package/dist/knowledge/lint.js.map +1 -1
- package/dist/knowledge/primitives/code-structure.d.ts.map +1 -1
- package/dist/knowledge/primitives/code-structure.js +29 -12
- package/dist/knowledge/primitives/code-structure.js.map +1 -1
- package/dist/knowledge/query.d.ts.map +1 -1
- package/dist/knowledge/query.js.map +1 -1
- package/dist/knowledge/store.d.ts.map +1 -1
- package/dist/llm/adapter.d.ts +3 -3
- package/dist/llm/adapter.d.ts.map +1 -1
- package/dist/llm/adapter.js +3 -3
- package/dist/llm/adapter.js.map +1 -1
- package/dist/monitoring/analyzer-base.d.ts +50 -0
- package/dist/monitoring/analyzer-base.d.ts.map +1 -0
- package/dist/monitoring/analyzer-base.js +146 -0
- package/dist/monitoring/analyzer-base.js.map +1 -0
- package/dist/monitoring/constraint-doctor.d.ts +3 -46
- package/dist/monitoring/constraint-doctor.d.ts.map +1 -1
- package/dist/monitoring/constraint-doctor.js +11 -113
- package/dist/monitoring/constraint-doctor.js.map +1 -1
- package/dist/monitoring/constraint-evolver.d.ts +9 -63
- package/dist/monitoring/constraint-evolver.d.ts.map +1 -1
- package/dist/monitoring/constraint-evolver.js +8 -10
- package/dist/monitoring/constraint-evolver.js.map +1 -1
- package/dist/monitoring/diagnosis-rules.d.ts +18 -0
- package/dist/monitoring/diagnosis-rules.d.ts.map +1 -0
- package/dist/monitoring/diagnosis-rules.js +119 -0
- package/dist/monitoring/diagnosis-rules.js.map +1 -0
- package/dist/monitoring/knowledge-doctor.d.ts.map +1 -1
- package/dist/monitoring/knowledge-doctor.js.map +1 -1
- package/dist/monitoring/performance-analyzer.d.ts +0 -12
- package/dist/monitoring/performance-analyzer.d.ts.map +1 -1
- package/dist/monitoring/performance-analyzer.js +13 -93
- package/dist/monitoring/performance-analyzer.js.map +1 -1
- package/dist/monitoring/performance-collector.d.ts +0 -8
- package/dist/monitoring/performance-collector.d.ts.map +1 -1
- package/dist/monitoring/performance-collector.js +0 -21
- package/dist/monitoring/performance-collector.js.map +1 -1
- package/dist/monitoring/trace-analyzer.d.ts +0 -8
- package/dist/monitoring/trace-analyzer.d.ts.map +1 -1
- package/dist/monitoring/trace-analyzer.js +9 -91
- package/dist/monitoring/trace-analyzer.js.map +1 -1
- package/dist/presets/index.d.ts +1 -1
- package/dist/presets/index.d.ts.map +1 -1
- package/dist/presets/index.js +1 -4
- package/dist/presets/index.js.map +1 -1
- package/dist/presets/standard.d.ts +0 -9
- package/dist/presets/standard.d.ts.map +1 -1
- package/dist/presets/standard.js +1 -16
- package/dist/presets/standard.js.map +1 -1
- package/dist/safety/output-guardrail.d.ts +0 -1
- package/dist/safety/output-guardrail.d.ts.map +1 -1
- package/dist/safety/output-guardrail.js +0 -3
- package/dist/safety/output-guardrail.js.map +1 -1
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/types/constraint.d.ts +5 -59
- package/dist/types/constraint.d.ts.map +1 -1
- package/dist/types/constraint.js +1 -39
- package/dist/types/constraint.js.map +1 -1
- package/dist/types/failure.d.ts +89 -0
- package/dist/types/failure.d.ts.map +1 -0
- package/dist/types/failure.js +121 -0
- package/dist/types/failure.js.map +1 -0
- package/dist/types/index.d.ts +2 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +7 -6
- package/dist/types/index.js.map +1 -1
- package/dist/types/monitoring-types.d.ts +114 -0
- package/dist/types/monitoring-types.d.ts.map +1 -0
- package/dist/types/monitoring-types.js +10 -0
- package/dist/types/monitoring-types.js.map +1 -0
- package/dist/utils/detect-source-roots.js.map +1 -1
- package/dist/utils/file-walk.d.ts +33 -0
- package/dist/utils/file-walk.d.ts.map +1 -0
- package/dist/utils/file-walk.js +89 -0
- package/dist/utils/file-walk.js.map +1 -0
- package/dist/verification/rules-based.d.ts.map +1 -1
- package/dist/verification/rules-based.js.map +1 -1
- package/package.json +3 -7
- package/src/__tests__/checker-extra.test.ts +0 -30
- package/src/__tests__/checker.test.ts +0 -33
- package/src/__tests__/checkpoint.test.ts +46 -46
- package/src/__tests__/constraint-evolver.test.ts +22 -21
- package/src/__tests__/doctor-evolver.test.ts +3 -3
- package/src/__tests__/iron-laws.test.ts +0 -27
- package/src/__tests__/presets.test.ts +1 -40
- package/src/architecture/constraint-engine.ts +0 -5
- package/src/architecture/cross-project-checker.ts +6 -24
- package/src/cli/commands/__tests__/check.test.ts +3 -1
- package/src/cli/commands/__tests__/sync-docs.test.ts +77 -0
- package/src/cli/commands/__tests__/validate.test.ts +5 -0
- package/src/cli/commands/analyze-sessions.ts +31 -185
- package/src/cli/commands/check.ts +26 -225
- package/src/cli/commands/doc-freshness-check.ts +14 -25
- package/src/cli/commands/flow.ts +5 -3
- package/src/cli/commands/init.ts +3 -3
- package/src/cli/commands/posteval-plan.ts +0 -1
- package/src/cli/commands/release.ts +1 -1
- package/src/cli/commands/report.ts +2 -0
- package/src/cli/commands/spec-baseline-check.ts +12 -19
- package/src/cli/commands/sync-docs/agents-syncer.ts +280 -0
- package/src/cli/commands/sync-docs/capabilities-syncer.ts +229 -0
- package/src/cli/commands/sync-docs/context-syncer.ts +108 -0
- package/src/cli/commands/sync-docs/index.ts +355 -0
- package/src/cli/commands/sync-docs/preserve-block.ts +59 -0
- package/src/cli/commands/sync-docs/project-reader.ts +163 -0
- package/src/cli/commands/update-user-model.ts +23 -87
- package/src/cli/commands/validate.ts +6 -40
- package/src/cli/session-mining/corrections.ts +56 -0
- package/src/cli/session-mining/index.ts +13 -0
- package/src/cli/session-mining/text.ts +117 -0
- package/src/cli/session-mining/transcript.ts +107 -0
- package/src/constraints/__tests__/lifecycle-runner.test.ts +1 -1
- package/src/constraints/lifecycle-runner.ts +1 -1
- package/src/context/compaction.ts +2 -3
- package/src/context/knowledge-injector.ts +1 -1
- package/src/context/tool-output-budget.ts +1 -1
- package/src/core/constraints/capabilities-parser.ts +70 -0
- package/src/core/constraints/checker.ts +170 -779
- package/src/core/constraints/checkers/always-pass.ts +22 -0
- package/src/core/constraints/checkers/capability-sync.ts +71 -0
- package/src/core/constraints/checkers/context-doc-sync.ts +36 -0
- package/src/core/constraints/checkers/docs-freshness.ts +116 -0
- package/src/core/constraints/checkers/guideline-flags.ts +30 -0
- package/src/core/constraints/checkers/index.ts +114 -0
- package/src/core/constraints/checkers/iron-flags.ts +62 -0
- package/src/core/constraints/checkers/no-any-type.ts +42 -0
- package/src/core/constraints/checkers/no-bypass-checkpoint.ts +40 -0
- package/src/core/constraints/checkers/no-excuse-patterns.ts +24 -0
- package/src/core/constraints/checkers/no-fuzzy-completion-claim.ts +33 -0
- package/src/core/constraints/checkers/no-performative-agreement.ts +22 -0
- package/src/core/constraints/checkers/no-simplification-without-approval.ts +29 -0
- package/src/core/constraints/checkers/no-test-simplification.ts +28 -0
- package/src/core/constraints/checkers/test-coverage.ts +35 -0
- package/src/core/constraints/checkers/types.ts +54 -0
- package/src/core/constraints/checkers/yagni.ts +65 -0
- package/src/core/constraints/context-builder.ts +262 -0
- package/src/core/constraints/definitions/guidelines.ts +668 -0
- package/src/core/constraints/definitions/iron-laws.ts +333 -0
- package/src/core/constraints/definitions/tips.ts +63 -0
- package/src/core/constraints/definitions.ts +9 -1086
- package/src/core/constraints/doc-freshness/runner.ts +2 -3
- package/src/core/constraints/index.ts +1 -27
- package/src/core/constraints/interceptor.ts +0 -2
- package/src/core/index.ts +1 -1
- package/src/core/project-config-loader.ts +49 -13
- package/src/core/validators/check-handlers/command.ts +58 -0
- package/src/core/validators/check-handlers/file.ts +104 -0
- package/src/core/validators/check-handlers/http.ts +88 -0
- package/src/core/validators/check-handlers/output.ts +165 -0
- package/src/core/validators/checkpoint.ts +32 -407
- package/src/core/validators/cso.ts +1 -1
- package/src/core/validators/passes-gate.ts +2 -2
- package/src/dashboard/stats.ts +1 -1
- package/src/dashboard/types.ts +1 -1
- package/src/evolution/__tests__/auto-evolve.test.ts +1 -2
- package/src/evolution/auto-evolve.ts +3 -3
- package/src/failure/types.ts +5 -161
- package/src/gates/contract.ts +0 -1
- package/src/gates/index.ts +0 -2
- package/src/gates/performance.ts +1 -1
- package/src/gates/security.ts +1 -3
- package/src/hooks/bootstrap.ts +6 -16
- package/src/index.ts +4 -1
- package/src/knowledge/__tests__/lifecycle.test.ts +4 -1
- package/src/knowledge/audit.ts +1 -1
- package/src/knowledge/doctor.ts +0 -1
- package/src/knowledge/import.ts +2 -2
- package/src/knowledge/index-generator.ts +0 -1
- package/src/knowledge/ingest.ts +1 -2
- package/src/knowledge/lint.ts +2 -2
- package/src/knowledge/primitives/__tests__/code-structure-degrade.test.ts +24 -0
- package/src/knowledge/primitives/code-structure.ts +36 -12
- package/src/knowledge/query.ts +0 -3
- package/src/knowledge/store.ts +1 -1
- package/src/llm/adapter.ts +3 -3
- package/src/monitoring/analyzer-base.ts +112 -0
- package/src/monitoring/constraint-doctor.ts +14 -175
- package/src/monitoring/constraint-evolver.ts +20 -92
- package/src/monitoring/diagnosis-rules.ts +132 -0
- package/src/monitoring/knowledge-doctor.ts +0 -1
- package/src/monitoring/performance-analyzer.ts +22 -72
- package/src/monitoring/performance-collector.ts +0 -22
- package/src/monitoring/trace-analyzer.ts +17 -73
- package/src/presets/__tests__/standard.test.ts +2 -17
- package/src/presets/index.ts +1 -3
- package/src/presets/standard.ts +1 -26
- package/src/safety/output-guardrail.ts +0 -4
- package/src/tools/registry.ts +1 -1
- package/src/types/__tests__/types.test.ts +1 -33
- package/src/types/constraint.ts +6 -75
- package/src/types/failure.ts +165 -0
- package/src/types/index.ts +7 -5
- package/src/types/monitoring-types.ts +150 -0
- package/src/utils/detect-source-roots.ts +1 -1
- package/src/utils/file-walk.ts +78 -0
- package/src/verification/rules-based.ts +0 -1
- package/bin/harness-knowledge-capture.js +0 -99
- package/bin/harness-knowledge-check.js +0 -164
- package/bin/harness-knowledge-track.js +0 -118
- package/dist/cli/commands/sync-docs.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs.js +0 -1074
- package/dist/cli/commands/sync-docs.js.map +0 -1
- package/dist/constraints/index.d.ts +0 -4
- package/dist/constraints/index.d.ts.map +0 -1
- package/dist/constraints/index.js +0 -20
- package/dist/constraints/index.js.map +0 -1
- package/dist/core/constraints/doc-freshness/auto-fix.d.ts +0 -23
- package/dist/core/constraints/doc-freshness/auto-fix.d.ts.map +0 -1
- package/dist/core/constraints/doc-freshness/auto-fix.js +0 -59
- package/dist/core/constraints/doc-freshness/auto-fix.js.map +0 -1
- package/dist/core/constraints/prompt-injection.d.ts +0 -16
- package/dist/core/constraints/prompt-injection.d.ts.map +0 -1
- package/dist/core/constraints/prompt-injection.js +0 -69
- package/dist/core/constraints/prompt-injection.js.map +0 -1
- package/dist/core/spec/index.d.ts +0 -7
- package/dist/core/spec/index.d.ts.map +0 -1
- package/dist/core/spec/index.js.map +0 -1
- package/dist/governance/executor.d.ts +0 -45
- package/dist/governance/executor.d.ts.map +0 -1
- package/dist/governance/executor.js +0 -243
- package/dist/governance/executor.js.map +0 -1
- package/dist/governance/index.d.ts +0 -9
- package/dist/governance/index.d.ts.map +0 -1
- package/dist/governance/index.js +0 -13
- package/dist/governance/index.js.map +0 -1
- package/dist/governance/types.d.ts +0 -46
- package/dist/governance/types.d.ts.map +0 -1
- package/dist/governance/types.js +0 -9
- package/dist/governance/types.js.map +0 -1
- package/dist/tools/definitions/definitions/core/code/fingerprint.sh +0 -273
- package/dist/tools/definitions/definitions/core/code/fingerprint.yml +0 -72
- package/dist/tools/definitions/definitions/core/code/parse.yml +0 -68
- package/dist/tools/definitions/definitions/core/code/register-language.sh +0 -475
- package/dist/tools/definitions/definitions/core/code/register-language.yml +0 -74
- package/dist/tools/definitions/definitions/core/docker/build.yml +0 -73
- package/dist/tools/definitions/definitions/core/docker/run.yml +0 -81
- package/dist/tools/definitions/definitions/core/file/copy.yml +0 -88
- package/dist/tools/definitions/definitions/core/file/read.yml +0 -69
- package/dist/tools/definitions/definitions/core/file/write.yml +0 -75
- package/dist/tools/definitions/definitions/core/git/branch.yml +0 -61
- package/dist/tools/definitions/definitions/core/git/cleanup-worktree.yml +0 -50
- package/dist/tools/definitions/definitions/core/git/clone.yml +0 -69
- package/dist/tools/definitions/definitions/core/git/commit.yml +0 -65
- package/dist/tools/definitions/definitions/core/git/push.yml +0 -79
- package/dist/tools/definitions/definitions/core/git/worktree.yml +0 -96
- package/dist/tools/definitions/definitions/core/notification/notify.sh +0 -152
- package/dist/tools/definitions/definitions/core/notification/notify.yml +0 -60
- package/dist/tools/definitions/definitions/core/npm/build.yml +0 -75
- package/dist/tools/definitions/definitions/core/npm/install.yml +0 -58
- package/dist/tools/definitions/definitions/core/npm/test.yml +0 -75
- package/dist/tools/definitions/definitions/core/validation/check-reuse.yml +0 -170
- package/dist/tools/definitions/definitions/core/validation/validate-handlers.yml +0 -118
- package/dist/tools/definitions/definitions/core/validation/validate-readme-stats.yml +0 -155
- package/dist/tools/definitions/definitions/core/validation/validate-yaml-syntax.yml +0 -134
- package/dist/tools/definitions/definitions/ext/browser/browser-automate.sh +0 -255
- package/dist/tools/definitions/definitions/ext/browser/browser-automate.yml +0 -166
- package/dist/tools/definitions/definitions/ext/browser/browser-close.sh +0 -104
- package/dist/tools/definitions/definitions/ext/browser/browser-close.yml +0 -55
- package/dist/tools/definitions/definitions/ext/browser/browser-mcp-debug.sh +0 -682
- package/dist/tools/definitions/definitions/ext/browser/browser-mcp-debug.yml +0 -167
- package/dist/tools/definitions/definitions/ext/browser/browser-start.sh +0 -101
- package/dist/tools/definitions/definitions/ext/browser/browser-start.yml +0 -62
- package/dist/tools/definitions/definitions/registry.json +0 -795
- package/dist/tools/definitions/definitions/std/README.md +0 -350
- package/dist/tools/definitions/definitions/std/analysis/analyze-codebase.yml +0 -72
- package/dist/tools/definitions/definitions/std/analysis/analyze-diff.yml +0 -182
- package/dist/tools/definitions/definitions/std/analysis/analyze-git-diff.yml +0 -70
- package/dist/tools/definitions/definitions/std/analysis/analyze-impact.yml +0 -78
- package/dist/tools/definitions/definitions/std/analysis/analyze-requirements.yml +0 -105
- package/dist/tools/definitions/definitions/std/analysis/brainstorm-options.yml +0 -106
- package/dist/tools/definitions/definitions/std/analysis/build-graph.yml +0 -154
- package/dist/tools/definitions/definitions/std/analysis/clarify-requirements.yml +0 -90
- package/dist/tools/definitions/definitions/std/analysis/detect-context.yml +0 -109
- package/dist/tools/definitions/definitions/std/analysis/detect-layers.yml +0 -125
- package/dist/tools/definitions/definitions/std/analysis/generate-tour.yml +0 -102
- package/dist/tools/definitions/definitions/std/analysis/search-enhance.yml +0 -105
- package/dist/tools/definitions/definitions/std/backlog/add.yml +0 -51
- package/dist/tools/definitions/definitions/std/backlog/decide.yml +0 -39
- package/dist/tools/definitions/definitions/std/backlog/github-sync.yml +0 -161
- package/dist/tools/definitions/definitions/std/backlog/list.yml +0 -53
- package/dist/tools/definitions/definitions/std/backlog/load.yml +0 -46
- package/dist/tools/definitions/definitions/std/backlog/resolve.yml +0 -37
- package/dist/tools/definitions/definitions/std/backlog/update.yml +0 -42
- package/dist/tools/definitions/definitions/std/bugfix/diagnose.yml +0 -68
- package/dist/tools/definitions/definitions/std/bugfix/fix.yml +0 -66
- package/dist/tools/definitions/definitions/std/bugfix/verify.yml +0 -69
- package/dist/tools/definitions/definitions/std/constraint/check-decomposition.yml +0 -103
- package/dist/tools/definitions/definitions/std/constraint/check-feature-list.yml +0 -77
- package/dist/tools/definitions/definitions/std/constraint/check-progress.yml +0 -97
- package/dist/tools/definitions/definitions/std/constraint/generate-report.yml +0 -147
- package/dist/tools/definitions/definitions/std/deploy/commit-push.yml +0 -33
- package/dist/tools/definitions/definitions/std/deploy/deploy-backend.yml +0 -37
- package/dist/tools/definitions/definitions/std/deploy/deploy-frontend.yml +0 -37
- package/dist/tools/definitions/definitions/std/deploy/rollback.yml +0 -148
- package/dist/tools/definitions/definitions/std/design/analyze-architecture-impact.yml +0 -113
- package/dist/tools/definitions/definitions/std/design/design-api.yml +0 -55
- package/dist/tools/definitions/definitions/std/design/design-architecture.yml +0 -97
- package/dist/tools/definitions/definitions/std/design/design-db.yml +0 -81
- package/dist/tools/definitions/definitions/std/design/generate-spec.yml +0 -182
- package/dist/tools/definitions/definitions/std/development/develop-api.yml +0 -85
- package/dist/tools/definitions/definitions/std/development/develop-backend.yml +0 -88
- package/dist/tools/definitions/definitions/std/development/develop-frontend.yml +0 -87
- package/dist/tools/definitions/definitions/std/development/develop-shared-types.yml +0 -74
- package/dist/tools/definitions/definitions/std/development/develop-task.yml +0 -122
- package/dist/tools/definitions/definitions/std/development/develop-tests.yml +0 -76
- package/dist/tools/definitions/definitions/std/development/execute-batch.yml +0 -152
- package/dist/tools/definitions/definitions/std/development/fix-issues.yml +0 -100
- package/dist/tools/definitions/definitions/std/development/implement-task.yml +0 -124
- package/dist/tools/definitions/definitions/std/development/review-fix-cycle.yml +0 -232
- package/dist/tools/definitions/definitions/std/evolution/implement.yml +0 -125
- package/dist/tools/definitions/definitions/std/evolution/prioritize.yml +0 -112
- package/dist/tools/definitions/definitions/std/evolution/report-gap.yml +0 -166
- package/dist/tools/definitions/definitions/std/file/read.yml +0 -21
- package/dist/tools/definitions/definitions/std/governance/aggregate-opinions.sh +0 -201
- package/dist/tools/definitions/definitions/std/governance/aggregate-opinions.yml +0 -79
- package/dist/tools/definitions/definitions/std/governance/audit-task.yml +0 -178
- package/dist/tools/definitions/definitions/std/governance/cast-vote.yml +0 -129
- package/dist/tools/definitions/definitions/std/governance/collect-issues.yml +0 -16
- package/dist/tools/definitions/definitions/std/governance/create-signed-document.yml +0 -23
- package/dist/tools/definitions/definitions/std/governance/create-voting-session.yml +0 -101
- package/dist/tools/definitions/definitions/std/governance/define-stance.sh +0 -243
- package/dist/tools/definitions/definitions/std/governance/define-stance.yml +0 -82
- package/dist/tools/definitions/definitions/std/governance/generate-review-report.yml +0 -23
- package/dist/tools/definitions/definitions/std/governance/impeach.yml +0 -179
- package/dist/tools/definitions/definitions/std/governance/multi-stance-review.yml +0 -154
- package/dist/tools/definitions/definitions/std/governance/prepare-artifact.yml +0 -20
- package/dist/tools/definitions/definitions/std/governance/review-spec-approval.yml +0 -262
- package/dist/tools/definitions/definitions/std/governance/rollback.yml +0 -186
- package/dist/tools/definitions/definitions/std/governance/stance-review.yml +0 -149
- package/dist/tools/definitions/definitions/std/governance/track-effect.yml +0 -199
- package/dist/tools/definitions/definitions/std/governance/vote-tally.yml +0 -144
- package/dist/tools/definitions/definitions/std/patch/execute.yml +0 -51
- package/dist/tools/definitions/definitions/std/planning/generate-tasks.yml +0 -36
- package/dist/tools/definitions/definitions/std/planning/load-tasks.yml +0 -44
- package/dist/tools/definitions/definitions/std/planning/split-batch.yml +0 -481
- package/dist/tools/definitions/definitions/std/planning/split-tasks.yml +0 -359
- package/dist/tools/definitions/definitions/std/planning/update-tasks.yml +0 -51
- package/dist/tools/definitions/definitions/std/planning/validate-tasks.yml +0 -46
- package/dist/tools/definitions/definitions/std/project/decide-next-workflow.yml +0 -38
- package/dist/tools/definitions/definitions/std/project/load-state.yml +0 -31
- package/dist/tools/definitions/definitions/std/project/save-state.yml +0 -32
- package/dist/tools/definitions/definitions/std/quality/check-quality.yml +0 -241
- package/dist/tools/definitions/definitions/std/quality/debug-systematic.yml +0 -163
- package/dist/tools/definitions/definitions/std/quality/handle-feedback.yml +0 -108
- package/dist/tools/definitions/definitions/std/quality/review-code.yml +0 -128
- package/dist/tools/definitions/definitions/std/quality/review-spec.yml +0 -140
- package/dist/tools/definitions/definitions/std/quality/review-task.yml +0 -190
- package/dist/tools/definitions/definitions/std/quality/run-tests.yml +0 -80
- package/dist/tools/definitions/definitions/std/quick/analyze.yml +0 -56
- package/dist/tools/definitions/definitions/std/quick/implement.yml +0 -67
- package/dist/tools/definitions/definitions/std/quick/verify.yml +0 -71
- package/dist/tools/definitions/definitions/std/verification/verify_completion.yml +0 -113
- package/dist/tools/definitions/definitions/std/verification/wait-condition.yml +0 -107
- package/dist/types/iron-law.d.ts +0 -25
- package/dist/types/iron-law.d.ts.map +0 -1
- package/dist/types/iron-law.js +0 -16
- package/dist/types/iron-law.js.map +0 -1
- package/src/cli/commands/sync-docs.ts +0 -1175
- package/src/constraints/index.ts +0 -3
- package/src/core/constraints/__tests__/prompt-injection.test.ts +0 -89
- package/src/core/constraints/doc-freshness/auto-fix.ts +0 -69
- package/src/core/constraints/prompt-injection.ts +0 -73
- package/src/core/spec/index.ts +0 -7
- package/src/governance/CONTEXT.md +0 -22
- package/src/governance/__tests__/executor.test.ts +0 -249
- package/src/governance/executor.ts +0 -229
- package/src/governance/index.ts +0 -13
- package/src/governance/types.ts +0 -53
- package/src/tools/core/package.json +0 -7
- package/src/tools/core/pnpm-lock.yaml +0 -232
- package/src/types/iron-law.ts +0 -50
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
* - PerformanceAnalyzer: 分析操作耗时
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import * as fs from 'fs';
|
|
17
|
-
import * as path from 'path';
|
|
18
16
|
import type {
|
|
19
17
|
PerformanceTrace,
|
|
20
18
|
PerformanceSummary,
|
|
@@ -22,6 +20,16 @@ import type {
|
|
|
22
20
|
PerformanceAnalyzerConfig,
|
|
23
21
|
} from '../types/performance';
|
|
24
22
|
import { PerformanceCollector } from './performance-collector';
|
|
23
|
+
import {
|
|
24
|
+
groupByKey,
|
|
25
|
+
timeRangeOf,
|
|
26
|
+
calcAverage,
|
|
27
|
+
calcPercentile,
|
|
28
|
+
splitByTime,
|
|
29
|
+
writeSummaryJson,
|
|
30
|
+
readSummaryJson,
|
|
31
|
+
MIN_TREND_SAMPLES,
|
|
32
|
+
} from './analyzer-base';
|
|
25
33
|
|
|
26
34
|
/**
|
|
27
35
|
* 默认配置
|
|
@@ -62,17 +70,13 @@ export class PerformanceAnalyzer {
|
|
|
62
70
|
*/
|
|
63
71
|
summarize(traces: PerformanceTrace[]): PerformanceSummary[] {
|
|
64
72
|
// 按操作类型分组
|
|
65
|
-
const grouped =
|
|
73
|
+
const grouped = groupByKey(traces, t => t.operation);
|
|
66
74
|
|
|
67
75
|
const summaries: PerformanceSummary[] = [];
|
|
68
76
|
|
|
69
77
|
for (const [operation, group] of grouped) {
|
|
70
78
|
// 计算时间范围
|
|
71
|
-
const
|
|
72
|
-
const timeRange = {
|
|
73
|
-
start: Math.min(...timestamps),
|
|
74
|
-
end: Math.max(...timestamps),
|
|
75
|
-
};
|
|
79
|
+
const timeRange = timeRangeOf(group.map(t => t.timestamp));
|
|
76
80
|
|
|
77
81
|
// 单次遍历计算核心统计
|
|
78
82
|
const totalCalls = group.length;
|
|
@@ -90,11 +94,11 @@ export class PerformanceAnalyzer {
|
|
|
90
94
|
|
|
91
95
|
// 计算耗时统计
|
|
92
96
|
const durations = group.map(t => t.duration);
|
|
93
|
-
const avgDuration =
|
|
97
|
+
const avgDuration = calcAverage(durations);
|
|
94
98
|
const maxDuration = Math.max(...durations);
|
|
95
99
|
const minDuration = Math.min(...durations);
|
|
96
|
-
const p95Duration =
|
|
97
|
-
const p99Duration =
|
|
100
|
+
const p95Duration = calcPercentile(durations, 95);
|
|
101
|
+
const p99Duration = calcPercentile(durations, 99);
|
|
98
102
|
|
|
99
103
|
// 计算趋势
|
|
100
104
|
const recentTrend = this.calculateTrend(group);
|
|
@@ -255,42 +259,22 @@ export class PerformanceAnalyzer {
|
|
|
255
259
|
});
|
|
256
260
|
}
|
|
257
261
|
|
|
258
|
-
/**
|
|
259
|
-
* 按操作类型分组
|
|
260
|
-
*/
|
|
261
|
-
private groupByOperation(traces: PerformanceTrace[]): Map<string, PerformanceTrace[]> {
|
|
262
|
-
const grouped = new Map<string, PerformanceTrace[]>();
|
|
263
|
-
|
|
264
|
-
for (const trace of traces) {
|
|
265
|
-
const existing = grouped.get(trace.operation) || [];
|
|
266
|
-
existing.push(trace);
|
|
267
|
-
grouped.set(trace.operation, existing);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
return grouped;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
262
|
/**
|
|
274
263
|
* 计算趋势
|
|
275
264
|
*
|
|
276
265
|
* 对比前半段和后半段的平均耗时
|
|
277
266
|
*/
|
|
278
267
|
private calculateTrend(traces: PerformanceTrace[]): 'stable' | 'rising' | 'falling' {
|
|
279
|
-
if (traces.length <
|
|
268
|
+
if (traces.length < MIN_TREND_SAMPLES) {
|
|
280
269
|
return 'stable';
|
|
281
270
|
}
|
|
282
271
|
|
|
283
|
-
//
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
// 分成前后两半
|
|
287
|
-
const half = Math.floor(sorted.length / 2);
|
|
288
|
-
const firstHalf = sorted.slice(0, half);
|
|
289
|
-
const secondHalf = sorted.slice(half);
|
|
272
|
+
// 分成前后两半(按时间排序)
|
|
273
|
+
const [firstHalf, secondHalf] = splitByTime(traces);
|
|
290
274
|
|
|
291
275
|
// 计算前半段和后半段的平均耗时
|
|
292
|
-
const firstAvg =
|
|
293
|
-
const secondAvg =
|
|
276
|
+
const firstAvg = calcAverage(firstHalf.map(t => t.duration));
|
|
277
|
+
const secondAvg = calcAverage(secondHalf.map(t => t.duration));
|
|
294
278
|
|
|
295
279
|
// 计算变化率
|
|
296
280
|
const delta = secondAvg - firstAvg;
|
|
@@ -306,52 +290,18 @@ export class PerformanceAnalyzer {
|
|
|
306
290
|
}
|
|
307
291
|
}
|
|
308
292
|
|
|
309
|
-
/**
|
|
310
|
-
* 计算平均值
|
|
311
|
-
*/
|
|
312
|
-
private calcAverage(values: number[]): number {
|
|
313
|
-
if (values.length === 0) return 0;
|
|
314
|
-
return values.reduce((sum, v) => sum + v, 0) / values.length;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* 计算百分位数
|
|
319
|
-
*/
|
|
320
|
-
private calcPercentile(values: number[], percentile: number): number {
|
|
321
|
-
if (values.length === 0) return 0;
|
|
322
|
-
|
|
323
|
-
const sorted = [...values].sort((a, b) => a - b);
|
|
324
|
-
const index = Math.ceil((percentile / 100) * sorted.length) - 1;
|
|
325
|
-
|
|
326
|
-
return sorted[Math.max(0, index)];
|
|
327
|
-
}
|
|
328
|
-
|
|
329
293
|
/**
|
|
330
294
|
* 保存汇总结果
|
|
331
295
|
*/
|
|
332
296
|
saveSummary(summaries: PerformanceSummary[]): void {
|
|
333
|
-
|
|
334
|
-
if (!fs.existsSync(dir)) {
|
|
335
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
fs.writeFileSync(
|
|
339
|
-
this.config.summaryFile!,
|
|
340
|
-
JSON.stringify(summaries, null, 2),
|
|
341
|
-
'utf-8'
|
|
342
|
-
);
|
|
297
|
+
writeSummaryJson(this.config.summaryFile!, summaries);
|
|
343
298
|
}
|
|
344
299
|
|
|
345
300
|
/**
|
|
346
301
|
* 加载上次汇总结果
|
|
347
302
|
*/
|
|
348
303
|
loadSummary(): PerformanceSummary[] | null {
|
|
349
|
-
|
|
350
|
-
return null;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
const content = fs.readFileSync(this.config.summaryFile!, 'utf-8');
|
|
354
|
-
return JSON.parse(content) as PerformanceSummary[];
|
|
304
|
+
return readSummaryJson<PerformanceSummary[]>(this.config.summaryFile!);
|
|
355
305
|
}
|
|
356
306
|
|
|
357
307
|
/**
|
|
@@ -324,25 +324,3 @@ export class PerformanceCollector {
|
|
|
324
324
|
};
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* 全局单例(可选)
|
|
330
|
-
*/
|
|
331
|
-
let globalCollector: PerformanceCollector | null = null;
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* 获取全局收集器
|
|
335
|
-
*/
|
|
336
|
-
export function getPerformanceCollector(): PerformanceCollector {
|
|
337
|
-
if (!globalCollector) {
|
|
338
|
-
globalCollector = new PerformanceCollector();
|
|
339
|
-
}
|
|
340
|
-
return globalCollector;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* 配置全局收集器
|
|
345
|
-
*/
|
|
346
|
-
export function configurePerformanceCollector(config: Partial<PerformanceCollectorConfig>): void {
|
|
347
|
-
globalCollector = new PerformanceCollector(config);
|
|
348
|
-
}
|
|
@@ -9,16 +9,22 @@
|
|
|
9
9
|
* - 趋势分析(对比上一周期)
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import * as fs from 'fs';
|
|
13
|
-
import * as path from 'path';
|
|
14
12
|
import type {
|
|
15
13
|
ExecutionTrace,
|
|
16
14
|
TraceSummary,
|
|
17
15
|
TraceAnomaly,
|
|
18
|
-
TraceFilter,
|
|
19
16
|
TraceAnalyzerConfig,
|
|
20
17
|
} from '../types/trace';
|
|
21
18
|
import { TraceCollector } from './traces';
|
|
19
|
+
import {
|
|
20
|
+
groupByKey,
|
|
21
|
+
timeRangeOf,
|
|
22
|
+
findMostCommon,
|
|
23
|
+
splitByTime,
|
|
24
|
+
writeSummaryJson,
|
|
25
|
+
readSummaryJson,
|
|
26
|
+
MIN_TREND_SAMPLES,
|
|
27
|
+
} from './analyzer-base';
|
|
22
28
|
|
|
23
29
|
/**
|
|
24
30
|
* 默认配置
|
|
@@ -59,7 +65,7 @@ export class TraceAnalyzer {
|
|
|
59
65
|
*/
|
|
60
66
|
summarize(traces: ExecutionTrace[]): TraceSummary[] {
|
|
61
67
|
// 按约束 ID 分组
|
|
62
|
-
const grouped =
|
|
68
|
+
const grouped = groupByKey(traces, t => t.constraintId);
|
|
63
69
|
|
|
64
70
|
const summaries: TraceSummary[] = [];
|
|
65
71
|
|
|
@@ -68,11 +74,7 @@ export class TraceAnalyzer {
|
|
|
68
74
|
const level = group[0].level;
|
|
69
75
|
|
|
70
76
|
// 计算时间范围
|
|
71
|
-
const
|
|
72
|
-
const timeRange = {
|
|
73
|
-
start: Math.min(...timestamps),
|
|
74
|
-
end: Math.max(...timestamps),
|
|
75
|
-
};
|
|
77
|
+
const timeRange = timeRangeOf(group.map(t => t.timestamp));
|
|
76
78
|
|
|
77
79
|
// 单次遍历计算核心统计
|
|
78
80
|
const totalChecks = group.length;
|
|
@@ -93,7 +95,7 @@ export class TraceAnalyzer {
|
|
|
93
95
|
const exceptionTraces = group.filter(t => t.exceptionApplied);
|
|
94
96
|
const exceptionCount = exceptionTraces.length;
|
|
95
97
|
const exceptionTypes = exceptionTraces.map(t => t.exceptionApplied!);
|
|
96
|
-
const mostCommonException =
|
|
98
|
+
const mostCommonException = findMostCommon(exceptionTypes);
|
|
97
99
|
|
|
98
100
|
// 计算趋势
|
|
99
101
|
const recentTrend = this.calculateTrend(group);
|
|
@@ -265,38 +267,18 @@ export class TraceAnalyzer {
|
|
|
265
267
|
});
|
|
266
268
|
}
|
|
267
269
|
|
|
268
|
-
/**
|
|
269
|
-
* 按约束 ID 分组
|
|
270
|
-
*/
|
|
271
|
-
private groupByConstraint(traces: ExecutionTrace[]): Map<string, ExecutionTrace[]> {
|
|
272
|
-
const grouped = new Map<string, ExecutionTrace[]>();
|
|
273
|
-
|
|
274
|
-
for (const trace of traces) {
|
|
275
|
-
const existing = grouped.get(trace.constraintId) || [];
|
|
276
|
-
existing.push(trace);
|
|
277
|
-
grouped.set(trace.constraintId, existing);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
return grouped;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
270
|
/**
|
|
284
271
|
* 计算趋势
|
|
285
272
|
*
|
|
286
273
|
* 对比前半段和后半段的通过率
|
|
287
274
|
*/
|
|
288
275
|
private calculateTrend(traces: ExecutionTrace[]): 'stable' | 'rising' | 'falling' {
|
|
289
|
-
if (traces.length <
|
|
276
|
+
if (traces.length < MIN_TREND_SAMPLES) {
|
|
290
277
|
return 'stable';
|
|
291
278
|
}
|
|
292
279
|
|
|
293
|
-
//
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
// 分成前后两半
|
|
297
|
-
const half = Math.floor(sorted.length / 2);
|
|
298
|
-
const firstHalf = sorted.slice(0, half);
|
|
299
|
-
const secondHalf = sorted.slice(half);
|
|
280
|
+
// 分成前后两半(按时间排序)
|
|
281
|
+
const [firstHalf, secondHalf] = splitByTime(traces);
|
|
300
282
|
|
|
301
283
|
// 计算前半段和后半段的通过率
|
|
302
284
|
const firstPassRate = this.calcPassRate(firstHalf);
|
|
@@ -324,56 +306,18 @@ export class TraceAnalyzer {
|
|
|
324
306
|
return passCount / traces.length;
|
|
325
307
|
}
|
|
326
308
|
|
|
327
|
-
/**
|
|
328
|
-
* 找出最常见元素
|
|
329
|
-
*/
|
|
330
|
-
private findMostCommon(items: string[]): string | undefined {
|
|
331
|
-
if (items.length === 0) return undefined;
|
|
332
|
-
|
|
333
|
-
const counts = new Map<string, number>();
|
|
334
|
-
for (const item of items) {
|
|
335
|
-
counts.set(item, (counts.get(item) || 0) + 1);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
let maxCount = 0;
|
|
339
|
-
let mostCommon: string | undefined;
|
|
340
|
-
|
|
341
|
-
for (const [item, count] of counts) {
|
|
342
|
-
if (count > maxCount) {
|
|
343
|
-
maxCount = count;
|
|
344
|
-
mostCommon = item;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
return mostCommon;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
309
|
/**
|
|
352
310
|
* 保存汇总结果
|
|
353
311
|
*/
|
|
354
312
|
saveSummary(summaries: TraceSummary[]): void {
|
|
355
|
-
|
|
356
|
-
if (!fs.existsSync(dir)) {
|
|
357
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
fs.writeFileSync(
|
|
361
|
-
this.config.summaryFile!,
|
|
362
|
-
JSON.stringify(summaries, null, 2),
|
|
363
|
-
'utf-8'
|
|
364
|
-
);
|
|
313
|
+
writeSummaryJson(this.config.summaryFile!, summaries);
|
|
365
314
|
}
|
|
366
315
|
|
|
367
316
|
/**
|
|
368
317
|
* 加载上次汇总结果
|
|
369
318
|
*/
|
|
370
319
|
loadSummary(): TraceSummary[] | null {
|
|
371
|
-
|
|
372
|
-
return null;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
const content = fs.readFileSync(this.config.summaryFile!, 'utf-8');
|
|
376
|
-
return JSON.parse(content) as TraceSummary[];
|
|
320
|
+
return readSummaryJson<TraceSummary[]>(this.config.summaryFile!);
|
|
377
321
|
}
|
|
378
322
|
|
|
379
323
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Tests for standard.ts — applyPreset, getPreset
|
|
2
|
+
* Tests for standard.ts — applyPreset, getPreset
|
|
3
3
|
*
|
|
4
4
|
* Pure logic, no I/O — tests preset selection and constraint filtering.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { applyPreset, getPreset
|
|
7
|
+
import { applyPreset, getPreset } from '../standard';
|
|
8
8
|
|
|
9
9
|
describe('getPreset', () => {
|
|
10
10
|
it('returns strict preset', () => {
|
|
@@ -87,18 +87,3 @@ describe('applyPreset with PresetConfig object', () => {
|
|
|
87
87
|
expect(config.disabled.length).toBeGreaterThan(0);
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
|
-
|
|
91
|
-
describe('getIronLawPreset (deprecated)', () => {
|
|
92
|
-
it('returns iron law config for strict preset', () => {
|
|
93
|
-
const config = getIronLawPreset('strict');
|
|
94
|
-
expect(config.preset).toBe('strict');
|
|
95
|
-
expect(config.enabled).toBe(true);
|
|
96
|
-
expect(config.ironLaws.length).toBeGreaterThan(5);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('returns iron law config for relaxed preset', () => {
|
|
100
|
-
const config = getIronLawPreset('relaxed');
|
|
101
|
-
expect(config.preset).toBe('relaxed');
|
|
102
|
-
expect(config.ironLaws).toHaveLength(3);
|
|
103
|
-
});
|
|
104
|
-
});
|
package/src/presets/index.ts
CHANGED
package/src/presets/standard.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* 预设定义哪些约束被启用
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type {
|
|
7
|
+
import type { Constraint } from '../types/constraint';
|
|
8
8
|
import type { MergedConstraintsConfig } from '../types/project-config';
|
|
9
9
|
import { IRON_LAWS, GUIDELINES, TIPS } from '../core/constraints/definitions';
|
|
10
10
|
|
|
@@ -135,29 +135,4 @@ export function getPreset(name: string): PresetConfig {
|
|
|
135
135
|
default:
|
|
136
136
|
return STANDARD_PRESET;
|
|
137
137
|
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// ========================================
|
|
141
|
-
// 向后兼容
|
|
142
|
-
// ========================================
|
|
143
|
-
|
|
144
|
-
import type { IronLawConfig } from '../types/iron-law';
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* @deprecated 使用 PresetConfig 代替
|
|
148
|
-
*/
|
|
149
|
-
export { STANDARD_PRESET as STANDARD_IRON_LAWS_CONFIG };
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* @deprecated 使用 getPreset 代替
|
|
153
|
-
*/
|
|
154
|
-
export function getIronLawPreset(preset: string): IronLawConfig {
|
|
155
|
-
const config = getPreset(preset);
|
|
156
|
-
return {
|
|
157
|
-
preset: preset as 'strict' | 'standard' | 'relaxed',
|
|
158
|
-
enabled: true,
|
|
159
|
-
ironLaws: config.ironLaws
|
|
160
|
-
? Object.values(IRON_LAWS).filter(c => config.ironLaws!.includes(c.id))
|
|
161
|
-
: Object.values(IRON_LAWS),
|
|
162
|
-
};
|
|
163
138
|
}
|
|
@@ -26,16 +26,12 @@ const DEFAULT_SENSITIVE_PATTERNS: RegExp[] = [
|
|
|
26
26
|
/(?:mongodb|postgres|mysql|redis):\/\/[^\s'"]+/gi,
|
|
27
27
|
];
|
|
28
28
|
|
|
29
|
-
const DEFAULT_MIN_QUALITY_SCORE = 0.6;
|
|
30
|
-
|
|
31
29
|
export class OutputGuardrail {
|
|
32
30
|
private sensitivePatterns: RegExp[];
|
|
33
|
-
private minQualityScore: number;
|
|
34
31
|
private checkKnowledgeRefs: boolean;
|
|
35
32
|
|
|
36
33
|
constructor(config?: OutputGuardrailConfig) {
|
|
37
34
|
this.sensitivePatterns = config?.sensitivePatterns ?? DEFAULT_SENSITIVE_PATTERNS;
|
|
38
|
-
this.minQualityScore = config?.minQualityScore ?? DEFAULT_MIN_QUALITY_SCORE;
|
|
39
35
|
this.checkKnowledgeRefs = config?.checkKnowledgeRefs ?? false;
|
|
40
36
|
}
|
|
41
37
|
|
package/src/tools/registry.ts
CHANGED
|
@@ -5,29 +5,13 @@
|
|
|
5
5
|
import { describe, it, expect } from '@jest/globals';
|
|
6
6
|
|
|
7
7
|
// 从 barrel index.ts 导入,覆盖 re-export 行
|
|
8
|
-
import {
|
|
9
|
-
ConstraintViolationError,
|
|
10
|
-
IronLawViolationError,
|
|
11
|
-
} from '..';
|
|
12
|
-
|
|
13
|
-
// 从 iron-law.ts 导入,覆盖 value re-export
|
|
14
|
-
import { IronLawViolationError as IronLawViolationErrorDirect } from '../iron-law';
|
|
8
|
+
import { ConstraintViolationError } from '..';
|
|
15
9
|
|
|
16
10
|
describe('types barrel exports', () => {
|
|
17
11
|
it('ConstraintViolationError 应该可从 index 导入', () => {
|
|
18
12
|
expect(ConstraintViolationError).toBeDefined();
|
|
19
13
|
expect(typeof ConstraintViolationError).toBe('function');
|
|
20
14
|
});
|
|
21
|
-
|
|
22
|
-
it('IronLawViolationError 应该可从 index 导入(向后兼容)', () => {
|
|
23
|
-
expect(IronLawViolationError).toBeDefined();
|
|
24
|
-
expect(IronLawViolationError.prototype).toBeInstanceOf(ConstraintViolationError);
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('IronLawViolationError 应该可从 iron-law.ts 直接导入', () => {
|
|
28
|
-
expect(IronLawViolationErrorDirect).toBeDefined();
|
|
29
|
-
expect(IronLawViolationErrorDirect).toBe(ConstraintViolationError);
|
|
30
|
-
});
|
|
31
15
|
});
|
|
32
16
|
|
|
33
17
|
describe('ConstraintViolationError', () => {
|
|
@@ -68,19 +52,3 @@ describe('ConstraintViolationError', () => {
|
|
|
68
52
|
expect(error.message).toBe('Constraint violation');
|
|
69
53
|
});
|
|
70
54
|
});
|
|
71
|
-
|
|
72
|
-
describe('IronLawViolationError', () => {
|
|
73
|
-
it('应该继承 ConstraintViolationError', () => {
|
|
74
|
-
const error = new IronLawViolationError({
|
|
75
|
-
id: 'test',
|
|
76
|
-
level: 'iron_law',
|
|
77
|
-
satisfied: false,
|
|
78
|
-
message: '铁律违规',
|
|
79
|
-
checkedAt: new Date(),
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
expect(error).toBeInstanceOf(ConstraintViolationError);
|
|
83
|
-
expect(error.name).toBe('IronLawViolationError');
|
|
84
|
-
expect(error.message).toBe('铁律违规');
|
|
85
|
-
});
|
|
86
|
-
});
|
package/src/types/constraint.ts
CHANGED
|
@@ -18,35 +18,11 @@ export type ConstraintId = string;
|
|
|
18
18
|
export type ConstraintLevel = 'iron_law' | 'guideline' | 'tip';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* 约束触发器(开放扩展)
|
|
21
|
+
* 约束触发条件(开放扩展)
|
|
25
22
|
*
|
|
26
23
|
* 从硬编码 union type 改为 string,consumer 可传入任意 trigger。
|
|
27
24
|
* 无需修改 harness 即可添加领域特定 trigger。
|
|
28
|
-
*
|
|
29
|
-
* 以下为推荐的抽象 trigger 常量。领域概念(如 deploy、
|
|
30
|
-
* config_update 等)由 consumer 自行管理。
|
|
31
25
|
*/
|
|
32
|
-
|
|
33
|
-
export const CODE_IMPLEMENTATION = 'code_implementation' as const;
|
|
34
|
-
export const FILE_MODIFICATION = 'file_modification' as const;
|
|
35
|
-
export const FILE_CREATION = 'file_creation' as const;
|
|
36
|
-
export const FILE_DELETION = 'file_deletion' as const;
|
|
37
|
-
export const MODULE_CREATION = 'module_creation' as const;
|
|
38
|
-
export const MODULE_MODIFICATION = 'module_modification' as const;
|
|
39
|
-
export const MODULE_DELETION = 'module_deletion' as const;
|
|
40
|
-
export const MODULE_EXTENSION = 'module_extension' as const;
|
|
41
|
-
export const API_CHANGE = 'api_change' as const;
|
|
42
|
-
export const EXPORT_CHANGE = 'export_change' as const;
|
|
43
|
-
export const TEST_CREATION = 'test_creation' as const;
|
|
44
|
-
export const COMMIT = 'commit' as const;
|
|
45
|
-
export const PUSH = 'push' as const;
|
|
46
|
-
export const MERGE = 'merge' as const;
|
|
47
|
-
export const DESIGN_REQUEST = 'design_request' as const;
|
|
48
|
-
export const ARCHITECTURE_CHANGE = 'architecture_change' as const;
|
|
49
|
-
|
|
50
26
|
export type ConstraintTrigger = string;
|
|
51
27
|
|
|
52
28
|
/**
|
|
@@ -87,33 +63,6 @@ export interface Constraint {
|
|
|
87
63
|
exceptions?: string[];
|
|
88
64
|
}
|
|
89
65
|
|
|
90
|
-
// ========================================
|
|
91
|
-
// 向后兼容的类型别名
|
|
92
|
-
// ========================================
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* @deprecated 使用 ConstraintId 代替
|
|
96
|
-
*/
|
|
97
|
-
export type IronLawId = ConstraintId;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* @deprecated 使用 ConstraintLevel 代替
|
|
101
|
-
*/
|
|
102
|
-
export type IronLawSeverity = 'error' | 'warning' | 'info';
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* @deprecated 使用 ConstraintTrigger 代替
|
|
106
|
-
*/
|
|
107
|
-
export type IronLawTrigger = ConstraintTrigger;
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* @deprecated 使用 Constraint 代替
|
|
111
|
-
*/
|
|
112
|
-
export interface IronLaw extends Constraint {
|
|
113
|
-
/** @deprecated 使用 level 代替 */
|
|
114
|
-
severity?: IronLawSeverity;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
66
|
/**
|
|
118
67
|
* 约束检查结果
|
|
119
68
|
*/
|
|
@@ -140,14 +89,6 @@ export interface ConstraintResult {
|
|
|
140
89
|
checkedAt: Date;
|
|
141
90
|
}
|
|
142
91
|
|
|
143
|
-
/**
|
|
144
|
-
* @deprecated 使用 ConstraintResult 代替
|
|
145
|
-
*/
|
|
146
|
-
export interface IronLawResult extends ConstraintResult {
|
|
147
|
-
/** @deprecated */
|
|
148
|
-
law?: Constraint;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
92
|
/**
|
|
152
93
|
* 约束检查上下文
|
|
153
94
|
*/
|
|
@@ -283,11 +224,6 @@ export interface ConstraintContext {
|
|
|
283
224
|
executionContext?: any;
|
|
284
225
|
}
|
|
285
226
|
|
|
286
|
-
/**
|
|
287
|
-
* @deprecated 使用 ConstraintContext 代替
|
|
288
|
-
*/
|
|
289
|
-
export type IronLawContext = ConstraintContext;
|
|
290
|
-
|
|
291
227
|
/**
|
|
292
228
|
* 约束违规错误
|
|
293
229
|
*/
|
|
@@ -301,16 +237,6 @@ export class ConstraintViolationError extends Error {
|
|
|
301
237
|
}
|
|
302
238
|
}
|
|
303
239
|
|
|
304
|
-
/**
|
|
305
|
-
* @deprecated 使用 ConstraintViolationError 代替
|
|
306
|
-
*/
|
|
307
|
-
export class IronLawViolationError extends ConstraintViolationError {
|
|
308
|
-
constructor(result: ConstraintResult) {
|
|
309
|
-
super(result);
|
|
310
|
-
this.name = 'IronLawViolationError';
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
240
|
/**
|
|
315
241
|
* 三层约束检查结果
|
|
316
242
|
*/
|
|
@@ -333,3 +259,8 @@ export interface ConstraintCheckResult {
|
|
|
333
259
|
/** 提示数量 */
|
|
334
260
|
tipCount: number;
|
|
335
261
|
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* studio 兼容别名(P0 护栏):等价于 ConstraintContext
|
|
265
|
+
*/
|
|
266
|
+
export type IronLawContext = ConstraintContext;
|