@dommaker/harness 1.15.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/bin/harness.js +6 -0
- package/dist/agents/lifecycle.d.ts.map +1 -1
- package/dist/agents/lifecycle.js +3 -6
- package/dist/agents/lifecycle.js.map +1 -1
- package/dist/cli/command-contract.d.ts +10 -13
- package/dist/cli/command-contract.d.ts.map +1 -1
- package/dist/cli/command-contract.js +6 -0
- package/dist/cli/command-contract.js.map +1 -1
- package/dist/cli/commands/acceptance.d.ts.map +1 -1
- package/dist/cli/commands/acceptance.js +8 -7
- package/dist/cli/commands/acceptance.js.map +1 -1
- package/dist/cli/commands/command.d.ts.map +1 -1
- package/dist/cli/commands/command.js +5 -5
- package/dist/cli/commands/command.js.map +1 -1
- package/dist/cli/commands/constraints-disable.d.ts +7 -11
- package/dist/cli/commands/constraints-disable.d.ts.map +1 -1
- package/dist/cli/commands/constraints-disable.js +8 -80
- package/dist/cli/commands/constraints-disable.js.map +1 -1
- package/dist/cli/commands/constraints-pack-proposal.d.ts +7 -20
- package/dist/cli/commands/constraints-pack-proposal.d.ts.map +1 -1
- package/dist/cli/commands/constraints-pack-proposal.js +21 -129
- package/dist/cli/commands/constraints-pack-proposal.js.map +1 -1
- package/dist/cli/commands/constraints-reactivate.d.ts +8 -20
- package/dist/cli/commands/constraints-reactivate.d.ts.map +1 -1
- package/dist/cli/commands/constraints-reactivate.js +11 -105
- package/dist/cli/commands/constraints-reactivate.js.map +1 -1
- package/dist/cli/commands/constraints-retire.d.ts +11 -67
- package/dist/cli/commands/constraints-retire.d.ts.map +1 -1
- package/dist/cli/commands/constraints-retire.js +20 -196
- package/dist/cli/commands/constraints-retire.js.map +1 -1
- package/dist/cli/commands/constraints.d.ts +6 -9
- package/dist/cli/commands/constraints.d.ts.map +1 -1
- package/dist/cli/commands/constraints.js +7 -21
- package/dist/cli/commands/constraints.js.map +1 -1
- package/dist/cli/commands/contract.d.ts.map +1 -1
- package/dist/cli/commands/contract.js +20 -10
- package/dist/cli/commands/contract.js.map +1 -1
- package/dist/cli/commands/definitions.d.ts.map +1 -1
- package/dist/cli/commands/definitions.js +13 -12
- package/dist/cli/commands/definitions.js.map +1 -1
- package/dist/cli/commands/init/ci-platform.d.ts +35 -0
- package/dist/cli/commands/init/ci-platform.d.ts.map +1 -0
- package/dist/cli/commands/init/ci-platform.js +59 -0
- package/dist/cli/commands/init/ci-platform.js.map +1 -0
- package/dist/cli/commands/init/ci-wiring.d.ts +20 -0
- package/dist/cli/commands/init/ci-wiring.d.ts.map +1 -0
- package/dist/cli/commands/init/ci-wiring.js +72 -0
- package/dist/cli/commands/init/ci-wiring.js.map +1 -0
- package/dist/cli/commands/init/git-hooks.d.ts +15 -0
- package/dist/cli/commands/init/git-hooks.d.ts.map +1 -0
- package/dist/{tools/paths.js → cli/commands/init/git-hooks.js} +25 -12
- package/dist/cli/commands/init/git-hooks.js.map +1 -0
- package/dist/cli/commands/init/governance.d.ts +14 -0
- package/dist/cli/commands/init/governance.d.ts.map +1 -0
- package/dist/cli/commands/init/governance.js +132 -0
- package/dist/cli/commands/init/governance.js.map +1 -0
- package/dist/cli/commands/{init.d.ts → init/index.d.ts} +13 -14
- package/dist/cli/commands/init/index.d.ts.map +1 -0
- package/dist/cli/commands/init/index.js +148 -0
- package/dist/cli/commands/init/index.js.map +1 -0
- package/dist/cli/commands/init/output-style.d.ts +19 -0
- package/dist/cli/commands/init/output-style.d.ts.map +1 -0
- package/dist/cli/commands/init/output-style.js +110 -0
- package/dist/cli/commands/init/output-style.js.map +1 -0
- package/dist/cli/commands/init/presets.d.ts +26 -0
- package/dist/cli/commands/init/presets.d.ts.map +1 -0
- package/dist/cli/commands/init/presets.js +104 -0
- package/dist/cli/commands/init/presets.js.map +1 -0
- package/dist/cli/commands/init/snippets.d.ts +18 -0
- package/dist/cli/commands/init/snippets.d.ts.map +1 -0
- package/dist/cli/commands/init/snippets.js +49 -0
- package/dist/cli/commands/init/snippets.js.map +1 -0
- package/dist/cli/commands/knowledge/audit.d.ts +30 -0
- package/dist/cli/commands/knowledge/audit.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/audit.js +114 -0
- package/dist/cli/commands/knowledge/audit.js.map +1 -0
- package/dist/cli/commands/knowledge/decay.d.ts +19 -0
- package/dist/cli/commands/knowledge/decay.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/decay.js +48 -0
- package/dist/cli/commands/knowledge/decay.js.map +1 -0
- package/dist/cli/commands/knowledge/health.d.ts +36 -0
- package/dist/cli/commands/knowledge/health.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/health.js +172 -0
- package/dist/cli/commands/knowledge/health.js.map +1 -0
- package/dist/cli/commands/knowledge/import.d.ts +26 -0
- package/dist/cli/commands/knowledge/import.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/import.js +63 -0
- package/dist/cli/commands/knowledge/import.js.map +1 -0
- package/dist/cli/commands/knowledge/index.d.ts +25 -0
- package/dist/cli/commands/knowledge/index.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/index.js +84 -0
- package/dist/cli/commands/knowledge/index.js.map +1 -0
- package/dist/cli/commands/knowledge/list.d.ts +25 -0
- package/dist/cli/commands/knowledge/list.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/list.js +60 -0
- package/dist/cli/commands/knowledge/list.js.map +1 -0
- package/dist/cli/commands/knowledge/migrate.d.ts +21 -0
- package/dist/cli/commands/knowledge/migrate.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/migrate.js +48 -0
- package/dist/cli/commands/knowledge/migrate.js.map +1 -0
- package/dist/cli/commands/knowledge/search.d.ts +32 -0
- package/dist/cli/commands/knowledge/search.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/search.js +73 -0
- package/dist/cli/commands/knowledge/search.js.map +1 -0
- package/dist/cli/commands/knowledge/shared.d.ts +14 -0
- package/dist/cli/commands/knowledge/shared.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/shared.js +6 -0
- package/dist/cli/commands/knowledge/shared.js.map +1 -0
- package/dist/cli/commands/knowledge/snapshot.d.ts +18 -0
- package/dist/cli/commands/knowledge/snapshot.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/snapshot.js +34 -0
- package/dist/cli/commands/knowledge/snapshot.js.map +1 -0
- package/dist/cli/commands/knowledge/stats.d.ts +26 -0
- package/dist/cli/commands/knowledge/stats.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/stats.js +132 -0
- package/dist/cli/commands/knowledge/stats.js.map +1 -0
- package/dist/cli/commands/knowledge/sync-rag.d.ts +19 -0
- package/dist/cli/commands/knowledge/sync-rag.d.ts.map +1 -0
- package/dist/cli/commands/knowledge/sync-rag.js +77 -0
- package/dist/cli/commands/knowledge/sync-rag.js.map +1 -0
- package/dist/cli/commands/knowledge-view.d.ts +2 -1
- package/dist/cli/commands/knowledge-view.d.ts.map +1 -1
- package/dist/cli/commands/knowledge-view.js +2 -2
- package/dist/cli/commands/knowledge-view.js.map +1 -1
- package/dist/cli/commands/passes-gate.d.ts.map +1 -1
- package/dist/cli/commands/passes-gate.js +12 -2
- package/dist/cli/commands/passes-gate.js.map +1 -1
- package/dist/cli/commands/performance.js.map +1 -1
- package/dist/cli/commands/release.d.ts +2 -2
- package/dist/cli/commands/release.d.ts.map +1 -1
- package/dist/cli/commands/release.js +15 -43
- package/dist/cli/commands/release.js.map +1 -1
- package/dist/cli/commands/review.d.ts.map +1 -1
- package/dist/cli/commands/review.js +3 -2
- package/dist/cli/commands/review.js.map +1 -1
- package/dist/cli/commands/scaffold-templates.d.ts +7 -0
- package/dist/cli/commands/scaffold-templates.d.ts.map +1 -1
- package/dist/cli/commands/scaffold-templates.js +21 -1
- package/dist/cli/commands/scaffold-templates.js.map +1 -1
- package/dist/cli/commands/security.d.ts.map +1 -1
- package/dist/cli/commands/security.js +7 -8
- package/dist/cli/commands/security.js.map +1 -1
- package/dist/cli/commands/spec-baseline-check.d.ts.map +1 -1
- package/dist/cli/commands/spec-baseline-check.js +6 -5
- package/dist/cli/commands/spec-baseline-check.js.map +1 -1
- package/dist/cli/commands/status.js +2 -2
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/sync-docs/agents-syncer.js +31 -55
- package/dist/cli/commands/sync-docs/agents-syncer.js.map +1 -1
- package/dist/cli/commands/sync-docs/capabilities-syncer.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/capabilities-syncer.js +18 -12
- package/dist/cli/commands/sync-docs/capabilities-syncer.js.map +1 -1
- package/dist/cli/commands/sync-docs/compact.d.ts +9 -0
- package/dist/cli/commands/sync-docs/compact.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/compact.js +73 -0
- package/dist/cli/commands/sync-docs/compact.js.map +1 -0
- package/dist/cli/commands/sync-docs/context-syncer.d.ts +13 -0
- package/dist/cli/commands/sync-docs/context-syncer.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/context-syncer.js +40 -29
- package/dist/cli/commands/sync-docs/context-syncer.js.map +1 -1
- package/dist/cli/commands/sync-docs/gate.d.ts +27 -0
- package/dist/cli/commands/sync-docs/gate.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/gate.js +72 -0
- package/dist/cli/commands/sync-docs/gate.js.map +1 -0
- package/dist/cli/commands/sync-docs/index.d.ts +13 -27
- package/dist/cli/commands/sync-docs/index.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/index.js +19 -503
- package/dist/cli/commands/sync-docs/index.js.map +1 -1
- package/dist/cli/commands/sync-docs/main-flow.d.ts +37 -0
- package/dist/cli/commands/sync-docs/main-flow.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/main-flow.js +485 -0
- package/dist/cli/commands/sync-docs/main-flow.js.map +1 -0
- package/dist/cli/commands/sync-docs/project-reader.d.ts +6 -1
- package/dist/cli/commands/sync-docs/project-reader.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/project-reader.js +16 -25
- package/dist/cli/commands/sync-docs/project-reader.js.map +1 -1
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/commands/validate.js +7 -0
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/gate-command.d.ts +1 -1
- package/dist/cli/gate-command.d.ts.map +1 -1
- package/dist/cli/gate-command.js +1 -1
- package/dist/cli/gate-command.js.map +1 -1
- package/dist/completion-checkers/glob-match.d.ts +1 -1
- package/dist/completion-checkers/glob-match.d.ts.map +1 -1
- package/dist/completion-checkers/glob-match.js +3 -38
- package/dist/completion-checkers/glob-match.js.map +1 -1
- package/dist/context/index.d.ts +2 -5
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +2 -9
- package/dist/context/index.js.map +1 -1
- package/dist/context/session-manager.d.ts +2 -8
- package/dist/context/session-manager.d.ts.map +1 -1
- package/dist/context/session-manager.js +31 -61
- package/dist/context/session-manager.js.map +1 -1
- package/dist/context/types.d.ts +2 -26
- package/dist/context/types.d.ts.map +1 -1
- package/dist/core/config-files.d.ts +21 -0
- package/dist/core/config-files.d.ts.map +1 -0
- package/dist/core/config-files.js +75 -0
- package/dist/core/config-files.js.map +1 -0
- package/dist/core/constraint-lifecycle.d.ts +127 -0
- package/dist/core/constraint-lifecycle.d.ts.map +1 -0
- package/dist/core/constraint-lifecycle.js +306 -0
- package/dist/core/constraint-lifecycle.js.map +1 -0
- package/dist/core/constraints/capabilities-parser.d.ts +2 -1
- package/dist/core/constraints/capabilities-parser.d.ts.map +1 -1
- package/dist/core/constraints/capabilities-parser.js +4 -6
- package/dist/core/constraints/capabilities-parser.js.map +1 -1
- package/dist/core/constraints/checker.d.ts +9 -1
- package/dist/core/constraints/checker.d.ts.map +1 -1
- package/dist/core/constraints/checker.js +18 -0
- package/dist/core/constraints/checker.js.map +1 -1
- package/dist/core/constraints/checkers/no-completion-without-verification.d.ts +6 -1
- package/dist/core/constraints/checkers/no-completion-without-verification.d.ts.map +1 -1
- package/dist/core/constraints/checkers/no-completion-without-verification.js +17 -1
- package/dist/core/constraints/checkers/no-completion-without-verification.js.map +1 -1
- package/dist/core/constraints/checkers/no-hardcoded-credentials.d.ts +0 -2
- package/dist/core/constraints/checkers/no-hardcoded-credentials.d.ts.map +1 -1
- package/dist/core/constraints/checkers/no-hardcoded-credentials.js +0 -5
- package/dist/core/constraints/checkers/no-hardcoded-credentials.js.map +1 -1
- package/dist/core/constraints/checkers/templated/exec.d.ts.map +1 -1
- package/dist/core/constraints/checkers/templated/exec.js +1 -0
- package/dist/core/constraints/checkers/templated/exec.js.map +1 -1
- package/dist/core/constraints/checkers/templated/file-exists.js +2 -2
- package/dist/core/constraints/checkers/templated/file-exists.js.map +1 -1
- package/dist/core/constraints/checkers/templated/glob.d.ts +2 -3
- package/dist/core/constraints/checkers/templated/glob.d.ts.map +1 -1
- package/dist/core/constraints/checkers/templated/glob.js +4 -40
- package/dist/core/constraints/checkers/templated/glob.js.map +1 -1
- package/dist/core/constraints/construction-sites.d.ts +56 -0
- package/dist/core/constraints/construction-sites.d.ts.map +1 -0
- package/dist/core/constraints/construction-sites.js +75 -0
- package/dist/core/constraints/construction-sites.js.map +1 -0
- package/dist/core/constraints/context-builder.d.ts.map +1 -1
- package/dist/core/constraints/context-builder.js +13 -34
- package/dist/core/constraints/context-builder.js.map +1 -1
- package/dist/core/constraints/definitions/guidelines.d.ts.map +1 -1
- package/dist/core/constraints/definitions/guidelines.js +18 -0
- package/dist/core/constraints/definitions/guidelines.js.map +1 -1
- package/dist/core/constraints/definitions/iron-laws.d.ts.map +1 -1
- package/dist/core/constraints/definitions/iron-laws.js +0 -16
- package/dist/core/constraints/definitions/iron-laws.js.map +1 -1
- package/dist/core/constraints/doc-freshness/runner.d.ts.map +1 -1
- package/dist/core/constraints/doc-freshness/runner.js +192 -221
- package/dist/core/constraints/doc-freshness/runner.js.map +1 -1
- package/dist/core/constraints/git-evidence.d.ts.map +1 -1
- package/dist/core/constraints/git-evidence.js +2 -0
- package/dist/core/constraints/git-evidence.js.map +1 -1
- package/dist/core/constraints/index.d.ts +0 -2
- package/dist/core/constraints/index.d.ts.map +1 -1
- package/dist/core/constraints/index.js +1 -4
- package/dist/core/constraints/index.js.map +1 -1
- package/dist/core/constraints/injection-writer.d.ts +1 -0
- package/dist/core/constraints/injection-writer.d.ts.map +1 -1
- package/dist/core/constraints/injection-writer.js +3 -6
- package/dist/core/constraints/injection-writer.js.map +1 -1
- package/dist/core/constraints/meta.d.ts +18 -0
- package/dist/core/constraints/meta.d.ts.map +1 -0
- package/dist/core/constraints/meta.js +31 -0
- package/dist/core/constraints/meta.js.map +1 -0
- package/dist/core/constraints/pack-proposal.d.ts +66 -0
- package/dist/core/constraints/pack-proposal.d.ts.map +1 -0
- package/dist/core/constraints/pack-proposal.js +181 -0
- package/dist/core/constraints/pack-proposal.js.map +1 -0
- package/dist/core/constraints/usage-report.d.ts +3 -1
- package/dist/core/constraints/usage-report.d.ts.map +1 -1
- package/dist/core/constraints/usage-report.js +3 -1
- package/dist/core/constraints/usage-report.js.map +1 -1
- package/dist/core/effective-constraints.d.ts +6 -6
- package/dist/core/effective-constraints.d.ts.map +1 -1
- package/dist/core/effective-constraints.js +6 -6
- package/dist/core/effective-constraints.js.map +1 -1
- package/dist/core/index.d.ts +3 -6
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -6
- package/dist/core/index.js.map +1 -1
- package/dist/core/project-config-loader.d.ts +3 -1
- package/dist/core/project-config-loader.d.ts.map +1 -1
- package/dist/core/project-config-loader.js +6 -6
- package/dist/core/project-config-loader.js.map +1 -1
- package/dist/core/spec/validator.d.ts +1 -1
- package/dist/core/spec/validator.d.ts.map +1 -1
- package/dist/core/spec/validator.js +41 -36
- package/dist/core/spec/validator.js.map +1 -1
- package/dist/core/validators/check-handlers/command.d.ts.map +1 -1
- package/dist/core/validators/check-handlers/command.js +49 -8
- package/dist/core/validators/check-handlers/command.js.map +1 -1
- package/dist/core/validators/check-handlers/http.d.ts.map +1 -1
- package/dist/core/validators/check-handlers/http.js +6 -4
- package/dist/core/validators/check-handlers/http.js.map +1 -1
- package/dist/core/validators/check-handlers/output.d.ts +1 -1
- package/dist/core/validators/check-handlers/output.d.ts.map +1 -1
- package/dist/core/validators/check-handlers/output.js +2 -1
- package/dist/core/validators/check-handlers/output.js.map +1 -1
- package/dist/core/validators/passes-gate.d.ts +2 -1
- package/dist/core/validators/passes-gate.d.ts.map +1 -1
- package/dist/core/validators/passes-gate.js +25 -30
- package/dist/core/validators/passes-gate.js.map +1 -1
- package/dist/gates/acceptance.d.ts +37 -18
- package/dist/gates/acceptance.d.ts.map +1 -1
- package/dist/gates/acceptance.js +129 -97
- package/dist/gates/acceptance.js.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 +2 -1
- package/dist/gates/checker-gate.js.map +1 -1
- package/dist/gates/command.d.ts +3 -20
- package/dist/gates/command.d.ts.map +1 -1
- package/dist/gates/command.js +2 -35
- package/dist/gates/command.js.map +1 -1
- package/dist/gates/contract.d.ts +11 -2
- package/dist/gates/contract.d.ts.map +1 -1
- package/dist/gates/contract.js +57 -62
- package/dist/gates/contract.js.map +1 -1
- package/dist/gates/definitions.d.ts +1 -1
- package/dist/gates/definitions.d.ts.map +1 -1
- package/dist/gates/definitions.js +1 -1
- package/dist/gates/definitions.js.map +1 -1
- package/dist/gates/performance.d.ts +1 -1
- package/dist/gates/performance.d.ts.map +1 -1
- package/dist/gates/performance.js +18 -8
- package/dist/gates/performance.js.map +1 -1
- package/dist/gates/registry.d.ts.map +1 -1
- package/dist/gates/registry.js +7 -3
- package/dist/gates/registry.js.map +1 -1
- package/dist/gates/review.d.ts.map +1 -1
- package/dist/gates/review.js +16 -2
- package/dist/gates/review.js.map +1 -1
- package/dist/gates/security.d.ts +5 -1
- package/dist/gates/security.d.ts.map +1 -1
- package/dist/gates/security.js +57 -63
- package/dist/gates/security.js.map +1 -1
- package/dist/gates/types.d.ts +12 -72
- package/dist/gates/types.d.ts.map +1 -1
- package/dist/gates/types.js +5 -1
- package/dist/gates/types.js.map +1 -1
- package/dist/index.d.ts +23 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -65
- package/dist/index.js.map +1 -1
- package/dist/knowledge/audit-dimensions.d.ts +45 -0
- package/dist/knowledge/audit-dimensions.d.ts.map +1 -0
- package/dist/knowledge/audit-dimensions.js +144 -0
- package/dist/knowledge/audit-dimensions.js.map +1 -0
- package/dist/knowledge/audit-rules.d.ts +41 -0
- package/dist/knowledge/audit-rules.d.ts.map +1 -0
- package/dist/knowledge/audit-rules.js +269 -0
- package/dist/knowledge/audit-rules.js.map +1 -0
- package/dist/knowledge/audit-scoring.d.ts +6 -60
- package/dist/knowledge/audit-scoring.d.ts.map +1 -1
- package/dist/knowledge/audit-scoring.js +8 -391
- package/dist/knowledge/audit-scoring.js.map +1 -1
- package/dist/knowledge/audit.d.ts +6 -3
- package/dist/knowledge/audit.d.ts.map +1 -1
- package/dist/knowledge/audit.js +9 -6
- package/dist/knowledge/audit.js.map +1 -1
- package/dist/knowledge/import.d.ts.map +1 -1
- package/dist/knowledge/import.js +5 -4
- package/dist/knowledge/import.js.map +1 -1
- package/dist/knowledge/index-generator.d.ts +2 -0
- package/dist/knowledge/index-generator.d.ts.map +1 -1
- package/dist/knowledge/index-generator.js +43 -50
- package/dist/knowledge/index-generator.js.map +1 -1
- package/dist/knowledge/index.d.ts +5 -5
- package/dist/knowledge/index.d.ts.map +1 -1
- package/dist/knowledge/index.js +4 -5
- package/dist/knowledge/index.js.map +1 -1
- package/dist/knowledge/ingest.d.ts +21 -5
- package/dist/knowledge/ingest.d.ts.map +1 -1
- package/dist/knowledge/ingest.js +12 -9
- package/dist/knowledge/ingest.js.map +1 -1
- package/dist/knowledge/lifecycle.d.ts.map +1 -1
- package/dist/knowledge/lifecycle.js +17 -22
- package/dist/knowledge/lifecycle.js.map +1 -1
- package/dist/knowledge/query.d.ts +2 -2
- package/dist/knowledge/query.d.ts.map +1 -1
- package/dist/knowledge/query.js +19 -22
- package/dist/knowledge/query.js.map +1 -1
- package/dist/knowledge/reference-tracker.d.ts.map +1 -1
- package/dist/knowledge/reference-tracker.js +14 -17
- package/dist/knowledge/reference-tracker.js.map +1 -1
- package/dist/knowledge/store.d.ts.map +1 -1
- package/dist/knowledge/store.js +17 -36
- package/dist/knowledge/store.js.map +1 -1
- package/dist/knowledge/token-estimate.d.ts +14 -0
- package/dist/knowledge/token-estimate.d.ts.map +1 -0
- package/dist/knowledge/token-estimate.js +31 -0
- package/dist/knowledge/token-estimate.js.map +1 -0
- package/dist/monitoring/analyzer-base.d.ts +0 -8
- package/dist/monitoring/analyzer-base.d.ts.map +1 -1
- package/dist/monitoring/analyzer-base.js +0 -20
- package/dist/monitoring/analyzer-base.js.map +1 -1
- package/dist/monitoring/index.d.ts +2 -7
- package/dist/monitoring/index.d.ts.map +1 -1
- package/dist/monitoring/index.js +2 -9
- package/dist/monitoring/index.js.map +1 -1
- package/dist/monitoring/trace-analyzer.d.ts +2 -6
- package/dist/monitoring/trace-analyzer.d.ts.map +1 -1
- package/dist/monitoring/trace-analyzer.js +9 -16
- package/dist/monitoring/trace-analyzer.js.map +1 -1
- package/dist/monitoring/traces.d.ts +14 -10
- package/dist/monitoring/traces.d.ts.map +1 -1
- package/dist/monitoring/traces.js +47 -49
- package/dist/monitoring/traces.js.map +1 -1
- package/dist/pretool-use-hook.d.ts +1 -1
- package/dist/pretool-use-hook.d.ts.map +1 -1
- package/dist/pretool-use-hook.js +14 -21
- package/dist/pretool-use-hook.js.map +1 -1
- package/dist/release/integrity.d.ts.map +1 -1
- package/dist/release/integrity.js +8 -10
- package/dist/release/integrity.js.map +1 -1
- package/dist/sdd/index-generator.d.ts.map +1 -1
- package/dist/sdd/index-generator.js +4 -0
- package/dist/sdd/index-generator.js.map +1 -1
- package/dist/test-setup/jsonl-fake-fs.d.ts +1 -1
- package/dist/test-setup/jsonl-fake-fs.js +1 -1
- package/dist/types/checkpoint.d.ts +8 -8
- package/dist/types/checkpoint.d.ts.map +1 -1
- package/dist/types/command-io.d.ts +19 -0
- package/dist/types/command-io.d.ts.map +1 -0
- package/dist/types/command-io.js +3 -0
- package/dist/types/command-io.js.map +1 -0
- package/dist/types/gate.d.ts +72 -0
- package/dist/types/gate.d.ts.map +1 -0
- package/dist/types/gate.js +13 -0
- package/dist/types/gate.js.map +1 -0
- package/dist/utils/attempt.d.ts +22 -0
- package/dist/utils/attempt.d.ts.map +1 -0
- package/dist/utils/attempt.js +40 -0
- package/dist/utils/attempt.js.map +1 -0
- package/dist/utils/detect-source-roots.d.ts.map +1 -1
- package/dist/utils/detect-source-roots.js +42 -51
- package/dist/utils/detect-source-roots.js.map +1 -1
- package/dist/utils/file-walk.d.ts +2 -1
- package/dist/utils/file-walk.d.ts.map +1 -1
- package/dist/utils/file-walk.js +3 -8
- package/dist/utils/file-walk.js.map +1 -1
- package/dist/utils/glob-match.d.ts +10 -0
- package/dist/utils/glob-match.d.ts.map +1 -0
- package/dist/utils/glob-match.js +47 -0
- package/dist/utils/glob-match.js.map +1 -0
- package/dist/utils/jsonl.d.ts +1 -1
- package/dist/utils/jsonl.js +1 -1
- package/dist/utils/package-json.d.ts +49 -0
- package/dist/utils/package-json.d.ts.map +1 -0
- package/dist/utils/package-json.js +78 -0
- package/dist/utils/package-json.js.map +1 -0
- package/dist/utils/package-version.d.ts +5 -2
- package/dist/utils/package-version.d.ts.map +1 -1
- package/dist/utils/package-version.js +8 -11
- package/dist/utils/package-version.js.map +1 -1
- package/dist/utils/yaml-edit.d.ts +26 -0
- package/dist/utils/yaml-edit.d.ts.map +1 -0
- package/dist/utils/yaml-edit.js +98 -0
- package/dist/utils/yaml-edit.js.map +1 -0
- package/package.json +2 -7
- package/src/CONTEXT.md +14 -6
- package/src/__tests__/acceptance-gate.test.ts +25 -55
- package/src/__tests__/contract-gate.test.ts +1 -1
- package/src/__tests__/effective-constraints.test.ts +16 -0
- package/src/__tests__/install-precommit-hook.test.ts +61 -0
- package/src/__tests__/iron-laws.test.ts +5 -5
- package/src/__tests__/layering.test.ts +3 -4
- package/src/__tests__/no-studio-references.test.ts +13 -5
- package/src/__tests__/pretool-use-hook.test.ts +3 -3
- package/src/__tests__/public-exports.test.ts +196 -42
- package/src/__tests__/public-type-surface.test.ts +22 -72
- package/src/__tests__/public-value-surface.test.ts +7 -38
- package/src/__tests__/skip-semantics.test.ts +5 -4
- package/src/__tests__/trace-analyzer-extra.test.ts +1 -13
- package/src/agents/CONTEXT.md +4 -4
- package/src/agents/lifecycle.ts +3 -5
- package/src/cli/__tests__/command-contract.test.ts +18 -0
- package/src/cli/__tests__/gate-command.test.ts +1 -1
- package/src/cli/command-contract.ts +12 -9
- package/src/cli/commands/CONTEXT.md +13 -13
- package/src/cli/commands/__tests__/check.test.ts +1 -1
- package/src/cli/commands/__tests__/command.test.ts +2 -2
- package/src/cli/commands/__tests__/constraints-retire.test.ts +5 -3
- package/src/cli/commands/__tests__/init-governance-io.test.ts +7 -2
- package/src/cli/commands/__tests__/init.test.ts +1 -1
- package/src/cli/commands/__tests__/knowledge-audit-threshold.test.ts +14 -8
- package/src/cli/commands/__tests__/knowledge-flywheel-consistency.test.ts +2 -1
- package/src/cli/commands/__tests__/knowledge-view.test.ts +29 -19
- package/src/cli/commands/__tests__/knowledge.test.ts +6 -2
- package/src/cli/commands/__tests__/numeric-flag-assembly.test.ts +1 -1
- package/src/cli/commands/__tests__/passes-gate.test.ts +100 -24
- package/src/cli/commands/__tests__/project-path-anchoring.test.ts +3 -6
- package/src/cli/commands/__tests__/project-path-convention.test.ts +3 -35
- package/src/cli/commands/__tests__/registry.test.ts +3 -2
- package/src/cli/commands/__tests__/release.test.ts +24 -2
- package/src/cli/commands/__tests__/report-false-green.test.ts +10 -6
- package/src/cli/commands/__tests__/sync-docs-construction-sites.test.ts +175 -0
- package/src/cli/commands/__tests__/validate.test.ts +49 -0
- package/src/cli/commands/acceptance.ts +10 -9
- package/src/cli/commands/command.ts +2 -1
- package/src/cli/commands/constraints-disable.ts +8 -59
- package/src/cli/commands/constraints-pack-proposal.ts +26 -121
- package/src/cli/commands/constraints-reactivate.ts +22 -113
- package/src/cli/commands/constraints-retire.ts +32 -271
- package/src/cli/commands/constraints.ts +6 -30
- package/src/cli/commands/contract.ts +29 -14
- package/src/cli/commands/definitions.ts +13 -12
- package/src/cli/commands/init/ci-platform.ts +66 -0
- package/src/cli/commands/init/ci-wiring.ts +48 -0
- package/src/cli/commands/init/git-hooks.ts +31 -0
- package/src/cli/commands/init/governance.ts +127 -0
- package/src/cli/commands/init/index.ts +156 -0
- package/src/cli/commands/init/output-style.ts +82 -0
- package/src/cli/commands/init/presets.ts +105 -0
- package/src/cli/commands/init/snippets.ts +57 -0
- package/src/cli/commands/knowledge/audit.ts +155 -0
- package/src/cli/commands/knowledge/decay.ts +57 -0
- package/src/cli/commands/knowledge/health.ts +176 -0
- package/src/cli/commands/knowledge/import.ts +82 -0
- package/src/cli/commands/knowledge/index.ts +60 -0
- package/src/cli/commands/knowledge/list.ts +73 -0
- package/src/cli/commands/knowledge/migrate.ts +61 -0
- package/src/cli/commands/knowledge/search.ts +93 -0
- package/src/cli/commands/knowledge/shared.ts +13 -0
- package/src/cli/commands/knowledge/snapshot.ts +38 -0
- package/src/cli/commands/knowledge/stats.ts +112 -0
- package/src/cli/commands/knowledge/sync-rag.ts +48 -0
- package/src/cli/commands/knowledge-view.ts +3 -2
- package/src/cli/commands/passes-gate.ts +14 -2
- package/src/cli/commands/performance.ts +2 -2
- package/src/cli/commands/release.ts +16 -11
- package/src/cli/commands/review.ts +5 -4
- package/src/cli/commands/scaffold-templates.ts +23 -0
- package/src/cli/commands/security.ts +11 -12
- package/src/cli/commands/spec-baseline-check.ts +6 -7
- package/src/cli/commands/status.ts +2 -2
- package/src/cli/commands/sync-docs/__tests__/construction-site-count.test.ts +49 -0
- package/src/cli/commands/sync-docs/agents-syncer.ts +28 -47
- package/src/cli/commands/sync-docs/capabilities-syncer.ts +18 -11
- package/src/cli/commands/sync-docs/compact.ts +35 -0
- package/src/cli/commands/sync-docs/context-syncer.ts +52 -26
- package/src/cli/commands/sync-docs/gate.ts +78 -0
- package/src/cli/commands/sync-docs/index.ts +21 -549
- package/src/cli/commands/sync-docs/main-flow.ts +549 -0
- package/src/cli/commands/sync-docs/project-reader.ts +26 -24
- package/src/cli/commands/validate.ts +7 -0
- package/src/cli/gate-command.ts +2 -2
- package/src/completion-checkers/CONTEXT.md +3 -3
- package/src/completion-checkers/glob-match.ts +3 -35
- package/src/context/CONTEXT.md +7 -10
- package/src/context/__tests__/session-manager.test.ts +18 -7
- package/src/context/index.ts +1 -9
- package/src/context/session-manager.ts +34 -60
- package/src/context/types.ts +2 -22
- package/src/core/CONTEXT.md +10 -5
- package/src/core/__tests__/config-files.test.ts +88 -0
- package/src/core/__tests__/constraint-lifecycle.test.ts +255 -0
- package/src/core/__tests__/constraints-meta.test.ts +26 -0
- package/src/core/__tests__/pack-proposal.test.ts +95 -0
- package/src/core/config-files.ts +39 -0
- package/src/core/constraint-lifecycle.ts +435 -0
- package/src/core/constraints/__tests__/check-cache.test.ts +0 -7
- package/src/core/constraints/__tests__/collect-constraints.test.ts +25 -0
- package/src/core/constraints/__tests__/construction-sites.test.ts +147 -0
- package/src/core/constraints/__tests__/context-reconcile.test.ts +16 -16
- package/src/core/constraints/__tests__/trace-injection.test.ts +14 -15
- package/src/core/constraints/__tests__/usage-report.test.ts +9 -0
- package/src/core/constraints/capabilities-parser.ts +4 -6
- package/src/core/constraints/checker.ts +20 -1
- package/src/core/constraints/checkers/__tests__/no-completion-without-verification.test.ts +22 -3
- package/src/core/constraints/checkers/__tests__/no-hardcoded-credentials.test.ts +56 -41
- package/src/core/constraints/checkers/no-completion-without-verification.ts +16 -1
- package/src/core/constraints/checkers/no-hardcoded-credentials.ts +0 -5
- package/src/core/constraints/checkers/templated/exec.ts +1 -0
- package/src/core/constraints/checkers/templated/file-exists.ts +2 -2
- package/src/core/constraints/checkers/templated/glob.ts +3 -36
- package/src/core/constraints/construction-sites.ts +95 -0
- package/src/core/constraints/context-builder.ts +11 -28
- package/src/core/constraints/definitions/guidelines.ts +19 -0
- package/src/core/constraints/definitions/iron-laws.ts +0 -17
- package/src/core/constraints/doc-freshness/runner.ts +221 -242
- package/src/core/constraints/git-evidence.ts +2 -0
- package/src/core/constraints/index.ts +0 -4
- package/src/core/constraints/injection-writer.ts +3 -6
- package/src/core/constraints/meta.ts +40 -0
- package/src/core/constraints/pack-proposal.ts +179 -0
- package/src/core/constraints/usage-report.ts +3 -1
- package/src/core/effective-constraints.ts +6 -6
- package/src/core/index.ts +0 -15
- package/src/core/project-config-loader.ts +6 -5
- package/src/core/spec/__tests__/validator.test.ts +65 -13
- package/src/core/spec/validator.ts +50 -40
- package/src/core/validators/__tests__/command-success-output.test.ts +56 -0
- package/src/core/validators/__tests__/passes-gate-counts.test.ts +52 -0
- package/src/core/validators/check-handlers/command.ts +53 -10
- package/src/core/validators/check-handlers/http.ts +8 -6
- package/src/core/validators/check-handlers/output.ts +7 -6
- package/src/core/validators/passes-gate.ts +31 -32
- package/src/gates/CONTEXT.md +22 -14
- package/src/gates/__tests__/acceptance-types-single-source.test.ts +22 -19
- package/src/gates/__tests__/acceptance.test.ts +72 -99
- package/src/gates/__tests__/command-single-predicate.test.ts +1 -1
- package/src/gates/__tests__/command.test.ts +24 -25
- package/src/gates/__tests__/decision.test.ts +35 -0
- package/src/gates/__tests__/gate-interface.test.ts +2 -5
- package/src/gates/__tests__/performance.test.ts +3 -3
- package/src/gates/__tests__/security.test.ts +7 -19
- package/src/gates/acceptance.ts +176 -131
- package/src/gates/checker-gate.ts +2 -1
- package/src/gates/command.ts +4 -38
- package/src/gates/contract.ts +86 -79
- package/src/gates/definitions.ts +2 -2
- package/src/gates/performance.ts +35 -19
- package/src/gates/registry.ts +7 -4
- package/src/gates/review.ts +38 -10
- package/src/gates/security.ts +94 -81
- package/src/gates/types.ts +23 -77
- package/src/hooks/CONTEXT.md +1 -1
- package/src/index.ts +57 -98
- package/src/knowledge/CONTEXT.md +14 -10
- package/src/knowledge/__tests__/audit-labels.test.ts +3 -3
- package/src/knowledge/__tests__/audit-scoring.test.ts +9 -7
- package/src/knowledge/__tests__/ingest.test.ts +17 -17
- package/src/knowledge/__tests__/store.test.ts +4 -6
- package/src/knowledge/__tests__/token-estimate.test.ts +54 -0
- package/src/knowledge/audit-dimensions.ts +190 -0
- package/src/knowledge/audit-rules.ts +335 -0
- package/src/knowledge/audit-scoring.ts +7 -495
- package/src/knowledge/audit.ts +9 -11
- package/src/knowledge/import.ts +7 -6
- package/src/knowledge/index-generator.ts +48 -53
- package/src/knowledge/index.ts +5 -5
- package/src/knowledge/ingest.ts +27 -12
- package/src/knowledge/lifecycle.ts +17 -19
- package/src/knowledge/query.ts +20 -20
- package/src/knowledge/reference-tracker.ts +14 -16
- package/src/knowledge/store.ts +17 -32
- package/src/knowledge/token-estimate.ts +27 -0
- package/src/monitoring/CONTEXT.md +6 -8
- package/src/monitoring/__tests__/prune-trace-logs.test.ts +76 -0
- package/src/monitoring/__tests__/traces.test.ts +1 -17
- package/src/monitoring/analyzer-base.ts +0 -18
- package/src/monitoring/index.ts +2 -7
- package/src/monitoring/trace-analyzer.ts +12 -17
- package/src/monitoring/traces.ts +59 -57
- package/src/pretool-use-hook.ts +28 -23
- package/src/release/CONTEXT.md +2 -2
- package/src/release/__tests__/integrity.test.ts +3 -7
- package/src/release/integrity.ts +8 -11
- package/src/sdd/index-generator.ts +4 -0
- package/src/test-setup/jsonl-fake-fs.ts +1 -1
- package/src/types/checkpoint.ts +8 -8
- package/src/types/command-io.ts +14 -0
- package/src/types/gate.ts +77 -0
- package/src/utils/__tests__/attempt.test.ts +94 -0
- package/src/utils/__tests__/glob-match.test.ts +52 -0
- package/src/utils/__tests__/jsonl-skip-disposition.test.ts +0 -1
- package/src/utils/__tests__/package-json.test.ts +58 -0
- package/src/utils/__tests__/package-version.test.ts +21 -2
- package/src/utils/__tests__/yaml-edit.test.ts +62 -0
- package/src/utils/attempt.ts +35 -0
- package/src/utils/detect-source-roots.ts +38 -44
- package/src/utils/file-walk.ts +3 -7
- package/src/utils/glob-match.ts +41 -0
- package/src/utils/jsonl.ts +1 -1
- package/src/utils/package-json.ts +61 -0
- package/src/utils/package-version.ts +8 -10
- package/src/utils/yaml-edit.ts +67 -0
- package/dist/cli/commands/init.d.ts.map +0 -1
- package/dist/cli/commands/init.js +0 -517
- package/dist/cli/commands/init.js.map +0 -1
- package/dist/cli/commands/knowledge.d.ts +0 -169
- package/dist/cli/commands/knowledge.d.ts.map +0 -1
- package/dist/cli/commands/knowledge.js +0 -700
- package/dist/cli/commands/knowledge.js.map +0 -1
- package/dist/context/knowledge-injector.d.ts +0 -51
- package/dist/context/knowledge-injector.d.ts.map +0 -1
- package/dist/context/knowledge-injector.js +0 -129
- package/dist/context/knowledge-injector.js.map +0 -1
- package/dist/context/token-budget.d.ts +0 -115
- package/dist/context/token-budget.d.ts.map +0 -1
- package/dist/context/token-budget.js +0 -200
- package/dist/context/token-budget.js.map +0 -1
- package/dist/gates/index.d.ts +0 -44
- package/dist/gates/index.d.ts.map +0 -1
- package/dist/gates/index.js +0 -85
- package/dist/gates/index.js.map +0 -1
- package/dist/gates/runner.d.ts +0 -30
- package/dist/gates/runner.d.ts.map +0 -1
- package/dist/gates/runner.js +0 -38
- package/dist/gates/runner.js.map +0 -1
- package/dist/knowledge/primitives/code-structure.d.ts +0 -37
- package/dist/knowledge/primitives/code-structure.d.ts.map +0 -1
- package/dist/knowledge/primitives/code-structure.js +0 -185
- package/dist/knowledge/primitives/code-structure.js.map +0 -1
- package/dist/monitoring/context-tracker.d.ts +0 -38
- package/dist/monitoring/context-tracker.d.ts.map +0 -1
- package/dist/monitoring/context-tracker.js +0 -153
- package/dist/monitoring/context-tracker.js.map +0 -1
- package/dist/tools/definitions/core/code/fingerprint.sh +0 -273
- package/dist/tools/definitions/core/code/fingerprint.yml +0 -72
- package/dist/tools/definitions/core/code/parse.yml +0 -68
- package/dist/tools/definitions/core/code/register-language.sh +0 -475
- package/dist/tools/definitions/core/code/register-language.yml +0 -74
- package/dist/tools/definitions/core/docker/build.yml +0 -73
- package/dist/tools/definitions/core/docker/run.yml +0 -81
- package/dist/tools/definitions/core/file/copy.yml +0 -88
- package/dist/tools/definitions/core/file/read.yml +0 -69
- package/dist/tools/definitions/core/file/write.yml +0 -75
- package/dist/tools/definitions/core/git/branch.yml +0 -61
- package/dist/tools/definitions/core/git/cleanup-worktree.yml +0 -50
- package/dist/tools/definitions/core/git/clone.yml +0 -69
- package/dist/tools/definitions/core/git/commit.yml +0 -65
- package/dist/tools/definitions/core/git/push.yml +0 -79
- package/dist/tools/definitions/core/git/worktree.yml +0 -96
- package/dist/tools/definitions/core/notification/notify.sh +0 -152
- package/dist/tools/definitions/core/notification/notify.yml +0 -59
- package/dist/tools/definitions/core/npm/build.yml +0 -75
- package/dist/tools/definitions/core/npm/install.yml +0 -58
- package/dist/tools/definitions/core/npm/test.yml +0 -75
- package/dist/tools/definitions/core/validation/check-reuse.yml +0 -170
- package/dist/tools/definitions/core/validation/validate-handlers.yml +0 -118
- package/dist/tools/definitions/core/validation/validate-readme-stats.yml +0 -155
- package/dist/tools/definitions/core/validation/validate-yaml-syntax.yml +0 -134
- package/dist/tools/definitions/ext/browser/browser-automate.sh +0 -255
- package/dist/tools/definitions/ext/browser/browser-automate.yml +0 -166
- package/dist/tools/definitions/ext/browser/browser-close.sh +0 -104
- package/dist/tools/definitions/ext/browser/browser-close.yml +0 -54
- package/dist/tools/definitions/ext/browser/browser-mcp-debug.sh +0 -682
- package/dist/tools/definitions/ext/browser/browser-mcp-debug.yml +0 -167
- package/dist/tools/definitions/ext/browser/browser-start.sh +0 -101
- package/dist/tools/definitions/ext/browser/browser-start.yml +0 -61
- package/dist/tools/definitions/registry.json +0 -795
- package/dist/tools/definitions/std/README.md +0 -350
- package/dist/tools/definitions/std/analysis/analyze-codebase.yml +0 -72
- package/dist/tools/definitions/std/analysis/analyze-diff.yml +0 -182
- package/dist/tools/definitions/std/analysis/analyze-git-diff.yml +0 -70
- package/dist/tools/definitions/std/analysis/analyze-impact.yml +0 -78
- package/dist/tools/definitions/std/analysis/analyze-requirements.yml +0 -105
- package/dist/tools/definitions/std/analysis/brainstorm-options.yml +0 -106
- package/dist/tools/definitions/std/analysis/build-graph.yml +0 -154
- package/dist/tools/definitions/std/analysis/clarify-requirements.yml +0 -90
- package/dist/tools/definitions/std/analysis/detect-context.yml +0 -109
- package/dist/tools/definitions/std/analysis/detect-layers.yml +0 -125
- package/dist/tools/definitions/std/analysis/generate-tour.yml +0 -102
- package/dist/tools/definitions/std/analysis/search-enhance.yml +0 -105
- package/dist/tools/definitions/std/backlog/add.yml +0 -51
- package/dist/tools/definitions/std/backlog/decide.yml +0 -39
- package/dist/tools/definitions/std/backlog/github-sync.yml +0 -161
- package/dist/tools/definitions/std/backlog/list.yml +0 -53
- package/dist/tools/definitions/std/backlog/load.yml +0 -46
- package/dist/tools/definitions/std/backlog/resolve.yml +0 -37
- package/dist/tools/definitions/std/backlog/update.yml +0 -42
- package/dist/tools/definitions/std/bugfix/diagnose.yml +0 -68
- package/dist/tools/definitions/std/bugfix/fix.yml +0 -66
- package/dist/tools/definitions/std/bugfix/verify.yml +0 -69
- package/dist/tools/definitions/std/constraint/check-decomposition.yml +0 -103
- package/dist/tools/definitions/std/constraint/check-feature-list.yml +0 -77
- package/dist/tools/definitions/std/constraint/check-progress.yml +0 -97
- package/dist/tools/definitions/std/constraint/generate-report.yml +0 -147
- package/dist/tools/definitions/std/deploy/commit-push.yml +0 -33
- package/dist/tools/definitions/std/deploy/deploy-backend.yml +0 -37
- package/dist/tools/definitions/std/deploy/deploy-frontend.yml +0 -37
- package/dist/tools/definitions/std/deploy/rollback.yml +0 -148
- package/dist/tools/definitions/std/design/analyze-architecture-impact.yml +0 -113
- package/dist/tools/definitions/std/design/design-api.yml +0 -55
- package/dist/tools/definitions/std/design/design-architecture.yml +0 -97
- package/dist/tools/definitions/std/design/design-db.yml +0 -81
- package/dist/tools/definitions/std/design/generate-spec.yml +0 -182
- package/dist/tools/definitions/std/development/develop-api.yml +0 -85
- package/dist/tools/definitions/std/development/develop-backend.yml +0 -88
- package/dist/tools/definitions/std/development/develop-frontend.yml +0 -87
- package/dist/tools/definitions/std/development/develop-shared-types.yml +0 -74
- package/dist/tools/definitions/std/development/develop-task.yml +0 -122
- package/dist/tools/definitions/std/development/develop-tests.yml +0 -76
- package/dist/tools/definitions/std/development/execute-batch.yml +0 -152
- package/dist/tools/definitions/std/development/fix-issues.yml +0 -100
- package/dist/tools/definitions/std/development/implement-task.yml +0 -124
- package/dist/tools/definitions/std/development/review-fix-cycle.yml +0 -232
- package/dist/tools/definitions/std/evolution/implement.yml +0 -124
- package/dist/tools/definitions/std/evolution/prioritize.yml +0 -111
- package/dist/tools/definitions/std/evolution/report-gap.yml +0 -165
- package/dist/tools/definitions/std/file/read.yml +0 -21
- package/dist/tools/definitions/std/governance/aggregate-opinions.sh +0 -201
- package/dist/tools/definitions/std/governance/aggregate-opinions.yml +0 -78
- package/dist/tools/definitions/std/governance/audit-task.yml +0 -177
- package/dist/tools/definitions/std/governance/cast-vote.yml +0 -128
- package/dist/tools/definitions/std/governance/collect-issues.yml +0 -16
- package/dist/tools/definitions/std/governance/create-signed-document.yml +0 -23
- package/dist/tools/definitions/std/governance/create-voting-session.yml +0 -100
- package/dist/tools/definitions/std/governance/define-stance.sh +0 -243
- package/dist/tools/definitions/std/governance/define-stance.yml +0 -81
- package/dist/tools/definitions/std/governance/generate-review-report.yml +0 -23
- package/dist/tools/definitions/std/governance/impeach.yml +0 -178
- package/dist/tools/definitions/std/governance/multi-stance-review.yml +0 -153
- package/dist/tools/definitions/std/governance/prepare-artifact.yml +0 -20
- package/dist/tools/definitions/std/governance/review-spec-approval.yml +0 -262
- package/dist/tools/definitions/std/governance/rollback.yml +0 -185
- package/dist/tools/definitions/std/governance/stance-review.yml +0 -148
- package/dist/tools/definitions/std/governance/track-effect.yml +0 -198
- package/dist/tools/definitions/std/governance/vote-tally.yml +0 -143
- package/dist/tools/definitions/std/patch/execute.yml +0 -51
- package/dist/tools/definitions/std/planning/generate-tasks.yml +0 -36
- package/dist/tools/definitions/std/planning/load-tasks.yml +0 -44
- package/dist/tools/definitions/std/planning/split-batch.yml +0 -480
- package/dist/tools/definitions/std/planning/split-tasks.yml +0 -358
- package/dist/tools/definitions/std/planning/update-tasks.yml +0 -51
- package/dist/tools/definitions/std/planning/validate-tasks.yml +0 -46
- package/dist/tools/definitions/std/project/decide-next-workflow.yml +0 -38
- package/dist/tools/definitions/std/project/load-state.yml +0 -31
- package/dist/tools/definitions/std/project/save-state.yml +0 -32
- package/dist/tools/definitions/std/quality/check-quality.yml +0 -241
- package/dist/tools/definitions/std/quality/debug-systematic.yml +0 -163
- package/dist/tools/definitions/std/quality/handle-feedback.yml +0 -108
- package/dist/tools/definitions/std/quality/review-code.yml +0 -128
- package/dist/tools/definitions/std/quality/review-spec.yml +0 -140
- package/dist/tools/definitions/std/quality/review-task.yml +0 -190
- package/dist/tools/definitions/std/quality/run-tests.yml +0 -80
- package/dist/tools/definitions/std/quick/analyze.yml +0 -56
- package/dist/tools/definitions/std/quick/implement.yml +0 -67
- package/dist/tools/definitions/std/quick/verify.yml +0 -71
- package/dist/tools/definitions/std/verification/verify_completion.yml +0 -113
- package/dist/tools/definitions/std/verification/wait-condition.yml +0 -107
- package/dist/tools/index.d.ts +0 -5
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -10
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/paths.d.ts +0 -9
- package/dist/tools/paths.d.ts.map +0 -1
- package/dist/tools/paths.js.map +0 -1
- package/src/__tests__/token-budget.test.ts +0 -252
- package/src/cli/commands/init.ts +0 -604
- package/src/cli/commands/knowledge.ts +0 -820
- package/src/context/__tests__/knowledge-injector.test.ts +0 -178
- package/src/context/__tests__/token-budget.test.ts +0 -258
- package/src/context/knowledge-injector.ts +0 -175
- package/src/context/token-budget.ts +0 -222
- package/src/gates/__tests__/runner.test.ts +0 -81
- package/src/gates/index.ts +0 -98
- package/src/gates/runner.ts +0 -57
- package/src/knowledge/primitives/__tests__/code-structure-degrade.test.ts +0 -24
- package/src/knowledge/primitives/__tests__/code-structure.test.ts +0 -120
- package/src/knowledge/primitives/code-structure.ts +0 -185
- package/src/monitoring/__tests__/context-tracker.test.ts +0 -180
- package/src/monitoring/context-tracker.ts +0 -136
- package/src/tools/CONTEXT.md +0 -24
- package/src/tools/__tests__/registry.test.ts +0 -221
- package/src/tools/definitions/core/code/fingerprint.sh +0 -273
- package/src/tools/definitions/core/code/fingerprint.yml +0 -72
- package/src/tools/definitions/core/code/parse.yml +0 -68
- package/src/tools/definitions/core/code/register-language.sh +0 -475
- package/src/tools/definitions/core/code/register-language.yml +0 -74
- package/src/tools/definitions/core/docker/build.yml +0 -73
- package/src/tools/definitions/core/docker/run.yml +0 -81
- package/src/tools/definitions/core/file/copy.yml +0 -88
- package/src/tools/definitions/core/file/read.yml +0 -69
- package/src/tools/definitions/core/file/write.yml +0 -75
- package/src/tools/definitions/core/git/branch.yml +0 -61
- package/src/tools/definitions/core/git/cleanup-worktree.yml +0 -50
- package/src/tools/definitions/core/git/clone.yml +0 -69
- package/src/tools/definitions/core/git/commit.yml +0 -65
- package/src/tools/definitions/core/git/push.yml +0 -79
- package/src/tools/definitions/core/git/worktree.yml +0 -96
- package/src/tools/definitions/core/notification/notify.sh +0 -152
- package/src/tools/definitions/core/notification/notify.yml +0 -59
- package/src/tools/definitions/core/npm/build.yml +0 -75
- package/src/tools/definitions/core/npm/install.yml +0 -58
- package/src/tools/definitions/core/npm/test.yml +0 -75
- package/src/tools/definitions/core/validation/check-reuse.yml +0 -170
- package/src/tools/definitions/core/validation/validate-handlers.yml +0 -118
- package/src/tools/definitions/core/validation/validate-readme-stats.yml +0 -155
- package/src/tools/definitions/core/validation/validate-yaml-syntax.yml +0 -134
- package/src/tools/definitions/ext/browser/browser-automate.sh +0 -255
- package/src/tools/definitions/ext/browser/browser-automate.yml +0 -166
- package/src/tools/definitions/ext/browser/browser-close.sh +0 -104
- package/src/tools/definitions/ext/browser/browser-close.yml +0 -54
- package/src/tools/definitions/ext/browser/browser-mcp-debug.sh +0 -682
- package/src/tools/definitions/ext/browser/browser-mcp-debug.yml +0 -167
- package/src/tools/definitions/ext/browser/browser-start.sh +0 -101
- package/src/tools/definitions/ext/browser/browser-start.yml +0 -61
- package/src/tools/definitions/registry.json +0 -795
- package/src/tools/definitions/std/README.md +0 -350
- package/src/tools/definitions/std/analysis/analyze-codebase.yml +0 -72
- package/src/tools/definitions/std/analysis/analyze-diff.yml +0 -182
- package/src/tools/definitions/std/analysis/analyze-git-diff.yml +0 -70
- package/src/tools/definitions/std/analysis/analyze-impact.yml +0 -78
- package/src/tools/definitions/std/analysis/analyze-requirements.yml +0 -105
- package/src/tools/definitions/std/analysis/brainstorm-options.yml +0 -106
- package/src/tools/definitions/std/analysis/build-graph.yml +0 -154
- package/src/tools/definitions/std/analysis/clarify-requirements.yml +0 -90
- package/src/tools/definitions/std/analysis/detect-context.yml +0 -109
- package/src/tools/definitions/std/analysis/detect-layers.yml +0 -125
- package/src/tools/definitions/std/analysis/generate-tour.yml +0 -102
- package/src/tools/definitions/std/analysis/search-enhance.yml +0 -105
- package/src/tools/definitions/std/backlog/add.yml +0 -51
- package/src/tools/definitions/std/backlog/decide.yml +0 -39
- package/src/tools/definitions/std/backlog/github-sync.yml +0 -161
- package/src/tools/definitions/std/backlog/list.yml +0 -53
- package/src/tools/definitions/std/backlog/load.yml +0 -46
- package/src/tools/definitions/std/backlog/resolve.yml +0 -37
- package/src/tools/definitions/std/backlog/update.yml +0 -42
- package/src/tools/definitions/std/bugfix/diagnose.yml +0 -68
- package/src/tools/definitions/std/bugfix/fix.yml +0 -66
- package/src/tools/definitions/std/bugfix/verify.yml +0 -69
- package/src/tools/definitions/std/constraint/check-decomposition.yml +0 -103
- package/src/tools/definitions/std/constraint/check-feature-list.yml +0 -77
- package/src/tools/definitions/std/constraint/check-progress.yml +0 -97
- package/src/tools/definitions/std/constraint/generate-report.yml +0 -147
- package/src/tools/definitions/std/deploy/commit-push.yml +0 -33
- package/src/tools/definitions/std/deploy/deploy-backend.yml +0 -37
- package/src/tools/definitions/std/deploy/deploy-frontend.yml +0 -37
- package/src/tools/definitions/std/deploy/rollback.yml +0 -148
- package/src/tools/definitions/std/design/analyze-architecture-impact.yml +0 -113
- package/src/tools/definitions/std/design/design-api.yml +0 -55
- package/src/tools/definitions/std/design/design-architecture.yml +0 -97
- package/src/tools/definitions/std/design/design-db.yml +0 -81
- package/src/tools/definitions/std/design/generate-spec.yml +0 -182
- package/src/tools/definitions/std/development/develop-api.yml +0 -85
- package/src/tools/definitions/std/development/develop-backend.yml +0 -88
- package/src/tools/definitions/std/development/develop-frontend.yml +0 -87
- package/src/tools/definitions/std/development/develop-shared-types.yml +0 -74
- package/src/tools/definitions/std/development/develop-task.yml +0 -122
- package/src/tools/definitions/std/development/develop-tests.yml +0 -76
- package/src/tools/definitions/std/development/execute-batch.yml +0 -152
- package/src/tools/definitions/std/development/fix-issues.yml +0 -100
- package/src/tools/definitions/std/development/implement-task.yml +0 -124
- package/src/tools/definitions/std/development/review-fix-cycle.yml +0 -232
- package/src/tools/definitions/std/evolution/implement.yml +0 -124
- package/src/tools/definitions/std/evolution/prioritize.yml +0 -111
- package/src/tools/definitions/std/evolution/report-gap.yml +0 -165
- package/src/tools/definitions/std/file/read.yml +0 -21
- package/src/tools/definitions/std/governance/aggregate-opinions.sh +0 -201
- package/src/tools/definitions/std/governance/aggregate-opinions.yml +0 -78
- package/src/tools/definitions/std/governance/audit-task.yml +0 -177
- package/src/tools/definitions/std/governance/cast-vote.yml +0 -128
- package/src/tools/definitions/std/governance/collect-issues.yml +0 -16
- package/src/tools/definitions/std/governance/create-signed-document.yml +0 -23
- package/src/tools/definitions/std/governance/create-voting-session.yml +0 -100
- package/src/tools/definitions/std/governance/define-stance.sh +0 -243
- package/src/tools/definitions/std/governance/define-stance.yml +0 -81
- package/src/tools/definitions/std/governance/generate-review-report.yml +0 -23
- package/src/tools/definitions/std/governance/impeach.yml +0 -178
- package/src/tools/definitions/std/governance/multi-stance-review.yml +0 -153
- package/src/tools/definitions/std/governance/prepare-artifact.yml +0 -20
- package/src/tools/definitions/std/governance/review-spec-approval.yml +0 -262
- package/src/tools/definitions/std/governance/rollback.yml +0 -185
- package/src/tools/definitions/std/governance/stance-review.yml +0 -148
- package/src/tools/definitions/std/governance/track-effect.yml +0 -198
- package/src/tools/definitions/std/governance/vote-tally.yml +0 -143
- package/src/tools/definitions/std/patch/execute.yml +0 -51
- package/src/tools/definitions/std/planning/generate-tasks.yml +0 -36
- package/src/tools/definitions/std/planning/load-tasks.yml +0 -44
- package/src/tools/definitions/std/planning/split-batch.yml +0 -480
- package/src/tools/definitions/std/planning/split-tasks.yml +0 -358
- package/src/tools/definitions/std/planning/update-tasks.yml +0 -51
- package/src/tools/definitions/std/planning/validate-tasks.yml +0 -46
- package/src/tools/definitions/std/project/decide-next-workflow.yml +0 -38
- package/src/tools/definitions/std/project/load-state.yml +0 -31
- package/src/tools/definitions/std/project/save-state.yml +0 -32
- package/src/tools/definitions/std/quality/check-quality.yml +0 -241
- package/src/tools/definitions/std/quality/debug-systematic.yml +0 -163
- package/src/tools/definitions/std/quality/handle-feedback.yml +0 -108
- package/src/tools/definitions/std/quality/review-code.yml +0 -128
- package/src/tools/definitions/std/quality/review-spec.yml +0 -140
- package/src/tools/definitions/std/quality/review-task.yml +0 -190
- package/src/tools/definitions/std/quality/run-tests.yml +0 -80
- package/src/tools/definitions/std/quick/analyze.yml +0 -56
- package/src/tools/definitions/std/quick/implement.yml +0 -67
- package/src/tools/definitions/std/quick/verify.yml +0 -71
- package/src/tools/definitions/std/verification/verify_completion.yml +0 -113
- package/src/tools/definitions/std/verification/wait-condition.yml +0 -107
- package/src/tools/index.ts +0 -5
- package/src/tools/paths.ts +0 -15
|
@@ -143,22 +143,22 @@ describe('parseExportStatements — 源码导出面解析口径', () => {
|
|
|
143
143
|
});
|
|
144
144
|
|
|
145
145
|
describe('reconcileContext — 幽灵方向(文档→代码)', () => {
|
|
146
|
-
const doc = contextDoc(['- `TraceCollector` — 收集', '- `
|
|
146
|
+
const doc = contextDoc(['- `TraceCollector` — 收集', '- `SessionManager` — 会话'].join('\n'));
|
|
147
147
|
|
|
148
148
|
it('声明的符号在导出面中不存在 → 报幽灵并指名符号', () => {
|
|
149
149
|
const v = reconcileContext({
|
|
150
150
|
contextMdContent: doc,
|
|
151
151
|
exportSurface: ['TraceCollector'],
|
|
152
152
|
});
|
|
153
|
-
expect(v.declaredSymbols).toEqual(['TraceCollector', '
|
|
154
|
-
expect(v.ghosts).toEqual(['
|
|
153
|
+
expect(v.declaredSymbols).toEqual(['TraceCollector', 'SessionManager']);
|
|
154
|
+
expect(v.ghosts).toEqual(['SessionManager']);
|
|
155
155
|
});
|
|
156
156
|
|
|
157
157
|
it('导出面含同名符号(含类型符号)→ 零幽灵', () => {
|
|
158
158
|
expect(
|
|
159
159
|
reconcileContext({
|
|
160
160
|
contextMdContent: doc,
|
|
161
|
-
exportSurface: ['TraceCollector', '
|
|
161
|
+
exportSurface: ['TraceCollector', 'SessionManager'],
|
|
162
162
|
}).ghosts
|
|
163
163
|
).toEqual([]);
|
|
164
164
|
});
|
|
@@ -179,17 +179,17 @@ describe('reconcileContext — 覆盖方向(代码→文档,barrel 值符号
|
|
|
179
179
|
const doc = contextDoc(
|
|
180
180
|
[
|
|
181
181
|
'- `TraceCollector` — 执行追踪收集(`readReport(filter?)`)',
|
|
182
|
-
'- `TraceAnalyzer` — 统计分析,另有 `
|
|
182
|
+
'- `TraceAnalyzer` — 统计分析,另有 `pruneTraceLogs` GC 入口',
|
|
183
183
|
].join('\n')
|
|
184
184
|
);
|
|
185
185
|
|
|
186
186
|
it('barrel 再导出的值符号未出现在「核心导出」节 → 未登记;inline 提及即算登记', () => {
|
|
187
187
|
const v = reconcileContext({
|
|
188
188
|
contextMdContent: doc,
|
|
189
|
-
exportSurface: ['TraceCollector', 'TraceAnalyzer', '
|
|
190
|
-
barrelExports: ['TraceCollector', 'TraceAnalyzer', '
|
|
189
|
+
exportSurface: ['TraceCollector', 'TraceAnalyzer', 'pruneTraceLogs', 'KnowledgeInjector'],
|
|
190
|
+
barrelExports: ['TraceCollector', 'TraceAnalyzer', 'pruneTraceLogs', 'KnowledgeInjector'],
|
|
191
191
|
});
|
|
192
|
-
expect(v.unlistedBarrelExports).toEqual(['
|
|
192
|
+
expect(v.unlistedBarrelExports).toEqual(['KnowledgeInjector']);
|
|
193
193
|
});
|
|
194
194
|
|
|
195
195
|
it('无 barrel 的目录(barrelExports 不传/空)跳过覆盖方向', () => {
|
|
@@ -212,11 +212,11 @@ describe('reconcileContext — 覆盖方向(代码→文档,barrel 值符号
|
|
|
212
212
|
|
|
213
213
|
it('节外正文(其它 ## 节)里的同名句子不救 barrel 未登记', () => {
|
|
214
214
|
const v = reconcileContext({
|
|
215
|
-
contextMdContent: contextDoc('- `TraceCollector` — 收集', '## 约定\n- `
|
|
216
|
-
exportSurface: ['TraceCollector', '
|
|
217
|
-
barrelExports: ['TraceCollector', '
|
|
215
|
+
contextMdContent: contextDoc('- `TraceCollector` — 收集', '## 约定\n- `KnowledgeInjector` 只在组合根用\n'),
|
|
216
|
+
exportSurface: ['TraceCollector', 'KnowledgeInjector'],
|
|
217
|
+
barrelExports: ['TraceCollector', 'KnowledgeInjector'],
|
|
218
218
|
});
|
|
219
|
-
expect(v.unlistedBarrelExports).toEqual(['
|
|
219
|
+
expect(v.unlistedBarrelExports).toEqual(['KnowledgeInjector']);
|
|
220
220
|
});
|
|
221
221
|
});
|
|
222
222
|
|
|
@@ -225,7 +225,7 @@ describe('reconcileContext — 两方向同输入对撞', () => {
|
|
|
225
225
|
const doc = contextDoc('- `TraceCollector` — 收集\n');
|
|
226
226
|
const v = reconcileContext({
|
|
227
227
|
contextMdContent: doc,
|
|
228
|
-
exportSurface: ['TraceSink', '
|
|
228
|
+
exportSurface: ['TraceSink', 'KnowledgeInjector'],
|
|
229
229
|
barrelExports: ['TraceSink'],
|
|
230
230
|
});
|
|
231
231
|
expect(v.ghosts).toEqual(['TraceCollector']);
|
|
@@ -233,11 +233,11 @@ describe('reconcileContext — 两方向同输入对撞', () => {
|
|
|
233
233
|
});
|
|
234
234
|
|
|
235
235
|
it('两侧一致 → 干净(判定不制造存量噪音)', () => {
|
|
236
|
-
const doc = contextDoc('- `TraceCollector` — 收集\n- `
|
|
236
|
+
const doc = contextDoc('- `TraceCollector` — 收集\n- `KnowledgeInjector` — 知识注入\n');
|
|
237
237
|
const v = reconcileContext({
|
|
238
238
|
contextMdContent: doc,
|
|
239
|
-
exportSurface: ['TraceCollector', '
|
|
240
|
-
barrelExports: ['TraceCollector', '
|
|
239
|
+
exportSurface: ['TraceCollector', 'KnowledgeInjector'],
|
|
240
|
+
barrelExports: ['TraceCollector', 'KnowledgeInjector'],
|
|
241
241
|
});
|
|
242
242
|
expect(v.ghosts).toEqual([]);
|
|
243
243
|
expect(v.unlistedBarrelExports).toEqual([]);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* trace 记录器注入(工单 15 decycle 收尾 / harness#88)
|
|
3
3
|
*
|
|
4
|
-
* 原状态:checker 值导入 monitoring
|
|
4
|
+
* 原状态:checker 值导入 monitoring 的全局单例收集器,并在首次记录时惰性接线
|
|
5
5
|
* (ADR-0003),`setTraceRecorder` 退化成只有测试在用的假 seam。
|
|
6
6
|
* 现在:记录器经**构造参数**注入;未注入 = no-op(core 零上行依赖,默认无副作用),
|
|
7
|
-
* 真实收集器由组合根(CLI 命令 / bootstrap)接线。
|
|
7
|
+
* 真实收集器由组合根(CLI 命令 / bootstrap)接线。monitoring 侧的单例出口
|
|
8
|
+
* (getTraceCollector/configureTraceCollector)已随 #199 删除,「checker 不碰
|
|
9
|
+
* monitoring 值面」由本文件的源码扫描断言直接钉住。
|
|
8
10
|
*/
|
|
9
11
|
|
|
10
12
|
import * as fs from 'fs';
|
|
@@ -13,16 +15,6 @@ import * as path from 'path';
|
|
|
13
15
|
import { ConstraintChecker } from '../checker';
|
|
14
16
|
import type { ExecutionTrace } from '../../../types/trace';
|
|
15
17
|
|
|
16
|
-
jest.mock('../../../monitoring/traces', () => ({
|
|
17
|
-
getTraceCollector: jest.fn(() => ({ record: jest.fn() })),
|
|
18
|
-
TraceCollector: jest.fn(),
|
|
19
|
-
configureTraceCollector: jest.fn(),
|
|
20
|
-
}));
|
|
21
|
-
|
|
22
|
-
/** 替身收集器工厂(core 侧连测试也不值导入 monitoring,方向由 #88 规则锁) */
|
|
23
|
-
const getTraceCollector = jest.requireMock('../../../monitoring/traces')
|
|
24
|
-
.getTraceCollector as jest.Mock;
|
|
25
|
-
|
|
26
18
|
describe('trace 记录器构造注入(harness#88)', () => {
|
|
27
19
|
let projectDir: string;
|
|
28
20
|
/**
|
|
@@ -39,7 +31,6 @@ describe('trace 记录器构造注入(harness#88)', () => {
|
|
|
39
31
|
projectDir = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-trace-injection-'));
|
|
40
32
|
fs.mkdirSync(path.join(projectDir, '.harness', 'evidence'), { recursive: true });
|
|
41
33
|
fs.writeFileSync(path.join(projectDir, '.harness', 'evidence', 'test.log'), 'ok');
|
|
42
|
-
getTraceCollector.mockClear();
|
|
43
34
|
});
|
|
44
35
|
|
|
45
36
|
afterAll(() => {
|
|
@@ -67,11 +58,19 @@ describe('trace 记录器构造注入(harness#88)', () => {
|
|
|
67
58
|
expect((checker as any).setTraceRecorder).toBeUndefined();
|
|
68
59
|
});
|
|
69
60
|
|
|
70
|
-
it('
|
|
61
|
+
it('未注入记录器时检查照常执行(no-op 默认,core 零上行依赖)', async () => {
|
|
71
62
|
const unwired = new ConstraintChecker();
|
|
72
63
|
|
|
73
64
|
await unwired.checkConstraints(context());
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('checker 对 monitoring 零值导入(单例出口删除后不可能再反向取全局收集器,#199)', () => {
|
|
68
|
+
const source = fs.readFileSync(path.join(__dirname, '..', 'checker.ts'), 'utf-8');
|
|
69
|
+
const monitoringValueImports = source
|
|
70
|
+
.split('\n')
|
|
71
|
+
.filter(line => /^\s*import\s/.test(line) && !/^\s*import\s+type\b/.test(line))
|
|
72
|
+
.filter(line => line.includes('monitoring'));
|
|
74
73
|
|
|
75
|
-
expect(
|
|
74
|
+
expect(monitoringValueImports).toEqual([]);
|
|
76
75
|
});
|
|
77
76
|
});
|
|
@@ -172,4 +172,13 @@ describe('应用层约束进候选诊断(ADR-0033 块 3 子项 3)', () => {
|
|
|
172
172
|
expect(report.stats.some(s => s.id === 'app_no_internal_url')).toBe(false);
|
|
173
173
|
expect(report.candidates.some(c => c.id === 'app_no_internal_url')).toBe(false);
|
|
174
174
|
});
|
|
175
|
+
|
|
176
|
+
it('buildConstraintsUsageReport 根参数必传(harness#201,同族同形)', () => {
|
|
177
|
+
// 永不执行:只钉签名形状——不传根在类型层即被拒绝,无 process.cwd() 缺省
|
|
178
|
+
const neverCalled = (): void => {
|
|
179
|
+
// @ts-expect-error 根参数必传(harness#201)
|
|
180
|
+
buildConstraintsUsageReport();
|
|
181
|
+
};
|
|
182
|
+
void neverCalled;
|
|
183
|
+
});
|
|
175
184
|
});
|
|
@@ -62,14 +62,12 @@ export function parseCapabilitiesEntries(content: string, options: CapabilitiesP
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
* 读取并解析 CAPABILITIES.md
|
|
65
|
+
* 读取并解析 CAPABILITIES.md;文件缺失时返回 [](未采用该约定的项目占多数,不算异常);
|
|
66
|
+
* 文件在场但读失败 → 抛出(fail-fast,不装成「无登记条目」)
|
|
66
67
|
*/
|
|
67
68
|
export function readCapabilitiesEntries(capabilitiesPath: string, options: CapabilitiesParseOptions = {}): string[] {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
} catch {
|
|
71
|
-
return [];
|
|
72
|
-
}
|
|
69
|
+
if (!fs.existsSync(capabilitiesPath)) return [];
|
|
70
|
+
return parseCapabilitiesEntries(fs.readFileSync(capabilitiesPath, 'utf-8'), options);
|
|
73
71
|
}
|
|
74
72
|
|
|
75
73
|
/**
|
|
@@ -31,7 +31,7 @@ import { createRunEnv, type RunEnv } from './run-env';
|
|
|
31
31
|
*
|
|
32
32
|
* core 不上行依赖 monitoring:记录器经**构造参数**注入,未注入 = no-op
|
|
33
33
|
* (默认无副作用)。真实收集器由组合根接线——CLI check/report 与 bootstrap
|
|
34
|
-
* 各自 `new ConstraintChecker(
|
|
34
|
+
* 各自 `new ConstraintChecker(new TraceCollector({ projectPath }))`。
|
|
35
35
|
*/
|
|
36
36
|
export interface TraceRecorder {
|
|
37
37
|
record(trace: ExecutionTrace): void;
|
|
@@ -422,6 +422,25 @@ export async function checkConstraints(
|
|
|
422
422
|
return result;
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
+
/**
|
|
426
|
+
* 快捷函数:收集模式执行约束检查(不抛出口,harness#194)
|
|
427
|
+
*
|
|
428
|
+
* 与 checkConstraints 共享同一检查体、同一 options 签名,唯一差别是不 throw:
|
|
429
|
+
* error 级违规照进 result.errors、passed=false,后续 error 与 warning 级照常执行。
|
|
430
|
+
* 报告类 / HTTP 端点类消费方拿全量视图;阻断语义只属于 checkConstraints。
|
|
431
|
+
*/
|
|
432
|
+
export async function collectConstraints(
|
|
433
|
+
context: ConstraintContext,
|
|
434
|
+
options?: CheckConstraintsOptions
|
|
435
|
+
): Promise<ConstraintCheckResult> {
|
|
436
|
+
const result = await ConstraintChecker.getInstance().collectConstraints(context, options?.customConfig ?? null);
|
|
437
|
+
if (options?.onTrace) {
|
|
438
|
+
for (const r of result.errors) options.onTrace(r);
|
|
439
|
+
for (const r of result.warnings) options.onTrace(r);
|
|
440
|
+
}
|
|
441
|
+
return result;
|
|
442
|
+
}
|
|
443
|
+
|
|
425
444
|
/**
|
|
426
445
|
* 快捷函数:执行前检查
|
|
427
446
|
*
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* - 证据源 = `.harness/evidence/`(独立链路写入:PassesGate.runTests 真实跑测试
|
|
8
8
|
* 命令落盘,或消费方外部验证事件),与 traces.log 彻底脱钩
|
|
9
|
-
* - 新鲜度 = 最新证据 mtime
|
|
9
|
+
* - 新鲜度 = 最新证据 mtime 严格晚于全部可读变更文件(验证跑在最新变更之后);
|
|
10
|
+
* 同刻等值 = 时钟精度内先后不可判(harness#195)→ 显式降级 skip,不放行也不违规
|
|
10
11
|
* - 缺失/空目录 → fail;过期 → fail(点名晚于证据的变更文件);
|
|
11
12
|
* 证据位不可读 / 新鲜度不可判定 → 带原因的显式降级 skip(不静默)
|
|
12
13
|
*
|
|
@@ -74,13 +75,31 @@ describe('no_completion_without_verification(harness#183 证据源重构)',
|
|
|
74
75
|
expect(result.satisfied).toBe(true);
|
|
75
76
|
});
|
|
76
77
|
|
|
77
|
-
it('
|
|
78
|
+
it('证据与最新变更同一时刻(等值不可判,harness#195)→ 显式降级 skip,不放行也不违规', async () => {
|
|
78
79
|
writeChangedFile('src/a.ts', T_OLD);
|
|
79
80
|
writeEvidence('test-same-instant.log', T_OLD);
|
|
80
81
|
|
|
81
82
|
const result = await checker.check(LAW, contextOf(['src/a.ts']));
|
|
82
83
|
|
|
83
|
-
|
|
84
|
+
// 时钟精度内「同刻」物理上无法区分先后:判 pass 是假绿灯,判 fail 又可能误杀
|
|
85
|
+
// 正常时序(改完立刻验证落进同一毫秒)——不可判定态走显式降级,与「变更清单
|
|
86
|
+
// 未接线」「mtime 均不可读」同一出口
|
|
87
|
+
expect(result.skipped).toBe(true);
|
|
88
|
+
expect(result.satisfied).toBe(true); // skip 不产生违规
|
|
89
|
+
expect(result.skipReason).toContain('同刻');
|
|
90
|
+
expect(result.skipReason).toContain('src/a.ts');
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('严格晚于证据的变更与同刻变更并存 → fail 优先(证据确定过期,不因同刻降级)', async () => {
|
|
94
|
+
writeChangedFile('src/a.ts', T_OLD);
|
|
95
|
+
writeChangedFile('src/b.ts', T_NEW);
|
|
96
|
+
writeEvidence('test-same-instant.log', T_OLD);
|
|
97
|
+
|
|
98
|
+
const result = await checker.check(LAW, contextOf(['src/a.ts', 'src/b.ts']));
|
|
99
|
+
|
|
100
|
+
expect(result.skipped).toBeUndefined();
|
|
101
|
+
expect(result.satisfied).toBe(false);
|
|
102
|
+
expect(result.evidence?.join('\n')).toContain('src/b.ts');
|
|
84
103
|
});
|
|
85
104
|
|
|
86
105
|
it('changedFiles 为 undefined(调用方未接线变更清单)→ 显式降级 skip,不放行', async () => {
|
|
@@ -12,7 +12,6 @@ import { join } from 'path';
|
|
|
12
12
|
import { describe, it, expect, afterAll } from '@jest/globals';
|
|
13
13
|
import {
|
|
14
14
|
noHardcodedCredentials,
|
|
15
|
-
containsHardcodedCredential,
|
|
16
15
|
} from '../no-hardcoded-credentials';
|
|
17
16
|
import type { CheckEnv } from '../types';
|
|
18
17
|
import { createRunEnv } from '../../run-env';
|
|
@@ -33,97 +32,113 @@ const PASSWORD_ASSIGN = 'const dbPass' + 'word = "sup3r-s3cret-value";';
|
|
|
33
32
|
const JWT =
|
|
34
33
|
'eyJ' + 'hbGciOiJIUzI1NiJ9.' + 'eyJ' + 'zdWIiOiIxMjM0NTY3ODkwIn0.' + 'dozjgNryP4J3jVmNHl0w5N_XgL0n';
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
/** 经生产入口判定一段文本是否命中凭证:写入临时文件,走「变更文件内容扫描」路径 */
|
|
36
|
+
const scanDir = mkdtempSync(join(tmpdir(), 'harness-cred-scan-'));
|
|
37
|
+
afterAll(() => rmSync(scanDir, { recursive: true, force: true }));
|
|
38
|
+
|
|
39
|
+
async function textHitsCredential(text: string): Promise<boolean> {
|
|
40
|
+
writeFileSync(join(scanDir, 'probe.ts'), text + '\n');
|
|
41
|
+
const env: CheckEnv = {
|
|
42
|
+
...createRunEnv(scanDir),
|
|
43
|
+
context: { operation: 'commit', projectPath: scanDir, changedFiles: ['probe.ts'] },
|
|
44
|
+
stagedDiff: async () => '',
|
|
45
|
+
stagedDiffNames: async () => '',
|
|
46
|
+
srcScan: () => [],
|
|
47
|
+
};
|
|
48
|
+
return (await noHardcodedCredentials.evaluate(env)) !== true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
describe('文本命中判定(经生产入口 evaluate 的变更文件扫描路径)', () => {
|
|
52
|
+
it('命中 PEM 私钥头', async () => {
|
|
53
|
+
expect(await textHitsCredential(PEM_HEADER + '\nMIIE...')).toBe(true);
|
|
39
54
|
});
|
|
40
55
|
|
|
41
|
-
it('命中 AWS Access Key', () => {
|
|
42
|
-
expect(
|
|
56
|
+
it('命中 AWS Access Key', async () => {
|
|
57
|
+
expect(await textHitsCredential(`const key = "${AWS_KEY}";`)).toBe(true);
|
|
43
58
|
});
|
|
44
59
|
|
|
45
|
-
it('命中硬编码 password 赋值', () => {
|
|
46
|
-
expect(
|
|
60
|
+
it('命中硬编码 password 赋值', async () => {
|
|
61
|
+
expect(await textHitsCredential(PASSWORD_ASSIGN)).toBe(true);
|
|
47
62
|
});
|
|
48
63
|
|
|
49
|
-
it('命中硬编码 api_key 赋值', () => {
|
|
50
|
-
expect(
|
|
64
|
+
it('命中硬编码 api_key 赋值', async () => {
|
|
65
|
+
expect(await textHitsCredential('api' + '_key: "abcdef123456789"')).toBe(true);
|
|
51
66
|
});
|
|
52
67
|
|
|
53
|
-
it('命中 .env 裸值(无引号赋值)', () => {
|
|
54
|
-
expect(
|
|
68
|
+
it('命中 .env 裸值(无引号赋值)', async () => {
|
|
69
|
+
expect(await textHitsCredential('DB_TO' + 'KEN=abc123def456ghi')).toBe(true);
|
|
55
70
|
});
|
|
56
71
|
|
|
57
|
-
it('命中无引号 YAML 值', () => {
|
|
58
|
-
expect(
|
|
72
|
+
it('命中无引号 YAML 值', async () => {
|
|
73
|
+
expect(await textHitsCredential('pass' + 'word: secret123')).toBe(true);
|
|
59
74
|
});
|
|
60
75
|
|
|
61
|
-
it('命中 URL 内嵌凭证', () => {
|
|
62
|
-
expect(
|
|
76
|
+
it('命中 URL 内嵌凭证', async () => {
|
|
77
|
+
expect(await textHitsCredential('const url = "postgres:/' + '/user:pw12345@db.host/app";')).toBe(true);
|
|
63
78
|
});
|
|
64
79
|
|
|
65
|
-
it('命中 JSON 带引号键', () => {
|
|
66
|
-
expect(
|
|
80
|
+
it('命中 JSON 带引号键', async () => {
|
|
81
|
+
expect(await textHitsCredential('"pass' + 'word": "realvalue123"')).toBe(true);
|
|
67
82
|
});
|
|
68
83
|
|
|
69
|
-
it('命中非清单变量名 credential/privateKey/signingKey', () => {
|
|
70
|
-
expect(
|
|
71
|
-
expect(
|
|
72
|
-
expect(
|
|
84
|
+
it('命中非清单变量名 credential/privateKey/signingKey', async () => {
|
|
85
|
+
expect(await textHitsCredential('cred' + 'ential = "realvalue123";')).toBe(true);
|
|
86
|
+
expect(await textHitsCredential('private' + 'Key = "realvalue123";')).toBe(true);
|
|
87
|
+
expect(await textHitsCredential('signing' + '_key: realvalue123')).toBe(true);
|
|
73
88
|
});
|
|
74
89
|
|
|
75
|
-
it('命中 JWT', () => {
|
|
76
|
-
expect(
|
|
90
|
+
it('命中 JWT', async () => {
|
|
91
|
+
expect(await textHitsCredential(`const tok = "${JWT}";`)).toBe(true);
|
|
77
92
|
});
|
|
78
93
|
|
|
79
|
-
it('行内出现 test 不再整行豁免真实值', () => {
|
|
94
|
+
it('行内出现 test 不再整行豁免真实值', async () => {
|
|
80
95
|
expect(
|
|
81
|
-
|
|
96
|
+
await textHitsCredential('const pass' + 'word = "realvalue123"; // test fixture')
|
|
82
97
|
).toBe(true);
|
|
83
98
|
});
|
|
84
99
|
|
|
85
|
-
it('豁免环境变量引用', () => {
|
|
100
|
+
it('豁免环境变量引用', async () => {
|
|
86
101
|
expect(
|
|
87
|
-
|
|
102
|
+
await textHitsCredential('const pass' + 'word = process.env.DB_PASSWORD;')
|
|
88
103
|
).toBe(false);
|
|
89
104
|
});
|
|
90
105
|
|
|
91
|
-
it('豁免占位符值', () => {
|
|
106
|
+
it('豁免占位符值', async () => {
|
|
92
107
|
expect(
|
|
93
|
-
|
|
108
|
+
await textHitsCredential('const pass' + 'word = "your-password-here";')
|
|
94
109
|
).toBe(false);
|
|
95
110
|
});
|
|
96
111
|
|
|
97
|
-
it('豁免 TS 类型注解(值是类型名而非字面量)', () => {
|
|
98
|
-
expect(
|
|
112
|
+
it('豁免 TS 类型注解(值是类型名而非字面量)', async () => {
|
|
113
|
+
expect(await textHitsCredential('api' + 'Key: string|undefined;')).toBe(false);
|
|
99
114
|
});
|
|
100
115
|
|
|
101
|
-
it('豁免 URL 中的变量插值占位', () => {
|
|
116
|
+
it('豁免 URL 中的变量插值占位', async () => {
|
|
102
117
|
expect(
|
|
103
|
-
|
|
118
|
+
await textHitsCredential('postgres://user:' + '${' + 'DB_PASS}@host/db')
|
|
104
119
|
).toBe(false);
|
|
105
120
|
});
|
|
106
121
|
|
|
107
|
-
it('普通代码不误报', () => {
|
|
122
|
+
it('普通代码不误报', async () => {
|
|
108
123
|
expect(
|
|
109
|
-
|
|
124
|
+
await textHitsCredential('export function add(a: number, b: number) { return a + b; }')
|
|
110
125
|
).toBe(false);
|
|
111
126
|
});
|
|
112
127
|
|
|
113
|
-
it('豁免右值为代码表达式的赋值(#184 收窄正则版假灯回归)', () => {
|
|
128
|
+
it('豁免右值为代码表达式的赋值(#184 收窄正则版假灯回归)', async () => {
|
|
114
129
|
// 现场复现:交付链 2026-09-24 一次采纳 1.14.0 时,业务仓的 React useCallback
|
|
115
130
|
// 赋值被无引号分支判成「口令类赋值」——右值是代码而非字面量。
|
|
116
131
|
expect(
|
|
117
|
-
|
|
132
|
+
await textHitsCredential('const insertPmoTok' + 'en = useCallback((candidate: string) => {')
|
|
118
133
|
).toBe(false);
|
|
119
134
|
expect(
|
|
120
|
-
|
|
135
|
+
await textHitsCredential('const refreshTok' + 'en = getTokenFromStor' + 'age();')
|
|
121
136
|
).toBe(false);
|
|
122
137
|
expect(
|
|
123
|
-
|
|
138
|
+
await textHitsCredential('const refreshTok' + 'en = req.cookies.refre' + 'sh;')
|
|
124
139
|
).toBe(false);
|
|
125
140
|
expect(
|
|
126
|
-
|
|
141
|
+
await textHitsCredential('api' + '_key: make' + 'Key("abc123456789"),')
|
|
127
142
|
).toBe(false);
|
|
128
143
|
});
|
|
129
144
|
});
|
|
@@ -7,8 +7,11 @@
|
|
|
7
7
|
* (PassesGate.runTests 真实跑项目声明的验证命令后落盘;消费方外部验证事件
|
|
8
8
|
* 也写这里),判定与约束检查自身的 trace 彻底脱钩。
|
|
9
9
|
*
|
|
10
|
-
* 新鲜度口径:最新证据文件的 mtime
|
|
10
|
+
* 新鲜度口径:最新证据文件的 mtime 严格晚于全部可读变更文件的 mtime
|
|
11
11
|
* (验证跑在最新变更之后)。不用固定时间窗——与本次变更的因果关系才是口径。
|
|
12
|
+
* 同刻等值(harness#195):文件系统时间戳粒度有限,等值在物理上无法区分先后,
|
|
13
|
+
* 属不可判定态——判 pass 是假绿灯(同毫秒「先证据后变更」会被放行),判 fail 又
|
|
14
|
+
* 误杀正常时序(改完立刻验证落进同一毫秒),故等值走显式降级 skip,不放行也不违规。
|
|
12
15
|
* 已知边界(保守方向,不修复):git checkout 等刷新工作区 mtime 会误杀真证据
|
|
13
16
|
* (误判过期 → fail,要求重跑验证);证据只核存在性与时间,不读内容——防伪
|
|
14
17
|
* 非本票口径(旧机制是自我指认,更弱)。
|
|
@@ -19,6 +22,8 @@
|
|
|
19
22
|
* 判定(显式三态,harness#182 语义):
|
|
20
23
|
* - 证据目录缺失/为空 → fail(从未验证)
|
|
21
24
|
* - 证据旧于最新变更 → fail(证据过期,点名晚于证据的变更文件)
|
|
25
|
+
* - 证据与变更文件同刻等值 → 带原因的 CheckSkip(harness#195:等值不可判定,
|
|
26
|
+
* 不放行也不违规;严格晚于证据的变更并存时 fail 优先,证据确定过期不降级)
|
|
22
27
|
* - 新鲜 → pass
|
|
23
28
|
* - changedFiles 为 undefined(调用方未接线变更清单,如生产侧直调)→ 带原因的
|
|
24
29
|
* CheckSkip:新鲜度无所依不能放行(空数组 = 真无变更,不在此列,有证据即过)
|
|
@@ -96,11 +101,13 @@ export const noCompletionWithoutVerification: ConstraintCheck = {
|
|
|
96
101
|
// 全部不可读才无法判定 → 显式降级
|
|
97
102
|
let readable = 0;
|
|
98
103
|
const laterThanEvidence: string[] = [];
|
|
104
|
+
const sameAsEvidence: string[] = [];
|
|
99
105
|
for (const file of changed) {
|
|
100
106
|
try {
|
|
101
107
|
const mtime = fs.statSync(path.join(env.projectPath, file)).mtimeMs;
|
|
102
108
|
readable++;
|
|
103
109
|
if (mtime > evidence.mtime) laterThanEvidence.push(file);
|
|
110
|
+
else if (mtime === evidence.mtime) sameAsEvidence.push(file);
|
|
104
111
|
} catch {
|
|
105
112
|
// 变更文件不可读(如已删除):不参与新鲜度判定
|
|
106
113
|
}
|
|
@@ -121,6 +128,14 @@ export const noCompletionWithoutVerification: ConstraintCheck = {
|
|
|
121
128
|
),
|
|
122
129
|
};
|
|
123
130
|
}
|
|
131
|
+
// 同刻等值 = 时钟精度内先后不可判(harness#195):不放行也不违规,显式降级。
|
|
132
|
+
// 置于 fail 之后:严格晚于证据的变更并存时证据确定过期,不因同刻降级
|
|
133
|
+
if (sameAsEvidence.length > 0) {
|
|
134
|
+
return {
|
|
135
|
+
skip: true,
|
|
136
|
+
reason: `证据与变更文件同刻(mtime 等值,时钟精度内无法区分先后):${sameAsEvidence.join(', ')},无法判定证据新鲜度,本次未评估`,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
124
139
|
return true;
|
|
125
140
|
},
|
|
126
141
|
};
|
|
@@ -120,11 +120,6 @@ function scanText(text: string, file: string): Hit[] {
|
|
|
120
120
|
return hits;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
/** 判定一段文本是否包含硬编码凭证 */
|
|
124
|
-
export function containsHardcodedCredential(text: string): boolean {
|
|
125
|
-
return scanText(text, '(text)').length > 0;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
123
|
interface AddedLine {
|
|
129
124
|
file: string;
|
|
130
125
|
lineNo: number;
|
|
@@ -72,6 +72,7 @@ function runCommand(command: string, cwd: string, timeoutMs: number): Promise<Co
|
|
|
72
72
|
try {
|
|
73
73
|
if (child.pid !== undefined) process.kill(-child.pid, 'SIGKILL');
|
|
74
74
|
} catch {
|
|
75
|
+
// 进程组 kill 失败(竞态:子进程已退,ESRCH)→ 退化单进程 kill,best-effort 收尾
|
|
75
76
|
child.kill('SIGKILL');
|
|
76
77
|
}
|
|
77
78
|
}, timeoutMs);
|
|
@@ -47,7 +47,7 @@ export const fileExists: TemplatedCheckerFactory = {
|
|
|
47
47
|
evaluate(env) {
|
|
48
48
|
const pathHit = rel !== undefined && existsSync(join(env.projectPath, rel));
|
|
49
49
|
const globHits = globPattern !== undefined
|
|
50
|
-
? glob.sync(globPattern, { cwd: env.projectPath, dot: true, onlyFiles: false })
|
|
50
|
+
? glob.sync(globPattern, { cwd: env.projectPath, dot: true, onlyFiles: false, ignore: ['node_modules/**'] })
|
|
51
51
|
: [];
|
|
52
52
|
|
|
53
53
|
if (mustExist) {
|
|
@@ -62,7 +62,7 @@ export const fileExists: TemplatedCheckerFactory = {
|
|
|
62
62
|
|
|
63
63
|
// mustExist=false:任何目标存在即违规
|
|
64
64
|
const present: string[] = [
|
|
65
|
-
...(pathHit ? [rel
|
|
65
|
+
...(pathHit && rel !== undefined ? [rel] : []),
|
|
66
66
|
...globHits,
|
|
67
67
|
];
|
|
68
68
|
if (present.length > 0) {
|
|
@@ -1,44 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 模板侧轻量 glob 匹配(支持 `**`、`*`、`?`,纯字符串判定,不碰文件系统)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* 参数匹配不住 completion-checkers 的 commits 分类模块。
|
|
4
|
+
* glob→正则正本在 `utils/glob-match.ts`(与 completion-checkers 同一匹配语义,
|
|
5
|
+
* utils 下游白名单内,分层守卫(harness#88)不违)。
|
|
7
6
|
*/
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
return s.replace(/[.+^${}()|[\]\\]/g, '\\$&');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/** glob → 锚定正则。前缀 `**` + `/` 匹配零或多段路径;`*` 不跨 `/`;`?` 匹配单个非 `/` 字符 */
|
|
14
|
-
function globToRegExp(glob: string): RegExp {
|
|
15
|
-
let re = '';
|
|
16
|
-
let i = 0;
|
|
17
|
-
while (i < glob.length) {
|
|
18
|
-
const c = glob[i];
|
|
19
|
-
if (c === '*') {
|
|
20
|
-
if (glob[i + 1] === '*') {
|
|
21
|
-
if (glob[i + 2] === '/') {
|
|
22
|
-
re += '(?:[^/]+/)*';
|
|
23
|
-
i += 3;
|
|
24
|
-
} else {
|
|
25
|
-
re += '.*';
|
|
26
|
-
i += 2;
|
|
27
|
-
}
|
|
28
|
-
} else {
|
|
29
|
-
re += '[^/]*';
|
|
30
|
-
i += 1;
|
|
31
|
-
}
|
|
32
|
-
} else if (c === '?') {
|
|
33
|
-
re += '[^/]';
|
|
34
|
-
i += 1;
|
|
35
|
-
} else {
|
|
36
|
-
re += escapeRegExp(c);
|
|
37
|
-
i += 1;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return new RegExp('^' + re + '$');
|
|
41
|
-
}
|
|
8
|
+
import { globToRegExp } from '../../../../utils/glob-match';
|
|
42
9
|
|
|
43
10
|
/** 单 glob 匹配(相对路径正斜杠口径) */
|
|
44
11
|
export function matchGlob(file: string, glob: string): boolean {
|