Skip to content

fix(port): follow upstream's pause list and let the operator's prompt authorize merges - #57

Merged
negoro26 merged 6 commits into
mainfrom
fix/lauren-merge-policy
Nov 26, 2026
Merged

negoro26 merged 6 commits into
mainfrom
fix/lauren-merge-policy

Conversation

@negoro26

Copy link
Copy Markdown
Owner

Summary

The port follows upstream's pause list and treats the operator's prompt as the permission to merge. It no longer widens the list, never waives "going to bed", and no longer refuses merges unless omp starts with an environment grant.

  • poteto-mode Autonomy (both bold lines), worker.md, and principle-never-block-on-the-human ship exactly as upstream 9e278fe wrote them.
  • Shipping and Autopilot-full owners merge, as upstream says. Babysit still stops at merge-ready. pstack-omp no longer says the root keeps merges.
  • pstackpolicy refuses two things and nothing else: a force-push to the default branch or to main, master, or trunk, and deleting the repository. The grant is gone. The refusal tells the agent to stop and return the step to the operator.
  • The extension no longer claims to enforce the playbooks. README, plugin README, and PORTING say so.
  • omp-port/RELEASE is 2, publishing 0.15.4802. fix(port): derive skill command names from the tree and drop hand-kept counts #56 shipped 0.15.4801 and is already merged, so this is the second bump.

Rules removed

Rule (rules.sed before this PR) Why it goes
Section 10 header comment naming the grant Describes the grant. The section is now one line saying policy text is never rewritten.
"Merge only on an explicit request" (shipping step) Policy addition. Matched no upstream text at the pin (stale). Upstream's step merges.
"Always pause" widened list Policy addition. Upstream's list is the list.
Session overrides "...not authorisation to land" Policy addition. It contradicts upstream's README prompt "land the stack ... merged by morning".
worker.md widened stop list Policy addition. It also dropped upstream's "a message to someone outside the run" for "customer messages".
autopilot-stack "Never force-push a shared branch" Policy addition beyond the text. Matched no upstream text (stale).
shipping step 4 "retarget only on the operator's explicit go" Policy addition. Matched no upstream text (stale).
autopilot-full "full-autonomy grant ... PSTACK_LANDING_GRANT" Policy addition and the grant itself. Matched no upstream text (stale).
principle-never-block "force-push to a shared or trunk branch" A scoping edit to upstream's "Irreversible actions (force-push, ...)". Not a name mapping, so upstream's wording returns.
Four stale-exempt.tsv rows for the stale rules above Their stated reason ("a different rule covers the phrasing") was false. The rules are deleted, so the rows go too.

pstack-omp/SKILL.md (port-owned): "The root keeps ... approvals, external-write authorization, merges, deletion decisions" becomes "user interaction, scope, integration, and final verification acceptance", plus "a step a playbook gives to an owner stays with that owner".

Rules kept

Rule Why it stays
babysit "Declare a mode" to "Name the watcher invocation" Pure mechanics. The four Cursor modes name no command on omp. The merge line, "Owner approval is a wait. Babysitting never authorizes merging.", is verbatim upstream.
shipping PASS/PASS+NOTES/FAIL to PASS/ISSUES/BLOCKED Verdict vocabulary, not a gate, grant, or merge prohibition. Out of scope here. The step-4 landing text is verbatim upstream.
autopilot-full "one task call ... isolated: true" in place of "Cursor cloud agent" Name and mechanics translation. "merges once steps 4 and 5 clear it" is verbatim.
poteto-help line naming the extensions Edited to say pstackpolicy is active from install and what it refuses.
omp-mechanics, pstack-omp lifecycle protocols (owner, watcher) Mechanics. Watchers observe and do not merge, which matches upstream Babysit.
All other name, tool, and model-routing rules Mechanics translations. The audit found no other gate, grant, or merge prohibition.

Side by side, upstream 9e278fe and the rebuilt port

Text Upstream Port
Autonomy, Always pause **Always pause** for irreversible writes: force-push to shared branches, deploys, data deletion, customer messages. identical
Autonomy, Session overrides **Session overrides:** "Don't stop" / "going to bed" / "run until done" / "be fully autonomous" → keep going. identical
worker.md stop line Stop only for a deploy, deleted data, a force-push to a shared branch, or a message to someone outside the run. identical
autopilot-full step 2, owner merge Each owner is a Cursor cloud agent that builds, opens its PR ..., babysits to green ..., and merges once steps 4 and 5 clear it. Each owner is an isolated subagent (isolated: true) that builds, ... and merges once steps 4 and 5 clear it. Plus the task batch clause on the step heading. Both are mechanical translations.
shipping step 4, landing Always merge the run's lowest unmerged PR, with origin pr merge orgh pr merge --squash. ... identical
babysit merge line Owner approval is a wait. Babysitting never authorizes merging. identical

pstackpolicy contract

