@dommaker/harness 1.13.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +4 -2
- package/dist/cli/commands/check.js +3 -3
- package/dist/cli/commands/check.js.map +1 -1
- package/dist/cli/commands/constraints-disable.d.ts +48 -0
- package/dist/cli/commands/constraints-disable.d.ts.map +1 -0
- package/dist/cli/commands/constraints-disable.js +156 -0
- package/dist/cli/commands/constraints-disable.js.map +1 -0
- package/dist/cli/commands/constraints-pack-proposal.d.ts +1 -1
- package/dist/cli/commands/constraints-pack-proposal.js +1 -1
- package/dist/cli/commands/constraints-reactivate.d.ts.map +1 -1
- package/dist/cli/commands/constraints-reactivate.js +4 -2
- package/dist/cli/commands/constraints-reactivate.js.map +1 -1
- package/dist/cli/commands/constraints-retire.d.ts +14 -4
- package/dist/cli/commands/constraints-retire.d.ts.map +1 -1
- package/dist/cli/commands/constraints-retire.js +10 -6
- package/dist/cli/commands/constraints-retire.js.map +1 -1
- package/dist/cli/commands/constraints.d.ts +1 -1
- package/dist/cli/commands/constraints.js +1 -1
- package/dist/cli/commands/definitions.d.ts.map +1 -1
- package/dist/cli/commands/definitions.js +16 -1
- package/dist/cli/commands/definitions.js.map +1 -1
- package/dist/cli/commands/knowledge-view.d.ts +3 -3
- package/dist/cli/commands/knowledge-view.js +4 -4
- package/dist/cli/commands/knowledge-view.js.map +1 -1
- package/dist/cli/commands/release.d.ts +2 -2
- package/dist/cli/commands/release.js +2 -2
- package/dist/cli/commands/sync-docs/agents-syncer.js +2 -4
- package/dist/cli/commands/sync-docs/agents-syncer.js.map +1 -1
- package/dist/cli/commands/sync-docs/head-gate.d.ts +34 -0
- package/dist/cli/commands/sync-docs/head-gate.d.ts.map +1 -0
- package/dist/cli/commands/sync-docs/head-gate.js +86 -0
- package/dist/cli/commands/sync-docs/head-gate.js.map +1 -0
- package/dist/cli/commands/sync-docs/index.d.ts +7 -0
- package/dist/cli/commands/sync-docs/index.d.ts.map +1 -1
- package/dist/cli/commands/sync-docs/index.js +51 -1
- package/dist/cli/commands/sync-docs/index.js.map +1 -1
- package/dist/completion-checkers/contract-presence.d.ts +1 -1
- package/dist/completion-checkers/contract-presence.js +1 -1
- package/dist/core/app-constraints-loader.d.ts +5 -3
- package/dist/core/app-constraints-loader.d.ts.map +1 -1
- package/dist/core/app-constraints-loader.js +20 -7
- package/dist/core/app-constraints-loader.js.map +1 -1
- package/dist/core/constraints/capabilities-parser.js +1 -1
- package/dist/core/constraints/check-cache.d.ts +1 -1
- package/dist/core/constraints/check-cache.js +1 -1
- package/dist/core/constraints/checker.d.ts +5 -3
- package/dist/core/constraints/checker.d.ts.map +1 -1
- package/dist/core/constraints/checker.js +31 -10
- package/dist/core/constraints/checker.js.map +1 -1
- package/dist/core/constraints/checkers/capability-sync.d.ts +1 -1
- package/dist/core/constraints/checkers/capability-sync.d.ts.map +1 -1
- package/dist/core/constraints/checkers/capability-sync.js +22 -9
- package/dist/core/constraints/checkers/capability-sync.js.map +1 -1
- package/dist/core/constraints/checkers/context-doc-sync.d.ts.map +1 -1
- package/dist/core/constraints/checkers/context-doc-sync.js +7 -1
- package/dist/core/constraints/checkers/context-doc-sync.js.map +1 -1
- package/dist/core/constraints/checkers/docs-freshness.d.ts.map +1 -1
- package/dist/core/constraints/checkers/docs-freshness.js +41 -26
- package/dist/core/constraints/checkers/docs-freshness.js.map +1 -1
- package/dist/core/constraints/checkers/governance-presence.d.ts +4 -1
- package/dist/core/constraints/checkers/governance-presence.d.ts.map +1 -1
- package/dist/core/constraints/checkers/governance-presence.js +8 -11
- package/dist/core/constraints/checkers/governance-presence.js.map +1 -1
- package/dist/core/constraints/checkers/index.d.ts +6 -6
- package/dist/core/constraints/checkers/index.d.ts.map +1 -1
- package/dist/core/constraints/checkers/index.js +16 -11
- package/dist/core/constraints/checkers/index.js.map +1 -1
- package/dist/core/constraints/checkers/no-completion-without-verification.d.ts +34 -0
- package/dist/core/constraints/checkers/no-completion-without-verification.d.ts.map +1 -0
- package/dist/core/constraints/checkers/no-completion-without-verification.js +157 -0
- package/dist/core/constraints/checkers/no-completion-without-verification.js.map +1 -0
- package/dist/core/constraints/checkers/no-hardcoded-credentials.d.ts +14 -4
- package/dist/core/constraints/checkers/no-hardcoded-credentials.d.ts.map +1 -1
- package/dist/core/constraints/checkers/no-hardcoded-credentials.js +134 -30
- package/dist/core/constraints/checkers/no-hardcoded-credentials.js.map +1 -1
- package/dist/core/constraints/checkers/no-test-simplification.d.ts +16 -2
- package/dist/core/constraints/checkers/no-test-simplification.d.ts.map +1 -1
- package/dist/core/constraints/checkers/no-test-simplification.js +115 -15
- package/dist/core/constraints/checkers/no-test-simplification.js.map +1 -1
- package/dist/core/constraints/checkers/templated/exec.d.ts +19 -0
- package/dist/core/constraints/checkers/templated/exec.d.ts.map +1 -0
- package/dist/core/constraints/checkers/templated/exec.js +124 -0
- package/dist/core/constraints/checkers/templated/exec.js.map +1 -0
- package/dist/core/constraints/checkers/templated/index.d.ts +1 -0
- package/dist/core/constraints/checkers/templated/index.d.ts.map +1 -1
- package/dist/core/constraints/checkers/templated/index.js +3 -1
- package/dist/core/constraints/checkers/templated/index.js.map +1 -1
- package/dist/core/constraints/checkers/templates-registry.d.ts +2 -1
- package/dist/core/constraints/checkers/templates-registry.d.ts.map +1 -1
- package/dist/core/constraints/checkers/templates-registry.js +3 -1
- package/dist/core/constraints/checkers/templates-registry.js.map +1 -1
- package/dist/core/constraints/checkers/types.d.ts +68 -7
- package/dist/core/constraints/checkers/types.d.ts.map +1 -1
- package/dist/core/constraints/checkers/types.js +52 -7
- package/dist/core/constraints/checkers/types.js.map +1 -1
- package/dist/core/constraints/context-builder.d.ts.map +1 -1
- package/dist/core/constraints/context-builder.js +0 -17
- package/dist/core/constraints/context-builder.js.map +1 -1
- package/dist/core/constraints/definitions/guidelines.d.ts +1 -0
- package/dist/core/constraints/definitions/guidelines.d.ts.map +1 -1
- package/dist/core/constraints/definitions/guidelines.js +5 -1
- package/dist/core/constraints/definitions/guidelines.js.map +1 -1
- package/dist/core/constraints/definitions/iron-laws.d.ts +1 -0
- package/dist/core/constraints/definitions/iron-laws.d.ts.map +1 -1
- package/dist/core/constraints/definitions/iron-laws.js +8 -3
- package/dist/core/constraints/definitions/iron-laws.js.map +1 -1
- package/dist/core/constraints/definitions.d.ts +8 -1
- package/dist/core/constraints/definitions.d.ts.map +1 -1
- package/dist/core/constraints/definitions.js +11 -1
- package/dist/core/constraints/definitions.js.map +1 -1
- package/dist/core/constraints/git-evidence.d.ts +10 -0
- package/dist/core/constraints/git-evidence.d.ts.map +1 -1
- package/dist/core/constraints/git-evidence.js +2 -0
- package/dist/core/constraints/git-evidence.js.map +1 -1
- package/dist/core/constraints/index.d.ts +3 -1
- package/dist/core/constraints/index.d.ts.map +1 -1
- package/dist/core/constraints/index.js +8 -1
- package/dist/core/constraints/index.js.map +1 -1
- package/dist/core/constraints/run-env.d.ts +3 -2
- package/dist/core/constraints/run-env.d.ts.map +1 -1
- package/dist/core/constraints/run-env.js +5 -4
- package/dist/core/constraints/run-env.js.map +1 -1
- package/dist/core/constraints/usage-report.d.ts +0 -5
- package/dist/core/constraints/usage-report.d.ts.map +1 -1
- package/dist/core/constraints/usage-report.js +3 -12
- package/dist/core/constraints/usage-report.js.map +1 -1
- package/dist/core/effective-constraints.d.ts +1 -1
- package/dist/core/effective-constraints.js +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +6 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/retired-constraints.d.ts +66 -0
- package/dist/core/retired-constraints.d.ts.map +1 -0
- package/dist/core/retired-constraints.js +52 -0
- package/dist/core/retired-constraints.js.map +1 -0
- package/dist/core/validators/checkpoint.d.ts +4 -2
- package/dist/core/validators/checkpoint.d.ts.map +1 -1
- package/dist/core/validators/checkpoint.js +4 -2
- package/dist/core/validators/checkpoint.js.map +1 -1
- package/dist/core/validators/passes-gate.d.ts +2 -2
- package/dist/core/validators/passes-gate.d.ts.map +1 -1
- package/dist/core/validators/passes-gate.js +4 -3
- package/dist/core/validators/passes-gate.js.map +1 -1
- package/dist/gates/checker-gate.d.ts +8 -4
- package/dist/gates/checker-gate.d.ts.map +1 -1
- package/dist/gates/checker-gate.js +13 -6
- package/dist/gates/checker-gate.js.map +1 -1
- package/dist/gates/index.d.ts +1 -1
- package/dist/gates/index.js +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -5
- package/dist/index.js.map +1 -1
- package/dist/knowledge/audit-scoring.js +1 -1
- package/dist/knowledge/audit-scoring.js.map +1 -1
- package/dist/monitoring/trace-analyzer.d.ts +2 -2
- package/dist/monitoring/trace-analyzer.js +2 -2
- package/dist/monitoring/traces.d.ts +1 -1
- package/dist/monitoring/traces.js +4 -4
- package/dist/monitoring/traces.js.map +1 -1
- package/dist/pretool-use-hook.d.ts +1 -1
- package/dist/pretool-use-hook.d.ts.map +1 -1
- package/dist/pretool-use-hook.js +5 -5
- package/dist/pretool-use-hook.js.map +1 -1
- package/dist/release/integrity.d.ts +4 -4
- package/dist/release/integrity.js +4 -4
- package/dist/test-setup/mkdtemp-cleanup.js +1 -1
- package/dist/tools/definitions/core/notification/notify.yml +0 -1
- package/dist/tools/definitions/ext/browser/browser-close.yml +0 -1
- package/dist/tools/definitions/ext/browser/browser-start.yml +0 -1
- package/dist/tools/definitions/std/evolution/implement.yml +0 -1
- package/dist/tools/definitions/std/evolution/prioritize.yml +0 -1
- package/dist/tools/definitions/std/evolution/report-gap.yml +0 -1
- package/dist/tools/definitions/std/governance/aggregate-opinions.yml +0 -1
- package/dist/tools/definitions/std/governance/audit-task.yml +0 -1
- package/dist/tools/definitions/std/governance/cast-vote.yml +0 -1
- package/dist/tools/definitions/std/governance/create-voting-session.yml +0 -1
- package/dist/tools/definitions/std/governance/define-stance.yml +0 -1
- package/dist/tools/definitions/std/governance/impeach.yml +0 -1
- package/dist/tools/definitions/std/governance/multi-stance-review.yml +0 -1
- package/dist/tools/definitions/std/governance/rollback.yml +0 -1
- package/dist/tools/definitions/std/governance/stance-review.yml +0 -1
- package/dist/tools/definitions/std/governance/track-effect.yml +0 -1
- package/dist/tools/definitions/std/governance/vote-tally.yml +0 -1
- package/dist/tools/definitions/std/planning/split-batch.yml +0 -1
- package/dist/tools/definitions/std/planning/split-tasks.yml +0 -1
- package/dist/types/constraint.d.ts +32 -9
- package/dist/types/constraint.d.ts.map +1 -1
- package/dist/types/constraint.js +6 -1
- package/dist/types/constraint.js.map +1 -1
- package/dist/types/passes-gate.d.ts +7 -0
- package/dist/types/passes-gate.d.ts.map +1 -1
- package/dist/types/passes-gate.js +8 -0
- package/dist/types/passes-gate.js.map +1 -1
- package/dist/types/trace.d.ts +7 -0
- package/dist/types/trace.d.ts.map +1 -1
- package/dist/utils/detect-source-roots.d.ts +1 -1
- package/dist/utils/detect-source-roots.d.ts.map +1 -1
- package/dist/utils/detect-source-roots.js +2 -21
- package/dist/utils/detect-source-roots.js.map +1 -1
- package/package.json +1 -2
- package/src/CONTEXT.md +3 -3
- package/src/__tests__/app-constraints-loader.test.ts +86 -3
- package/src/__tests__/checker-extra.test.ts +110 -11
- package/src/__tests__/checker-primitives-sdk.test.ts +70 -0
- package/src/__tests__/checker.test.ts +16 -14
- package/src/__tests__/detect-source-roots.test.ts +5 -4
- package/src/__tests__/exec-checker-full-chain.test.ts +118 -0
- package/src/__tests__/iron-laws.test.ts +13 -20
- package/src/__tests__/no-studio-references.test.ts +54 -0
- package/src/__tests__/passes-gate-check.test.ts +1 -1
- package/src/__tests__/pretool-use-hook.test.ts +2 -2
- package/src/__tests__/public-exports.test.ts +6 -0
- package/src/__tests__/public-type-surface.test.ts +24 -2
- package/src/__tests__/public-value-surface.test.ts +5 -0
- package/src/__tests__/retired-constraints.test.ts +99 -0
- package/src/__tests__/skip-semantics.test.ts +16 -33
- package/src/__tests__/usage-report-public-export.test.ts +3 -3
- package/src/cli/commands/CONTEXT.md +7 -6
- package/src/cli/commands/__tests__/check-read-count.test.ts +3 -0
- package/src/cli/commands/__tests__/check-skip-output.test.ts +4 -4
- package/src/cli/commands/__tests__/check.test.ts +35 -6
- package/src/cli/commands/__tests__/constraints-disable.test.ts +229 -0
- package/src/cli/commands/__tests__/constraints-report-json-flag.test.ts +1 -1
- package/src/cli/commands/__tests__/constraints-report.test.ts +4 -4
- package/src/cli/commands/__tests__/knowledge-flywheel-consistency.test.ts +1 -1
- package/src/cli/commands/__tests__/knowledge.test.ts +3 -3
- package/src/cli/commands/__tests__/project-path-anchoring.test.ts +4 -1
- package/src/cli/commands/__tests__/project-path-convention.test.ts +1 -1
- package/src/cli/commands/__tests__/spec-baseline-index-cap.test.ts +1 -1
- package/src/cli/commands/__tests__/sync-docs-agents.test.ts +1 -24
- package/src/cli/commands/__tests__/sync-docs-gate.test.ts +154 -0
- package/src/cli/commands/__tests__/sync-docs-table-layout.test.ts +1 -1
- package/src/cli/commands/__tests__/sync-docs.test.ts +3 -3
- package/src/cli/commands/check.ts +3 -3
- package/src/cli/commands/constraints-disable.ts +145 -0
- package/src/cli/commands/constraints-pack-proposal.ts +1 -1
- package/src/cli/commands/constraints-reactivate.ts +4 -2
- package/src/cli/commands/constraints-retire.ts +11 -8
- package/src/cli/commands/constraints.ts +1 -1
- package/src/cli/commands/definitions.ts +16 -1
- package/src/cli/commands/knowledge-view.ts +4 -4
- package/src/cli/commands/release.ts +2 -2
- package/src/cli/commands/sync-docs/agents-syncer.ts +2 -4
- package/src/cli/commands/sync-docs/head-gate.ts +87 -0
- package/src/cli/commands/sync-docs/index.ts +62 -1
- package/src/completion-checkers/contract-presence.ts +1 -1
- package/src/core/CONTEXT.md +9 -8
- package/src/core/app-constraints-loader.ts +23 -8
- package/src/core/constraints/__tests__/capabilities-reconcile.test.ts +1 -1
- package/src/core/constraints/__tests__/check-cache.test.ts +1 -1
- package/src/core/constraints/__tests__/collect-constraints.test.ts +42 -18
- package/src/core/constraints/__tests__/git-evidence.test.ts +20 -0
- package/src/core/constraints/__tests__/run-env.test.ts +9 -7
- package/src/core/constraints/__tests__/trace-injection.test.ts +8 -2
- package/src/core/constraints/capabilities-parser.ts +1 -1
- package/src/core/constraints/check-cache.ts +1 -1
- package/src/core/constraints/checker.ts +35 -12
- package/src/core/constraints/checkers/__tests__/capability-sync.test.ts +21 -3
- package/src/core/constraints/checkers/__tests__/context-doc-sync.test.ts +20 -12
- package/src/core/constraints/checkers/__tests__/docs-freshness-degraded.test.ts +89 -0
- package/src/core/constraints/checkers/__tests__/docs-freshness.test.ts +4 -2
- package/src/core/constraints/checkers/__tests__/exec-checker.test.ts +99 -0
- package/src/core/constraints/checkers/__tests__/fixtures/public-repo-sanitization.mjs +40 -0
- package/src/core/constraints/checkers/__tests__/governance-presence.test.ts +24 -3
- package/src/core/constraints/checkers/__tests__/input-contract.test.ts +135 -0
- package/src/core/constraints/checkers/__tests__/no-completion-without-verification.test.ts +208 -0
- package/src/core/constraints/checkers/__tests__/no-hardcoded-credentials.test.ts +127 -5
- package/src/core/constraints/checkers/__tests__/no-test-simplification.test.ts +144 -21
- package/src/core/constraints/checkers/__tests__/three-state-consistency.test.ts +6 -2
- package/src/core/constraints/checkers/capability-sync.ts +25 -11
- package/src/core/constraints/checkers/context-doc-sync.ts +8 -1
- package/src/core/constraints/checkers/docs-freshness.ts +44 -26
- package/src/core/constraints/checkers/governance-presence.ts +8 -9
- package/src/core/constraints/checkers/index.ts +23 -13
- package/src/core/constraints/checkers/no-completion-without-verification.ts +126 -0
- package/src/core/constraints/checkers/no-hardcoded-credentials.ts +153 -29
- package/src/core/constraints/checkers/no-test-simplification.ts +128 -17
- package/src/core/constraints/checkers/templated/exec.ts +138 -0
- package/src/core/constraints/checkers/templated/index.ts +1 -0
- package/src/core/constraints/checkers/templates-registry.ts +4 -2
- package/src/core/constraints/checkers/types.ts +107 -10
- package/src/core/constraints/context-builder.ts +0 -18
- package/src/core/constraints/definitions/guidelines.ts +5 -1
- package/src/core/constraints/definitions/iron-laws.ts +8 -3
- package/src/core/constraints/definitions.ts +11 -1
- package/src/core/constraints/doc-freshness/__tests__/runner.test.ts +3 -3
- package/src/core/constraints/git-evidence.ts +13 -0
- package/src/core/constraints/index.ts +22 -1
- package/src/core/constraints/run-env.ts +6 -5
- package/src/core/constraints/usage-report.ts +2 -12
- package/src/core/effective-constraints.ts +1 -1
- package/src/core/index.ts +16 -1
- package/src/core/retired-constraints.ts +77 -0
- package/src/core/validators/checkpoint.ts +4 -2
- package/src/core/validators/passes-gate.ts +4 -3
- package/src/gates/CONTEXT.md +3 -2
- package/src/gates/__tests__/checker-gate.test.ts +20 -3
- package/src/gates/checker-gate.ts +14 -7
- package/src/gates/index.ts +1 -1
- package/src/hooks/CONTEXT.md +2 -2
- package/src/index.ts +35 -3
- package/src/knowledge/CONTEXT.md +2 -2
- package/src/knowledge/__tests__/audit.test.ts +1 -1
- package/src/knowledge/__tests__/flywheel-metrics.test.ts +1 -1
- package/src/knowledge/audit-scoring.ts +1 -1
- package/src/monitoring/CONTEXT.md +2 -2
- package/src/monitoring/__tests__/skipped-lines-report.test.ts +2 -2
- package/src/monitoring/__tests__/traces.test.ts +1 -1
- package/src/monitoring/trace-analyzer.ts +2 -2
- package/src/monitoring/traces.ts +4 -4
- package/src/pretool-use-hook.ts +5 -5
- package/src/release/CONTEXT.md +3 -3
- package/src/release/integrity.ts +4 -4
- package/src/test-setup/__tests__/mkdtemp-cleanup.test.ts +1 -1
- package/src/test-setup/mkdtemp-cleanup.ts +1 -1
- package/src/tools/CONTEXT.md +3 -3
- package/src/tools/__tests__/registry.test.ts +3 -3
- package/src/tools/definitions/core/notification/notify.yml +0 -1
- package/src/tools/definitions/ext/browser/browser-close.yml +0 -1
- package/src/tools/definitions/ext/browser/browser-start.yml +0 -1
- package/src/tools/definitions/std/evolution/implement.yml +0 -1
- package/src/tools/definitions/std/evolution/prioritize.yml +0 -1
- package/src/tools/definitions/std/evolution/report-gap.yml +0 -1
- package/src/tools/definitions/std/governance/aggregate-opinions.yml +0 -1
- package/src/tools/definitions/std/governance/audit-task.yml +0 -1
- package/src/tools/definitions/std/governance/cast-vote.yml +0 -1
- package/src/tools/definitions/std/governance/create-voting-session.yml +0 -1
- package/src/tools/definitions/std/governance/define-stance.yml +0 -1
- package/src/tools/definitions/std/governance/impeach.yml +0 -1
- package/src/tools/definitions/std/governance/multi-stance-review.yml +0 -1
- package/src/tools/definitions/std/governance/rollback.yml +0 -1
- package/src/tools/definitions/std/governance/stance-review.yml +0 -1
- package/src/tools/definitions/std/governance/track-effect.yml +0 -1
- package/src/tools/definitions/std/governance/vote-tally.yml +0 -1
- package/src/tools/definitions/std/planning/split-batch.yml +0 -1
- package/src/tools/definitions/std/planning/split-tasks.yml +0 -1
- package/src/types/constraint.ts +35 -10
- package/src/types/passes-gate.ts +8 -0
- package/src/types/trace.ts +8 -0
- package/src/utils/detect-source-roots.ts +2 -20
- package/bin/harness-knowledge-track.sh +0 -47
- package/bin/harness-sensitive-check.sh +0 -67
- package/dist/core/constraints/checkers/iron-flags.d.ts +0 -12
- package/dist/core/constraints/checkers/iron-flags.d.ts.map +0 -1
- package/dist/core/constraints/checkers/iron-flags.js +0 -16
- package/dist/core/constraints/checkers/iron-flags.js.map +0 -1
- package/src/core/constraints/checkers/__tests__/iron-flags.test.ts +0 -30
- package/src/core/constraints/checkers/iron-flags.ts +0 -17
- package/templates/nextjs-app/.github/workflows/ci.yml +0 -39
- package/templates/node-api/.github/workflows/ci.yml +0 -36
- package/templates/node-api/package.json +0 -23
- package/templates/node-api/src/index.ts +0 -2
- package/templates/node-api/tsconfig.json +0 -19
- package/templates/python-api/.github/workflows/ci.yml +0 -39
package/src/types/constraint.ts
CHANGED
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
* 约束类型定义
|
|
3
3
|
*
|
|
4
4
|
* severity 显式模型(ADR-0029,取代 ADR-0001 的三层命名与 kind 二元模型):
|
|
5
|
-
* - 全部约束 kind='check':必须带真实 checker,参与运行时检查与 trace 统计
|
|
6
5
|
* - severity 直接写死在定义上:error = 违规即阻断;warning = 违规告警不阻断;
|
|
7
6
|
* info = 仅记录
|
|
8
7
|
* - 纯文本提示层(kind='prompt' / promptInjection / 注入段渲染)已整体关停,
|
|
9
8
|
* 文本规则由消费方手写治理段承接
|
|
9
|
+
*
|
|
10
|
+
* channel 通道模型(ADR-0035,两轴:channel=后果轴、checker 来源=判定轴):
|
|
11
|
+
* - gate(缺省):硬门禁,必须带真实 checker,参与运行时检查与 trace 统计
|
|
12
|
+
* - workflow:流程机制承载,无 checker,不进检查分发
|
|
13
|
+
* - discipline:拦不住但数得出的登记记录,无 checker,harness 不渲染、不注入、
|
|
14
|
+
* 不执行,供消费方做信号计数;晋升毕业后原地翻 channel 回 gate
|
|
10
15
|
*/
|
|
11
16
|
|
|
12
17
|
/**
|
|
@@ -24,6 +29,17 @@ export type ConstraintKind = 'check';
|
|
|
24
29
|
*/
|
|
25
30
|
export type ConstraintSeverity = 'error' | 'warning' | 'info';
|
|
26
31
|
|
|
32
|
+
/**
|
|
33
|
+
* 约束通道(ADR-0035,后果轴;与探测器来源的判定轴正交)
|
|
34
|
+
*
|
|
35
|
+
* - gate:硬门禁——带 checker、违规按 severity 阻断/告警(缺省通道,现有行为)
|
|
36
|
+
* - workflow:流程机制承载——无 checker,由 CI/拆票等流程结构兜住,不进检查分发
|
|
37
|
+
* - discipline:拦不住但数得出——无 checker 的登记记录,harness 永不渲染、
|
|
38
|
+
* 永不注入、永不执行,仅供消费方做代理信号计数;
|
|
39
|
+
* 超阈值晋升毕业后原地翻回 gate(补上 checker)
|
|
40
|
+
*/
|
|
41
|
+
export type ConstraintChannel = 'gate' | 'workflow' | 'discipline';
|
|
42
|
+
|
|
27
43
|
/**
|
|
28
44
|
* 约束触发条件(开放扩展)
|
|
29
45
|
*
|
|
@@ -49,11 +65,19 @@ export interface Constraint {
|
|
|
49
65
|
id: ConstraintId;
|
|
50
66
|
|
|
51
67
|
/**
|
|
52
|
-
* 约束类别(ADR-0029):恒为 'check'
|
|
68
|
+
* 约束类别(ADR-0029):恒为 'check';
|
|
53
69
|
* 纯文本提示(kind='prompt')已随文本注入层一并关停
|
|
54
70
|
*/
|
|
55
71
|
kind: ConstraintKind;
|
|
56
72
|
|
|
73
|
+
/**
|
|
74
|
+
* 约束通道(ADR-0035):缺省 'gate'
|
|
75
|
+
*
|
|
76
|
+
* gate 通道必须带 checker(注册表闭环收窄后的口径);workflow/discipline
|
|
77
|
+
* 通道允许无 checker——不进入检查分发、不触发闭环抛错、harness 不渲染不注入
|
|
78
|
+
*/
|
|
79
|
+
channel?: ConstraintChannel;
|
|
80
|
+
|
|
57
81
|
/** 约束规则(英文) */
|
|
58
82
|
rule: string;
|
|
59
83
|
|
|
@@ -84,7 +108,7 @@ export interface Constraint {
|
|
|
84
108
|
source?: ConstraintSource;
|
|
85
109
|
|
|
86
110
|
/**
|
|
87
|
-
* 填空式 checker 模板 id(仅 source='app'
|
|
111
|
+
* 填空式 checker 模板 id(仅 source='app' 使用;仅 channel='gate' 必填)
|
|
88
112
|
*
|
|
89
113
|
* 内置约束省略 = checker 按约束 id 在内置注册表查找;应用层约束按模板 id
|
|
90
114
|
* 在模板注册表(checkers/index.ts TEMPLATES)查找并带 params 实例化
|
|
@@ -116,6 +140,14 @@ export interface ConstraintResult {
|
|
|
116
140
|
* 但不计入 pass/fail 统计;trace 记录为 result: 'skip'。
|
|
117
141
|
*/
|
|
118
142
|
skipped?: boolean;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* 跳过原因(harness#182:「检查器失效 ≠ 对象合规」必须显式、可统计)
|
|
146
|
+
*
|
|
147
|
+
* 仅 skipped=true 时可能携带(旧路径的裸 'skip' 无原因);
|
|
148
|
+
* 进 CLI 跳过清单与 ExecutionTrace.skipReason。
|
|
149
|
+
*/
|
|
150
|
+
skipReason?: string;
|
|
119
151
|
|
|
120
152
|
/** 约束定义 */
|
|
121
153
|
constraint?: Constraint;
|
|
@@ -188,9 +220,6 @@ export interface ConstraintContext {
|
|
|
188
220
|
/** 是否已通过诊断→修复闸门(设计方案已确认) */
|
|
189
221
|
hasPlanApproval?: boolean;
|
|
190
222
|
|
|
191
|
-
/** 是否有验证证据 */
|
|
192
|
-
hasVerificationEvidence?: boolean;
|
|
193
|
-
|
|
194
223
|
/** 是否有测试 */
|
|
195
224
|
hasTest?: boolean;
|
|
196
225
|
|
|
@@ -245,7 +274,3 @@ export interface ConstraintCheckResult {
|
|
|
245
274
|
warningCount: number;
|
|
246
275
|
}
|
|
247
276
|
|
|
248
|
-
/**
|
|
249
|
-
* studio 兼容别名(P0 护栏):等价于 ConstraintContext
|
|
250
|
-
*/
|
|
251
|
-
export type IronLawContext = ConstraintContext;
|
package/src/types/passes-gate.ts
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
* 测试门控类型定义
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* 验证证据的约定落点(项目根相对路径)
|
|
7
|
+
*
|
|
8
|
+
* 写方 = PassesGate.runTests(真实跑测试命令后落盘)与消费方外部验证事件;
|
|
9
|
+
* 读方 = no_completion_without_verification checker(harness#183)。路径真相只此一处。
|
|
10
|
+
*/
|
|
11
|
+
export const EVIDENCE_DIR_REL = '.harness/evidence';
|
|
12
|
+
|
|
5
13
|
/**
|
|
6
14
|
* 测试门控配置
|
|
7
15
|
*/
|
package/src/types/trace.ts
CHANGED
|
@@ -61,6 +61,14 @@ export interface ExecutionTrace {
|
|
|
61
61
|
*/
|
|
62
62
|
evidence?: string[];
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* 跳过原因(harness#182;仅 result='skip' 时可能携带)
|
|
66
|
+
*
|
|
67
|
+
* 「未评估」必须可统计:降级跳过(输入不可得/检查器失效)与约定未采用
|
|
68
|
+
* 在结果面上靠本字段区分,失效计数由此可聚合成代理信号。
|
|
69
|
+
*/
|
|
70
|
+
skipReason?: string;
|
|
71
|
+
|
|
64
72
|
// ========================================
|
|
65
73
|
// 用户响应(可选,用于诊断)
|
|
66
74
|
// ========================================
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 统一所有源码目录发现逻辑:
|
|
5
5
|
* 1. monorepo: packages/下各包的 src 或 lib 子目录
|
|
6
|
-
* 2. monorepo: apps/下各应用的 src
|
|
6
|
+
* 2. monorepo: apps/下各应用的 src 子目录
|
|
7
7
|
* 3. 单 repo: src/ lib/ 目录
|
|
8
8
|
*
|
|
9
9
|
* 返回相对 projectPath 的路径数组。全都不存在时返回空数组。
|
|
@@ -49,28 +49,10 @@ export function detectSourceRoots(projectPath: string): string[] {
|
|
|
49
49
|
if (!entry.isDirectory() || entry.name.startsWith('.') || entry.name.startsWith('__')) continue;
|
|
50
50
|
const appDir = join(appsDir, entry.name);
|
|
51
51
|
|
|
52
|
-
// apps/api/src/modules/* 的子目录
|
|
53
|
-
const modulesDir = join(appDir, 'src', 'modules');
|
|
54
|
-
if (existsSync(modulesDir)) {
|
|
55
|
-
try {
|
|
56
|
-
const modEntries = readdirSync(modulesDir, { withFileTypes: true });
|
|
57
|
-
for (const mod of modEntries) {
|
|
58
|
-
if (!mod.isDirectory() || mod.name.startsWith('.') || mod.name.startsWith('__')) continue;
|
|
59
|
-
const modPath = join(modulesDir, mod.name);
|
|
60
|
-
if (hasSourceFiles(modPath)) {
|
|
61
|
-
roots.push(`apps/${entry.name}/src/modules/${mod.name}`);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
} catch { /* skip */ }
|
|
65
|
-
}
|
|
66
|
-
|
|
67
52
|
// apps/xxx/src 本身
|
|
68
53
|
const appSrcDir = join(appDir, 'src');
|
|
69
54
|
if (existsSync(appSrcDir) && hasSourceFiles(appSrcDir)) {
|
|
70
|
-
|
|
71
|
-
if (!roots.some(r => r.startsWith(`apps/${entry.name}/src/`))) {
|
|
72
|
-
roots.push(`apps/${entry.name}/src`);
|
|
73
|
-
}
|
|
55
|
+
roots.push(`apps/${entry.name}/src`);
|
|
74
56
|
}
|
|
75
57
|
}
|
|
76
58
|
} catch { /* skip */ }
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# PostToolUse hook — track deep analysis + session metrics
|
|
3
|
-
# Matcher: EnterPlanMode|Agent|Read|Write|Edit|Bash (broad coverage)
|
|
4
|
-
# DailyReflection: enriched session:summary events for behavioral analysis
|
|
5
|
-
|
|
6
|
-
STATE_FILE=/tmp/claude-knowledge-capture-state.json
|
|
7
|
-
INPUT=$(cat)
|
|
8
|
-
|
|
9
|
-
tool_name=$(echo "$INPUT" | jq -r '.tool_name // ""')
|
|
10
|
-
file_path=$(echo "$INPUT" | jq -r '.tool_input.file_path // ""')
|
|
11
|
-
|
|
12
|
-
# Init state file if missing (tool: claude|codex|opencode|etc)
|
|
13
|
-
_tool=$(echo "${CLAUDE_CODE_TOOL_NAME:-claude}" | tr '[:upper:]' '[:lower:]')
|
|
14
|
-
[ -f "$STATE_FILE" ] || echo "{\"planned\":false,\"explored\":false,\"readDirs\":[],\"captured\":false,\"turnCount\":0,\"startTime\":$(date +%s)000,\"tool\":\"$_tool\"}" > "$STATE_FILE"
|
|
15
|
-
|
|
16
|
-
# Always increment turn counter on substantive tools
|
|
17
|
-
case "$tool_name" in
|
|
18
|
-
EnterPlanMode)
|
|
19
|
-
jq '.planned = true | .turnCount += 1' "$STATE_FILE" > "${STATE_FILE}.tmp" && mv "${STATE_FILE}.tmp" "$STATE_FILE"
|
|
20
|
-
;;
|
|
21
|
-
Agent)
|
|
22
|
-
# Agent(Explore) spawned → deep analysis signal
|
|
23
|
-
_agent_type=$(echo "$INPUT" | jq -r '.tool_input.subagent_type // ""')
|
|
24
|
-
if [ "$_agent_type" = "Explore" ]; then
|
|
25
|
-
jq '.explored = true | .turnCount += 1' "$STATE_FILE" > "${STATE_FILE}.tmp" && mv "${STATE_FILE}.tmp" "$STATE_FILE"
|
|
26
|
-
fi
|
|
27
|
-
;;
|
|
28
|
-
Read)
|
|
29
|
-
if [ -n "$file_path" ]; then
|
|
30
|
-
dir=$(dirname "$file_path")
|
|
31
|
-
if [ "$dir" != "." ] && [ "$dir" != "/" ]; then
|
|
32
|
-
jq --arg d "$dir" '.readDirs += [$d] | .readDirs |= unique | .turnCount += 1' "$STATE_FILE" > "${STATE_FILE}.tmp" && mv "${STATE_FILE}.tmp" "$STATE_FILE"
|
|
33
|
-
fi
|
|
34
|
-
fi
|
|
35
|
-
;;
|
|
36
|
-
Write|Edit)
|
|
37
|
-
jq '.turnCount += 1' "$STATE_FILE" > "${STATE_FILE}.tmp" && mv "${STATE_FILE}.tmp" "$STATE_FILE"
|
|
38
|
-
case "$file_path" in
|
|
39
|
-
*.harness/knowledge-docs/*|*.harness/knowledge/*|*/memory/*.md|*/docs/*.md)
|
|
40
|
-
jq '.captured = true' "$STATE_FILE" > "${STATE_FILE}.tmp" && mv "${STATE_FILE}.tmp" "$STATE_FILE"
|
|
41
|
-
;;
|
|
42
|
-
esac
|
|
43
|
-
;;
|
|
44
|
-
Bash)
|
|
45
|
-
jq '.turnCount += 1' "$STATE_FILE" > "${STATE_FILE}.tmp" && mv "${STATE_FILE}.tmp" "$STATE_FILE"
|
|
46
|
-
;;
|
|
47
|
-
esac
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# PostToolUse hook — check for operations on sensitive files without prior Read
|
|
3
|
-
#
|
|
4
|
-
# Detects: Bash(mv/rm), Edit, or Write targeting files in bin/, .harness/, or
|
|
5
|
-
# package.json — and checks whether those files were Read earlier in this session.
|
|
6
|
-
#
|
|
7
|
-
# State file is maintained by harness-knowledge-track.sh which tracks all Read calls.
|
|
8
|
-
|
|
9
|
-
STATE_FILE=/tmp/claude-knowledge-capture-state.json
|
|
10
|
-
SENSITIVE_DIRS="bin/ .harness/"
|
|
11
|
-
|
|
12
|
-
INPUT=$(cat)
|
|
13
|
-
tool_name=$(echo "$INPUT" | jq -r '.tool_name // ""')
|
|
14
|
-
file_path=$(echo "$INPUT" | jq -r '.tool_input.file_path // ""')
|
|
15
|
-
content=$(echo "$INPUT" | jq -r '.tool_input.content // ""')
|
|
16
|
-
command=$(echo "$INPUT" | jq -r '.tool_input.command // ""')
|
|
17
|
-
|
|
18
|
-
# Check if this operation targets a sensitive file
|
|
19
|
-
is_sensitive=false
|
|
20
|
-
for dir in $SENSITIVE_DIRS; do
|
|
21
|
-
case "$file_path" in
|
|
22
|
-
*$dir*) is_sensitive=true; break ;;
|
|
23
|
-
esac
|
|
24
|
-
done
|
|
25
|
-
|
|
26
|
-
# For Bash, check if the command involves mv/rm on sensitive paths
|
|
27
|
-
if [ "$tool_name" = "Bash" ] && [ -n "$command" ]; then
|
|
28
|
-
for dir in $SENSITIVE_DIRS; do
|
|
29
|
-
if echo "$command" | grep -qE "(mv|rm|cp|git rm).*$dir"; then
|
|
30
|
-
is_sensitive=true
|
|
31
|
-
# Extract target from command for checking
|
|
32
|
-
file_path=$(echo "$command" | grep -oE "$dir[^ ]*" | head -1)
|
|
33
|
-
break
|
|
34
|
-
fi
|
|
35
|
-
done
|
|
36
|
-
fi
|
|
37
|
-
|
|
38
|
-
# Only check sensitive operations
|
|
39
|
-
if [ "$is_sensitive" != "true" ] || [ -z "$file_path" ]; then
|
|
40
|
-
exit 0
|
|
41
|
-
fi
|
|
42
|
-
|
|
43
|
-
# Check if this file was Read earlier in the session
|
|
44
|
-
if [ -f "$STATE_FILE" ]; then
|
|
45
|
-
read_dirs=$(jq -r '.readDirs // [] | join(" ")' "$STATE_FILE" 2>/dev/null || echo "")
|
|
46
|
-
|
|
47
|
-
# Check if any read_dir is an ancestor of file_path
|
|
48
|
-
verified=false
|
|
49
|
-
file_dir=$(dirname "$file_path")
|
|
50
|
-
for dir in $read_dirs; do
|
|
51
|
-
case "$file_dir" in
|
|
52
|
-
"$dir"|"$dir/"*) verified=true; break ;;
|
|
53
|
-
esac
|
|
54
|
-
done
|
|
55
|
-
|
|
56
|
-
if [ "$verified" != "true" ]; then
|
|
57
|
-
# Also check if the file itself was explicitly Read (file_path matches a read path)
|
|
58
|
-
# The track hook only records directories, not individual files — conservative check
|
|
59
|
-
|
|
60
|
-
# Emit warning via state file for Stop hook to pick up
|
|
61
|
-
jq --arg op "$tool_name" --arg fp "$file_path" \
|
|
62
|
-
'.sensitiveOps += [{"tool":$op,"file":$fp,"verified":false}]' \
|
|
63
|
-
"$STATE_FILE" > "${STATE_FILE}.tmp" && mv "${STATE_FILE}.tmp" "$STATE_FILE"
|
|
64
|
-
fi
|
|
65
|
-
fi
|
|
66
|
-
|
|
67
|
-
exit 0
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* error 级轻量检查(工单 21):纯上下文证据标志判定,无 I/O
|
|
3
|
-
*
|
|
4
|
-
* harness#174 后仅存活的 flag:hasVerificationEvidence
|
|
5
|
-
*(incremental_progress / no_implementation_without_requirement 已随定义一并删除)
|
|
6
|
-
*
|
|
7
|
-
* 三态语义(ADR-0001 防爆措施):
|
|
8
|
-
* - undefined = flag 未接线 → skip(不评估,CLI pre-commit 等路径不误报违规)
|
|
9
|
-
* - 显式 false → fail;true → pass
|
|
10
|
-
*/
|
|
11
|
-
export declare const noCompletionWithoutVerification: import("./types").ConstraintCheck;
|
|
12
|
-
//# sourceMappingURL=iron-flags.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iron-flags.d.ts","sourceRoot":"","sources":["../../../../src/core/constraints/checkers/iron-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,eAAO,MAAM,+BAA+B,mCAG3C,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* error 级轻量检查(工单 21):纯上下文证据标志判定,无 I/O
|
|
4
|
-
*
|
|
5
|
-
* harness#174 后仅存活的 flag:hasVerificationEvidence
|
|
6
|
-
*(incremental_progress / no_implementation_without_requirement 已随定义一并删除)
|
|
7
|
-
*
|
|
8
|
-
* 三态语义(ADR-0001 防爆措施):
|
|
9
|
-
* - undefined = flag 未接线 → skip(不评估,CLI pre-commit 等路径不误报违规)
|
|
10
|
-
* - 显式 false → fail;true → pass
|
|
11
|
-
*/
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.noCompletionWithoutVerification = void 0;
|
|
14
|
-
const types_1 = require("./types");
|
|
15
|
-
exports.noCompletionWithoutVerification = (0, types_1.contextEvidenceFlag)('no_completion_without_verification', ctx => ctx.hasVerificationEvidence);
|
|
16
|
-
//# sourceMappingURL=iron-flags.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iron-flags.js","sourceRoot":"","sources":["../../../../src/core/constraints/checkers/iron-flags.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,mCAA8C;AAEjC,QAAA,+BAA+B,GAAG,IAAA,2BAAmB,EAChE,oCAAoC,EACpC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,uBAAuB,CACnC,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 铁律层 flag 检查旁测(架构评审候选4,ADR-0009 同模式)
|
|
3
|
-
*
|
|
4
|
-
* 唯一存活的 flag 铁律为 contextEvidenceFlag 构造,真实 bug 面 = 读错上下文字段
|
|
5
|
-
* 与三态语义(undefined→skip / false→fail / true→pass)。直接喂不同字段组合
|
|
6
|
-
* 钉死映射,不再经 engine facade(旧测在 skip-semantics/checker.test 间接打)。
|
|
7
|
-
*
|
|
8
|
-
* harness#174 删除 incremental_progress / no_implementation_without_requirement,
|
|
9
|
-
* 对应用例一并移除。
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { describe, it, expect } from '@jest/globals';
|
|
13
|
-
import { noCompletionWithoutVerification } from '../iron-flags';
|
|
14
|
-
import { buildCheckEnv } from '../types';
|
|
15
|
-
import type { ConstraintContext } from '../../../../types/constraint';
|
|
16
|
-
|
|
17
|
-
const evaluate = (
|
|
18
|
-
check: { evaluate: (env: any) => unknown },
|
|
19
|
-
ctx: Partial<ConstraintContext>
|
|
20
|
-
) => check.evaluate(buildCheckEnv({ ...ctx, operation: 'code_implementation' }, 'none'));
|
|
21
|
-
|
|
22
|
-
describe('iron flags — 三态与字段映射', () => {
|
|
23
|
-
it('no_completion_without_verification → 读 hasVerificationEvidence', async () => {
|
|
24
|
-
expect(await evaluate(noCompletionWithoutVerification, {})).toBe('skip');
|
|
25
|
-
expect(await evaluate(noCompletionWithoutVerification, { hasVerificationEvidence: false })).toBe(false);
|
|
26
|
-
expect(await evaluate(noCompletionWithoutVerification, { hasVerificationEvidence: true })).toBe(true);
|
|
27
|
-
// 相邻字段不串台:hasTest 不能顶替
|
|
28
|
-
expect(await evaluate(noCompletionWithoutVerification, { hasTest: true })).toBe('skip');
|
|
29
|
-
});
|
|
30
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* error 级轻量检查(工单 21):纯上下文证据标志判定,无 I/O
|
|
3
|
-
*
|
|
4
|
-
* harness#174 后仅存活的 flag:hasVerificationEvidence
|
|
5
|
-
*(incremental_progress / no_implementation_without_requirement 已随定义一并删除)
|
|
6
|
-
*
|
|
7
|
-
* 三态语义(ADR-0001 防爆措施):
|
|
8
|
-
* - undefined = flag 未接线 → skip(不评估,CLI pre-commit 等路径不误报违规)
|
|
9
|
-
* - 显式 false → fail;true → pass
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { contextEvidenceFlag } from './types';
|
|
13
|
-
|
|
14
|
-
export const noCompletionWithoutVerification = contextEvidenceFlag(
|
|
15
|
-
'no_completion_without_verification',
|
|
16
|
-
ctx => ctx.hasVerificationEvidence
|
|
17
|
-
);
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main, master]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [main, master]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
test:
|
|
11
|
-
name: Test
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v4
|
|
16
|
-
|
|
17
|
-
- name: Setup Node.js
|
|
18
|
-
uses: actions/setup-node@v4
|
|
19
|
-
with:
|
|
20
|
-
node-version: '20'
|
|
21
|
-
cache: 'npm'
|
|
22
|
-
|
|
23
|
-
- name: Install dependencies
|
|
24
|
-
run: npm ci
|
|
25
|
-
|
|
26
|
-
- name: Run linter
|
|
27
|
-
run: npm run lint
|
|
28
|
-
|
|
29
|
-
- name: Run tests
|
|
30
|
-
run: npm test
|
|
31
|
-
|
|
32
|
-
- name: Build
|
|
33
|
-
run: npm run build
|
|
34
|
-
|
|
35
|
-
harness:
|
|
36
|
-
name: Harness Check
|
|
37
|
-
uses: kww/harness/.github/workflows/harness-check.yml@v1
|
|
38
|
-
with:
|
|
39
|
-
preset: standard
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main, master]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [main, master]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
test:
|
|
11
|
-
name: Test
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v4
|
|
16
|
-
|
|
17
|
-
- name: Setup Node.js
|
|
18
|
-
uses: actions/setup-node@v4
|
|
19
|
-
with:
|
|
20
|
-
node-version: '20'
|
|
21
|
-
cache: 'npm'
|
|
22
|
-
|
|
23
|
-
- name: Install dependencies
|
|
24
|
-
run: npm ci
|
|
25
|
-
|
|
26
|
-
- name: Run tests
|
|
27
|
-
run: npm test
|
|
28
|
-
|
|
29
|
-
- name: Build
|
|
30
|
-
run: npm run build
|
|
31
|
-
|
|
32
|
-
harness:
|
|
33
|
-
name: Harness Check
|
|
34
|
-
uses: kww/harness/.github/workflows/harness-check.yml@v1
|
|
35
|
-
with:
|
|
36
|
-
preset: standard
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{project_name}}",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"description": "",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc",
|
|
9
|
-
"dev": "tsc --watch",
|
|
10
|
-
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
11
|
-
"lint": "eslint src --ext .ts"
|
|
12
|
-
},
|
|
13
|
-
"devDependencies": {
|
|
14
|
-
"@types/node": "^20.11.0",
|
|
15
|
-
"typescript": "^5.3.0",
|
|
16
|
-
"jest": "^29.7.0",
|
|
17
|
-
"@types/jest": "^29.5.0",
|
|
18
|
-
"ts-jest": "^29.1.0"
|
|
19
|
-
},
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"@dommaker/harness": "^0.1.0"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "Node",
|
|
6
|
-
"lib": ["ES2022"],
|
|
7
|
-
"outDir": "./dist",
|
|
8
|
-
"rootDir": "./src",
|
|
9
|
-
"strict": true,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"skipLibCheck": true,
|
|
12
|
-
"forceConsistentCasingInFileNames": true,
|
|
13
|
-
"declaration": true,
|
|
14
|
-
"declarationMap": true,
|
|
15
|
-
"sourceMap": true
|
|
16
|
-
},
|
|
17
|
-
"include": ["src/**/*"],
|
|
18
|
-
"exclude": ["node_modules", "dist", "__tests__"]
|
|
19
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main, master]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [main, master]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
test:
|
|
11
|
-
name: Test
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v4
|
|
16
|
-
|
|
17
|
-
- name: Setup Python
|
|
18
|
-
uses: actions/setup-python@v5
|
|
19
|
-
with:
|
|
20
|
-
python-version: '3.11'
|
|
21
|
-
cache: 'pip'
|
|
22
|
-
|
|
23
|
-
- name: Install dependencies
|
|
24
|
-
run: |
|
|
25
|
-
pip install -r requirements.txt
|
|
26
|
-
pip install pytest pytest-cov
|
|
27
|
-
|
|
28
|
-
- name: Run tests
|
|
29
|
-
run: pytest --cov=src --cov-report=xml
|
|
30
|
-
|
|
31
|
-
- name: Upload coverage
|
|
32
|
-
uses: codecov/codecov-action@v4
|
|
33
|
-
|
|
34
|
-
harness:
|
|
35
|
-
name: Harness Check
|
|
36
|
-
uses: kww/harness/.github/workflows/harness-check.yml@v1
|
|
37
|
-
with:
|
|
38
|
-
preset: standard
|
|
39
|
-
skip-tests: true # Python 项目使用 pytest
|