@pzy560117/codex-harness 0.1.9 → 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 +3 -1
- 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 +32 -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 +3 -1
- package/package-source/tools/install/install-agent.ps1 +48 -23
- 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" },
|
|
@@ -667,7 +668,8 @@ $contextFiles = @(
|
|
|
667
668
|
@{ Source = "context\API_MAP.md"; Destination = "docs\ai\API_MAP.md" },
|
|
668
669
|
@{ Source = "context\DB_SCHEMA.md"; Destination = "docs\ai\DB_SCHEMA.md" },
|
|
669
670
|
@{ Source = "context\KNOWN_ISSUES.md"; Destination = "docs\ai\KNOWN_ISSUES.md" },
|
|
670
|
-
@{ Source = "context\CHANGELOG_AI.md"; Destination = "docs\ai\CHANGELOG_AI.md" }
|
|
671
|
+
@{ Source = "context\CHANGELOG_AI.md"; Destination = "docs\ai\CHANGELOG_AI.md" },
|
|
672
|
+
@{ Source = "context\service-dependency-matrix.yaml"; Destination = ".service-matrix\dependencies.yaml" }
|
|
671
673
|
)
|
|
672
674
|
|
|
673
675
|
foreach ($file in $contextFiles) {
|
|
@@ -218,7 +218,7 @@ function Write-InstallPlan {
|
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
function Get-ManifestEntriesForMode {
|
|
221
|
+
function Get-ManifestEntriesForMode {
|
|
222
222
|
param(
|
|
223
223
|
[object]$ManifestInfo,
|
|
224
224
|
[string]$InstallMode,
|
|
@@ -253,8 +253,17 @@ function Get-ManifestEntriesForMode {
|
|
|
253
253
|
})
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
return $modeEntries
|
|
257
|
-
}
|
|
256
|
+
return $modeEntries
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function Get-ThinProjectExcludedDestinations {
|
|
260
|
+
return @(
|
|
261
|
+
"docs/testing/",
|
|
262
|
+
"docs/harness/",
|
|
263
|
+
"docs/requirement-prep-kit/",
|
|
264
|
+
"docs/knowledge/"
|
|
265
|
+
)
|
|
266
|
+
}
|
|
258
267
|
|
|
259
268
|
function Get-InstallManifestVersion {
|
|
260
269
|
param([object]$ManifestInfo)
|
|
@@ -1653,11 +1662,11 @@ function Test-GitRepository {
|
|
|
1653
1662
|
}
|
|
1654
1663
|
}
|
|
1655
1664
|
|
|
1656
|
-
function Assert-GitRepoOrInit {
|
|
1657
|
-
param(
|
|
1658
|
-
[string]$Root,
|
|
1659
|
-
[bool]$AllowInit
|
|
1660
|
-
)
|
|
1665
|
+
function Assert-GitRepoOrInit {
|
|
1666
|
+
param(
|
|
1667
|
+
[string]$Root,
|
|
1668
|
+
[bool]$AllowInit
|
|
1669
|
+
)
|
|
1661
1670
|
|
|
1662
1671
|
$repoExists = Test-GitRepository -Root $Root
|
|
1663
1672
|
|
|
@@ -1665,15 +1674,32 @@ function Assert-GitRepoOrInit {
|
|
|
1665
1674
|
return $true
|
|
1666
1675
|
}
|
|
1667
1676
|
|
|
1668
|
-
if (-not $AllowInit) {
|
|
1669
|
-
throw "目标目录不是 Git 仓库: $Root。请先初始化 Git,或传入 -InitGitIfNeeded。"
|
|
1670
|
-
}
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
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
|
+
}
|
|
1677
1703
|
|
|
1678
1704
|
return $false
|
|
1679
1705
|
}
|
|
@@ -2077,13 +2103,11 @@ function Ensure-ReadmeForSmoke {
|
|
|
2077
2103
|
function Assert-InstalledProjectScopeSurface {
|
|
2078
2104
|
param(
|
|
2079
2105
|
[object]$ManifestInfo,
|
|
2080
|
-
[string]$ProjectRoot
|
|
2106
|
+
[string]$ProjectRoot,
|
|
2107
|
+
[switch]$ThinProjectProfile
|
|
2081
2108
|
)
|
|
2082
2109
|
|
|
2083
|
-
$projectEntries = @(
|
|
2084
|
-
$ManifestInfo.Entries |
|
|
2085
|
-
Where-Object { [string]$_.Scope -eq "project" }
|
|
2086
|
-
)
|
|
2110
|
+
$projectEntries = @(Get-ManifestEntriesForMode -ManifestInfo $ManifestInfo -InstallMode "project" -ThinProjectProfile:$ThinProjectProfile.IsPresent)
|
|
2087
2111
|
|
|
2088
2112
|
$missingPaths = @()
|
|
2089
2113
|
foreach ($entry in $projectEntries) {
|
|
@@ -2447,7 +2471,8 @@ try {
|
|
|
2447
2471
|
}
|
|
2448
2472
|
|
|
2449
2473
|
if ($Mode -eq "project") {
|
|
2450
|
-
|
|
2474
|
+
$thinProjectInstall = $Scope -eq "project" -or $defaultThinInstall
|
|
2475
|
+
Assert-InstalledProjectScopeSurface -ManifestInfo $installManifestInfo -ProjectRoot $resolvedProjectRoot -ThinProjectProfile:$thinProjectInstall
|
|
2451
2476
|
Write-Step "project scope 真相源与运行文件已按 manifest 落地"
|
|
2452
2477
|
}
|
|
2453
2478
|
|