Refused: git push with --force, -f (including clusters such as -fu), --force-with-lease, or a +refspec, and --mirror, when the destination is the default branch (read from the remote's HEAD) or main, master, trunk. HEAD or a missing refspec reads the checked-out branch. gh api updates of a trunk ref that send force=true are refused. Repository deletion: gh repo delete and gh api -X DELETE repos/<owner>/<repo> with no further path.

Allowed: everything else, including gh pr merge, origin pr merge, merge APIs, closing, reviews, replies, thread resolves, retargeting, branch deletion, plain pushes to any branch, and force-pushes to non-default branches. No spelling is gated differently from another: -X POST and --method POST pass alike.

Judgment calls

  • origin/main was ahead of the branch with no commits of mine, so bringing it in was a fast-forward. There is no merge commit, no rebase, and no force-push.
  • A gh api PATCH of refs/heads/<trunk> with force=true stays refused. It is a force-push to the default branch that the command shows, and the old extension already refused it. A PATCH without force=true passes.
  • A force-push whose destination only the shell can fill in ($BRANCH) passes, because the command does not show it. The old extension refused it.
  • omp-mechanics still says the arena and interrogate fallback keeps same-family contexts. The audit flagged it as a departure from upstream's arena fallback, but it is not a gate, grant, or merge prohibition, so it stays out of this PR.

Verification

cd plugins/pstack && bun test ./extensions
  179 pass, 0 fail
CANON=/tmp/cursor-plugins /usr/bin/bash omp-port/sync-upstream.sh rebuild
CANON=/tmp/cursor-plugins /usr/bin/bash omp-port/check-port.sh                  check-port: PASS
/usr/bin/bash omp-port/test-gate-mutations.sh                                  PASS
/usr/bin/bash omp-port/test-sync-owned-paths.sh                                PASS
/usr/bin/bash omp-port/test-upstream-sync.sh                                   PASS
/usr/bin/bash omp-port/test-worktree-audit.sh                                  PASS
OMP_SMOKE_REQUIRED=1 bun omp-port/smoke-plugin.mjs   (omp 19.2.1)             PASS for -e, omp plugin link, marketplace install
grep -rn 'PSTACK_LANDING_GRANT\|landing grant' . (excluding .git)              no output

Live drive of the reworked verify-pstack-omp recipe, run gate-1 on omp 19.2.1 through control-pstack:

Step Result
git -C . push --force origin main from the model's bash pstackpolicy: refused force-pushing a default or trunk branch. The agent got the same text, ending "Stop here and return this step to the operator". git-calls.log empty.
eval cell, --force-with-lease origin +HEAD:main Refused. git-calls.log still empty.
gh api -X DELETE repos/pstack-verify/no-such-repo Refused as repository deletion. gh-calls.log empty.
gh pr merge 1 --repo pstack-verify/no-such-repo --squash Reached the shim: gh-shim: pr merge 1 ....
git -C . push --force-with-lease origin feature/verify Reached the git shim.
user !git push --force origin main Ran ungated, shim logged it.

- Delete rules.sed section 10 and the dead gate rules in sections 11 and 12, with their stale-exempt rows.
- poteto-mode Autonomy, the session-override line, worker.md, and the never-block principle now match upstream 9e278fe.
- pstack-omp no longer says the root keeps merges, so Shipping and Autopilot-full owners merge as upstream says.
- poteto-help names pstackpolicy and what it refuses.
- Set RELEASE to 2, publishing 0.15.4802.
… repository deletion

- Drop the landing grant and every rule for merges, closes, reviews, retargets, branch deletes, releases, secrets, curl, Graphite, and plain pushes.
- Read the default branch and the checked-out branch from git, so HEAD, a missing refspec, and a non-main default branch are judged by fact.
- The refusal tells the agent to stop and return the step to the operator.
- Smoke asserts the refused force-push never reaches the git shim and gh pr merge reaches the gh shim.
…ion gate

- Replace the grant launch with a git push shim beside the gh shim.
- Prompts cover a refused force-push to main, an eval force-push, a repo delete, and allowed merge and feature-push controls.
…rompt merge permission

- README, plugin README, and PORTING say pstackpolicy refuses two actions and does not enforce the playbooks.
… the quoting gaps

- Resolve the checked-out branch and default branch from ctx.cwd moved by the call's own cwd, not process.cwd(). Isolated owners in worktrees got the wrong answer in both directions.
- Tell the agent to write the branch name out literally when a forced destination is shell-named. A real trunk refusal still says to stop and return to the operator.
- Join quoted and unquoted pieces of a word as the shell does, so "HEAD":main, "ma"in and m""ain no longer pass.
- Strip backslash-newline before the repository-delete match and accept an absolute api.github.com endpoint.
- Document the shell-named rule and the untracked cd in README.md, plugins/pstack/README.md and PORTING.md, and reword the gate.yml smoke comment.
@negoro26
negoro26 merged commit f39ebf4 into main Nov 26, 2026
3 checks passed
@negoro26
negoro26 deleted the fix/lauren-merge-policy branch November 26, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant