From 968634366acc507dd7be1f15f8c9105b32695843 Mon Sep 17 00:00:00 2001 From: Negrescu Alexandru <124818050+negoro26@users.noreply.github.com> Date: Fri, 27 Nov 2026 11:33:07 +0200 Subject: [PATCH 1/2] fix(port): hand a refused force-push back to the operator and describe worktree-cleanup truthfully --- .omp-plugin/marketplace.json | 4 ++-- omp-port/RELEASE | 2 +- plugins/pstack/extensions/pstackpolicy/index.js | 4 +++- plugins/pstack/package.json | 2 +- plugins/pstack/skills/omp-mechanics/SKILL.md | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.omp-plugin/marketplace.json b/.omp-plugin/marketplace.json index cd067f0..015e9d0 100644 --- a/.omp-plugin/marketplace.json +++ b/.omp-plugin/marketplace.json @@ -5,13 +5,13 @@ }, "metadata": { "description": "pstack, poteto's engineering methodology for Cursor, ported to oh-my-pi. Model and provider agnostic.", - "version": "0.15.4803" + "version": "0.15.4804" }, "plugins": [ { "name": "pstack", "description": "60 skills, 22 playbooks, 24 principles, the poteto-mode pin, and two agents. Upstream cursor/plugins pstack 0.15.48 at 9e278fe.", - "version": "0.15.4803", + "version": "0.15.4804", "category": "development", "license": "MIT", "source": "./plugins/pstack" diff --git a/omp-port/RELEASE b/omp-port/RELEASE index 00750ed..b8626c4 100644 --- a/omp-port/RELEASE +++ b/omp-port/RELEASE @@ -1 +1 @@ -3 +4 diff --git a/plugins/pstack/extensions/pstackpolicy/index.js b/plugins/pstack/extensions/pstackpolicy/index.js index b23ea34..983d52b 100644 --- a/plugins/pstack/extensions/pstackpolicy/index.js +++ b/plugins/pstack/extensions/pstackpolicy/index.js @@ -434,6 +434,8 @@ const baseDirectory = (event, ctx) => resolve(ctx.cwd, typeof event.input?.cwd === "string" ? event.input.cwd : ""); const STOP = "Stop here and return this step to the operator, saying what is blocked."; +const HANDOFF = + "Ask them to confirm it and run it themselves. A retry in another form is refused the same way."; export default function pstackpolicy(pi) { pi.on("tool_call", async (event, ctx) => { @@ -457,7 +459,7 @@ export default function pstackpolicy(pi) { reason: `pstackpolicy: refused ${why}. pstack's pause list says to always pause for ` + `irreversible writes, and a force-push to the default branch and repository deletion ` + - `are two of them. ${STOP} Do not look for another way to run it.`, + `are two of them. ${STOP} ${HANDOFF}`, }; }); } diff --git a/plugins/pstack/package.json b/plugins/pstack/package.json index 411b597..8c535b2 100644 --- a/plugins/pstack/package.json +++ b/plugins/pstack/package.json @@ -1,6 +1,6 @@ { "name": "pstack", - "version": "0.15.4803", + "version": "0.15.4804", "license": "MIT", "omp": { "extensions": [ diff --git a/plugins/pstack/skills/omp-mechanics/SKILL.md b/plugins/pstack/skills/omp-mechanics/SKILL.md index e13adf8..57bdc0b 100644 --- a/plugins/pstack/skills/omp-mechanics/SKILL.md +++ b/plugins/pstack/skills/omp-mechanics/SKILL.md @@ -53,4 +53,4 @@ Before `recall`, `reflect`, `eval`, `session-pickup`, `show-me-your-work`, or `a - `poteto-mode` warns against Cursor's built-in `babysit` skill. OMP has no such skill, so the warning is inert. - `bugbot-triage` still applies to OMP's security reviewer and other review comments. - `make-bot-ui` names `api2.cursor.sh` and the Grok Bot routine panel. Neither maps to OMP. -- `worktree-cleanup` used to name a macOS `trash` step this host does not have. It now moves each approved worktree somewhere recoverable, using `trash` where it exists and `mv` where it does not, and still forbids `rm -rf`. Nothing in it is platform-specific any more, so there is no step to skip. +- `worktree-cleanup` here is stricter than upstream. It removes each approved worktree with plain `git worktree remove`, keeps the worktree when git refuses, and never uses `--force`, `rm -rf`, or `git worktree prune`. From aef54130b7a135042085ffd7622abe7a5cb813d2 Mon Sep 17 00:00:00 2001 From: Negrescu Alexandru <124818050+negoro26@users.noreply.github.com> Date: Fri, 27 Nov 2026 11:41:27 +0200 Subject: [PATCH 2/2] test(pstackpolicy): pin the operator handoff and state the policy without claiming enforcement --- .../features/irreversible-action-gate.md | 2 +- omp-port/rules.sed | 4 ---- plugins/pstack/extensions/pstackpolicy/index.js | 3 ++- plugins/pstack/extensions/pstackpolicy/index.test.js | 8 +++++++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.omp/skills/verify-pstack-omp/features/irreversible-action-gate.md b/.omp/skills/verify-pstack-omp/features/irreversible-action-gate.md index 6a5fa5f..f923448 100644 --- a/.omp/skills/verify-pstack-omp/features/irreversible-action-gate.md +++ b/.omp/skills/verify-pstack-omp/features/irreversible-action-gate.md @@ -26,7 +26,7 @@ Preconditions: - The run id is new, so `$C evidence gate-` prints a directory that did not exist before. - **Refuse a bash force-push.** Run `$C type-file gate- $P/gate-force-push-main.txt`, `$C press gate- Enter`, `$C wait gate- 'refused force-pushing a default or trunk branch'`, `$C wait gate- 'tool result received'`, and `$C capture gate- irreversible-action-gate.gate-refuse-force-push`. The pane shows the typed `tool:bash` prompt, a tool block whose command line is `git -C . push --force origin main`, and output starting `pstackpolicy: refused force-pushing a default or trunk branch.` `irreversible-action-gate.gate-refuse-force-push.git-calls.log` is empty. -- **Agent receives the refusal.** Run `jq -r 'select(.body.messages[-1].role=="tool") | .body.messages[-1].content' "$($C evidence gate-)/irreversible-action-gate.gate-refuse-force-push.model-requests.jsonl"`. It prints the same `pstackpolicy: refused` text, which ends with `Stop here and return this step to the operator`. +- **Agent receives the refusal.** Run `jq -r 'select(.body.messages[-1].role=="tool") | .body.messages[-1].content' "$($C evidence gate-)/irreversible-action-gate.gate-refuse-force-push.model-requests.jsonl"`. It prints the same `pstackpolicy: refused` text, which contains `Stop here and return this step to the operator` and `Ask them to confirm it and run it themselves`. - **Refuse an eval force-push.** Run `$C type-file gate- $P/gate-eval-force-push.txt`, `$C press gate- Enter`, `$C wait gate- 'refused force-pushing a default or trunk branch'`, `$C wait gate- 'tool result received'`, and `$C capture gate- irreversible-action-gate.gate-refuse-eval`. The pane shows the `tool:eval` prompt followed by the refusal. The git-calls log is still empty. - **Refuse a repository delete.** Run `$C type-file gate- $P/gate-repo-delete.txt`, `$C press gate- Enter`, `$C wait gate- 'refused deleting the repository'`, `$C wait gate- 'tool result received'`, and `$C capture gate- irreversible-action-gate.gate-refuse-repo-delete`. The gh-calls log is empty. - **Allowed merge.** Run `$C type-file gate- $P/gate-merge.txt`, `$C press gate- Enter`, `$C wait gate- 'gh-shim: pr merge'`, `$C wait gate- 'tool result received'`, and `$C capture gate- irreversible-action-gate.gate-allow-merge`. The tool block output is `gh-shim: pr merge 1 --repo pstack-verify/no-such-repo --squash`, and that capture's gh-calls log has exactly that one line. This is the control that proves the shim was reachable while the refusals above ran. diff --git a/omp-port/rules.sed b/omp-port/rules.sed index 7b9fb85..295e4c0 100644 --- a/omp-port/rules.sed +++ b/omp-port/rules.sed @@ -410,10 +410,6 @@ s#\*\*You own the merge frontier\. Declare a mode, clear one PR at a time, stop ## contradicted another sentence in the same tree. None is a Cursor residue; they are the port's ## own claims about itself, which is the class nothing upstream can fix for us. -# `trash` is macOS, so the step could not be followed on this host, and the sentence forbade the one -# fallback that would work. Handled in zz-live-runtime-routing.patch instead, because that line is -# the patch's own output and a sed rule cannot see it. - ## 12. Graphite. Four playbooks say "Never require Graphite (`gt`)", so no sentence may make `gt` ## mandatory or authoritative. diff --git a/plugins/pstack/extensions/pstackpolicy/index.js b/plugins/pstack/extensions/pstackpolicy/index.js index 983d52b..04d1629 100644 --- a/plugins/pstack/extensions/pstackpolicy/index.js +++ b/plugins/pstack/extensions/pstackpolicy/index.js @@ -435,7 +435,8 @@ const baseDirectory = (event, ctx) => const STOP = "Stop here and return this step to the operator, saying what is blocked."; const HANDOFF = - "Ask them to confirm it and run it themselves. A retry in another form is refused the same way."; + "Ask them to confirm it and run it themselves. A different command for the same push or delete " + + "is the same blocked action."; export default function pstackpolicy(pi) { pi.on("tool_call", async (event, ctx) => { diff --git a/plugins/pstack/extensions/pstackpolicy/index.test.js b/plugins/pstack/extensions/pstackpolicy/index.test.js index 0d365ba..9ba8433 100644 --- a/plugins/pstack/extensions/pstackpolicy/index.test.js +++ b/plugins/pstack/extensions/pstackpolicy/index.test.js @@ -255,15 +255,21 @@ describe("pstackpolicy", () => { const result = await run("git push --force origin main"); expect(result?.reason).toContain("pause list"); expect(result?.reason).toContain("Stop here and return this step to the operator"); + expect(result?.reason).toContain("Ask them to confirm it and run it themselves"); expect(result?.reason).not.toContain("write its name out literally"); }); + test("a repository delete is handed back to the operator", async () => { + const result = await run("gh repo delete o/r --yes"); + expect(result?.reason).toContain("Ask them to confirm it and run it themselves"); + }); + test("a shell-named forced destination is told to write the branch out, and the literal passes", async () => { const named = await run('git push --force-with-lease="$BRANCH:$SHA" origin "$BRANCH"'); expect(named?.block).toBe(true); expect(named?.reason).toContain("If the branch is not the default branch, write its name out literally and retry"); expect(named?.reason).toContain("Stop here and return this step to the operator"); - expect(named?.reason).not.toContain("Do not look for another way"); + expect(named?.reason).not.toContain("run it themselves"); expect(await run('git push --force-with-lease="feature/x:$SHA" origin "feature/x"')).toBeUndefined(); expect(await run("git push --force-with-lease=feature/x:abc123 origin feature/x")).toBeUndefined(); });