@dommaker/harness 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/index.d.ts +0 -1
- package/dist/agents/index.js +0 -1
- package/dist/agents/lifecycle.d.ts +0 -1
- package/dist/agents/lifecycle.js +0 -1
- package/dist/agents/types.d.ts +0 -1
- package/dist/agents/types.js +0 -1
- package/dist/bootstrap/bootstrap.d.ts +0 -1
- package/dist/bootstrap/bootstrap.js +0 -1
- package/dist/bootstrap/index.d.ts +0 -1
- package/dist/bootstrap/index.js +0 -1
- package/dist/cli/command-contract.d.ts +0 -1
- package/dist/cli/command-contract.js +0 -1
- package/dist/cli/commands/__tests__/gate-decision.d.ts +0 -1
- package/dist/cli/commands/__tests__/gate-decision.js +0 -1
- package/dist/cli/commands/acceptance.d.ts +0 -1
- package/dist/cli/commands/acceptance.js +3 -3
- package/dist/cli/commands/check.d.ts +0 -1
- package/dist/cli/commands/check.js +0 -1
- package/dist/cli/commands/command.d.ts +0 -1
- package/dist/cli/commands/command.js +0 -1
- package/dist/cli/commands/constraints-disable.d.ts +0 -1
- package/dist/cli/commands/constraints-disable.js +0 -1
- package/dist/cli/commands/constraints-pack-proposal.d.ts +0 -1
- package/dist/cli/commands/constraints-pack-proposal.js +0 -1
- package/dist/cli/commands/constraints-reactivate.d.ts +0 -1
- package/dist/cli/commands/constraints-reactivate.js +0 -1
- package/dist/cli/commands/constraints-report.d.ts +0 -1
- package/dist/cli/commands/constraints-report.js +4 -4
- package/dist/cli/commands/constraints-retire.d.ts +0 -1
- package/dist/cli/commands/constraints-retire.js +0 -1
- package/dist/cli/commands/constraints.d.ts +0 -1
- package/dist/cli/commands/constraints.js +0 -1
- package/dist/cli/commands/contract.d.ts +0 -1
- package/dist/cli/commands/contract.js +4 -4
- package/dist/cli/commands/definitions.d.ts +0 -1
- package/dist/cli/commands/definitions.js +0 -1
- package/dist/cli/commands/failure.d.ts +0 -1
- package/dist/cli/commands/failure.js +0 -1
- package/dist/cli/commands/init/ci-platform.d.ts +0 -1
- package/dist/cli/commands/init/ci-platform.js +0 -1
- package/dist/cli/commands/init/ci-wiring.d.ts +0 -1
- package/dist/cli/commands/init/ci-wiring.js +0 -1
- package/dist/cli/commands/init/git-hooks.d.ts +0 -1
- package/dist/cli/commands/init/git-hooks.js +0 -1
- package/dist/cli/commands/init/governance.d.ts +0 -1
- package/dist/cli/commands/init/governance.js +0 -1
- package/dist/cli/commands/init/index.d.ts +0 -1
- package/dist/cli/commands/init/index.js +2 -3
- package/dist/cli/commands/init/output-style.d.ts +0 -1
- package/dist/cli/commands/init/output-style.js +0 -1
- package/dist/cli/commands/init/presets.d.ts +0 -1
- package/dist/cli/commands/init/presets.js +0 -1
- package/dist/cli/commands/init/snippets.d.ts +0 -1
- package/dist/cli/commands/init/snippets.js +0 -1
- package/dist/cli/commands/knowledge/audit.d.ts +0 -1
- package/dist/cli/commands/knowledge/audit.js +0 -1
- package/dist/cli/commands/knowledge/decay.d.ts +0 -1
- package/dist/cli/commands/knowledge/decay.js +0 -1
- package/dist/cli/commands/knowledge/health.d.ts +0 -1
- package/dist/cli/commands/knowledge/health.js +0 -1
- package/dist/cli/commands/knowledge/import.d.ts +0 -1
- package/dist/cli/commands/knowledge/import.js +12 -1
- package/dist/cli/commands/knowledge/index.d.ts +0 -1
- package/dist/cli/commands/knowledge/index.js +0 -1
- package/dist/cli/commands/knowledge/list.d.ts +0 -1
- package/dist/cli/commands/knowledge/list.js +18 -1
- package/dist/cli/commands/knowledge/search.d.ts +0 -1
- package/dist/cli/commands/knowledge/search.js +0 -1
- package/dist/cli/commands/knowledge/shared.d.ts +0 -1
- package/dist/cli/commands/knowledge/shared.js +0 -1
- package/dist/cli/commands/knowledge/snapshot.d.ts +0 -1
- package/dist/cli/commands/knowledge/snapshot.js +0 -1
- package/dist/cli/commands/knowledge/stats.d.ts +0 -1
- package/dist/cli/commands/knowledge/stats.js +4 -9
- package/dist/cli/commands/knowledge/store-access.d.ts +0 -1
- package/dist/cli/commands/knowledge/store-access.js +0 -1
- package/dist/cli/commands/knowledge-view.d.ts +0 -1
- package/dist/cli/commands/knowledge-view.js +0 -1
- package/dist/cli/commands/passes-gate.d.ts +0 -1
- package/dist/cli/commands/passes-gate.js +5 -42
- package/dist/cli/commands/performance.d.ts +0 -1
- package/dist/cli/commands/performance.js +0 -1
- package/dist/cli/commands/release.d.ts +0 -1
- package/dist/cli/commands/release.js +2 -2
- package/dist/cli/commands/report.d.ts +0 -1
- package/dist/cli/commands/report.js +0 -1
- package/dist/cli/commands/review.d.ts +0 -1
- package/dist/cli/commands/review.js +4 -4
- package/dist/cli/commands/scaffold-templates.d.ts +0 -1
- package/dist/cli/commands/scaffold-templates.js +1 -2
- package/dist/cli/commands/scaffold.d.ts +0 -1
- package/dist/cli/commands/scaffold.js +0 -1
- package/dist/cli/commands/sdd.d.ts +0 -1
- package/dist/cli/commands/sdd.js +0 -1
- package/dist/cli/commands/security.d.ts +0 -1
- package/dist/cli/commands/security.js +2 -2
- package/dist/cli/commands/spec/validator.d.ts +3 -1
- package/dist/cli/commands/spec/validator.js +12 -13
- package/dist/cli/commands/spec-baseline-check.d.ts +0 -1
- package/dist/cli/commands/spec-baseline-check.js +22 -5
- package/dist/cli/commands/spec.d.ts +0 -1
- package/dist/cli/commands/spec.js +0 -1
- package/dist/cli/commands/status.d.ts +0 -1
- package/dist/cli/commands/status.js +0 -1
- package/dist/cli/commands/sync-docs/agents-syncer.d.ts +0 -1
- package/dist/cli/commands/sync-docs/agents-syncer.js +0 -1
- package/dist/cli/commands/sync-docs/capabilities-syncer.d.ts +0 -1
- package/dist/cli/commands/sync-docs/capabilities-syncer.js +2 -2
- package/dist/cli/commands/sync-docs/compact.d.ts +0 -1
- package/dist/cli/commands/sync-docs/compact.js +0 -1
- package/dist/cli/commands/sync-docs/context-syncer.d.ts +0 -1
- package/dist/cli/commands/sync-docs/context-syncer.js +0 -1
- package/dist/cli/commands/sync-docs/gate.d.ts +0 -1
- package/dist/cli/commands/sync-docs/gate.js +0 -1
- package/dist/cli/commands/sync-docs/head-gate.d.ts +0 -1
- package/dist/cli/commands/sync-docs/head-gate.js +0 -1
- package/dist/cli/commands/sync-docs/index.d.ts +0 -1
- package/dist/cli/commands/sync-docs/index.js +0 -1
- package/dist/cli/commands/sync-docs/main-flow.d.ts +0 -1
- package/dist/cli/commands/sync-docs/main-flow.js +0 -1
- package/dist/cli/commands/sync-docs/preserve-block.d.ts +0 -1
- package/dist/cli/commands/sync-docs/preserve-block.js +0 -1
- package/dist/cli/commands/sync-docs/project-reader.d.ts +0 -1
- package/dist/cli/commands/sync-docs/project-reader.js +0 -1
- package/dist/cli/commands/sync-docs/sync-output.d.ts +0 -1
- package/dist/cli/commands/sync-docs/sync-output.js +62 -47
- package/dist/cli/commands/sync-docs/sync-state.d.ts +0 -1
- package/dist/cli/commands/sync-docs/sync-state.js +0 -1
- package/dist/cli/commands/sync-docs/sync-writes.d.ts +0 -1
- package/dist/cli/commands/sync-docs/sync-writes.js +0 -1
- package/dist/cli/commands/validate.d.ts +0 -1
- package/dist/cli/commands/validate.js +5 -3
- package/dist/cli/gate-command.d.ts +0 -1
- package/dist/cli/gate-command.js +2 -2
- package/dist/cli/state-io.d.ts +0 -1
- package/dist/cli/state-io.js +0 -1
- package/dist/completion-checkers/classify.d.ts +0 -1
- package/dist/completion-checkers/classify.js +0 -1
- package/dist/completion-checkers/contract-presence.d.ts +0 -1
- package/dist/completion-checkers/contract-presence.js +0 -1
- package/dist/completion-checkers/glob-match.d.ts +0 -1
- package/dist/completion-checkers/glob-match.js +0 -1
- package/dist/completion-checkers/index.d.ts +0 -1
- package/dist/completion-checkers/index.js +0 -1
- package/dist/completion-checkers/phase-format.d.ts +0 -1
- package/dist/completion-checkers/phase-format.js +0 -1
- package/dist/completion-checkers/tdd-chain.d.ts +0 -1
- package/dist/completion-checkers/tdd-chain.js +0 -1
- package/dist/completion-checkers/types.d.ts +0 -1
- package/dist/completion-checkers/types.js +0 -1
- package/dist/context/index.d.ts +0 -1
- package/dist/context/index.js +0 -1
- package/dist/context/session-manager.d.ts +0 -1
- package/dist/context/session-manager.js +0 -1
- package/dist/context/types.d.ts +0 -1
- package/dist/context/types.js +0 -1
- package/dist/core/app-constraints-loader.d.ts +0 -1
- package/dist/core/app-constraints-loader.js +3 -3
- package/dist/core/constraint-lifecycle.d.ts +0 -1
- package/dist/core/constraint-lifecycle.js +0 -1
- package/dist/core/constraints/capabilities-parser.d.ts +0 -1
- package/dist/core/constraints/capabilities-parser.js +0 -1
- package/dist/core/constraints/capabilities-reconcile.d.ts +0 -1
- package/dist/core/constraints/capabilities-reconcile.js +0 -1
- package/dist/core/constraints/check-cache.d.ts +0 -1
- package/dist/core/constraints/check-cache.js +0 -1
- package/dist/core/constraints/checker.d.ts +0 -2
- package/dist/core/constraints/checker.js +1 -4
- package/dist/core/constraints/checkers/capability-sync.d.ts +0 -1
- package/dist/core/constraints/checkers/capability-sync.js +2 -2
- package/dist/core/constraints/checkers/context-doc-sync.d.ts +0 -1
- package/dist/core/constraints/checkers/context-doc-sync.js +0 -1
- package/dist/core/constraints/checkers/docs-freshness.d.ts +0 -1
- package/dist/core/constraints/checkers/docs-freshness.js +2 -2
- package/dist/core/constraints/checkers/governance-presence.d.ts +0 -1
- package/dist/core/constraints/checkers/governance-presence.js +0 -1
- package/dist/core/constraints/checkers/index.d.ts +0 -1
- package/dist/core/constraints/checkers/index.js +0 -1
- package/dist/core/constraints/checkers/no-completion-without-verification.d.ts +0 -1
- package/dist/core/constraints/checkers/no-completion-without-verification.js +2 -2
- package/dist/core/constraints/checkers/no-hardcoded-credentials.d.ts +0 -1
- package/dist/core/constraints/checkers/no-hardcoded-credentials.js +0 -1
- package/dist/core/constraints/checkers/no-test-simplification.d.ts +0 -1
- package/dist/core/constraints/checkers/no-test-simplification.js +2 -2
- package/dist/core/constraints/checkers/templated/exec.d.ts +0 -1
- package/dist/core/constraints/checkers/templated/exec.js +0 -1
- package/dist/core/constraints/checkers/templated/file-exists.d.ts +3 -2
- package/dist/core/constraints/checkers/templated/file-exists.js +14 -40
- package/dist/core/constraints/checkers/templated/glob.d.ts +0 -1
- package/dist/core/constraints/checkers/templated/glob.js +0 -1
- package/dist/core/constraints/checkers/templated/index.d.ts +0 -1
- package/dist/core/constraints/checkers/templated/index.js +0 -1
- package/dist/core/constraints/checkers/templated/regex-scan.d.ts +0 -1
- package/dist/core/constraints/checkers/templated/regex-scan.js +2 -2
- package/dist/core/constraints/checkers/types.d.ts +0 -1
- package/dist/core/constraints/checkers/types.js +0 -1
- package/dist/core/constraints/construction-sites.d.ts +0 -1
- package/dist/core/constraints/construction-sites.js +0 -1
- package/dist/core/constraints/context-builder.d.ts +0 -1
- package/dist/core/constraints/context-builder.js +0 -1
- package/dist/core/constraints/context-reconcile.d.ts +0 -1
- package/dist/core/constraints/context-reconcile.js +0 -1
- package/dist/core/constraints/definitions/errors.d.ts +0 -1
- package/dist/core/constraints/definitions/errors.js +0 -1
- package/dist/core/constraints/definitions/warnings.d.ts +0 -1
- package/dist/core/constraints/definitions/warnings.js +0 -1
- package/dist/core/constraints/definitions.d.ts +1 -6
- package/dist/core/constraints/definitions.js +0 -11
- package/dist/core/constraints/doc-freshness/check-changelog-version.d.ts +8 -0
- package/dist/core/constraints/doc-freshness/check-changelog-version.js +39 -0
- package/dist/core/constraints/doc-freshness/check-context-docs.d.ts +8 -0
- package/dist/core/constraints/doc-freshness/check-context-docs.js +32 -0
- package/dist/core/constraints/doc-freshness/check-doc-dir.d.ts +8 -0
- package/dist/core/constraints/doc-freshness/check-doc-dir.js +138 -0
- package/dist/core/constraints/doc-freshness/check-doc-regex-count.d.ts +16 -0
- package/dist/core/constraints/doc-freshness/check-doc-regex-count.js +131 -0
- package/dist/core/constraints/doc-freshness/runner.d.ts +8 -21
- package/dist/core/constraints/doc-freshness/runner.js +19 -313
- package/dist/core/constraints/find-constraint.d.ts +0 -1
- package/dist/core/constraints/find-constraint.js +0 -1
- package/dist/core/constraints/git-evidence.d.ts +0 -1
- package/dist/core/constraints/git-evidence.js +0 -1
- package/dist/core/constraints/governance-accessors.d.ts +0 -1
- package/dist/core/constraints/governance-accessors.js +0 -1
- package/dist/core/constraints/index.d.ts +2 -3
- package/dist/core/constraints/index.js +1 -4
- package/dist/core/constraints/injection-writer.d.ts +0 -13
- package/dist/core/constraints/injection-writer.js +0 -16
- package/dist/core/constraints/meta.d.ts +0 -1
- package/dist/core/constraints/meta.js +0 -1
- package/dist/core/constraints/pack-proposal.d.ts +0 -1
- package/dist/core/constraints/pack-proposal.js +5 -5
- package/dist/core/constraints/run-env.d.ts +0 -1
- package/dist/core/constraints/run-env.js +1 -2
- package/dist/core/constraints/triggers.d.ts +0 -1
- package/dist/core/constraints/triggers.js +0 -1
- package/dist/core/constraints/usage-report.d.ts +0 -12
- package/dist/core/constraints/usage-report.js +0 -16
- package/dist/core/effective-constraints.d.ts +0 -1
- package/dist/core/effective-constraints.js +0 -1
- package/dist/core/effective-set.d.ts +0 -1
- package/dist/core/effective-set.js +0 -1
- package/dist/core/project-config-loader.d.ts +0 -1
- package/dist/core/project-config-loader.js +0 -1
- package/dist/core/retired-constraints.d.ts +0 -1
- package/dist/core/retired-constraints.js +0 -1
- package/dist/core/spec/baseline-check.d.ts +5 -1
- package/dist/core/spec/baseline-check.js +0 -1
- package/dist/core/validators/check-handlers/command.d.ts +3 -4
- package/dist/core/validators/check-handlers/command.js +7 -22
- package/dist/core/validators/check-handlers/fail-result.d.ts +11 -0
- package/dist/core/validators/check-handlers/fail-result.js +15 -0
- package/dist/core/validators/check-handlers/file.d.ts +5 -6
- package/dist/core/validators/check-handlers/file.js +12 -33
- package/dist/core/validators/check-handlers/http.d.ts +3 -4
- package/dist/core/validators/check-handlers/http.js +7 -22
- package/dist/core/validators/check-handlers/output.d.ts +5 -6
- package/dist/core/validators/check-handlers/output.js +8 -28
- package/dist/core/validators/checkpoint.d.ts +7 -1
- package/dist/core/validators/checkpoint.js +66 -7
- package/dist/core/validators/cso.d.ts +0 -1
- package/dist/core/validators/cso.js +0 -1
- package/dist/core/validators/index.d.ts +1 -2
- package/dist/core/validators/index.js +1 -3
- package/dist/core/validators/passes-gate.d.ts +0 -5
- package/dist/core/validators/passes-gate.js +2 -9
- package/dist/core/validators/test-output.d.ts +0 -1
- package/dist/core/validators/test-output.js +0 -1
- package/dist/failure/classifier.d.ts +1 -2
- package/dist/failure/classifier.js +0 -1
- package/dist/failure/error-types.d.ts +48 -5
- package/dist/failure/error-types.js +5 -4
- package/dist/failure/index.d.ts +1 -2
- package/dist/failure/index.js +3 -3
- package/dist/failure/recorder.d.ts +1 -2
- package/dist/failure/recorder.js +0 -1
- package/dist/gates/acceptance.d.ts +0 -36
- package/dist/gates/acceptance.js +5 -59
- package/dist/gates/blacklist-rules.d.ts +12 -0
- package/dist/gates/blacklist-rules.js +227 -0
- package/dist/gates/command.d.ts +1 -5
- package/dist/gates/command.js +5 -219
- package/dist/gates/contract.d.ts +0 -1
- package/dist/gates/contract.js +0 -1
- package/dist/gates/coverage.d.ts +13 -0
- package/dist/gates/coverage.js +63 -0
- package/dist/gates/decision.d.ts +0 -1
- package/dist/gates/decision.js +0 -1
- package/dist/gates/definitions.d.ts +4 -4
- package/dist/gates/definitions.js +4 -4
- package/dist/gates/performance.d.ts +0 -1
- package/dist/gates/performance.js +6 -12
- package/dist/gates/review.d.ts +22 -1
- package/dist/gates/review.js +4 -3
- package/dist/gates/security.d.ts +0 -1
- package/dist/gates/security.js +10 -2
- package/dist/gates/tasks-file.d.ts +41 -0
- package/dist/gates/tasks-file.js +63 -0
- package/dist/gates/types.d.ts +0 -1
- package/dist/gates/types.js +2 -2
- package/dist/index.d.ts +7 -9
- package/dist/index.js +4 -18
- package/dist/knowledge/audit-dimensions.d.ts +0 -1
- package/dist/knowledge/audit-dimensions.js +0 -1
- package/dist/knowledge/audit-rules.d.ts +0 -1
- package/dist/knowledge/audit-rules.js +0 -1
- package/dist/knowledge/audit-scoring.d.ts +0 -1
- package/dist/knowledge/audit-scoring.js +0 -1
- package/dist/knowledge/audit.d.ts +0 -1
- package/dist/knowledge/audit.js +0 -1
- package/dist/knowledge/cold-start.d.ts +0 -1
- package/dist/knowledge/cold-start.js +8 -7
- package/dist/knowledge/flywheel-metrics.d.ts +0 -1
- package/dist/knowledge/flywheel-metrics.js +0 -1
- package/dist/knowledge/index-generator.d.ts +0 -1
- package/dist/knowledge/index-generator.js +8 -9
- package/dist/knowledge/index.d.ts +0 -1
- package/dist/knowledge/index.js +0 -1
- package/dist/knowledge/ingest.d.ts +0 -1
- package/dist/knowledge/ingest.js +0 -1
- package/dist/knowledge/lifecycle.d.ts +0 -1
- package/dist/knowledge/lifecycle.js +0 -1
- package/dist/knowledge/query.d.ts +0 -1
- package/dist/knowledge/query.js +0 -1
- package/dist/knowledge/store.d.ts +0 -1
- package/dist/knowledge/store.js +14 -11
- package/dist/knowledge/token-estimate.d.ts +0 -1
- package/dist/knowledge/token-estimate.js +0 -1
- package/dist/knowledge/tree-walker.d.ts +0 -1
- package/dist/knowledge/tree-walker.js +0 -1
- package/dist/knowledge/types.d.ts +0 -1
- package/dist/knowledge/types.js +0 -1
- package/dist/monitoring/index.d.ts +1 -2
- package/dist/monitoring/index.js +1 -3
- package/dist/monitoring/trace-analyzer.d.ts +0 -1
- package/dist/monitoring/trace-analyzer.js +32 -6
- package/dist/monitoring/traces.d.ts +0 -15
- package/dist/monitoring/traces.js +1 -17
- package/dist/presets/index.d.ts +0 -1
- package/dist/presets/index.js +0 -1
- package/dist/presets/standard.d.ts +0 -1
- package/dist/presets/standard.js +0 -1
- package/dist/pretool-use-hook.d.ts +0 -1
- package/dist/pretool-use-hook.js +0 -1
- package/dist/release/index.d.ts +0 -1
- package/dist/release/index.js +0 -1
- package/dist/release/integrity.d.ts +0 -1
- package/dist/release/integrity.js +0 -1
- package/dist/sdd/index-generator.d.ts +0 -2
- package/dist/sdd/index-generator.js +2 -5
- package/dist/types/checkpoint.d.ts +105 -33
- package/dist/types/checkpoint.js +0 -1
- package/dist/types/command-definition.d.ts +0 -1
- package/dist/types/command-definition.js +0 -1
- package/dist/types/command-io.d.ts +0 -1
- package/dist/types/command-io.js +0 -1
- package/dist/types/constraint.d.ts +0 -1
- package/dist/types/constraint.js +0 -1
- package/dist/types/cso.d.ts +0 -1
- package/dist/types/cso.js +0 -1
- package/dist/types/failure.d.ts +5 -53
- package/dist/types/failure.js +5 -9
- package/dist/types/gate.d.ts +0 -1
- package/dist/types/gate.js +0 -1
- package/dist/types/passes-gate.d.ts +10 -4
- package/dist/types/passes-gate.js +0 -1
- package/dist/types/project-config.d.ts +0 -1
- package/dist/types/project-config.js +0 -1
- package/dist/types/spec.d.ts +0 -7
- package/dist/types/spec.js +0 -1
- package/dist/types/trace.d.ts +0 -1
- package/dist/types/trace.js +0 -1
- package/dist/utils/attempt.d.ts +0 -1
- package/dist/utils/attempt.js +0 -1
- package/dist/utils/clip.d.ts +0 -1
- package/dist/utils/clip.js +0 -1
- package/dist/utils/date.d.ts +10 -0
- package/dist/utils/date.js +18 -0
- package/dist/utils/detect-source-roots.d.ts +0 -1
- package/dist/utils/detect-source-roots.js +0 -1
- package/dist/utils/diff-parse.d.ts +0 -1
- package/dist/utils/diff-parse.js +0 -1
- package/dist/utils/error.d.ts +10 -0
- package/dist/utils/error.js +15 -0
- package/dist/utils/exec.d.ts +0 -1
- package/dist/utils/exec.js +0 -1
- package/dist/utils/file-walk.d.ts +12 -3
- package/dist/utils/file-walk.js +20 -3
- package/dist/utils/frontmatter.d.ts +0 -1
- package/dist/utils/frontmatter.js +4 -4
- package/dist/utils/glob-match.d.ts +0 -1
- package/dist/utils/glob-match.js +0 -1
- package/dist/utils/guards.d.ts +0 -1
- package/dist/utils/guards.js +0 -1
- package/dist/utils/json-doc.d.ts +13 -0
- package/dist/utils/json-doc.js +54 -0
- package/dist/utils/jsonl.d.ts +0 -1
- package/dist/utils/jsonl.js +0 -1
- package/dist/utils/log-rotate.d.ts +0 -1
- package/dist/utils/log-rotate.js +0 -1
- package/dist/utils/numeric-flag.d.ts +0 -1
- package/dist/utils/numeric-flag.js +0 -1
- package/dist/utils/package-json.d.ts +0 -1
- package/dist/utils/package-json.js +0 -1
- package/dist/utils/package-version.d.ts +0 -1
- package/dist/utils/package-version.js +0 -1
- package/dist/utils/text.d.ts +18 -0
- package/dist/utils/text.js +26 -0
- package/dist/utils/yaml-edit.d.ts +2 -3
- package/dist/utils/yaml-edit.js +4 -5
- package/dist/utils/yaml.d.ts +13 -0
- package/dist/utils/yaml.js +19 -0
- package/package.json +2 -21
- package/CHANGELOG.md +0 -601
- package/dist/agents/index.d.ts.map +0 -1
- package/dist/agents/index.js.map +0 -1
- package/dist/agents/lifecycle.d.ts.map +0 -1
- package/dist/agents/lifecycle.js.map +0 -1
- package/dist/agents/types.d.ts.map +0 -1
- package/dist/agents/types.js.map +0 -1
- package/dist/bootstrap/bootstrap.d.ts.map +0 -1
- package/dist/bootstrap/bootstrap.js.map +0 -1
- package/dist/bootstrap/index.d.ts.map +0 -1
- package/dist/bootstrap/index.js.map +0 -1
- package/dist/cli/command-contract.d.ts.map +0 -1
- package/dist/cli/command-contract.js.map +0 -1
- package/dist/cli/commands/__tests__/gate-decision.d.ts.map +0 -1
- package/dist/cli/commands/__tests__/gate-decision.js.map +0 -1
- package/dist/cli/commands/acceptance.d.ts.map +0 -1
- package/dist/cli/commands/acceptance.js.map +0 -1
- package/dist/cli/commands/check.d.ts.map +0 -1
- package/dist/cli/commands/check.js.map +0 -1
- package/dist/cli/commands/command.d.ts.map +0 -1
- package/dist/cli/commands/command.js.map +0 -1
- package/dist/cli/commands/constraints-disable.d.ts.map +0 -1
- package/dist/cli/commands/constraints-disable.js.map +0 -1
- package/dist/cli/commands/constraints-pack-proposal.d.ts.map +0 -1
- package/dist/cli/commands/constraints-pack-proposal.js.map +0 -1
- package/dist/cli/commands/constraints-reactivate.d.ts.map +0 -1
- package/dist/cli/commands/constraints-reactivate.js.map +0 -1
- package/dist/cli/commands/constraints-report.d.ts.map +0 -1
- package/dist/cli/commands/constraints-report.js.map +0 -1
- package/dist/cli/commands/constraints-retire.d.ts.map +0 -1
- package/dist/cli/commands/constraints-retire.js.map +0 -1
- package/dist/cli/commands/constraints.d.ts.map +0 -1
- package/dist/cli/commands/constraints.js.map +0 -1
- package/dist/cli/commands/contract.d.ts.map +0 -1
- package/dist/cli/commands/contract.js.map +0 -1
- package/dist/cli/commands/definitions.d.ts.map +0 -1
- package/dist/cli/commands/definitions.js.map +0 -1
- package/dist/cli/commands/failure.d.ts.map +0 -1
- package/dist/cli/commands/failure.js.map +0 -1
- package/dist/cli/commands/init/ci-platform.d.ts.map +0 -1
- package/dist/cli/commands/init/ci-platform.js.map +0 -1
- package/dist/cli/commands/init/ci-wiring.d.ts.map +0 -1
- package/dist/cli/commands/init/ci-wiring.js.map +0 -1
- package/dist/cli/commands/init/git-hooks.d.ts.map +0 -1
- package/dist/cli/commands/init/git-hooks.js.map +0 -1
- package/dist/cli/commands/init/governance.d.ts.map +0 -1
- package/dist/cli/commands/init/governance.js.map +0 -1
- package/dist/cli/commands/init/index.d.ts.map +0 -1
- package/dist/cli/commands/init/index.js.map +0 -1
- package/dist/cli/commands/init/output-style.d.ts.map +0 -1
- package/dist/cli/commands/init/output-style.js.map +0 -1
- package/dist/cli/commands/init/presets.d.ts.map +0 -1
- package/dist/cli/commands/init/presets.js.map +0 -1
- package/dist/cli/commands/init/snippets.d.ts.map +0 -1
- package/dist/cli/commands/init/snippets.js.map +0 -1
- package/dist/cli/commands/knowledge/audit.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/audit.js.map +0 -1
- package/dist/cli/commands/knowledge/decay.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/decay.js.map +0 -1
- package/dist/cli/commands/knowledge/health.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/health.js.map +0 -1
- package/dist/cli/commands/knowledge/import.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/import.js.map +0 -1
- package/dist/cli/commands/knowledge/index.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/index.js.map +0 -1
- package/dist/cli/commands/knowledge/list.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/list.js.map +0 -1
- package/dist/cli/commands/knowledge/search.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/search.js.map +0 -1
- package/dist/cli/commands/knowledge/shared.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/shared.js.map +0 -1
- package/dist/cli/commands/knowledge/snapshot.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/snapshot.js.map +0 -1
- package/dist/cli/commands/knowledge/stats.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/stats.js.map +0 -1
- package/dist/cli/commands/knowledge/store-access.d.ts.map +0 -1
- package/dist/cli/commands/knowledge/store-access.js.map +0 -1
- package/dist/cli/commands/knowledge-view.d.ts.map +0 -1
- package/dist/cli/commands/knowledge-view.js.map +0 -1
- package/dist/cli/commands/passes-gate.d.ts.map +0 -1
- package/dist/cli/commands/passes-gate.js.map +0 -1
- package/dist/cli/commands/performance.d.ts.map +0 -1
- package/dist/cli/commands/performance.js.map +0 -1
- package/dist/cli/commands/release.d.ts.map +0 -1
- package/dist/cli/commands/release.js.map +0 -1
- package/dist/cli/commands/report.d.ts.map +0 -1
- package/dist/cli/commands/report.js.map +0 -1
- package/dist/cli/commands/review.d.ts.map +0 -1
- package/dist/cli/commands/review.js.map +0 -1
- package/dist/cli/commands/scaffold-templates.d.ts.map +0 -1
- package/dist/cli/commands/scaffold-templates.js.map +0 -1
- package/dist/cli/commands/scaffold.d.ts.map +0 -1
- package/dist/cli/commands/scaffold.js.map +0 -1
- package/dist/cli/commands/sdd.d.ts.map +0 -1
- package/dist/cli/commands/sdd.js.map +0 -1
- package/dist/cli/commands/security.d.ts.map +0 -1
- package/dist/cli/commands/security.js.map +0 -1
- package/dist/cli/commands/spec/validator.d.ts.map +0 -1
- package/dist/cli/commands/spec/validator.js.map +0 -1
- package/dist/cli/commands/spec-baseline-check.d.ts.map +0 -1
- package/dist/cli/commands/spec-baseline-check.js.map +0 -1
- package/dist/cli/commands/spec.d.ts.map +0 -1
- package/dist/cli/commands/spec.js.map +0 -1
- package/dist/cli/commands/status.d.ts.map +0 -1
- package/dist/cli/commands/status.js.map +0 -1
- package/dist/cli/commands/sync-docs/agents-syncer.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/agents-syncer.js.map +0 -1
- package/dist/cli/commands/sync-docs/capabilities-syncer.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/capabilities-syncer.js.map +0 -1
- package/dist/cli/commands/sync-docs/compact.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/compact.js.map +0 -1
- package/dist/cli/commands/sync-docs/context-syncer.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/context-syncer.js.map +0 -1
- package/dist/cli/commands/sync-docs/gate.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/gate.js.map +0 -1
- package/dist/cli/commands/sync-docs/head-gate.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/head-gate.js.map +0 -1
- package/dist/cli/commands/sync-docs/index.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/index.js.map +0 -1
- package/dist/cli/commands/sync-docs/main-flow.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/main-flow.js.map +0 -1
- package/dist/cli/commands/sync-docs/preserve-block.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/preserve-block.js.map +0 -1
- package/dist/cli/commands/sync-docs/project-reader.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/project-reader.js.map +0 -1
- package/dist/cli/commands/sync-docs/sync-output.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/sync-output.js.map +0 -1
- package/dist/cli/commands/sync-docs/sync-state.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/sync-state.js.map +0 -1
- package/dist/cli/commands/sync-docs/sync-writes.d.ts.map +0 -1
- package/dist/cli/commands/sync-docs/sync-writes.js.map +0 -1
- package/dist/cli/commands/validate.d.ts.map +0 -1
- package/dist/cli/commands/validate.js.map +0 -1
- package/dist/cli/gate-command.d.ts.map +0 -1
- package/dist/cli/gate-command.js.map +0 -1
- package/dist/cli/state-io.d.ts.map +0 -1
- package/dist/cli/state-io.js.map +0 -1
- package/dist/completion-checkers/classify.d.ts.map +0 -1
- package/dist/completion-checkers/classify.js.map +0 -1
- package/dist/completion-checkers/contract-presence.d.ts.map +0 -1
- package/dist/completion-checkers/contract-presence.js.map +0 -1
- package/dist/completion-checkers/glob-match.d.ts.map +0 -1
- package/dist/completion-checkers/glob-match.js.map +0 -1
- package/dist/completion-checkers/index.d.ts.map +0 -1
- package/dist/completion-checkers/index.js.map +0 -1
- package/dist/completion-checkers/phase-format.d.ts.map +0 -1
- package/dist/completion-checkers/phase-format.js.map +0 -1
- package/dist/completion-checkers/tdd-chain.d.ts.map +0 -1
- package/dist/completion-checkers/tdd-chain.js.map +0 -1
- package/dist/completion-checkers/types.d.ts.map +0 -1
- package/dist/completion-checkers/types.js.map +0 -1
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js.map +0 -1
- package/dist/context/session-manager.d.ts.map +0 -1
- package/dist/context/session-manager.js.map +0 -1
- package/dist/context/types.d.ts.map +0 -1
- package/dist/context/types.js.map +0 -1
- package/dist/core/app-constraints-loader.d.ts.map +0 -1
- package/dist/core/app-constraints-loader.js.map +0 -1
- package/dist/core/config-files.d.ts +0 -21
- package/dist/core/config-files.d.ts.map +0 -1
- package/dist/core/config-files.js +0 -75
- package/dist/core/config-files.js.map +0 -1
- package/dist/core/constraint-lifecycle.d.ts.map +0 -1
- package/dist/core/constraint-lifecycle.js.map +0 -1
- package/dist/core/constraints/capabilities-parser.d.ts.map +0 -1
- package/dist/core/constraints/capabilities-parser.js.map +0 -1
- package/dist/core/constraints/capabilities-reconcile.d.ts.map +0 -1
- package/dist/core/constraints/capabilities-reconcile.js.map +0 -1
- package/dist/core/constraints/check-cache.d.ts.map +0 -1
- package/dist/core/constraints/check-cache.js.map +0 -1
- package/dist/core/constraints/checker.d.ts.map +0 -1
- package/dist/core/constraints/checker.js.map +0 -1
- package/dist/core/constraints/checkers/capability-sync.d.ts.map +0 -1
- package/dist/core/constraints/checkers/capability-sync.js.map +0 -1
- package/dist/core/constraints/checkers/context-doc-sync.d.ts.map +0 -1
- package/dist/core/constraints/checkers/context-doc-sync.js.map +0 -1
- package/dist/core/constraints/checkers/docs-freshness.d.ts.map +0 -1
- package/dist/core/constraints/checkers/docs-freshness.js.map +0 -1
- package/dist/core/constraints/checkers/governance-presence.d.ts.map +0 -1
- package/dist/core/constraints/checkers/governance-presence.js.map +0 -1
- package/dist/core/constraints/checkers/index.d.ts.map +0 -1
- package/dist/core/constraints/checkers/index.js.map +0 -1
- package/dist/core/constraints/checkers/no-completion-without-verification.d.ts.map +0 -1
- package/dist/core/constraints/checkers/no-completion-without-verification.js.map +0 -1
- package/dist/core/constraints/checkers/no-hardcoded-credentials.d.ts.map +0 -1
- package/dist/core/constraints/checkers/no-hardcoded-credentials.js.map +0 -1
- package/dist/core/constraints/checkers/no-test-simplification.d.ts.map +0 -1
- package/dist/core/constraints/checkers/no-test-simplification.js.map +0 -1
- package/dist/core/constraints/checkers/templated/exec.d.ts.map +0 -1
- package/dist/core/constraints/checkers/templated/exec.js.map +0 -1
- package/dist/core/constraints/checkers/templated/file-exists.d.ts.map +0 -1
- package/dist/core/constraints/checkers/templated/file-exists.js.map +0 -1
- package/dist/core/constraints/checkers/templated/glob.d.ts.map +0 -1
- package/dist/core/constraints/checkers/templated/glob.js.map +0 -1
- package/dist/core/constraints/checkers/templated/index.d.ts.map +0 -1
- package/dist/core/constraints/checkers/templated/index.js.map +0 -1
- package/dist/core/constraints/checkers/templated/regex-scan.d.ts.map +0 -1
- package/dist/core/constraints/checkers/templated/regex-scan.js.map +0 -1
- package/dist/core/constraints/checkers/types.d.ts.map +0 -1
- package/dist/core/constraints/checkers/types.js.map +0 -1
- package/dist/core/constraints/construction-sites.d.ts.map +0 -1
- package/dist/core/constraints/construction-sites.js.map +0 -1
- package/dist/core/constraints/context-builder.d.ts.map +0 -1
- package/dist/core/constraints/context-builder.js.map +0 -1
- package/dist/core/constraints/context-reconcile.d.ts.map +0 -1
- package/dist/core/constraints/context-reconcile.js.map +0 -1
- package/dist/core/constraints/definitions/errors.d.ts.map +0 -1
- package/dist/core/constraints/definitions/errors.js.map +0 -1
- package/dist/core/constraints/definitions/warnings.d.ts.map +0 -1
- package/dist/core/constraints/definitions/warnings.js.map +0 -1
- package/dist/core/constraints/definitions.d.ts.map +0 -1
- package/dist/core/constraints/definitions.js.map +0 -1
- package/dist/core/constraints/doc-freshness/runner.d.ts.map +0 -1
- package/dist/core/constraints/doc-freshness/runner.js.map +0 -1
- package/dist/core/constraints/find-constraint.d.ts.map +0 -1
- package/dist/core/constraints/find-constraint.js.map +0 -1
- package/dist/core/constraints/git-evidence.d.ts.map +0 -1
- package/dist/core/constraints/git-evidence.js.map +0 -1
- package/dist/core/constraints/governance-accessors.d.ts.map +0 -1
- package/dist/core/constraints/governance-accessors.js.map +0 -1
- package/dist/core/constraints/index.d.ts.map +0 -1
- package/dist/core/constraints/index.js.map +0 -1
- package/dist/core/constraints/injection-writer.d.ts.map +0 -1
- package/dist/core/constraints/injection-writer.js.map +0 -1
- package/dist/core/constraints/meta.d.ts.map +0 -1
- package/dist/core/constraints/meta.js.map +0 -1
- package/dist/core/constraints/pack-proposal.d.ts.map +0 -1
- package/dist/core/constraints/pack-proposal.js.map +0 -1
- package/dist/core/constraints/run-env.d.ts.map +0 -1
- package/dist/core/constraints/run-env.js.map +0 -1
- package/dist/core/constraints/triggers.d.ts.map +0 -1
- package/dist/core/constraints/triggers.js.map +0 -1
- package/dist/core/constraints/usage-report.d.ts.map +0 -1
- package/dist/core/constraints/usage-report.js.map +0 -1
- package/dist/core/effective-constraints.d.ts.map +0 -1
- package/dist/core/effective-constraints.js.map +0 -1
- package/dist/core/effective-set.d.ts.map +0 -1
- package/dist/core/effective-set.js.map +0 -1
- package/dist/core/index.d.ts +0 -16
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -42
- package/dist/core/index.js.map +0 -1
- package/dist/core/project-config-loader.d.ts.map +0 -1
- package/dist/core/project-config-loader.js.map +0 -1
- package/dist/core/retired-constraints.d.ts.map +0 -1
- package/dist/core/retired-constraints.js.map +0 -1
- package/dist/core/spec/baseline-check.d.ts.map +0 -1
- package/dist/core/spec/baseline-check.js.map +0 -1
- package/dist/core/validators/check-handlers/command.d.ts.map +0 -1
- package/dist/core/validators/check-handlers/command.js.map +0 -1
- package/dist/core/validators/check-handlers/file.d.ts.map +0 -1
- package/dist/core/validators/check-handlers/file.js.map +0 -1
- package/dist/core/validators/check-handlers/http.d.ts.map +0 -1
- package/dist/core/validators/check-handlers/http.js.map +0 -1
- package/dist/core/validators/check-handlers/output.d.ts.map +0 -1
- package/dist/core/validators/check-handlers/output.js.map +0 -1
- package/dist/core/validators/checkpoint.d.ts.map +0 -1
- package/dist/core/validators/checkpoint.js.map +0 -1
- package/dist/core/validators/cso.d.ts.map +0 -1
- package/dist/core/validators/cso.js.map +0 -1
- package/dist/core/validators/index.d.ts.map +0 -1
- package/dist/core/validators/index.js.map +0 -1
- package/dist/core/validators/passes-gate.d.ts.map +0 -1
- package/dist/core/validators/passes-gate.js.map +0 -1
- package/dist/core/validators/test-output.d.ts.map +0 -1
- package/dist/core/validators/test-output.js.map +0 -1
- package/dist/failure/classifier.d.ts.map +0 -1
- package/dist/failure/classifier.js.map +0 -1
- package/dist/failure/error-types.d.ts.map +0 -1
- package/dist/failure/error-types.js.map +0 -1
- package/dist/failure/index.d.ts.map +0 -1
- package/dist/failure/index.js.map +0 -1
- package/dist/failure/recorder.d.ts.map +0 -1
- package/dist/failure/recorder.js.map +0 -1
- package/dist/gates/acceptance.d.ts.map +0 -1
- package/dist/gates/acceptance.js.map +0 -1
- package/dist/gates/command.d.ts.map +0 -1
- package/dist/gates/command.js.map +0 -1
- package/dist/gates/contract.d.ts.map +0 -1
- package/dist/gates/contract.js.map +0 -1
- package/dist/gates/decision.d.ts.map +0 -1
- package/dist/gates/decision.js.map +0 -1
- package/dist/gates/definitions.d.ts.map +0 -1
- package/dist/gates/definitions.js.map +0 -1
- package/dist/gates/performance.d.ts.map +0 -1
- package/dist/gates/performance.js.map +0 -1
- package/dist/gates/registry.d.ts +0 -32
- package/dist/gates/registry.d.ts.map +0 -1
- package/dist/gates/registry.js +0 -91
- package/dist/gates/registry.js.map +0 -1
- package/dist/gates/review.d.ts.map +0 -1
- package/dist/gates/review.js.map +0 -1
- package/dist/gates/security.d.ts.map +0 -1
- package/dist/gates/security.js.map +0 -1
- package/dist/gates/types.d.ts.map +0 -1
- package/dist/gates/types.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/knowledge/audit-dimensions.d.ts.map +0 -1
- package/dist/knowledge/audit-dimensions.js.map +0 -1
- package/dist/knowledge/audit-rules.d.ts.map +0 -1
- package/dist/knowledge/audit-rules.js.map +0 -1
- package/dist/knowledge/audit-scoring.d.ts.map +0 -1
- package/dist/knowledge/audit-scoring.js.map +0 -1
- package/dist/knowledge/audit.d.ts.map +0 -1
- package/dist/knowledge/audit.js.map +0 -1
- package/dist/knowledge/cold-start.d.ts.map +0 -1
- package/dist/knowledge/cold-start.js.map +0 -1
- package/dist/knowledge/flywheel-metrics.d.ts.map +0 -1
- package/dist/knowledge/flywheel-metrics.js.map +0 -1
- package/dist/knowledge/index-generator.d.ts.map +0 -1
- package/dist/knowledge/index-generator.js.map +0 -1
- package/dist/knowledge/index.d.ts.map +0 -1
- package/dist/knowledge/index.js.map +0 -1
- package/dist/knowledge/ingest.d.ts.map +0 -1
- package/dist/knowledge/ingest.js.map +0 -1
- package/dist/knowledge/lifecycle.d.ts.map +0 -1
- package/dist/knowledge/lifecycle.js.map +0 -1
- package/dist/knowledge/query.d.ts.map +0 -1
- package/dist/knowledge/query.js.map +0 -1
- package/dist/knowledge/store.d.ts.map +0 -1
- package/dist/knowledge/store.js.map +0 -1
- package/dist/knowledge/token-estimate.d.ts.map +0 -1
- package/dist/knowledge/token-estimate.js.map +0 -1
- package/dist/knowledge/tree-walker.d.ts.map +0 -1
- package/dist/knowledge/tree-walker.js.map +0 -1
- package/dist/knowledge/types.d.ts.map +0 -1
- package/dist/knowledge/types.js.map +0 -1
- package/dist/monitoring/analyzer-base.d.ts +0 -29
- package/dist/monitoring/analyzer-base.d.ts.map +0 -1
- package/dist/monitoring/analyzer-base.js +0 -48
- package/dist/monitoring/analyzer-base.js.map +0 -1
- package/dist/monitoring/index.d.ts.map +0 -1
- package/dist/monitoring/index.js.map +0 -1
- package/dist/monitoring/trace-analyzer.d.ts.map +0 -1
- package/dist/monitoring/trace-analyzer.js.map +0 -1
- package/dist/monitoring/traces.d.ts.map +0 -1
- package/dist/monitoring/traces.js.map +0 -1
- package/dist/presets/index.d.ts.map +0 -1
- package/dist/presets/index.js.map +0 -1
- package/dist/presets/standard.d.ts.map +0 -1
- package/dist/presets/standard.js.map +0 -1
- package/dist/pretool-use-hook.d.ts.map +0 -1
- package/dist/pretool-use-hook.js.map +0 -1
- package/dist/release/index.d.ts.map +0 -1
- package/dist/release/index.js.map +0 -1
- package/dist/release/integrity.d.ts.map +0 -1
- package/dist/release/integrity.js.map +0 -1
- package/dist/sdd/index-generator.d.ts.map +0 -1
- package/dist/sdd/index-generator.js.map +0 -1
- package/dist/test-setup/jsonl-fake-fs.d.ts +0 -30
- package/dist/test-setup/jsonl-fake-fs.d.ts.map +0 -1
- package/dist/test-setup/jsonl-fake-fs.js +0 -49
- package/dist/test-setup/jsonl-fake-fs.js.map +0 -1
- package/dist/test-setup/mkdtemp-cleanup.d.ts +0 -9
- package/dist/test-setup/mkdtemp-cleanup.d.ts.map +0 -1
- package/dist/test-setup/mkdtemp-cleanup.js +0 -90
- package/dist/test-setup/mkdtemp-cleanup.js.map +0 -1
- package/dist/test-setup/project-fixture.d.ts +0 -48
- package/dist/test-setup/project-fixture.d.ts.map +0 -1
- package/dist/test-setup/project-fixture.js +0 -106
- package/dist/test-setup/project-fixture.js.map +0 -1
- package/dist/types/checkpoint.d.ts.map +0 -1
- package/dist/types/checkpoint.js.map +0 -1
- package/dist/types/command-definition.d.ts.map +0 -1
- package/dist/types/command-definition.js.map +0 -1
- package/dist/types/command-io.d.ts.map +0 -1
- package/dist/types/command-io.js.map +0 -1
- package/dist/types/constraint.d.ts.map +0 -1
- package/dist/types/constraint.js.map +0 -1
- package/dist/types/cso.d.ts.map +0 -1
- package/dist/types/cso.js.map +0 -1
- package/dist/types/failure.d.ts.map +0 -1
- package/dist/types/failure.js.map +0 -1
- package/dist/types/gate.d.ts.map +0 -1
- package/dist/types/gate.js.map +0 -1
- package/dist/types/passes-gate.d.ts.map +0 -1
- package/dist/types/passes-gate.js.map +0 -1
- package/dist/types/project-config.d.ts.map +0 -1
- package/dist/types/project-config.js.map +0 -1
- package/dist/types/spec.d.ts.map +0 -1
- package/dist/types/spec.js.map +0 -1
- package/dist/types/trace.d.ts.map +0 -1
- package/dist/types/trace.js.map +0 -1
- package/dist/utils/attempt.d.ts.map +0 -1
- package/dist/utils/attempt.js.map +0 -1
- package/dist/utils/clip.d.ts.map +0 -1
- package/dist/utils/clip.js.map +0 -1
- package/dist/utils/detect-source-roots.d.ts.map +0 -1
- package/dist/utils/detect-source-roots.js.map +0 -1
- package/dist/utils/diff-parse.d.ts.map +0 -1
- package/dist/utils/diff-parse.js.map +0 -1
- package/dist/utils/exec.d.ts.map +0 -1
- package/dist/utils/exec.js.map +0 -1
- package/dist/utils/file-walk.d.ts.map +0 -1
- package/dist/utils/file-walk.js.map +0 -1
- package/dist/utils/frontmatter.d.ts.map +0 -1
- package/dist/utils/frontmatter.js.map +0 -1
- package/dist/utils/glob-match.d.ts.map +0 -1
- package/dist/utils/glob-match.js.map +0 -1
- package/dist/utils/guards.d.ts.map +0 -1
- package/dist/utils/guards.js.map +0 -1
- package/dist/utils/jsonl.d.ts.map +0 -1
- package/dist/utils/jsonl.js.map +0 -1
- package/dist/utils/log-rotate.d.ts.map +0 -1
- package/dist/utils/log-rotate.js.map +0 -1
- package/dist/utils/numeric-flag.d.ts.map +0 -1
- package/dist/utils/numeric-flag.js.map +0 -1
- package/dist/utils/package-json.d.ts.map +0 -1
- package/dist/utils/package-json.js.map +0 -1
- package/dist/utils/package-version.d.ts.map +0 -1
- package/dist/utils/package-version.js.map +0 -1
- package/dist/utils/yaml-edit.d.ts.map +0 -1
- package/dist/utils/yaml-edit.js.map +0 -1
- package/src/CONTEXT.md +0 -64
- package/src/__tests__/acceptance-gate.test.ts +0 -339
- package/src/__tests__/app-constraints-loader.test.ts +0 -301
- package/src/__tests__/checker-extra.test.ts +0 -303
- package/src/__tests__/checker-primitives-sdk.test.ts +0 -55
- package/src/__tests__/checker.test.ts +0 -118
- package/src/__tests__/checkpoint.test.ts +0 -700
- package/src/__tests__/context-files-resolution.test.ts +0 -131
- package/src/__tests__/contract-gate.test.ts +0 -268
- package/src/__tests__/cso-validator.test.ts +0 -197
- package/src/__tests__/detect-source-roots.test.ts +0 -99
- package/src/__tests__/effective-constraints.test.ts +0 -114
- package/src/__tests__/error-classifier.test.ts +0 -263
- package/src/__tests__/exec-checker-full-chain.test.ts +0 -118
- package/src/__tests__/exec.test.ts +0 -55
- package/src/__tests__/failure-recorder.test.ts +0 -277
- package/src/__tests__/install-precommit-hook.test.ts +0 -61
- package/src/__tests__/iron-laws.test.ts +0 -221
- package/src/__tests__/layering.test.ts +0 -345
- package/src/__tests__/no-studio-references.test.ts +0 -62
- package/src/__tests__/passes-gate-check.test.ts +0 -154
- package/src/__tests__/passes-gate.test.ts +0 -171
- package/src/__tests__/performance-gate.test.ts +0 -54
- package/src/__tests__/pretool-use-hook.test.ts +0 -289
- package/src/__tests__/project-config-loader-extra.test.ts +0 -172
- package/src/__tests__/project-config-loader.test.ts +0 -141
- package/src/__tests__/public-exports.test.ts +0 -368
- package/src/__tests__/public-type-surface.test.ts +0 -305
- package/src/__tests__/public-value-surface.test.ts +0 -147
- package/src/__tests__/retired-constraints.test.ts +0 -99
- package/src/__tests__/review-gate.test.ts +0 -73
- package/src/__tests__/security-gate.test.ts +0 -67
- package/src/__tests__/skip-semantics.test.ts +0 -285
- package/src/__tests__/sub-barrels-explicit.test.ts +0 -87
- package/src/__tests__/test-fixture-hygiene.test.ts +0 -53
- package/src/__tests__/trace-analyzer-extra.test.ts +0 -101
- package/src/__tests__/trace-analyzer.test.ts +0 -182
- package/src/__tests__/trace-collector.test.ts +0 -206
- package/src/__tests__/traces.test.ts +0 -294
- package/src/__tests__/usage-report-public-export.test.ts +0 -21
- package/src/agents/CONTEXT.md +0 -19
- package/src/agents/__tests__/lifecycle.test.ts +0 -97
- package/src/agents/index.ts +0 -10
- package/src/agents/lifecycle.ts +0 -86
- package/src/agents/types.ts +0 -26
- package/src/bootstrap/CONTEXT.md +0 -24
- package/src/bootstrap/__tests__/bootstrap.test.ts +0 -155
- package/src/bootstrap/bootstrap.ts +0 -106
- package/src/bootstrap/index.ts +0 -11
- package/src/cli/__tests__/command-contract.test.ts +0 -188
- package/src/cli/__tests__/gate-command.test.ts +0 -162
- package/src/cli/__tests__/state-io.test.ts +0 -50
- package/src/cli/command-contract.ts +0 -111
- package/src/cli/commands/CONTEXT.md +0 -83
- package/src/cli/commands/__tests__/acceptance.test.ts +0 -186
- package/src/cli/commands/__tests__/bin-exit-mapping.test.ts +0 -122
- package/src/cli/commands/__tests__/check-read-count.test.ts +0 -159
- package/src/cli/commands/__tests__/check-skip-output.test.ts +0 -123
- package/src/cli/commands/__tests__/check.test.ts +0 -600
- package/src/cli/commands/__tests__/command-gate-dead-options.test.ts +0 -62
- package/src/cli/commands/__tests__/command.test.ts +0 -180
- package/src/cli/commands/__tests__/constraints-disable.test.ts +0 -229
- package/src/cli/commands/__tests__/constraints-pack-proposal.test.ts +0 -141
- package/src/cli/commands/__tests__/constraints-reactivate.test.ts +0 -210
- package/src/cli/commands/__tests__/constraints-report-json-flag.test.ts +0 -101
- package/src/cli/commands/__tests__/constraints-report.test.ts +0 -457
- package/src/cli/commands/__tests__/constraints-retire.test.ts +0 -532
- package/src/cli/commands/__tests__/context-syncer.test.ts +0 -141
- package/src/cli/commands/__tests__/contract.test.ts +0 -151
- package/src/cli/commands/__tests__/failure.test.ts +0 -196
- package/src/cli/commands/__tests__/gate-decision.ts +0 -30
- package/src/cli/commands/__tests__/init-dead-options.test.ts +0 -50
- package/src/cli/commands/__tests__/init-governance-io.test.ts +0 -98
- package/src/cli/commands/__tests__/init-ondisk.test.ts +0 -859
- package/src/cli/commands/__tests__/init.test.ts +0 -479
- package/src/cli/commands/__tests__/knowledge-audit-threshold.test.ts +0 -152
- package/src/cli/commands/__tests__/knowledge-flywheel-consistency.test.ts +0 -109
- package/src/cli/commands/__tests__/knowledge-tone-mapping.test.ts +0 -244
- package/src/cli/commands/__tests__/knowledge-view.test.ts +0 -719
- package/src/cli/commands/__tests__/knowledge.test.ts +0 -414
- package/src/cli/commands/__tests__/numeric-flag-assembly.test.ts +0 -369
- package/src/cli/commands/__tests__/passes-gate-dead-options.test.ts +0 -158
- package/src/cli/commands/__tests__/passes-gate.test.ts +0 -334
- package/src/cli/commands/__tests__/performance.test.ts +0 -102
- package/src/cli/commands/__tests__/pre-push-hook.test.ts +0 -181
- package/src/cli/commands/__tests__/project-path-anchoring.test.ts +0 -250
- package/src/cli/commands/__tests__/project-path-convention.test.ts +0 -260
- package/src/cli/commands/__tests__/registry.test.ts +0 -327
- package/src/cli/commands/__tests__/release.test.ts +0 -334
- package/src/cli/commands/__tests__/report-app-constraints.test.ts +0 -67
- package/src/cli/commands/__tests__/report-extra.test.ts +0 -79
- package/src/cli/commands/__tests__/report-false-green.test.ts +0 -50
- package/src/cli/commands/__tests__/report.test.ts +0 -111
- package/src/cli/commands/__tests__/review.test.ts +0 -162
- package/src/cli/commands/__tests__/scaffold.test.ts +0 -495
- package/src/cli/commands/__tests__/security-default-scan.test.ts +0 -75
- package/src/cli/commands/__tests__/security.test.ts +0 -242
- package/src/cli/commands/__tests__/spec-baseline-check.test.ts +0 -236
- package/src/cli/commands/__tests__/spec-baseline-index-cap.test.ts +0 -131
- package/src/cli/commands/__tests__/spec-baseline-read-count.test.ts +0 -325
- package/src/cli/commands/__tests__/spec.test.ts +0 -215
- package/src/cli/commands/__tests__/status-analysis-wiring.test.ts +0 -68
- package/src/cli/commands/__tests__/status-extra.test.ts +0 -163
- package/src/cli/commands/__tests__/status-skipped-lines.test.ts +0 -72
- package/src/cli/commands/__tests__/status.test.ts +0 -235
- package/src/cli/commands/__tests__/sync-docs-agents.test.ts +0 -638
- package/src/cli/commands/__tests__/sync-docs-construction-sites.test.ts +0 -175
- package/src/cli/commands/__tests__/sync-docs-context-drift.test.ts +0 -232
- package/src/cli/commands/__tests__/sync-docs-gate.test.ts +0 -154
- package/src/cli/commands/__tests__/sync-docs-module-order.test.ts +0 -111
- package/src/cli/commands/__tests__/sync-docs-read-count.test.ts +0 -192
- package/src/cli/commands/__tests__/sync-docs-table-layout.test.ts +0 -259
- package/src/cli/commands/__tests__/sync-docs.test.ts +0 -691
- package/src/cli/commands/__tests__/validate.test.ts +0 -195
- package/src/cli/commands/acceptance.ts +0 -118
- package/src/cli/commands/check.ts +0 -291
- package/src/cli/commands/command.ts +0 -106
- package/src/cli/commands/constraints-disable.ts +0 -94
- package/src/cli/commands/constraints-pack-proposal.ts +0 -79
- package/src/cli/commands/constraints-reactivate.ts +0 -112
- package/src/cli/commands/constraints-report.ts +0 -224
- package/src/cli/commands/constraints-retire.ts +0 -309
- package/src/cli/commands/constraints.ts +0 -30
- package/src/cli/commands/contract.ts +0 -187
- package/src/cli/commands/definitions.ts +0 -346
- package/src/cli/commands/failure.ts +0 -137
- package/src/cli/commands/init/ci-platform.ts +0 -66
- package/src/cli/commands/init/ci-wiring.ts +0 -48
- package/src/cli/commands/init/git-hooks.ts +0 -31
- package/src/cli/commands/init/governance.ts +0 -127
- package/src/cli/commands/init/index.ts +0 -156
- package/src/cli/commands/init/output-style.ts +0 -82
- package/src/cli/commands/init/presets.ts +0 -105
- package/src/cli/commands/init/snippets.ts +0 -57
- package/src/cli/commands/knowledge/audit.ts +0 -155
- package/src/cli/commands/knowledge/decay.ts +0 -57
- package/src/cli/commands/knowledge/health.ts +0 -180
- package/src/cli/commands/knowledge/import.ts +0 -82
- package/src/cli/commands/knowledge/index.ts +0 -60
- package/src/cli/commands/knowledge/list.ts +0 -73
- package/src/cli/commands/knowledge/search.ts +0 -92
- package/src/cli/commands/knowledge/shared.ts +0 -13
- package/src/cli/commands/knowledge/snapshot.ts +0 -38
- package/src/cli/commands/knowledge/stats.ts +0 -112
- package/src/cli/commands/knowledge/store-access.ts +0 -40
- package/src/cli/commands/knowledge-view.ts +0 -182
- package/src/cli/commands/passes-gate.ts +0 -167
- package/src/cli/commands/performance.ts +0 -92
- package/src/cli/commands/release.ts +0 -234
- package/src/cli/commands/report.ts +0 -145
- package/src/cli/commands/review.ts +0 -134
- package/src/cli/commands/scaffold-templates.ts +0 -377
- package/src/cli/commands/scaffold.ts +0 -291
- package/src/cli/commands/sdd.ts +0 -46
- package/src/cli/commands/security.ts +0 -240
- package/src/cli/commands/spec/__tests__/validator.test.ts +0 -417
- package/src/cli/commands/spec/validator.ts +0 -353
- package/src/cli/commands/spec-baseline-check.ts +0 -229
- package/src/cli/commands/spec.ts +0 -175
- package/src/cli/commands/status.ts +0 -162
- package/src/cli/commands/sync-docs/__tests__/construction-site-count.test.ts +0 -49
- package/src/cli/commands/sync-docs/__tests__/context-export-surface.test.ts +0 -102
- package/src/cli/commands/sync-docs/__tests__/module-descriptions.test.ts +0 -196
- package/src/cli/commands/sync-docs/agents-syncer.ts +0 -274
- package/src/cli/commands/sync-docs/capabilities-syncer.ts +0 -329
- package/src/cli/commands/sync-docs/compact.ts +0 -36
- package/src/cli/commands/sync-docs/context-syncer.ts +0 -241
- package/src/cli/commands/sync-docs/gate.ts +0 -78
- package/src/cli/commands/sync-docs/head-gate.ts +0 -87
- package/src/cli/commands/sync-docs/index.ts +0 -52
- package/src/cli/commands/sync-docs/main-flow.ts +0 -109
- package/src/cli/commands/sync-docs/preserve-block.ts +0 -59
- package/src/cli/commands/sync-docs/project-reader.ts +0 -211
- package/src/cli/commands/sync-docs/sync-output.ts +0 -218
- package/src/cli/commands/sync-docs/sync-state.ts +0 -327
- package/src/cli/commands/sync-docs/sync-writes.ts +0 -49
- package/src/cli/commands/validate.ts +0 -117
- package/src/cli/gate-command.ts +0 -87
- package/src/cli/state-io.ts +0 -60
- package/src/completion-checkers/CONTEXT.md +0 -25
- package/src/completion-checkers/__tests__/contract-presence.test.ts +0 -44
- package/src/completion-checkers/__tests__/phase-format.test.ts +0 -60
- package/src/completion-checkers/__tests__/tdd-chain.test.ts +0 -99
- package/src/completion-checkers/classify.ts +0 -47
- package/src/completion-checkers/contract-presence.ts +0 -40
- package/src/completion-checkers/glob-match.ts +0 -22
- package/src/completion-checkers/index.ts +0 -28
- package/src/completion-checkers/phase-format.ts +0 -48
- package/src/completion-checkers/tdd-chain.ts +0 -63
- package/src/completion-checkers/types.ts +0 -84
- package/src/context/CONTEXT.md +0 -20
- package/src/context/__tests__/session-manager.test.ts +0 -169
- package/src/context/index.ts +0 -16
- package/src/context/session-manager.ts +0 -185
- package/src/context/types.ts +0 -35
- package/src/core/CONTEXT.md +0 -43
- package/src/core/__tests__/config-files.test.ts +0 -88
- package/src/core/__tests__/constraint-lifecycle.test.ts +0 -255
- package/src/core/__tests__/constraints-meta.test.ts +0 -26
- package/src/core/__tests__/effective-set.test.ts +0 -56
- package/src/core/__tests__/pack-proposal.test.ts +0 -95
- package/src/core/app-constraints-loader.ts +0 -162
- package/src/core/config-files.ts +0 -39
- package/src/core/constraint-lifecycle.ts +0 -426
- package/src/core/constraints/__tests__/capabilities-reconcile.test.ts +0 -200
- package/src/core/constraints/__tests__/capability-counts.test.ts +0 -94
- package/src/core/constraints/__tests__/check-cache.test.ts +0 -98
- package/src/core/constraints/__tests__/collect-constraints.test.ts +0 -116
- package/src/core/constraints/__tests__/construction-sites.test.ts +0 -147
- package/src/core/constraints/__tests__/context-reconcile.test.ts +0 -246
- package/src/core/constraints/__tests__/git-evidence.test.ts +0 -225
- package/src/core/constraints/__tests__/injection-writer.test.ts +0 -178
- package/src/core/constraints/__tests__/run-env.test.ts +0 -262
- package/src/core/constraints/__tests__/trace-injection.test.ts +0 -76
- package/src/core/constraints/__tests__/triggers.test.ts +0 -71
- package/src/core/constraints/__tests__/usage-report.test.ts +0 -181
- package/src/core/constraints/capabilities-parser.ts +0 -213
- package/src/core/constraints/capabilities-reconcile.ts +0 -190
- package/src/core/constraints/check-cache.ts +0 -102
- package/src/core/constraints/checker.ts +0 -408
- package/src/core/constraints/checkers/__tests__/capability-sync.test.ts +0 -292
- package/src/core/constraints/checkers/__tests__/check-outcome.test.ts +0 -172
- package/src/core/constraints/checkers/__tests__/context-doc-sync.test.ts +0 -90
- package/src/core/constraints/checkers/__tests__/docs-freshness-degraded.test.ts +0 -91
- package/src/core/constraints/checkers/__tests__/docs-freshness.test.ts +0 -129
- package/src/core/constraints/checkers/__tests__/exec-checker.test.ts +0 -99
- package/src/core/constraints/checkers/__tests__/fixtures/public-repo-sanitization.mjs +0 -40
- package/src/core/constraints/checkers/__tests__/governance-presence.test.ts +0 -182
- package/src/core/constraints/checkers/__tests__/input-contract.test.ts +0 -111
- package/src/core/constraints/checkers/__tests__/no-completion-without-verification.test.ts +0 -228
- package/src/core/constraints/checkers/__tests__/no-hardcoded-credentials.test.ts +0 -232
- package/src/core/constraints/checkers/__tests__/no-test-simplification.test.ts +0 -182
- package/src/core/constraints/checkers/__tests__/templated-checkers.test.ts +0 -181
- package/src/core/constraints/checkers/__tests__/templates-registry.test.ts +0 -79
- package/src/core/constraints/checkers/__tests__/three-state-consistency.test.ts +0 -158
- package/src/core/constraints/checkers/capability-sync.ts +0 -134
- package/src/core/constraints/checkers/context-doc-sync.ts +0 -42
- package/src/core/constraints/checkers/docs-freshness.ts +0 -156
- package/src/core/constraints/checkers/governance-presence.ts +0 -60
- package/src/core/constraints/checkers/index.ts +0 -142
- package/src/core/constraints/checkers/no-completion-without-verification.ts +0 -141
- package/src/core/constraints/checkers/no-hardcoded-credentials.ts +0 -185
- package/src/core/constraints/checkers/no-test-simplification.ts +0 -118
- package/src/core/constraints/checkers/templated/exec.ts +0 -133
- package/src/core/constraints/checkers/templated/file-exists.ts +0 -75
- package/src/core/constraints/checkers/templated/glob.ts +0 -13
- package/src/core/constraints/checkers/templated/index.ts +0 -13
- package/src/core/constraints/checkers/templated/regex-scan.ts +0 -113
- package/src/core/constraints/checkers/types.ts +0 -239
- package/src/core/constraints/construction-sites.ts +0 -95
- package/src/core/constraints/context-builder.ts +0 -119
- package/src/core/constraints/context-reconcile.ts +0 -200
- package/src/core/constraints/definitions/errors.ts +0 -69
- package/src/core/constraints/definitions/warnings.ts +0 -108
- package/src/core/constraints/definitions.ts +0 -59
- package/src/core/constraints/doc-freshness/__tests__/runner.test.ts +0 -576
- package/src/core/constraints/doc-freshness/runner.ts +0 -471
- package/src/core/constraints/find-constraint.ts +0 -24
- package/src/core/constraints/git-evidence.ts +0 -138
- package/src/core/constraints/governance-accessors.ts +0 -74
- package/src/core/constraints/index.ts +0 -52
- package/src/core/constraints/injection-writer.ts +0 -164
- package/src/core/constraints/meta.ts +0 -40
- package/src/core/constraints/pack-proposal.ts +0 -168
- package/src/core/constraints/run-env.ts +0 -151
- package/src/core/constraints/triggers.ts +0 -38
- package/src/core/constraints/usage-report.ts +0 -361
- package/src/core/effective-constraints.ts +0 -93
- package/src/core/effective-set.ts +0 -40
- package/src/core/index.ts +0 -80
- package/src/core/project-config-loader.ts +0 -163
- package/src/core/retired-constraints.ts +0 -77
- package/src/core/spec/baseline-check.ts +0 -300
- package/src/core/validators/__tests__/command-success-output.test.ts +0 -56
- package/src/core/validators/__tests__/http-retry-sleep.test.ts +0 -231
- package/src/core/validators/__tests__/passes-gate-counts.test.ts +0 -52
- package/src/core/validators/__tests__/passes-gate.test.ts +0 -70
- package/src/core/validators/__tests__/test-output.test.ts +0 -372
- package/src/core/validators/check-handlers/command.ts +0 -101
- package/src/core/validators/check-handlers/file.ts +0 -147
- package/src/core/validators/check-handlers/http.ts +0 -101
- package/src/core/validators/check-handlers/output.ts +0 -166
- package/src/core/validators/checkpoint.ts +0 -141
- package/src/core/validators/cso.ts +0 -113
- package/src/core/validators/index.ts +0 -23
- package/src/core/validators/passes-gate.ts +0 -292
- package/src/core/validators/test-output.ts +0 -128
- package/src/failure/CONTEXT.md +0 -27
- package/src/failure/__tests__/recorder.test.ts +0 -169
- package/src/failure/classifier.ts +0 -116
- package/src/failure/error-types.ts +0 -122
- package/src/failure/index.ts +0 -37
- package/src/failure/recorder.ts +0 -138
- package/src/gates/CONTEXT.md +0 -47
- package/src/gates/__tests__/acceptance-types-single-source.test.ts +0 -71
- package/src/gates/__tests__/acceptance.test.ts +0 -498
- package/src/gates/__tests__/command-single-predicate.test.ts +0 -90
- package/src/gates/__tests__/command.test.ts +0 -239
- package/src/gates/__tests__/contract.test.ts +0 -73
- package/src/gates/__tests__/decision.test.ts +0 -35
- package/src/gates/__tests__/gate-interface.test.ts +0 -180
- package/src/gates/__tests__/performance.test.ts +0 -254
- package/src/gates/__tests__/registry.test.ts +0 -87
- package/src/gates/__tests__/review.test.ts +0 -278
- package/src/gates/__tests__/security-default-scan.test.ts +0 -100
- package/src/gates/__tests__/security.test.ts +0 -288
- package/src/gates/__tests__/test-verdict-consistency.test.ts +0 -140
- package/src/gates/acceptance.ts +0 -494
- package/src/gates/command.ts +0 -414
- package/src/gates/contract.ts +0 -215
- package/src/gates/decision.ts +0 -27
- package/src/gates/definitions.ts +0 -186
- package/src/gates/performance.ts +0 -243
- package/src/gates/registry.ts +0 -108
- package/src/gates/review.ts +0 -196
- package/src/gates/security.ts +0 -211
- package/src/gates/types.ts +0 -208
- package/src/index.ts +0 -368
- package/src/knowledge/CONTEXT.md +0 -63
- package/src/knowledge/__tests__/audit-labels.test.ts +0 -47
- package/src/knowledge/__tests__/audit-scoring.test.ts +0 -232
- package/src/knowledge/__tests__/audit-write-count.test.ts +0 -131
- package/src/knowledge/__tests__/audit.test.ts +0 -737
- package/src/knowledge/__tests__/flywheel-metrics.test.ts +0 -135
- package/src/knowledge/__tests__/import.test.ts +0 -420
- package/src/knowledge/__tests__/index-generator.test.ts +0 -388
- package/src/knowledge/__tests__/ingest-validate-entry.test.ts +0 -235
- package/src/knowledge/__tests__/ingest.test.ts +0 -529
- package/src/knowledge/__tests__/lifecycle.test.ts +0 -1040
- package/src/knowledge/__tests__/query.test.ts +0 -336
- package/src/knowledge/__tests__/store.test.ts +0 -863
- package/src/knowledge/__tests__/token-estimate.test.ts +0 -54
- package/src/knowledge/__tests__/tree-walker.test.ts +0 -124
- package/src/knowledge/audit-dimensions.ts +0 -190
- package/src/knowledge/audit-rules.ts +0 -339
- package/src/knowledge/audit-scoring.ts +0 -101
- package/src/knowledge/audit.ts +0 -149
- package/src/knowledge/cold-start.ts +0 -454
- package/src/knowledge/flywheel-metrics.ts +0 -71
- package/src/knowledge/index-generator.ts +0 -230
- package/src/knowledge/index.ts +0 -40
- package/src/knowledge/ingest.ts +0 -412
- package/src/knowledge/lifecycle.ts +0 -457
- package/src/knowledge/query.ts +0 -253
- package/src/knowledge/store.ts +0 -493
- package/src/knowledge/token-estimate.ts +0 -27
- package/src/knowledge/tree-walker.ts +0 -29
- package/src/knowledge/types.ts +0 -169
- package/src/monitoring/CONTEXT.md +0 -28
- package/src/monitoring/__tests__/prune-trace-logs.test.ts +0 -76
- package/src/monitoring/__tests__/skipped-lines-report.test.ts +0 -165
- package/src/monitoring/__tests__/trace-file-anchoring.test.ts +0 -80
- package/src/monitoring/__tests__/traces.test.ts +0 -195
- package/src/monitoring/analyzer-base.ts +0 -45
- package/src/monitoring/index.ts +0 -10
- package/src/monitoring/trace-analyzer.ts +0 -236
- package/src/monitoring/traces.ts +0 -316
- package/src/presets/__tests__/standard.test.ts +0 -65
- package/src/presets/index.ts +0 -12
- package/src/presets/standard.ts +0 -71
- package/src/pretool-use-hook.ts +0 -167
- package/src/release/CONTEXT.md +0 -24
- package/src/release/__tests__/barrel.test.ts +0 -60
- package/src/release/__tests__/integrity.test.ts +0 -162
- package/src/release/index.ts +0 -2
- package/src/release/integrity.ts +0 -138
- package/src/sdd/__tests__/index-generator.test.ts +0 -221
- package/src/sdd/index-generator.ts +0 -113
- package/src/test-setup/__tests__/jsonl-fake-fs.test.ts +0 -98
- package/src/test-setup/__tests__/mkdtemp-cleanup.test.ts +0 -45
- package/src/test-setup/__tests__/project-fixture.test.ts +0 -178
- package/src/test-setup/jsonl-fake-fs.ts +0 -59
- package/src/test-setup/mkdtemp-cleanup.ts +0 -83
- package/src/test-setup/project-fixture.ts +0 -87
- package/src/types/__tests__/types.test.ts +0 -53
- package/src/types/checkpoint.ts +0 -180
- package/src/types/command-definition.ts +0 -85
- package/src/types/command-io.ts +0 -14
- package/src/types/constraint.ts +0 -247
- package/src/types/cso.ts +0 -37
- package/src/types/failure.ts +0 -67
- package/src/types/gate.ts +0 -77
- package/src/types/passes-gate.ts +0 -130
- package/src/types/project-config.ts +0 -251
- package/src/types/spec.ts +0 -87
- package/src/types/trace.ts +0 -233
- package/src/utils/__tests__/attempt.test.ts +0 -94
- package/src/utils/__tests__/file-walk.test.ts +0 -54
- package/src/utils/__tests__/frontmatter.test.ts +0 -206
- package/src/utils/__tests__/glob-match.test.ts +0 -52
- package/src/utils/__tests__/jsonl-bounded-read.test.ts +0 -106
- package/src/utils/__tests__/jsonl-skip-disposition.test.ts +0 -174
- package/src/utils/__tests__/jsonl.test.ts +0 -234
- package/src/utils/__tests__/numeric-flag.test.ts +0 -80
- package/src/utils/__tests__/package-json.test.ts +0 -58
- package/src/utils/__tests__/package-version.test.ts +0 -116
- package/src/utils/__tests__/yaml-edit.test.ts +0 -62
- package/src/utils/attempt.ts +0 -35
- package/src/utils/clip.ts +0 -12
- package/src/utils/detect-source-roots.ts +0 -90
- package/src/utils/diff-parse.ts +0 -80
- package/src/utils/exec.ts +0 -16
- package/src/utils/file-walk.ts +0 -103
- package/src/utils/frontmatter.ts +0 -121
- package/src/utils/glob-match.ts +0 -41
- package/src/utils/guards.ts +0 -8
- package/src/utils/jsonl.ts +0 -276
- package/src/utils/log-rotate.ts +0 -43
- package/src/utils/numeric-flag.ts +0 -86
- package/src/utils/package-json.ts +0 -61
- package/src/utils/package-version.ts +0 -25
- package/src/utils/yaml-edit.ts +0 -67
|
@@ -1,859 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* init 落盘集成测试(harness#132)
|
|
3
|
-
*
|
|
4
|
-
* init.test.ts 把 fs/promises 整体 mock 掉,只能看到「调过 writeFile」,看不到
|
|
5
|
-
* 真写出了什么内容。本文件不 mock 任何 IO:在临时目录里真跑两遍 init——
|
|
6
|
-
* 第一遍断言 8 个受管文件的落盘字节,第二遍(文件已在场且被用户改过)断言
|
|
7
|
-
* 8 站点各自的第三态、用户内容一字节不动、以及「打印片段 == 真正落盘的内容」。
|
|
8
|
-
* ADR-0029:custom-constraints.yml 示例站与 AGENTS.md 治理契约段 writer 已随
|
|
9
|
-
* 文本注入层关停移除,落盘集合同步收缩。
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import * as fs from 'fs/promises';
|
|
13
|
-
import * as os from 'os';
|
|
14
|
-
import * as path from 'path';
|
|
15
|
-
import * as yaml from 'js-yaml';
|
|
16
|
-
import { init, type InitOptions } from '../init';
|
|
17
|
-
import { captureIO, type CapturingIO } from '../../command-contract';
|
|
18
|
-
|
|
19
|
-
jest.mock('chalk', () => ({
|
|
20
|
-
blue: jest.fn((s: string) => s),
|
|
21
|
-
yellow: jest.fn((s: string) => s),
|
|
22
|
-
green: jest.fn((s: string) => s),
|
|
23
|
-
gray: jest.fn((s: string) => s),
|
|
24
|
-
red: jest.fn((s: string) => s),
|
|
25
|
-
cyan: jest.fn((s: string) => s),
|
|
26
|
-
bold: jest.fn((s: string) => s),
|
|
27
|
-
}));
|
|
28
|
-
|
|
29
|
-
const INIT_OPTIONS = { preset: 'standard' as const, governance: 'standard' as const };
|
|
30
|
-
|
|
31
|
-
/** 版本号随发布漂移,冻结时归一化 */
|
|
32
|
-
function normalize(text: string, root: string): string {
|
|
33
|
-
return text.split(root).join('<P>').replace(/\(v[\d.]+\)/g, '(v*)');
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
async function makeProject(withGit = true): Promise<string> {
|
|
37
|
-
const root = await fs.mkdtemp(path.join(os.tmpdir(), 'harness-scaffold-'));
|
|
38
|
-
await fs.mkdir(path.join(root, 'src'));
|
|
39
|
-
await fs.writeFile(path.join(root, 'src', 'index.ts'), 'export const x = 1;\n');
|
|
40
|
-
if (withGit) await fs.mkdir(path.join(root, '.git'));
|
|
41
|
-
return root;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** expected 里的行按顺序出现在 lines 中(中间可夹片段正文等其他行) */
|
|
45
|
-
function expectOrderedSubsequence(lines: string[], expected: string[]): void {
|
|
46
|
-
let cursor = -1;
|
|
47
|
-
for (const want of expected) {
|
|
48
|
-
const found = lines.indexOf(want, cursor + 1);
|
|
49
|
-
if (found <= cursor) throw new Error(`第三态缺失或顺序错乱: ${want}\n实际输出:\n${lines.join('\n')}`);
|
|
50
|
-
cursor = found;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* .git/hooks/pre-push 的字节级冻结基线(harness#144;正本:`scaffold-templates.renderPrePushHook`)。
|
|
56
|
-
* 三道决定都在这里被钉住:整仓全量(`check` 不带 `--staged`)+ validate、任一失败 exit 1、
|
|
57
|
-
* 无增量解析/无逃生机制。改模板必须同步改这份基线——「同步」这个动作正是拦住门禁被削弱的地方。
|
|
58
|
-
*/
|
|
59
|
-
const PRE_PUSH_HOOK_BYTES = `#!/bin/sh
|
|
60
|
-
# Harness pre-push hook
|
|
61
|
-
|
|
62
|
-
echo "🔍 Running harness pre-push checks (whole repo)..."
|
|
63
|
-
|
|
64
|
-
# 分工:pre-commit 查暂存的(增量、快反馈),pre-push 查整仓的(全量、兜底)。
|
|
65
|
-
# 同一次改动跑两遍是设计使然——这道拦的是 git commit --no-verify 绕出去的内容。
|
|
66
|
-
# 本地 hook 只是自检与提醒,真正的门禁在服务端 CI;逃生口只有 git 原生 push --no-verify。
|
|
67
|
-
# 不解析 pre-push 从 stdin 收到的 ref 清单,子进程一律不给它读(< /dev/null)。
|
|
68
|
-
npx @dommaker/harness check < /dev/null
|
|
69
|
-
if [ $? -ne 0 ]; then
|
|
70
|
-
echo "❌ Iron law check failed"
|
|
71
|
-
exit 1
|
|
72
|
-
fi
|
|
73
|
-
|
|
74
|
-
npx @dommaker/harness validate < /dev/null
|
|
75
|
-
if [ $? -ne 0 ]; then
|
|
76
|
-
echo "❌ Validate failed"
|
|
77
|
-
exit 1
|
|
78
|
-
fi
|
|
79
|
-
|
|
80
|
-
echo "✅ All pre-push checks passed"
|
|
81
|
-
`;
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* src/CONTEXT.md 骨架的字节级冻结基线(harness#158;正本:`scaffold-templates.renderContextDoc('src')`)。
|
|
85
|
-
* #150 把 init 与 sync-docs 归一到单一正本后,「改正本无测试报警」成了新缺口(复审 M3:
|
|
86
|
-
* 给正本加一行 → 全绿)。改骨架必须同步改这份基线——「同步」这个动作正是拦住骨架被静改的地方。
|
|
87
|
-
*/
|
|
88
|
-
const CONTEXT_MD_BYTES = `# src
|
|
89
|
-
|
|
90
|
-
> 此文件描述 src 目录的职责和上下文
|
|
91
|
-
> 请阅读本目录的源代码,然后填写以下各节。
|
|
92
|
-
> 如果使用 AI 编码助手,将本文件内容作为 prompt 请求它分析并填写。
|
|
93
|
-
|
|
94
|
-
## 职责
|
|
95
|
-
|
|
96
|
-
<!-- 本目录的核心职责是什么 -->
|
|
97
|
-
|
|
98
|
-
## 核心导出
|
|
99
|
-
|
|
100
|
-
<!-- 本目录对外暴露的主要模块/函数 -->
|
|
101
|
-
|
|
102
|
-
## 依赖关系
|
|
103
|
-
|
|
104
|
-
<!-- 本目录依赖哪些其他模块,谁依赖本目录 -->
|
|
105
|
-
|
|
106
|
-
## 注意事项
|
|
107
|
-
|
|
108
|
-
<!-- 开发时需要注意的约束或约定 -->
|
|
109
|
-
`;
|
|
110
|
-
|
|
111
|
-
describe('init 真落盘(无 IO mock)', () => {
|
|
112
|
-
const roots: string[] = [];
|
|
113
|
-
|
|
114
|
-
afterAll(async () => {
|
|
115
|
-
await Promise.all(roots.map(root => fs.rm(root, { recursive: true, force: true })));
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
it('第一遍:受管文件逐字节落盘,整屏输出逐字冻结', async () => {
|
|
119
|
-
const root = await makeProject();
|
|
120
|
-
roots.push(root);
|
|
121
|
-
const io = captureIO();
|
|
122
|
-
|
|
123
|
-
expect(await init({ ...INIT_OPTIONS, projectPath: root }, io)).toEqual({ kind: 'ok' });
|
|
124
|
-
|
|
125
|
-
// 冻结的整屏 = scaffold 8 站点 + 治理段 writer 的落盘提示。#149 前 io 在
|
|
126
|
-
// setupGovernance 调用点被丢,治理 writer 的提示逃到 process.stdout、不进捕获面;
|
|
127
|
-
// io 贯通后它回到捕获面,真机输出的字节不变。
|
|
128
|
-
expect(normalize(io.outText(), root)).toBe(`🚀 初始化 harness 配置...
|
|
129
|
-
配置目录: <P>/.harness
|
|
130
|
-
预设: standard
|
|
131
|
-
治理级别: standard
|
|
132
|
-
✅ 已创建配置文件: <P>/.harness/config.yml (v*)
|
|
133
|
-
✅ 已创建示例检查点文件: <P>/.harness/checkpoints.yml
|
|
134
|
-
✅ 已创建 Resolutions 文件: <P>/.harness/resolutions.json
|
|
135
|
-
✅ 已创建 .git/hooks/pre-commit
|
|
136
|
-
✅ 已创建 .git/hooks/pre-push
|
|
137
|
-
✅ 已创建 .github/workflows/harness-check.yml
|
|
138
|
-
|
|
139
|
-
📋 设置治理文件...
|
|
140
|
-
✅ 已创建 CHANGELOG.md
|
|
141
|
-
✅ 已创建 src/CONTEXT.md
|
|
142
|
-
治理检查已由 harness-check.yml 覆盖,跳过创建 harness-governance.yml
|
|
143
|
-
|
|
144
|
-
✅ harness 初始化完成!
|
|
145
|
-
|
|
146
|
-
下一步:
|
|
147
|
-
1. 编辑 .harness/config.yml 自定义配置
|
|
148
|
-
2. 正常开发:每次 git commit 查暂存的(增量快反馈),每次 git push 查整仓的(全量兜底)——重复是设计使然
|
|
149
|
-
3. 运行 harness status 查看状态
|
|
150
|
-
|
|
151
|
-
💡 提示: 使用 harness init --print-snippets 查看配置代码片段
|
|
152
|
-
`);
|
|
153
|
-
|
|
154
|
-
const read = (rel: string) => fs.readFile(path.join(root, rel), 'utf-8');
|
|
155
|
-
|
|
156
|
-
const hook = await read('.git/hooks/pre-commit');
|
|
157
|
-
expect(hook.startsWith('#!/bin/sh\n# Harness pre-commit hook\n')).toBe(true);
|
|
158
|
-
expect(hook).toContain('echo "🔍 Running harness checks..."');
|
|
159
|
-
expect(hook).toContain('npx @dommaker/harness check --staged');
|
|
160
|
-
expect(hook.endsWith('echo "✅ All checks passed"\n')).toBe(true);
|
|
161
|
-
|
|
162
|
-
// 第 9 站点(#144):字节级冻结,改模板必须同步改这份基线(同 GITLAB_PLAIN 手法)
|
|
163
|
-
expect(await read('.git/hooks/pre-push')).toBe(PRE_PUSH_HOOK_BYTES);
|
|
164
|
-
|
|
165
|
-
expect(await read('.github/workflows/harness-check.yml')).toContain('name: Harness Check');
|
|
166
|
-
expect(await read('.harness/checkpoints.yml')).toContain('id: build-success');
|
|
167
|
-
expect(JSON.parse(await read('.harness/resolutions.json')).capability_sync).toBeDefined();
|
|
168
|
-
expect(await read('CHANGELOG.md')).toContain('Keep a Changelog');
|
|
169
|
-
// src/CONTEXT.md 骨架(#158):字节级冻结,同 PRE_PUSH_HOOK_BYTES 手法
|
|
170
|
-
expect(await read('src/CONTEXT.md')).toBe(CONTEXT_MD_BYTES);
|
|
171
|
-
|
|
172
|
-
for (const hookFile of ['.git/hooks/pre-commit', '.git/hooks/pre-push']) {
|
|
173
|
-
const stat = await fs.stat(path.join(root, hookFile));
|
|
174
|
-
expect(stat.mode & 0o111).toBeTruthy();
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
it('第二遍(harness 自己的文件在场):8 站点走冲突分支,打印片段即磁盘正文', async () => {
|
|
179
|
-
const root = await makeProject();
|
|
180
|
-
roots.push(root);
|
|
181
|
-
await init({ ...INIT_OPTIONS, projectPath: root }, captureIO());
|
|
182
|
-
|
|
183
|
-
const io = captureIO();
|
|
184
|
-
await init({ ...INIT_OPTIONS, projectPath: root }, io);
|
|
185
|
-
const lines = io.outLines();
|
|
186
|
-
|
|
187
|
-
// 顺序 = init 的落盘顺序;harness-governance.yml(末站)因既有 workflow 覆盖而跳过
|
|
188
|
-
expectOrderedSubsequence(lines, [
|
|
189
|
-
'checkpoints.yml 已存在,跳过',
|
|
190
|
-
'resolutions.json 已存在,跳过',
|
|
191
|
-
'⚠️ .git/hooks/pre-commit 已存在',
|
|
192
|
-
'💡 请手动添加以下内容到文件末尾:',
|
|
193
|
-
'⚠️ .git/hooks/pre-push 已存在',
|
|
194
|
-
'💡 请手动添加以下内容到文件末尾:',
|
|
195
|
-
'⚠️ 检测到已存在的 CI 配置:',
|
|
196
|
-
' - .github/workflows/harness-check.yml',
|
|
197
|
-
'💡 请手动添加以下内容到 jobs 中:',
|
|
198
|
-
'CHANGELOG.md 已存在',
|
|
199
|
-
'src/CONTEXT.md 已存在',
|
|
200
|
-
'治理检查已由 harness-check.yml 覆盖,跳过创建 harness-governance.yml',
|
|
201
|
-
]);
|
|
202
|
-
|
|
203
|
-
// 同源不变量(#103 判据):冲突分支打印的就是磁盘上那份正文
|
|
204
|
-
const hook = await fs.readFile(path.join(root, '.git/hooks/pre-commit'), 'utf-8');
|
|
205
|
-
expect(hook.startsWith('#!/bin/sh\n# Harness pre-commit hook\n')).toBe(true);
|
|
206
|
-
expect(io.outText()).toContain(hook.replace('#!/bin/sh\n# Harness pre-commit hook\n', ''));
|
|
207
|
-
const prePush = await fs.readFile(path.join(root, '.git/hooks/pre-push'), 'utf-8');
|
|
208
|
-
expect(prePush).toBe(PRE_PUSH_HOOK_BYTES);
|
|
209
|
-
expect(io.outText()).toContain(prePush.replace('#!/bin/sh\n# Harness pre-push hook\n', ''));
|
|
210
|
-
const workflow = await fs.readFile(path.join(root, '.github/workflows/harness-check.yml'), 'utf-8');
|
|
211
|
-
expect(io.outText()).toContain(workflow);
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
it('第三遍(用户已接管这些文件):一字节都不改', async () => {
|
|
215
|
-
const root = await makeProject();
|
|
216
|
-
roots.push(root);
|
|
217
|
-
await init({ ...INIT_OPTIONS, projectPath: root }, captureIO());
|
|
218
|
-
|
|
219
|
-
const userFiles = {
|
|
220
|
-
'.git/hooks/pre-commit': '#!/bin/sh\n# 我自己的钩子\n',
|
|
221
|
-
'.git/hooks/pre-push': '#!/bin/sh\n# 我自己的推送钩子\n',
|
|
222
|
-
'.github/workflows/harness-check.yml': 'name: 我自己的流水线\n',
|
|
223
|
-
'.harness/checkpoints.yml': 'checkpoints: []\n',
|
|
224
|
-
'.harness/resolutions.json': '{}\n',
|
|
225
|
-
'CHANGELOG.md': '# 我的更新日志\n',
|
|
226
|
-
'src/CONTEXT.md': '# src\n\n我写的\n',
|
|
227
|
-
} as const;
|
|
228
|
-
for (const [rel, content] of Object.entries(userFiles)) {
|
|
229
|
-
await fs.writeFile(path.join(root, rel), content);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
await init({ ...INIT_OPTIONS, projectPath: root }, captureIO());
|
|
233
|
-
|
|
234
|
-
for (const [rel, content] of Object.entries(userFiles)) {
|
|
235
|
-
expect(await fs.readFile(path.join(root, rel), 'utf-8')).toBe(content);
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
it('治理 CI 站点:github 下既有 workflow 不覆盖治理命令时自建,第二遍告知已存在', async () => {
|
|
240
|
-
const root = await makeProject(false);
|
|
241
|
-
roots.push(root);
|
|
242
|
-
// 用户自带的 workflow 不含治理命令:harness-check 站点走 manual(只打印不落盘),
|
|
243
|
-
// 治理命令无任何覆盖 → 自建 harness-governance.yml(本站点唯一会真落盘的场景)
|
|
244
|
-
await fs.mkdir(path.join(root, '.github/workflows'), { recursive: true });
|
|
245
|
-
await fs.writeFile(path.join(root, '.github/workflows/ci.yml'), 'name: 我自己的流水线\n');
|
|
246
|
-
const first = captureIO();
|
|
247
|
-
|
|
248
|
-
await init({ ...INIT_OPTIONS, projectPath: root }, first);
|
|
249
|
-
expect(normalize(first.outText(), root)).toContain('✅ 已创建 .github/workflows/harness-governance.yml');
|
|
250
|
-
const governance = await fs.readFile(path.join(root, '.github/workflows/harness-governance.yml'), 'utf-8');
|
|
251
|
-
expect(governance).toContain('name: Harness Governance');
|
|
252
|
-
expect(governance).toContain('npx @dommaker/harness passes-gate');
|
|
253
|
-
|
|
254
|
-
const second = captureIO();
|
|
255
|
-
await init({ ...INIT_OPTIONS, projectPath: root }, second);
|
|
256
|
-
expect(second.outLines()).toContain('harness-governance.yml 已存在');
|
|
257
|
-
expect(await fs.readFile(path.join(root, '.github/workflows/harness-governance.yml'), 'utf-8')).toBe(governance);
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
it('治理 CI 站点:--ci none(含 --no-github-actions 别名)带 -g 也一律不建(harness#156 裁决 F1)', async () => {
|
|
261
|
-
// 本用例原是「无 GH Actions 旗帜时自建」——钉的是 #143 有意保留的旧边界;
|
|
262
|
-
// #156 裁决 F1 走「none = 不创建任何 CI 文件」,旧断言整体翻面
|
|
263
|
-
const root = await makeProject(false);
|
|
264
|
-
roots.push(root);
|
|
265
|
-
const io = captureIO();
|
|
266
|
-
|
|
267
|
-
await init({ ...INIT_OPTIONS, githubActions: false, projectPath: root }, io);
|
|
268
|
-
|
|
269
|
-
expect(io.outLines()).toContain('⚠️ --no-github-actions 已废弃,请改用 --ci none');
|
|
270
|
-
expect(io.outText()).not.toContain('harness-governance.yml');
|
|
271
|
-
expect(await exists(path.join(root, '.github'))).toBe(false);
|
|
272
|
-
expect(await exists(path.join(root, '.gitlab-ci.yml'))).toBe(false);
|
|
273
|
-
// 治理文档面照常:CHANGELOG / CONTEXT.md 不受 CI 豁免影响
|
|
274
|
-
expect(await exists(path.join(root, 'CHANGELOG.md'))).toBe(true);
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
it('无 .git 与无源码目录时仍按原措辞告知,不写任何文件', async () => {
|
|
278
|
-
const root = await makeProject(false);
|
|
279
|
-
roots.push(root);
|
|
280
|
-
await fs.rm(path.join(root, 'src'), { recursive: true });
|
|
281
|
-
|
|
282
|
-
const io = captureIO();
|
|
283
|
-
await init({ ...INIT_OPTIONS, governance: undefined, projectPath: root }, io);
|
|
284
|
-
expect(io.outLines()).toContain('⚠️ 未检测到 Git 仓库,跳过 Git hooks');
|
|
285
|
-
|
|
286
|
-
const withDocsDir = await makeProject(false);
|
|
287
|
-
roots.push(withDocsDir);
|
|
288
|
-
const io2 = captureIO();
|
|
289
|
-
await init({ ...INIT_OPTIONS, projectPath: withDocsDir }, io2);
|
|
290
|
-
expect(io2.outText()).not.toContain('不存在,跳过 CONTEXT.md');
|
|
291
|
-
});
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
// ── CI 平台维度(harness#143):落盘正文的字节级正本 ─────────────────────
|
|
295
|
-
|
|
296
|
-
const RULES = ` rules:
|
|
297
|
-
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
298
|
-
- if: $CI_COMMIT_BRANCH == "main"
|
|
299
|
-
- if: $CI_COMMIT_BRANCH == "master"
|
|
300
|
-
`;
|
|
301
|
-
|
|
302
|
-
const GITLAB_PLAIN = `# 由 harness init 生成 —— 以下 harness-* 任务是 harness 的 CI 接线
|
|
303
|
-
# 门禁真正生效还需在 GitLab 侧开分支保护:pipeline 成功才允许合并
|
|
304
|
-
|
|
305
|
-
image: node:20
|
|
306
|
-
|
|
307
|
-
stages:
|
|
308
|
-
- test
|
|
309
|
-
|
|
310
|
-
harness-check:
|
|
311
|
-
stage: test
|
|
312
|
-
script:
|
|
313
|
-
- npm ci
|
|
314
|
-
- npx @dommaker/harness check
|
|
315
|
-
- npx @dommaker/harness validate
|
|
316
|
-
- npx @dommaker/harness passes-gate
|
|
317
|
-
${RULES}`;
|
|
318
|
-
|
|
319
|
-
const GITLAB_GOVERNED = GITLAB_PLAIN + `
|
|
320
|
-
harness-governance:
|
|
321
|
-
stage: test
|
|
322
|
-
script:
|
|
323
|
-
- npm ci
|
|
324
|
-
- npx @dommaker/harness check
|
|
325
|
-
- npx @dommaker/harness passes-gate
|
|
326
|
-
${RULES}
|
|
327
|
-
harness-docs-freshness:
|
|
328
|
-
stage: test
|
|
329
|
-
script:
|
|
330
|
-
- npm ci
|
|
331
|
-
- npx @dommaker/harness sync-docs --check
|
|
332
|
-
${RULES} allow_failure: true
|
|
333
|
-
`;
|
|
334
|
-
|
|
335
|
-
/** GitLab 站点的 harness-check 任务正文(冲突分支打印的 job 片段即此份) */
|
|
336
|
-
const GITLAB_CHECK_JOB = GITLAB_PLAIN.slice(GITLAB_PLAIN.indexOf('harness-check:'));
|
|
337
|
-
|
|
338
|
-
const CI_OPTIONS = { preset: 'standard' as const };
|
|
339
|
-
|
|
340
|
-
async function exists(rel: string): Promise<boolean> {
|
|
341
|
-
try {
|
|
342
|
-
await fs.access(rel);
|
|
343
|
-
return true;
|
|
344
|
-
} catch {
|
|
345
|
-
return false;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
describe('init --ci 平台维度(harness#143,真落盘)', () => {
|
|
350
|
-
const roots: string[] = [];
|
|
351
|
-
|
|
352
|
-
afterAll(async () => {
|
|
353
|
-
await Promise.all(roots.map(root => fs.rm(root, { recursive: true, force: true })));
|
|
354
|
-
});
|
|
355
|
-
|
|
356
|
-
it('--ci gitlab:逐字节落盘 .gitlab-ci.yml,不写 GH workflow,平台持久化进 config.yml', async () => {
|
|
357
|
-
const root = await makeProject();
|
|
358
|
-
roots.push(root);
|
|
359
|
-
const io = captureIO();
|
|
360
|
-
|
|
361
|
-
expect(await init({ ...CI_OPTIONS, ci: 'gitlab', projectPath: root }, io)).toEqual({ kind: 'ok' });
|
|
362
|
-
|
|
363
|
-
expect(await fs.readFile(path.join(root, '.gitlab-ci.yml'), 'utf-8')).toBe(GITLAB_PLAIN);
|
|
364
|
-
expect(await exists(path.join(root, '.github'))).toBe(false);
|
|
365
|
-
expect(io.outLines()).toContain('✅ 已创建 .gitlab-ci.yml');
|
|
366
|
-
expect(io.outLines()).toContain('CI 平台: gitlab');
|
|
367
|
-
expect(await fs.readFile(path.join(root, '.harness', 'config.yml'), 'utf-8')).toContain(
|
|
368
|
-
'ci:\n platform: gitlab',
|
|
369
|
-
);
|
|
370
|
-
});
|
|
371
|
-
|
|
372
|
-
it('迁移方向:gitlab 已持久化后再 --ci github → config.yml 的 ci 键消失,回到 GitHub 形状', async () => {
|
|
373
|
-
const root = await makeProject();
|
|
374
|
-
roots.push(root);
|
|
375
|
-
await init({ ...CI_OPTIONS, ci: 'gitlab', projectPath: root }, captureIO());
|
|
376
|
-
expect(await fs.readFile(path.join(root, '.harness', 'config.yml'), 'utf-8')).toContain(
|
|
377
|
-
'ci:\n platform: gitlab',
|
|
378
|
-
);
|
|
379
|
-
|
|
380
|
-
const io = captureIO();
|
|
381
|
-
expect(await init({ ...CI_OPTIONS, ci: 'github', projectPath: root }, io)).toEqual({ kind: 'ok' });
|
|
382
|
-
|
|
383
|
-
// github 是缺省平台,非默认平台才写键(旧配置零迁移)——显式 --ci github 必须把
|
|
384
|
-
// 已持久化的 ci: 键抹掉,而不是留下 platform: github(harness#158 补钉,复审 M9 留口)
|
|
385
|
-
const config = yaml.load(await fs.readFile(path.join(root, '.harness', 'config.yml'), 'utf-8')) as Record<string, unknown>;
|
|
386
|
-
expect('ci' in config).toBe(false);
|
|
387
|
-
expect(io.outText()).not.toContain('CI 平台:');
|
|
388
|
-
expect(await fs.readFile(path.join(root, '.github/workflows/harness-check.yml'), 'utf-8'))
|
|
389
|
-
.toContain('name: Harness Check');
|
|
390
|
-
// 旧的 gitlab 站点是用户文件,不删不动
|
|
391
|
-
expect(await fs.readFile(path.join(root, '.gitlab-ci.yml'), 'utf-8')).toBe(GITLAB_PLAIN);
|
|
392
|
-
});
|
|
393
|
-
|
|
394
|
-
it('第二趟(.gitlab-ci.yml 已在场):manual 态,用户内容一字节不动,打印的 job 片段即落盘正文的一部分', async () => {
|
|
395
|
-
const root = await makeProject();
|
|
396
|
-
roots.push(root);
|
|
397
|
-
await init({ ...CI_OPTIONS, ci: 'gitlab', projectPath: root }, captureIO());
|
|
398
|
-
const gitlabFile = path.join(root, '.gitlab-ci.yml');
|
|
399
|
-
const userContent = '# 我自己的流水线\n\ntest:\n script:\n - echo hi\n';
|
|
400
|
-
await fs.writeFile(gitlabFile, userContent);
|
|
401
|
-
|
|
402
|
-
const io = captureIO();
|
|
403
|
-
await init({ ...CI_OPTIONS, ci: 'gitlab', projectPath: root }, io);
|
|
404
|
-
|
|
405
|
-
expect(io.outLines()).toContain('⚠️ .gitlab-ci.yml 已存在');
|
|
406
|
-
expect(io.outLines()).toContain('💡 请手动添加以下内容到文件中:');
|
|
407
|
-
expect(io.outText()).toContain(GITLAB_CHECK_JOB);
|
|
408
|
-
expect(await fs.readFile(gitlabFile, 'utf-8')).toBe(userContent);
|
|
409
|
-
expect(await exists(path.join(root, '.github'))).toBe(false);
|
|
410
|
-
});
|
|
411
|
-
|
|
412
|
-
it('--ci gitlab -g standard:治理任务并入同一份 .gitlab-ci.yml,docs 新鲜度 allow_failure: true', async () => {
|
|
413
|
-
const root = await makeProject();
|
|
414
|
-
roots.push(root);
|
|
415
|
-
const io = captureIO();
|
|
416
|
-
|
|
417
|
-
await init({ ...INIT_OPTIONS, ci: 'gitlab', projectPath: root }, io);
|
|
418
|
-
|
|
419
|
-
expect(await fs.readFile(path.join(root, '.gitlab-ci.yml'), 'utf-8')).toBe(GITLAB_GOVERNED);
|
|
420
|
-
expect(await exists(path.join(root, '.github'))).toBe(false);
|
|
421
|
-
expect(io.outText()).not.toContain('harness-governance.yml');
|
|
422
|
-
});
|
|
423
|
-
|
|
424
|
-
it('平台持久化:裸 init 与 --print-snippets 都按 config.yml 的 ci.platform 出面', async () => {
|
|
425
|
-
const root = await makeProject();
|
|
426
|
-
roots.push(root);
|
|
427
|
-
await init({ ...CI_OPTIONS, ci: 'gitlab', projectPath: root }, captureIO());
|
|
428
|
-
await fs.rm(path.join(root, '.gitlab-ci.yml'));
|
|
429
|
-
|
|
430
|
-
const bare = captureIO();
|
|
431
|
-
await init({ ...CI_OPTIONS, projectPath: root }, bare);
|
|
432
|
-
expect(bare.outLines()).toContain('✅ 已创建 .gitlab-ci.yml');
|
|
433
|
-
expect(bare.outText()).not.toContain('harness-check.yml');
|
|
434
|
-
expect(await fs.readFile(path.join(root, '.gitlab-ci.yml'), 'utf-8')).toBe(GITLAB_PLAIN);
|
|
435
|
-
// 裸 init 重写 config.yml 时不得丢掉已持久化的平台
|
|
436
|
-
expect(await fs.readFile(path.join(root, '.harness', 'config.yml'), 'utf-8')).toContain(
|
|
437
|
-
'ci:\n platform: gitlab',
|
|
438
|
-
);
|
|
439
|
-
|
|
440
|
-
const snippets = captureIO();
|
|
441
|
-
await init({ ...CI_OPTIONS, printSnippets: true, projectPath: root }, snippets);
|
|
442
|
-
expect(snippets.outLines()).toContain('GitLab CI:');
|
|
443
|
-
expect(snippets.outText()).toContain(GITLAB_CHECK_JOB);
|
|
444
|
-
expect(snippets.outText()).not.toContain('GitHub Actions:');
|
|
445
|
-
});
|
|
446
|
-
|
|
447
|
-
it('--ci none 不落任何 CI 文件;--no-github-actions 与之等价并打 deprecation warning', async () => {
|
|
448
|
-
const noneRoot = await makeProject();
|
|
449
|
-
roots.push(noneRoot);
|
|
450
|
-
const none = captureIO();
|
|
451
|
-
await init({ ...CI_OPTIONS, ci: 'none', projectPath: noneRoot }, none);
|
|
452
|
-
expect(await exists(path.join(noneRoot, '.github'))).toBe(false);
|
|
453
|
-
expect(await exists(path.join(noneRoot, '.gitlab-ci.yml'))).toBe(false);
|
|
454
|
-
expect(none.outText()).not.toContain('已废弃');
|
|
455
|
-
expect(await fs.readFile(path.join(noneRoot, '.harness', 'config.yml'), 'utf-8')).toContain(
|
|
456
|
-
'ci:\n platform: none',
|
|
457
|
-
);
|
|
458
|
-
|
|
459
|
-
const legacyRoot = await makeProject();
|
|
460
|
-
roots.push(legacyRoot);
|
|
461
|
-
const legacy = captureIO();
|
|
462
|
-
await init({ ...CI_OPTIONS, githubActions: false, projectPath: legacyRoot }, legacy);
|
|
463
|
-
expect(legacy.outLines()).toContain('⚠️ --no-github-actions 已废弃,请改用 --ci none');
|
|
464
|
-
expect(await exists(path.join(legacyRoot, '.github'))).toBe(false);
|
|
465
|
-
expect(await fs.readFile(path.join(legacyRoot, '.harness', 'config.yml'), 'utf-8')).toContain(
|
|
466
|
-
'ci:\n platform: none',
|
|
467
|
-
);
|
|
468
|
-
});
|
|
469
|
-
|
|
470
|
-
it('--ci gitlab 与 --no-github-actions 同时给出:用法错误且什么都不落盘', async () => {
|
|
471
|
-
const root = await makeProject();
|
|
472
|
-
roots.push(root);
|
|
473
|
-
const io = captureIO();
|
|
474
|
-
|
|
475
|
-
const result = await init({ ...CI_OPTIONS, ci: 'gitlab', githubActions: false, projectPath: root }, io);
|
|
476
|
-
|
|
477
|
-
expect(result).toEqual({
|
|
478
|
-
kind: 'usage-error',
|
|
479
|
-
reason: expect.stringContaining('--no-github-actions'),
|
|
480
|
-
});
|
|
481
|
-
expect(io.errText()).toContain('用法错误');
|
|
482
|
-
expect(await exists(path.join(root, '.gitlab-ci.yml'))).toBe(false);
|
|
483
|
-
expect(await exists(path.join(root, '.harness', 'config.yml'))).toBe(false);
|
|
484
|
-
});
|
|
485
|
-
|
|
486
|
-
it('--ci 非法值:用法错误并列出可取值', async () => {
|
|
487
|
-
const root = await makeProject();
|
|
488
|
-
roots.push(root);
|
|
489
|
-
// CLI 边界:commander 把用户敲的字符串原样递进来,合法域由命令层校验
|
|
490
|
-
const dirty = { ci: 'bitbucket' as unknown as InitOptions['ci'] };
|
|
491
|
-
|
|
492
|
-
const result = await init({ ...CI_OPTIONS, ...dirty, projectPath: root }, captureIO());
|
|
493
|
-
|
|
494
|
-
expect(result).toEqual({
|
|
495
|
-
kind: 'usage-error',
|
|
496
|
-
reason: expect.stringContaining('github | gitlab | none'),
|
|
497
|
-
});
|
|
498
|
-
expect(await exists(path.join(root, '.gitlab-ci.yml'))).toBe(false);
|
|
499
|
-
});
|
|
500
|
-
|
|
501
|
-
it('config.yml 的 ci 段读不动(YAML 解析失败)时回落 github,不炸 init', async () => {
|
|
502
|
-
const root = await makeProject();
|
|
503
|
-
roots.push(root);
|
|
504
|
-
await fs.mkdir(path.join(root, '.harness'), { recursive: true });
|
|
505
|
-
await fs.writeFile(path.join(root, '.harness', 'config.yml'), 'preset: standard\nci:\n platform: [\n');
|
|
506
|
-
|
|
507
|
-
const io = captureIO();
|
|
508
|
-
expect(await init({ ...CI_OPTIONS, projectPath: root }, io)).toEqual({ kind: 'ok' });
|
|
509
|
-
|
|
510
|
-
expect(io.outText()).not.toContain('CI 平台');
|
|
511
|
-
expect(await exists(path.join(root, '.github/workflows/harness-check.yml'))).toBe(true);
|
|
512
|
-
expect(await exists(path.join(root, '.gitlab-ci.yml'))).toBe(false);
|
|
513
|
-
});
|
|
514
|
-
});
|
|
515
|
-
|
|
516
|
-
// ── --ci × -g 组合边界(harness#156):none = 零 CI 文件;-g 值域校验在命令入口 ──
|
|
517
|
-
|
|
518
|
-
/** 项目下全部文件的相对路径(排序),逐字冻结「落盘文件集合」这个投影 */
|
|
519
|
-
async function listProjectFiles(root: string): Promise<string[]> {
|
|
520
|
-
const out: string[] = [];
|
|
521
|
-
async function walk(dir: string): Promise<void> {
|
|
522
|
-
for (const entry of await fs.readdir(dir, { withFileTypes: true })) {
|
|
523
|
-
const full = path.join(dir, entry.name);
|
|
524
|
-
if (entry.isDirectory()) await walk(full);
|
|
525
|
-
else out.push(path.relative(root, full).split(path.sep).join('/'));
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
await walk(root);
|
|
529
|
-
return out.sort();
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
describe('init --ci × -g 组合边界(harness#156,真落盘)', () => {
|
|
533
|
-
const roots: string[] = [];
|
|
534
|
-
|
|
535
|
-
afterAll(async () => {
|
|
536
|
-
await Promise.all(roots.map(root => fs.rm(root, { recursive: true, force: true })));
|
|
537
|
-
});
|
|
538
|
-
|
|
539
|
-
it('--ci none -g standard:零 CI 文件、治理文档面照常;落盘文件集合与 config.yml 两投影逐字冻结', async () => {
|
|
540
|
-
const root = await makeProject();
|
|
541
|
-
roots.push(root);
|
|
542
|
-
const io = captureIO();
|
|
543
|
-
|
|
544
|
-
expect(await init({ ...INIT_OPTIONS, ci: 'none', projectPath: root }, io)).toEqual({ kind: 'ok' });
|
|
545
|
-
|
|
546
|
-
// 投影一:落盘文件集合逐字冻结。反证可跑——把 setupGovernanceWorkflow 的豁免写回
|
|
547
|
-
// `platform === 'gitlab'`(不豁免 none),集合里会多出
|
|
548
|
-
// `.github/workflows/harness-governance.yml`,本断言即红(harness#156 F1 的形态)
|
|
549
|
-
expect(await listProjectFiles(root)).toEqual([
|
|
550
|
-
'.git/hooks/pre-commit',
|
|
551
|
-
'.git/hooks/pre-push',
|
|
552
|
-
'.harness/checkpoints.yml',
|
|
553
|
-
'.harness/config.yml',
|
|
554
|
-
'.harness/resolutions.json',
|
|
555
|
-
'CHANGELOG.md',
|
|
556
|
-
'src/CONTEXT.md',
|
|
557
|
-
'src/index.ts',
|
|
558
|
-
]);
|
|
559
|
-
|
|
560
|
-
// 投影二:config.yml 逐字冻结(版本号随发布漂移,归一化)——ci.platform: none
|
|
561
|
-
// 与磁盘状态一致:配置声称不接任何 CI 平台,磁盘上也没有任何 CI 文件
|
|
562
|
-
const config = await fs.readFile(path.join(root, '.harness', 'config.yml'), 'utf-8');
|
|
563
|
-
expect(config.replace(/version: [\d.]+/, 'version: *')).toBe(`preset: standard
|
|
564
|
-
governance:
|
|
565
|
-
level: standard
|
|
566
|
-
docs:
|
|
567
|
-
sync_command: harness sync-docs
|
|
568
|
-
check_on_ci: true
|
|
569
|
-
files:
|
|
570
|
-
- CAPABILITIES.md
|
|
571
|
-
- README.md
|
|
572
|
-
context_files:
|
|
573
|
-
enabled: true
|
|
574
|
-
required_dirs: []
|
|
575
|
-
changelog:
|
|
576
|
-
format: keep-a-changelog
|
|
577
|
-
testing:
|
|
578
|
-
test_first: true
|
|
579
|
-
coverage_threshold: 85
|
|
580
|
-
incremental_coverage: false
|
|
581
|
-
ci:
|
|
582
|
-
platform: none
|
|
583
|
-
harness:
|
|
584
|
-
version: *
|
|
585
|
-
`);
|
|
586
|
-
|
|
587
|
-
// 治理文档面(CHANGELOG / CONTEXT.md)在 none 下照常生成,不受 CI 豁免影响
|
|
588
|
-
expect(await fs.readFile(path.join(root, 'CHANGELOG.md'), 'utf-8')).toContain('Keep a Changelog');
|
|
589
|
-
expect(await fs.readFile(path.join(root, 'src/CONTEXT.md'), 'utf-8')).toBe(CONTEXT_MD_BYTES);
|
|
590
|
-
});
|
|
591
|
-
|
|
592
|
-
it('-g 非法值在 github / gitlab / none 三平台后果一致:usage-error、零落盘(钉「一致」本身)', async () => {
|
|
593
|
-
// CLI 边界:commander 把用户敲的字符串原样递进来,合法域由命令入口校验
|
|
594
|
-
const dirty = { governance: 'bogus' as unknown as InitOptions['governance'] };
|
|
595
|
-
const runs: Array<{ platform: string; result: unknown; files: string[]; err: string }> = [];
|
|
596
|
-
|
|
597
|
-
for (const platform of ['github', 'gitlab', 'none'] as const) {
|
|
598
|
-
const root = await makeProject();
|
|
599
|
-
roots.push(root);
|
|
600
|
-
const io = captureIO();
|
|
601
|
-
const result = await init({ ...CI_OPTIONS, ...dirty, ci: platform, projectPath: root }, io);
|
|
602
|
-
runs.push({ platform, result, files: await listProjectFiles(root), err: io.errText() });
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
// 钉的是「三平台一致」这件事本身(harness#156 F2:同一非法输入,gitlab 曾落三个任务、
|
|
606
|
-
// github 曾静默不建治理站),不是各自冻一份基线
|
|
607
|
-
expect(runs[1].result).toEqual(runs[0].result);
|
|
608
|
-
expect(runs[2].result).toEqual(runs[0].result);
|
|
609
|
-
expect(runs[1].files).toEqual(runs[0].files);
|
|
610
|
-
expect(runs[2].files).toEqual(runs[0].files);
|
|
611
|
-
for (const run of runs) {
|
|
612
|
-
expect(run.result).toEqual({
|
|
613
|
-
kind: 'usage-error',
|
|
614
|
-
reason: expect.stringContaining('minimal | standard | strict'),
|
|
615
|
-
});
|
|
616
|
-
expect(run.err).toContain('用法错误');
|
|
617
|
-
// 零落盘:只剩夹具文件(src/index.ts;.git 是空目录不产生文件条目)
|
|
618
|
-
expect(run.files).toEqual(['src/index.ts']);
|
|
619
|
-
}
|
|
620
|
-
});
|
|
621
|
-
|
|
622
|
-
it.each(['constructor', 'toString'])(
|
|
623
|
-
'-g %s 不穿透原型链:usage-error、零落盘(harness#164:`in` 走原型链可拿到 Object 构造函数的反证)',
|
|
624
|
-
async dirty => {
|
|
625
|
-
const root = await makeProject();
|
|
626
|
-
roots.push(root);
|
|
627
|
-
const io = captureIO();
|
|
628
|
-
|
|
629
|
-
const result = await init(
|
|
630
|
-
{ ...CI_OPTIONS, governance: dirty as unknown as InitOptions['governance'], projectPath: root },
|
|
631
|
-
io,
|
|
632
|
-
);
|
|
633
|
-
|
|
634
|
-
expect(result).toEqual({
|
|
635
|
-
kind: 'usage-error',
|
|
636
|
-
reason: expect.stringContaining('minimal | standard | strict'),
|
|
637
|
-
});
|
|
638
|
-
expect(io.errText()).toContain('用法错误');
|
|
639
|
-
expect(await listProjectFiles(root)).toEqual(['src/index.ts']);
|
|
640
|
-
},
|
|
641
|
-
);
|
|
642
|
-
|
|
643
|
-
it.each(['minimal', 'standard', 'strict'] as const)(
|
|
644
|
-
'-g 合法值 %s 行为不变:ok 且治理级别写进 config.yml',
|
|
645
|
-
async level => {
|
|
646
|
-
const root = await makeProject();
|
|
647
|
-
roots.push(root);
|
|
648
|
-
|
|
649
|
-
expect(await init({ ...CI_OPTIONS, governance: level, projectPath: root }, captureIO()))
|
|
650
|
-
.toEqual({ kind: 'ok' });
|
|
651
|
-
|
|
652
|
-
const config = await fs.readFile(path.join(root, '.harness', 'config.yml'), 'utf-8');
|
|
653
|
-
expect(config).toContain(`level: ${level}`);
|
|
654
|
-
},
|
|
655
|
-
);
|
|
656
|
-
});
|
|
657
|
-
|
|
658
|
-
// ── --print-snippets 的 CI 片段视图(harness#153):打印的 job 正文 == 落盘正本的一段 ──
|
|
659
|
-
|
|
660
|
-
/**
|
|
661
|
-
* harness-check.yml 的字节级冻结基线(正本:`scaffold-templates.HARNESS_CHECK_WORKFLOW`)。
|
|
662
|
-
* 与 `GITLAB_PLAIN` 同族:改模板必须同步改这份基线,而「同步」这个动作正是拦住门禁被削弱的地方。
|
|
663
|
-
*/
|
|
664
|
-
const HARNESS_CHECK_BYTES = `name: Harness Check
|
|
665
|
-
|
|
666
|
-
on:
|
|
667
|
-
push:
|
|
668
|
-
branches: [main, master]
|
|
669
|
-
pull_request:
|
|
670
|
-
branches: [main, master]
|
|
671
|
-
|
|
672
|
-
jobs:
|
|
673
|
-
harness-check:
|
|
674
|
-
runs-on: ubuntu-latest
|
|
675
|
-
|
|
676
|
-
steps:
|
|
677
|
-
- uses: actions/checkout@v4
|
|
678
|
-
|
|
679
|
-
- name: Setup Node.js
|
|
680
|
-
uses: actions/setup-node@v4
|
|
681
|
-
with:
|
|
682
|
-
node-version: '20'
|
|
683
|
-
|
|
684
|
-
- name: Install dependencies
|
|
685
|
-
run: npm ci
|
|
686
|
-
|
|
687
|
-
- name: Run harness check
|
|
688
|
-
run: npx @dommaker/harness check
|
|
689
|
-
|
|
690
|
-
- name: Run harness validate
|
|
691
|
-
run: npx @dommaker/harness validate
|
|
692
|
-
|
|
693
|
-
- name: Run harness passes-gate
|
|
694
|
-
run: npx @dommaker/harness passes-gate
|
|
695
|
-
`;
|
|
696
|
-
|
|
697
|
-
/** 打印面里那份 job 正文(一次 log 调用 = 一条记录;片段自带的首尾换行按基线口径归一) */
|
|
698
|
-
function printedJob(io: CapturingIO): string {
|
|
699
|
-
const record = io.outRecords().find(chunk => chunk.includes('harness-check:'));
|
|
700
|
-
if (!record) throw new Error('--print-snippets 没有打印 harness-check 的 job 正文');
|
|
701
|
-
return record.replace(/^\n+/, '').replace(/\n$/, '');
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
/** job 正文(含两空格缩进)的 run 命令清单:按 YAML 解析枚举 steps,不靠子串碰运气 */
|
|
705
|
-
function runCommands(jobBody: string): string[] {
|
|
706
|
-
const doc = yaml.load(`jobs:\n${jobBody}`) as {
|
|
707
|
-
jobs: Record<string, { steps?: Array<{ run?: string }> }>;
|
|
708
|
-
};
|
|
709
|
-
return (doc.jobs['harness-check'].steps ?? [])
|
|
710
|
-
.map(step => step.run)
|
|
711
|
-
.filter((run): run is string => run !== undefined);
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
const GH_GUIDANCE_LINE = '添加到 .github/workflows/*.yml 的 jobs 下(以下正文取自 harness-check.yml 的 job 段)';
|
|
715
|
-
|
|
716
|
-
describe('init --print-snippets 的 GitHub Actions 片段视图(harness#153)', () => {
|
|
717
|
-
const roots: string[] = [];
|
|
718
|
-
|
|
719
|
-
afterAll(async () => {
|
|
720
|
-
await Promise.all(roots.map(root => fs.rm(root, { recursive: true, force: true })));
|
|
721
|
-
});
|
|
722
|
-
|
|
723
|
-
async function snippetsOfCiView(): Promise<CapturingIO> {
|
|
724
|
-
const root = await makeProject();
|
|
725
|
-
roots.push(root);
|
|
726
|
-
const io = captureIO();
|
|
727
|
-
await init({ ...CI_OPTIONS, printSnippets: true, projectPath: root }, io);
|
|
728
|
-
return io;
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
it('同源闸:打印的 job 正文逐字等于落盘正本的 jobs: 段之后(抄回去的就是 init 写出的那一段)', async () => {
|
|
732
|
-
const printed = await snippetsOfCiView();
|
|
733
|
-
const job = printedJob(printed);
|
|
734
|
-
|
|
735
|
-
expect(job).toBe(HARNESS_CHECK_BYTES.slice(HARNESS_CHECK_BYTES.indexOf(' harness-check:')));
|
|
736
|
-
|
|
737
|
-
const root = await makeProject();
|
|
738
|
-
roots.push(root);
|
|
739
|
-
await init({ ...CI_OPTIONS, projectPath: root }, captureIO());
|
|
740
|
-
const written = await fs.readFile(path.join(root, '.github/workflows/harness-check.yml'), 'utf-8');
|
|
741
|
-
expect(written.includes(job)).toBe(true);
|
|
742
|
-
expect(runCommands(written.slice(written.indexOf(' harness-check:')))).toEqual(runCommands(job));
|
|
743
|
-
});
|
|
744
|
-
|
|
745
|
-
it('steps 集合闸:打印的 job 覆盖 check / validate / passes-gate 三道门禁,一道不缺', async () => {
|
|
746
|
-
const printed = await snippetsOfCiView();
|
|
747
|
-
|
|
748
|
-
expect(runCommands(printedJob(printed))).toEqual(
|
|
749
|
-
expect.arrayContaining([
|
|
750
|
-
'npx @dommaker/harness check',
|
|
751
|
-
'npx @dommaker/harness validate',
|
|
752
|
-
'npx @dommaker/harness passes-gate',
|
|
753
|
-
]),
|
|
754
|
-
);
|
|
755
|
-
});
|
|
756
|
-
|
|
757
|
-
it('引导语逐字冻结:说清打印的是完整 workflow 的 job 段', async () => {
|
|
758
|
-
const lines = (await snippetsOfCiView()).outLines();
|
|
759
|
-
|
|
760
|
-
expect(lines[lines.indexOf('GitHub Actions:') + 1]).toBe(GH_GUIDANCE_LINE);
|
|
761
|
-
expect(lines).not.toContain('添加到 .github/workflows/*.yml 的 jobs 中');
|
|
762
|
-
});
|
|
763
|
-
});
|
|
764
|
-
|
|
765
|
-
// ── --print-snippets 的 GitLab CI 片段视图(harness#157):打印的任务正文 == 落盘正本的一段 ──
|
|
766
|
-
|
|
767
|
-
/** 打印面里 GitLab 那份任务正文(一次 log 调用 = 一条记录;归一化口径同 printedJob) */
|
|
768
|
-
function printedGitLabJobs(io: CapturingIO): string {
|
|
769
|
-
const record = io.outRecords().find(chunk => chunk.includes('harness-check:'));
|
|
770
|
-
if (!record) throw new Error('--print-snippets 没有打印 harness-check 的任务正文');
|
|
771
|
-
return record.replace(/^\n+/, '').replace(/\n$/, '');
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
/** .gitlab-ci.yml 文本里 harness 拥有的任务名(顶层键中 harness-* 的那些),排序后比对 */
|
|
775
|
-
function harnessJobNames(gitlabCiText: string): string[] {
|
|
776
|
-
const doc = yaml.load(gitlabCiText) as Record<string, unknown>;
|
|
777
|
-
return Object.keys(doc).filter(key => key.startsWith('harness-')).sort();
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
/** GitLab 任务正文里某任务的 script 命令清单:按 YAML 解析枚举,不靠子串碰运气 */
|
|
781
|
-
function gitLabScriptCommands(jobsBody: string, job: string): string[] {
|
|
782
|
-
const doc = yaml.load(jobsBody) as Record<string, { script?: string[] }>;
|
|
783
|
-
return doc[job]?.script ?? [];
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
describe('init --print-snippets 的 GitLab CI 片段视图(harness#157)', () => {
|
|
787
|
-
const roots: string[] = [];
|
|
788
|
-
|
|
789
|
-
afterAll(async () => {
|
|
790
|
-
await Promise.all(roots.map(root => fs.rm(root, { recursive: true, force: true })));
|
|
791
|
-
});
|
|
792
|
-
|
|
793
|
-
async function gitlabSnippets(options: Partial<InitOptions> = {}) {
|
|
794
|
-
const root = await makeProject();
|
|
795
|
-
roots.push(root);
|
|
796
|
-
const io = captureIO();
|
|
797
|
-
const result = await init(
|
|
798
|
-
{ ...CI_OPTIONS, ci: 'gitlab', printSnippets: true, ...options, projectPath: root },
|
|
799
|
-
io,
|
|
800
|
-
);
|
|
801
|
-
return { io, result };
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
it('同源闸(-g standard):打印的任务正文逐字等于落盘正本的任务段,任务集合与真落盘文件一致', async () => {
|
|
805
|
-
const { io } = await gitlabSnippets({ governance: 'standard' });
|
|
806
|
-
const printed = printedGitLabJobs(io);
|
|
807
|
-
|
|
808
|
-
// 逐字等于字节级冻结基线的任务段(改模板必须同步改 GITLAB_GOVERNED——同步动作正是闸)
|
|
809
|
-
expect(printed).toBe(
|
|
810
|
-
GITLAB_GOVERNED.slice(GITLAB_GOVERNED.indexOf('harness-check:')),
|
|
811
|
-
);
|
|
812
|
-
|
|
813
|
-
// 与真落盘对撞:任务集合按 YAML 解析比对(非子串)——给落盘正本删一个任务,
|
|
814
|
-
// 集合即不等,本闸必红(harness#157 验收 2 的反证)
|
|
815
|
-
const root = await makeProject();
|
|
816
|
-
roots.push(root);
|
|
817
|
-
await init({ ...INIT_OPTIONS, ci: 'gitlab', projectPath: root }, captureIO());
|
|
818
|
-
const written = await fs.readFile(path.join(root, '.gitlab-ci.yml'), 'utf-8');
|
|
819
|
-
expect(harnessJobNames(written)).toEqual(harnessJobNames(printed));
|
|
820
|
-
expect(written).toContain(printed);
|
|
821
|
-
});
|
|
822
|
-
|
|
823
|
-
it('script 集合闸:打印的 harness-check 覆盖 check / validate / passes-gate 三道门禁,一道不缺', async () => {
|
|
824
|
-
const { io } = await gitlabSnippets({ governance: 'standard' });
|
|
825
|
-
|
|
826
|
-
expect(gitLabScriptCommands(printedGitLabJobs(io), 'harness-check')).toEqual(
|
|
827
|
-
expect.arrayContaining([
|
|
828
|
-
'npx @dommaker/harness check',
|
|
829
|
-
'npx @dommaker/harness validate',
|
|
830
|
-
'npx @dommaker/harness passes-gate',
|
|
831
|
-
]),
|
|
832
|
-
);
|
|
833
|
-
});
|
|
834
|
-
|
|
835
|
-
it('不传 -g:只打 harness-check 一个任务,与无治理档的落盘正本一致', async () => {
|
|
836
|
-
const { io } = await gitlabSnippets();
|
|
837
|
-
const printed = printedGitLabJobs(io);
|
|
838
|
-
|
|
839
|
-
expect(printed).toBe(
|
|
840
|
-
GITLAB_PLAIN.slice(GITLAB_PLAIN.indexOf('harness-check:')),
|
|
841
|
-
);
|
|
842
|
-
expect(harnessJobNames(printed)).toEqual(['harness-check']);
|
|
843
|
-
});
|
|
844
|
-
|
|
845
|
-
it('-g 非法值:usage-error(harness#156 裁决 F2 同判),不打印任何 CI 片段', async () => {
|
|
846
|
-
// CLI 边界:commander 把用户敲的字符串原样递进来,合法域由命令入口校验
|
|
847
|
-
const dirty = { governance: 'bogus' as unknown as InitOptions['governance'] };
|
|
848
|
-
|
|
849
|
-
const { io, result } = await gitlabSnippets(dirty);
|
|
850
|
-
|
|
851
|
-
expect(result).toEqual({
|
|
852
|
-
kind: 'usage-error',
|
|
853
|
-
reason: expect.stringContaining('minimal | standard | strict'),
|
|
854
|
-
});
|
|
855
|
-
expect(io.outText()).not.toContain('GitLab CI:');
|
|
856
|
-
expect(io.outText()).not.toContain('harness-check:');
|
|
857
|
-
});
|
|
858
|
-
});
|
|
859
|
-
|