@pzy560117/codex-harness 0.1.10 → 0.1.11
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 +1 -1
- package/package-source/docs/codex-harness-engineering/templates/bootstrap-codex-harness.ps1 +1 -0
- package/package-source/docs/codex-harness-engineering/templates/package-assets/root/install-agent.ps1 +151 -78
- package/package-source/docs/codex-harness-engineering/templates/runtime/doctor.ps1 +12 -11
- package/package-source/docs/codex-harness-engineering/templates/runtime/feature-task-reference.json +363 -0
- package/package-source/docs/codex-harness-engineering/templates/runtime/project-task-template.json +46 -793
- package/package-source/docs/codex-harness-engineering/templates/tools/harness/architecture-lint.ps1 +17 -6
- package/package-source/docs/codex-harness-engineering/templates/tools/harness/task-structure-lint.ps1 +1 -1
- package/package-source/install-manifest.json +14 -7
- package/package-source/tools/install/bootstrap-codex-harness.ps1 +1 -0
- package/package-source/tools/install/install-agent.ps1 +31 -14
- package/package.json +1 -1
package/package-source/docs/codex-harness-engineering/templates/tools/harness/architecture-lint.ps1
CHANGED
|
@@ -72,10 +72,12 @@ $issues = @()
|
|
|
72
72
|
$architectureRulesPath = Join-Path $ProjectRoot "docs\codex-harness-engineering\templates\docs\project-agents-template.md"
|
|
73
73
|
$currentTaskPath = Join-Path $ProjectRoot "docs\codex-harness-engineering\templates\context\CURRENT_TASK.md"
|
|
74
74
|
$taskTemplatePath = Join-Path $ProjectRoot "tools\harness\templates\project-task-template.json"
|
|
75
|
+
$featureTaskReferencePath = Join-Path $ProjectRoot "tools\harness\templates\feature-task-reference.json"
|
|
75
76
|
|
|
76
77
|
$architectureRules = Get-FileContentOrNull -Path $architectureRulesPath
|
|
77
78
|
$currentTask = Get-FileContentOrNull -Path $currentTaskPath
|
|
78
79
|
$taskTemplate = Get-FileContentOrNull -Path $taskTemplatePath
|
|
80
|
+
$featureTaskReference = Get-FileContentOrNull -Path $featureTaskReferencePath
|
|
79
81
|
|
|
80
82
|
if ($null -eq $architectureRules) {
|
|
81
83
|
$issues += New-Issue -Severity "error" -File "docs/codex-harness-engineering/templates/docs/project-agents-template.md" -Section "file" -Message "缺少 project AGENTS 模板,无法承载第三章目录级架构规则。"
|
|
@@ -102,14 +104,23 @@ if ($null -eq $taskTemplate) {
|
|
|
102
104
|
$issues += New-Issue -Severity "error" -File "tools/harness/templates/project-task-template.json" -Section "file" -Message "缺少 project-task-template,无法承载第三章计划约束。"
|
|
103
105
|
}
|
|
104
106
|
else {
|
|
105
|
-
if (Test-
|
|
106
|
-
$issues += New-Issue -Severity "
|
|
107
|
+
if (-not (Test-ContainsAll -Content $taskTemplate -Terms @("INIT-001", "ANALYSIS-001", "TESTCASE-001", "PLAN-001", "seed queue", "feature-task-reference.json"))) {
|
|
108
|
+
$issues += New-Issue -Severity "error" -File "tools/harness/templates/project-task-template.json" -Section "seed-queue-fields" -Message "project-task-template 没有清晰表达四阶段 seed queue 和 feature-task-reference 的分层关系。"
|
|
107
109
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if ($null -eq $featureTaskReference) {
|
|
113
|
+
$issues += New-Issue -Severity "error" -File "tools/harness/templates/feature-task-reference.json" -Section "file" -Message "缺少 feature-task-reference,无法为后续 feature_impl / release 任务提供蓝本。"
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
if (Test-ContainsPlaceholder -Content $featureTaskReference) {
|
|
117
|
+
$issues += New-Issue -Severity "warning" -File "tools/harness/templates/feature-task-reference.json" -Section "placeholders" -Message "feature-task-reference 仍包含占位符;这是模板预期,但需要保证完整字段存在。"
|
|
118
|
+
}
|
|
119
|
+
if (-not (Test-ContainsAll -Content $featureTaskReference -Terms @("qa_contract", "required_layers", "tdd_contract", "architecture_constraints", "forbidden_implementations", "story_full_chain", "acceptance_validation"))) {
|
|
120
|
+
$issues += New-Issue -Severity "error" -File "tools/harness/templates/feature-task-reference.json" -Section "implementation-fields" -Message "feature-task-reference 缺少后续 feature_impl / release 任务所需的 QA 和架构字段。"
|
|
110
121
|
}
|
|
111
|
-
if (-not (Test-ContainsAll -Content $
|
|
112
|
-
$issues += New-Issue -Severity "error" -File "tools/harness/templates/
|
|
122
|
+
if (-not (Test-ContainsAll -Content $featureTaskReference -Terms @("模块归属", "文件改动清单", "复用内容", "新增内容", "不改内容", "风险点", "测试范围"))) {
|
|
123
|
+
$issues += New-Issue -Severity "error" -File "tools/harness/templates/feature-task-reference.json" -Section "design-plan-fields" -Message "feature-task-reference 缺少复杂功能技术方案字段。"
|
|
113
124
|
}
|
|
114
125
|
}
|
|
115
126
|
|
|
@@ -125,7 +125,7 @@ function Test-IsFormalTaskQueue {
|
|
|
125
125
|
|
|
126
126
|
foreach ($task in @($Tasks)) {
|
|
127
127
|
$taskKind = [string](Get-ObjectPropertyValue -InputObject $task -Name "task_kind" -Default "")
|
|
128
|
-
if (@("feature_research", "feature_spec", "feature_design", "feature_plan", "feature_impl", "release", "archive") -contains $taskKind) {
|
|
128
|
+
if (@("feature_research", "feature_spec", "feature_design", "feature_plan", "testcase_design", "feature_impl", "release", "archive") -contains $taskKind) {
|
|
129
129
|
return $true
|
|
130
130
|
}
|
|
131
131
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": "0.1",
|
|
3
3
|
"status": "draft",
|
|
4
4
|
"package": "codex-harness",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.11",
|
|
6
6
|
"installModes": [
|
|
7
7
|
{
|
|
8
8
|
"name": "user",
|
|
@@ -85,13 +85,20 @@
|
|
|
85
85
|
"kind": "task-template",
|
|
86
86
|
"mutable": false
|
|
87
87
|
},
|
|
88
|
-
{
|
|
89
|
-
"source": "templates/runtime/project-task-template.json",
|
|
88
|
+
{
|
|
89
|
+
"source": "templates/runtime/project-task-template.json",
|
|
90
90
|
"destination": "tools/harness/templates/project-task-template.json",
|
|
91
|
-
"scope": "project",
|
|
92
|
-
"kind": "task-template",
|
|
93
|
-
"mutable": false
|
|
94
|
-
},
|
|
91
|
+
"scope": "project",
|
|
92
|
+
"kind": "task-template",
|
|
93
|
+
"mutable": false
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"source": "templates/runtime/feature-task-reference.json",
|
|
97
|
+
"destination": "tools/harness/templates/feature-task-reference.json",
|
|
98
|
+
"scope": "project",
|
|
99
|
+
"kind": "task-template",
|
|
100
|
+
"mutable": false
|
|
101
|
+
},
|
|
95
102
|
{
|
|
96
103
|
"source": "templates/trace/trace.schema.json",
|
|
97
104
|
"destination": "docs/harness/trace.schema.json",
|
|
@@ -613,6 +613,7 @@ $rootFiles = @(
|
|
|
613
613
|
@{ Source = "prompts\worker-role\harness-writer.md"; Destination = ".codex\prompts\worker-role\harness-writer.md" },
|
|
614
614
|
@{ Source = "runtime\smoke-task.json"; Destination = "tools\harness\templates\smoke-task.json" },
|
|
615
615
|
@{ Source = "runtime\project-task-template.json"; Destination = "tools\harness\templates\project-task-template.json" },
|
|
616
|
+
@{ Source = "runtime\feature-task-reference.json"; Destination = "tools\harness\templates\feature-task-reference.json" },
|
|
616
617
|
@{ Source = "tools\harness\task-structure-lint.ps1"; Destination = "tools\harness\task-structure-lint.ps1" },
|
|
617
618
|
@{ Source = "runtime\verify.ps1"; Destination = "tools\harness\verify.ps1" },
|
|
618
619
|
@{ Source = "tools\harness\docs-lint.ps1"; Destination = "tools\harness\docs-lint.ps1" },
|
|
@@ -1662,11 +1662,11 @@ function Test-GitRepository {
|
|
|
1662
1662
|
}
|
|
1663
1663
|
}
|
|
1664
1664
|
|
|
1665
|
-
function Assert-GitRepoOrInit {
|
|
1666
|
-
param(
|
|
1667
|
-
[string]$Root,
|
|
1668
|
-
[bool]$AllowInit
|
|
1669
|
-
)
|
|
1665
|
+
function Assert-GitRepoOrInit {
|
|
1666
|
+
param(
|
|
1667
|
+
[string]$Root,
|
|
1668
|
+
[bool]$AllowInit
|
|
1669
|
+
)
|
|
1670
1670
|
|
|
1671
1671
|
$repoExists = Test-GitRepository -Root $Root
|
|
1672
1672
|
|
|
@@ -1674,15 +1674,32 @@ function Assert-GitRepoOrInit {
|
|
|
1674
1674
|
return $true
|
|
1675
1675
|
}
|
|
1676
1676
|
|
|
1677
|
-
if (-not $AllowInit) {
|
|
1678
|
-
throw "目标目录不是 Git 仓库: $Root。请先初始化 Git,或传入 -InitGitIfNeeded。"
|
|
1679
|
-
}
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1677
|
+
if (-not $AllowInit) {
|
|
1678
|
+
throw "目标目录不是 Git 仓库: $Root。请先初始化 Git,或传入 -InitGitIfNeeded。"
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
$codeGraphCommand = Get-Command codegraph -ErrorAction SilentlyContinue
|
|
1682
|
+
if ($null -eq $codeGraphCommand) {
|
|
1683
|
+
throw "目标目录不是 Git 仓库: $Root。自动初始化前需要先执行 codegraph init -i,但当前环境找不到 codegraph 命令。"
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
Write-Step "目标目录不是 Git 仓库,先执行 codegraph init -i。"
|
|
1687
|
+
Push-Location $Root
|
|
1688
|
+
try {
|
|
1689
|
+
& $codeGraphCommand.Source init -i | Out-Host
|
|
1690
|
+
if ($LASTEXITCODE -ne 0) {
|
|
1691
|
+
throw "codegraph init -i 失败: $Root"
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
finally {
|
|
1695
|
+
Pop-Location
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
Write-Step "目标目录不是 Git 仓库,执行 git init。"
|
|
1699
|
+
& git -C $Root init | Out-Null
|
|
1700
|
+
if ($LASTEXITCODE -ne 0) {
|
|
1701
|
+
throw "git init 失败: $Root"
|
|
1702
|
+
}
|
|
1686
1703
|
|
|
1687
1704
|
return $false
|
|
1688
1705
|
}
|