Skip to content

fix(pstack): resume, verification, and engagement-edge discipline - #383

Open
NickSuomi wants to merge 6 commits into
cursor:mainfrom
NickSuomi:pstack-session-resume-discipline
Open

NickSuomi wants to merge 6 commits into
cursor:mainfrom
NickSuomi:pstack-session-resume-discipline

Conversation

@NickSuomi

@NickSuomi NickSuomi commented Sep 16, 2026

Copy link
Copy Markdown

What

Seven discipline fixes to pstack skills, across six files in four skills. Each was observed failing in real multi-harness agent sessions and then verified against the fixed text:

  1. session-pickup: locate the prior transcript by harness. Cursor writes JSONL under the workspace agent-transcripts/, OpenCode stores sessions in ~/.local/share/opencode/opencode.db (read-only, ?immutable=1), Codex writes rollout files under ~/.codex.
  2. session-pickup: verify a transcript by session metadata, not filename. Rollout filenames are host-local and forked subagent sessions can share the parent UUID. Normalize timestamps to one zone before comparing.
  3. session-pickup: when a shared meter (spend, quota, counters) drifted since the checkpoint, enumerate the current session's own consumption first before building external theories from the drifted figure.
  4. reflect: the same harness detection before the transcript scan.
  5. principle-boundary-discipline: measurement and adversarial engagements. Guards belong at the engagement edge; every interior restriction traces to the engagement's stated goal or is labeled a human option.
  6. poteto-mode: parallel shell defaults. An unverified command shape runs once and alone; only shapes proven in the session get batched.
  7. principle-prove-it-works: empty or missing verification output is a failed verification, never a pass. Scripts assert loudly on the empty case.
  8. pause-safely: resume notes segregate verified facts from inference; deriving limits from unconfirmed figures is banned.

(The list has eight lines because session-pickup carries rules 1-3; there are six commits, one per edit.)

Scope

Text-only changes to pstack/skills/{poteto-mode, reflect, principle-boundary-discipline, principle-prove-it-works}. No frontmatter, packaging, or registry changes. Based on current main (c1c0a32).

Authorship: AI agent using OpenCode; model moonshotai/kimi-k3.

Nick Suomi added 6 commits September 16, 2026 05:19
Locate transcripts by harness (Cursor JSONL, OpenCode sqlite, Codex
rollouts), verify identity by session metadata instead of filename,
normalize timestamps to one zone, and blame the current session's own
consumption first when a shared meter drifted.
Same locator rule as session-pickup: Cursor JSONL, OpenCode sqlite
read-only via ?immutable=1, Codex rollouts.
Guards belong at the engagement edge; interior restrictions trace to
the stated goal or are labeled human options.
Parallel fan-out applies only to shapes already proven in the session.
Scripts assert loudly on the empty case.
Resume notes never derive limits from unconfirmed figures.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 4bd53f7. Configure here.

### 1. Locate the active transcript

The parent finds its own transcript file before fanning out. The system prompt names the active workspace's `agent-transcripts/` directory. Use that path. Do not glob across `~/.cursor/projects/*/`. That crosses workspace boundaries and reads private chats from unrelated projects.
The parent finds its own transcript file before fanning out. Detect the harness first. Cursor writes JSONL under the active workspace's `agent-transcripts/` directory (the system prompt names the path; use it, and do not glob across `~/.cursor/projects/*/`). OpenCode stores sessions in `~/.local/share/opencode/opencode.db`; open it read-only with `?immutable=1` and export to text. Codex writes rollout files under `~/.codex`. Never cross workspace boundaries or read private chats from unrelated projects.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harness locators skip workspace-scoped matching

Medium Severity · Logic Bug

The new locators send the agent to OpenCode's opencode.db and Codex files under ~/.codex without scoping those stores to this workspace or session. Reflect then still globs workspace agent-transcripts/ JSONL and matches Cursor's message.content[0].text, so non-Cursor runs miss the active transcript or ingest other projects' chats.

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by learned rule: Workspace-scoping for transcript-mining skills

Reviewed by Cursor Bugbot for commit 4bd53f7. Configure here.

### 1. Locate the active transcript

The parent finds its own transcript file before fanning out. The system prompt names the active workspace's `agent-transcripts/` directory. Use that path. Do not glob across `~/.cursor/projects/*/`. That crosses workspace boundaries and reads private chats from unrelated projects.
The parent finds its own transcript file before fanning out. Detect the harness first. Cursor writes JSONL under the active workspace's `agent-transcripts/` directory (the system prompt names the path; use it, and do not glob across `~/.cursor/projects/*/`). OpenCode stores sessions in `~/.local/share/opencode/opencode.db`; open it read-only with `?immutable=1` and export to text. Codex writes rollout files under `~/.codex`. Never cross workspace boundaries or read private chats from unrelated projects.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New prose uses banned clause joiners

Low Severity · Bugbot Rules

Added pstack/skills sentences join independent clauses with semicolons, and session-pickup uses a mid-sentence connector colon after filename. Unslop bans those clause joiners in skill prose outside code spans, labels, and list introductions.

Additional Locations (2)
Fix in Cursor Fix in Web

Triggered by learned rule: pstack skill prose follows unslop punctuation

Reviewed by Cursor Bugbot for commit 4bd53f7. Configure here.

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