@pzy560117/codex-harness 0.1.6 → 0.1.8
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/README.md +4 -1
- package/lib/commands/init.js +61 -1
- package/lib/release/package-source-layout.js +20 -8
- package/package-source/AGENTS.md +7 -0
- package/package-source/PACKAGE.md +3 -3
- package/package-source/README.md +13 -46
- package/package-source/docs/codex-harness-engineering/templates/bootstrap-codex-harness.ps1 +57 -48
- package/package-source/docs/codex-harness-engineering/templates/docs/new-project-usage.md +2 -0
- package/package-source/docs/codex-harness-engineering/templates/docs/task-session-strategy.md +4 -0
- package/package-source/docs/codex-harness-engineering/templates/hooks/hook-stop-verify.ps1 +76 -10
- package/package-source/docs/codex-harness-engineering/templates/package-assets/docs/codex-harness-engineering/examples/ticket-filter-demo/task.json +2 -2
- package/package-source/docs/codex-harness-engineering/templates/runtime/AGENTS.md +4 -0
- package/package-source/docs/codex-harness-engineering/templates/runtime/doctor.ps1 +89 -24
- package/package-source/docs/codex-harness-engineering/templates/runtime/project-task-template.json +81 -66
- package/package-source/docs/codex-harness-engineering/templates/runtime/smoke-task.json +1 -1
- package/package-source/docs/codex-harness-engineering/templates/runtime/task.json +1 -1
- package/package-source/docs/codex-harness-engineering/templates/runtime/verify.ps1 +29 -12
- package/package-source/docs/codex-harness-engineering/templates/tools/harness/task-structure-lint.ps1 +399 -0
- package/package-source/install-manifest.json +1 -1
- package/package-source/tools/install/bootstrap-codex-harness.ps1 +23 -10
- package/package.json +1 -1
|
@@ -57,14 +57,50 @@ function Add-DoctorError {
|
|
|
57
57
|
$Errors.Value += $Message
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
function Add-DoctorWarning {
|
|
61
|
-
param(
|
|
62
|
-
[ref]$Warnings,
|
|
63
|
-
[string]$Message
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
$Warnings.Value += $Message
|
|
67
|
-
}
|
|
60
|
+
function Add-DoctorWarning {
|
|
61
|
+
param(
|
|
62
|
+
[ref]$Warnings,
|
|
63
|
+
[string]$Message
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
$Warnings.Value += $Message
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function Invoke-TaskStructureValidation {
|
|
70
|
+
param(
|
|
71
|
+
[string]$Root,
|
|
72
|
+
[ref]$Errors,
|
|
73
|
+
[ref]$Warnings
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
$scriptPath = Join-Path $Root "tools\harness\task-structure-lint.ps1"
|
|
77
|
+
if (-not (Test-Path -LiteralPath $scriptPath -PathType Leaf)) {
|
|
78
|
+
Add-DoctorError -Errors $Errors -Message "缺少 task structure lint: tools\\harness\\task-structure-lint.ps1"
|
|
79
|
+
return
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
try {
|
|
83
|
+
$result = & powershell -NoProfile -ExecutionPolicy Bypass -File $scriptPath -ProjectRoot $Root -JsonOutput | ConvertFrom-Json
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
Add-DoctorError -Errors $Errors -Message "task structure lint 执行失败: $($_.Exception.Message)"
|
|
87
|
+
return
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
foreach ($finding in @($result.findings)) {
|
|
91
|
+
$message = [string]$finding.message
|
|
92
|
+
if (-not [string]::IsNullOrWhiteSpace([string]$finding.task_id)) {
|
|
93
|
+
$message = "task $($finding.task_id): $message"
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if ($finding.severity -eq "warning") {
|
|
97
|
+
Add-DoctorWarning -Warnings $Warnings -Message $message
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
Add-DoctorError -Errors $Errors -Message $message
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
68
104
|
|
|
69
105
|
function Get-DoctorFileSha256 {
|
|
70
106
|
param([string]$Path)
|
|
@@ -1017,15 +1053,16 @@ $isThinProjectInstall = $harnessConfigInfo.Exists -and $harnessConfigInfo.Valid
|
|
|
1017
1053
|
$isVendorProjectInstall = $harnessConfigInfo.Exists -and $harnessConfigInfo.Valid -and $harnessConfigInfo.InstallScope -eq "vendor"
|
|
1018
1054
|
$isNotInstalledProject = $baseProjectShape -eq "not-installed"
|
|
1019
1055
|
|
|
1020
|
-
$requiredRootFiles = @(
|
|
1021
|
-
"AGENTS.md",
|
|
1056
|
+
$requiredRootFiles = @(
|
|
1057
|
+
"AGENTS.md",
|
|
1022
1058
|
"tools\harness\codex-loop.ps1",
|
|
1023
1059
|
"tools\harness\doctor.ps1",
|
|
1060
|
+
"tools\harness\task-structure-lint.ps1",
|
|
1024
1061
|
"tools\harness\verify.ps1",
|
|
1025
1062
|
"tools\install\env-check.ps1",
|
|
1026
1063
|
"task.json",
|
|
1027
1064
|
"docs\harness\trace.schema.json"
|
|
1028
|
-
)
|
|
1065
|
+
)
|
|
1029
1066
|
|
|
1030
1067
|
$requiredPromptFiles = @(
|
|
1031
1068
|
".codex\\prompts\\implement-one-task.md",
|
|
@@ -1143,11 +1180,37 @@ elseif (-not $isVendorProjectInstall) {
|
|
|
1143
1180
|
Add-DoctorError -Errors ([ref]$errors) -Message "task.json 仍包含模板占位符,请先替换为当前项目真实任务。"
|
|
1144
1181
|
}
|
|
1145
1182
|
|
|
1146
|
-
$taskDocument = $taskContent | ConvertFrom-Json
|
|
1147
|
-
$runtime = $taskDocument.runtime
|
|
1148
|
-
$
|
|
1149
|
-
|
|
1150
|
-
|
|
1183
|
+
$taskDocument = $taskContent | ConvertFrom-Json
|
|
1184
|
+
$runtime = $taskDocument.runtime
|
|
1185
|
+
if ($null -eq $runtime -or [string]::IsNullOrWhiteSpace([string]$runtime.driver)) {
|
|
1186
|
+
Add-DoctorError -Errors ([ref]$errors) -Message "task.json 缺少 runtime.driver"
|
|
1187
|
+
}
|
|
1188
|
+
else {
|
|
1189
|
+
$driverCommand = [string]$runtime.driver
|
|
1190
|
+
if ($driverCommand -match 'tools[\\/]+harness[\\/]+tools[\\/]+harness[\\/]+codex-loop\.ps1') {
|
|
1191
|
+
Add-DoctorError -Errors ([ref]$errors) -Message "task.json 的 runtime.driver 包含重复路径段 tools/harness/tools/harness,请改为 .\\tools\\harness\\codex-loop.ps1"
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
$driverFileMatch = [regex]::Match($driverCommand, '(?i)-File\s+("?)([^"]+)\1')
|
|
1195
|
+
if (-not $driverFileMatch.Success) {
|
|
1196
|
+
Add-DoctorError -Errors ([ref]$errors) -Message "task.json 的 runtime.driver 不是可解析的 PowerShell -File 命令: $driverCommand"
|
|
1197
|
+
}
|
|
1198
|
+
else {
|
|
1199
|
+
$driverRelativePath = $driverFileMatch.Groups[2].Value.Replace('/', '\')
|
|
1200
|
+
if ($driverRelativePath.StartsWith('.\')) {
|
|
1201
|
+
$driverRelativePath = $driverRelativePath.Substring(2)
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
$driverPath = Join-Path $resolvedProjectRoot $driverRelativePath
|
|
1205
|
+
if (-not (Test-Path -LiteralPath $driverPath)) {
|
|
1206
|
+
Add-DoctorError -Errors ([ref]$errors) -Message "task.json 的 runtime.driver 指向不存在的脚本: $driverRelativePath"
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
$runProfileRelativePath = $DefaultRunProfile
|
|
1212
|
+
if ($null -ne $runtime -and -not [string]::IsNullOrWhiteSpace($runtime.run_profile)) {
|
|
1213
|
+
$runProfileRelativePath = $runtime.run_profile
|
|
1151
1214
|
}
|
|
1152
1215
|
|
|
1153
1216
|
$runProfilePath = Join-Path $resolvedProjectRoot $runProfileRelativePath
|
|
@@ -1204,7 +1267,7 @@ elseif (-not $isVendorProjectInstall) {
|
|
|
1204
1267
|
}
|
|
1205
1268
|
|
|
1206
1269
|
$taskIds = @{}
|
|
1207
|
-
foreach ($task in @($taskDocument.tasks)) {
|
|
1270
|
+
foreach ($task in @($taskDocument.tasks)) {
|
|
1208
1271
|
if ($null -eq $task.id -or [string]::IsNullOrWhiteSpace([string]$task.id)) {
|
|
1209
1272
|
Add-DoctorError -Errors ([ref]$errors) -Message "存在缺少 id 的任务。"
|
|
1210
1273
|
continue
|
|
@@ -1231,13 +1294,15 @@ elseif (-not $isVendorProjectInstall) {
|
|
|
1231
1294
|
|
|
1232
1295
|
$requiredTruthSourcesProperty = $task.PSObject.Properties["required_truth_sources"]
|
|
1233
1296
|
$requiredTruthSources = if ($null -ne $requiredTruthSourcesProperty) { $requiredTruthSourcesProperty.Value } else { @() }
|
|
1234
|
-
foreach ($truthSource in @($requiredTruthSources)) {
|
|
1235
|
-
if ($allowedTruthSources -notcontains [string]$truthSource) {
|
|
1236
|
-
Add-DoctorError -Errors ([ref]$errors) -Message "任务 $($task.id) 使用了未知 required_truth_source: $truthSource"
|
|
1237
|
-
}
|
|
1238
|
-
}
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1297
|
+
foreach ($truthSource in @($requiredTruthSources)) {
|
|
1298
|
+
if ($allowedTruthSources -notcontains [string]$truthSource) {
|
|
1299
|
+
Add-DoctorError -Errors ([ref]$errors) -Message "任务 $($task.id) 使用了未知 required_truth_source: $truthSource"
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
Invoke-TaskStructureValidation -Root $resolvedProjectRoot -Errors ([ref]$errors) -Warnings ([ref]$warnings)
|
|
1305
|
+
}
|
|
1241
1306
|
|
|
1242
1307
|
Write-DoctorReadiness `
|
|
1243
1308
|
-Root $resolvedProjectRoot `
|
package/package-source/docs/codex-harness-engineering/templates/runtime/project-task-template.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"runtime": {
|
|
3
|
-
"driver": "powershell -NoProfile -ExecutionPolicy Bypass -File .\\tools\\harness\\
|
|
3
|
+
"driver": "powershell -NoProfile -ExecutionPolicy Bypass -File .\\tools\\harness\\codex-loop.ps1",
|
|
4
4
|
"trace_dir": "traces",
|
|
5
5
|
"agent": "codex",
|
|
6
6
|
"run_profile": ".codex\\task-run-profile.json",
|
|
@@ -92,12 +92,13 @@
|
|
|
92
92
|
"execution": {
|
|
93
93
|
"mode": "single"
|
|
94
94
|
},
|
|
95
|
-
"steps": [
|
|
96
|
-
"把模板中的 <feature-slug>、用户故事标题、requirement_ids、owned_paths、context_files 和 test_command 全部替换成当前项目真实值",
|
|
97
|
-
"确认 task 依赖、优先级、execution.mode 和 non_blocking_dirty_paths 已与当前项目约束一致",
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
|
|
95
|
+
"steps": [
|
|
96
|
+
"把模板中的 <feature-slug>、用户故事标题、requirement_ids、owned_paths、context_files 和 test_command 全部替换成当前项目真实值",
|
|
97
|
+
"确认 task 依赖、优先级、execution.mode 和 non_blocking_dirty_paths 已与当前项目约束一致",
|
|
98
|
+
"不得删除 ANALYSIS-001、TESTCASE-001、PLAN-001;未经用户明确批准并记录例外原因,不得压缩标准模板 phase",
|
|
99
|
+
"确认架构约束 truth source 已明确交付形态、公开入口、数据边界、异步边界、测试替身策略、禁止实现和 Definition of Done;如项目不用默认路径,更新 runtime.handoff.truth_sources.architecture",
|
|
100
|
+
"确认当前 task.json 已经是正式任务队列,不再保留领域示例、smoke 占位或过期路径"
|
|
101
|
+
],
|
|
101
102
|
"test_command": "git diff --check",
|
|
102
103
|
"acceptance": [
|
|
103
104
|
"任务队列只保留当前项目真实阶段与用户故事",
|
|
@@ -354,7 +355,9 @@
|
|
|
354
355
|
"把后续实现按用户故事顺序映射到 dev-plan、affected tests、验证命令和证据路径",
|
|
355
356
|
"把自然语言测试用例中的 TDD 候选转换为每个 feature_impl.qa_contract.tdd_contract,并保留 source_case_ids",
|
|
356
357
|
"把非 TDD 自然语言用例映射到 feature_impl.qa_contract.story_full_chain.source_case_ids、acceptance_validation.source_case_ids、回归计划或 verify-matrix",
|
|
358
|
+
"不要把模板 phase 合并成更少任务;如果用户明确批准压缩,必须在对应任务补充 decomposition_exemption 记录批准范围和原因",
|
|
357
359
|
"确认每个实现任务都已有 requirement_ids、owned_paths、context_files 和最小可行验收闭环",
|
|
360
|
+
"确认每个 feature_impl 默认不超过 3 条主 requirement_ids;订单、支付、库存、RBAC 拆成独立任务;前端和后端不要长期混在同一个 story",
|
|
358
361
|
"对涉及用户可见行为、路由、表单、权限、状态流转或关键业务闭环的任务,明确是否要求 docs/testing/e2e-plan.md,并把相关 E2E 命令写进 test_command 或 release 验证链路",
|
|
359
362
|
"确认每个 feature_impl 任务都携带 architecture_constraints、forbidden_implementations、tdd_contract 和项目真实可执行的 test_command",
|
|
360
363
|
"明确哪些故事必须串行,哪些依赖可在后续手工改成并行"
|
|
@@ -364,6 +367,8 @@
|
|
|
364
367
|
"dev-plan、verify-matrix 和 story 级执行顺序保持一致",
|
|
365
368
|
"每个 feature_impl 的 tdd_contract.red.source_case_ids 均能回溯到 NATURAL_LANGUAGE_TEST_CASES.md",
|
|
366
369
|
"每个 feature_impl 的非 TDD 自然语言用例均能回溯到 story_full_chain、acceptance_validation、回归计划或 verify-matrix",
|
|
370
|
+
"模板 phase 没有被压缩;如存在压缩或跨层混合,已附带用户批准的 decomposition_exemption",
|
|
371
|
+
"每个 feature_impl 默认不超过 3 条主 requirement_ids,且订单、支付、库存、RBAC 已拆成独立任务",
|
|
367
372
|
"高风险用户可见任务已经明确是否需要 e2e-plan 与对应 E2E 证据",
|
|
368
373
|
"实现任务不会把测试替身、local-only adapter 或领域原型伪装成声明的交付路径",
|
|
369
374
|
"后续实现与 release 任务的验证边界已经明确且可执行"
|
|
@@ -487,19 +492,21 @@
|
|
|
487
492
|
],
|
|
488
493
|
"exemptions": []
|
|
489
494
|
},
|
|
490
|
-
"context_files": [
|
|
491
|
-
"docs/product/prd-lite.md",
|
|
492
|
-
"docs/product/requirement-interface-matrix.md",
|
|
493
|
-
"docs/architecture/constraints.md",
|
|
494
|
-
"docs/context/feature-pack.md",
|
|
495
|
-
"docs/design/design-brief.md",
|
|
496
|
-
"docs/design/component-map.md",
|
|
497
|
-
"docs/design/screen-states.md",
|
|
498
|
-
"docs/testing/
|
|
499
|
-
"docs/testing/
|
|
500
|
-
"docs/testing/
|
|
501
|
-
"docs/testing/
|
|
502
|
-
"docs/testing/
|
|
495
|
+
"context_files": [
|
|
496
|
+
"docs/product/prd-lite.md",
|
|
497
|
+
"docs/product/requirement-interface-matrix.md",
|
|
498
|
+
"docs/architecture/constraints.md",
|
|
499
|
+
"docs/context/feature-pack.md",
|
|
500
|
+
"docs/design/design-brief.md",
|
|
501
|
+
"docs/design/component-map.md",
|
|
502
|
+
"docs/design/screen-states.md",
|
|
503
|
+
"docs/testing/ACCEPTANCE_CRITERIA.md",
|
|
504
|
+
"docs/testing/ACCEPTANCE_EXAMPLES.md",
|
|
505
|
+
"docs/testing/NATURAL_LANGUAGE_TEST_CASES.md",
|
|
506
|
+
"docs/testing/REGRESSION_PLAN.md",
|
|
507
|
+
"docs/testing/TRACEABILITY_MATRIX.md",
|
|
508
|
+
"docs/testing/TEST_STRATEGY.md",
|
|
509
|
+
"docs/testing/TEST_DATA_MATRIX.md",
|
|
503
510
|
"docs/testing/EVIDENCE_PROTOCOL.md",
|
|
504
511
|
"docs/testing/test-matrix.md",
|
|
505
512
|
"docs/testing/verify-matrix.md",
|
|
@@ -520,13 +527,14 @@
|
|
|
520
527
|
"execution": {
|
|
521
528
|
"mode": "single"
|
|
522
529
|
},
|
|
523
|
-
"steps": [
|
|
524
|
-
"把 US1 标题、requirement_ids、owned_paths、产物路径和独立验证方式替换为真实项目内容",
|
|
525
|
-
"把 qa_contract 中的 tdd_contract.source_case_ids、story_full_chain.source_case_ids、acceptance_validation.source_case_ids、入口、数据、动作、Oracle、证据、失败态和 release impact 全部替换为真实内容",
|
|
526
|
-
"
|
|
527
|
-
"
|
|
528
|
-
|
|
529
|
-
|
|
530
|
+
"steps": [
|
|
531
|
+
"把 US1 标题、requirement_ids、owned_paths、产物路径和独立验证方式替换为真实项目内容",
|
|
532
|
+
"把 qa_contract 中的 tdd_contract.source_case_ids、story_full_chain.source_case_ids、acceptance_validation.source_case_ids、入口、数据、动作、Oracle、证据、失败态和 release impact 全部替换为真实内容",
|
|
533
|
+
"单个 feature_impl 默认不超过 3 条主 requirement_ids;订单、支付、库存、RBAC 不要和其他主故事捆绑;前端和后端不要长期混在同一个 story",
|
|
534
|
+
"仅实现首个可单独交付的用户故事,并同步补齐其 affected tests 与必要文档",
|
|
535
|
+
"运行与 US1 对应的真实验证命令,必须包含开发验证和代码完成后的故事级验收链路,并记录可回溯证据"
|
|
536
|
+
],
|
|
537
|
+
"test_command": "powershell -NoProfile -ExecutionPolicy Bypass -File .\\tools\\harness\\verify.ps1 -Commands @('<replace-with-project-fitness-check>', '<replace-with-affected-tests>', 'git diff --check')",
|
|
530
538
|
"acceptance": [
|
|
531
539
|
"US1 能作为 MVP 独立演示或独立验收",
|
|
532
540
|
"US1 满足架构约束 truth source,不以测试替身冒充声明交付路径",
|
|
@@ -652,19 +660,21 @@
|
|
|
652
660
|
],
|
|
653
661
|
"exemptions": []
|
|
654
662
|
},
|
|
655
|
-
"context_files": [
|
|
656
|
-
"docs/product/prd-lite.md",
|
|
657
|
-
"docs/product/requirement-interface-matrix.md",
|
|
658
|
-
"docs/architecture/constraints.md",
|
|
659
|
-
"docs/context/feature-pack.md",
|
|
660
|
-
"docs/design/design-brief.md",
|
|
661
|
-
"docs/design/component-map.md",
|
|
662
|
-
"docs/design/screen-states.md",
|
|
663
|
-
"docs/testing/
|
|
664
|
-
"docs/testing/
|
|
665
|
-
"docs/testing/
|
|
666
|
-
"docs/testing/
|
|
667
|
-
"docs/testing/
|
|
663
|
+
"context_files": [
|
|
664
|
+
"docs/product/prd-lite.md",
|
|
665
|
+
"docs/product/requirement-interface-matrix.md",
|
|
666
|
+
"docs/architecture/constraints.md",
|
|
667
|
+
"docs/context/feature-pack.md",
|
|
668
|
+
"docs/design/design-brief.md",
|
|
669
|
+
"docs/design/component-map.md",
|
|
670
|
+
"docs/design/screen-states.md",
|
|
671
|
+
"docs/testing/ACCEPTANCE_CRITERIA.md",
|
|
672
|
+
"docs/testing/ACCEPTANCE_EXAMPLES.md",
|
|
673
|
+
"docs/testing/NATURAL_LANGUAGE_TEST_CASES.md",
|
|
674
|
+
"docs/testing/REGRESSION_PLAN.md",
|
|
675
|
+
"docs/testing/TRACEABILITY_MATRIX.md",
|
|
676
|
+
"docs/testing/TEST_STRATEGY.md",
|
|
677
|
+
"docs/testing/TEST_DATA_MATRIX.md",
|
|
668
678
|
"docs/testing/EVIDENCE_PROTOCOL.md",
|
|
669
679
|
"docs/testing/test-matrix.md",
|
|
670
680
|
"docs/testing/verify-matrix.md",
|
|
@@ -685,13 +695,14 @@
|
|
|
685
695
|
"execution": {
|
|
686
696
|
"mode": "single"
|
|
687
697
|
},
|
|
688
|
-
"steps": [
|
|
689
|
-
"将 US2 占位内容替换为真实范围、路径、需求编号和验证命令",
|
|
690
|
-
"把 qa_contract 中的 tdd_contract.source_case_ids、story_full_chain.source_case_ids、acceptance_validation.source_case_ids、入口、数据、动作、Oracle、证据、失败态和 release impact 全部替换为真实内容",
|
|
691
|
-
"
|
|
692
|
-
"
|
|
693
|
-
|
|
694
|
-
|
|
698
|
+
"steps": [
|
|
699
|
+
"将 US2 占位内容替换为真实范围、路径、需求编号和验证命令",
|
|
700
|
+
"把 qa_contract 中的 tdd_contract.source_case_ids、story_full_chain.source_case_ids、acceptance_validation.source_case_ids、入口、数据、动作、Oracle、证据、失败态和 release impact 全部替换为真实内容",
|
|
701
|
+
"单个 feature_impl 默认不超过 3 条主 requirement_ids;订单、支付、库存、RBAC 不要和其他主故事捆绑;前端和后端不要长期混在同一个 story",
|
|
702
|
+
"确保 US2 可作为独立增量交付,不把未确认范围混入同一任务",
|
|
703
|
+
"补齐 US2 的 affected tests、开发验证、代码完成后的故事级验收链路、回归说明和证据路径"
|
|
704
|
+
],
|
|
705
|
+
"test_command": "powershell -NoProfile -ExecutionPolicy Bypass -File .\\tools\\harness\\verify.ps1 -Commands @('<replace-with-project-fitness-check>', '<replace-with-affected-tests>', 'git diff --check')",
|
|
695
706
|
"acceptance": [
|
|
696
707
|
"US2 范围清晰且不与其他故事混杂",
|
|
697
708
|
"US2 满足架构约束 truth source,不以测试替身冒充声明交付路径",
|
|
@@ -817,18 +828,21 @@
|
|
|
817
828
|
],
|
|
818
829
|
"exemptions": []
|
|
819
830
|
},
|
|
820
|
-
"context_files": [
|
|
821
|
-
"docs/product/prd-lite.md",
|
|
822
|
-
"docs/product/requirement-interface-matrix.md",
|
|
823
|
-
"docs/architecture/constraints.md",
|
|
824
|
-
"docs/context/feature-pack.md",
|
|
825
|
-
"docs/design/design-brief.md",
|
|
826
|
-
"docs/design/component-map.md",
|
|
827
|
-
"docs/design/screen-states.md",
|
|
828
|
-
"docs/testing/
|
|
829
|
-
"docs/testing/
|
|
830
|
-
"docs/testing/
|
|
831
|
-
"docs/testing/
|
|
831
|
+
"context_files": [
|
|
832
|
+
"docs/product/prd-lite.md",
|
|
833
|
+
"docs/product/requirement-interface-matrix.md",
|
|
834
|
+
"docs/architecture/constraints.md",
|
|
835
|
+
"docs/context/feature-pack.md",
|
|
836
|
+
"docs/design/design-brief.md",
|
|
837
|
+
"docs/design/component-map.md",
|
|
838
|
+
"docs/design/screen-states.md",
|
|
839
|
+
"docs/testing/ACCEPTANCE_CRITERIA.md",
|
|
840
|
+
"docs/testing/ACCEPTANCE_EXAMPLES.md",
|
|
841
|
+
"docs/testing/NATURAL_LANGUAGE_TEST_CASES.md",
|
|
842
|
+
"docs/testing/REGRESSION_PLAN.md",
|
|
843
|
+
"docs/testing/TRACEABILITY_MATRIX.md",
|
|
844
|
+
"docs/testing/TEST_STRATEGY.md",
|
|
845
|
+
"docs/testing/TEST_DATA_MATRIX.md",
|
|
832
846
|
"docs/testing/EVIDENCE_PROTOCOL.md",
|
|
833
847
|
"docs/testing/test-matrix.md",
|
|
834
848
|
"docs/testing/verify-matrix.md",
|
|
@@ -849,13 +863,14 @@
|
|
|
849
863
|
"execution": {
|
|
850
864
|
"mode": "single"
|
|
851
865
|
},
|
|
852
|
-
"steps": [
|
|
853
|
-
"将 US3 占位内容替换为真实故事标题、路径、需求编号和验证方式",
|
|
854
|
-
"把 qa_contract 中的 tdd_contract.source_case_ids、story_full_chain.source_case_ids、acceptance_validation.source_case_ids、入口、数据、动作、Oracle、证据、失败态和 release impact 全部替换为真实内容",
|
|
855
|
-
"
|
|
856
|
-
"
|
|
857
|
-
|
|
858
|
-
|
|
866
|
+
"steps": [
|
|
867
|
+
"将 US3 占位内容替换为真实故事标题、路径、需求编号和验证方式",
|
|
868
|
+
"把 qa_contract 中的 tdd_contract.source_case_ids、story_full_chain.source_case_ids、acceptance_validation.source_case_ids、入口、数据、动作、Oracle、证据、失败态和 release impact 全部替换为真实内容",
|
|
869
|
+
"单个 feature_impl 默认不超过 3 条主 requirement_ids;订单、支付、库存、RBAC 不要和其他主故事捆绑;前端和后端不要长期混在同一个 story",
|
|
870
|
+
"只承接剩余优先级最高且可单独验收的增量,不把 release 收口动作混入本故事",
|
|
871
|
+
"完成 US3 的实现、测试映射、开发验证、代码完成后的故事级验收链路和证据沉淀"
|
|
872
|
+
],
|
|
873
|
+
"test_command": "powershell -NoProfile -ExecutionPolicy Bypass -File .\\tools\\harness\\verify.ps1 -Commands @('<replace-with-project-fitness-check>', '<replace-with-affected-tests>', 'git diff --check')",
|
|
859
874
|
"acceptance": [
|
|
860
875
|
"US3 的增量边界和独立验收方式已明确",
|
|
861
876
|
"US3 满足架构约束 truth source,不以测试替身冒充声明交付路径",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
}
|
|
38
38
|
],
|
|
39
39
|
"runtime": {
|
|
40
|
-
"driver": "powershell -NoProfile -ExecutionPolicy Bypass -File .\\tools\\harness\\
|
|
40
|
+
"driver": "powershell -NoProfile -ExecutionPolicy Bypass -File .\\tools\\harness\\codex-loop.ps1",
|
|
41
41
|
"run_profile": ".codex\\task-run-profile.json",
|
|
42
42
|
"session": {
|
|
43
43
|
"mode": "fresh-process",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"runtime": {
|
|
3
|
-
"driver": "powershell -NoProfile -ExecutionPolicy Bypass -File .\\tools\\harness\\
|
|
3
|
+
"driver": "powershell -NoProfile -ExecutionPolicy Bypass -File .\\tools\\harness\\codex-loop.ps1",
|
|
4
4
|
"trace_dir": "traces",
|
|
5
5
|
"agent": "codex",
|
|
6
6
|
"run_profile": ".codex\\task-run-profile.json",
|
|
@@ -11,7 +11,7 @@ if ([string]::IsNullOrWhiteSpace($ProjectRoot)) {
|
|
|
11
11
|
$ProjectRoot = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot "..\.."))
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
function Invoke-VerificationCommand {
|
|
14
|
+
function Invoke-VerificationCommand {
|
|
15
15
|
param(
|
|
16
16
|
[string]$Command,
|
|
17
17
|
[string]$Root
|
|
@@ -27,8 +27,22 @@ function Invoke-VerificationCommand {
|
|
|
27
27
|
}
|
|
28
28
|
finally {
|
|
29
29
|
Pop-Location
|
|
30
|
-
}
|
|
31
|
-
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function Invoke-TaskStructureValidation {
|
|
34
|
+
param([string]$Root)
|
|
35
|
+
|
|
36
|
+
$scriptPath = Join-Path $Root "tools\harness\task-structure-lint.ps1"
|
|
37
|
+
if (-not (Test-Path -LiteralPath $scriptPath)) {
|
|
38
|
+
throw "缺少 task structure lint: tools\\harness\\task-structure-lint.ps1"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
& powershell -NoProfile -ExecutionPolicy Bypass -File $scriptPath -ProjectRoot $Root | Out-Host
|
|
42
|
+
if ($LASTEXITCODE -ne 0) {
|
|
43
|
+
throw "task structure 校验失败。"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
32
46
|
|
|
33
47
|
function Get-CodexHookCommand {
|
|
34
48
|
param(
|
|
@@ -166,15 +180,17 @@ function Test-CodexHookCommandCompatibility {
|
|
|
166
180
|
function Test-PowerShellSyntax {
|
|
167
181
|
param([string]$Root)
|
|
168
182
|
|
|
169
|
-
$paths = @(
|
|
183
|
+
$paths = @(
|
|
170
184
|
"tools\install\bootstrap-codex-harness.ps1",
|
|
171
185
|
"tools\harness\codex-loop.ps1",
|
|
172
186
|
"tools\install\env-check.ps1",
|
|
173
187
|
"tools\install\install-agent.ps1",
|
|
174
188
|
"tools\install\install-agent-here.ps1",
|
|
189
|
+
"tools\harness\task-structure-lint.ps1",
|
|
175
190
|
"tools\harness\verify.ps1",
|
|
176
191
|
"docs\codex-harness-engineering\templates\bootstrap-codex-harness.ps1",
|
|
177
|
-
"docs\codex-harness-engineering\templates\hooks\hook-stop-verify.ps1"
|
|
192
|
+
"docs\codex-harness-engineering\templates\hooks\hook-stop-verify.ps1",
|
|
193
|
+
"docs\codex-harness-engineering\templates\tools\harness\task-structure-lint.ps1"
|
|
178
194
|
)
|
|
179
195
|
|
|
180
196
|
foreach ($relativePath in $paths) {
|
|
@@ -273,13 +289,14 @@ function Invoke-AgentPackageFreshnessCheck {
|
|
|
273
289
|
|
|
274
290
|
$resolvedProjectRoot = (Resolve-Path -LiteralPath $ProjectRoot).Path
|
|
275
291
|
|
|
276
|
-
foreach ($command in $Commands) {
|
|
277
|
-
Invoke-VerificationCommand -Command $command -Root $resolvedProjectRoot
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
Test-
|
|
282
|
-
Test-
|
|
292
|
+
foreach ($command in $Commands) {
|
|
293
|
+
Invoke-VerificationCommand -Command $command -Root $resolvedProjectRoot
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
Invoke-TaskStructureValidation -Root $resolvedProjectRoot
|
|
297
|
+
Test-CodexHookCommandCompatibility -Root $resolvedProjectRoot -AdditionalPaths $HookConfigPaths
|
|
298
|
+
Test-PowerShellSyntax -Root $resolvedProjectRoot
|
|
299
|
+
Test-NoStaleFeedbackMcpReferences -Root $resolvedProjectRoot
|
|
283
300
|
Invoke-AgentPackageFreshnessCheck -Root $resolvedProjectRoot
|
|
284
301
|
|
|
285
302
|
Write-Output "Verification passed."
|