@dommaker/harness 1.14.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +4 -2
- package/bin/harness.js +6 -0
- package/dist/cli/command-contract.d.ts +4 -4
- package/dist/cli/command-contract.d.ts.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 +44 -0
- package/dist/cli/commands/constraints-disable.d.ts.map +1 -0
- package/dist/cli/commands/constraints-disable.js +84 -0
- package/dist/cli/commands/constraints-disable.js.map +1 -0
- package/dist/cli/commands/constraints-pack-proposal.d.ts +8 -21
- package/dist/cli/commands/constraints-pack-proposal.d.ts.map +1 -1
- package/dist/cli/commands/constraints-pack-proposal.js +22 -130
- 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 -103
- package/dist/cli/commands/constraints-reactivate.js.map +1 -1
- package/dist/cli/commands/constraints-retire.d.ts +14 -60
- package/dist/cli/commands/constraints-retire.d.ts.map +1 -1
- package/dist/cli/commands/constraints-retire.js +22 -195
- package/dist/cli/commands/constraints-retire.js.map +1 -1
- package/dist/cli/commands/constraints.d.ts +7 -10
- package/dist/cli/commands/constraints.d.ts.map +1 -1
- package/dist/cli/commands/constraints.js +8 -22
- package/dist/cli/commands/constraints.js.map +1 -1
- package/dist/cli/commands/definitions.d.ts.map +1 -1
- package/dist/cli/commands/definitions.js +16 -1
- package/dist/cli/commands/definitions.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +4 -19
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/knowledge-view.d.ts +3 -3
- package/dist/cli/commands/knowledge-view.js +4 -4
- package/dist/cli/commands/knowledge-view.js.map +1 -1
- package/dist/cli/commands/knowledge.js +1 -1
- package/dist/cli/commands/knowledge.js.map +1 -1
- package/dist/cli/commands/release.d.ts +2 -2
- package/dist/cli/commands/release.js +2 -2
- 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/sync-docs/agents-syncer.js +2 -4
- package/dist/cli/commands/sync-docs/agents-syncer.js.map +1 -1
- 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 +30 -0
- package/dist/cli/commands/sync-docs/context-syncer.js.map +1 -1
- package/dist/cli/commands/sync-docs/head-gate.d.ts +34 -0
- package/dist/cli/commands/sync-docs/head-gate.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/head-gate.js +86 -0
- package/dist/cli/commands/sync-docs/head-gate.js.map +1 -0
- package/dist/cli/commands/sync-docs/index.d.ts +8 -1
- package/dist/cli/commands/sync-docs/index.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/index.js +81 -5
- package/dist/cli/commands/sync-docs/index.js.map +1 -1
- package/dist/cli/commands/sync-docs/project-reader.d.ts +5 -0
- package/dist/cli/commands/sync-docs/project-reader.d.ts.map +1 -1
- 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.js +1 -1
- package/dist/cli/gate-command.js.map +1 -1
- package/dist/completion-checkers/contract-presence.d.ts +1 -1
- package/dist/completion-checkers/contract-presence.js +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 -3
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +2 -6
- package/dist/context/index.js.map +1 -1
- package/dist/context/knowledge-injector.d.ts.map +1 -1
- package/dist/context/knowledge-injector.js +3 -4
- package/dist/context/knowledge-injector.js.map +1 -1
- package/dist/context/session-manager.d.ts +0 -6
- package/dist/context/session-manager.d.ts.map +1 -1
- package/dist/context/session-manager.js +0 -9
- package/dist/context/session-manager.js.map +1 -1
- package/dist/context/types.d.ts +0 -24
- 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.js +1 -1
- package/dist/core/constraints/check-cache.d.ts +1 -1
- package/dist/core/constraints/check-cache.js +1 -1
- package/dist/core/constraints/checker.d.ts +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/capability-sync.d.ts +1 -1
- package/dist/core/constraints/checkers/capability-sync.js +1 -1
- package/dist/core/constraints/checkers/docs-freshness.js +1 -1
- package/dist/core/constraints/checkers/docs-freshness.js.map +1 -1
- package/dist/core/constraints/checkers/governance-presence.d.ts +1 -1
- package/dist/core/constraints/checkers/governance-presence.js +1 -1
- package/dist/core/constraints/checkers/index.d.ts.map +1 -1
- package/dist/core/constraints/checkers/index.js +2 -2
- package/dist/core/constraints/checkers/index.js.map +1 -1
- package/dist/core/constraints/checkers/no-completion-without-verification.d.ts +39 -0
- package/dist/core/constraints/checkers/no-completion-without-verification.d.ts.map +1 -0
- package/dist/core/constraints/checkers/no-completion-without-verification.js +173 -0
- package/dist/core/constraints/checkers/no-completion-without-verification.js.map +1 -0
- package/dist/core/constraints/checkers/no-hardcoded-credentials.d.ts +3 -2
- package/dist/core/constraints/checkers/no-hardcoded-credentials.d.ts.map +1 -1
- package/dist/core/constraints/checkers/no-hardcoded-credentials.js +19 -7
- package/dist/core/constraints/checkers/no-hardcoded-credentials.js.map +1 -1
- package/dist/core/constraints/checkers/templated/file-exists.js +1 -1
- 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/checkers/types.d.ts +1 -1
- package/dist/core/constraints/checkers/types.js +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 +0 -17
- package/dist/core/constraints/context-builder.js.map +1 -1
- package/dist/core/constraints/definitions/guidelines.js +1 -1
- package/dist/core/constraints/definitions/iron-laws.js +2 -2
- package/dist/core/constraints/definitions/iron-laws.js.map +1 -1
- package/dist/core/constraints/definitions.d.ts +1 -1
- package/dist/core/constraints/definitions.js +1 -1
- package/dist/core/constraints/doc-freshness/runner.d.ts.map +1 -1
- package/dist/core/constraints/doc-freshness/runner.js +3 -1
- package/dist/core/constraints/doc-freshness/runner.js.map +1 -1
- package/dist/core/constraints/index.d.ts +1 -3
- 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/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/run-env.d.ts +3 -2
- package/dist/core/constraints/run-env.d.ts.map +1 -1
- package/dist/core/constraints/run-env.js +5 -4
- package/dist/core/constraints/run-env.js.map +1 -1
- package/dist/core/constraints/usage-report.d.ts +3 -6
- package/dist/core/constraints/usage-report.d.ts.map +1 -1
- package/dist/core/constraints/usage-report.js +6 -13
- package/dist/core/constraints/usage-report.js.map +1 -1
- package/dist/core/effective-constraints.d.ts +7 -7
- package/dist/core/effective-constraints.d.ts.map +1 -1
- package/dist/core/effective-constraints.js +7 -7
- 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/retired-constraints.d.ts +66 -0
- package/dist/core/retired-constraints.d.ts.map +1 -0
- package/dist/core/retired-constraints.js +52 -0
- package/dist/core/retired-constraints.js.map +1 -0
- package/dist/core/validators/check-handlers/command.d.ts.map +1 -1
- package/dist/core/validators/check-handlers/command.js +42 -4
- package/dist/core/validators/check-handlers/command.js.map +1 -1
- package/dist/core/validators/checkpoint.d.ts +4 -2
- package/dist/core/validators/checkpoint.d.ts.map +1 -1
- package/dist/core/validators/checkpoint.js +4 -2
- package/dist/core/validators/checkpoint.js.map +1 -1
- package/dist/core/validators/passes-gate.d.ts +2 -2
- package/dist/core/validators/passes-gate.d.ts.map +1 -1
- package/dist/core/validators/passes-gate.js +4 -3
- package/dist/core/validators/passes-gate.js.map +1 -1
- package/dist/gates/checker-gate.d.ts +4 -3
- package/dist/gates/checker-gate.d.ts.map +1 -1
- package/dist/gates/checker-gate.js +4 -3
- 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/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/index.d.ts +6 -40
- package/dist/gates/index.d.ts.map +1 -1
- package/dist/gates/index.js +5 -79
- package/dist/gates/index.js.map +1 -1
- package/dist/gates/registry.js +1 -1
- package/dist/gates/registry.js.map +1 -1
- package/dist/gates/types.d.ts +10 -3
- package/dist/gates/types.d.ts.map +1 -1
- package/dist/index.d.ts +19 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -67
- package/dist/index.js.map +1 -1
- package/dist/knowledge/audit-scoring.js +1 -1
- package/dist/knowledge/audit-scoring.js.map +1 -1
- package/dist/knowledge/index.d.ts +1 -3
- package/dist/knowledge/index.d.ts.map +1 -1
- package/dist/knowledge/index.js +3 -5
- package/dist/knowledge/index.js.map +1 -1
- package/dist/knowledge/query.d.ts +1 -1
- package/dist/knowledge/query.d.ts.map +1 -1
- package/dist/knowledge/query.js +12 -15
- package/dist/knowledge/query.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 +2 -11
- package/dist/monitoring/trace-analyzer.js.map +1 -1
- package/dist/monitoring/traces.d.ts +15 -11
- package/dist/monitoring/traces.d.ts.map +1 -1
- package/dist/monitoring/traces.js +44 -48
- 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 +7 -7
- package/dist/pretool-use-hook.js.map +1 -1
- package/dist/release/integrity.d.ts +4 -4
- package/dist/release/integrity.d.ts.map +1 -1
- package/dist/release/integrity.js +4 -6
- package/dist/release/integrity.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/test-setup/mkdtemp-cleanup.js +1 -1
- package/dist/types/constraint.d.ts +1 -7
- package/dist/types/constraint.d.ts.map +1 -1
- package/dist/types/constraint.js.map +1 -1
- package/dist/types/passes-gate.d.ts +7 -0
- package/dist/types/passes-gate.d.ts.map +1 -1
- package/dist/types/passes-gate.js +8 -0
- package/dist/types/passes-gate.js.map +1 -1
- package/dist/utils/detect-source-roots.d.ts +1 -1
- package/dist/utils/detect-source-roots.d.ts.map +1 -1
- package/dist/utils/detect-source-roots.js +2 -21
- package/dist/utils/detect-source-roots.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/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 -3
- package/src/CONTEXT.md +14 -7
- package/src/__tests__/acceptance-gate.test.ts +2 -4
- package/src/__tests__/checker-extra.test.ts +32 -9
- package/src/__tests__/checker-primitives-sdk.test.ts +2 -2
- package/src/__tests__/checker.test.ts +16 -14
- package/src/__tests__/detect-source-roots.test.ts +5 -4
- package/src/__tests__/effective-constraints.test.ts +16 -0
- package/src/__tests__/exec-checker-full-chain.test.ts +3 -3
- package/src/__tests__/iron-laws.test.ts +13 -20
- package/src/__tests__/layering.test.ts +2 -3
- package/src/__tests__/no-studio-references.test.ts +62 -0
- package/src/__tests__/passes-gate-check.test.ts +1 -1
- package/src/__tests__/pretool-use-hook.test.ts +5 -5
- package/src/__tests__/public-exports.test.ts +196 -41
- package/src/__tests__/public-type-surface.test.ts +27 -67
- package/src/__tests__/public-value-surface.test.ts +13 -36
- package/src/__tests__/retired-constraints.test.ts +99 -0
- package/src/__tests__/skip-semantics.test.ts +16 -33
- package/src/__tests__/trace-analyzer-extra.test.ts +1 -13
- package/src/__tests__/usage-report-public-export.test.ts +3 -3
- package/src/agents/CONTEXT.md +4 -4
- package/src/cli/__tests__/gate-command.test.ts +1 -1
- package/src/cli/command-contract.ts +4 -4
- package/src/cli/commands/CONTEXT.md +10 -9
- package/src/cli/commands/__tests__/check-read-count.test.ts +3 -0
- package/src/cli/commands/__tests__/check.test.ts +33 -6
- package/src/cli/commands/__tests__/command.test.ts +2 -2
- package/src/cli/commands/__tests__/constraints-disable.test.ts +229 -0
- package/src/cli/commands/__tests__/constraints-report-json-flag.test.ts +1 -1
- package/src/cli/commands/__tests__/constraints-report.test.ts +4 -4
- package/src/cli/commands/__tests__/knowledge-flywheel-consistency.test.ts +1 -1
- package/src/cli/commands/__tests__/knowledge-view.test.ts +1 -1
- package/src/cli/commands/__tests__/knowledge.test.ts +3 -3
- package/src/cli/commands/__tests__/project-path-anchoring.test.ts +4 -1
- package/src/cli/commands/__tests__/project-path-convention.test.ts +4 -36
- package/src/cli/commands/__tests__/spec-baseline-index-cap.test.ts +1 -1
- package/src/cli/commands/__tests__/sync-docs-agents.test.ts +1 -24
- package/src/cli/commands/__tests__/sync-docs-construction-sites.test.ts +175 -0
- package/src/cli/commands/__tests__/sync-docs-gate.test.ts +154 -0
- package/src/cli/commands/__tests__/sync-docs-table-layout.test.ts +1 -1
- package/src/cli/commands/__tests__/sync-docs.test.ts +3 -3
- package/src/cli/commands/__tests__/validate.test.ts +49 -0
- package/src/cli/commands/command.ts +2 -1
- package/src/cli/commands/constraints-disable.ts +94 -0
- package/src/cli/commands/constraints-pack-proposal.ts +27 -122
- package/src/cli/commands/constraints-reactivate.ts +22 -111
- package/src/cli/commands/constraints-retire.ts +33 -270
- package/src/cli/commands/constraints.ts +7 -31
- package/src/cli/commands/definitions.ts +16 -1
- package/src/cli/commands/init.ts +5 -19
- package/src/cli/commands/knowledge-view.ts +4 -4
- package/src/cli/commands/knowledge.ts +1 -1
- package/src/cli/commands/release.ts +2 -2
- package/src/cli/commands/scaffold-templates.ts +23 -0
- package/src/cli/commands/security.ts +1 -1
- package/src/cli/commands/sync-docs/__tests__/construction-site-count.test.ts +49 -0
- package/src/cli/commands/sync-docs/agents-syncer.ts +2 -4
- package/src/cli/commands/sync-docs/context-syncer.ts +43 -1
- package/src/cli/commands/sync-docs/head-gate.ts +87 -0
- package/src/cli/commands/sync-docs/index.ts +103 -6
- package/src/cli/commands/sync-docs/project-reader.ts +5 -0
- package/src/cli/commands/validate.ts +7 -0
- package/src/cli/gate-command.ts +1 -1
- package/src/completion-checkers/CONTEXT.md +3 -3
- package/src/completion-checkers/contract-presence.ts +1 -1
- package/src/completion-checkers/glob-match.ts +3 -35
- package/src/context/CONTEXT.md +5 -8
- package/src/context/__tests__/knowledge-injector.test.ts +21 -2
- package/src/context/__tests__/session-manager.test.ts +0 -7
- package/src/context/index.ts +1 -5
- package/src/context/knowledge-injector.ts +3 -4
- package/src/context/session-manager.ts +0 -10
- package/src/context/types.ts +0 -20
- package/src/core/CONTEXT.md +13 -7
- 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__/capabilities-reconcile.test.ts +1 -1
- package/src/core/constraints/__tests__/check-cache.test.ts +1 -8
- package/src/core/constraints/__tests__/collect-constraints.test.ts +67 -18
- 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__/run-env.test.ts +7 -7
- package/src/core/constraints/__tests__/trace-injection.test.ts +22 -17
- package/src/core/constraints/__tests__/usage-report.test.ts +9 -0
- package/src/core/constraints/capabilities-parser.ts +1 -1
- package/src/core/constraints/check-cache.ts +1 -1
- package/src/core/constraints/checker.ts +20 -1
- package/src/core/constraints/checkers/__tests__/fixtures/public-repo-sanitization.mjs +1 -1
- package/src/core/constraints/checkers/__tests__/governance-presence.test.ts +1 -1
- package/src/core/constraints/checkers/__tests__/input-contract.test.ts +3 -3
- package/src/core/constraints/checkers/__tests__/no-completion-without-verification.test.ts +227 -0
- package/src/core/constraints/checkers/__tests__/no-hardcoded-credentials.test.ts +68 -36
- package/src/core/constraints/checkers/capability-sync.ts +1 -1
- package/src/core/constraints/checkers/docs-freshness.ts +1 -1
- package/src/core/constraints/checkers/governance-presence.ts +1 -1
- package/src/core/constraints/checkers/index.ts +1 -3
- package/src/core/constraints/checkers/no-completion-without-verification.ts +141 -0
- package/src/core/constraints/checkers/no-hardcoded-credentials.ts +20 -7
- package/src/core/constraints/checkers/templated/file-exists.ts +1 -1
- package/src/core/constraints/checkers/templated/glob.ts +3 -36
- package/src/core/constraints/checkers/types.ts +1 -1
- package/src/core/constraints/construction-sites.ts +95 -0
- package/src/core/constraints/context-builder.ts +0 -18
- package/src/core/constraints/definitions/guidelines.ts +1 -1
- package/src/core/constraints/definitions/iron-laws.ts +2 -2
- package/src/core/constraints/definitions.ts +1 -1
- package/src/core/constraints/doc-freshness/__tests__/runner.test.ts +3 -3
- package/src/core/constraints/doc-freshness/runner.ts +4 -1
- package/src/core/constraints/index.ts +0 -5
- package/src/core/constraints/meta.ts +40 -0
- package/src/core/constraints/pack-proposal.ts +179 -0
- package/src/core/constraints/run-env.ts +6 -5
- package/src/core/constraints/usage-report.ts +5 -13
- package/src/core/effective-constraints.ts +7 -7
- package/src/core/index.ts +0 -16
- package/src/core/retired-constraints.ts +77 -0
- package/src/core/validators/__tests__/command-success-output.test.ts +56 -0
- package/src/core/validators/check-handlers/command.ts +44 -4
- package/src/core/validators/checkpoint.ts +4 -2
- package/src/core/validators/passes-gate.ts +4 -3
- package/src/gates/CONTEXT.md +22 -14
- package/src/gates/__tests__/acceptance-types-single-source.test.ts +7 -6
- package/src/gates/__tests__/acceptance.test.ts +3 -5
- package/src/gates/__tests__/checker-gate.test.ts +3 -3
- package/src/gates/__tests__/command.test.ts +1 -13
- package/src/gates/__tests__/decision.test.ts +35 -0
- package/src/gates/checker-gate.ts +4 -3
- package/src/gates/command.ts +4 -38
- package/src/gates/definitions.ts +2 -2
- package/src/gates/index.ts +8 -95
- package/src/gates/registry.ts +1 -1
- package/src/gates/types.ts +11 -3
- package/src/hooks/CONTEXT.md +3 -3
- package/src/index.ts +59 -98
- package/src/knowledge/CONTEXT.md +8 -6
- package/src/knowledge/__tests__/audit.test.ts +1 -1
- package/src/knowledge/__tests__/flywheel-metrics.test.ts +1 -1
- package/src/knowledge/__tests__/token-estimate.test.ts +54 -0
- package/src/knowledge/audit-scoring.ts +1 -1
- package/src/knowledge/index.ts +1 -3
- package/src/knowledge/query.ts +13 -14
- package/src/knowledge/token-estimate.ts +27 -0
- package/src/monitoring/CONTEXT.md +7 -9
- package/src/monitoring/__tests__/prune-trace-logs.test.ts +76 -0
- package/src/monitoring/__tests__/skipped-lines-report.test.ts +2 -2
- package/src/monitoring/__tests__/traces.test.ts +2 -18
- package/src/monitoring/analyzer-base.ts +0 -18
- package/src/monitoring/index.ts +2 -7
- package/src/monitoring/trace-analyzer.ts +2 -10
- package/src/monitoring/traces.ts +54 -54
- package/src/pretool-use-hook.ts +7 -7
- package/src/release/CONTEXT.md +4 -4
- package/src/release/__tests__/integrity.test.ts +3 -5
- package/src/release/integrity.ts +4 -6
- package/src/test-setup/__tests__/mkdtemp-cleanup.test.ts +1 -1
- package/src/test-setup/jsonl-fake-fs.ts +1 -1
- package/src/test-setup/mkdtemp-cleanup.ts +1 -1
- package/src/types/constraint.ts +1 -8
- package/src/types/passes-gate.ts +8 -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__/yaml-edit.test.ts +62 -0
- package/src/utils/detect-source-roots.ts +2 -20
- package/src/utils/glob-match.ts +41 -0
- package/src/utils/jsonl.ts +1 -1
- package/src/utils/yaml-edit.ts +67 -0
- package/bin/harness-knowledge-track.sh +0 -47
- package/bin/harness-sensitive-check.sh +0 -67
- 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/core/constraints/checkers/iron-flags.d.ts +0 -12
- package/dist/core/constraints/checkers/iron-flags.d.ts.map +0 -1
- package/dist/core/constraints/checkers/iron-flags.js +0 -16
- package/dist/core/constraints/checkers/iron-flags.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 -60
- 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 -55
- 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 -62
- 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 -125
- package/dist/tools/definitions/std/evolution/prioritize.yml +0 -112
- package/dist/tools/definitions/std/evolution/report-gap.yml +0 -166
- 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 -79
- package/dist/tools/definitions/std/governance/audit-task.yml +0 -178
- package/dist/tools/definitions/std/governance/cast-vote.yml +0 -129
- 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 -101
- package/dist/tools/definitions/std/governance/define-stance.sh +0 -243
- package/dist/tools/definitions/std/governance/define-stance.yml +0 -82
- package/dist/tools/definitions/std/governance/generate-review-report.yml +0 -23
- package/dist/tools/definitions/std/governance/impeach.yml +0 -179
- package/dist/tools/definitions/std/governance/multi-stance-review.yml +0 -154
- 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 -186
- package/dist/tools/definitions/std/governance/stance-review.yml +0 -149
- package/dist/tools/definitions/std/governance/track-effect.yml +0 -199
- package/dist/tools/definitions/std/governance/vote-tally.yml +0 -144
- 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 -481
- package/dist/tools/definitions/std/planning/split-tasks.yml +0 -359
- 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 +0 -51
- package/dist/tools/paths.js.map +0 -1
- package/src/__tests__/token-budget.test.ts +0 -252
- package/src/context/__tests__/token-budget.test.ts +0 -258
- package/src/context/token-budget.ts +0 -222
- package/src/core/constraints/checkers/__tests__/iron-flags.test.ts +0 -43
- package/src/core/constraints/checkers/iron-flags.ts +0 -17
- package/src/gates/__tests__/runner.test.ts +0 -81
- 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 -60
- 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 -55
- 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 -62
- 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 -125
- package/src/tools/definitions/std/evolution/prioritize.yml +0 -112
- package/src/tools/definitions/std/evolution/report-gap.yml +0 -166
- 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 -79
- package/src/tools/definitions/std/governance/audit-task.yml +0 -178
- package/src/tools/definitions/std/governance/cast-vote.yml +0 -129
- 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 -101
- package/src/tools/definitions/std/governance/define-stance.sh +0 -243
- package/src/tools/definitions/std/governance/define-stance.yml +0 -82
- package/src/tools/definitions/std/governance/generate-review-report.yml +0 -23
- package/src/tools/definitions/std/governance/impeach.yml +0 -179
- package/src/tools/definitions/std/governance/multi-stance-review.yml +0 -154
- 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 -186
- package/src/tools/definitions/std/governance/stance-review.yml +0 -149
- package/src/tools/definitions/std/governance/track-effect.yml +0 -199
- package/src/tools/definitions/std/governance/vote-tally.yml +0 -144
- 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 -481
- package/src/tools/definitions/std/planning/split-tasks.yml +0 -359
- 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
- package/templates/nextjs-app/.github/workflows/ci.yml +0 -39
- package/templates/node-api/.github/workflows/ci.yml +0 -36
- package/templates/node-api/package.json +0 -23
- package/templates/node-api/src/index.ts +0 -2
- package/templates/node-api/tsconfig.json +0 -19
- package/templates/python-api/.github/workflows/ci.yml +0 -39
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* retired: { at, reason, stats: { total, fail, failRate } }
|
|
13
13
|
*
|
|
14
14
|
* 每条同时写一条 KnowledgeStore 记录(consumptionMode: 'signal')。
|
|
15
|
-
baseDir 不硬编码 projectRoot 拼接,走 openKnowledgeStore 同一解析点(harness#177):
|
|
16
|
-
缺省与 `harness knowledge` 读口同根,KNOWLEDGE_BASE_DIR 覆盖对写口同步生效。
|
|
15
|
+
* baseDir 不硬编码 projectRoot 拼接,走 openKnowledgeStore 同一解析点(harness#177):
|
|
16
|
+
* 缺省与 `harness knowledge` 读口同根,KNOWLEDGE_BASE_DIR 覆盖对写口同步生效。
|
|
17
17
|
*
|
|
18
18
|
* ADR-0029:custom 纯文本约束与治理注入段同步已随文本注入层关停一并退役。
|
|
19
19
|
* ADR-0032 观察名单(块 3 子项 4):零拦截命中先进观察名单(`.harness/.state.json`
|
|
@@ -28,55 +28,39 @@ baseDir 不硬编码 projectRoot 拼接,走 openKnowledgeStore 同一解析点
|
|
|
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
|
-
|
|
42
|
+
import {
|
|
43
|
+
retireConstraint as coreRetireConstraint,
|
|
44
|
+
findRetireTarget,
|
|
45
|
+
type RetireExecuteOptions,
|
|
46
|
+
type RetireResult,
|
|
47
|
+
} from '../../core/constraint-lifecycle';
|
|
47
48
|
import { openKnowledgeStore } from './knowledge-view';
|
|
48
49
|
import { fileStateIO } from '../state-io';
|
|
49
50
|
import {
|
|
50
51
|
buildConstraintsUsageReport,
|
|
51
52
|
CANDIDATE_KIND_LABEL,
|
|
52
|
-
collectUsageByConstraint,
|
|
53
|
-
readProjectTraces,
|
|
54
53
|
readProjectTracesReport,
|
|
55
54
|
WATCHLIST_PERIOD_DAYS,
|
|
56
55
|
} from '../../core/constraints/usage-report';
|
|
57
56
|
|
|
58
|
-
export
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export type RetireStatus = 'retired' | 'already_retired' | 'unknown_id';
|
|
68
|
-
|
|
69
|
-
export interface RetireResult {
|
|
70
|
-
id: string;
|
|
71
|
-
status: RetireStatus;
|
|
72
|
-
/** 是否 severity='error'(交互模式据此追加确认) */
|
|
73
|
-
isError: boolean;
|
|
74
|
-
stats: { total: number; fail: number; failRate: number };
|
|
75
|
-
/** KnowledgeStore 条目 id(status='retired' 时存在) */
|
|
76
|
-
knowledgeEntryId?: string;
|
|
77
|
-
/** 退役记录实际落盘的知识库根(status='retired' 时存在,harness#177) */
|
|
78
|
-
knowledgeBaseDir?: string;
|
|
79
|
-
}
|
|
57
|
+
export type {
|
|
58
|
+
RetireExecuteOptions,
|
|
59
|
+
RetireStatus,
|
|
60
|
+
RetireResult,
|
|
61
|
+
RetireTargetInfo,
|
|
62
|
+
} from '../../core/constraint-lifecycle';
|
|
63
|
+
export { findRetireTarget } from '../../core/constraint-lifecycle';
|
|
80
64
|
|
|
81
65
|
export interface ConstraintsRetireOptions {
|
|
82
66
|
projectPath?: string;
|
|
@@ -85,251 +69,30 @@ export interface ConstraintsRetireOptions {
|
|
|
85
69
|
yes?: boolean;
|
|
86
70
|
}
|
|
87
71
|
|
|
88
|
-
export interface RetireTargetInfo {
|
|
89
|
-
severity: Constraint['severity'];
|
|
90
|
-
description?: string;
|
|
91
|
-
rule?: string;
|
|
92
|
-
message?: string;
|
|
93
|
-
/** 约束来源(ADR-0033):app 层退休沉淀条目 tags 加 source:app */
|
|
94
|
-
source?: Constraint['source'];
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* 查找约束定义(内置 definitions + 应用层 constraints.yml,ADR-0033)
|
|
99
|
-
*
|
|
100
|
-
* loader 由调用方给(一次退役一份观察面,见 retireConstraint):本函数只读它的装载结果,
|
|
101
|
-
* 不再自造 ProjectConfigLoader。应用层查找经 target 参数(项目根路径或观察面),
|
|
102
|
-
* 不传 = 只查内置(历史行为)。
|
|
103
|
-
*
|
|
104
|
-
* 导出给 constraints-reactivate 复用(复活同样认内置 + 应用层 check 约束)。
|
|
105
|
-
*/
|
|
106
|
-
export function findRetireTarget(id: string, target?: RunTarget): RetireTargetInfo | undefined {
|
|
107
|
-
const builtIn = getConstraint(id);
|
|
108
|
-
if (builtIn) {
|
|
109
|
-
return {
|
|
110
|
-
severity: builtIn.severity,
|
|
111
|
-
description: builtIn.description,
|
|
112
|
-
rule: builtIn.rule,
|
|
113
|
-
message: builtIn.message,
|
|
114
|
-
source: 'builtin',
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
if (target !== undefined) {
|
|
118
|
-
const app = loadAppConstraints(target).find(c => c.id === id);
|
|
119
|
-
if (app) {
|
|
120
|
-
return {
|
|
121
|
-
severity: app.severity,
|
|
122
|
-
description: app.description,
|
|
123
|
-
rule: app.rule,
|
|
124
|
-
message: app.message,
|
|
125
|
-
source: 'app',
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return undefined;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
72
|
/**
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* 文件名)。落盘字节由 `__tests__/constraints-retire.test.ts`
|
|
137
|
-
* 的逐字节冻结用例钉住——合并属内部重构,对外产物不得漂移。
|
|
73
|
+
* CLI 侧 wired 包装:core retireConstraint + 知识沉淀写口接线
|
|
74
|
+
* (openKnowledgeStore 同一解析点:KNOWLEDGE_BASE_DIR / 用户 home 缺省目录,harness#177)。
|
|
75
|
+
* 库消费方请直接用包根导出的 retireConstraint,按需注入 openKnowledgeStore。
|
|
138
76
|
*/
|
|
139
|
-
function
|
|
140
|
-
|
|
141
|
-
label: string,
|
|
142
|
-
section: string,
|
|
77
|
+
export function retireConstraint(
|
|
78
|
+
projectRoot: string,
|
|
143
79
|
id: string,
|
|
144
|
-
|
|
145
|
-
):
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
raw = (yaml.load(original) as Record<string, unknown>) ?? {};
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const entries = (raw[section] ?? {}) as Record<string, unknown>;
|
|
155
|
-
const prev = (entries[id] ?? {}) as Record<string, unknown>;
|
|
156
|
-
entries[id] = { ...prev, ...patch };
|
|
157
|
-
raw[section] = entries;
|
|
158
|
-
|
|
159
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
160
|
-
fs.writeFileSync(filePath, yaml.dump(raw, { lineWidth: 120 }), 'utf-8');
|
|
161
|
-
|
|
162
|
-
if (hadComments) {
|
|
163
|
-
console.log(chalk.yellow(` ⚠️ ${label} 已重写:js-yaml 不保留原文件注释`));
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* YAML 条目的删除单点(constraints reactivate 用,与 setYamlEntry 同一读-改-写口径)
|
|
169
|
-
*
|
|
170
|
-
* 删除 config.yml `section.id` 整个 key;段/条目不存在时零写盘。返回是否实际删除。
|
|
171
|
-
*/
|
|
172
|
-
export function removeYamlEntry(filePath: string, section: string, id: string): boolean {
|
|
173
|
-
if (!fs.existsSync(filePath)) return false;
|
|
174
|
-
const raw = (yaml.load(fs.readFileSync(filePath, 'utf-8')) as Record<string, unknown>) ?? {};
|
|
175
|
-
const entries = (raw[section] ?? {}) as Record<string, unknown>;
|
|
176
|
-
if (!(id in entries)) return false;
|
|
177
|
-
delete entries[id];
|
|
178
|
-
raw[section] = entries;
|
|
179
|
-
fs.writeFileSync(filePath, yaml.dump(raw, { lineWidth: 120 }), 'utf-8');
|
|
180
|
-
return true;
|
|
80
|
+
options: RetireExecuteOptions = {}
|
|
81
|
+
): RetireResult {
|
|
82
|
+
return coreRetireConstraint(projectRoot, id, {
|
|
83
|
+
...options,
|
|
84
|
+
openKnowledgeStore:
|
|
85
|
+
options.openKnowledgeStore ?? (() => openKnowledgeStore({}, options.io ?? processIO)),
|
|
86
|
+
});
|
|
181
87
|
}
|
|
182
88
|
|
|
183
89
|
/**
|
|
184
90
|
* 落盘后 commit 提示(票 02 断点 4):仅 git 仓内提示,不替用户动 git。
|
|
185
|
-
*
|
|
91
|
+
* 下游审卡通道由 applier 自动 commit,本提示面向 CLI 直达/裸项目场景。
|
|
186
92
|
*/
|
|
187
93
|
export function logCommitHint(projectRoot: string, io: CommandIO): void {
|
|
188
94
|
if (!fs.existsSync(path.join(projectRoot, '.git'))) return;
|
|
189
|
-
log(io, chalk.gray(' 提示:config.yml 已改未提交——git add .harness/config.yml && git commit
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* 写 KnowledgeStore 退役记录(consumptionMode: 'signal')
|
|
194
|
-
*
|
|
195
|
-
* baseDir 走 openKnowledgeStore 同一解析点(harness#177):缺省与 knowledge 读口同根,
|
|
196
|
-
* 不再硬编码 projectRoot 拼接(那会写进没有任何默认读口的 <repo>/.harness/knowledge)。
|
|
197
|
-
*/
|
|
198
|
-
function saveRetireKnowledge(
|
|
199
|
-
id: string,
|
|
200
|
-
target: RetireTargetInfo,
|
|
201
|
-
reason: string,
|
|
202
|
-
stats: { total: number; fail: number; failRate: number },
|
|
203
|
-
iso: string,
|
|
204
|
-
io: CommandIO
|
|
205
|
-
): { entryId: string; baseDir: string } {
|
|
206
|
-
const entryId = `constraint-retired-${id}`;
|
|
207
|
-
const contentLines = [
|
|
208
|
-
`# 约束退役:${id}`,
|
|
209
|
-
'',
|
|
210
|
-
'## 规则原文',
|
|
211
|
-
'',
|
|
212
|
-
target.description ? `description: ${target.description}` : undefined,
|
|
213
|
-
target.rule ? `rule: ${target.rule}` : undefined,
|
|
214
|
-
target.message ? `message: ${target.message}` : undefined,
|
|
215
|
-
'',
|
|
216
|
-
'## 退役原因',
|
|
217
|
-
'',
|
|
218
|
-
reason || '(未填写)',
|
|
219
|
-
'',
|
|
220
|
-
'## 历史统计',
|
|
221
|
-
'',
|
|
222
|
-
`- total: ${stats.total}`,
|
|
223
|
-
`- fail: ${stats.fail}`,
|
|
224
|
-
`- failRate: ${Math.round(stats.failRate * 100)}%`,
|
|
225
|
-
'',
|
|
226
|
-
`退役日期: ${iso}`,
|
|
227
|
-
].filter((l): l is string => l !== undefined);
|
|
228
|
-
|
|
229
|
-
const entry: KnowledgeEntry = {
|
|
230
|
-
id: entryId,
|
|
231
|
-
type: 'decision',
|
|
232
|
-
title: `约束退役:${id}`,
|
|
233
|
-
content: contentLines.join('\n'),
|
|
234
|
-
maturity: 'verified',
|
|
235
|
-
layer: 'project',
|
|
236
|
-
created: iso,
|
|
237
|
-
lastReferenced: iso,
|
|
238
|
-
contributors: [],
|
|
239
|
-
projects: [],
|
|
240
|
-
// ADR-0033:应用层退休沉淀带 source:app 标签(内置条目不加,历史形状不动)
|
|
241
|
-
tags: [
|
|
242
|
-
'constraint-retired',
|
|
243
|
-
`constraint:${id}`,
|
|
244
|
-
`severity:${target.severity}`,
|
|
245
|
-
...(target.source === 'app' ? ['source:app'] : []),
|
|
246
|
-
],
|
|
247
|
-
applicablePhases: [],
|
|
248
|
-
sourceReferences: [{ timestamp: iso }],
|
|
249
|
-
referencedBy: [],
|
|
250
|
-
executionResults: [],
|
|
251
|
-
consumptionMode: 'signal',
|
|
252
|
-
origin: 'human',
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
const store = openKnowledgeStore({}, io);
|
|
256
|
-
store.save(entry);
|
|
257
|
-
return { entryId, baseDir: store.getBaseDir() };
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* 执行单条约束退役(纯执行逻辑,无交互)
|
|
262
|
-
*
|
|
263
|
-
* 不存在的 id / 已退役的 id 通过 status 返回,由调用方提示。
|
|
264
|
-
*/
|
|
265
|
-
export function retireConstraint(
|
|
266
|
-
projectRoot: string,
|
|
267
|
-
id: string,
|
|
268
|
-
options: RetireExecuteOptions = {}
|
|
269
|
-
): RetireResult {
|
|
270
|
-
const now = options.now ?? new Date();
|
|
271
|
-
const iso = now.toISOString();
|
|
272
|
-
const reason = options.reason ?? '';
|
|
273
|
-
|
|
274
|
-
// 一次退役一份观察面(ADR-0023 决策 2):定义查找与 already_retired 判定共用这一份装载结果。
|
|
275
|
-
const loader = new ProjectConfigLoader(projectRoot);
|
|
276
|
-
loader.load();
|
|
277
|
-
|
|
278
|
-
const target = findRetireTarget(id, projectRoot);
|
|
279
|
-
const emptyStats = { total: 0, fail: 0, failRate: 0 };
|
|
280
|
-
if (!target) {
|
|
281
|
-
return { id, status: 'unknown_id', isError: false, stats: emptyStats };
|
|
282
|
-
}
|
|
283
|
-
const isError = target.severity === 'error';
|
|
284
|
-
|
|
285
|
-
// 已退役保护:只认 retired 墓碑(ADR-0032 决策 6.6,票 02 断点 6)——
|
|
286
|
-
// 裸 enabled:false 是"禁用"不是"退休",落到下面正常退休流程:覆写墓碑 + 补写沉淀,
|
|
287
|
-
// 不让一次裸 disable 吞掉 retire 的知识沉淀。
|
|
288
|
-
const existing = loader.getConfig().constraints?.[id] as { enabled?: boolean; retired?: unknown } | undefined;
|
|
289
|
-
if (existing?.enabled === false && existing.retired) {
|
|
290
|
-
return { id, status: 'already_retired', isError, stats: emptyStats };
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
// 历史统计(来自 traces.log)
|
|
294
|
-
// 计数去向:兼容包装 readProjectTraces() 丢计数(harness#100)——落盘的 retire stats 只计
|
|
295
|
-
// 合法记录,把坏行数写进 RetireResult.stats 属形状变更不在本票;本函数按契约「纯执行无交互」
|
|
296
|
-
// 不打印,告知由两条命令入口各自负责(runRetireInteractive 顶部 / constraintsRetire 的 --yes 分支)
|
|
297
|
-
const usage = collectUsageByConstraint(readProjectTraces(projectRoot)).get(id);
|
|
298
|
-
const evaluated = usage ? usage.total - usage.skip : 0;
|
|
299
|
-
const stats = {
|
|
300
|
-
total: usage?.total ?? 0,
|
|
301
|
-
fail: usage?.fail ?? 0,
|
|
302
|
-
failRate: evaluated > 0 ? (usage!.fail / evaluated) : 0,
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
// 1. 落盘退役(config.yml enabled:false + retired 段,原文保留)
|
|
306
|
-
const retiredMeta = { at: iso, reason, stats };
|
|
307
|
-
setYamlEntry(
|
|
308
|
-
path.join(projectRoot, '.harness', 'config.yml'),
|
|
309
|
-
'config.yml',
|
|
310
|
-
'constraints',
|
|
311
|
-
id,
|
|
312
|
-
{ enabled: false, retired: retiredMeta }
|
|
313
|
-
);
|
|
314
|
-
|
|
315
|
-
// 2. KnowledgeStore
|
|
316
|
-
const { entryId: knowledgeEntryId, baseDir: knowledgeBaseDir } = saveRetireKnowledge(
|
|
317
|
-
id,
|
|
318
|
-
target,
|
|
319
|
-
reason,
|
|
320
|
-
stats,
|
|
321
|
-
iso,
|
|
322
|
-
options.io ?? processIO
|
|
323
|
-
);
|
|
324
|
-
|
|
325
|
-
return {
|
|
326
|
-
id,
|
|
327
|
-
status: 'retired',
|
|
328
|
-
isError,
|
|
329
|
-
stats,
|
|
330
|
-
knowledgeEntryId,
|
|
331
|
-
knowledgeBaseDir,
|
|
332
|
-
};
|
|
95
|
+
log(io, chalk.gray(' 提示:config.yml 已改未提交——git add .harness/config.yml && git commit(下游审卡通道会自动 commit)'));
|
|
333
96
|
}
|
|
334
97
|
|
|
335
98
|
/**
|
|
@@ -2,41 +2,17 @@
|
|
|
2
2
|
* harness constraints -- 约束集合元数据导出
|
|
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
|
|
@@ -223,6 +223,7 @@ export const COMMAND_DEFINITIONS: CommandDefinition[] = [
|
|
|
223
223
|
{ flags: '--json', description: '输出 JSON 格式(供 LLM 消费)', defaultValue: false },
|
|
224
224
|
{ flags: '--agents', description: '同步 AGENTS.md(agent 导读;PRESERVE 标记段重新生成时保留)', defaultValue: false },
|
|
225
225
|
{ flags: '--compact', description: '一次性迁移:将 CAPABILITIES.md 文件表格折叠为目录条目', defaultValue: false },
|
|
226
|
+
{ flags: '--gate', description: '门禁模式:自愈写入后判定被管理文档相对 HEAD 的 diff,有 diff 退 1(CI 用;与 --check/--json/--compact 互斥)', defaultValue: false },
|
|
226
227
|
],
|
|
227
228
|
// --check 下的漂移由实现返回 fail(候选7:退出码映射只在 bin 一处),故无需 afterRun
|
|
228
229
|
action: { module: 'sync-docs', export: 'syncDocs' },
|
|
@@ -297,7 +298,7 @@ export const COMMAND_DEFINITIONS: CommandDefinition[] = [
|
|
|
297
298
|
},
|
|
298
299
|
{
|
|
299
300
|
command: 'release',
|
|
300
|
-
description: 'npm 发布流水线:tsc → dist 验证 → npm version → git push → npm publish → gh release
|
|
301
|
+
description: 'npm 发布流水线:tsc → dist 验证 → npm version → git push → npm publish → gh release。纯 CLI 实现,不依赖外部 API。',
|
|
301
302
|
options: [
|
|
302
303
|
{ flags: '--bump <type>', description: '版本递增类型', defaultValue: 'patch' },
|
|
303
304
|
{ flags: '--dry-run <bool>', description: '仅模拟执行', defaultValue: 'false' },
|
|
@@ -369,6 +370,20 @@ export const COMMAND_DEFINITIONS: CommandDefinition[] = [
|
|
|
369
370
|
yes: options.yes,
|
|
370
371
|
}],
|
|
371
372
|
},
|
|
373
|
+
{
|
|
374
|
+
command: 'disable',
|
|
375
|
+
argument: '<id>',
|
|
376
|
+
description: '裸禁用约束:config.yml enabled:false 无 retired 墓碑无沉淀(区别于 retire;写后验证生效集已缩小,失败回滚);直达需显式 --yes,幂等 already disabled',
|
|
377
|
+
options: [
|
|
378
|
+
{ flags: '-p, --project-path <path>', description: '项目路径' },
|
|
379
|
+
{ flags: '-y, --yes', description: '显式确认直达禁用(与 retire 同一道人确认闸门)', defaultValue: false },
|
|
380
|
+
],
|
|
381
|
+
action: { module: 'constraints-disable', export: 'constraintsDisable' },
|
|
382
|
+
mapActionArgs: (positionals, options) => [positionals[0], {
|
|
383
|
+
projectPath: options.projectPath,
|
|
384
|
+
yes: options.yes,
|
|
385
|
+
}],
|
|
386
|
+
},
|
|
372
387
|
{
|
|
373
388
|
command: 'pack-proposal',
|
|
374
389
|
argument: '<id>',
|
package/src/cli/commands/init.ts
CHANGED
|
@@ -32,6 +32,9 @@ import {
|
|
|
32
32
|
renderGitLabCiJobs,
|
|
33
33
|
PRE_COMMIT_SNIPPET,
|
|
34
34
|
PRE_PUSH_SNIPPET,
|
|
35
|
+
OUTPUT_STYLE_START,
|
|
36
|
+
OUTPUT_STYLE_END,
|
|
37
|
+
renderOutputStyleSection,
|
|
35
38
|
} from './scaffold-templates';
|
|
36
39
|
|
|
37
40
|
export interface InitOptions {
|
|
@@ -411,30 +414,13 @@ async function findCiWorkflows(workflowsDir: string): Promise<string[]> {
|
|
|
411
414
|
}
|
|
412
415
|
|
|
413
416
|
/**
|
|
414
|
-
* Output Style
|
|
417
|
+
* Output Style 段标记与正文正本在 `scaffold-templates.ts`
|
|
418
|
+
*(ADR-0001:init 只写标记区间内,标记外只读)
|
|
415
419
|
*/
|
|
416
|
-
const OUTPUT_STYLE_START = '<!-- HARNESS_OUTPUT_STYLE_START -->';
|
|
417
|
-
const OUTPUT_STYLE_END = '<!-- HARNESS_OUTPUT_STYLE_END -->';
|
|
418
420
|
|
|
419
421
|
/** 旧版 harness 无标记 Output Style 段的特征串(用于区分 harness 写入 vs 用户自写) */
|
|
420
422
|
const LEGACY_OUTPUT_STYLE_FINGERPRINT = 'Terse like caveman';
|
|
421
423
|
|
|
422
|
-
const OUTPUT_STYLE_BODY = [
|
|
423
|
-
'Terse like caveman. Technical substance exact. Only fluff die.',
|
|
424
|
-
'Drop: articles, filler (just/really/basically), pleasantries (sure/certainly/happy to), hedging.',
|
|
425
|
-
'Fragments OK. Short synonyms. Code blocks unchanged. Error messages quoted exact.',
|
|
426
|
-
'Pattern: [thing] [action] [reason]. [next step].',
|
|
427
|
-
'No sycophantic openers/closing fluff. No emojis or em-dashes.',
|
|
428
|
-
'Read existing files before writing. Don\'t re-read unless changed.',
|
|
429
|
-
'Skip files over 100KB unless required.',
|
|
430
|
-
'Don\'t guess APIs, versions, flags, commit SHAs, or package names. Verify before asserting.',
|
|
431
|
-
].join('\n');
|
|
432
|
-
|
|
433
|
-
/** 渲染带标记的 Output Style 段(含 `## Output Style` 标题,以换行结尾) */
|
|
434
|
-
function renderOutputStyleSection(): string {
|
|
435
|
-
return `${OUTPUT_STYLE_START}\n## Output Style\n\n${OUTPUT_STYLE_BODY}\n${OUTPUT_STYLE_END}\n`;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
424
|
/**
|
|
439
425
|
* 在 CLAUDE.md 顶部写入 Output Style 段(标记化、幂等)
|
|
440
426
|
*
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* - **角色→样式单表 + 键→中文 label 映射**:维度 label、成熟度颜色、规则 label 的唯一权威。
|
|
11
11
|
* - **json / 人读的唯一分派与退出码**:`--json` 打 `data` 的序列化,否则渲染 display model。
|
|
12
12
|
* - **路径解析与 store 构造**:`-p` / `KNOWLEDGE_BASE_DIR` / 缺省目录解析只在这一处
|
|
13
|
-
* (ADR-0034
|
|
13
|
+
* (ADR-0034:消费方数据区正本由编排侧经 KNOWLEDGE_BASE_DIR 显式注入)。
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import chalk from 'chalk';
|
|
@@ -176,7 +176,7 @@ export function emitKnowledgeView<T>(io: CommandIO, options: { json?: boolean },
|
|
|
176
176
|
|
|
177
177
|
// ── 路径解析与 store 构造 ─────────────────────────────────
|
|
178
178
|
|
|
179
|
-
/** 缺省知识库数据根(相对用户 home)。裸 CLI
|
|
179
|
+
/** 缺省知识库数据根(相对用户 home)。裸 CLI 项目缺省目录;消费方数据区正本由编排侧经 KNOWLEDGE_BASE_DIR 显式注入(ADR-0034) */
|
|
180
180
|
const KNOWLEDGE_DATA_DIR = path.join('.harness', 'knowledge');
|
|
181
181
|
|
|
182
182
|
export interface KnowledgePathOptions {
|
|
@@ -188,8 +188,8 @@ export interface KnowledgePathOptions {
|
|
|
188
188
|
|
|
189
189
|
/**
|
|
190
190
|
* 知识库数据根的唯一解析点。`-p` 优先,其次 KNOWLEDGE_BASE_DIR,
|
|
191
|
-
* 最后落到用户 home 缺省目录(ADR-0034
|
|
192
|
-
*
|
|
191
|
+
* 最后落到用户 home 缺省目录(ADR-0034 目录收编:消费方数据区正本由
|
|
192
|
+
* 编排侧经 KNOWLEDGE_BASE_DIR 显式注入,本命令不做任何旧目录兼容沿用;
|
|
193
193
|
* io 参数随兼容提示一并失去用途,签名保留免动全部调用方)。
|
|
194
194
|
*/
|
|
195
195
|
export function resolveKnowledgeBaseDir(options: KnowledgePathOptions, _io: CommandIO): string {
|
|
@@ -412,7 +412,7 @@ function syncRagRows(docsPresent: boolean, docsDir: string, files: string[]): Di
|
|
|
412
412
|
blankLine(),
|
|
413
413
|
...files.map((file, i) => ({ cells: [{ field: `files.${i}`, text: ` ${file}`, tone: 'accent' as const }] })),
|
|
414
414
|
blankLine(),
|
|
415
|
-
{ cells: [{ label: '
|
|
415
|
+
{ cells: [{ label: 'Ingest each file into your own knowledge-base backend to sync to RAG', tone: 'muted' }] },
|
|
416
416
|
];
|
|
417
417
|
}
|
|
418
418
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* harness release 命令
|
|
3
3
|
*
|
|
4
4
|
* 完整 npm 发布流水线:tsc → dist 验证 → npm version → git push → npm publish → gh release。
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* 纯 CLI 实现,不依赖任何外部服务——依赖 harness 的环境(编排服务、运行时基础设施)
|
|
6
|
+
* 因 harness 包损坏而故障时,此命令仍可独立作为发布兜底通道使用。
|
|
7
7
|
*
|
|
8
8
|
* 流程:
|
|
9
9
|
* 1. Verify package
|
|
@@ -352,3 +352,26 @@ const DEFAULT_RESOLUTIONS = {
|
|
|
352
352
|
export function renderResolutions(): string {
|
|
353
353
|
return JSON.stringify(DEFAULT_RESOLUTIONS, null, 2);
|
|
354
354
|
}
|
|
355
|
+
|
|
356
|
+
// ── CLAUDE.md Output Style 段(ADR-0001:init 只写标记区间内,标记外只读)─────
|
|
357
|
+
|
|
358
|
+
/** Output Style 段标记(区间外只读;replaceStandaloneRange 的 begin/end) */
|
|
359
|
+
export const OUTPUT_STYLE_START = '<!-- HARNESS_OUTPUT_STYLE_START -->';
|
|
360
|
+
export const OUTPUT_STYLE_END = '<!-- HARNESS_OUTPUT_STYLE_END -->';
|
|
361
|
+
|
|
362
|
+
/** Output Style 段正文(逐字节冻结面:init 落盘与幂等替换的唯一正本) */
|
|
363
|
+
export const OUTPUT_STYLE_BODY = [
|
|
364
|
+
'Terse like caveman. Technical substance exact. Only fluff die.',
|
|
365
|
+
'Drop: articles, filler (just/really/basically), pleasantries (sure/certainly/happy to), hedging.',
|
|
366
|
+
'Fragments OK. Short synonyms. Code blocks unchanged. Error messages quoted exact.',
|
|
367
|
+
'Pattern: [thing] [action] [reason]. [next step].',
|
|
368
|
+
'No sycophantic openers/closing fluff. No emojis or em-dashes.',
|
|
369
|
+
'Read existing files before writing. Don\'t re-read unless changed.',
|
|
370
|
+
'Skip files over 100KB unless required.',
|
|
371
|
+
'Don\'t guess APIs, versions, flags, commit SHAs, or package names. Verify before asserting.',
|
|
372
|
+
].join('\n');
|
|
373
|
+
|
|
374
|
+
/** 渲染带标记的 Output Style 段(含 `## Output Style` 标题,以换行结尾) */
|
|
375
|
+
export function renderOutputStyleSection(): string {
|
|
376
|
+
return `${OUTPUT_STYLE_START}\n## Output Style\n\n${OUTPUT_STYLE_BODY}\n${OUTPUT_STYLE_END}\n`;
|
|
377
|
+
}
|
|
@@ -96,7 +96,7 @@ function getSeverityColor(severity: string): (text: string) => string {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
// ========== security secrets:全历史机密扫描(P1-8,ADR-0031
|
|
99
|
+
// ========== security secrets:全历史机密扫描(P1-8,ADR-0031,票08) ==========
|
|
100
100
|
|
|
101
101
|
export interface SecretsOptions {
|
|
102
102
|
/** 项目路径(= 待扫仓库根) */
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 构造点计数采集测试(harness#202 / ADR-0039)
|
|
3
|
+
*
|
|
4
|
+
* 钉计数口径:全仓 `new X(` 直构造,默认排除 DEFAULT_SKIP_DIRS
|
|
5
|
+
* (node_modules/__tests__/dist),标记带 include: tests 时把测试目录计入。
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as fs from 'fs';
|
|
9
|
+
import * as path from 'path';
|
|
10
|
+
import * as os from 'os';
|
|
11
|
+
import { createConstructionSiteCounter } from '../context-syncer';
|
|
12
|
+
|
|
13
|
+
let tempDir: string;
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'temp-test-construction-count-'));
|
|
17
|
+
fs.mkdirSync(path.join(tempDir, 'src', '__tests__'), { recursive: true });
|
|
18
|
+
fs.mkdirSync(path.join(tempDir, 'node_modules', 'pkg'), { recursive: true });
|
|
19
|
+
fs.mkdirSync(path.join(tempDir, 'dist'), { recursive: true });
|
|
20
|
+
fs.writeFileSync(
|
|
21
|
+
path.join(tempDir, 'src', 'a.ts'),
|
|
22
|
+
'const x = new Widget();\nconst y = new Widget({});\nconst z = new Map<string, boolean>();\n'
|
|
23
|
+
);
|
|
24
|
+
fs.writeFileSync(path.join(tempDir, 'src', '__tests__', 'a.test.ts'), 'new Widget();\n');
|
|
25
|
+
fs.writeFileSync(path.join(tempDir, 'node_modules', 'pkg', 'x.ts'), 'new Widget();\n');
|
|
26
|
+
fs.writeFileSync(path.join(tempDir, 'dist', 'out.ts'), 'new Widget();\n');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
afterEach(() => {
|
|
30
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
describe('createConstructionSiteCounter', () => {
|
|
34
|
+
it('默认口径排除 __tests__/node_modules/dist', () => {
|
|
35
|
+
const count = createConstructionSiteCounter(tempDir);
|
|
36
|
+
expect(count('Widget', false)).toBe(2);
|
|
37
|
+
expect(count('Map', false)).toBe(1);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('includeTests 口径把测试目录计入', () => {
|
|
41
|
+
const count = createConstructionSiteCounter(tempDir);
|
|
42
|
+
expect(count('Widget', true)).toBe(3);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('未出现的类名计 0', () => {
|
|
46
|
+
const count = createConstructionSiteCounter(tempDir);
|
|
47
|
+
expect(count('Missing', false)).toBe(0);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -236,17 +236,15 @@ async function hasKnowledgeDir(projectPath: string): Promise<boolean> {
|
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
/**
|
|
239
|
+
/** 模块上下文正本候选路径(相对项目根) */
|
|
240
240
|
const CONTEXT_DOC_PATHS: string[][] = [
|
|
241
241
|
['.harness', 'CONTEXT.md'],
|
|
242
|
-
['.studio', 'CONTEXT.md'],
|
|
243
242
|
];
|
|
244
243
|
|
|
245
244
|
/**
|
|
246
245
|
* 定位模块上下文正本(正本模型):
|
|
247
246
|
* 模块上下文沉淀归并到业务仓单一正本(模块锚点组织)时,知识入口行改指正本,
|
|
248
|
-
* 不再输出散置 CONTEXT.md 指引。正本路径缺省 `.harness/CONTEXT.md
|
|
249
|
-
* 旧正本 `.studio/CONTEXT.md` 在场时兼容沿用,两者同时在场上以 `.harness/` 为准。
|
|
247
|
+
* 不再输出散置 CONTEXT.md 指引。正本路径缺省 `.harness/CONTEXT.md`。
|
|
250
248
|
* 返回相对 projectPath 的正本路径(posix 分隔符),无正本返回 null。只判存在性,不解析内容。
|
|
251
249
|
*/
|
|
252
250
|
async function findCanonicalContextDoc(projectPath: string): Promise<string | null> {
|