@pzy560117/codex-harness 0.1.8 → 0.1.10
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/AGENTS.md +11 -1
- package/package-source/docs/codex-harness-engineering/templates/bootstrap-codex-harness.ps1 +2 -1
- package/package-source/docs/codex-harness-engineering/templates/config/rules/agents.md +3 -3
- package/package-source/docs/codex-harness-engineering/templates/docs/project-agents-template.md +8 -1
- package/package-source/docs/codex-harness-engineering/templates/docs/task-session-strategy.md +3 -0
- package/package-source/docs/codex-harness-engineering/templates/package-assets/docs/codex-harness-engineering/project-agents-template.md +51 -1
- package/package-source/docs/codex-harness-engineering/templates/package-assets/docs/codex-harness-engineering/templates/prompts/controller-loop.md +88 -0
- package/package-source/docs/codex-harness-engineering/templates/package-assets/docs/codex-harness-engineering/templates/prompts/failure-triage.md +71 -0
- package/package-source/docs/codex-harness-engineering/templates/package-assets/docs/codex-harness-engineering/templates/prompts/harness-audit.md +54 -0
- package/package-source/docs/codex-harness-engineering/templates/package-assets/docs/codex-harness-engineering/templates/prompts/implement-one-task.md +18 -15
- package/package-source/docs/codex-harness-engineering/templates/package-assets/docs/codex-harness-engineering/templates/prompts/repair-one-finding.md +1 -2
- package/package-source/docs/codex-harness-engineering/templates/package-assets/docs/codex-harness-engineering/templates/prompts/review-one-task.md +45 -0
- package/package-source/docs/codex-harness-engineering/templates/package-assets/docs/codex-harness-engineering/templates/prompts/review-stage1-spec.md +111 -0
- package/package-source/docs/codex-harness-engineering/templates/package-assets/docs/codex-harness-engineering/templates/prompts/review-stage2-quality.md +82 -0
- package/package-source/docs/codex-harness-engineering/templates/package-assets/docs/codex-harness-engineering/templates/prompts/visual-evaluator.md +80 -0
- package/package-source/docs/codex-harness-engineering/templates/package-assets/docs/codex-harness-engineering/templates/prompts/worker-role/backend-worker.md +41 -0
- package/package-source/docs/codex-harness-engineering/templates/package-assets/docs/codex-harness-engineering/templates/prompts/worker-role/docs-worker.md +28 -0
- package/package-source/docs/codex-harness-engineering/templates/package-assets/docs/codex-harness-engineering/templates/prompts/worker-role/frontend-worker.md +46 -0
- package/package-source/docs/codex-harness-engineering/templates/package-assets/docs/codex-harness-engineering/templates/prompts/worker-role/harness-writer.md +40 -0
- package/package-source/docs/codex-harness-engineering/templates/package-assets/docs/codex-harness-engineering/templates/prompts/worker-role/test-runner.md +27 -0
- package/package-source/docs/codex-harness-engineering/templates/package-assets/rules/agents.md +6 -3
- package/package-source/docs/codex-harness-engineering/templates/package-assets/skills/auto-commit/SKILL.md +1 -1
- package/package-source/docs/codex-harness-engineering/templates/package-assets/skills/speckit-plan/SKILL.md +1 -1
- package/package-source/docs/codex-harness-engineering/templates/prompts/controller-loop.md +4 -4
- package/package-source/docs/codex-harness-engineering/templates/prompts/failure-triage.md +1 -1
- package/package-source/docs/codex-harness-engineering/templates/prompts/harness-audit.md +1 -1
- package/package-source/docs/codex-harness-engineering/templates/prompts/implement-one-task.md +18 -15
- package/package-source/docs/codex-harness-engineering/templates/prompts/repair-one-finding.md +1 -2
- package/package-source/docs/codex-harness-engineering/templates/prompts/review-one-task.md +1 -1
- package/package-source/docs/codex-harness-engineering/templates/prompts/review-stage1-spec.md +1 -1
- package/package-source/docs/codex-harness-engineering/templates/prompts/review-stage2-quality.md +1 -1
- package/package-source/docs/codex-harness-engineering/templates/prompts/visual-evaluator.md +1 -1
- package/package-source/docs/codex-harness-engineering/templates/prompts/worker-role/backend-worker.md +2 -2
- package/package-source/docs/codex-harness-engineering/templates/prompts/worker-role/docs-worker.md +2 -2
- package/package-source/docs/codex-harness-engineering/templates/prompts/worker-role/frontend-worker.md +2 -2
- package/package-source/docs/codex-harness-engineering/templates/prompts/worker-role/harness-writer.md +4 -4
- package/package-source/docs/codex-harness-engineering/templates/prompts/worker-role/test-runner.md +1 -1
- package/package-source/docs/codex-harness-engineering/templates/runtime/AGENTS.md +45 -50
- package/package-source/docs/codex-harness-engineering/templates/runtime/doctor.ps1 +82 -18
- package/package-source/install-manifest.json +1 -1
- package/package-source/tools/install/bootstrap-codex-harness.ps1 +2 -1
- package/package-source/tools/install/install-agent.ps1 +70 -21
- package/package.json +1 -1
|
@@ -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)
|
|
@@ -2022,7 +2031,7 @@ function Copy-ManifestEntries {
|
|
|
2022
2031
|
}
|
|
2023
2032
|
}
|
|
2024
2033
|
|
|
2025
|
-
function Overlay-DirectoryIfPresent {
|
|
2034
|
+
function Overlay-DirectoryIfPresent {
|
|
2026
2035
|
param(
|
|
2027
2036
|
[string]$SourceDirectory,
|
|
2028
2037
|
[string]$DestinationDirectory
|
|
@@ -2056,8 +2065,8 @@ function Overlay-DirectoryIfPresent {
|
|
|
2056
2065
|
}
|
|
2057
2066
|
}
|
|
2058
2067
|
|
|
2059
|
-
function Ensure-ReadmeForSmoke {
|
|
2060
|
-
param([string]$Root)
|
|
2068
|
+
function Ensure-ReadmeForSmoke {
|
|
2069
|
+
param([string]$Root)
|
|
2061
2070
|
|
|
2062
2071
|
$readmePath = Join-Path $Root "README.md"
|
|
2063
2072
|
if (Test-Path -LiteralPath $readmePath) {
|
|
@@ -2070,11 +2079,45 @@ function Ensure-ReadmeForSmoke {
|
|
|
2070
2079
|
"This README was generated by install-agent.ps1 to support the initial smoke task.",
|
|
2071
2080
|
"Replace it with project-specific content after harness setup is verified."
|
|
2072
2081
|
) | Set-Content -LiteralPath $readmePath -Encoding UTF8
|
|
2073
|
-
|
|
2074
|
-
return $readmePath
|
|
2075
|
-
}
|
|
2076
|
-
|
|
2077
|
-
function
|
|
2082
|
+
|
|
2083
|
+
return $readmePath
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
function Assert-InstalledProjectScopeSurface {
|
|
2087
|
+
param(
|
|
2088
|
+
[object]$ManifestInfo,
|
|
2089
|
+
[string]$ProjectRoot,
|
|
2090
|
+
[switch]$ThinProjectProfile
|
|
2091
|
+
)
|
|
2092
|
+
|
|
2093
|
+
$projectEntries = @(Get-ManifestEntriesForMode -ManifestInfo $ManifestInfo -InstallMode "project" -ThinProjectProfile:$ThinProjectProfile.IsPresent)
|
|
2094
|
+
|
|
2095
|
+
$missingPaths = @()
|
|
2096
|
+
foreach ($entry in $projectEntries) {
|
|
2097
|
+
$targetPath = [string]$entry.TargetPath
|
|
2098
|
+
if ([string]::IsNullOrWhiteSpace($targetPath)) {
|
|
2099
|
+
continue
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
if ($entry.SourceKind -eq "directory") {
|
|
2103
|
+
if (-not (Test-Path -LiteralPath $targetPath -PathType Container)) {
|
|
2104
|
+
$missingPaths += $entry.Destination
|
|
2105
|
+
}
|
|
2106
|
+
continue
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
if (-not (Test-Path -LiteralPath $targetPath -PathType Leaf)) {
|
|
2110
|
+
$missingPaths += $entry.Destination
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
if ($missingPaths.Count -gt 0) {
|
|
2115
|
+
$details = ($missingPaths | Sort-Object -Unique | ForEach-Object { "- $_" }) -join "`n"
|
|
2116
|
+
throw "project scope 安装后缺少以下真相源或运行文件:`n$details"
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
|
|
2120
|
+
function Copy-Package {
|
|
2078
2121
|
param(
|
|
2079
2122
|
[string]$SourceRoot,
|
|
2080
2123
|
[string]$DestinationRoot,
|
|
@@ -2399,18 +2442,24 @@ try {
|
|
|
2399
2442
|
Write-Step "已写入 package lock: $lockPath"
|
|
2400
2443
|
}
|
|
2401
2444
|
|
|
2402
|
-
if ($Mode -eq "project" -or $Mode -eq "vendor") {
|
|
2403
|
-
$configPackageRoot = if ($Mode -eq "vendor") { $targetAgentsRoot } elseif ($null -ne $scopeUserPackage) { [string]$scopeUserPackage.PackageRoot } else { $effectiveSourceRoot }
|
|
2404
|
-
$configPath = Write-ProjectHarnessConfig `
|
|
2405
|
-
-ManifestInfo $installManifestInfo `
|
|
2445
|
+
if ($Mode -eq "project" -or $Mode -eq "vendor") {
|
|
2446
|
+
$configPackageRoot = if ($Mode -eq "vendor") { $targetAgentsRoot } elseif ($null -ne $scopeUserPackage) { [string]$scopeUserPackage.PackageRoot } else { $effectiveSourceRoot }
|
|
2447
|
+
$configPath = Write-ProjectHarnessConfig `
|
|
2448
|
+
-ManifestInfo $installManifestInfo `
|
|
2406
2449
|
-ProjectRoot $resolvedProjectRoot `
|
|
2407
2450
|
-InstallScope $Mode `
|
|
2408
2451
|
-VendorInstalled:($Mode -eq "vendor") `
|
|
2409
|
-
-PackageRoot $configPackageRoot
|
|
2410
|
-
Write-Step "已写入 harness config: $configPath"
|
|
2411
|
-
}
|
|
2412
|
-
|
|
2413
|
-
$
|
|
2452
|
+
-PackageRoot $configPackageRoot
|
|
2453
|
+
Write-Step "已写入 harness config: $configPath"
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
if ($Mode -eq "project") {
|
|
2457
|
+
$thinProjectInstall = $Scope -eq "project" -or $defaultThinInstall
|
|
2458
|
+
Assert-InstalledProjectScopeSurface -ManifestInfo $installManifestInfo -ProjectRoot $resolvedProjectRoot -ThinProjectProfile:$thinProjectInstall
|
|
2459
|
+
Write-Step "project scope 真相源与运行文件已按 manifest 落地"
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
$generatedReadme = $null
|
|
2414
2463
|
if ($InitSmoke) {
|
|
2415
2464
|
$generatedReadme = Ensure-ReadmeForSmoke -Root $resolvedProjectRoot
|
|
2416
2465
|
if ($null -ne $generatedReadme) {
|
|
@@ -2506,7 +2555,7 @@ try {
|
|
|
2506
2555
|
Write-Output ("- powershell -NoProfile -ExecutionPolicy Bypass -File `"{0}`"" -f (Join-Path $resolvedProjectRoot 'tools\harness\codex-loop.ps1'))
|
|
2507
2556
|
}
|
|
2508
2557
|
}
|
|
2509
|
-
finally {
|
|
2558
|
+
finally {
|
|
2510
2559
|
if (($null -ne $stagedSourceRoot) -and (Test-Path -LiteralPath $stagedSourceRoot)) {
|
|
2511
2560
|
Remove-Item -LiteralPath $stagedSourceRoot -Recurse -Force -ErrorAction SilentlyContinue
|
|
2512
2561
|
}
|