@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
|
@@ -67,7 +67,7 @@ function stageChange(dir: string, rel: string, content: string): void {
|
|
|
67
67
|
git(dir, 'add', '--', rel);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
/**
|
|
70
|
+
/** trace 种子行(未跟踪,不进 diff);仅供 trace 计数/切片类用例预置 */
|
|
71
71
|
function passTraces(dir: string, lines = 1): void {
|
|
72
72
|
write(
|
|
73
73
|
dir,
|
|
@@ -76,6 +76,14 @@ function passTraces(dir: string, lines = 1): void {
|
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
/**
|
|
80
|
+
* 真验证证据(harness#183):.harness/evidence 落盘一条测试输出(未跟踪,不进 diff)。
|
|
81
|
+
* traces.log 不再充当验证证据(其唯一写入方是约束检查自身,语义循环已拆除)。
|
|
82
|
+
*/
|
|
83
|
+
function passEvidence(dir: string): void {
|
|
84
|
+
write(dir, '.harness/evidence/test-fixture.log', '1 passed\n');
|
|
85
|
+
}
|
|
86
|
+
|
|
79
87
|
/**
|
|
80
88
|
* 本项目的 trace 落点记录(harness#139:命令侧收集器锚根构造,写的就是 `<projectPath>/DEFAULT_TRACE_FILE` 正本)
|
|
81
89
|
*
|
|
@@ -146,6 +154,7 @@ function stagedTestDeletion(): string {
|
|
|
146
154
|
git(dir, 'commit', '-q', '-m', 'tests');
|
|
147
155
|
stageChange(dir, 'src/__tests__/existing.test.ts', "test('a', () => {}\n");
|
|
148
156
|
passTraces(dir);
|
|
157
|
+
passEvidence(dir);
|
|
149
158
|
return dir;
|
|
150
159
|
}
|
|
151
160
|
|
|
@@ -161,6 +170,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
161
170
|
const dir = gitRepo();
|
|
162
171
|
stageChange(dir, 'src/existing.ts', 'export const a = 2;\n');
|
|
163
172
|
passTraces(dir);
|
|
173
|
+
passEvidence(dir);
|
|
164
174
|
|
|
165
175
|
const result = await check(
|
|
166
176
|
{ preset: 'standard', staged: true, projectPath: dir, trigger: 'code_implementation' },
|
|
@@ -183,11 +193,12 @@ describe('check command(真 git fixture)', () => {
|
|
|
183
193
|
io
|
|
184
194
|
);
|
|
185
195
|
|
|
186
|
-
expect(io.outText()).toContain('
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
196
|
+
expect(io.outText()).toContain('禁止无验证声明完成,必须有晚于最新变更的验证证据');
|
|
197
|
+
// reason 携带证据行(harness#119 证据通道),前缀比对即可
|
|
198
|
+
expect(result.kind).toBe('fail');
|
|
199
|
+
expect(result.kind === 'fail' && result.reason).toContain(
|
|
200
|
+
'check error: 禁止无验证声明完成,必须有晚于最新变更的验证证据(.harness/evidence)'
|
|
201
|
+
);
|
|
191
202
|
});
|
|
192
203
|
|
|
193
204
|
it('staged 删除测试行 → 真 git diff 驱动 no_test_simplification 拦截', async () => {
|
|
@@ -216,6 +227,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
216
227
|
'export const a = 1;\nconst pass' + 'word = "correcthorsebattery";\n'
|
|
217
228
|
);
|
|
218
229
|
passTraces(dir);
|
|
230
|
+
passEvidence(dir);
|
|
219
231
|
|
|
220
232
|
const result = await check(
|
|
221
233
|
{ preset: 'standard', staged: true, projectPath: dir, trigger: 'code_implementation' },
|
|
@@ -233,6 +245,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
233
245
|
write(dir, '.harness/config.yml', 'preset: standard\n');
|
|
234
246
|
stageChange(dir, 'src/existing.ts', 'export const a = 2;\n');
|
|
235
247
|
passTraces(dir);
|
|
248
|
+
passEvidence(dir);
|
|
236
249
|
|
|
237
250
|
// 不显式传 trigger:governance_presence 的触发词是 file_modification,由 diff 推断
|
|
238
251
|
const result = await check(
|
|
@@ -251,6 +264,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
251
264
|
stageChange(dir, 'src/existing.ts', 'export const a = 2;\n');
|
|
252
265
|
stageChange(dir, 'src/nested/deep.ts', 'export const d = 2;\n');
|
|
253
266
|
passTraces(dir);
|
|
267
|
+
passEvidence(dir);
|
|
254
268
|
|
|
255
269
|
await check(
|
|
256
270
|
{ preset: 'standard', staged: true, projectPath: dir, trigger: 'code_implementation' },
|
|
@@ -274,6 +288,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
274
288
|
const dir = gitRepo();
|
|
275
289
|
stageChange(dir, 'src/existing.ts', 'export const a = 2;\n');
|
|
276
290
|
passTraces(dir);
|
|
291
|
+
passEvidence(dir);
|
|
277
292
|
|
|
278
293
|
await check({ staged: true, projectPath: dir, trigger: 'code_implementation' }, io);
|
|
279
294
|
await check(
|
|
@@ -309,6 +324,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
309
324
|
const dir = capRepo(['src/existing.ts', 'src/nested/deep.ts']);
|
|
310
325
|
stageChange(dir, 'src/nested/extra.ts', 'export const e = 1;\n');
|
|
311
326
|
passTraces(dir);
|
|
327
|
+
passEvidence(dir);
|
|
312
328
|
|
|
313
329
|
const result = await check(
|
|
314
330
|
{ preset: 'standard', staged: true, projectPath: dir, trigger: 'module_modification' },
|
|
@@ -323,6 +339,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
323
339
|
it('仓库级漂移(与本次变更无关)→ 提示块露出,不判违规', async () => {
|
|
324
340
|
const dir = capRepo(['src/existing.ts']);
|
|
325
341
|
passTraces(dir);
|
|
342
|
+
passEvidence(dir);
|
|
326
343
|
|
|
327
344
|
const result = await check(
|
|
328
345
|
{ preset: 'standard', staged: true, projectPath: dir, trigger: 'module_modification' },
|
|
@@ -342,6 +359,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
342
359
|
it('提示与违规都写进 trace 的 evidence 字段(统计侧可诊断)', async () => {
|
|
343
360
|
const dir = capRepo(['src/existing.ts']);
|
|
344
361
|
passTraces(dir);
|
|
362
|
+
passEvidence(dir);
|
|
345
363
|
|
|
346
364
|
await check(
|
|
347
365
|
{ preset: 'standard', staged: true, projectPath: dir, trigger: 'module_modification' },
|
|
@@ -361,6 +379,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
361
379
|
const dir = gitRepo();
|
|
362
380
|
stageChange(dir, 'src/__tests__/added.test.ts', "test('a', () => {}\n");
|
|
363
381
|
passTraces(dir);
|
|
382
|
+
passEvidence(dir);
|
|
364
383
|
const { evidence, requests, commands } = recordingEvidence(dir);
|
|
365
384
|
|
|
366
385
|
const result = await check({ preset: 'standard', staged: true, projectPath: dir, evidence }, io);
|
|
@@ -376,6 +395,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
376
395
|
const stagedDir = gitRepo();
|
|
377
396
|
stageChange(stagedDir, 'src/existing.ts', 'export const a = 2;\n');
|
|
378
397
|
passTraces(stagedDir);
|
|
398
|
+
passEvidence(stagedDir);
|
|
379
399
|
const staged = recordingEvidence(stagedDir);
|
|
380
400
|
await check(
|
|
381
401
|
{ preset: 'standard', staged: true, projectPath: stagedDir, trigger: 'code_implementation', evidence: staged.evidence },
|
|
@@ -388,6 +408,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
388
408
|
const worktreeDir = gitRepo();
|
|
389
409
|
write(worktreeDir, 'src/existing.ts', 'export const a = 3;\n');
|
|
390
410
|
passTraces(worktreeDir);
|
|
411
|
+
passEvidence(worktreeDir);
|
|
391
412
|
const worktree = recordingEvidence(worktreeDir);
|
|
392
413
|
await check(
|
|
393
414
|
{ preset: 'standard', staged: false, projectPath: worktreeDir, trigger: 'code_implementation', evidence: worktree.evidence },
|
|
@@ -404,6 +425,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
404
425
|
const dir = gitRepo();
|
|
405
426
|
stageChange(dir, 'src/existing.ts', 'export const a = 2;\n');
|
|
406
427
|
passTraces(dir);
|
|
428
|
+
passEvidence(dir);
|
|
407
429
|
const seeded = projectTraces(dir).length;
|
|
408
430
|
|
|
409
431
|
await check(
|
|
@@ -427,6 +449,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
427
449
|
const dir = gitRepo();
|
|
428
450
|
stageChange(dir, 'src/existing.ts', 'export const a = 2;\n');
|
|
429
451
|
passTraces(dir);
|
|
452
|
+
passEvidence(dir);
|
|
430
453
|
|
|
431
454
|
await check({ preset: 'standard', staged: true, projectPath: dir }, io);
|
|
432
455
|
|
|
@@ -437,6 +460,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
437
460
|
const dir = gitRepo();
|
|
438
461
|
stageChange(dir, 'src/brandnew/mod.ts', 'export const n = 1;\n');
|
|
439
462
|
passTraces(dir);
|
|
463
|
+
passEvidence(dir);
|
|
440
464
|
|
|
441
465
|
await check({ preset: 'standard', staged: true, projectPath: dir }, io);
|
|
442
466
|
|
|
@@ -447,6 +471,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
447
471
|
const dir = gitRepo();
|
|
448
472
|
stageChange(dir, 'src/__tests__/existing.test.ts', "test('a', () => {}\n");
|
|
449
473
|
passTraces(dir);
|
|
474
|
+
passEvidence(dir);
|
|
450
475
|
|
|
451
476
|
await check({ preset: 'standard', staged: true, projectPath: dir }, io);
|
|
452
477
|
|
|
@@ -467,6 +492,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
467
492
|
const dir = gitRepo();
|
|
468
493
|
stageChange(dir, 'src/existing.ts', 'export const a = 2;\n');
|
|
469
494
|
passTraces(dir);
|
|
495
|
+
passEvidence(dir);
|
|
470
496
|
|
|
471
497
|
await check(
|
|
472
498
|
{ preset: 'standard', staged: true, projectPath: dir, trigger: 'design_request' },
|
|
@@ -483,6 +509,7 @@ describe('check command(真 git fixture)', () => {
|
|
|
483
509
|
const dir = gitRepo();
|
|
484
510
|
stageChange(dir, 'src/existing.ts', 'export const a = 2;\n');
|
|
485
511
|
passTraces(dir);
|
|
512
|
+
passEvidence(dir);
|
|
486
513
|
write(
|
|
487
514
|
dir,
|
|
488
515
|
'.harness/config.yml',
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { executeCommand } from '../command';
|
|
9
|
-
import { createCommandGate } from '../../../gates';
|
|
9
|
+
import { createCommandGate } from '../../../gates/command';
|
|
10
10
|
import { captureIO, type CapturingIO } from '../../command-contract';
|
|
11
11
|
import { decide, fakeGate } from './gate-decision';
|
|
12
12
|
|
|
13
|
-
jest.mock('../../../gates', () => ({
|
|
13
|
+
jest.mock('../../../gates/command', () => ({
|
|
14
14
|
createCommandGate: jest.fn(),
|
|
15
15
|
DEFAULT_COMMAND_BLACKLIST: [
|
|
16
16
|
{ id: 'rule-1', level: 'block', message: 'No rm -rf', category: 'destructive', pattern: 'rm -rf' },
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* harness constraints disable 测试(harness#190,ADR-0032 决策 6.6 的另一侧)
|
|
3
|
+
*
|
|
4
|
+
* 裸禁用 = config.yml `constraints.<id>.enabled:false`,无 retired 墓碑、无知识沉淀
|
|
5
|
+
* (墓碑与沉淀是 retire 专有语义)。幂等 already_disabled;retired 墓碑不接管不动;
|
|
6
|
+
* 写后验证生效集已缩小,失败回滚(与下游消费方 applier 同一纪律)。
|
|
7
|
+
* CLI 直达(constraintsDisable):--yes 人确认闸门,与 retire/reactivate 同形。
|
|
8
|
+
*
|
|
9
|
+
* 使用真实临时目录。
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import * as fs from 'fs';
|
|
13
|
+
import * as os from 'os';
|
|
14
|
+
import * as path from 'path';
|
|
15
|
+
import * as yaml from 'js-yaml';
|
|
16
|
+
import { captureIO, type CapturingIO } from '../../command-contract';
|
|
17
|
+
import { getEffectiveConstraints } from '../../../core/effective-constraints';
|
|
18
|
+
import * as effectiveConstraints from '../../../core/effective-constraints';
|
|
19
|
+
import { FileKnowledgeStore } from '../../../knowledge/store';
|
|
20
|
+
import { retireConstraint } from '../constraints-retire';
|
|
21
|
+
import { disableConstraint, constraintsDisable, printDisableResult } from '../constraints-disable';
|
|
22
|
+
import { createProjectFixture, writeProjectConfig } from '../../../test-setup/project-fixture';
|
|
23
|
+
|
|
24
|
+
const FIXED_NOW = new Date('2026-08-08T12:00:00.000Z');
|
|
25
|
+
|
|
26
|
+
function readConfig(root: string): any {
|
|
27
|
+
return yaml.load(fs.readFileSync(path.join(root, '.harness', 'config.yml'), 'utf-8'));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
let io: CapturingIO;
|
|
31
|
+
beforeEach(() => {
|
|
32
|
+
io = captureIO();
|
|
33
|
+
// disable 不写沉淀——隔离知识库根以便断言「零沉淀」
|
|
34
|
+
process.env.KNOWLEDGE_BASE_DIR = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-disable-kb-'));
|
|
35
|
+
});
|
|
36
|
+
afterEach(() => {
|
|
37
|
+
fs.rmSync(process.env.KNOWLEDGE_BASE_DIR!, { recursive: true, force: true });
|
|
38
|
+
delete process.env.KNOWLEDGE_BASE_DIR;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe('disableConstraint 执行逻辑', () => {
|
|
42
|
+
it('禁用落盘:config.yml enabled:false 无 retired 段,约束离开生效集', () => {
|
|
43
|
+
const root = createProjectFixture({ name: 'harness-disable-test' });
|
|
44
|
+
expect(getEffectiveConstraints(root).some(c => c.id === 'capability_sync')).toBe(true);
|
|
45
|
+
|
|
46
|
+
const result = disableConstraint(root, 'capability_sync');
|
|
47
|
+
|
|
48
|
+
expect(result.status).toBe('disabled');
|
|
49
|
+
const entry = readConfig(root).constraints.capability_sync;
|
|
50
|
+
expect(entry.enabled).toBe(false);
|
|
51
|
+
expect(entry.retired).toBeUndefined();
|
|
52
|
+
expect(getEffectiveConstraints(root).some(c => c.id === 'capability_sync')).toBe(false);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('零知识沉淀:disable 不写任何 KnowledgeStore 条目(沉淀是 retire 专有语义)', () => {
|
|
56
|
+
const root = createProjectFixture({ name: 'harness-disable-test' });
|
|
57
|
+
|
|
58
|
+
const result = disableConstraint(root, 'capability_sync');
|
|
59
|
+
|
|
60
|
+
expect(result.status).toBe('disabled');
|
|
61
|
+
const store = new FileKnowledgeStore({ baseDir: process.env.KNOWLEDGE_BASE_DIR! });
|
|
62
|
+
expect(store.list()).toHaveLength(0);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('幂等:裸 enabled:false 已禁用 → already_disabled,配置原样不动', () => {
|
|
66
|
+
const root = createProjectFixture({
|
|
67
|
+
name: 'harness-disable-test',
|
|
68
|
+
config: 'constraints:\n capability_sync:\n enabled: false\n',
|
|
69
|
+
});
|
|
70
|
+
const before = fs.readFileSync(path.join(root, '.harness', 'config.yml'), 'utf-8');
|
|
71
|
+
|
|
72
|
+
const result = disableConstraint(root, 'capability_sync');
|
|
73
|
+
|
|
74
|
+
expect(result.status).toBe('already_disabled');
|
|
75
|
+
expect(fs.readFileSync(path.join(root, '.harness', 'config.yml'), 'utf-8')).toBe(before);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('retired 墓碑不接管:already_retired,墓碑原样保留(disable 不吞 retire 语义)', () => {
|
|
79
|
+
const root = createProjectFixture({ name: 'harness-disable-test' });
|
|
80
|
+
retireConstraint(root, 'capability_sync', { reason: '先退', now: FIXED_NOW });
|
|
81
|
+
|
|
82
|
+
const result = disableConstraint(root, 'capability_sync');
|
|
83
|
+
|
|
84
|
+
expect(result.status).toBe('already_retired');
|
|
85
|
+
const entry = readConfig(root).constraints.capability_sync;
|
|
86
|
+
expect(entry.enabled).toBe(false);
|
|
87
|
+
expect(entry.retired).toBeDefined();
|
|
88
|
+
expect(entry.retired.reason).toBe('先退');
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('未知 id:unknown_id,不落盘任何文件', () => {
|
|
92
|
+
const root = createProjectFixture({ name: 'harness-disable-test' });
|
|
93
|
+
|
|
94
|
+
const result = disableConstraint(root, 'not_a_constraint');
|
|
95
|
+
|
|
96
|
+
expect(result.status).toBe('unknown_id');
|
|
97
|
+
expect(fs.existsSync(path.join(root, '.harness'))).toBe(false);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('同文件其他约束条目不受影响', () => {
|
|
101
|
+
const root = createProjectFixture({
|
|
102
|
+
name: 'harness-disable-test',
|
|
103
|
+
config: 'constraints:\n docs_freshness:\n enabled: false\n',
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
const result = disableConstraint(root, 'capability_sync');
|
|
107
|
+
|
|
108
|
+
expect(result.status).toBe('disabled');
|
|
109
|
+
const config = readConfig(root);
|
|
110
|
+
expect(config.constraints.docs_freshness.enabled).toBe(false);
|
|
111
|
+
expect(config.constraints.capability_sync.enabled).toBe(false);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it('禁用结果打印:git 仓内附 commit 提示,非 git 目录不提示', () => {
|
|
115
|
+
const gitRoot = createProjectFixture({ name: 'harness-disable-test', files: { '.git/HEAD': 'ref: refs/heads/master\n' } });
|
|
116
|
+
printDisableResult(disableConstraint(gitRoot, 'capability_sync'), io, gitRoot);
|
|
117
|
+
expect(io.outText()).toContain('git add .harness/config.yml');
|
|
118
|
+
|
|
119
|
+
const plainRoot = createProjectFixture({ name: 'harness-disable-test' });
|
|
120
|
+
const plainIo = captureIO();
|
|
121
|
+
printDisableResult(disableConstraint(plainRoot, 'capability_sync'), plainIo, plainRoot);
|
|
122
|
+
expect(plainIo.outText()).not.toContain('git add');
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
describe('写后验证失败回滚(harness#190 AC:失败回滚)', () => {
|
|
127
|
+
afterEach(() => {
|
|
128
|
+
jest.restoreAllMocks();
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
it('生效集仍含该约束 → verify_failed,config.yml 恢复备份逐字节', () => {
|
|
132
|
+
const root = createProjectFixture({
|
|
133
|
+
name: 'harness-disable-test',
|
|
134
|
+
config: 'constraints:\n docs_freshness:\n enabled: false\n',
|
|
135
|
+
});
|
|
136
|
+
const before = fs.readFileSync(path.join(root, '.harness', 'config.yml'), 'utf-8');
|
|
137
|
+
// 强制验证失败:生效集仍含该 id(spy 只钉本用例,afterEach 恢复)
|
|
138
|
+
jest.spyOn(effectiveConstraints, 'getEffectiveConstraints').mockReturnValue([{ id: 'capability_sync' } as any]);
|
|
139
|
+
|
|
140
|
+
const result = disableConstraint(root, 'capability_sync');
|
|
141
|
+
|
|
142
|
+
expect(result.status).toBe('verify_failed');
|
|
143
|
+
expect(fs.readFileSync(path.join(root, '.harness', 'config.yml'), 'utf-8')).toBe(before);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('原本无 config.yml → verify_failed 时删除新建文件,回到零落盘', () => {
|
|
147
|
+
const root = createProjectFixture({ name: 'harness-disable-test' });
|
|
148
|
+
jest.spyOn(effectiveConstraints, 'getEffectiveConstraints').mockReturnValue([{ id: 'capability_sync' } as any]);
|
|
149
|
+
|
|
150
|
+
const result = disableConstraint(root, 'capability_sync');
|
|
151
|
+
|
|
152
|
+
expect(result.status).toBe('verify_failed');
|
|
153
|
+
expect(fs.existsSync(path.join(root, '.harness', 'config.yml'))).toBe(false);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('verify_failed 打印:fail kind + 回滚告知走 stderr', () => {
|
|
157
|
+
const cmdResult = printDisableResult({ id: 'capability_sync', status: 'verify_failed' }, io);
|
|
158
|
+
expect(cmdResult.kind).toBe('fail');
|
|
159
|
+
expect(io.errText()).toContain('已回滚');
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
describe('constraintsDisable 非交互直达', () => {
|
|
164
|
+
it('无 --yes 直达:报错 + 非零退出码 + 不落盘任何文件(人确认闸门)', async () => {
|
|
165
|
+
const root = createProjectFixture({ name: 'harness-disable-test' });
|
|
166
|
+
|
|
167
|
+
const result = await constraintsDisable('capability_sync', { projectPath: root }, io);
|
|
168
|
+
|
|
169
|
+
expect(io.errText()).toContain('--yes');
|
|
170
|
+
expect(result.kind).toBe('usage-error');
|
|
171
|
+
expect(fs.existsSync(path.join(root, '.harness'))).toBe(false);
|
|
172
|
+
expect(getEffectiveConstraints(root).some(c => c.id === 'capability_sync')).toBe(true);
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
it('--yes 直达禁用:落盘并打印结果', async () => {
|
|
176
|
+
const root = createProjectFixture({ name: 'harness-disable-test' });
|
|
177
|
+
|
|
178
|
+
const result = await constraintsDisable('capability_sync', { projectPath: root, yes: true }, io);
|
|
179
|
+
|
|
180
|
+
expect(result.kind).toBe('ok');
|
|
181
|
+
expect(io.outText()).toContain('已禁用');
|
|
182
|
+
expect(readConfig(root).constraints.capability_sync.enabled).toBe(false);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it('--yes 直达已禁用:幂等 skip', async () => {
|
|
186
|
+
const root = createProjectFixture({ name: 'harness-disable-test' });
|
|
187
|
+
writeProjectConfig(root, 'constraints:\n capability_sync:\n enabled: false\n');
|
|
188
|
+
|
|
189
|
+
const result = await constraintsDisable('capability_sync', { projectPath: root, yes: true }, io);
|
|
190
|
+
|
|
191
|
+
expect(result.kind).toBe('skip');
|
|
192
|
+
expect(io.outText()).toContain('已处于禁用状态');
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
it('缺 id:usage-error 提示用法', async () => {
|
|
196
|
+
const result = await constraintsDisable(undefined, { yes: true }, io);
|
|
197
|
+
expect(result.kind).toBe('usage-error');
|
|
198
|
+
expect(io.errText()).toContain('用法');
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
describe('应用层约束禁用(ADR-0033 同路径)', () => {
|
|
203
|
+
const APP_YML = [
|
|
204
|
+
'constraints:',
|
|
205
|
+
' - id: app_no_internal_url',
|
|
206
|
+
' rule: Web code must not contain internal URLs',
|
|
207
|
+
' checker: regex-scan',
|
|
208
|
+
' params:',
|
|
209
|
+
" pattern: 'https?://10\\.'",
|
|
210
|
+
' severity: warning',
|
|
211
|
+
'',
|
|
212
|
+
].join('\n');
|
|
213
|
+
|
|
214
|
+
it('应用层 check 约束可禁用:config.yml enabled:false,离开生效集,constraints.yml 条文保留', () => {
|
|
215
|
+
const root = createProjectFixture({
|
|
216
|
+
name: 'harness-disable-test',
|
|
217
|
+
files: { [path.join('.harness', 'constraints.yml')]: APP_YML },
|
|
218
|
+
});
|
|
219
|
+
expect(getEffectiveConstraints(root).some(c => c.id === 'app_no_internal_url')).toBe(true);
|
|
220
|
+
|
|
221
|
+
const result = disableConstraint(root, 'app_no_internal_url');
|
|
222
|
+
|
|
223
|
+
expect(result.status).toBe('disabled');
|
|
224
|
+
expect(readConfig(root).constraints.app_no_internal_url.enabled).toBe(false);
|
|
225
|
+
expect(getEffectiveConstraints(root).some(c => c.id === 'app_no_internal_url')).toBe(false);
|
|
226
|
+
// 条文保留不删(禁用 = 停用不是删除)
|
|
227
|
+
expect(fs.readFileSync(path.join(root, '.harness', 'constraints.yml'), 'utf-8')).toBe(APP_YML);
|
|
228
|
+
});
|
|
229
|
+
});
|
|
@@ -97,7 +97,7 @@ describe('buildConstraintsUsageReport', () => {
|
|
|
97
97
|
it('四类候选诊断:零触发/不可评估(flag)/不可评估(探测)/高噪/零拦截', () => {
|
|
98
98
|
const root = createProjectFixture({ name: 'harness-report-test' });
|
|
99
99
|
writeProjectTraces(root, [
|
|
100
|
-
//
|
|
100
|
+
// 不可评估(证据不可用):全部 skip(harness#183 起不再是 flag 未接线)
|
|
101
101
|
...tracesOf('no_completion_without_verification', 'skip', 3),
|
|
102
102
|
// 不可评估(存在性探测未命中):全部 skip
|
|
103
103
|
...tracesOf('capability_sync', 'skip', 5),
|
|
@@ -113,12 +113,12 @@ describe('buildConstraintsUsageReport', () => {
|
|
|
113
113
|
// 零触发(未出现在 trace 的 check 约束)
|
|
114
114
|
expect(byId.get('docs_freshness')?.kind).toBe('zero_trigger');
|
|
115
115
|
|
|
116
|
-
// 不可评估 · flag
|
|
116
|
+
// 不可评估 · 全部 skip(证据不可用/约定未采用不再分列,harness#183 起无 flag 型约束)
|
|
117
117
|
const flagC = byId.get('no_completion_without_verification');
|
|
118
118
|
expect(flagC?.kind).toBe('unevaluable');
|
|
119
|
-
expect(flagC?.reason).toContain('
|
|
119
|
+
expect(flagC?.reason).toContain('约定未采用或证据不可用');
|
|
120
120
|
|
|
121
|
-
// 不可评估 ·
|
|
121
|
+
// 不可评估 · 同口径
|
|
122
122
|
const probeC = byId.get('capability_sync');
|
|
123
123
|
expect(probeC?.kind).toBe('unevaluable');
|
|
124
124
|
expect(probeC?.reason).toContain('约定未采用');
|
|
@@ -52,7 +52,7 @@ const FIXTURE: KnowledgeEntry[] = [
|
|
|
52
52
|
makeEntry('K-001', 'verified', ['agent-a:2026-09-01', 'search:2026-09-01']),
|
|
53
53
|
makeEntry('K-002', 'verified', ['prompt-inject:2026-08-30', 'test-agent:2026-08-31', 'monitor:2026-09-01']),
|
|
54
54
|
makeEntry('K-003', 'draft', []),
|
|
55
|
-
makeEntry('K-004', 'proven', ['decision-1:2026-07-01', '
|
|
55
|
+
makeEntry('K-004', 'proven', ['decision-1:2026-07-01', 'web-app:2026-07-02']),
|
|
56
56
|
];
|
|
57
57
|
|
|
58
58
|
function setupKnowledgeBase(): string {
|
|
@@ -364,7 +364,7 @@ const HUMAN_BASELINE: Record<SubName, string[]> = {
|
|
|
364
364
|
' a.md',
|
|
365
365
|
' b.md',
|
|
366
366
|
'',
|
|
367
|
-
'
|
|
367
|
+
'Ingest each file into your own knowledge-base backend to sync to RAG',
|
|
368
368
|
],
|
|
369
369
|
audit: [
|
|
370
370
|
'🔍 知识库质量审计...',
|
|
@@ -86,7 +86,7 @@ beforeEach(() => {
|
|
|
86
86
|
|
|
87
87
|
// 解析函数本体自 #133 起住 knowledge-view.ts(resolveKnowledgeBaseDir),行为面不变:
|
|
88
88
|
// 这里经 knowledgeStats 观测 `-p` / KNOWLEDGE_BASE_DIR / 缺省目录三条路径的解析结果
|
|
89
|
-
// (ADR-0034
|
|
89
|
+
// (ADR-0034:旧消费方数据区兼容沿用已退役,不再属观测面)
|
|
90
90
|
describe('getKnowledgeDir', () => {
|
|
91
91
|
const fs = require('fs');
|
|
92
92
|
const os = require('os');
|
|
@@ -127,8 +127,8 @@ describe('getKnowledgeDir', () => {
|
|
|
127
127
|
}));
|
|
128
128
|
});
|
|
129
129
|
|
|
130
|
-
it('should NOT fall back to legacy
|
|
131
|
-
const legacyDir = path.join(tmpHome, '.
|
|
130
|
+
it('should NOT fall back to legacy consumer data dir even when it has data (ADR-0034 目录收编:兼容沿用已退役)', async () => {
|
|
131
|
+
const legacyDir = path.join(tmpHome, '.legacy', 'knowledge');
|
|
132
132
|
fs.mkdirSync(legacyDir, { recursive: true });
|
|
133
133
|
fs.writeFileSync(path.join(legacyDir, 'guideline-x.md'), 'data');
|
|
134
134
|
await knowledgeStats({ json: true }, io);
|
|
@@ -169,7 +169,7 @@ describe('-p 锚定:执行与 IO 必须落在 projectPath(cwd ≠ projectPat
|
|
|
169
169
|
execFileSync('git', args, { cwd: dir, stdio: 'pipe' });
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
/** check 能真跑完的项目:已提交基线 + staged 改动 +
|
|
172
|
+
/** check 能真跑完的项目:已提交基线 + staged 改动 + 真验证证据(harness#183:.harness/evidence 落盘) */
|
|
173
173
|
function checkProject(name: string): string {
|
|
174
174
|
const dir = createProjectFixture({
|
|
175
175
|
name,
|
|
@@ -183,6 +183,9 @@ describe('-p 锚定:执行与 IO 必须落在 projectPath(cwd ≠ projectPat
|
|
|
183
183
|
git(dir, 'commit', '-q', '-m', 'baseline');
|
|
184
184
|
fs.writeFileSync(path.join(dir, 'src/existing.ts'), 'export const a = 2;\n', 'utf-8');
|
|
185
185
|
git(dir, 'add', '--', 'src/existing.ts');
|
|
186
|
+
// 验证证据须在变更之后落盘(mtime 新鲜度口径)
|
|
187
|
+
fs.mkdirSync(path.join(dir, '.harness', 'evidence'), { recursive: true });
|
|
188
|
+
fs.writeFileSync(path.join(dir, '.harness', 'evidence', 'test-fixture.log'), '1 passed\n', 'utf-8');
|
|
186
189
|
return dir;
|
|
187
190
|
}
|
|
188
191
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* 兜底,之后必须传到每个 IO/执行点**——下游禁止再取一次 cwd,也禁止用相对路径默认值
|
|
6
6
|
* (两者都会让 `-p` 半失效:读写/执行位置悄悄回到调用方的 cwd)。
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* 本文件是这条约定的机器可检面,三道闸:
|
|
9
9
|
* 1. CLI 入口层:cwd 只能以 `xxx || process.cwd()` 的兜底形状出现,例外逐个点名并记理由
|
|
10
10
|
* 2. 下游层(= src 减 cli,含 core / gates / context / monitoring / hooks 等):cwd 站点**逐行**冻结
|
|
11
11
|
* (harness#98,不再只冻文件键集——豁免文件内新增站点/行变形同样失败),
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* 3. 相对路径默认值同理冻结(harness#98 收紧:对象字面量 `xxxPath: '相对'` 之外,
|
|
14
14
|
* 参数默认值形 `xxxPath = '相对'`(含类型标注)与模板字面量同罪;harness#139 再扩两形:
|
|
15
15
|
* 键名后缀 `Path` → `Path|File|Log`,以及引用常量的 `xxxFile: SOME_CONST` 臂;扫描域 = 整个下游层)
|
|
16
|
-
* 4
|
|
17
|
-
*
|
|
16
|
+
* (原闸 4「组合根不消费 cwd 锚定的 getTraceCollector() 单例」随 #199 单例出口删除整体退役——
|
|
17
|
+
* 它钉的兼容面已不存在)
|
|
18
18
|
*
|
|
19
19
|
* 冻结集合还要求**每条豁免仍然成立**(站点消失却不删条目 → 同样失败),豁免不会烂成化石。
|
|
20
20
|
* 「根参数已传入却又取 cwd」这类静态看不出的漂移,由 project-path-anchoring.test.ts 的真实 IO 行为用例守。
|
|
@@ -142,18 +142,6 @@ const DOWNSTREAM_CWD_EXEMPTIONS: Record<string, { lines: string[]; reason: strin
|
|
|
142
142
|
'resolveRunEnv 的根兜底:RunTarget 只给了路径或什么也没给时自造一枚一次性观察面' +
|
|
143
143
|
'(配置访问器族与 ProjectConfigLoader 的入参归一点,ADR-0023 决策 2)',
|
|
144
144
|
},
|
|
145
|
-
'src/core/constraints/usage-report.ts': {
|
|
146
|
-
lines: ['projectRoot: string = process.cwd(),'],
|
|
147
|
-
reason: 'projectRoot 形参默认值(库层可选根)',
|
|
148
|
-
},
|
|
149
|
-
'src/core/effective-constraints.ts': {
|
|
150
|
-
lines: [
|
|
151
|
-
'target: RunTarget = process.cwd(),',
|
|
152
|
-
'target: RunTarget = process.cwd(),',
|
|
153
|
-
'export function lintEffectiveConfig(projectRoot: string = process.cwd()): EffectiveConfigLint {',
|
|
154
|
-
],
|
|
155
|
-
reason: '生效集三函数根形参默认值(库层可选根,JSDoc 已声明;前两者入参含 RunEnv,ADR-0023)',
|
|
156
|
-
},
|
|
157
145
|
'src/core/spec/validator.ts': {
|
|
158
146
|
lines: ['const cwd = projectPath || process.cwd();'],
|
|
159
147
|
reason: 'validateAll 的可选 projectPath 兜底(其相对 schemaPath 默认值见闸 3 豁免)',
|
|
@@ -169,10 +157,6 @@ const DOWNSTREAM_CWD_EXEMPTIONS: Record<string, { lines: string[]; reason: strin
|
|
|
169
157
|
],
|
|
170
158
|
reason: 'bootstrapHarness 的可选 projectPath 兜底(组合根入口,2 处)',
|
|
171
159
|
},
|
|
172
|
-
'src/monitoring/context-tracker.ts': {
|
|
173
|
-
lines: ['const base = basePath || process.cwd();'],
|
|
174
|
-
reason: 'basePath 构造参数缺省兜底',
|
|
175
|
-
},
|
|
176
160
|
};
|
|
177
161
|
|
|
178
162
|
// ========================================
|
|
@@ -211,7 +195,7 @@ const RELATIVE_PATH_DEFAULT_EXEMPTIONS: Record<string, string> = {
|
|
|
211
195
|
'src/monitoring/trace-analyzer.ts':
|
|
212
196
|
'summaryFile: ".harness/logs/traces-summary.json" 同型病灶(#139 实测的第二处命中)。不在本票修:' +
|
|
213
197
|
'harness 侧无生产写点(`status` 自 ADR-0020 起直调纯函数,不构造 analyzer),修它等于给无人消费的面' +
|
|
214
|
-
'新增根参数。与 trace 的 failure/summary
|
|
198
|
+
'新增根参数。与 trace 的 failure/summary 三件套同型病灶一并由下游消费方迁移票带走(#139 Out of scope)。',
|
|
215
199
|
};
|
|
216
200
|
|
|
217
201
|
describe('projectPath 传递约定(harness#95)', () => {
|
|
@@ -290,20 +274,4 @@ describe('projectPath 传递约定(harness#95)', () => {
|
|
|
290
274
|
].map(f => relativePathDefaultSites([f]).size)).toEqual([0, 0, 0, 0]);
|
|
291
275
|
});
|
|
292
276
|
});
|
|
293
|
-
|
|
294
|
-
describe('闸 4:组合根锚根构造,不消费 cwd 锚定的单例(harness#139)', () => {
|
|
295
|
-
it('src/cli 与 src/hooks 的生产代码对 getTraceCollector() 零消费', () => {
|
|
296
|
-
const offenders: string[] = [];
|
|
297
|
-
for (const dir of ['cli', 'hooks']) {
|
|
298
|
-
for (const file of listTsFiles(path.join(SRC_ROOT, dir))) {
|
|
299
|
-
const lines = codeLines(file).filter(line => /getTraceCollector\s*\(/.test(line));
|
|
300
|
-
if (lines.length > 0) offenders.push(`${repoPath(file)}: ${lines.join(' | ')}`);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
// 单例保留是给跨仓消费者的兼容面(#139 裁决:公共面不摘除);本仓四个组合根各自
|
|
305
|
-
// new TraceCollector({ projectPath }),取用口一旦复活,-p 就又半失效一次
|
|
306
|
-
expect(offenders).toEqual([]);
|
|
307
|
-
});
|
|
308
|
-
});
|
|
309
277
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* #146 把 `sourceContents()` 改成全仓内容常驻一个 Map:排除面只有
|
|
5
5
|
* node_modules / dist / 隐藏目录与 .ts/.js 后缀,**无单文件字节、总量、条目上限**——
|
|
6
|
-
* 峰值内存由 O(单文件) 变 O(全仓源码)
|
|
6
|
+
* 峰值内存由 O(单文件) 变 O(全仓源码),大型 monorepo 跑本命令会承担这个峰值,
|
|
7
7
|
* 而本仓 146 个源文件的规模测不出来。
|
|
8
8
|
*
|
|
9
9
|
* 裁决(票面修法二):索引加总量上限(条目数 + 字节数双闸),超限即放弃驻留、
|
|
@@ -281,29 +281,6 @@ describe('sync-docs --agents', () => {
|
|
|
281
281
|
fs.rmSync(testDir, { recursive: true, force: true });
|
|
282
282
|
});
|
|
283
283
|
|
|
284
|
-
it('旧正本 .studio/CONTEXT.md 仍在场时兼容沿用(免迁移),两者同在以 .harness/ 为准', async () => {
|
|
285
|
-
const legacyDir = path.join(tempDir, 'legacy-context-model');
|
|
286
|
-
createFixture(legacyDir, { pnpm: true, withCapabilities: true });
|
|
287
|
-
fs.mkdirSync(path.join(legacyDir, '.studio'), { recursive: true });
|
|
288
|
-
fs.writeFileSync(path.join(legacyDir, '.studio', 'CONTEXT.md'), '# 模块上下文\n\n## src\n\n职责:夹具\n');
|
|
289
|
-
await syncDocs({ projectPath: legacyDir, agents: true }, io);
|
|
290
|
-
expect(fs.readFileSync(path.join(legacyDir, 'AGENTS.md'), 'utf-8'))
|
|
291
|
-
.toContain('模块上下文正本:`.studio/CONTEXT.md`(模块锚点组织),改动代码时同步更新');
|
|
292
|
-
fs.rmSync(legacyDir, { recursive: true, force: true });
|
|
293
|
-
|
|
294
|
-
const bothDir = path.join(tempDir, 'both-context-model');
|
|
295
|
-
createFixture(bothDir, { pnpm: true, withCapabilities: true });
|
|
296
|
-
fs.mkdirSync(path.join(bothDir, '.studio'), { recursive: true });
|
|
297
|
-
fs.writeFileSync(path.join(bothDir, '.studio', 'CONTEXT.md'), '# 旧\n');
|
|
298
|
-
fs.mkdirSync(path.join(bothDir, '.harness'), { recursive: true });
|
|
299
|
-
fs.writeFileSync(path.join(bothDir, '.harness', 'CONTEXT.md'), '# 新\n');
|
|
300
|
-
await syncDocs({ projectPath: bothDir, agents: true }, io);
|
|
301
|
-
const content = fs.readFileSync(path.join(bothDir, 'AGENTS.md'), 'utf-8');
|
|
302
|
-
expect(content).toContain('模块上下文正本:`.harness/CONTEXT.md`');
|
|
303
|
-
expect(content).not.toContain('.studio/CONTEXT.md');
|
|
304
|
-
fs.rmSync(bothDir, { recursive: true, force: true });
|
|
305
|
-
});
|
|
306
|
-
|
|
307
284
|
it('正本不存在时保持散置模型行,--check 无漂移', async () => {
|
|
308
285
|
const testDir = path.join(tempDir, 'scattered-context-model');
|
|
309
286
|
createFixture(testDir, { pnpm: true, withCapabilities: true });
|
|
@@ -630,7 +607,7 @@ describe('sync-docs --agents', () => {
|
|
|
630
607
|
fs.rmSync(testDir, { recursive: true, force: true });
|
|
631
608
|
});
|
|
632
609
|
|
|
633
|
-
it('PRESERVE:governance 治理契约段开箱即用:重新生成保留、--check 通过(
|
|
610
|
+
it('PRESERVE:governance 治理契约段开箱即用:重新生成保留、--check 通过(ADR 2026-08-21 落点模型)', async () => {
|
|
634
611
|
const testDir = path.join(tempDir, 'preserve-governance');
|
|
635
612
|
createFixture(testDir, { pnpm: true, withCapabilities: true });
|
|
636
613
|
|