@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
|
@@ -10,36 +10,27 @@
|
|
|
10
10
|
*
|
|
11
11
|
* 人确认闸门与 retire 同形(ADR-0001 决策 2 语义):直达必须显式 --yes。
|
|
12
12
|
* 不提供交互批量模式——复活是低频点对点操作。
|
|
13
|
+
*
|
|
14
|
+
* harness#198:纯执行逻辑(reactivateConstraint 与结果类型)已搬入
|
|
15
|
+
* `core/constraint-lifecycle` 并上公共 barrel;本模块是 CLI 薄壳——打印、
|
|
16
|
+
* 人确认闸门,外加把知识沉淀写口接进 core 的 wired 包装(同 constraints-retire)。
|
|
13
17
|
*/
|
|
14
18
|
|
|
15
|
-
import * as path from 'path';
|
|
16
19
|
import { log, logError, processIO, type CommandIO, type CommandResult } from '../command-contract';
|
|
17
20
|
import chalk from 'chalk';
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
import {
|
|
22
|
+
reactivateConstraint as coreReactivateConstraint,
|
|
23
|
+
type ReactivateExecuteOptions,
|
|
24
|
+
type ReactivateResult,
|
|
25
|
+
} from '../../core/constraint-lifecycle';
|
|
21
26
|
import { openKnowledgeStore } from './knowledge-view';
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
export interface ReactivateExecuteOptions {
|
|
25
|
-
/** 复活原因(可空) */
|
|
26
|
-
reason?: string;
|
|
27
|
-
/** 注入当前时间(测试用) */
|
|
28
|
-
now?: Date;
|
|
29
|
-
/** 知识库路径解析的 io(缺省 processIO,与 retire 写口同形) */
|
|
30
|
-
io?: CommandIO;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export type ReactivateStatus = 'reactivated' | 'not_retired' | 'unknown_id';
|
|
27
|
+
import { logCommitHint } from './constraints-retire';
|
|
34
28
|
|
|
35
|
-
export
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/** 复活记录实际落盘的知识库根(status='reactivated' 时存在) */
|
|
41
|
-
knowledgeBaseDir?: string;
|
|
42
|
-
}
|
|
29
|
+
export type {
|
|
30
|
+
ReactivateExecuteOptions,
|
|
31
|
+
ReactivateStatus,
|
|
32
|
+
ReactivateResult,
|
|
33
|
+
} from '../../core/constraint-lifecycle';
|
|
43
34
|
|
|
44
35
|
export interface ConstraintsReactivateOptions {
|
|
45
36
|
projectPath?: string;
|
|
@@ -49,101 +40,19 @@ export interface ConstraintsReactivateOptions {
|
|
|
49
40
|
}
|
|
50
41
|
|
|
51
42
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* baseDir 走 openKnowledgeStore 同一解析点,与 retire 沉淀写口同根。
|
|
55
|
-
*/
|
|
56
|
-
function saveReactivateKnowledge(
|
|
57
|
-
id: string,
|
|
58
|
-
target: RetireTargetInfo,
|
|
59
|
-
reason: string,
|
|
60
|
-
iso: string,
|
|
61
|
-
io: CommandIO
|
|
62
|
-
): { entryId: string; baseDir: string } {
|
|
63
|
-
const entryId = `constraint-reactivated-${id}`;
|
|
64
|
-
const contentLines = [
|
|
65
|
-
`# 约束复活:${id}`,
|
|
66
|
-
'',
|
|
67
|
-
`原退役沉淀:constraint-retired-${id}(不改历史,原条目保留)`,
|
|
68
|
-
'',
|
|
69
|
-
'## 规则原文',
|
|
70
|
-
'',
|
|
71
|
-
target.description ? `description: ${target.description}` : undefined,
|
|
72
|
-
target.rule ? `rule: ${target.rule}` : undefined,
|
|
73
|
-
target.message ? `message: ${target.message}` : undefined,
|
|
74
|
-
'',
|
|
75
|
-
'## 复活原因',
|
|
76
|
-
'',
|
|
77
|
-
reason || '(未填写)',
|
|
78
|
-
'',
|
|
79
|
-
`复活日期: ${iso}`,
|
|
80
|
-
].filter((l): l is string => l !== undefined);
|
|
81
|
-
|
|
82
|
-
const entry: KnowledgeEntry = {
|
|
83
|
-
id: entryId,
|
|
84
|
-
type: 'decision',
|
|
85
|
-
title: `约束复活:${id}`,
|
|
86
|
-
content: contentLines.join('\n'),
|
|
87
|
-
maturity: 'verified',
|
|
88
|
-
layer: 'project',
|
|
89
|
-
created: iso,
|
|
90
|
-
lastReferenced: iso,
|
|
91
|
-
contributors: [],
|
|
92
|
-
projects: [],
|
|
93
|
-
tags: ['constraint-reactivated', `constraint:${id}`, `severity:${target.severity}`],
|
|
94
|
-
applicablePhases: [],
|
|
95
|
-
sourceReferences: [{ timestamp: iso }],
|
|
96
|
-
referencedBy: [],
|
|
97
|
-
executionResults: [],
|
|
98
|
-
consumptionMode: 'signal',
|
|
99
|
-
origin: 'human',
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const store = openKnowledgeStore({}, io);
|
|
103
|
-
store.save(entry);
|
|
104
|
-
return { entryId, baseDir: store.getBaseDir() };
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* 执行单条约束复活(纯执行逻辑,无交互)
|
|
109
|
-
*
|
|
110
|
-
* 不存在的 id / 无 retired 墓碑的 id 通过 status 返回,由调用方提示。
|
|
43
|
+
* CLI 侧 wired 包装:core reactivateConstraint + 知识沉淀写口接线
|
|
44
|
+
* (openKnowledgeStore 同一解析点,与 retire 写口同根,harness#177)。
|
|
111
45
|
*/
|
|
112
46
|
export function reactivateConstraint(
|
|
113
47
|
projectRoot: string,
|
|
114
48
|
id: string,
|
|
115
49
|
options: ReactivateExecuteOptions = {}
|
|
116
50
|
): ReactivateResult {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return { id, status: 'unknown_id' };
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// 只认 retired 墓碑:裸 disable 与未配置一律 not_retired(与 retire 的幂等口径对偶,
|
|
126
|
-
// 判定谓词唯一实现 = isRetiredTombstone)
|
|
127
|
-
const loader = new ProjectConfigLoader(projectRoot);
|
|
128
|
-
loader.load();
|
|
129
|
-
const existing = loader.getConfig().constraints?.[id] as { enabled?: boolean; retired?: unknown } | undefined;
|
|
130
|
-
if (!isRetiredTombstone(existing)) {
|
|
131
|
-
return { id, status: 'not_retired' };
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// 1. 删 config.yml constraints.<id> 墓碑段(恢复 = 回生效集)
|
|
135
|
-
removeYamlEntry(path.join(projectRoot, '.harness', 'config.yml'), 'constraints', id);
|
|
136
|
-
|
|
137
|
-
// 2. KnowledgeStore 复活条目(不改历史,新写一条)
|
|
138
|
-
const { entryId: knowledgeEntryId, baseDir: knowledgeBaseDir } = saveReactivateKnowledge(
|
|
139
|
-
id,
|
|
140
|
-
target,
|
|
141
|
-
options.reason ?? '',
|
|
142
|
-
iso,
|
|
143
|
-
options.io ?? processIO
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
return { id, status: 'reactivated', knowledgeEntryId, knowledgeBaseDir };
|
|
51
|
+
return coreReactivateConstraint(projectRoot, id, {
|
|
52
|
+
...options,
|
|
53
|
+
openKnowledgeStore:
|
|
54
|
+
options.openKnowledgeStore ?? (() => openKnowledgeStore({}, options.io ?? processIO)),
|
|
55
|
+
});
|
|
147
56
|
}
|
|
148
57
|
|
|
149
58
|
/**
|
|
@@ -28,56 +28,39 @@
|
|
|
28
28
|
* already_retired 幂等只认 retired 墓碑(ADR-0032 决策 6.6,票 02 断点 6):
|
|
29
29
|
* 裸 enabled:false 是"禁用"不是"退休",会被退休流程接管补上墓碑与沉淀。
|
|
30
30
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* harness#198:纯执行逻辑(retireConstraint / findRetireTarget 与结果类型)已搬入
|
|
32
|
+
* `core/constraint-lifecycle` 并上公共 barrel(消费方不再偷看 .harness/ 内部);
|
|
33
|
+
* 本模块是 CLI 薄壳——交互、打印、人确认闸门,外加把知识沉淀写口接进 core 的
|
|
34
|
+
* wired 包装(harness#88 注入纪律:core 不 value-import 知识层)。
|
|
33
35
|
*/
|
|
34
36
|
|
|
35
37
|
import * as fs from 'fs';
|
|
36
38
|
import * as path from 'path';
|
|
37
39
|
import * as readline from 'readline';
|
|
38
40
|
import { log, logError, processIO, type CommandIO, type CommandResult } from '../command-contract';
|
|
39
|
-
import * as yaml from 'js-yaml';
|
|
40
41
|
import chalk from 'chalk';
|
|
41
|
-
import {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
import type { Constraint } from '../../types/constraint';
|
|
42
|
+
import {
|
|
43
|
+
retireConstraint as coreRetireConstraint,
|
|
44
|
+
findRetireTarget,
|
|
45
|
+
type RetireExecuteOptions,
|
|
46
|
+
type RetireResult,
|
|
47
|
+
} from '../../core/constraint-lifecycle';
|
|
48
48
|
import { openKnowledgeStore } from './knowledge-view';
|
|
49
49
|
import { fileStateIO } from '../state-io';
|
|
50
50
|
import {
|
|
51
51
|
buildConstraintsUsageReport,
|
|
52
52
|
CANDIDATE_KIND_LABEL,
|
|
53
|
-
collectUsageByConstraint,
|
|
54
|
-
readProjectTraces,
|
|
55
53
|
readProjectTracesReport,
|
|
56
54
|
WATCHLIST_PERIOD_DAYS,
|
|
57
55
|
} from '../../core/constraints/usage-report';
|
|
58
56
|
|
|
59
|
-
export
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export type RetireStatus = 'retired' | 'already_retired' | 'unknown_id';
|
|
69
|
-
|
|
70
|
-
export interface RetireResult {
|
|
71
|
-
id: string;
|
|
72
|
-
status: RetireStatus;
|
|
73
|
-
/** 是否 severity='error'(交互模式据此追加确认) */
|
|
74
|
-
isError: boolean;
|
|
75
|
-
stats: { total: number; fail: number; failRate: number };
|
|
76
|
-
/** KnowledgeStore 条目 id(status='retired' 时存在) */
|
|
77
|
-
knowledgeEntryId?: string;
|
|
78
|
-
/** 退役记录实际落盘的知识库根(status='retired' 时存在,harness#177) */
|
|
79
|
-
knowledgeBaseDir?: string;
|
|
80
|
-
}
|
|
57
|
+
export type {
|
|
58
|
+
RetireExecuteOptions,
|
|
59
|
+
RetireStatus,
|
|
60
|
+
RetireResult,
|
|
61
|
+
RetireTargetInfo,
|
|
62
|
+
} from '../../core/constraint-lifecycle';
|
|
63
|
+
export { findRetireTarget } from '../../core/constraint-lifecycle';
|
|
81
64
|
|
|
82
65
|
export interface ConstraintsRetireOptions {
|
|
83
66
|
projectPath?: string;
|
|
@@ -86,101 +69,21 @@ export interface ConstraintsRetireOptions {
|
|
|
86
69
|
yes?: boolean;
|
|
87
70
|
}
|
|
88
71
|
|
|
89
|
-
export interface RetireTargetInfo {
|
|
90
|
-
severity: Constraint['severity'];
|
|
91
|
-
description?: string;
|
|
92
|
-
rule?: string;
|
|
93
|
-
message?: string;
|
|
94
|
-
/** 约束来源(ADR-0033):app 层退休沉淀条目 tags 加 source:app */
|
|
95
|
-
source?: Constraint['source'];
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* 查找约束定义(内置 definitions + 应用层 constraints.yml,ADR-0033)
|
|
100
|
-
*
|
|
101
|
-
* loader 由调用方给(一次退役一份观察面,见 retireConstraint):本函数只读它的装载结果,
|
|
102
|
-
* 不再自造 ProjectConfigLoader。应用层查找经 target 参数(项目根路径或观察面),
|
|
103
|
-
* 不传 = 只查内置(历史行为)。
|
|
104
|
-
*
|
|
105
|
-
* 导出给 constraints-reactivate 复用(复活同样认内置 + 应用层 check 约束)。
|
|
106
|
-
*/
|
|
107
|
-
export function findRetireTarget(id: string, target?: RunTarget): RetireTargetInfo | undefined {
|
|
108
|
-
const builtIn = getConstraint(id);
|
|
109
|
-
if (builtIn) {
|
|
110
|
-
return {
|
|
111
|
-
severity: builtIn.severity,
|
|
112
|
-
description: builtIn.description,
|
|
113
|
-
rule: builtIn.rule,
|
|
114
|
-
message: builtIn.message,
|
|
115
|
-
source: 'builtin',
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
if (target !== undefined) {
|
|
119
|
-
const app = loadAppConstraints(target).find(c => c.id === id);
|
|
120
|
-
if (app) {
|
|
121
|
-
return {
|
|
122
|
-
severity: app.severity,
|
|
123
|
-
description: app.description,
|
|
124
|
-
rule: app.rule,
|
|
125
|
-
message: app.message,
|
|
126
|
-
source: 'app',
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return undefined;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
72
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* 文件名)。落盘字节由 `__tests__/constraints-retire.test.ts`
|
|
138
|
-
* 的逐字节冻结用例钉住——合并属内部重构,对外产物不得漂移。
|
|
139
|
-
*
|
|
140
|
-
* 导出给 constraints-disable 复用(裸禁用写 `{ enabled: false }` 同一读-改-写口径)。
|
|
73
|
+
* CLI 侧 wired 包装:core retireConstraint + 知识沉淀写口接线
|
|
74
|
+
* (openKnowledgeStore 同一解析点:KNOWLEDGE_BASE_DIR / 用户 home 缺省目录,harness#177)。
|
|
75
|
+
* 库消费方请直接用包根导出的 retireConstraint,按需注入 openKnowledgeStore。
|
|
141
76
|
*/
|
|
142
|
-
export function
|
|
143
|
-
|
|
144
|
-
label: string,
|
|
145
|
-
section: string,
|
|
77
|
+
export function retireConstraint(
|
|
78
|
+
projectRoot: string,
|
|
146
79
|
id: string,
|
|
147
|
-
|
|
148
|
-
):
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
raw = (yaml.load(original) as Record<string, unknown>) ?? {};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
const entries = (raw[section] ?? {}) as Record<string, unknown>;
|
|
158
|
-
const prev = (entries[id] ?? {}) as Record<string, unknown>;
|
|
159
|
-
entries[id] = { ...prev, ...patch };
|
|
160
|
-
raw[section] = entries;
|
|
161
|
-
|
|
162
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
163
|
-
fs.writeFileSync(filePath, yaml.dump(raw, { lineWidth: 120 }), 'utf-8');
|
|
164
|
-
|
|
165
|
-
if (hadComments) {
|
|
166
|
-
console.log(chalk.yellow(` ⚠️ ${label} 已重写:js-yaml 不保留原文件注释`));
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* YAML 条目的删除单点(constraints reactivate 用,与 setYamlEntry 同一读-改-写口径)
|
|
172
|
-
*
|
|
173
|
-
* 删除 config.yml `section.id` 整个 key;段/条目不存在时零写盘。返回是否实际删除。
|
|
174
|
-
*/
|
|
175
|
-
export function removeYamlEntry(filePath: string, section: string, id: string): boolean {
|
|
176
|
-
if (!fs.existsSync(filePath)) return false;
|
|
177
|
-
const raw = (yaml.load(fs.readFileSync(filePath, 'utf-8')) as Record<string, unknown>) ?? {};
|
|
178
|
-
const entries = (raw[section] ?? {}) as Record<string, unknown>;
|
|
179
|
-
if (!(id in entries)) return false;
|
|
180
|
-
delete entries[id];
|
|
181
|
-
raw[section] = entries;
|
|
182
|
-
fs.writeFileSync(filePath, yaml.dump(raw, { lineWidth: 120 }), 'utf-8');
|
|
183
|
-
return true;
|
|
80
|
+
options: RetireExecuteOptions = {}
|
|
81
|
+
): RetireResult {
|
|
82
|
+
return coreRetireConstraint(projectRoot, id, {
|
|
83
|
+
...options,
|
|
84
|
+
openKnowledgeStore:
|
|
85
|
+
options.openKnowledgeStore ?? (() => openKnowledgeStore({}, options.io ?? processIO)),
|
|
86
|
+
});
|
|
184
87
|
}
|
|
185
88
|
|
|
186
89
|
/**
|
|
@@ -192,149 +95,6 @@ export function logCommitHint(projectRoot: string, io: CommandIO): void {
|
|
|
192
95
|
log(io, chalk.gray(' 提示:config.yml 已改未提交——git add .harness/config.yml && git commit(下游审卡通道会自动 commit)'));
|
|
193
96
|
}
|
|
194
97
|
|
|
195
|
-
/**
|
|
196
|
-
* 写 KnowledgeStore 退役记录(consumptionMode: 'signal')
|
|
197
|
-
*
|
|
198
|
-
* baseDir 走 openKnowledgeStore 同一解析点(harness#177):缺省与 knowledge 读口同根,
|
|
199
|
-
* 不再硬编码 projectRoot 拼接(那会写进没有任何默认读口的 <repo>/.harness/knowledge)。
|
|
200
|
-
*/
|
|
201
|
-
function saveRetireKnowledge(
|
|
202
|
-
id: string,
|
|
203
|
-
target: RetireTargetInfo,
|
|
204
|
-
reason: string,
|
|
205
|
-
stats: { total: number; fail: number; failRate: number },
|
|
206
|
-
iso: string,
|
|
207
|
-
io: CommandIO
|
|
208
|
-
): { entryId: string; baseDir: string } {
|
|
209
|
-
const entryId = `constraint-retired-${id}`;
|
|
210
|
-
const contentLines = [
|
|
211
|
-
`# 约束退役:${id}`,
|
|
212
|
-
'',
|
|
213
|
-
'## 规则原文',
|
|
214
|
-
'',
|
|
215
|
-
target.description ? `description: ${target.description}` : undefined,
|
|
216
|
-
target.rule ? `rule: ${target.rule}` : undefined,
|
|
217
|
-
target.message ? `message: ${target.message}` : undefined,
|
|
218
|
-
'',
|
|
219
|
-
'## 退役原因',
|
|
220
|
-
'',
|
|
221
|
-
reason || '(未填写)',
|
|
222
|
-
'',
|
|
223
|
-
'## 历史统计',
|
|
224
|
-
'',
|
|
225
|
-
`- total: ${stats.total}`,
|
|
226
|
-
`- fail: ${stats.fail}`,
|
|
227
|
-
`- failRate: ${Math.round(stats.failRate * 100)}%`,
|
|
228
|
-
'',
|
|
229
|
-
`退役日期: ${iso}`,
|
|
230
|
-
].filter((l): l is string => l !== undefined);
|
|
231
|
-
|
|
232
|
-
const entry: KnowledgeEntry = {
|
|
233
|
-
id: entryId,
|
|
234
|
-
type: 'decision',
|
|
235
|
-
title: `约束退役:${id}`,
|
|
236
|
-
content: contentLines.join('\n'),
|
|
237
|
-
maturity: 'verified',
|
|
238
|
-
layer: 'project',
|
|
239
|
-
created: iso,
|
|
240
|
-
lastReferenced: iso,
|
|
241
|
-
contributors: [],
|
|
242
|
-
projects: [],
|
|
243
|
-
// ADR-0033:应用层退休沉淀带 source:app 标签(内置条目不加,历史形状不动)
|
|
244
|
-
tags: [
|
|
245
|
-
'constraint-retired',
|
|
246
|
-
`constraint:${id}`,
|
|
247
|
-
`severity:${target.severity}`,
|
|
248
|
-
...(target.source === 'app' ? ['source:app'] : []),
|
|
249
|
-
],
|
|
250
|
-
applicablePhases: [],
|
|
251
|
-
sourceReferences: [{ timestamp: iso }],
|
|
252
|
-
referencedBy: [],
|
|
253
|
-
executionResults: [],
|
|
254
|
-
consumptionMode: 'signal',
|
|
255
|
-
origin: 'human',
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
const store = openKnowledgeStore({}, io);
|
|
259
|
-
store.save(entry);
|
|
260
|
-
return { entryId, baseDir: store.getBaseDir() };
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* 执行单条约束退役(纯执行逻辑,无交互)
|
|
265
|
-
*
|
|
266
|
-
* 不存在的 id / 已退役的 id 通过 status 返回,由调用方提示。
|
|
267
|
-
*/
|
|
268
|
-
export function retireConstraint(
|
|
269
|
-
projectRoot: string,
|
|
270
|
-
id: string,
|
|
271
|
-
options: RetireExecuteOptions = {}
|
|
272
|
-
): RetireResult {
|
|
273
|
-
const now = options.now ?? new Date();
|
|
274
|
-
const iso = now.toISOString();
|
|
275
|
-
const reason = options.reason ?? '';
|
|
276
|
-
|
|
277
|
-
// 一次退役一份观察面(ADR-0023 决策 2):定义查找与 already_retired 判定共用这一份装载结果。
|
|
278
|
-
const loader = new ProjectConfigLoader(projectRoot);
|
|
279
|
-
loader.load();
|
|
280
|
-
|
|
281
|
-
const target = findRetireTarget(id, projectRoot);
|
|
282
|
-
const emptyStats = { total: 0, fail: 0, failRate: 0 };
|
|
283
|
-
if (!target) {
|
|
284
|
-
return { id, status: 'unknown_id', isError: false, stats: emptyStats };
|
|
285
|
-
}
|
|
286
|
-
const isError = target.severity === 'error';
|
|
287
|
-
|
|
288
|
-
// 已退役保护:只认 retired 墓碑(ADR-0032 决策 6.6,票 02 断点 6)——
|
|
289
|
-
// 裸 enabled:false 是"禁用"不是"退休",落到下面正常退休流程:覆写墓碑 + 补写沉淀,
|
|
290
|
-
// 不让一次裸 disable 吞掉 retire 的知识沉淀。判定谓词唯一实现 = isRetiredTombstone。
|
|
291
|
-
const existing = loader.getConfig().constraints?.[id] as { enabled?: boolean; retired?: unknown } | undefined;
|
|
292
|
-
if (isRetiredTombstone(existing)) {
|
|
293
|
-
return { id, status: 'already_retired', isError, stats: emptyStats };
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
// 历史统计(来自 traces.log)
|
|
297
|
-
// 计数去向:兼容包装 readProjectTraces() 丢计数(harness#100)——落盘的 retire stats 只计
|
|
298
|
-
// 合法记录,把坏行数写进 RetireResult.stats 属形状变更不在本票;本函数按契约「纯执行无交互」
|
|
299
|
-
// 不打印,告知由两条命令入口各自负责(runRetireInteractive 顶部 / constraintsRetire 的 --yes 分支)
|
|
300
|
-
const usage = collectUsageByConstraint(readProjectTraces(projectRoot)).get(id);
|
|
301
|
-
const evaluated = usage ? usage.total - usage.skip : 0;
|
|
302
|
-
const stats = {
|
|
303
|
-
total: usage?.total ?? 0,
|
|
304
|
-
fail: usage?.fail ?? 0,
|
|
305
|
-
failRate: evaluated > 0 ? (usage!.fail / evaluated) : 0,
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
// 1. 落盘退役(config.yml enabled:false + retired 段,原文保留)
|
|
309
|
-
const retiredMeta = { at: iso, reason, stats };
|
|
310
|
-
setYamlEntry(
|
|
311
|
-
path.join(projectRoot, '.harness', 'config.yml'),
|
|
312
|
-
'config.yml',
|
|
313
|
-
'constraints',
|
|
314
|
-
id,
|
|
315
|
-
{ enabled: false, retired: retiredMeta }
|
|
316
|
-
);
|
|
317
|
-
|
|
318
|
-
// 2. KnowledgeStore
|
|
319
|
-
const { entryId: knowledgeEntryId, baseDir: knowledgeBaseDir } = saveRetireKnowledge(
|
|
320
|
-
id,
|
|
321
|
-
target,
|
|
322
|
-
reason,
|
|
323
|
-
stats,
|
|
324
|
-
iso,
|
|
325
|
-
options.io ?? processIO
|
|
326
|
-
);
|
|
327
|
-
|
|
328
|
-
return {
|
|
329
|
-
id,
|
|
330
|
-
status: 'retired',
|
|
331
|
-
isError,
|
|
332
|
-
stats,
|
|
333
|
-
knowledgeEntryId,
|
|
334
|
-
knowledgeBaseDir,
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
|
|
338
98
|
/**
|
|
339
99
|
* 打印单条退役结果(含回滚语义提示)
|
|
340
100
|
*/
|
|
@@ -397,8 +157,9 @@ export async function runRetireInteractive(
|
|
|
397
157
|
console.error(chalk.yellow(`⚠️ trace 文件有 ${report.skippedLines} 行损坏已跳过,候选只基于其余合法记录`));
|
|
398
158
|
}
|
|
399
159
|
const { ask, close } = createAsk(io);
|
|
400
|
-
// 退役结果打印走注入流(与 readline
|
|
401
|
-
|
|
160
|
+
// 退役结果打印走注入流(与 readline 提示同一去向);
|
|
161
|
+
// WritableStream.write(chunk: any) 结构化满足 CommandIO 的最小可写接口
|
|
162
|
+
const out: CommandIO = { stdout: io.output, stderr: io.output };
|
|
402
163
|
|
|
403
164
|
try {
|
|
404
165
|
let selectedIds: string[] = [];
|
|
@@ -3,40 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 纯数据导出,不调用 LLM,不访问文件系统(除 definitions.ts)。
|
|
5
5
|
* 供下游消费方获取约束的 hash、计数等元数据。
|
|
6
|
+
*
|
|
7
|
+
* harness#198:元数据函数已搬入 `core/constraints/meta` 并上公共 barrel
|
|
8
|
+
* (消费方免起子进程);本模块是 CLI 薄壳——--json / 文本两种打印形态。
|
|
6
9
|
*/
|
|
7
10
|
|
|
8
|
-
import {
|
|
9
|
-
import { getAllConstraints } from '../../core/constraints/definitions';
|
|
10
|
-
import { getHarnessPackageVersion } from '../../utils/package-version';
|
|
11
|
+
import { getConstraintsMeta } from '../../core/constraints/meta';
|
|
11
12
|
import { log, processIO, type CommandIO, type CommandResult } from '../command-contract';
|
|
12
13
|
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
hash: string;
|
|
16
|
-
counts: { errors: number; warnings: number };
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function getConstraintsMeta(): ConstraintsMeta {
|
|
20
|
-
const constraints = getAllConstraints();
|
|
21
|
-
|
|
22
|
-
const errors = constraints.filter(c => c.severity === 'error');
|
|
23
|
-
const warnings = constraints.filter(c => c.severity === 'warning');
|
|
24
|
-
|
|
25
|
-
// 稳定 JSON 序列化后取 hash(内容面 = id + severity + 规则文本)
|
|
26
|
-
const hashInput = JSON.stringify(
|
|
27
|
-
constraints.map(c => ({ id: c.id, severity: c.severity, rule: c.rule, message: c.message, description: c.description }))
|
|
28
|
-
);
|
|
29
|
-
const hash = createHash('sha256').update(hashInput).digest('hex');
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
version: getHarnessPackageVersion(),
|
|
33
|
-
hash,
|
|
34
|
-
counts: {
|
|
35
|
-
errors: errors.length,
|
|
36
|
-
warnings: warnings.length,
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
}
|
|
14
|
+
export { getConstraintsMeta };
|
|
15
|
+
export type { ConstraintsMeta } from '../../core/constraints/meta';
|
|
40
16
|
|
|
41
17
|
/**
|
|
42
18
|
* CLI handler: output --json
|
|
@@ -83,7 +83,7 @@ export async function contract(
|
|
|
83
83
|
|
|
84
84
|
if (r.details?.breakingChanges) {
|
|
85
85
|
lines.push('', chalk.red('破坏性变更:'));
|
|
86
|
-
(r.details.breakingChanges as
|
|
86
|
+
(r.details.breakingChanges as Array<{ type: string; path: string; description?: string }>).forEach((change) => {
|
|
87
87
|
lines.push(chalk.red(` - ${change.type}: ${change.path}`));
|
|
88
88
|
if (change.description) {
|
|
89
89
|
lines.push(chalk.gray(` ${change.description}`));
|
|
@@ -119,14 +119,28 @@ export async function validateSchema(
|
|
|
119
119
|
const fullPath = path.join(projectPath, contractPath);
|
|
120
120
|
const content = await fs.readFile(fullPath, 'utf-8');
|
|
121
121
|
|
|
122
|
-
let
|
|
122
|
+
let parsed: unknown;
|
|
123
123
|
try {
|
|
124
|
-
|
|
125
|
-
} catch (e:
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
parsed = yaml.load(content);
|
|
125
|
+
} catch (e: unknown) {
|
|
126
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
127
|
+
log(io, chalk.red(`❌ YAML 解析错误: ${message}`));
|
|
128
|
+
return { kind: 'fail', reason: `contract YAML parse error: ${message}` };
|
|
128
129
|
}
|
|
129
130
|
|
|
131
|
+
if (typeof parsed !== 'object' || parsed === null) {
|
|
132
|
+
log(io, chalk.red('❌ Schema 验证失败: 契约文件不是 YAML 对象'));
|
|
133
|
+
return { kind: 'fail', reason: 'contract schema invalid: not a YAML object' };
|
|
134
|
+
}
|
|
135
|
+
const schema = parsed as {
|
|
136
|
+
openapi?: string;
|
|
137
|
+
info?: { title?: string; version?: string };
|
|
138
|
+
paths?: Record<string, Record<string, unknown>>;
|
|
139
|
+
};
|
|
140
|
+
// 校验通过后消费的三处字段取本地常量(校验不收窄类型)
|
|
141
|
+
const info = schema.info;
|
|
142
|
+
const paths = schema.paths;
|
|
143
|
+
|
|
130
144
|
// 基本验证
|
|
131
145
|
const errors: string[] = [];
|
|
132
146
|
|
|
@@ -157,18 +171,19 @@ export async function validateSchema(
|
|
|
157
171
|
log(io);
|
|
158
172
|
log(io, chalk.gray('Schema 信息:'));
|
|
159
173
|
log(io, chalk.gray(` 版本: ${schema.openapi}`));
|
|
160
|
-
log(io, chalk.gray(` 标题: ${
|
|
161
|
-
log(io, chalk.gray(` API 版本: ${
|
|
174
|
+
log(io, chalk.gray(` 标题: ${info?.title}`));
|
|
175
|
+
log(io, chalk.gray(` API 版本: ${info?.version}`));
|
|
162
176
|
|
|
163
|
-
if (
|
|
164
|
-
const endpoints = Object.keys(
|
|
165
|
-
Object.keys(
|
|
177
|
+
if (paths) {
|
|
178
|
+
const endpoints = Object.keys(paths).flatMap(path =>
|
|
179
|
+
Object.keys(paths[path]).map(method => `${method.toUpperCase()} ${path}`)
|
|
166
180
|
);
|
|
167
181
|
log(io, chalk.gray(` 端点数: ${endpoints.length}`));
|
|
168
182
|
}
|
|
169
183
|
return { kind: 'ok' };
|
|
170
|
-
} catch (error:
|
|
171
|
-
|
|
172
|
-
|
|
184
|
+
} catch (error: unknown) {
|
|
185
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
186
|
+
log(io, chalk.red(`❌ 验证失败: ${message}`));
|
|
187
|
+
return { kind: 'fail', reason: `contract schema read error: ${message}` };
|
|
173
188
|
}
|
|
174
189
|
}
|
|
@@ -248,22 +248,23 @@ export const COMMAND_DEFINITIONS: CommandDefinition[] = [
|
|
|
248
248
|
{ flags: '--json', description: 'JSON 格式输出', defaultValue: false },
|
|
249
249
|
],
|
|
250
250
|
subcommands: {
|
|
251
|
-
// 纯投影条目:commander options
|
|
252
|
-
|
|
251
|
+
// 纯投影条目:commander options 与处理器参数同名,原样传入(编组归命令模块)。
|
|
252
|
+
// knowledge/ 目录一子命令一文件(Phase 3 拆分,原 knowledge.ts 单文件 820 行)
|
|
253
|
+
list: { impl: { module: 'knowledge/list', export: 'knowledgeList' }, aliases: ['ls'] },
|
|
253
254
|
search: {
|
|
254
|
-
impl: { module: 'knowledge', export: 'knowledgeSearchCommand' },
|
|
255
|
+
impl: { module: 'knowledge/search', export: 'knowledgeSearchCommand' },
|
|
255
256
|
aliases: ['s'],
|
|
256
257
|
withPositionals: true,
|
|
257
258
|
},
|
|
258
|
-
import: { impl: { module: 'knowledge', export: 'knowledgeImport' }, aliases: ['i'] },
|
|
259
|
-
decay: { impl: { module: 'knowledge', export: 'knowledgeDecay' }, aliases: ['d'] },
|
|
260
|
-
stats: { impl: { module: 'knowledge', export: 'knowledgeStats' }, aliases: ['st'] },
|
|
261
|
-
'sync-rag': { impl: { module: 'knowledge', export: 'knowledgeSyncRag' } },
|
|
262
|
-
audit: { impl: { module: 'knowledge', export: 'knowledgeAudit' }, aliases: ['a'] },
|
|
263
|
-
snapshot: { impl: { module: 'knowledge', export: 'knowledgeSnapshot' } },
|
|
264
|
-
migrate: { impl: { module: 'knowledge', export: 'knowledgeMigrate' } },
|
|
265
|
-
index: { impl: { module: 'knowledge', export: 'knowledgeIndex' }, aliases: ['idx'] },
|
|
266
|
-
health: { impl: { module: 'knowledge', export: 'knowledgeHealth' }, aliases: ['h'] },
|
|
259
|
+
import: { impl: { module: 'knowledge/import', export: 'knowledgeImport' }, aliases: ['i'] },
|
|
260
|
+
decay: { impl: { module: 'knowledge/decay', export: 'knowledgeDecay' }, aliases: ['d'] },
|
|
261
|
+
stats: { impl: { module: 'knowledge/stats', export: 'knowledgeStats' }, aliases: ['st'] },
|
|
262
|
+
'sync-rag': { impl: { module: 'knowledge/sync-rag', export: 'knowledgeSyncRag' } },
|
|
263
|
+
audit: { impl: { module: 'knowledge/audit', export: 'knowledgeAudit' }, aliases: ['a'] },
|
|
264
|
+
snapshot: { impl: { module: 'knowledge/snapshot', export: 'knowledgeSnapshot' } },
|
|
265
|
+
migrate: { impl: { module: 'knowledge/migrate', export: 'knowledgeMigrate' } },
|
|
266
|
+
index: { impl: { module: 'knowledge/index', export: 'knowledgeIndex' }, aliases: ['idx'] },
|
|
267
|
+
health: { impl: { module: 'knowledge/health', export: 'knowledgeHealth' }, aliases: ['h'] },
|
|
267
268
|
},
|
|
268
269
|
},
|
|
269
270
|
{
|