planning-with-files 3.10.2 → 3.12.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/README.md +21 -11
- package/SKILL.md +25 -14
- package/extensions/planning-with-files/__tests__/plan-anchor.test.ts +228 -228
- package/extensions/planning-with-files/package.json +17 -17
- package/extensions/planning-with-files/runtime.ts +785 -785
- package/package.json +5 -2
- package/scripts/attest-plan.ps1 +484 -137
- package/scripts/attest-plan.sh +206 -206
- package/scripts/check-complete.ps1 +253 -253
- package/scripts/check-complete.sh +253 -253
- package/scripts/gate-stop.sh +32 -32
- package/scripts/init-session.sh +19 -0
- package/scripts/inject-plan.sh +692 -104
- package/scripts/ledger-append.ps1 +180 -180
- package/scripts/ledger-append.sh +337 -337
- package/scripts/ledger-summary.ps1 +128 -128
- package/scripts/phase-status.ps1 +237 -175
- package/scripts/phase-status.sh +202 -158
- package/scripts/resolve-plan-dir.ps1 +77 -7
- package/scripts/resolve-plan-dir.sh +6 -1
- package/scripts/session-catchup.py +983 -876
- package/scripts/set-active-plan.ps1 +51 -51
- package/scripts/set-active-plan.sh +50 -50
- package/scripts/verify-shell-line-endings.mjs +50 -0
- package/templates/analytics_findings.md +67 -85
- package/templates/analytics_task_plan.md +81 -106
- package/templates/findings.md +47 -95
- package/templates/progress.md +58 -114
- package/templates/task_plan.md +89 -140
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
#requires -Version 5.0
|
|
2
|
-
<#
|
|
3
|
-
.SYNOPSIS
|
|
4
|
-
Emit a fixed-shape, cache-stable run-ledger summary (PowerShell mirror, v3).
|
|
5
|
-
|
|
6
|
-
.DESCRIPTION
|
|
7
|
-
Replaces raw progress.md tail injection in autonomous mode. Output is
|
|
8
|
-
synthesized from the machine ledger and task_plan.md status counts only:
|
|
9
|
-
NO free text from disk reaches model context, and NO timestamps, so the
|
|
10
|
-
injected block is KV-cache stable by construction (architecture C3).
|
|
11
|
-
|
|
12
|
-
Plan-dir resolution matches resolve-plan-dir.ps1:
|
|
13
|
-
1. $env:PLAN_ID -> .\.planning\$PLAN_ID\
|
|
14
|
-
2. .\.planning\.active_plan
|
|
15
|
-
3. Newest .\.planning\<dir>\ by LastWriteTime
|
|
16
|
-
4. Legacy: project root
|
|
17
|
-
|
|
18
|
-
Output block (stable shape):
|
|
19
|
-
=== RUN LEDGER ===
|
|
20
|
-
entries: <N>
|
|
21
|
-
phases: <complete>/<total> complete
|
|
22
|
-
in_progress: <phase heading or none>
|
|
23
|
-
agent <name>: <last event type>
|
|
24
|
-
==================
|
|
25
|
-
#>
|
|
26
|
-
[CmdletBinding()]
|
|
27
|
-
param()
|
|
28
|
-
|
|
29
|
-
$ErrorActionPreference = "Stop"
|
|
30
|
-
|
|
31
|
-
function Resolve-PlanDir {
|
|
32
|
-
$planRoot = Join-Path (Get-Location) ".planning"
|
|
33
|
-
|
|
34
|
-
if ($env:PLAN_ID) {
|
|
35
|
-
$candidate = Join-Path $planRoot $env:PLAN_ID
|
|
36
|
-
if (Test-Path -LiteralPath $candidate -PathType Container) { return $candidate }
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
$activePointer = Join-Path $planRoot ".active_plan"
|
|
40
|
-
if (Test-Path -LiteralPath $activePointer) {
|
|
41
|
-
$planId = (Get-Content -LiteralPath $activePointer -Raw).Trim()
|
|
42
|
-
if ($planId) {
|
|
43
|
-
$candidate = Join-Path $planRoot $planId
|
|
44
|
-
if (Test-Path -LiteralPath $candidate -PathType Container) { return $candidate }
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (Test-Path -LiteralPath $planRoot -PathType Container) {
|
|
49
|
-
$newest = Get-ChildItem -LiteralPath $planRoot -Directory -ErrorAction SilentlyContinue |
|
|
50
|
-
Where-Object { -not $_.Name.StartsWith(".") } |
|
|
51
|
-
Where-Object { Test-Path -LiteralPath (Join-Path $_.FullName "task_plan.md") } |
|
|
52
|
-
Sort-Object LastWriteTime -Descending |
|
|
53
|
-
Select-Object -First 1
|
|
54
|
-
if ($newest) { return $newest.FullName }
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return (Get-Location).Path
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
$planDir = Resolve-PlanDir
|
|
61
|
-
$planFile = Join-Path $planDir "task_plan.md"
|
|
62
|
-
|
|
63
|
-
# --- Phase counts: same patterns as check-complete.ps1 ---
|
|
64
|
-
$TOTAL = 0
|
|
65
|
-
$COMPLETE = 0
|
|
66
|
-
$IN_PROGRESS = 0
|
|
67
|
-
$inProgressHeading = "none"
|
|
68
|
-
|
|
69
|
-
if (Test-Path -LiteralPath $planFile) {
|
|
70
|
-
$content = Get-Content -LiteralPath $planFile -Raw
|
|
71
|
-
$TOTAL = ([regex]::Matches($content, "### Phase")).Count
|
|
72
|
-
$COMPLETE = ([regex]::Matches($content, "\*\*Status:\*\* complete")).Count
|
|
73
|
-
$IN_PROGRESS = ([regex]::Matches($content, "\*\*Status:\*\* in_progress")).Count
|
|
74
|
-
|
|
75
|
-
if ($COMPLETE -eq 0 -and $IN_PROGRESS -eq 0) {
|
|
76
|
-
$c2 = ([regex]::Matches($content, "\[complete\]")).Count
|
|
77
|
-
$i2 = ([regex]::Matches($content, "\[in_progress\]")).Count
|
|
78
|
-
if ($c2 -gt 0 -or $i2 -gt 0) {
|
|
79
|
-
$COMPLETE = $c2
|
|
80
|
-
$IN_PROGRESS = $i2
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
# Heading of the first phase block whose status is in_progress.
|
|
85
|
-
$heading = ""
|
|
86
|
-
foreach ($line in (Get-Content -LiteralPath $planFile)) {
|
|
87
|
-
if ($line -match "^### Phase") {
|
|
88
|
-
$heading = $line
|
|
89
|
-
} elseif ($line -match "\*\*Status:\*\* in_progress" -or $line -match "\[in_progress\]") {
|
|
90
|
-
if ($heading) {
|
|
91
|
-
$inProgressHeading = $heading
|
|
92
|
-
break
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
# --- Ledger stats ---
|
|
99
|
-
$totalEntries = 0
|
|
100
|
-
$ledgerFiles = Get-ChildItem -LiteralPath $planDir -Filter "ledger-*.jsonl" -File -ErrorAction SilentlyContinue
|
|
101
|
-
foreach ($f in $ledgerFiles) {
|
|
102
|
-
$lines = Get-Content -LiteralPath $f.FullName -ErrorAction SilentlyContinue
|
|
103
|
-
foreach ($line in $lines) {
|
|
104
|
-
if ($line -match '"tick"') { $totalEntries++ }
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
Write-Output "=== RUN LEDGER ==="
|
|
109
|
-
Write-Output ("entries: " + $totalEntries)
|
|
110
|
-
Write-Output ("phases: " + $COMPLETE + "/" + $TOTAL + " complete")
|
|
111
|
-
Write-Output ("in_progress: " + $inProgressHeading)
|
|
112
|
-
|
|
113
|
-
foreach ($f in $ledgerFiles) {
|
|
114
|
-
$agent = $f.Name -replace '^ledger-', '' -replace '\.jsonl$', ''
|
|
115
|
-
# @(...) forces array semantics: a single-line file returns a string from
|
|
116
|
-
# Get-Content and $lines[-1] would otherwise index the last character.
|
|
117
|
-
$lines = @(Get-Content -LiteralPath $f.FullName -ErrorAction SilentlyContinue)
|
|
118
|
-
$lastEvent = "none"
|
|
119
|
-
if ($lines.Count -gt 0) {
|
|
120
|
-
$lastLine = $lines[$lines.Count - 1]
|
|
121
|
-
$m = [regex]::Match($lastLine, '"event"\s*:\s*"([A-Za-z_]+)"')
|
|
122
|
-
if ($m.Success) { $lastEvent = $m.Groups[1].Value }
|
|
123
|
-
}
|
|
124
|
-
Write-Output ("agent " + $agent + ": " + $lastEvent)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
Write-Output "=================="
|
|
128
|
-
exit 0
|
|
1
|
+
#requires -Version 5.0
|
|
2
|
+
<#
|
|
3
|
+
.SYNOPSIS
|
|
4
|
+
Emit a fixed-shape, cache-stable run-ledger summary (PowerShell mirror, v3).
|
|
5
|
+
|
|
6
|
+
.DESCRIPTION
|
|
7
|
+
Replaces raw progress.md tail injection in autonomous mode. Output is
|
|
8
|
+
synthesized from the machine ledger and task_plan.md status counts only:
|
|
9
|
+
NO free text from disk reaches model context, and NO timestamps, so the
|
|
10
|
+
injected block is KV-cache stable by construction (architecture C3).
|
|
11
|
+
|
|
12
|
+
Plan-dir resolution matches resolve-plan-dir.ps1:
|
|
13
|
+
1. $env:PLAN_ID -> .\.planning\$PLAN_ID\
|
|
14
|
+
2. .\.planning\.active_plan
|
|
15
|
+
3. Newest .\.planning\<dir>\ by LastWriteTime
|
|
16
|
+
4. Legacy: project root
|
|
17
|
+
|
|
18
|
+
Output block (stable shape):
|
|
19
|
+
=== RUN LEDGER ===
|
|
20
|
+
entries: <N>
|
|
21
|
+
phases: <complete>/<total> complete
|
|
22
|
+
in_progress: <phase heading or none>
|
|
23
|
+
agent <name>: <last event type>
|
|
24
|
+
==================
|
|
25
|
+
#>
|
|
26
|
+
[CmdletBinding()]
|
|
27
|
+
param()
|
|
28
|
+
|
|
29
|
+
$ErrorActionPreference = "Stop"
|
|
30
|
+
|
|
31
|
+
function Resolve-PlanDir {
|
|
32
|
+
$planRoot = Join-Path (Get-Location) ".planning"
|
|
33
|
+
|
|
34
|
+
if ($env:PLAN_ID) {
|
|
35
|
+
$candidate = Join-Path $planRoot $env:PLAN_ID
|
|
36
|
+
if (Test-Path -LiteralPath $candidate -PathType Container) { return $candidate }
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
$activePointer = Join-Path $planRoot ".active_plan"
|
|
40
|
+
if (Test-Path -LiteralPath $activePointer) {
|
|
41
|
+
$planId = (Get-Content -LiteralPath $activePointer -Raw).Trim()
|
|
42
|
+
if ($planId) {
|
|
43
|
+
$candidate = Join-Path $planRoot $planId
|
|
44
|
+
if (Test-Path -LiteralPath $candidate -PathType Container) { return $candidate }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (Test-Path -LiteralPath $planRoot -PathType Container) {
|
|
49
|
+
$newest = Get-ChildItem -LiteralPath $planRoot -Directory -ErrorAction SilentlyContinue |
|
|
50
|
+
Where-Object { -not $_.Name.StartsWith(".") } |
|
|
51
|
+
Where-Object { Test-Path -LiteralPath (Join-Path $_.FullName "task_plan.md") } |
|
|
52
|
+
Sort-Object LastWriteTime -Descending |
|
|
53
|
+
Select-Object -First 1
|
|
54
|
+
if ($newest) { return $newest.FullName }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return (Get-Location).Path
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
$planDir = Resolve-PlanDir
|
|
61
|
+
$planFile = Join-Path $planDir "task_plan.md"
|
|
62
|
+
|
|
63
|
+
# --- Phase counts: same patterns as check-complete.ps1 ---
|
|
64
|
+
$TOTAL = 0
|
|
65
|
+
$COMPLETE = 0
|
|
66
|
+
$IN_PROGRESS = 0
|
|
67
|
+
$inProgressHeading = "none"
|
|
68
|
+
|
|
69
|
+
if (Test-Path -LiteralPath $planFile) {
|
|
70
|
+
$content = Get-Content -LiteralPath $planFile -Raw
|
|
71
|
+
$TOTAL = ([regex]::Matches($content, "### Phase")).Count
|
|
72
|
+
$COMPLETE = ([regex]::Matches($content, "\*\*Status:\*\* complete")).Count
|
|
73
|
+
$IN_PROGRESS = ([regex]::Matches($content, "\*\*Status:\*\* in_progress")).Count
|
|
74
|
+
|
|
75
|
+
if ($COMPLETE -eq 0 -and $IN_PROGRESS -eq 0) {
|
|
76
|
+
$c2 = ([regex]::Matches($content, "\[complete\]")).Count
|
|
77
|
+
$i2 = ([regex]::Matches($content, "\[in_progress\]")).Count
|
|
78
|
+
if ($c2 -gt 0 -or $i2 -gt 0) {
|
|
79
|
+
$COMPLETE = $c2
|
|
80
|
+
$IN_PROGRESS = $i2
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
# Heading of the first phase block whose status is in_progress.
|
|
85
|
+
$heading = ""
|
|
86
|
+
foreach ($line in (Get-Content -LiteralPath $planFile)) {
|
|
87
|
+
if ($line -match "^### Phase") {
|
|
88
|
+
$heading = $line
|
|
89
|
+
} elseif ($line -match "\*\*Status:\*\* in_progress" -or $line -match "\[in_progress\]") {
|
|
90
|
+
if ($heading) {
|
|
91
|
+
$inProgressHeading = $heading
|
|
92
|
+
break
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
# --- Ledger stats ---
|
|
99
|
+
$totalEntries = 0
|
|
100
|
+
$ledgerFiles = Get-ChildItem -LiteralPath $planDir -Filter "ledger-*.jsonl" -File -ErrorAction SilentlyContinue
|
|
101
|
+
foreach ($f in $ledgerFiles) {
|
|
102
|
+
$lines = Get-Content -LiteralPath $f.FullName -ErrorAction SilentlyContinue
|
|
103
|
+
foreach ($line in $lines) {
|
|
104
|
+
if ($line -match '"tick"') { $totalEntries++ }
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
Write-Output "=== RUN LEDGER ==="
|
|
109
|
+
Write-Output ("entries: " + $totalEntries)
|
|
110
|
+
Write-Output ("phases: " + $COMPLETE + "/" + $TOTAL + " complete")
|
|
111
|
+
Write-Output ("in_progress: " + $inProgressHeading)
|
|
112
|
+
|
|
113
|
+
foreach ($f in $ledgerFiles) {
|
|
114
|
+
$agent = $f.Name -replace '^ledger-', '' -replace '\.jsonl$', ''
|
|
115
|
+
# @(...) forces array semantics: a single-line file returns a string from
|
|
116
|
+
# Get-Content and $lines[-1] would otherwise index the last character.
|
|
117
|
+
$lines = @(Get-Content -LiteralPath $f.FullName -ErrorAction SilentlyContinue)
|
|
118
|
+
$lastEvent = "none"
|
|
119
|
+
if ($lines.Count -gt 0) {
|
|
120
|
+
$lastLine = $lines[$lines.Count - 1]
|
|
121
|
+
$m = [regex]::Match($lastLine, '"event"\s*:\s*"([A-Za-z_]+)"')
|
|
122
|
+
if ($m.Success) { $lastEvent = $m.Groups[1].Value }
|
|
123
|
+
}
|
|
124
|
+
Write-Output ("agent " + $agent + ": " + $lastEvent)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
Write-Output "=================="
|
|
128
|
+
exit 0
|