@dommaker/harness 1.6.0 → 1.8.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 +52 -0
- package/bin/harness.js +17 -1
- package/dist/agents/index.d.ts +6 -2
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +6 -16
- package/dist/agents/index.js.map +1 -1
- package/dist/cli/commands/__tests__/gate-decision.d.ts +18 -0
- package/dist/cli/commands/__tests__/gate-decision.d.ts.map +1 -0
- package/dist/cli/commands/__tests__/gate-decision.js +26 -0
- package/dist/cli/commands/__tests__/gate-decision.js.map +1 -0
- package/dist/cli/commands/acceptance.d.ts.map +1 -1
- package/dist/cli/commands/acceptance.js +17 -28
- package/dist/cli/commands/acceptance.js.map +1 -1
- package/dist/cli/commands/check.d.ts +11 -3
- package/dist/cli/commands/check.d.ts.map +1 -1
- package/dist/cli/commands/check.js +26 -11
- package/dist/cli/commands/check.js.map +1 -1
- package/dist/cli/commands/command.d.ts +0 -1
- package/dist/cli/commands/command.d.ts.map +1 -1
- package/dist/cli/commands/command.js +8 -6
- package/dist/cli/commands/command.js.map +1 -1
- package/dist/cli/commands/constraints-retire.d.ts.map +1 -1
- package/dist/cli/commands/constraints-retire.js +36 -57
- 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 +36 -42
- package/dist/cli/commands/contract.js.map +1 -1
- package/dist/cli/commands/definitions.d.ts +2 -0
- package/dist/cli/commands/definitions.d.ts.map +1 -1
- package/dist/cli/commands/definitions.js +11 -6
- 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 +16 -2
- package/dist/cli/commands/failure.js.map +1 -1
- package/dist/cli/commands/init.d.ts +14 -8
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +172 -364
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/knowledge-view.d.ts +90 -0
- package/dist/cli/commands/knowledge-view.d.ts.map +1 -0
- package/dist/cli/commands/knowledge-view.js +198 -0
- package/dist/cli/commands/knowledge-view.js.map +1 -0
- package/dist/cli/commands/knowledge.d.ts +137 -52
- package/dist/cli/commands/knowledge.d.ts.map +1 -1
- package/dist/cli/commands/knowledge.js +534 -400
- package/dist/cli/commands/knowledge.js.map +1 -1
- package/dist/cli/commands/passes-gate.d.ts +4 -1
- package/dist/cli/commands/passes-gate.d.ts.map +1 -1
- package/dist/cli/commands/passes-gate.js +11 -2
- package/dist/cli/commands/passes-gate.js.map +1 -1
- package/dist/cli/commands/performance.d.ts.map +1 -1
- package/dist/cli/commands/performance.js +19 -31
- package/dist/cli/commands/performance.js.map +1 -1
- package/dist/cli/commands/report.d.ts.map +1 -1
- package/dist/cli/commands/report.js +2 -1
- package/dist/cli/commands/report.js.map +1 -1
- package/dist/cli/commands/review.d.ts.map +1 -1
- package/dist/cli/commands/review.js +13 -25
- package/dist/cli/commands/review.js.map +1 -1
- package/dist/cli/commands/scaffold-templates.d.ts +73 -0
- package/dist/cli/commands/scaffold-templates.d.ts.map +1 -0
- package/dist/cli/commands/scaffold-templates.js +424 -0
- package/dist/cli/commands/scaffold-templates.js.map +1 -0
- package/dist/cli/commands/scaffold.d.ts +105 -0
- package/dist/cli/commands/scaffold.d.ts.map +1 -0
- package/dist/cli/commands/scaffold.js +263 -0
- package/dist/cli/commands/scaffold.js.map +1 -0
- package/dist/cli/commands/security.d.ts.map +1 -1
- package/dist/cli/commands/security.js +22 -24
- package/dist/cli/commands/security.js.map +1 -1
- package/dist/cli/commands/spec-baseline-check.d.ts +43 -0
- package/dist/cli/commands/spec-baseline-check.d.ts.map +1 -1
- package/dist/cli/commands/spec-baseline-check.js +109 -34
- package/dist/cli/commands/spec-baseline-check.js.map +1 -1
- package/dist/cli/commands/sync-docs/context-syncer.d.ts +21 -2
- package/dist/cli/commands/sync-docs/context-syncer.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/context-syncer.js +112 -28
- package/dist/cli/commands/sync-docs/context-syncer.js.map +1 -1
- package/dist/cli/commands/sync-docs/index.d.ts +1 -1
- package/dist/cli/commands/sync-docs/index.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/index.js +86 -27
- package/dist/cli/commands/sync-docs/index.js.map +1 -1
- package/dist/cli/commands/sync-docs/project-reader.d.ts +24 -1
- package/dist/cli/commands/sync-docs/project-reader.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/project-reader.js +33 -7
- package/dist/cli/commands/sync-docs/project-reader.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +0 -16
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/commands/validate.js +2 -97
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/gate-command.d.ts +37 -0
- package/dist/cli/gate-command.d.ts.map +1 -0
- package/dist/cli/gate-command.js +64 -0
- package/dist/cli/gate-command.js.map +1 -0
- package/dist/completion-checkers/index.d.ts +1 -1
- package/dist/completion-checkers/index.d.ts.map +1 -1
- package/dist/completion-checkers/index.js +0 -15
- package/dist/completion-checkers/index.js.map +1 -1
- package/dist/context/knowledge-injector.d.ts +4 -2
- package/dist/context/knowledge-injector.d.ts.map +1 -1
- package/dist/context/knowledge-injector.js +13 -6
- package/dist/context/knowledge-injector.js.map +1 -1
- package/dist/core/constraints/agent-prompt-renderer.js +2 -2
- package/dist/core/constraints/agent-prompt-renderer.js.map +1 -1
- package/dist/core/constraints/capabilities-reconcile.d.ts +20 -0
- package/dist/core/constraints/capabilities-reconcile.d.ts.map +1 -1
- package/dist/core/constraints/capabilities-reconcile.js +26 -4
- package/dist/core/constraints/capabilities-reconcile.js.map +1 -1
- package/dist/core/constraints/check-cache.d.ts +1 -1
- package/dist/core/constraints/check-cache.js +1 -1
- package/dist/core/constraints/checker.d.ts +8 -3
- package/dist/core/constraints/checker.d.ts.map +1 -1
- package/dist/core/constraints/checker.js +30 -19
- package/dist/core/constraints/checker.js.map +1 -1
- package/dist/core/constraints/checkers/capability-sync.d.ts +3 -1
- package/dist/core/constraints/checkers/capability-sync.d.ts.map +1 -1
- package/dist/core/constraints/checkers/capability-sync.js +17 -24
- package/dist/core/constraints/checkers/capability-sync.js.map +1 -1
- package/dist/core/constraints/checkers/context-doc-sync.d.ts +1 -1
- package/dist/core/constraints/checkers/context-doc-sync.d.ts.map +1 -1
- package/dist/core/constraints/checkers/context-doc-sync.js +9 -6
- package/dist/core/constraints/checkers/context-doc-sync.js.map +1 -1
- package/dist/core/constraints/checkers/docs-freshness.d.ts.map +1 -1
- package/dist/core/constraints/checkers/docs-freshness.js +24 -30
- package/dist/core/constraints/checkers/docs-freshness.js.map +1 -1
- package/dist/core/constraints/checkers/governance-presence.d.ts.map +1 -1
- package/dist/core/constraints/checkers/governance-presence.js +10 -4
- package/dist/core/constraints/checkers/governance-presence.js.map +1 -1
- package/dist/core/constraints/checkers/types.d.ts +10 -6
- package/dist/core/constraints/checkers/types.d.ts.map +1 -1
- package/dist/core/constraints/checkers/types.js +7 -3
- package/dist/core/constraints/checkers/types.js.map +1 -1
- package/dist/core/constraints/context-builder.d.ts +11 -10
- package/dist/core/constraints/context-builder.d.ts.map +1 -1
- package/dist/core/constraints/context-builder.js +31 -27
- package/dist/core/constraints/context-builder.js.map +1 -1
- package/dist/core/constraints/context-reconcile.d.ts +75 -0
- package/dist/core/constraints/context-reconcile.d.ts.map +1 -0
- package/dist/core/constraints/context-reconcile.js +161 -0
- package/dist/core/constraints/context-reconcile.js.map +1 -0
- package/dist/core/constraints/doc-freshness/runner.d.ts +7 -0
- package/dist/core/constraints/doc-freshness/runner.d.ts.map +1 -1
- package/dist/core/constraints/doc-freshness/runner.js +8 -3
- package/dist/core/constraints/doc-freshness/runner.js.map +1 -1
- package/dist/core/constraints/git-evidence.js +1 -1
- package/dist/core/constraints/git-evidence.js.map +1 -1
- package/dist/core/constraints/injection-drift.d.ts +7 -2
- package/dist/core/constraints/injection-drift.d.ts.map +1 -1
- package/dist/core/constraints/injection-drift.js +13 -7
- package/dist/core/constraints/injection-drift.js.map +1 -1
- package/dist/core/constraints/run-env.d.ts +92 -0
- package/dist/core/constraints/run-env.d.ts.map +1 -0
- package/dist/core/constraints/run-env.js +175 -0
- package/dist/core/constraints/run-env.js.map +1 -0
- package/dist/core/constraints/triggers.d.ts +22 -0
- package/dist/core/constraints/triggers.d.ts.map +1 -0
- package/dist/core/constraints/triggers.js +31 -0
- package/dist/core/constraints/triggers.js.map +1 -0
- package/dist/core/effective-constraints.d.ts +13 -4
- package/dist/core/effective-constraints.d.ts.map +1 -1
- package/dist/core/effective-constraints.js +16 -6
- package/dist/core/effective-constraints.js.map +1 -1
- package/dist/core/effective-set.d.ts +8 -15
- package/dist/core/effective-set.d.ts.map +1 -1
- package/dist/core/effective-set.js +7 -12
- package/dist/core/effective-set.js.map +1 -1
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/project-config-loader.d.ts +39 -17
- package/dist/core/project-config-loader.d.ts.map +1 -1
- package/dist/core/project-config-loader.js +51 -122
- package/dist/core/project-config-loader.js.map +1 -1
- package/dist/core/validators/check-handlers/http.d.ts +2 -2
- package/dist/core/validators/check-handlers/http.d.ts.map +1 -1
- package/dist/core/validators/check-handlers/http.js +12 -7
- package/dist/core/validators/check-handlers/http.js.map +1 -1
- package/dist/core/validators/index.d.ts +1 -1
- package/dist/core/validators/index.d.ts.map +1 -1
- package/dist/core/validators/passes-gate.d.ts.map +1 -1
- package/dist/core/validators/passes-gate.js +2 -2
- package/dist/core/validators/passes-gate.js.map +1 -1
- package/dist/failure/classifier.d.ts +1 -1
- package/dist/failure/classifier.d.ts.map +1 -1
- package/dist/failure/classifier.js +8 -8
- package/dist/failure/classifier.js.map +1 -1
- package/dist/failure/index.d.ts +2 -1
- package/dist/failure/index.d.ts.map +1 -1
- package/dist/failure/index.js +9 -17
- package/dist/failure/index.js.map +1 -1
- package/dist/failure/recorder.d.ts +1 -1
- package/dist/failure/recorder.d.ts.map +1 -1
- package/dist/gates/checker-gate.d.ts +2 -1
- package/dist/gates/checker-gate.d.ts.map +1 -1
- package/dist/gates/checker-gate.js +3 -2
- package/dist/gates/checker-gate.js.map +1 -1
- package/dist/gates/command.d.ts +10 -4
- package/dist/gates/command.d.ts.map +1 -1
- package/dist/gates/command.js +36 -62
- package/dist/gates/command.js.map +1 -1
- package/dist/gates/contract.d.ts.map +1 -1
- package/dist/gates/contract.js +0 -4
- package/dist/gates/contract.js.map +1 -1
- package/dist/gates/definitions.d.ts +2 -1
- package/dist/gates/definitions.d.ts.map +1 -1
- package/dist/gates/definitions.js +6 -5
- package/dist/gates/definitions.js.map +1 -1
- package/dist/gates/index.d.ts +0 -4
- package/dist/gates/index.d.ts.map +1 -1
- package/dist/gates/index.js +1 -6
- package/dist/gates/index.js.map +1 -1
- package/dist/gates/performance.d.ts.map +1 -1
- package/dist/gates/performance.js +0 -4
- package/dist/gates/performance.js.map +1 -1
- package/dist/gates/runner.d.ts +1 -1
- package/dist/gates/runner.js +1 -1
- package/dist/gates/security.d.ts +1 -1
- package/dist/gates/security.d.ts.map +1 -1
- package/dist/gates/security.js +5 -6
- package/dist/gates/security.js.map +1 -1
- package/dist/gates/types.d.ts +14 -17
- package/dist/gates/types.d.ts.map +1 -1
- package/dist/gates/types.js.map +1 -1
- package/dist/hooks/bootstrap.d.ts +6 -4
- package/dist/hooks/bootstrap.d.ts.map +1 -1
- package/dist/hooks/bootstrap.js +25 -13
- package/dist/hooks/bootstrap.js.map +1 -1
- package/dist/hooks/config.d.ts +6 -2
- package/dist/hooks/config.d.ts.map +1 -1
- package/dist/hooks/config.js +5 -1
- package/dist/hooks/config.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +0 -15
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/pipeline.d.ts.map +1 -1
- package/dist/hooks/pipeline.js +2 -4
- package/dist/hooks/pipeline.js.map +1 -1
- package/dist/hooks/registry.d.ts +11 -8
- package/dist/hooks/registry.d.ts.map +1 -1
- package/dist/hooks/registry.js +22 -7
- package/dist/hooks/registry.js.map +1 -1
- package/dist/hooks/types.d.ts +23 -7
- package/dist/hooks/types.d.ts.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/knowledge/audit-scoring.d.ts +87 -0
- package/dist/knowledge/audit-scoring.d.ts.map +1 -0
- package/dist/knowledge/audit-scoring.js +470 -0
- package/dist/knowledge/audit-scoring.js.map +1 -0
- package/dist/knowledge/audit.d.ts +11 -59
- package/dist/knowledge/audit.d.ts.map +1 -1
- package/dist/knowledge/audit.js +47 -522
- package/dist/knowledge/audit.js.map +1 -1
- package/dist/knowledge/import.d.ts.map +1 -1
- package/dist/knowledge/import.js +2 -0
- package/dist/knowledge/import.js.map +1 -1
- package/dist/knowledge/index-generator.d.ts.map +1 -1
- package/dist/knowledge/index-generator.js +4 -5
- package/dist/knowledge/index-generator.js.map +1 -1
- package/dist/knowledge/index.d.ts +3 -2
- package/dist/knowledge/index.d.ts.map +1 -1
- package/dist/knowledge/index.js +3 -16
- package/dist/knowledge/index.js.map +1 -1
- package/dist/knowledge/ingest.js +1 -1
- package/dist/knowledge/ingest.js.map +1 -1
- package/dist/knowledge/lifecycle.d.ts.map +1 -1
- package/dist/knowledge/lifecycle.js +4 -2
- package/dist/knowledge/lifecycle.js.map +1 -1
- package/dist/knowledge/migration.d.ts +3 -0
- package/dist/knowledge/migration.d.ts.map +1 -1
- package/dist/knowledge/migration.js +8 -2
- package/dist/knowledge/migration.js.map +1 -1
- package/dist/knowledge/query.d.ts +6 -0
- package/dist/knowledge/query.d.ts.map +1 -1
- package/dist/knowledge/query.js +8 -2
- package/dist/knowledge/query.js.map +1 -1
- package/dist/knowledge/reference-tracker.d.ts.map +1 -1
- package/dist/knowledge/reference-tracker.js +4 -6
- package/dist/knowledge/reference-tracker.js.map +1 -1
- package/dist/knowledge/store.d.ts +22 -16
- package/dist/knowledge/store.d.ts.map +1 -1
- package/dist/knowledge/store.js +53 -12
- package/dist/knowledge/store.js.map +1 -1
- package/dist/knowledge/tree-walker.d.ts +19 -0
- package/dist/knowledge/tree-walker.d.ts.map +1 -0
- package/dist/knowledge/tree-walker.js +30 -0
- package/dist/knowledge/tree-walker.js.map +1 -0
- package/dist/knowledge/types.d.ts +16 -0
- package/dist/knowledge/types.d.ts.map +1 -1
- package/dist/monitoring/traces.d.ts +5 -3
- package/dist/monitoring/traces.d.ts.map +1 -1
- package/dist/monitoring/traces.js +19 -5
- package/dist/monitoring/traces.js.map +1 -1
- package/dist/test-setup/jsonl-fake-fs.d.ts +30 -0
- package/dist/test-setup/jsonl-fake-fs.d.ts.map +1 -0
- package/dist/test-setup/jsonl-fake-fs.js +49 -0
- package/dist/test-setup/jsonl-fake-fs.js.map +1 -0
- package/dist/tools/index.d.ts +4 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +7 -15
- package/dist/tools/index.js.map +1 -1
- package/dist/types/checkpoint.d.ts +5 -0
- package/dist/types/checkpoint.d.ts.map +1 -1
- package/dist/types/passes-gate.d.ts +0 -13
- package/dist/types/passes-gate.d.ts.map +1 -1
- package/dist/types/project-config.d.ts +18 -0
- package/dist/types/project-config.d.ts.map +1 -1
- package/dist/types/trace.d.ts +13 -4
- package/dist/types/trace.d.ts.map +1 -1
- package/dist/types/trace.js +4 -3
- package/dist/types/trace.js.map +1 -1
- package/dist/utils/exec.d.ts +4 -27
- package/dist/utils/exec.d.ts.map +1 -1
- package/dist/utils/exec.js +4 -94
- package/dist/utils/exec.js.map +1 -1
- package/dist/utils/jsonl.d.ts +17 -7
- package/dist/utils/jsonl.d.ts.map +1 -1
- package/dist/utils/jsonl.js +144 -17
- package/dist/utils/jsonl.js.map +1 -1
- package/dist/utils/numeric-flag.d.ts +44 -0
- package/dist/utils/numeric-flag.d.ts.map +1 -0
- package/dist/utils/numeric-flag.js +62 -0
- package/dist/utils/numeric-flag.js.map +1 -0
- package/package.json +1 -1
- package/src/CONTEXT.md +5 -2
- package/src/__tests__/acceptance-gate.test.ts +7 -4
- package/src/__tests__/checker-extra.test.ts +3 -2
- package/src/__tests__/checker.test.ts +4 -3
- package/src/__tests__/checkpoint.test.ts +26 -9
- package/src/__tests__/context-files-resolution.test.ts +29 -15
- package/src/__tests__/contract-gate.test.ts +19 -40
- package/src/__tests__/error-classifier.test.ts +1 -1
- package/src/__tests__/exec.test.ts +45 -107
- package/src/__tests__/failure-recorder.test.ts +7 -5
- package/src/__tests__/hooks-pipeline.test.ts +34 -47
- package/src/__tests__/layering.test.ts +217 -25
- package/src/__tests__/passes-gate.test.ts +9 -4
- package/src/__tests__/performance-gate.test.ts +3 -15
- package/src/__tests__/project-config-loader-extra.test.ts +31 -57
- package/src/__tests__/project-config-loader.test.ts +6 -3
- package/src/__tests__/public-exports.test.ts +27 -6
- package/src/__tests__/public-type-surface.test.ts +360 -0
- package/src/__tests__/public-value-surface.test.ts +182 -0
- package/src/__tests__/review-gate.test.ts +4 -6
- package/src/__tests__/security-gate.test.ts +5 -20
- package/src/__tests__/skip-semantics.test.ts +5 -3
- package/src/__tests__/spec-validator.test.ts +3 -2
- package/src/__tests__/sub-barrels-explicit.test.ts +87 -0
- package/src/__tests__/test-fixture-hygiene.test.ts +53 -0
- package/src/__tests__/trace-analyzer-extra.test.ts +5 -3
- package/src/__tests__/trace-analyzer.test.ts +5 -3
- package/src/__tests__/trace-collector.test.ts +5 -3
- package/src/agents/index.ts +13 -2
- package/src/cli/__tests__/gate-command.test.ts +162 -0
- package/src/cli/commands/CONTEXT.md +29 -5
- package/src/cli/commands/__tests__/acceptance.test.ts +24 -25
- package/src/cli/commands/__tests__/bin-exit-mapping.test.ts +15 -0
- package/src/cli/commands/__tests__/check-drift.test.ts +42 -1
- package/src/cli/commands/__tests__/check-read-count.test.ts +167 -0
- package/src/cli/commands/__tests__/check-skip-output.test.ts +4 -1
- package/src/cli/commands/__tests__/check.test.ts +43 -36
- package/src/cli/commands/__tests__/command-gate-dead-options.test.ts +60 -0
- package/src/cli/commands/__tests__/command.test.ts +33 -17
- package/src/cli/commands/__tests__/constraints-retire.test.ts +52 -0
- package/src/cli/commands/__tests__/context-syncer.test.ts +141 -0
- package/src/cli/commands/__tests__/contract.test.ts +20 -20
- package/src/cli/commands/__tests__/failure.test.ts +5 -4
- package/src/cli/commands/__tests__/gate-decision.ts +30 -0
- package/src/cli/commands/__tests__/init-dead-options.test.ts +50 -0
- package/src/cli/commands/__tests__/init-governance-io.test.ts +139 -0
- package/src/cli/commands/__tests__/init-injection.test.ts +3 -3
- package/src/cli/commands/__tests__/init-ondisk.test.ts +867 -0
- package/src/cli/commands/__tests__/init.test.ts +82 -6
- package/src/cli/commands/__tests__/knowledge-audit-threshold.test.ts +146 -0
- package/src/cli/commands/__tests__/knowledge-flywheel-consistency.test.ts +1 -1
- package/src/cli/commands/__tests__/knowledge-tone-mapping.test.ts +244 -0
- package/src/cli/commands/__tests__/knowledge-view.test.ts +839 -0
- package/src/cli/commands/__tests__/knowledge.test.ts +33 -15
- package/src/cli/commands/__tests__/numeric-flag-assembly.test.ts +368 -0
- package/src/cli/commands/__tests__/passes-gate-dead-options.test.ts +89 -1
- package/src/cli/commands/__tests__/performance.test.ts +19 -21
- package/src/cli/commands/__tests__/posteval-plan.test.ts +5 -3
- package/src/cli/commands/__tests__/pre-push-hook.test.ts +181 -0
- package/src/cli/commands/__tests__/project-path-anchoring.test.ts +95 -2
- package/src/cli/commands/__tests__/project-path-convention.test.ts +103 -25
- package/src/cli/commands/__tests__/registry.test.ts +2 -0
- package/src/cli/commands/__tests__/report.test.ts +23 -1
- package/src/cli/commands/__tests__/review.test.ts +10 -17
- package/src/cli/commands/__tests__/scaffold.test.ts +505 -0
- package/src/cli/commands/__tests__/security-default-scan.test.ts +75 -0
- package/src/cli/commands/__tests__/security.test.ts +21 -24
- package/src/cli/commands/__tests__/spec-baseline-check.test.ts +3 -2
- package/src/cli/commands/__tests__/spec-baseline-index-cap.test.ts +131 -0
- package/src/cli/commands/__tests__/spec-baseline-read-count.test.ts +325 -0
- package/src/cli/commands/__tests__/sync-docs-agents.test.ts +19 -4
- package/src/cli/commands/__tests__/sync-docs-context-drift.test.ts +232 -0
- package/src/cli/commands/__tests__/sync-docs-module-order.test.ts +111 -0
- package/src/cli/commands/__tests__/sync-docs-read-count.test.ts +192 -0
- package/src/cli/commands/__tests__/sync-docs.test.ts +3 -2
- package/src/cli/commands/__tests__/validate.test.ts +1 -48
- package/src/cli/commands/acceptance.ts +24 -29
- package/src/cli/commands/check.ts +40 -17
- package/src/cli/commands/command.ts +9 -8
- package/src/cli/commands/constraints-retire.ts +57 -70
- package/src/cli/commands/contract.ts +44 -47
- package/src/cli/commands/definitions.ts +12 -6
- package/src/cli/commands/failure.ts +16 -3
- package/src/cli/commands/init.ts +242 -389
- package/src/cli/commands/knowledge-view.ts +224 -0
- package/src/cli/commands/knowledge.ts +643 -448
- package/src/cli/commands/passes-gate.ts +12 -3
- package/src/cli/commands/performance.ts +31 -38
- package/src/cli/commands/report.ts +3 -2
- package/src/cli/commands/review.ts +22 -28
- package/src/cli/commands/scaffold-templates.ts +406 -0
- package/src/cli/commands/scaffold.ts +302 -0
- package/src/cli/commands/security.ts +27 -23
- package/src/cli/commands/spec-baseline-check.ts +158 -33
- package/src/cli/commands/sync-docs/__tests__/context-export-surface.test.ts +102 -0
- package/src/cli/commands/sync-docs/__tests__/module-descriptions.test.ts +196 -0
- package/src/cli/commands/sync-docs/context-syncer.ts +137 -31
- package/src/cli/commands/sync-docs/index.ts +103 -28
- package/src/cli/commands/sync-docs/project-reader.ts +51 -7
- package/src/cli/commands/validate.ts +1 -104
- package/src/cli/gate-command.ts +87 -0
- package/src/completion-checkers/index.ts +10 -1
- package/src/context/CONTEXT.md +2 -1
- package/src/context/__tests__/knowledge-injector.test.ts +27 -0
- package/src/context/__tests__/session-manager.test.ts +19 -12
- package/src/context/knowledge-injector.ts +14 -7
- package/src/core/CONTEXT.md +10 -7
- package/src/core/__tests__/effective-set.test.ts +36 -60
- package/src/core/constraints/__tests__/context-reconcile.test.ts +246 -0
- package/src/core/constraints/__tests__/run-env.test.ts +377 -0
- package/src/core/constraints/__tests__/triggers.test.ts +70 -0
- package/src/core/constraints/agent-prompt-renderer.ts +1 -1
- package/src/core/constraints/capabilities-reconcile.ts +28 -4
- package/src/core/constraints/check-cache.ts +1 -1
- package/src/core/constraints/checker.ts +30 -14
- package/src/core/constraints/checkers/__tests__/context-doc-sync.test.ts +8 -3
- package/src/core/constraints/checkers/__tests__/governance-presence.test.ts +16 -7
- package/src/core/constraints/checkers/__tests__/no-hardcoded-credentials.test.ts +2 -1
- package/src/core/constraints/checkers/capability-sync.ts +27 -28
- package/src/core/constraints/checkers/context-doc-sync.ts +9 -7
- package/src/core/constraints/checkers/docs-freshness.ts +28 -33
- package/src/core/constraints/checkers/governance-presence.ts +10 -6
- package/src/core/constraints/checkers/types.ts +14 -8
- package/src/core/constraints/context-builder.ts +35 -26
- package/src/core/constraints/context-reconcile.ts +200 -0
- package/src/core/constraints/doc-freshness/__tests__/runner.test.ts +25 -0
- package/src/core/constraints/doc-freshness/runner.ts +18 -4
- package/src/core/constraints/git-evidence.ts +1 -1
- package/src/core/constraints/injection-drift.ts +19 -8
- package/src/core/constraints/run-env.ts +207 -0
- package/src/core/constraints/triggers.ts +33 -0
- package/src/core/effective-constraints.ts +17 -6
- package/src/core/effective-set.ts +8 -24
- package/src/core/index.ts +2 -1
- package/src/core/project-config-loader.ts +54 -102
- package/src/core/validators/__tests__/http-retry-sleep.test.ts +231 -0
- package/src/core/validators/check-handlers/http.ts +18 -7
- package/src/core/validators/index.ts +0 -1
- package/src/core/validators/passes-gate.ts +2 -3
- package/src/failure/CONTEXT.md +2 -1
- package/src/failure/classifier.ts +2 -2
- package/src/failure/index.ts +14 -2
- package/src/failure/recorder.ts +1 -1
- package/src/gates/CONTEXT.md +13 -7
- package/src/gates/__tests__/checker-gate.test.ts +1 -1
- package/src/gates/__tests__/command-single-predicate.test.ts +135 -0
- package/src/gates/__tests__/command.test.ts +8 -15
- package/src/gates/__tests__/contract.test.ts +5 -5
- package/src/gates/__tests__/gate-interface.test.ts +0 -17
- package/src/gates/__tests__/performance.test.ts +0 -13
- package/src/gates/__tests__/review.test.ts +0 -1
- package/src/gates/__tests__/runner.test.ts +1 -1
- package/src/gates/__tests__/security-default-scan.test.ts +97 -0
- package/src/gates/__tests__/security.test.ts +0 -13
- package/src/gates/checker-gate.ts +3 -2
- package/src/gates/command.ts +51 -74
- package/src/gates/contract.ts +0 -5
- package/src/gates/definitions.ts +6 -5
- package/src/gates/index.ts +0 -5
- package/src/gates/performance.ts +1 -6
- package/src/gates/runner.ts +1 -1
- package/src/gates/security.ts +9 -11
- package/src/gates/types.ts +20 -23
- package/src/hooks/CONTEXT.md +10 -9
- package/src/hooks/__tests__/bootstrap.test.ts +29 -6
- package/src/hooks/__tests__/pipeline.test.ts +28 -17
- package/src/hooks/__tests__/registry.test.ts +51 -3
- package/src/hooks/bootstrap.ts +35 -15
- package/src/hooks/config.ts +6 -2
- package/src/hooks/index.ts +10 -1
- package/src/hooks/pipeline.ts +4 -6
- package/src/hooks/registry.ts +31 -12
- package/src/hooks/types.ts +24 -7
- package/src/index.ts +1 -3
- package/src/knowledge/CONTEXT.md +14 -7
- package/src/knowledge/__tests__/audit-labels.test.ts +8 -5
- package/src/knowledge/__tests__/audit-scoring.test.ts +230 -0
- package/src/knowledge/__tests__/audit-write-count.test.ts +131 -0
- package/src/knowledge/__tests__/audit.test.ts +291 -208
- package/src/knowledge/__tests__/doctor.test.ts +3 -2
- package/src/knowledge/__tests__/ingest.test.ts +3 -2
- package/src/knowledge/__tests__/lifecycle.test.ts +57 -2
- package/src/knowledge/__tests__/migration.test.ts +35 -6
- package/src/knowledge/__tests__/query.test.ts +3 -2
- package/src/knowledge/__tests__/reference-tracker.test.ts +23 -2
- package/src/knowledge/__tests__/store.test.ts +149 -4
- package/src/knowledge/__tests__/tree-walker.test.ts +132 -0
- package/src/knowledge/audit-scoring.ts +589 -0
- package/src/knowledge/audit.ts +55 -599
- package/src/knowledge/import.ts +2 -0
- package/src/knowledge/index-generator.ts +4 -6
- package/src/knowledge/index.ts +27 -2
- package/src/knowledge/ingest.ts +1 -1
- package/src/knowledge/lifecycle.ts +5 -2
- package/src/knowledge/migration.ts +8 -2
- package/src/knowledge/query.ts +8 -1
- package/src/knowledge/reference-tracker.ts +5 -7
- package/src/knowledge/store.ts +75 -16
- package/src/knowledge/tree-walker.ts +29 -0
- package/src/knowledge/types.ts +19 -0
- package/src/monitoring/CONTEXT.md +5 -2
- package/src/monitoring/__tests__/context-tracker.test.ts +16 -8
- package/src/monitoring/__tests__/trace-file-anchoring.test.ts +80 -0
- package/src/monitoring/traces.ts +19 -5
- package/src/release/CONTEXT.md +1 -1
- package/src/release/__tests__/integrity.test.ts +21 -12
- package/src/test-setup/__tests__/jsonl-fake-fs.test.ts +98 -0
- package/src/test-setup/jsonl-fake-fs.ts +59 -0
- package/src/tools/index.ts +5 -1
- package/src/types/checkpoint.ts +6 -0
- package/src/types/passes-gate.ts +0 -17
- package/src/types/project-config.ts +21 -0
- package/src/types/trace.ts +14 -4
- package/src/utils/__tests__/file-walk.test.ts +3 -2
- package/src/utils/__tests__/jsonl-bounded-read.test.ts +106 -0
- package/src/utils/__tests__/jsonl-skip-disposition.test.ts +10 -6
- package/src/utils/__tests__/jsonl.test.ts +61 -14
- package/src/utils/__tests__/numeric-flag.test.ts +80 -0
- package/src/utils/__tests__/package-version.test.ts +2 -2
- package/src/utils/exec.ts +4 -64
- package/src/utils/jsonl.ts +159 -20
- package/src/utils/numeric-flag.ts +64 -0
- package/dist/failure/types.d.ts +0 -9
- package/dist/failure/types.d.ts.map +0 -1
- package/dist/failure/types.js +0 -25
- package/dist/failure/types.js.map +0 -1
- package/dist/gates/effective-gates.d.ts +0 -30
- package/dist/gates/effective-gates.d.ts.map +0 -1
- package/dist/gates/effective-gates.js +0 -81
- package/dist/gates/effective-gates.js.map +0 -1
- package/src/failure/types.ts +0 -9
- package/src/gates/__tests__/effective-gates.test.ts +0 -77
- package/src/gates/effective-gates.ts +0 -99
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 已发布类型面全量冻结闸(ADR-0003 类型面补全 / ADR-0022 追记第 4 条)
|
|
3
|
+
*
|
|
4
|
+
* 存在的理由是一起**定级**错误,不是一起删除错误:本仓 breaking 定级长期挂在「这个符号在
|
|
5
|
+
* 不在包根导出面」这句断言上(ADR-0010:5/31、ADR-0019:10、ADR-0022 皆以它定级),而这句话
|
|
6
|
+
* 在删除动作之前没有任何闸可跑,全靠人 grep 记忆。`PassesGateResult`(评审 A2)与
|
|
7
|
+
* `DynamicTask`(二次复审 B1)已在同一处错两次;B1 那次是复审方直接断言「不在包根」,而
|
|
8
|
+
* 实测 v1.6.0 源 `src/index.ts:106` 与已发布 npm 产物 `dist/index.d.ts:38` 都在导出它。
|
|
9
|
+
* 本闸让「在不在公开面上」变成跑一下就有答案的事实。
|
|
10
|
+
*
|
|
11
|
+
* **公开面 = `package.json` 的 exports 映射,不是只有包根。** 本包发布五个入口点
|
|
12
|
+
* (`.` / `./core` / `./presets` / `./context` / `./gates`),`import type { X } from
|
|
13
|
+
* '@dommaker/harness/core'` 与从包根导入同样是对外承诺。入口清单从 exports **派生**而非
|
|
14
|
+
* 硬编码:新增子路径会立刻落进本闸(未登记冻结清单即红),免得重演「公开面的定义比现实窄」
|
|
15
|
+
* 这个 B1 病因——`DynamicTask` 除包根外同时经 `./core` 可达,只冻包根会留同一个洞。
|
|
16
|
+
*
|
|
17
|
+
* 与 `public-exports.test.ts` 的分工:那边钉的是**删完之后**(已删类型 `@ts-expect-error`
|
|
18
|
+
* 负钉 + 活类型正钉 + 四级 barrel 链残留扫描),且它 `import('../index')`。本闸只做源码文本
|
|
19
|
+
* 分析、**刻意不 import 任何入口**——这是它单独立一个文件的原因:类型面一旦被改动,那边的
|
|
20
|
+
* 编译期钉会让整套 suite「failed to run」(实测注入一条 `export type { DynamicTask }` 得
|
|
21
|
+
* 0 tests),拿不到可执行的清单 diff;本闸在那种改动下必须仍然跑得动、报得出是哪个入口的
|
|
22
|
+
* 哪个符号。
|
|
23
|
+
*
|
|
24
|
+
* 清单来源不是手抄:五个入口的 `src` 解析结果与 tsc 产物(各自 exports 的 types 指向,如
|
|
25
|
+
* `dist/core/index.d.ts`)逐项对撞,152/32/1/12/18 全部逐字一致,产物侧同时零 `export *`。
|
|
26
|
+
* 改动入口清单文件时同步改本文件对应条目,diff 即 PR 评审材料;增删符号属公共面 breaking,
|
|
27
|
+
* 须按 ADR-0003/0022 走发布级别裁决。
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import * as fs from 'fs';
|
|
31
|
+
import * as path from 'path';
|
|
32
|
+
|
|
33
|
+
const REPO_ROOT = path.join(__dirname, '../..');
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 入口点合法的导出写法只有三种:
|
|
37
|
+
* ① `export { 值 } from '...'`;② `export type { 类型 } from '...'`;③ 内联值声明
|
|
38
|
+
* `export function|const|let|var`(如 `src/gates/index.ts` 的 5 个 `create*Gate`)——纯值面,
|
|
39
|
+
* 不属类型清单管辖。
|
|
40
|
+
* 清单归类按**说明符自身**而非块形式:`export { runGates, type GateRunResult }` 里的
|
|
41
|
+
* `GateRunResult` 按 TS 语义就是类型导出,必须进类型清单(本闸的职责是如实刻画公开面,不是管写法)。
|
|
42
|
+
* 其余行首 `export` 一律记为违禁而非跳过:`export *` / `export type *` 会让按名字扫描静默
|
|
43
|
+
* 漏算;内联 `export interface|type|enum|class|declare` 更必须红——它绕过类型清单,而
|
|
44
|
+
* `enum`/`class` 同时占值面与类型面,按单一分类必错一面。这正是 B1「公开面的定义比现实窄」
|
|
45
|
+
* 那个病因的形态来源。
|
|
46
|
+
*/
|
|
47
|
+
interface EntrySurface {
|
|
48
|
+
types: string[];
|
|
49
|
+
illegal: string[];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const INLINE_VALUE_DECL_RE = /^export\s+(?:async\s+)?(?:function|const|let|var)\b/;
|
|
53
|
+
|
|
54
|
+
function parseEntrySurface(source: string): EntrySurface {
|
|
55
|
+
const stmtRe = /^export (type )?\{([^}]*)\}[^;]*;/gm;
|
|
56
|
+
const types: string[] = [];
|
|
57
|
+
const illegal: string[] = [];
|
|
58
|
+
const starts = new Set<number>();
|
|
59
|
+
|
|
60
|
+
let match: RegExpExecArray | null = stmtRe.exec(source);
|
|
61
|
+
while (match !== null) {
|
|
62
|
+
starts.add(match.index);
|
|
63
|
+
const isTypeBlock = Boolean(match[1]);
|
|
64
|
+
for (const raw of match[2].split(',')) {
|
|
65
|
+
const spec = raw.trim();
|
|
66
|
+
if (!spec) continue;
|
|
67
|
+
// `A as B` 对外名字是 B;`type A as B` 对外名字是 B 且属类型面
|
|
68
|
+
const isTypeSpec = /^(type|typeof)\s/.test(spec);
|
|
69
|
+
if (isTypeBlock || isTypeSpec) {
|
|
70
|
+
types.push(spec.replace(/^(type|typeof)\s+/, '').split(/\s+as\s+/).pop()!.trim());
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
match = stmtRe.exec(source);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
let offset = 0;
|
|
77
|
+
for (const line of source.split('\n')) {
|
|
78
|
+
if (/^export\b/.test(line) && !starts.has(offset) && !INLINE_VALUE_DECL_RE.test(line)) {
|
|
79
|
+
illegal.push(line.trim());
|
|
80
|
+
}
|
|
81
|
+
offset += line.length + 1;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return { types, illegal };
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** exports 子路径 → 承载它的显式清单源文件。形态对不上返回 null,由映射闸 fail-loud。 */
|
|
88
|
+
function sourceFileForSubpath(subpath: string): string | null {
|
|
89
|
+
if (subpath === '.') return 'src/index.ts';
|
|
90
|
+
const rest = subpath.replace(/^\.\//, '');
|
|
91
|
+
return /^[a-z][a-z0-9-]*$/.test(rest) ? `src/${rest}/index.ts` : null;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const EXPORTS_MAP = JSON.parse(
|
|
95
|
+
fs.readFileSync(path.join(REPO_ROOT, 'package.json'), 'utf-8'),
|
|
96
|
+
).exports as Record<string, { types?: string }>;
|
|
97
|
+
|
|
98
|
+
const ENTRY_SUBPATHS: string[] = Object.keys(EXPORTS_MAP);
|
|
99
|
+
|
|
100
|
+
/** 每个已发布入口的类型面全量清单。增删任一项即公共面 breaking,见文件头。 */
|
|
101
|
+
const PUBLISHED_ENTRY_TYPES: Record<string, string[]> = {
|
|
102
|
+
'.': [
|
|
103
|
+
'AcceptanceCriteria',
|
|
104
|
+
'AcceptanceGateContext',
|
|
105
|
+
'AgentConfig',
|
|
106
|
+
'AgentEvent',
|
|
107
|
+
'AgentState',
|
|
108
|
+
'AgentStatus',
|
|
109
|
+
'ArtifactIntegrityResult',
|
|
110
|
+
'AuditAction',
|
|
111
|
+
'AuditIssue',
|
|
112
|
+
'AuditOptions',
|
|
113
|
+
'AuditReport',
|
|
114
|
+
'AuditRuleName',
|
|
115
|
+
'BatchSpecValidationResult',
|
|
116
|
+
'CSOIssue',
|
|
117
|
+
'CSOValidationResult',
|
|
118
|
+
'CapabilitiesConfig',
|
|
119
|
+
'ChangelogConfig',
|
|
120
|
+
'ChangelogVersionCheck',
|
|
121
|
+
'CheckCacheConfig',
|
|
122
|
+
'CheckConfig',
|
|
123
|
+
'CheckConstraintsOptions',
|
|
124
|
+
'CheckResult',
|
|
125
|
+
'CheckSamplingConfig',
|
|
126
|
+
'CheckType',
|
|
127
|
+
'CheckerVerdict',
|
|
128
|
+
'Checkpoint',
|
|
129
|
+
'CheckpointCheck',
|
|
130
|
+
'CheckpointContext',
|
|
131
|
+
'CheckpointResult',
|
|
132
|
+
'ClassificationResult',
|
|
133
|
+
'CodeStructure',
|
|
134
|
+
'CommandBlacklistRule',
|
|
135
|
+
'CommandGateConfig',
|
|
136
|
+
'CommitFileClassification',
|
|
137
|
+
'CommitInput',
|
|
138
|
+
'CommitVerdict',
|
|
139
|
+
'CompactionConfig',
|
|
140
|
+
'CompactionLevel',
|
|
141
|
+
'CompletionCheckersConfig',
|
|
142
|
+
'ConstCountActual',
|
|
143
|
+
'Constraint',
|
|
144
|
+
'ConstraintCheckResult',
|
|
145
|
+
'ConstraintContext',
|
|
146
|
+
'ConstraintId',
|
|
147
|
+
'ConstraintKind',
|
|
148
|
+
'ConstraintLevel',
|
|
149
|
+
'ConstraintResult',
|
|
150
|
+
'ConstraintTrigger',
|
|
151
|
+
'ConsumptionEvent',
|
|
152
|
+
'ConsumptionMode',
|
|
153
|
+
'ContextAverages',
|
|
154
|
+
'ContextDocsCheck',
|
|
155
|
+
'ContextFilesConfig',
|
|
156
|
+
'ContextSource',
|
|
157
|
+
'ContextSourceType',
|
|
158
|
+
'ContextUsageSnapshot',
|
|
159
|
+
'ContractGateConfig',
|
|
160
|
+
'ContractPresenceContext',
|
|
161
|
+
'ContractPresenceResult',
|
|
162
|
+
'CustomConstraintDefinition',
|
|
163
|
+
'DecayConfig',
|
|
164
|
+
'DecisionRecord',
|
|
165
|
+
'DeclarationInfo',
|
|
166
|
+
'DirCountActual',
|
|
167
|
+
'DocDirCheck',
|
|
168
|
+
'DocFreshnessCheck',
|
|
169
|
+
'DocFreshnessConfig',
|
|
170
|
+
'DocRegexCountCheck',
|
|
171
|
+
'DocsSyncConfig',
|
|
172
|
+
'EffectiveConfigLint',
|
|
173
|
+
'EffectiveHook',
|
|
174
|
+
'ErrorClassificationRule',
|
|
175
|
+
'ErrorClassifierConfig',
|
|
176
|
+
'EventHandler',
|
|
177
|
+
'ExecutionResult',
|
|
178
|
+
'ExecutionTrace',
|
|
179
|
+
'FailureRecord',
|
|
180
|
+
'FailureRecorderConfig',
|
|
181
|
+
'FallbackStrategy',
|
|
182
|
+
'Gate',
|
|
183
|
+
'GateContext',
|
|
184
|
+
'GateDecision',
|
|
185
|
+
'GateDecisionStatus',
|
|
186
|
+
'GateDefinition',
|
|
187
|
+
'GateResult',
|
|
188
|
+
'GateRunResult',
|
|
189
|
+
'GovernanceConfig',
|
|
190
|
+
'GrepCountActual',
|
|
191
|
+
'HarnessBootstrap',
|
|
192
|
+
'HookConfig',
|
|
193
|
+
'HookDefinition',
|
|
194
|
+
'HookErrorStrategy',
|
|
195
|
+
'HookExecutionRecord',
|
|
196
|
+
'HookPhase',
|
|
197
|
+
'HookResult',
|
|
198
|
+
'ImportInfo',
|
|
199
|
+
'IndexEntry',
|
|
200
|
+
'IngestOptions',
|
|
201
|
+
'InjectionConfig',
|
|
202
|
+
'InjectionResult',
|
|
203
|
+
'IronLawContext',
|
|
204
|
+
'KnowledgeEntry',
|
|
205
|
+
'KnowledgeOrigin',
|
|
206
|
+
'KnowledgeReference',
|
|
207
|
+
'KnowledgeStore',
|
|
208
|
+
'KnowledgeSubsystem',
|
|
209
|
+
'LintIssue',
|
|
210
|
+
'LintIssueType',
|
|
211
|
+
'MaturityChange',
|
|
212
|
+
'MaturityLevel',
|
|
213
|
+
'MergedConstraintsConfig',
|
|
214
|
+
'PassesGateCheckResult',
|
|
215
|
+
'PassesGateConfig',
|
|
216
|
+
'PassesGateViolation',
|
|
217
|
+
'PerformanceGateConfig',
|
|
218
|
+
'PerformanceThresholds',
|
|
219
|
+
'PhaseFormatResult',
|
|
220
|
+
'PipelineResult',
|
|
221
|
+
'ProjectConfig',
|
|
222
|
+
'QueryBudget',
|
|
223
|
+
'QueryFilter',
|
|
224
|
+
'QueryResult',
|
|
225
|
+
'ReferenceRecord',
|
|
226
|
+
'RenderConstraintsByTriggerOptions',
|
|
227
|
+
'ReviewGateConfig',
|
|
228
|
+
'SchemaLoader',
|
|
229
|
+
'SecurityGateConfig',
|
|
230
|
+
'SessionCheckpoint',
|
|
231
|
+
'SessionEvent',
|
|
232
|
+
'SessionEventType',
|
|
233
|
+
'SessionHandle',
|
|
234
|
+
'SessionMessage',
|
|
235
|
+
'SourceRef',
|
|
236
|
+
'SpecAcceptanceGateConfig',
|
|
237
|
+
'SpecSchemaDefinition',
|
|
238
|
+
'SpecType',
|
|
239
|
+
'SpecValidationError',
|
|
240
|
+
'SpecValidationResult',
|
|
241
|
+
'SpecValidatorConfig',
|
|
242
|
+
'StepMeta',
|
|
243
|
+
'StorageLayer',
|
|
244
|
+
'TaskTestResult',
|
|
245
|
+
'TddChainResult',
|
|
246
|
+
'TestResult',
|
|
247
|
+
'TestingGovernanceConfig',
|
|
248
|
+
'ToolMeta',
|
|
249
|
+
'TraceAnalyzerConfig',
|
|
250
|
+
'TraceAnomaly',
|
|
251
|
+
'TraceCollectorConfig',
|
|
252
|
+
'TraceFilter',
|
|
253
|
+
'TraceSummary',
|
|
254
|
+
'WorkflowMeta',
|
|
255
|
+
],
|
|
256
|
+
'./core': [
|
|
257
|
+
'BatchSpecValidationResult',
|
|
258
|
+
'CSOIssue',
|
|
259
|
+
'CSOValidationResult',
|
|
260
|
+
'CapabilitiesMode',
|
|
261
|
+
'CheckCacheConfig',
|
|
262
|
+
'CheckConfig',
|
|
263
|
+
'CheckConstraintsOptions',
|
|
264
|
+
'CheckResult',
|
|
265
|
+
'CheckSamplingConfig',
|
|
266
|
+
'CheckType',
|
|
267
|
+
'Checkpoint',
|
|
268
|
+
'CheckpointCheck',
|
|
269
|
+
'CheckpointContext',
|
|
270
|
+
'CheckpointResult',
|
|
271
|
+
'Constraint',
|
|
272
|
+
'ConstraintCheckResult',
|
|
273
|
+
'ConstraintContext',
|
|
274
|
+
'ConstraintId',
|
|
275
|
+
'ConstraintKind',
|
|
276
|
+
'ConstraintLevel',
|
|
277
|
+
'ConstraintResult',
|
|
278
|
+
'ConstraintTrigger',
|
|
279
|
+
'ContextFilesResolution',
|
|
280
|
+
'EffectiveConfigLint',
|
|
281
|
+
'IronLawContext',
|
|
282
|
+
'PassesGateConfig',
|
|
283
|
+
'RenderConstraintsByTriggerOptions',
|
|
284
|
+
'RunEnv',
|
|
285
|
+
'RunTarget',
|
|
286
|
+
'SpecSchemaDefinition',
|
|
287
|
+
'SpecType',
|
|
288
|
+
'SpecValidationResult',
|
|
289
|
+
'SpecValidatorConfig',
|
|
290
|
+
'TaskTestResult',
|
|
291
|
+
],
|
|
292
|
+
'./presets': [
|
|
293
|
+
'PresetConfig',
|
|
294
|
+
],
|
|
295
|
+
'./context': [
|
|
296
|
+
'CompactionConfig',
|
|
297
|
+
'CompactionLevel',
|
|
298
|
+
'ContextSource',
|
|
299
|
+
'ContextSourceType',
|
|
300
|
+
'ContextUsageSnapshot',
|
|
301
|
+
'InjectionConfig',
|
|
302
|
+
'InjectionResult',
|
|
303
|
+
'SessionCheckpoint',
|
|
304
|
+
'SessionEvent',
|
|
305
|
+
'SessionEventType',
|
|
306
|
+
'SessionHandle',
|
|
307
|
+
'SessionMessage',
|
|
308
|
+
],
|
|
309
|
+
'./gates': [
|
|
310
|
+
'AcceptanceCriteria',
|
|
311
|
+
'AcceptanceGateContext',
|
|
312
|
+
'CommandBlacklistRule',
|
|
313
|
+
'CommandGateConfig',
|
|
314
|
+
'ContractGateConfig',
|
|
315
|
+
'Gate',
|
|
316
|
+
'GateContext',
|
|
317
|
+
'GateDecision',
|
|
318
|
+
'GateDecisionStatus',
|
|
319
|
+
'GateDefinition',
|
|
320
|
+
'GateResult',
|
|
321
|
+
'GateRunResult',
|
|
322
|
+
'PerformanceGateConfig',
|
|
323
|
+
'PerformanceThresholds',
|
|
324
|
+
'ReviewGateConfig',
|
|
325
|
+
'SecurityGateConfig',
|
|
326
|
+
'SpecAcceptanceGateConfig',
|
|
327
|
+
],
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
describe('已发布类型面全量冻结(ADR-0022 追记 4)', () => {
|
|
331
|
+
it('exports 的每个子路径都映射到存在的显式清单源文件(新增子路径不得绕过本闸)', () => {
|
|
332
|
+
const unmapped = ENTRY_SUBPATHS.filter((sub) => {
|
|
333
|
+
const rel = sourceFileForSubpath(sub);
|
|
334
|
+
return rel === null || !fs.existsSync(path.join(REPO_ROOT, rel));
|
|
335
|
+
});
|
|
336
|
+
expect(unmapped).toEqual([]);
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
it('冻结清单覆盖全部已发布子路径(新增入口须先登记清单)', () => {
|
|
340
|
+
expect(Object.keys(PUBLISHED_ENTRY_TYPES).sort()).toEqual([...ENTRY_SUBPATHS].sort());
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
for (const sub of ENTRY_SUBPATHS) {
|
|
344
|
+
const rel = sourceFileForSubpath(sub);
|
|
345
|
+
if (rel === null) continue; // 映射闸已负责红,此处不重复报
|
|
346
|
+
const surface = parseEntrySurface(fs.readFileSync(path.join(REPO_ROOT, rel), 'utf-8'));
|
|
347
|
+
|
|
348
|
+
describe(`入口点 ${sub}(${rel})`, () => {
|
|
349
|
+
it('只用白名单写法导出,无被漏算的导出面', () => {
|
|
350
|
+
expect(surface.illegal).toEqual([]);
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
it('类型清单与冻结集逐字一致(增删即 breaking,需发布级别裁决)', () => {
|
|
354
|
+
// 解析塌掉不得退化成空集合假绿
|
|
355
|
+
expect(surface.types.length).toBeGreaterThan(0);
|
|
356
|
+
expect([...surface.types].sort()).toEqual([...PUBLISHED_ENTRY_TYPES[sub]].sort());
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
});
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 已发布子路径值面全量冻结闸(ADR-0022 追记第 5 条收口)
|
|
3
|
+
*
|
|
4
|
+
* 补齐 `public-type-surface.test.ts` 的另一半:那道闸按 `package.json` 的 `exports` 逐入口冻
|
|
5
|
+
* 结了**类型面**,但值面(运行时导出)只有包根一处被 `public-exports.test.ts` 钉住——
|
|
6
|
+
* `Object.keys(await import('../index'))` 只看得到 `.` 一个入口。于是「这个函数不在公开面上、
|
|
7
|
+
* 删它非 breaking」这类定级断言在子路径入口仍无闸可跑,只能靠人工逐条附「各入口源文件 +
|
|
8
|
+
* 已发布产物 `.d.ts`」双证据(能防这一次,防不了下一次)。
|
|
9
|
+
*
|
|
10
|
+
* 落闸前实测的洞(五个入口的运行时键集合 106/29/4/4/24):`./core` 有 7 个值导出、
|
|
11
|
+
* `./presets` 有 4 个(即该入口全部)不在包根清单里——删掉它们当前**零测试变红**。
|
|
12
|
+
* `./gates` 与 `./context` 的值导出恰好是包根的子集,删除会经 `src/index.ts` 的 barrel 链
|
|
13
|
+
* 撞上包根那条闸,但红名报的是 `.`、不是真正被删的那个入口——定级时照样得再人肉查一遍。
|
|
14
|
+
*
|
|
15
|
+
* 口径与类型面闸一致:**公开面 = `exports` 映射,不是只有包根**,入口清单从 `exports` 派生
|
|
16
|
+
* 而非硬编码,新增子路径未登记冻结清单即红。分工:
|
|
17
|
+
* - `.` 的值面仍由 `public-exports.test.ts` 冻结(本闸刻意不重复钉——同一个入口两份清单
|
|
18
|
+
* 必然漂移,且那条判定要逐字保留),本闸只管四个子路径;「两边都不漏」由登记闸与委派闸各钉一条。
|
|
19
|
+
* - 类型面归 `public-type-surface.test.ts`,含导出写法白名单(堵 `export *` 与入口内联类型
|
|
20
|
+
* 声明)。值面按运行时事实枚举,无按名字扫描漏算之虞,故本闸不重复那道写法检查。
|
|
21
|
+
*
|
|
22
|
+
* 本闸走运行时 `import`:值面的事实只有模块加载后才是真的(`Object.keys` 读到的正是 tsc
|
|
23
|
+
* 产物出厂的那批键)。它与类型面改动互不影响——`public-exports.test.ts` 的编译期钉在类型面
|
|
24
|
+
* 被改时会让那个套件「failed to run」(实测向 `src/index.ts` 注一条 `export type { DynamicTask }`
|
|
25
|
+
* 得 TS2578),本闸在同一注入下 7 项照跑且全绿,值面的清单 diff 不会被类型面的编译期钉连带抹掉。
|
|
26
|
+
*
|
|
27
|
+
* 冻结清单不手抄:四子路径 + 包根的 `src` 侧 ts-jest 运行时键与各自 tsc 产物
|
|
28
|
+
* (`dist/**\/index.js`)逐入口 `Object.keys` 对撞,106/29/4/4/24 全部逐字一致。改动入口清单
|
|
29
|
+
* 文件时同步改本文件对应条目,diff 即 PR 评审材料;增删符号属公共面 breaking,须按
|
|
30
|
+
* ADR-0003/0022 走发布级别裁决。
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
import * as fs from 'fs';
|
|
34
|
+
import * as path from 'path';
|
|
35
|
+
|
|
36
|
+
const REPO_ROOT = path.join(__dirname, '../..');
|
|
37
|
+
|
|
38
|
+
/** 包根值面的既有归属,见文件头分工。 */
|
|
39
|
+
const PACKAGE_ROOT_SUBPATH = '.';
|
|
40
|
+
|
|
41
|
+
const EXPORTS_MAP = JSON.parse(
|
|
42
|
+
fs.readFileSync(path.join(REPO_ROOT, 'package.json'), 'utf-8'),
|
|
43
|
+
).exports as Record<string, unknown>;
|
|
44
|
+
|
|
45
|
+
const ENTRY_SUBPATHS: string[] = Object.keys(EXPORTS_MAP);
|
|
46
|
+
|
|
47
|
+
/** 每个已发布子路径入口的值面全量清单。增删任一项即公共面 breaking,见文件头。 */
|
|
48
|
+
const PUBLISHED_ENTRY_VALUES: Record<string, string[]> = {
|
|
49
|
+
'./core': [
|
|
50
|
+
'CONSTRAINTS_END_MARKER',
|
|
51
|
+
'CONSTRAINTS_START_MARKER',
|
|
52
|
+
'CSOValidator',
|
|
53
|
+
'CheckCache',
|
|
54
|
+
'CheckpointValidator',
|
|
55
|
+
'ConstraintChecker',
|
|
56
|
+
'ConstraintViolationError',
|
|
57
|
+
'GUIDELINES',
|
|
58
|
+
'IRON_LAWS',
|
|
59
|
+
'PROMPTS',
|
|
60
|
+
'PassesGate',
|
|
61
|
+
'ProjectConfigLoader',
|
|
62
|
+
'SpecValidator',
|
|
63
|
+
'checkBeforeExecution',
|
|
64
|
+
'checkConstraint',
|
|
65
|
+
'checkConstraints',
|
|
66
|
+
'constraintChecker',
|
|
67
|
+
'createPassesGate',
|
|
68
|
+
'findConstraintsByTrigger',
|
|
69
|
+
'getAllConstraints',
|
|
70
|
+
'getCapabilitiesMode',
|
|
71
|
+
'getConstraint',
|
|
72
|
+
'getEffectiveConstraints',
|
|
73
|
+
'getGovernanceConfig',
|
|
74
|
+
'lintEffectiveConfig',
|
|
75
|
+
'loadRawProjectConfig',
|
|
76
|
+
'renderConstraintsByTrigger',
|
|
77
|
+
'renderConstraintsSection',
|
|
78
|
+
'resolveContextFiles',
|
|
79
|
+
],
|
|
80
|
+
'./presets': [
|
|
81
|
+
'PRESETS_BY_NAME',
|
|
82
|
+
'RELAXED_PRESET',
|
|
83
|
+
'STANDARD_PRESET',
|
|
84
|
+
'STRICT_PRESET',
|
|
85
|
+
],
|
|
86
|
+
'./context': [
|
|
87
|
+
'KnowledgeInjector',
|
|
88
|
+
'SessionManager',
|
|
89
|
+
'TokenBudget',
|
|
90
|
+
'TokenEstimator',
|
|
91
|
+
],
|
|
92
|
+
'./gates': [
|
|
93
|
+
'CommandGate',
|
|
94
|
+
'ContractGate',
|
|
95
|
+
'DEFAULT_COMMAND_BLACKLIST',
|
|
96
|
+
'GATE_DEFINITIONS',
|
|
97
|
+
'PerformanceGate',
|
|
98
|
+
'ReviewGate',
|
|
99
|
+
'SecurityGate',
|
|
100
|
+
'SpecAcceptanceGate',
|
|
101
|
+
'assertGateRegistryClosed',
|
|
102
|
+
'createCheckerGate',
|
|
103
|
+
'createCommandGate',
|
|
104
|
+
'createContractGate',
|
|
105
|
+
'createPerformanceGate',
|
|
106
|
+
'createReviewGate',
|
|
107
|
+
'createSecurityGate',
|
|
108
|
+
'createSpecAcceptanceGate',
|
|
109
|
+
'decisionFromResult',
|
|
110
|
+
'getCommandGate',
|
|
111
|
+
'getCommandRiskLevel',
|
|
112
|
+
'getGate',
|
|
113
|
+
'isCommandAllowed',
|
|
114
|
+
'listRegisteredGates',
|
|
115
|
+
'registeredGateCount',
|
|
116
|
+
'runGates',
|
|
117
|
+
],
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/** exports 子路径 → 承载它的显式清单源文件。形态对不上返回 null,由映射闸 fail-loud。 */
|
|
121
|
+
function sourceFileForSubpath(subpath: string): string | null {
|
|
122
|
+
if (subpath === PACKAGE_ROOT_SUBPATH) return 'src/index.ts';
|
|
123
|
+
const rest = subpath.replace(/^\.\//, '');
|
|
124
|
+
return /^[a-z][a-z0-9-]*$/.test(rest) ? `src/${rest}/index.ts` : null;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** 同上,但产 ts-jest 可解析的相对说明符(本包未自引用发布名,只能按源码路径 import)。 */
|
|
128
|
+
function moduleSpecifierForSubpath(subpath: string): string | null {
|
|
129
|
+
const rel = sourceFileForSubpath(subpath);
|
|
130
|
+
if (rel === null) return null;
|
|
131
|
+
return `../${rel.replace(/^src\//, '').replace(/\.ts$/, '')}`;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
async function runtimeKeysOf(subpath: string): Promise<string[]> {
|
|
135
|
+
const specifier = moduleSpecifierForSubpath(subpath);
|
|
136
|
+
expect(specifier).not.toBeNull();
|
|
137
|
+
const mod: Record<string, unknown> = await import(specifier as string);
|
|
138
|
+
return Object.keys(mod).sort();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
describe('已发布子路径值面全量冻结(ADR-0022 追记 5)', () => {
|
|
142
|
+
it('exports 的每个子路径都映射到存在的显式清单源文件(新增子路径不得绕过本闸)', () => {
|
|
143
|
+
const unmapped = ENTRY_SUBPATHS.filter((sub) => {
|
|
144
|
+
const rel = sourceFileForSubpath(sub);
|
|
145
|
+
return rel === null || !fs.existsSync(path.join(REPO_ROOT, rel));
|
|
146
|
+
});
|
|
147
|
+
expect(unmapped).toEqual([]);
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it('冻结清单覆盖除包根外的全部已发布子路径(新增入口须先登记清单)', () => {
|
|
151
|
+
expect(Object.keys(PUBLISHED_ENTRY_VALUES).sort()).toEqual(
|
|
152
|
+
ENTRY_SUBPATHS.filter((sub) => sub !== PACKAGE_ROOT_SUBPATH).sort(),
|
|
153
|
+
);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('包根值面确有既有归属(本闸委派 `.`,两边都不钉即公共面失控)', () => {
|
|
157
|
+
const sibling = fs.readFileSync(path.join(__dirname, 'public-exports.test.ts'), 'utf-8');
|
|
158
|
+
expect(sibling).toContain('Object.keys(mod)');
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
for (const sub of ENTRY_SUBPATHS) {
|
|
162
|
+
if (sub === PACKAGE_ROOT_SUBPATH) continue; // 委派给 public-exports.test.ts,见文件头
|
|
163
|
+
if (moduleSpecifierForSubpath(sub) === null) continue; // 映射闸已负责红,此处不重复报
|
|
164
|
+
const frozen = PUBLISHED_ENTRY_VALUES[sub];
|
|
165
|
+
if (frozen === undefined) continue; // 未登记入口由登记闸负责红,此处不重复报
|
|
166
|
+
|
|
167
|
+
describe(`入口点 ${sub}`, () => {
|
|
168
|
+
it('运行时导出键集合与冻结清单逐字一致(增删即 breaking,需发布级别裁决)', async () => {
|
|
169
|
+
const actual = await runtimeKeysOf(sub);
|
|
170
|
+
// 解析塌掉不得退化成空集合假绿;冻结清单自身不得有重复项(重复 + 缺失会互相抵掉 diff)
|
|
171
|
+
expect(actual.length).toBeGreaterThan(0);
|
|
172
|
+
expect(new Set(frozen).size).toBe(frozen.length);
|
|
173
|
+
expect({
|
|
174
|
+
entry: sub,
|
|
175
|
+
missing: frozen.filter((key) => !actual.includes(key)),
|
|
176
|
+
extra: actual.filter((key) => !frozen.includes(key)),
|
|
177
|
+
}).toEqual({ entry: sub, missing: [], extra: [] });
|
|
178
|
+
expect(actual.length).toBe(frozen.length);
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
});
|
|
@@ -4,16 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import { describe, it, expect, beforeAll, afterAll } from '@jest/globals';
|
|
6
6
|
import { ReviewGate } from '../gates/review';
|
|
7
|
-
import {
|
|
7
|
+
import { rmSync, writeFileSync, mkdtempSync } from 'fs';
|
|
8
8
|
import { join } from 'path';
|
|
9
|
+
import { tmpdir } from 'os';
|
|
9
10
|
import { execSync } from 'child_process';
|
|
10
11
|
|
|
11
12
|
describe('ReviewGate', () => {
|
|
12
|
-
|
|
13
|
+
let tempDir: string;
|
|
13
14
|
let gate: ReviewGate;
|
|
14
15
|
|
|
15
16
|
beforeAll(() => {
|
|
16
|
-
|
|
17
|
+
tempDir = mkdtempSync(join(tmpdir(), 'temp-test-review-gate-'));
|
|
17
18
|
gate = new ReviewGate({ minReviewers: 1, requireApproval: true });
|
|
18
19
|
|
|
19
20
|
// 初始化 git
|
|
@@ -40,7 +41,6 @@ describe('ReviewGate', () => {
|
|
|
40
41
|
describe('check', () => {
|
|
41
42
|
it('本地模式应该返回警告', async () => {
|
|
42
43
|
const result = await gate.check({
|
|
43
|
-
projectId: 'test-project',
|
|
44
44
|
projectPath: tempDir,
|
|
45
45
|
});
|
|
46
46
|
|
|
@@ -53,7 +53,6 @@ describe('ReviewGate', () => {
|
|
|
53
53
|
const relaxedGate = new ReviewGate({ requireApproval: false });
|
|
54
54
|
|
|
55
55
|
const result = await relaxedGate.check({
|
|
56
|
-
projectId: 'test-project',
|
|
57
56
|
projectPath: tempDir,
|
|
58
57
|
});
|
|
59
58
|
|
|
@@ -82,7 +81,6 @@ describe('ReviewGate', () => {
|
|
|
82
81
|
describe('checkLocalGit', () => {
|
|
83
82
|
it('应该检查 git 状态', async () => {
|
|
84
83
|
const result = await gate.check({
|
|
85
|
-
projectId: 'test-project',
|
|
86
84
|
projectPath: tempDir,
|
|
87
85
|
});
|
|
88
86
|
|
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
import { describe, it, expect, beforeAll, afterAll } from '@jest/globals';
|
|
6
6
|
import { SecurityGate } from '../gates/security';
|
|
7
|
-
import {
|
|
7
|
+
import { rmSync, writeFileSync, mkdtempSync } from 'fs';
|
|
8
8
|
import { join } from 'path';
|
|
9
|
+
import { tmpdir } from 'os';
|
|
9
10
|
|
|
10
11
|
describe('SecurityGate', () => {
|
|
11
|
-
|
|
12
|
+
let tempDir: string;
|
|
12
13
|
let gate: SecurityGate;
|
|
13
14
|
|
|
14
15
|
beforeAll(() => {
|
|
15
|
-
|
|
16
|
+
tempDir = mkdtempSync(join(tmpdir(), 'temp-test-security-gate-'));
|
|
16
17
|
|
|
17
18
|
// 创建 package.json(无漏洞)
|
|
18
19
|
writeFileSync(join(tempDir, 'package.json'), JSON.stringify({
|
|
@@ -20,7 +21,7 @@ describe('SecurityGate', () => {
|
|
|
20
21
|
dependencies: {},
|
|
21
22
|
}));
|
|
22
23
|
|
|
23
|
-
gate = new SecurityGate({
|
|
24
|
+
gate = new SecurityGate({ severityThreshold: 'high' });
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
afterAll(() => {
|
|
@@ -32,22 +33,9 @@ describe('SecurityGate', () => {
|
|
|
32
33
|
});
|
|
33
34
|
|
|
34
35
|
describe('scan', () => {
|
|
35
|
-
it('禁用时应该返回通过', async () => {
|
|
36
|
-
const disabledGate = new SecurityGate({ enabled: false });
|
|
37
|
-
|
|
38
|
-
const result = await disabledGate.scan({
|
|
39
|
-
projectId: 'test-project',
|
|
40
|
-
projectPath: tempDir,
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
expect(result.passed).toBe(true);
|
|
44
|
-
expect(result.message).toContain('安全门禁已禁用');
|
|
45
|
-
});
|
|
46
|
-
|
|
47
36
|
// 跳过:依赖真实 npm audit 结果,需要 mock 重构
|
|
48
37
|
it.skip('应该运行 npm audit', async () => {
|
|
49
38
|
const result = await gate.scan({
|
|
50
|
-
projectId: 'test-project',
|
|
51
39
|
projectPath: tempDir,
|
|
52
40
|
});
|
|
53
41
|
|
|
@@ -57,7 +45,6 @@ describe('SecurityGate', () => {
|
|
|
57
45
|
|
|
58
46
|
it.skip('应该返回漏洞分析', async () => {
|
|
59
47
|
const result = await gate.scan({
|
|
60
|
-
projectId: 'test-project',
|
|
61
48
|
projectPath: tempDir,
|
|
62
49
|
});
|
|
63
50
|
|
|
@@ -70,7 +57,6 @@ describe('SecurityGate', () => {
|
|
|
70
57
|
describe('severityThreshold', () => {
|
|
71
58
|
it.skip('high 阈值应该检查 critical + high', async () => {
|
|
72
59
|
const result = await gate.scan({
|
|
73
|
-
projectId: 'test-project',
|
|
74
60
|
projectPath: tempDir,
|
|
75
61
|
});
|
|
76
62
|
|
|
@@ -89,7 +75,6 @@ describe('SecurityGate', () => {
|
|
|
89
75
|
describe('analyzeResult', () => {
|
|
90
76
|
it.skip('应该解析 npm audit JSON 或返回 passed', async () => {
|
|
91
77
|
const result = await gate.scan({
|
|
92
|
-
projectId: 'test-project',
|
|
93
78
|
projectPath: tempDir,
|
|
94
79
|
});
|
|
95
80
|
|