open-pstack 0.9.174 → 0.9.176
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/NOTICE.md +4 -4
- package/package.json +1 -1
- package/plugin/.antigravity-plugin/plugin.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/.github/plugin/plugin.json +1 -1
- package/plugin/.grok-plugin/plugin.json +1 -1
- package/plugin/.muse-plugin/plugin.json +1 -1
- package/plugin/hooks/agy-context.awk +12 -7
- package/plugin/hooks/session-start-agy-ignored.md +1 -0
- package/plugin/hooks/session-start.ps1 +23 -1
- package/plugin/hooks/session-start.sh +27 -5
- package/plugin/package.json +1 -1
- package/plugin/pi/index.ts +3 -2
- package/plugin/pi/prompt.ts +8 -3
- package/plugin/skills/poteto-mode/playbooks/worktree-cleanup.md +1 -1
- package/plugin/skills/poteto-mode/references/agy-tools.md +2 -2
- package/plugin/skills/poteto-mode/references/vibe-tools.md +1 -1
- package/plugin/skills/poteto-mode/scripts/.prettierignore +3 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/check-suites.ts +78 -1
- package/plugin/skills/poteto-mode/scripts/watch-pr/cloud-reader.test.ts +21 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/cloud-reader.ts +7 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +6 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/github.port.test.ts +286 -1
- package/plugin/skills/poteto-mode/scripts/watch-pr/github.ts +46 -25
- package/plugin/skills/poteto-mode/scripts/watch-pr/head-checks.ts +47 -1
- package/plugin/skills/poteto-mode/scripts/watch-pr/policy.port.test.ts +158 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/fixtures/grafana-139602-cancelled-suites-beside-green.json +921 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/fixtures/grafana-139606-approval-gated.json +82 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/fixtures/grafana-139612-cancelled-check-beside-green.json +174 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/fixtures/octocat-hello-world-34-no-checks.json +42 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/gh.ts +144 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/harness.ts +172 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/heads.json +73 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/record.ts +410 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay/watch.ts +72 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/replay.port.test.ts +264 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/transport.test.ts +5 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/types.ts +2 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/workflow-runs.ts +58 -21
- package/plugin/skills/poteto-mode/scripts/worktree-audit.mjs +75 -6
- package/plugin/skills/setup-pstack/scripts/read-sheet.sh +6 -2
- package/plugin/vibe/ai.mistral.vibe/hooks.toml +12 -1
- package/plugin/vibe/plugin.json +1 -1
package/NOTICE.md
CHANGED
|
@@ -29,7 +29,7 @@ This plugin is a port of upstream MIT-licensed work. The port's modifications an
|
|
|
29
29
|
|
|
30
30
|
## What changed in the port
|
|
31
31
|
|
|
32
|
-
The port is editorial, not mechanical. [CHANGES.md](CHANGES.md) records each release's changes, and [`tools/substitutions.json`](tools/substitutions.json) lists the token rewrites with the reason for each.
|
|
32
|
+
The port is editorial, not mechanical. [CHANGES.md](https://github.com/michael-denyer/pstack-claude/blob/v0.9.176/CHANGES.md) records each release's changes, and [`tools/substitutions.json`](https://github.com/michael-denyer/pstack-claude/blob/v0.9.176/tools/substitutions.json) lists the token rewrites with the reason for each.
|
|
33
33
|
|
|
34
34
|
Summary of structural changes:
|
|
35
35
|
|
|
@@ -38,13 +38,13 @@ Summary of structural changes:
|
|
|
38
38
|
- Six skills imported from `cursor-team-kit`: `deslop`, `make-pr-easy-to-review`, `fix-ci`, `fix-merge-conflicts`, `get-pr-comments`, `what-did-i-get-done`. Five are copied verbatim with no rewiring needed. `deslop` is a policy fork that `tools/forks.json` declares.
|
|
39
39
|
- Three skills and two agents imported from `thermos`: `thermos`, `thermo-nuclear-review`, `thermo-nuclear-code-quality-review`, `thermo-nuclear-review-subagent`, and `thermo-nuclear-code-quality-review-subagent`. The skills' `subagent_type` values take the `pstack:` namespace, and the agents' parent-orchestration notes name Claude Code's tools; `tools/substitutions.json` lists each rewrite.
|
|
40
40
|
- `plugins/pstack/skills/babysit/` is independently authored as the Claude Code analog of Cursor's `/babysit` built-in. It has no upstream pstack equivalent; its workflow is informed by Cursor's public `/babysit` behavior. No code or prose was copied from any source.
|
|
41
|
-
- `plugins/pstack/skills/poteto-mode/scripts/` is vendored from upstream (`watch-pr`, `bootstrap.ts`, `package.json`, `bun.lock`). `worktree-audit.mjs` is a port-only rewrite of upstream's `worktree-audit.sh`, which `tools/upstream.json` excludes from sync; it reads the Claude Code, Codex, and Pi transcript directories instead of Cursor's and reports prunable worktrees. The port edits upstream files here and adds files of its own, such as `watch-pr/shipping.ts`. [`tools/forks.json`](tools/forks.json) lists each edited upstream file with the reason for the edit. `bun tools/sync.mjs pstack <pinned sha> --dry-run`, with the SHA from [`tools/upstream.json`](tools/upstream.json), prints those files with their changed-line counts, then lists the port-only files. The files on neither list are upstream's code under the upstream MIT license.
|
|
41
|
+
- `plugins/pstack/skills/poteto-mode/scripts/` is vendored from upstream (`watch-pr`, `bootstrap.ts`, `package.json`, `bun.lock`). `worktree-audit.mjs` is a port-only rewrite of upstream's `worktree-audit.sh`, which `tools/upstream.json` excludes from sync; it reads the Claude Code, Codex, and Pi transcript directories instead of Cursor's and reports prunable worktrees. The port edits upstream files here and adds files of its own, such as `watch-pr/shipping.ts`. [`tools/forks.json`](https://github.com/michael-denyer/pstack-claude/blob/v0.9.176/tools/forks.json) lists each edited upstream file with the reason for the edit. `bun tools/sync.mjs pstack <pinned sha> --dry-run`, with the SHA from [`tools/upstream.json`](https://github.com/michael-denyer/pstack-claude/blob/v0.9.176/tools/upstream.json), prints those files with their changed-line counts, then lists the port-only files. The files on neither list are upstream's code under the upstream MIT license.
|
|
42
42
|
- `plugins/pstack/agents/comment-sicko.md` is upstream's `Comment Sicko` agent, renamed to `comment-sicko` so the name works as a Claude Code `subagent_type`. The body is verbatim.
|
|
43
|
-
- A Codex build shares the same `skills/` tree. It adds `plugins/pstack/.codex-plugin/plugin.json`, a root `.agents/plugins/marketplace.json`, and `plugins/pstack/skills/poteto-mode/references/codex-tools.md` (the Claude-to-Codex tool, model, built-in, and per-skill map). Affected skill entry points link to this map. See the [reference](docs/reference.md#codex).
|
|
43
|
+
- A Codex build shares the same `skills/` tree. It adds `plugins/pstack/.codex-plugin/plugin.json`, a root `.agents/plugins/marketplace.json`, and `plugins/pstack/skills/poteto-mode/references/codex-tools.md` (the Claude-to-Codex tool, model, built-in, and per-skill map). Affected skill entry points link to this map. See the [reference](https://github.com/michael-denyer/pstack-claude/blob/v0.9.176/docs/reference.md#codex).
|
|
44
44
|
|
|
45
45
|
## Modifications
|
|
46
46
|
|
|
47
|
-
Per the MIT license, modifications are permitted. Skill bodies have been edited to substitute Cursor-specific primitives with their Claude Code equivalents (the substitution rules are in [`tools/substitutions.json`](tools/substitutions.json)). All upstream copyright notices in source files (where present) are preserved.
|
|
47
|
+
Per the MIT license, modifications are permitted. Skill bodies have been edited to substitute Cursor-specific primitives with their Claude Code equivalents (the substitution rules are in [`tools/substitutions.json`](https://github.com/michael-denyer/pstack-claude/blob/v0.9.176/tools/substitutions.json)). All upstream copyright notices in source files (where present) are preserved.
|
|
48
48
|
|
|
49
49
|
Port-authored files covered by this notice include:
|
|
50
50
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-pstack",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.176",
|
|
4
4
|
"description": "Install pstack into the agent harnesses on this machine: Claude Code, Codex, Pi, Copilot, Muse, OMP, Kimi, Grok, MiniMax, OpenCode, Antigravity, Vibe, and the shared skills directory.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pstack",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.176",
|
|
4
4
|
"description": "If you want to go fast, go deep first. pstack helps you write less, but higher quality code. rigorous agent workflows you can parallelize with confidence. Ported from cursor/plugins/pstack to Antigravity. Original pstack by Lauren Tan (poteto).",
|
|
5
5
|
"author": "Michael Denyer",
|
|
6
6
|
"logo": "assets/pstack-icon.png",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pstack",
|
|
3
3
|
"displayName": "pstack (Claude Code port)",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.176",
|
|
5
5
|
"description": "If you want to go fast, go deep first. pstack helps you write less, but higher quality code. rigorous agent workflows you can parallelize with confidence. Ported from cursor/plugins/pstack to Claude Code. Original pstack by Lauren Tan (poteto).",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Michael Denyer",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pstack",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.176",
|
|
4
4
|
"description": "If you want to go fast, go deep first. pstack helps you write less, but higher quality code. rigorous agent workflows you can parallelize with confidence. Codex port of the Claude Code plugin; skills are shared, tool names resolve via skills/poteto-mode/references/codex-tools.md. Original pstack by Lauren Tan (poteto).",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Michael Denyer",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pstack",
|
|
3
3
|
"displayName": "pstack (GitHub Copilot port)",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.176",
|
|
5
5
|
"description": "If you want to go fast, go deep first. pstack helps you write less, but higher quality code. rigorous agent workflows you can parallelize with confidence. Ported from cursor/plugins/pstack to GitHub Copilot CLI and app. Original pstack by Lauren Tan (poteto).",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Michael Denyer",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "pstack",
|
|
4
4
|
"displayName": "pstack (Muse port)",
|
|
5
|
-
"version": "0.9.
|
|
5
|
+
"version": "0.9.176",
|
|
6
6
|
"description": "If you want to go fast, go deep first. pstack helps you write less, but higher quality code. Rigorous agent workflows you can parallelize with confidence. Muse port of the Claude Code plugin; skills are shared, tool names resolve via skills/poteto-mode/references/muse-tools.md. Original pstack by Lauren Tan (poteto).",
|
|
7
7
|
"compat": {
|
|
8
8
|
"source": "native",
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
# Prints the Antigravity SessionStart output: one JSON object whose injectSteps
|
|
2
2
|
# systemMessage is the poteto-mode mandate for Antigravity, followed by any
|
|
3
|
-
# checked role lines from the Antigravity model sheet
|
|
4
|
-
#
|
|
5
|
-
#
|
|
3
|
+
# checked role lines from the Antigravity model sheet and the names of the
|
|
4
|
+
# roles whose line the hook ignored. Run after json.awk and setup-pstack's
|
|
5
|
+
# sheet.awk, with the sheet as input, -v found=<1 when the sheet exists>, and
|
|
6
|
+
# PSTACK_HOOKS=<this directory> in the environment.
|
|
6
7
|
# Only known role lines whose entries are Antigravity invoke_subagent Model
|
|
7
8
|
# values (inherit, flash_lite, flash, pro) or pstack aliases (inherit-parent,
|
|
8
9
|
# auto) reach the output, rebuilt from their checked values, so no other text
|
|
9
|
-
# in the sheet does.
|
|
10
|
+
# in the sheet does. invoke_subagent takes no reasoning effort, so a known
|
|
11
|
+
# effort suffix is dropped before the check. A known role whose line fails it
|
|
12
|
+
# is named from the stamped role list, never from the sheet.
|
|
10
13
|
{ sheet_add($0) }
|
|
11
14
|
|
|
12
15
|
END {
|
|
@@ -15,21 +18,23 @@ END {
|
|
|
15
18
|
n = sheet_roles(roles, panel)
|
|
16
19
|
for (i = 1; i <= SHEET_N; i++) raw[sheet_key(SHEET[i])] = sheet_value(SHEET[i])
|
|
17
20
|
role_lines = ""
|
|
21
|
+
ignored = ""
|
|
18
22
|
for (i = 1; i <= n; i++) {
|
|
19
23
|
label = roles[i]
|
|
20
24
|
if (!(label in raw)) continue
|
|
21
25
|
m = split(raw[label], E, ",")
|
|
22
|
-
|
|
23
|
-
ok = 1
|
|
26
|
+
ok = m > 0
|
|
24
27
|
rebuilt = ""
|
|
25
28
|
for (j = 1; j <= m; j++) {
|
|
26
|
-
e = sheet_trim(E[j])
|
|
29
|
+
e = sheet_model(sheet_trim(E[j]))
|
|
27
30
|
if (!agy_model(e)) { ok = 0; break }
|
|
28
31
|
rebuilt = rebuilt (j > 1 ? ", " : "") e
|
|
29
32
|
}
|
|
30
33
|
if (ok) role_lines = role_lines (role_lines == "" ? "" : "\n") label ": " rebuilt
|
|
34
|
+
else ignored = ignored "\n" label
|
|
31
35
|
}
|
|
32
36
|
if (role_lines != "") body = body "\n\n" text("session-start-agy-sheet.md") "\n" role_lines
|
|
37
|
+
if (ignored != "") body = body "\n\n" text("session-start-agy-ignored.md") ignored
|
|
33
38
|
}
|
|
34
39
|
n = split(body, L, "\n")
|
|
35
40
|
out = ""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The hook ignored the saved line for each role below, because the line holds no entry, or an entry that is not `inherit`, `inherit-parent`, `auto`, `flash_lite`, `flash`, or `pro`. Omit `Model` for these roles, and tell the user that their saved choice for each was not applied:
|
|
@@ -115,8 +115,23 @@ switch -CaseSensitive ($Runtime) {
|
|
|
115
115
|
$sheet = Join-Path $sheetRoot 'pstack-models.md'
|
|
116
116
|
$context = 'session-start-context.md'
|
|
117
117
|
}
|
|
118
|
+
'vibe' {
|
|
119
|
+
# Vibe reads VIBE_HOME as Path(value).expanduser().resolve(): a
|
|
120
|
+
# leading ~ before either separator is the user profile, and a value
|
|
121
|
+
# rooted at a drive, a share, or the current drive's root names that
|
|
122
|
+
# folder. The hook runs in the plugin root, so any other relative
|
|
123
|
+
# value would name another folder than Vibe's; ignore it, as
|
|
124
|
+
# session-start.sh does. The sheet path is joined as text, since
|
|
125
|
+
# Join-Path fails on a drive that is not mapped.
|
|
126
|
+
$vibeHome = $env:VIBE_HOME
|
|
127
|
+
$sheetRoot = if ($vibeHome -cmatch '^~(?:$|[\\/])') { $env:USERPROFILE + $vibeHome.Substring(1) }
|
|
128
|
+
elseif ($vibeHome -match '^(?:[A-Za-z]:)?[\\/]') { $vibeHome }
|
|
129
|
+
else { Join-Path $env:USERPROFILE '.vibe' }
|
|
130
|
+
$sheet = [System.IO.Path]::Combine($sheetRoot, 'pstack-models.md')
|
|
131
|
+
$context = 'session-start-context.md'
|
|
132
|
+
}
|
|
118
133
|
default {
|
|
119
|
-
[Console]::Error.WriteLine("session-start.ps1: unknown runtime '$Runtime' (expected codex, copilot, or
|
|
134
|
+
[Console]::Error.WriteLine("session-start.ps1: unknown runtime '$Runtime' (expected codex, copilot, muse, or vibe)")
|
|
120
135
|
exit 2
|
|
121
136
|
}
|
|
122
137
|
}
|
|
@@ -165,5 +180,12 @@ if ($Runtime -ceq 'copilot') {
|
|
|
165
180
|
if ($close -ge 0) { $output = $output.Substring(0, $close) + "`n" + $notes + "`n" + $output.Substring($close) } else { $output += "`n" + $notes }
|
|
166
181
|
$output = (ConvertTo-Json -InputObject @{ additionalContext = $output + "`n" } -Compress) + "`n"
|
|
167
182
|
}
|
|
183
|
+
# Vibe reads one JSON object and adds hook_specific_output.additional_context
|
|
184
|
+
# to the session's next user message: the mandate without its final newline,
|
|
185
|
+
# as vibe-context.awk joins its lines.
|
|
186
|
+
if ($Runtime -ceq 'vibe') {
|
|
187
|
+
$text = AsText $output
|
|
188
|
+
$output = (ConvertTo-Json -InputObject @{ hook_specific_output = @{ additional_context = $text } } -Compress) + "`n"
|
|
189
|
+
}
|
|
168
190
|
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($false)
|
|
169
191
|
[Console]::Write($output)
|
|
@@ -57,11 +57,33 @@ case "$runtime" in
|
|
|
57
57
|
: "${PLUGIN_ROOT:=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd)}"
|
|
58
58
|
# Vibe reads $VIBE_HOME when it is set and expands a leading ~. The hook
|
|
59
59
|
# runs in the plugin root, so any other relative value would name another
|
|
60
|
-
# directory than Vibe's; ignore it. Under Git Bash on Windows
|
|
61
|
-
#
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
# directory than Vibe's; ignore it. Under Git Bash on Windows the block
|
|
61
|
+
# below first turns each form Vibe reads into a drive-letter, `//` or `~/`
|
|
62
|
+
# value.
|
|
63
|
+
vibe_home=${VIBE_HOME:-}
|
|
64
|
+
# On Windows a backslash separates folders, so `~\vibe` is the `~/` form
|
|
65
|
+
# and `\\server\share\vibe` the `//` form. One leading separator names a
|
|
66
|
+
# folder on the current drive, as Vibe reads it, but Git's sh would read
|
|
67
|
+
# `/vibe` under Git's own root, so the drive goes in front.
|
|
68
|
+
case "$(uname -s 2>/dev/null || true)" in
|
|
69
|
+
MINGW* | MSYS* | CYGWIN*)
|
|
70
|
+
vibe_home=$(printf '%s' "$vibe_home" | tr '\134' /)
|
|
71
|
+
case "$vibe_home" in
|
|
72
|
+
//*) ;;
|
|
73
|
+
/*)
|
|
74
|
+
drive=$(cygpath -am . 2>/dev/null) || drive=
|
|
75
|
+
drive=${drive%%/*}
|
|
76
|
+
case "$drive" in
|
|
77
|
+
[A-Za-z]:) vibe_home=$drive$vibe_home ;;
|
|
78
|
+
*) vibe_home= ;;
|
|
79
|
+
esac
|
|
80
|
+
;;
|
|
81
|
+
esac
|
|
82
|
+
;;
|
|
83
|
+
esac
|
|
84
|
+
case "$vibe_home" in
|
|
85
|
+
/* | [A-Za-z]:[\\/]*) sheet="$vibe_home/pstack-models.md" ;;
|
|
86
|
+
"~" | "~"/*) sheet="$HOME${vibe_home#?}/pstack-models.md" ;;
|
|
65
87
|
*) sheet="$HOME/.vibe/pstack-models.md" ;;
|
|
66
88
|
esac
|
|
67
89
|
reader="${PLUGIN_ROOT}/skills/setup-pstack/scripts/read-sheet.sh"
|
package/plugin/package.json
CHANGED
package/plugin/pi/index.ts
CHANGED
|
@@ -27,9 +27,10 @@ export function install(pi: ExtensionAPI, settings: Settings): void {
|
|
|
27
27
|
process.on("exit", onExit);
|
|
28
28
|
// Every entry, not the active branch: an agent started on a branch the user
|
|
29
29
|
// later left is still a process, and its record is the only handle on it.
|
|
30
|
-
|
|
30
|
+
// omo, a Pi fork, returns the entries as a Promise; Pi returns them directly.
|
|
31
|
+
pi.on("session_start", async (_event, ctx) => {
|
|
31
32
|
runner.attachSession(ctx);
|
|
32
|
-
runner.restore(ctx.sessionManager.getEntries());
|
|
33
|
+
runner.restore(await ctx.sessionManager.getEntries());
|
|
33
34
|
});
|
|
34
35
|
pi.on("session_shutdown", async () => {
|
|
35
36
|
process.off("exit", onExit);
|
package/plugin/pi/prompt.ts
CHANGED
|
@@ -36,10 +36,15 @@ export function registerPromptSections(pi: ExtensionAPI, settings: Settings): vo
|
|
|
36
36
|
const mandateFile = join(settings.pluginRoot, "hooks", "session-start-context.md");
|
|
37
37
|
pi.on("before_agent_start", (event, ctx) => {
|
|
38
38
|
const sheet = readSheet(settings.agentDir, ctx.cwd);
|
|
39
|
-
const sections =
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const sections: Record<string, string> = {
|
|
40
|
+
[PARALLEL_SECTION]: PARALLEL_CALLS,
|
|
41
|
+
[TOOLS_SECTION]: piToolsNote(settings.pluginRoot),
|
|
42
|
+
};
|
|
42
43
|
if (settings.depth === 0 && !sheet?.hookOff) sections[MANDATE_SECTION] = piMandate(settings.pluginRoot, readFileSync(mandateFile, "utf8"));
|
|
43
44
|
if (sheet) sections[SHEET_SECTION] = sheet.text;
|
|
45
|
+
// omo, a Pi fork, has no sections map; there they join the turn's system prompt.
|
|
46
|
+
const target = event.systemPromptOptions.sections;
|
|
47
|
+
if (!target) return { systemPrompt: [event.systemPrompt, ...Object.values(sections)].join("\n\n") };
|
|
48
|
+
Object.assign(target, sections);
|
|
44
49
|
});
|
|
45
50
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
1. Snapshot and audit. Record `df -h /`, then run `skills/poteto-mode/scripts/worktree-audit.mjs` under the installed plugin (principle-build-the-lever). It reads paths from `git worktree list`, never hand-typed, since a hand-typed `myrepo-worktrees/x` misses one that lives at `.worktrees/myrepo/x` (principle-encode-lessons-in-structure). It classifies each worktree by size, age, merge state, uncommitted work, PR state, and the newest chat that touched it, then suggests a bucket. The transcript scan is slow, so background it.
|
|
4
4
|
2. The bucket is advice, not permission. The pinned and active chats are the real artifact (principle-prove-it-works). Get that set from the user or your own session list and cross-check every candidate. The lever has marked `safe` a worktree the user had pinned, so the pinned set wins.
|
|
5
5
|
3. Verify usage before deleting. For every `verify-recent-chat` row, or anything you doubt, fan subagents out to read the transcripts and report whether the chat is pinned or ongoing and which worktrees it touches (principle-guard-the-context-window, transcripts are bulk). A pinned chat spawns arena and repro trees into sibling worktrees via background subagents, and those are in use even when their names never hit the session list. Pick each subagent's reasoning level for the job, per the Subagents section.
|
|
6
|
-
4. Pause on irreversible loss. `wip:N` is N tracked paths with uncommitted changes and `untracked:N` is N files git has never seen. A worktree with both prints both, as in `wip:1,untracked:5`. `ignored:N` is N paths git ignores outside the build and cache directories named in the audit's `DISPOSABLE` list, such as `.env` or `.claude/settings.local.json`, which may exist nowhere else. List them with `git -C <path> status --porcelain --ignored=matching`. Also run `git -C <path> submodule foreach --recursive 'git ls-files --others --ignored --exclude-standard --directory --no-empty-directory'` to list ignored paths inside initialized submodules. `reflog:N` is N commits that no branch, tag, or remote reaches, kept only by the worktree's HEAD and its reflog, such as work committed on a detached HEAD. They are among the entries `git -C <path> reflog` prints. Keep any with `git branch <name> <sha>`. A clean worktree is recoverable from its branch. Either kind of uncommitted work is gone once the directory goes, so list it with the call the audit counted from, `git -C <path> status --porcelain --untracked-files=all --ignore-submodules=none`, show the diff from `git -C <path> diff HEAD --ignore-submodules=none --submodule=log`, and get a decision first. Each status line is work at stake, and an empty diff never means there is none. A diff leaves out every untracked file, and a plain `git diff` can leave out a submodule. A `wip` line that names a submodule stands for files changed or added inside it, or for commits made there. Run the same status call inside the submodule to list those files. `hold-locked` means another tool or agent locked the tree, with its reason in the LOCKED column. `git worktree remove` refuses a locked tree, so do not `rm -rf` around it. Per Autonomy, clean and merged and not-in-use proceeds. `wip`, `untracked`, `ignored`, `reflog`, locked, and in-use pause.
|
|
6
|
+
4. Pause on irreversible loss. `wip:N` is N tracked paths with uncommitted changes and `untracked:N` is N files git has never seen. A worktree with both prints both, as in `wip:1,untracked:5`. `hidden:N` is N tracked files whose edits `git status` is told to overlook, because the file is flagged skip-worktree or assume-unchanged. The audit holds the row as `hold-wip`, since `git worktree remove` deletes such a tree without asking for `--force`. `git -C <path> ls-files -v` marks each flagged file with `S` or a lowercase letter, and `git -C <path> show HEAD:<file>` prints the committed text to compare one against. `autostash:N` is N stashes that a stopped `rebase --autostash` or `merge --autostash` keeps in the git directory of the worktree or of an initialized submodule, where status shows nothing and `ls-files -v` flags nothing. The audit holds the row as `hold-wip`; `git -C <path> rebase --abort`, or `merge --abort`, run in the worktree or the submodule that holds the stash, puts the edits back in the tree. `ignored:N` is N paths git ignores outside the build and cache directories named in the audit's `DISPOSABLE` list, such as `.env` or `.claude/settings.local.json`, which may exist nowhere else. List them with `git -C <path> status --porcelain --ignored=matching`. Also run `git -C <path> submodule foreach --recursive 'git ls-files --others --ignored --exclude-standard --directory --no-empty-directory'` to list ignored paths inside initialized submodules. `reflog:N` is N commits that no branch, tag, or remote reaches, kept only by the worktree's HEAD and its reflog, such as work committed on a detached HEAD. They are among the entries `git -C <path> reflog` prints. Keep any with `git branch <name> <sha>`. A clean worktree is recoverable from its branch. Either kind of uncommitted work is gone once the directory goes, so list it with the call the audit counted from, `git -C <path> status --porcelain --untracked-files=all --ignore-submodules=none`, show the diff from `git -C <path> diff HEAD --ignore-submodules=none --submodule=log`, and get a decision first. Each status line is work at stake, and an empty diff never means there is none. A diff leaves out every untracked file, and a plain `git diff` can leave out a submodule. A `wip` line that names a submodule stands for files changed or added inside it, or for commits made there. Run the same status call inside the submodule to list those files. `hold-locked` means another tool or agent locked the tree, with its reason in the LOCKED column. `git worktree remove` refuses a locked tree, so do not `rm -rf` around it. Per Autonomy, clean and merged and not-in-use proceeds. `wip`, `hidden`, `autostash`, `untracked`, `ignored`, `reflog`, locked, and in-use pause.
|
|
7
7
|
5. Prune the confirmed set. Per path, `git worktree remove --force <path>`. If the dir survives on ignored build artifacts, `rm -rf` it, then `git worktree prune`. Branch refs survive, so commits on the worktree's branch are kept. The worktree's HEAD reflog goes with it, so a commit only that reflog reaches is lost. Commits made inside a submodule are stored with the worktree and go with it. Confirm with `df -h /` and re-list.
|
|
8
8
|
6. Simulators and other reclaimers. Simulators are usually the next-biggest win. `xcrun simctl --set testing delete all` (XCTestDevices clones), `xcrun simctl delete unavailable`, and `xcrun simctl runtime list` then `runtime delete <id>` for old runtimes. More when needed: Xcode `DerivedData` and `iOS DeviceSupport`, your editor's application-support caches, `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/shell-snapshots/` and old `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/projects/` transcripts (keep the recent ones the **recall** skill and Session pickup read), package caches (pnpm, uv, brew, yarn). Clear only caches the user has not said to keep.
|
|
9
9
|
|
|
@@ -41,7 +41,7 @@ poteto-mode's Subagents section sets Claude-specific defaults (`subagent_type: "
|
|
|
41
41
|
|
|
42
42
|
Skills name Claude Code model aliases in their Models sections. Those aliases do not resolve on Antigravity (`agy`). Antigravity's `invoke_subagent` `Model` parameter accepts only the tier values `inherit` (the default, which uses the parent session's active model), `flash_lite`, `flash`, and `pro`. It does not accept specific models such as Gemini 4 Argon, Carbon, or Neon, nor other model families. Passing `pro`, `flash`, or `flash_lite` routes subagents to fixed tier models instead of the parent session's active model.
|
|
43
43
|
|
|
44
|
-
- The model sheet is `~/.gemini/config/pstack-models.md`. It sits behind Antigravity's system protection boundary, so outside `/setup-pstack`, do not read or write it directly from agent tools. The plugin's `SessionStart` hook reads it and appends any valid role lines to the session context as the user's saved pstack model choices. Take role overrides from
|
|
44
|
+
- The model sheet is `~/.gemini/config/pstack-models.md`. It sits behind Antigravity's system protection boundary, so outside `/setup-pstack`, do not read or write it directly from agent tools. The plugin's `SessionStart` hook reads it and appends any valid role lines to the session context as the user's saved pstack model choices, without a reasoning effort, which `invoke_subagent` does not take. Take role overrides from those lines (or from `AGENTS.md` / `GEMINI.md` when pasted there). After them the hook names each role whose saved line it ignored. Omit `Model` for those roles.
|
|
45
45
|
- When no saved role override is present for a role-model skill (`arena`, `interrogate`, `no-comments`, `poteto-mode`, `swarm`, `thermos`), omit `Model` (equivalent to `inherit`) so subagents run on the parent session's active model. Do not run `setup-pstack` just because no sheet is injected, and do not pass `pro`, `flash`, or `flash_lite` unless a saved role line or the user explicitly asks for that tier.
|
|
46
46
|
- Pass a saved role's tier as `Model` on `invoke_subagent`. For `inherit`, `inherit-parent`, or `auto`, omit `Model`.
|
|
47
47
|
- Roles that default to the worker model (`feature, refactoring`) or strongest model (`strongest judgment`): omit `Model` (`inherit`) unless the user configured an explicit tier override.
|
|
@@ -51,7 +51,7 @@ Skills name Claude Code model aliases in their Models sections. Those aliases do
|
|
|
51
51
|
|
|
52
52
|
## Session routing hook
|
|
53
53
|
|
|
54
|
-
Antigravity runs the plugin's `SessionStart` hook when a new session starts. The hook outputs an `injectSteps` `systemMessage` JSON payload containing the Antigravity routing mandate
|
|
54
|
+
Antigravity runs the plugin's `SessionStart` hook when a new session starts. The hook outputs an `injectSteps` `systemMessage` JSON payload containing the Antigravity routing mandate, any valid saved role lines from `~/.gemini/config/pstack-models.md` (rebuilt from checked values so the agent never needs to read that protected file), and the names of any roles whose line it ignored, unless `~/.gemini/config/pstack-models.md` contains `session hook: off`.
|
|
55
55
|
|
|
56
56
|
## Driver and bundled skills pstack references
|
|
57
57
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Vibe mapping
|
|
2
2
|
|
|
3
|
-
Vibe loads pstack as a native plugin. Its manifest registers each skill as `pstack:<name>`, so `poteto-mode` is invoked as `pstack:poteto-mode` with the `skill` tool, and it declares a `session_start` hook that adds the poteto-mode mandate to the session's next user message. The four bundled agents load as subagent configurations under their `pstack:` names. Vibe's native format needs the manifest at the plugin root, so the installer copies the build's manifest and its `ai.mistral.vibe` directory there after the shared tree.
|
|
3
|
+
Vibe loads pstack as a native plugin. Its manifest registers each skill as `pstack:<name>`, so `poteto-mode` is invoked as `pstack:poteto-mode` with the `skill` tool, and it declares a `session_start` hook that adds the poteto-mode mandate to the session's next user message. On native Windows the hook runs in the session's shell, as Vibe 3.2 picks it: Git Bash runs `session-start.sh`, and PowerShell, which Vibe uses when it finds no Git Bash, runs `session-start.ps1`. The four bundled agents load as subagent configurations under their `pstack:` names. Vibe's native format needs the manifest at the plugin root, so the installer copies the build's manifest and its `ai.mistral.vibe` directory there after the shared tree.
|
|
4
4
|
|
|
5
5
|
## Tool actions
|
|
6
6
|
|
|
@@ -17,3 +17,6 @@ watch-pr/fakes.test-helper.ts
|
|
|
17
17
|
# Upstream stopped formatting github.test.ts with Prettier at 96dec8e;
|
|
18
18
|
# keeping its wrapping keeps the fork small.
|
|
19
19
|
watch-pr/github.test.ts
|
|
20
|
+
|
|
21
|
+
# replay/record.ts writes these, one check, suite, or run per line.
|
|
22
|
+
watch-pr/replay/fixtures/
|
|
@@ -20,11 +20,71 @@ export interface SuiteCheckEntry {
|
|
|
20
20
|
readonly check: SuiteCheck;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
export interface RunningActionsSuite {
|
|
24
|
+
readonly id: number;
|
|
25
|
+
readonly status: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
23
28
|
export interface ParsedSuiteRead {
|
|
24
29
|
readonly entries: readonly SuiteCheckEntry[];
|
|
25
30
|
readonly queuedWithoutRuns: readonly SuiteApp[];
|
|
26
31
|
readonly actionsSuites: ReadonlyMap<number, ActionsSuiteEvidence>;
|
|
27
32
|
readonly startupFailureSuites: readonly StartupFailureSuite[];
|
|
33
|
+
/** Unfinished Actions suites with runs beside reported checks. */
|
|
34
|
+
readonly runningActionsSuites: readonly RunningActionsSuite[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Between two jobs of a workflow run, gh can list only passed jobs while the
|
|
38
|
+
// run's suite is unfinished. The next job was created at most 11 s after the
|
|
39
|
+
// job it waited on finished, over 158 such jobs on grafana, n8n and pytorch
|
|
40
|
+
// (2026-12-04). GitHub can also
|
|
41
|
+
// leave a suite unfinished long after its last run: on 8 such suites the
|
|
42
|
+
// newest run had finished 6 to 116 days before.
|
|
43
|
+
export const BETWEEN_JOBS_MS = 120_000;
|
|
44
|
+
|
|
45
|
+
// A suite with a finished run is between two jobs, and still pending, while
|
|
46
|
+
// its newest finish or the start of a run still going falls within
|
|
47
|
+
// BETWEEN_JOBS_MS. A queued run gets started_at when it is created. A suite
|
|
48
|
+
// with no finished run, such as Copilot's code review, which gh does not
|
|
49
|
+
// list, is left to the reported checks. now is the local clock against
|
|
50
|
+
// GitHub's timestamps: a clock fast by more than BETWEEN_JOBS_MS reads every
|
|
51
|
+
// such suite clean, and a slow one holds a stuck suite pending that much longer.
|
|
52
|
+
export function betweenJobsCheck(
|
|
53
|
+
suite: RunningActionsSuite,
|
|
54
|
+
pages: unknown,
|
|
55
|
+
now: number
|
|
56
|
+
): SuiteCheck | null {
|
|
57
|
+
if (!Array.isArray(pages)) missing("check run pages", pages);
|
|
58
|
+
let finished = false;
|
|
59
|
+
let newest = -Infinity;
|
|
60
|
+
for (const page of pages) {
|
|
61
|
+
if (!isRecord(page) || !Array.isArray(page.check_runs))
|
|
62
|
+
missing("check_runs", page);
|
|
63
|
+
for (const run of page.check_runs) {
|
|
64
|
+
if (!isRecord(run)) missing("check run", run);
|
|
65
|
+
const done =
|
|
66
|
+
text(run.status, "check run.status").toLowerCase() === "completed";
|
|
67
|
+
finished ||= done;
|
|
68
|
+
const field = done ? "completed_at" : "started_at";
|
|
69
|
+
const at = text(
|
|
70
|
+
run[field],
|
|
71
|
+
`check run.${field} of ${done ? "a completed" : "an unfinished"} run`
|
|
72
|
+
);
|
|
73
|
+
const time = Date.parse(at);
|
|
74
|
+
if (!Number.isFinite(time)) missing(`check run.${field}`, at);
|
|
75
|
+
newest = Math.max(newest, time);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (!finished || now - newest > BETWEEN_JOBS_MS) return null;
|
|
79
|
+
return {
|
|
80
|
+
kind: "pending",
|
|
81
|
+
source: "check-suites",
|
|
82
|
+
name: "GitHub Actions check suite",
|
|
83
|
+
reportedState: suite.status.toUpperCase(),
|
|
84
|
+
description: "has not finished",
|
|
85
|
+
link: "",
|
|
86
|
+
workflow: "",
|
|
87
|
+
};
|
|
28
88
|
}
|
|
29
89
|
|
|
30
90
|
function positiveInteger(value: unknown): number | null {
|
|
@@ -105,6 +165,7 @@ export function parseSuiteRead(
|
|
|
105
165
|
const queuedWithoutRuns: SuiteApp[] = [];
|
|
106
166
|
const actionsSuites = new Map<number, ActionsSuiteEvidence>();
|
|
107
167
|
const startupFailureSuites: StartupFailureSuite[] = [];
|
|
168
|
+
const runningActionsSuites: RunningActionsSuite[] = [];
|
|
108
169
|
for (const page of pages) {
|
|
109
170
|
if (!isRecord(page)) missing("check_suites", page);
|
|
110
171
|
if (!("check_suites" in page)) missing("check_suites");
|
|
@@ -145,6 +206,16 @@ export function parseSuiteRead(
|
|
|
145
206
|
? value.conclusion.toLowerCase()
|
|
146
207
|
: null,
|
|
147
208
|
});
|
|
209
|
+
if (
|
|
210
|
+
isActions &&
|
|
211
|
+
suiteId !== null &&
|
|
212
|
+
typeof value.status === "string" &&
|
|
213
|
+
value.status.toLowerCase() !== "completed"
|
|
214
|
+
)
|
|
215
|
+
runningActionsSuites.push({
|
|
216
|
+
id: suiteId,
|
|
217
|
+
status: value.status.toLowerCase(),
|
|
218
|
+
});
|
|
148
219
|
continue;
|
|
149
220
|
}
|
|
150
221
|
}
|
|
@@ -183,7 +254,13 @@ export function parseSuiteRead(
|
|
|
183
254
|
else if (check !== null) entries.push({ suiteId, check });
|
|
184
255
|
}
|
|
185
256
|
}
|
|
186
|
-
return {
|
|
257
|
+
return {
|
|
258
|
+
entries,
|
|
259
|
+
queuedWithoutRuns,
|
|
260
|
+
actionsSuites,
|
|
261
|
+
startupFailureSuites,
|
|
262
|
+
runningActionsSuites,
|
|
263
|
+
};
|
|
187
264
|
}
|
|
188
265
|
|
|
189
266
|
export function unsettledSuiteChecks(
|
|
@@ -62,10 +62,19 @@ if (path === prefix + 'pulls/1') {
|
|
|
62
62
|
: scenario === 'replaced' ? [run('build', 'cancelled', 2, '2026-11-23T09:00:00Z'), run('build', 'success'), run('test', 'success')]
|
|
63
63
|
// Two jobs of one workflow run, started in the same second, one still running.
|
|
64
64
|
: scenario === 'tie' ? [run('build', 'success'), run('build'), run('test', 'success')]
|
|
65
|
+
// A job of a run cancelled before its matrix expanded, whose name no job of the later run has.
|
|
66
|
+
: scenario.startsWith('matrix-') ? [run('build-matrix', 'cancelled', 2, '2026-11-23T09:00:00Z'), run('build', 'success'), run('test', 'success')]
|
|
65
67
|
: scenario === 'codeql' ? [run('build', 'success'), run('test', 'success'), run('Analyze (javascript)', null, 3)]
|
|
66
68
|
: scenario === 'copilot-agent' ? [run('build', 'success'), run('test', 'success'), run('copilot-pull-request-reviewer', null, 4)]
|
|
67
69
|
: [run('build', 'success'), run('test', 'success')];
|
|
68
70
|
value = [{ total_count: scenario === 'short-page' ? runs.length + 1 : runs.length, check_runs: runs }];
|
|
71
|
+
} else if (path === prefix + 'actions/runs?head_sha=head&per_page=100' && scenario.startsWith('matrix-')) {
|
|
72
|
+
// The later run is of the same workflow when it replaced the cancelled one, and of another when not.
|
|
73
|
+
const workflowRun = (id, workflowId, conclusion, created) => ({ id, check_suite_id: id, workflow_id: workflowId, name: 'CI', event: 'pull_request', path: '.github/workflows/ci-' + workflowId + '.yml', head_sha: 'head', status: 'completed', conclusion, created_at: created });
|
|
74
|
+
value = [{ total_count: 2, workflow_runs: [
|
|
75
|
+
workflowRun(1, scenario === 'matrix-replaced' ? 100 : 200, 'success', '2026-11-23T10:00:00Z'),
|
|
76
|
+
workflowRun(2, 100, 'cancelled', '2026-11-23T09:00:00Z'),
|
|
77
|
+
] }];
|
|
69
78
|
} else if (path === prefix + 'actions/runs?head_sha=head&per_page=100') {
|
|
70
79
|
value = [{ total_count: 4, workflow_runs: [
|
|
71
80
|
{ id: 1, check_suite_id: 1, name: 'CI', event: 'pull_request', path: '.github/workflows/ci.yml' },
|
|
@@ -228,6 +237,18 @@ it("keeps only the newest run per name, workflow, and event, as gh pr checks doe
|
|
|
228
237
|
).toEqual(["build/CI", "test/CI"]);
|
|
229
238
|
});
|
|
230
239
|
|
|
240
|
+
it("drops a cancelled job that a later run of its workflow replaced, and keeps one that no later run replaced", () => {
|
|
241
|
+
expect(
|
|
242
|
+
watch("matrix-replaced", ["--status-only"]).verdict.rows[0].ci
|
|
243
|
+
).toMatchObject({ kind: "ci-clean", failed: [] });
|
|
244
|
+
expect(
|
|
245
|
+
watch("matrix-alone", ["--status-only"]).verdict.rows[0].ci
|
|
246
|
+
).toMatchObject({
|
|
247
|
+
kind: "ci-failing",
|
|
248
|
+
failed: [expect.objectContaining({ name: "build-matrix" })],
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
|
|
231
252
|
it("counts CodeQL's dynamic workflow, as GitHub's rollup does, and leaves out Copilot's review agent", () => {
|
|
232
253
|
expect(watch("codeql", ["--status-only"]).verdict.rows[0].ci).toMatchObject({
|
|
233
254
|
kind: "ci-pending",
|
|
@@ -105,6 +105,9 @@ export class FallbackGitHubReader implements T.GitHubReader {
|
|
|
105
105
|
reader.unsettledSuites(context, head, checksRead, expectedApps)
|
|
106
106
|
);
|
|
107
107
|
}
|
|
108
|
+
workflowRunPages(context: T.PrContext, head: string) {
|
|
109
|
+
return this.read((reader) => reader.workflowRunPages(context, head));
|
|
110
|
+
}
|
|
108
111
|
}
|
|
109
112
|
|
|
110
113
|
// One check as `gh pr checks --json` reports it, which parseFastCheck reads.
|
|
@@ -616,4 +619,8 @@ export class CloudSessionReader implements T.GitHubReader {
|
|
|
616
619
|
) {
|
|
617
620
|
return this.local.unsettledSuites(context, head, checksRead, expectedApps);
|
|
618
621
|
}
|
|
622
|
+
// A REST read, which the proxy serves, so the local reader makes it.
|
|
623
|
+
workflowRunPages(context: T.PrContext, head: string) {
|
|
624
|
+
return this.local.workflowRunPages(context, head);
|
|
625
|
+
}
|
|
619
626
|
}
|
|
@@ -25,6 +25,8 @@ export interface FakeReaderOptions {
|
|
|
25
25
|
readonly threadPages?: readonly ReviewThreadPage[];
|
|
26
26
|
readonly commitRollups?: readonly CommitRollup[];
|
|
27
27
|
readonly unsettledSuites?: readonly SuiteCheck[];
|
|
28
|
+
/** The head's Actions workflow runs, as REST lists them on one page. */
|
|
29
|
+
readonly workflowRuns?: readonly unknown[];
|
|
28
30
|
readonly openPullRequests?: readonly OpenPullRequest[];
|
|
29
31
|
readonly defaultBranch?: string;
|
|
30
32
|
readonly origin?: Repository | null;
|
|
@@ -159,5 +161,9 @@ export function fakeReader(
|
|
|
159
161
|
calls.push(`unsettledSuites:${head}:${checksRead}`);
|
|
160
162
|
return { checks: options.unsettledSuites ?? [], queuedWithoutRuns: [] };
|
|
161
163
|
},
|
|
164
|
+
async workflowRunPages(_requested, head) {
|
|
165
|
+
calls.push(`workflowRunPages:${head}`);
|
|
166
|
+
return [{ workflow_runs: options.workflowRuns ?? [] }];
|
|
167
|
+
},
|
|
162
168
|
};
|
|
163
169
|
}
|