Skip to content
4 changes: 2 additions & 2 deletions .claude/skills/verify-open-pstack/features/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The ownership table below says which features a changed path reaches. `SKILL.md`
| `assets` | Installed UI/resource surface for each actual consumer found in the pinned plugin manifests |
| `setup` | Installed setup/model configuration with byte-exact daily Claude file restoration before publication |
| `runner` | Installed parent invoking real configured provider lanes |
| `tools` | Installed parent invoking the changed shipped CLI |
| `tools` | Installed parent invoking the changed shipped CLI: `shipped-tools:watch-pr` for `watch-pr` and its dependency bootstrap, `shipped-tools` for the rest |
| `project` | Native discovery/invocation of this verifier in both harnesses |
| `nonRuntime` | Explicit ordinary repository documentation, policy, non-shipped assets, and unit-test paths; no plugin harness launch |

Expand All @@ -22,7 +22,7 @@ A change to `plugins/pstack/.claude-plugin/plugin.json`, `.claude-plugin/marketp

Asset ownership is consumer-driven, not blanket shared ownership. Inspect the exact candidate's plugin manifests. At present, `plugins/pstack/assets/logo.png` is referenced only by `plugins/pstack/.codex-plugin/plugin.json`, so a logo-only change selects the installed Codex asset surface and does not invent a Claude exercise. New shipped assets must be added to `assets` and must have a real manifest consumer; missing, ambiguous, or unknown consumption fails closed.

`bootstrap.ts` belongs to `tools`; exercise its actual consumer, `watch-pr`, including dependency bootstrapping rather than the unrelated external runner.
`bootstrap.ts`, `watch-pr/**`, and the poteto-mode scripts' `package.json` and `bun.lock` belong to `tools` and reach only `shipped-tools:watch-pr`: its actual consumer, `watch-pr`, including dependency bootstrapping, followed by the startup hook in the same installation. They never reach the unrelated external runner.

Catalog paths take precedence over `shared` and over the skill match, so `references/model-catalog.md` and the generated agents select only `catalog`, `setup`, and `runner`. Each generated agent is listed by exact path; a new one is unmapped until it is added to `catalog`. Skill-owned `SKILL.md`, `references/**`, and `playbooks/**` select their skill. poteto-mode's `SKILL.md` also reaches Claude's `agent-preload:poteto-agent`, because poteto-agent preloads it. Additional executable paths must be registered explicitly. `core.ts` assigns the Codex transcript resolver, `poteto-mode/scripts/resolve-codex-transcript.ts`, and its launcher, `poteto-mode/scripts/resolve-codex-transcript`, to `reflect` by their exact paths, so a change to it selects `skill-invocation:reflect` rather than the unrelated shipped-tool recipe. Shared consumed mappings select every dependent skill conservatively. The coverage test inventories tracked plugin files; new unmapped files block CI and runs. Deleted skill surfaces cannot silently disappear from evidence: choose a surviving documented entry point demonstrating the intended removal, or report blocked.

Expand Down
33 changes: 32 additions & 1 deletion .claude/skills/verify-open-pstack/features/recipes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Database } from 'bun:sqlite';
import { createHash } from 'node:crypto';
import { lstat, mkdir, readFile, realpath, rm, writeFile } from 'node:fs/promises';
import { lstat, mkdir, readdir, readFile, realpath, rm, writeFile } from 'node:fs/promises';
import { homedir } from 'node:os';
import { basename, join } from 'node:path';
import { pathToFileURL } from 'node:url';
Expand Down Expand Up @@ -747,6 +747,36 @@ const shippedTools: Case = {
},
};

const WATCH_PR = 'skills/poteto-mode/scripts/watch-pr/watch-pr';
const toolCache = async (f: Fixture): Promise<string> => join((await f.run(['printenv', 'XDG_CACHE_HOME'])).trim(), 'open-pstack/poteto-mode-tools');
const watchPr: Case = {
id: 'watch-pr',
codexSandbox: 'danger-full-access',
async prepare(f) {
await rm(await toolCache(f), { recursive: true, force: true });
},
prompt: f => `${invoke(f.harness, 'poteto-mode', `Do no engineering work. Run the installed helper ${join(f.location, WATCH_PR)} with only the --help flag, exactly once, and reply with the first line it prints.`)} ${rules(f.dir)}`,
async assert(record, f) {
const helper = join(f.location, WATCH_PR);
const ran = record.tools.find(t => {
if (t.failed) return false;
const command = String(t.input.command ?? '');
return command.includes(helper) && /(?:^|\s)--help(?:$|[\s'"])/.test(command);
Comment thread
github-actions[bot] marked this conversation as resolved.
Resolved
});
if (!ran) throw new Error('tool-not-run:watch-pr');
Comment thread
github-actions[bot] marked this conversation as resolved.
Resolved
if (!ran.result?.includes('Usage: watch-pr [options]')) throw new Error('usage-missing:watch-pr');
if (await lstat(join(f.location, 'skills/poteto-mode/scripts/node_modules')).catch(() => undefined)) throw new Error('plugin-mutated:node_modules');
Comment thread
github-actions[bot] marked this conversation as resolved.
Resolved
const root = await toolCache(f), entries = await readdir(root).catch(() => []);
if (entries.length !== 1) throw new Error(`tool-cache-entries:${entries.length}`);
const cache = join(root, entries[0]!);
if (!await lstat(join(cache, 'node_modules/commander/package.json')).catch(() => undefined)) throw new Error('tool-cache-missing:commander');
if (await lstat(join(cache, 'node_modules/typescript')).catch(() => undefined)) throw new Error('tool-cache-dev-dependency:typescript');
const help = join(f.dir, 'watch-pr-help.txt');
Comment thread
github-actions[bot] marked this conversation as resolved.
Resolved
await writeFile(help, ran.result);
return { assertions: ['tool-ran:watch-pr', 'usage-printed', 'plugin-unchanged', 'cache-production-only'], files: [help, join(cache, 'package.json')] };
},
};

const PRELOAD_TASK = 'Without invoking Skill or reading any file, reply with the first Core principle named in the preloaded poteto-mode skill.';
const agentPreload: Case = {
id: 'dispatch',
Expand Down Expand Up @@ -898,6 +928,7 @@ export function recipe(feature: string, harness: Harness, routes: string[] = [])
if (feature === 'setup' || feature === 'skill-invocation:setup-pstack') return setup;
if (feature === 'catalog') return catalog(harness);
if (feature === 'shipped-tools') return [shippedTools];
if (feature === 'shipped-tools:watch-pr') return [watchPr, startupHook];
if (feature === 'agent-preload:poteto-agent' && harness === 'claude') return [agentPreload];
if (feature === 'skill-invocation:reflect') return reflect(harness);
const skill = /^skill-invocation:([a-z][a-z0-9-]+)$/.exec(feature)?.[1];
Expand Down
8 changes: 6 additions & 2 deletions .claude/skills/verify-open-pstack/features/shipped-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ Invoke the installed `poteto-mode` parent for watch/plan/audit, installed `state

Use the candidate's installed help and documented arguments. Create fixture state/output under the private run root; use an explicitly named safe test PR where remote reads are required. Have the native installed workflow drive the changed tool, then inspect its real structured output and persisted state. For the audit assert no mutation; for logging check the written TSV and escaping; for statechart check the written chart and report; for watch/plan preserve the observed result and verdict. Retain native transcripts and these state artifacts. Label any direct helper invocation `local CLI` separately. Name every touched tool and changed branch in the recipe.

`bootstrap.ts` changes require its real shipped-tool consumer, `watch-pr`, including its clean dependency bootstrap path. They do not select the unrelated external runner.
A change to `bootstrap.ts`, `watch-pr/**`, or the poteto-mode scripts' `package.json` or `bun.lock` reaches only `shipped-tools:watch-pr`, never the unrelated external runner. Other tool paths reach `shipped-tools`.

## Gotchas

A mock test is not live proof. Never perform PR writes from a candidate process or edit daily workflow state as a fixture. Do not infer a successful remote read from an empty response. Candidates retain real identity and reuse normal Claude login/config and Codex's symlinked daily auth as described in `isolation.md`; GitHub and temporary state remain run-owned. No credential contents are read or copied and no extra login is started. Candidates never receive publisher credentials. This does not claim OS denial of daily-home or Keychain access. Missing access fails the feature; preserve its private reason and publish only the bounded exact-SHA result, never after failed setup restoration.

## Headless

The `shipped-tools` recipe in `recipes.ts` has the installed `show-me-your-work` workflow run its `log.sh` against a fixture TSV. It asserts the helper command ran from the installed plugin and the persisted row, including formula escaping. `watch-pr`, `check-plan`, the worktree audit, and `statechart` have no case yet.
The `shipped-tools` recipe in `recipes.ts` has the installed `show-me-your-work` workflow run its `log.sh` against a fixture TSV. It asserts the helper command ran from the installed plugin and the persisted row, including formula escaping.

The `shipped-tools:watch-pr` recipe runs two cases in the same installation. `watch-pr` first removes the run's tool cache under `$XDG_CACHE_HOME/open-pstack/poteto-mode-tools/`, then has the installed `poteto-mode` parent run the installed `watch-pr --help`, with Codex's full-access sandbox so `bun install` can reach the registry. It asserts the command ran from the installed plugin and printed its usage, that the installed `skills/poteto-mode/scripts/node_modules` does not exist, and that the cache holds exactly one entry with Commander and without TypeScript. `startup` then runs the `hook:startup` check in that installation, so a plugin tree the bootstrap changed would fail the next session's hook.

`check-plan`, the worktree audit, and `statechart` have no case yet.
15 changes: 10 additions & 5 deletions .claude/skills/verify-open-pstack/scripts/core.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,15 @@ describe('registry and ownership', () => {
r.observations = r.observations.filter(o => o.harness !== 'claude');
expect(() => completeEvidence(r)).toThrow('Missing/duplicate evidence: claude/project-skill');
});
test('bootstrap changes require its shipped tool consumers, not the unrelated runner', () => {
const s = classify([{ filename: 'plugins/pstack/skills/poteto-mode/scripts/bootstrap.ts' }], registry);
expect(s.noRuntime).toBe(false);
expect(s.features).toEqual(withGrok(both('shipped-tools')));
test('watch-pr and its dependency bootstrap reach only the watch-pr tool case', () => {
const scripts = 'plugins/pstack/skills/poteto-mode/scripts/';
for (const [filename, feature] of [
['bootstrap.ts', 'shipped-tools:watch-pr'], ['watch-pr/github.ts', 'shipped-tools:watch-pr'], ['watch-pr/watch-pr', 'shipped-tools:watch-pr'],
['package.json', 'shipped-tools:watch-pr'], ['bun.lock', 'shipped-tools:watch-pr'], ['check-plan.mjs', 'shipped-tools'], ['worktree-audit.sh', 'shipped-tools'],
]) {
expect([filename, classify([{ filename: `${scripts}${filename}` }], registry).features]).toEqual([filename, withGrok(both(feature!))]);
}
for (const harness of HARNESSES) expect(recipe('shipped-tools:watch-pr', harness).map(c => c.id)).toEqual(['watch-pr', 'startup']);
});
test('the transcript resolver belongs to Reflect rather than unrelated shipped tools', () => {
const path = 'plugins/pstack/skills/poteto-mode/scripts/resolve-codex-transcript.ts';
Expand Down Expand Up @@ -237,7 +242,7 @@ describe('registry and ownership', () => {
});
test('the shared recipe implementation reaches every implemented recipe and preserves project proof', () => {
const path = '.claude/skills/verify-open-pstack/features/recipes.ts';
const expected = [...both('catalog', 'setup', 'runner', 'shipped-tools', 'hook:startup', 'project-skill', 'writers',
const expected = [...both('catalog', 'setup', 'runner', 'shipped-tools', 'shipped-tools:watch-pr', 'hook:startup', 'project-skill', 'writers',
...WRITER_PROVIDERS.map(provider => `writers:${provider}`),
...registry.skills.map(skill => `skill-invocation:${skill}`)), 'claude:agent-preload:poteto-agent', 'grok:dispatch', 'grok:setup', 't3:dispatch'].sort();
for (const file of [{ filename: path }, { filename: 'docs/moved.md', previous_filename: path }]) {
Expand Down
5 changes: 3 additions & 2 deletions .claude/skills/verify-open-pstack/scripts/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const T3_DISPATCH_PATHS = [
'.claude/skills/verify-open-pstack/scripts/harness.ts', '.claude/skills/verify-open-pstack/scripts/doctor.ts',
];
const GROK_FEATURES = ['grok:dispatch', 'grok:setup'] as const;
const WATCH_PR_PATHS = /^plugins\/pstack\/skills\/poteto-mode\/scripts\/(?:bootstrap\.ts|watch-pr\/.+|package\.json|bun\.lock)$/;

export const VERSION_MANIFESTS: Readonly<Record<string, Harness>> = {
'plugins/pstack/.claude-plugin/plugin.json': 'claude', '.claude-plugin/marketplace.json': 'claude', 'plugins/pstack/.codex-plugin/plugin.json': 'codex',
Expand All @@ -44,7 +45,7 @@ export function classify(files: ChangedFile[], registry: Registry): Selection {
}
if (T3_DISPATCH_PATHS.includes(path)) features.add('t3:dispatch');
const sharedRecipe = path === '.claude/skills/verify-open-pstack/features/recipes.ts';
if (sharedRecipe) both('catalog', 'writers', ...WRITER_PROVIDERS.map(provider => `writers:${provider}`));
if (sharedRecipe) both('catalog', 'writers', ...WRITER_PROVIDERS.map(provider => `writers:${provider}`), 'shipped-tools:watch-pr');
const catalog = registry.catalog.some(p => matches(path, p));
if (catalog) { both('catalog', 'setup', 'runner'); grok(); covered = true; }
if (sharedRecipe || (!catalog && registry.shared.some(p => matches(path, p)))) {
Expand All @@ -54,7 +55,7 @@ export function classify(files: ChangedFile[], registry: Registry): Selection {
grok(); covered = true;
}
for (const [key, feature] of [['setup', 'setup'], ['runner', 'runner'], ['tools', 'shipped-tools'], ['project', 'project-skill']] as const) {
if (registry[key].some(p => matches(path, p))) { both(feature); grok(); covered = true; }
if (registry[key].some(p => matches(path, p))) { both(feature === 'shipped-tools' && WATCH_PR_PATHS.test(path) ? 'shipped-tools:watch-pr' : feature); grok(); covered = true; }
}
if (/^plugins\/pstack\/skills\/poteto-mode\/scripts\/resolve-codex-transcript(?:\.ts)?$/.test(path)) { skills.add('reflect'); grok(); covered = true; }
const provider = /^plugins\/pstack\/skills\/poteto-mode\/scripts\/runner\/providers\/(?:fixtures\/)?([a-z]+)?/.exec(path);
Expand Down
19 changes: 19 additions & 0 deletions .claude/skills/verify-open-pstack/scripts/runner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,22 @@ test('the runner recipe adds one linked-worktree writer case for a Codex parent
await writeFile(path, JSON.stringify({ ...receipt, argv: [...receipt.argv.slice(0, settings), ...receipt.argv.slice(settings + 2)] }));
await expect(writer.assert(record, f)).rejects.toThrow('shared-git-not-denied');
});

test('shipped-tools:watch-pr matches shell-wrapped Codex commands and rejects non-help flags', async () => {
const dir = await realpath(await mkdtemp(join(tmpdir(), 'pstack-watch-pr-recipe-'))); roots.push(dir);
const location = join(dir, 'plugin'), cache = join(dir, 'cache'), entry = join(cache, 'open-pstack/poteto-mode-tools/abc123');
await mkdir(join(entry, 'node_modules/commander'), { recursive: true });
await writeFile(join(entry, 'node_modules/commander/package.json'), '{}');
await writeFile(join(entry, 'package.json'), '{}');
const helper = join(location, 'skills/poteto-mode/scripts/watch-pr/watch-pr');
const f: Fixture = { harness: 'codex', dir, workspace: dir, location, configHome: dir, run: async () => `${cache}\n` };
const watch = recipe('shipped-tools:watch-pr', 'codex')[0]!;
const record = (cmd: string): SessionRecord => ({
harness: 'codex', exitCode: 0, started: Date.now() - 1000, skills: ['pstack:poteto-mode'], commands: [cmd], context: [],
tools: [{ name: 'command', id: 'cmd-1', input: { command: cmd }, result: 'Usage: watch-pr [options]\n', parent: null, failed: false }],
});

expect((await watch.assert(record(`/bin/zsh -c '${helper} --help'`), f)).assertions)
.toEqual(['tool-ran:watch-pr', 'usage-printed', 'plugin-unchanged', 'cache-production-only']);
await expect(watch.assert(record(`/bin/zsh -c '${helper} --help-extra'`), f)).rejects.toThrow('tool-not-run:watch-pr');
});
2 changes: 1 addition & 1 deletion NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Summary of structural changes:
- The native `plugins/pstack/skills/` tree is the only user-facing workflow surface. Claude Code and Codex invoke those skills directly.
- Seven skills imported from `cursor-team-kit`: `deslop`, `thermo-nuclear-code-quality-review`, `make-pr-easy-to-review`, `fix-ci`, `fix-merge-conflicts`, `get-pr-comments`, `what-did-i-get-done`. All copied verbatim — no rewiring needed.
- `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.
- `plugins/pstack/skills/poteto-mode/scripts/` is vendored from upstream (`watch-pr`, `orch`, `bootstrap.ts`, `worktree-audit.sh`, `package.json`, `bun.lock`) with these port edits: `worktree-audit.sh` reads `~/.claude/projects/` instead of Cursor's transcript directory and warns when `jq` or `rg` is missing (their absence silently blanks the columns the prune decision reads), the private workspace package is named `@open-pstack/poteto-mode-tools`, `bootstrap.ts` rejects Node before it reads Bun-only APIs, and `package.json` includes the port-authored tests in `bun run test`. `check-plan.mjs` is the Cursor 0.14.3 checker adapted for the shared Claude Code and Codex skeleton. `bootstrap.test.ts` and `check-plan.test.ts` are authored for this port. `check-plan.test.ts` also carries the fence cases from upstream's `check-plan.test.ts` at 0.15.20, run against the extracted plan skeleton.
- `plugins/pstack/skills/poteto-mode/scripts/` is vendored from upstream (`watch-pr`, `orch`, `bootstrap.ts`, `worktree-audit.sh`, `package.json`, `bun.lock`) with these port edits: `worktree-audit.sh` reads `~/.claude/projects/` instead of Cursor's transcript directory and warns when `jq` or `rg` is missing (their absence silently blanks the columns the prune decision reads), the private workspace package is named `@open-pstack/poteto-mode-tools`, `bootstrap.ts` rejects Node before it reads Bun-only APIs and installs frozen dependencies in a user cache keyed by the manifest and lockfile outside the plugin, then registers Commander with Bun before the CLI imports it (#293), `watch-pr` reads a head with no GraphQL check rollup as having no checks instead of a retryable query failure (#296), and `package.json` includes the port-authored tests in `bun run test`. `check-plan.mjs` is the Cursor 0.14.3 checker adapted for the shared Claude Code and Codex skeleton. `bootstrap.test.ts` and `check-plan.test.ts` are authored for this port. `check-plan.test.ts` also carries the fence cases from upstream's `check-plan.test.ts` at 0.15.20, run against the extracted plan skeleton.
- `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.
- `plugins/pstack/agents/poteto-agent.md` keeps the upstream prompt and adds Claude Code `skills` frontmatter so the isolated subagent preloads `pstack:poteto-mode`.
- Claude-native lanes are port-authored agent definitions. Fable, Opus and Sonnet select their rolling family alias, and the Opus 5.5 and Haiku 5.5 pins select their exact model, each with the requested effort, for every selectable Claude-native pair in the model catalog. `registry/render.ts` generates them from the runner registry.
Expand Down
Loading
Loading