Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/skills/verify-open-pstack/features/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The feature documents below define sub-features, user entry points, driving inst
- `catalog.md`: the generated model catalog and native agents, read by a parent resolving roles from a model sheet.
- `shipped-tools.md`: watch, plan checks, audit, statechart, and evidence logging.
- `assets.md`: manifest-declared installed assets on actual consuming harnesses.
- `t3.md`: a T3 Code parent dispatching a role through `delegate_task` (`t3:dispatch`), on a run-owned disposable T3 server.
- `t3.md`: a T3 Code parent dispatching Claude and Muse roles through `delegate_task` (`t3:dispatch`) and running `/setup-pstack` (`t3:setup`), on a run-owned disposable T3 server.
- `grok.md`: a Grok parent's native and runner lanes and agent visibility (`grok:dispatch`), and setup writing the Grok sheet (`grok:setup`), over ACP.
- `hooks.md`: the SessionStart hook's context reaching a new session (`hook:startup`), and the Windows runner beside it.
- `recipes.ts`: the headless cases and machine-checked assertions for every selectable feature. A named feature without one fails the run as `missing-recipe` before any session starts. A recipe proves a lookup or a read with a fixture value the model cannot derive from the prompt, such as a per-run `crypto.randomUUID()` marker, compared in the structured result. A command's text can show which tool the parent called, but it never proves what that tool read or produced, so do not add command-text or tool-output pattern checks for that.
Expand Down
173 changes: 157 additions & 16 deletions .claude/skills/verify-open-pstack/features/recipes.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .claude/skills/verify-open-pstack/features/runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ From Codex the recipe adds the `linked-worktree-writer` case: one `claude:opus@m

From Claude the recipe adds the `full-access-writer` case. Its fixture sheet puts `feature, refactoring` on `codex:gpt-6.2-sol@xhigh` and holds the line `codex writer sandbox: full-access`. The prompt names the sheet, the role and the lane's paths, never the runner flag. The child writes a per-run nonce to `.agents/result.json` in its cwd, and adds a second nonce that it reads from the DOM headless Chrome dumps for a fixture page (Playwright's Chromium when Chrome is absent). The page file holds that nonce only base64-encoded. The case asserts the receipt is `complete` for that route and cwd, records `writerSandbox: "full-access"` and carries `--sandbox danger-full-access` in its argv, and that the `.agents/` result written this session holds both nonces. Its counterpart, `bounded-writer`, uses the same dispatch from a fixture sheet that puts `feature, refactoring` on `codex:gpt-6.2-sol@low` and has no setting line. The child writes a per-run nonce to the plain file `result.json` in its cwd, which `workspace-write` allows; it uses no browser and no `.agents/` path. The case asserts the receipt is `complete` for that route and cwd, records `writerSandbox: "bounded"`, carries `--sandbox workspace-write` and never `danger-full-access` in its argv, and that `result.json` written this session holds the nonce. Docker is not exercised. Route overrides do not change these cases.

The `writers` feature is reachable when a path under `plugins/pstack/skills/poteto-mode/scripts/runner/providers/` changes, and runs only when named. Its recipe has one writer case each for `devin:swe-2@medium` and `dsh:deepseek-flash@low`, whose sheets hold no setting line, and for `opencode:opencode/deepseek-v4.1-flash-free@low`, `agy:gemini-3.8-flash@low`, `cursor:composer-2.5@default` and `amp:smart@default`, whose sheets hold `<provider> writer sandbox: full-access`. Each fixture sheet puts `feature, refactoring` on that descriptor, and the prompt names the sheet, the role and the lane's paths, never the runner flag. The lane's cwd is a linked worktree of a run-owned repository. The child runs a Python command that writes the SHA-256 of a per-run nonce to `result.txt`; the case asserts the receipt is `complete` for that route, cwd and writer sandbox, and that `result.txt`, written this session, holds the hash, which the model cannot produce without running the command. `muse-writer` runs the same task with launcher arguments that name `--writer-sandbox full-access`, because no Muse family is registered for a sheet to name. `muse-reader` runs a read-only `muse:muse-spark-1.3@low` lane that must reply with a per-run marker from a fixture file, with a `pinned-argv` receipt. Each provider's cases also form the feature `writers:<provider>`, such as `writers:amp` or `writers:muse` (both Muse cases), and a change to that provider's adapter, tests or fixtures under `runner/providers/` reaches only that feature, while any other path there reaches the whole `writers` set.
The `writers` feature is reachable when a path under `plugins/pstack/skills/poteto-mode/scripts/runner/providers/` changes, and runs only when named. Its recipe has one writer case each for `devin:swe-2@medium` and `dsh:deepseek-flash@low`, whose sheets hold no setting line, and for `opencode:opencode/deepseek-v4.1-flash-free@low`, `agy:gemini-3.8-flash@low`, `cursor:composer-2.5@default` and `amp:smart@default`, whose sheets hold `<provider> writer sandbox: full-access`. Each fixture sheet puts `feature, refactoring` on that descriptor, and the prompt names the sheet, the role and the lane's paths, never the runner flag. The lane's cwd is a linked worktree of a run-owned repository. The child runs a Python command that writes the SHA-256 of a per-run nonce to `result.txt`; the case asserts the receipt is `complete` for that route, cwd and writer sandbox, and that `result.txt`, written this session, holds the hash, which the model cannot produce without running the command. `muse-writer` runs the same task on the unregistered `muse-spark-1.3`, with launcher arguments that name `--writer-sandbox full-access` instead of a sheet. `muse-reader` runs a read-only `muse:muse-spark-1.3@low` lane that must reply with a per-run marker from a fixture file, with a `pinned-argv` receipt. Each provider's cases also form the feature `writers:<provider>`, such as `writers:amp` or `writers:muse` (both Muse cases), and a change to that provider's adapter, tests or fixtures under `runner/providers/` reaches only that feature, while any other path there reaches the whole `writers` set.
45 changes: 39 additions & 6 deletions .claude/skills/verify-open-pstack/features/t3.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,54 @@
# T3 parent dispatch
# T3 parent dispatch and setup

## Sub-features

`t3:dispatch`: a T3 Code parent running the installed `poteto-mode` routes a role whose provider T3 offers through T3's `delegate_task`, with the model and effort from the model sheet, and judges the result by the T3 host completion rules in `provider-dispatch.md`. Select it for a change to `provider-dispatch.md`, `codex-tools.md`, `setup-pstack/SKILL.md` or `recipes.ts`. A path that reaches it never adds it to every run; name it with `--feature t3:dispatch`.
`t3:dispatch`: a T3 Code parent running the installed `poteto-mode` routes each role whose provider T3 offers through T3's `delegate_task`, on the instance and effort option that the T3 host instance rule in `provider-dispatch.md` picks, and judges each result by that section's completion rules. One lane is Claude and one is an unregistered Muse model on T3's `muse` driver.

`t3:setup`: a T3 Code parent runs the installed `/setup-pstack` over a fixture sheet. It probes the T3-routed family through `delegate_task` and the Codex family through the runner, and writes the sheet only after both probes pass.

Select both for a change to `provider-dispatch.md`, `codex-tools.md`, `setup-pstack/SKILL.md`, `recipes.ts`, `harness.ts` or `doctor.ts`. A path that reaches them never adds them to every run; name them with `--feature t3:dispatch --feature t3:setup`.

## How to get to it (user POV)

Start a T3 Code thread on the Claude provider with the candidate plugin loaded, and ask `poteto-mode` to dispatch one role from a model sheet.
Start a T3 Code thread on the Claude provider with the candidate plugin loaded. Ask `poteto-mode` to dispatch roles from a model sheet, or run `/setup-pstack`.

## Driving it with verify-open-pstack

The `t3` transport runs a disposable T3 server from the operator's installed service binary, `~/.t3/runtime/versions/<activeVersion>/t3`, which `~/.t3/runtime/service-state.json` names. The server's base directory and project live in the run root. Its `userdata/settings.json` sets the `claudeAgent` provider's `launchArgs` to the same session-only `--plugin-dir <exact-head checkout>/plugins/pstack --settings '{"enabledPlugins":{"pstack@open-pstack":false}}'` the Claude harness uses, so the parent and every Claude child it delegates to load the candidate. Each case adds the fixture as a project, runs its prompt with `t3 thread start --provider claudeAgent --model claude-sonnet-5-5 --wait --json`, and stops the server.
The `t3` transport runs a disposable T3 server from the operator's installed service binary, `~/.t3/runtime/versions/<activeVersion>/t3`, which `~/.t3/runtime/service-state.json` names. The server's base directory and project live in the run root. Its `userdata/settings.json` sets the `claudeAgent` provider's `launchArgs` to the same session-only `--plugin-dir <exact-head checkout>/plugins/pstack --settings '{"enabledPlugins":{"pstack@open-pstack":false}}'` the Claude harness uses, so the parent and every Claude child it delegates to load the candidate. A case adds more provider instances to those settings:

- `dispatch` copies each enabled `muse` instance from the operator's `~/.t3/userdata/settings.json`, such as `muse_pool`, with only its driver, `enabled: true` and `config.binaryPath`. The base `muse` instance stays off by default, so the server has a disabled `muse` beside an enabled pool. The enabled `codex` instance also lists Muse models. The run stops with `t3-instance-missing:muse` when the operator has no enabled Muse instance.
- `setup` turns the `codex` instance off, so the Codex family takes the standalone route through the runner with `--parent claude`.

Each case adds the fixture as a project, runs its prompt with `t3 thread start --provider claudeAgent --model claude-sonnet-5-5 --wait --json`, and stops the server. The transport hashes the operator's `~/.t3/userdata/settings.json` before and after each case and fails the run on any change (`t3-operator-settings-unchanged`).

## Gotchas

`t3 thread show --json` carries neither tool calls nor options, so the transport reads the parent's Claude transcript. The run-owned `statev2.sqlite` maps the T3 thread to its Claude session id (`nativeThreadRef.nativeId`), and the transcript is `<Claude config>/projects/<project realpath, each non-alphanumeric character as ->/<session>.jsonl`. That transcript and the delegated child's stay in the operator's Claude projects folder; the verifier copies the parent's into the run root. The operator's T3 service, settings and data are never touched.
`t3 thread show --json` carries neither tool calls nor options, so the transport reads the parent's Claude transcript. The run-owned `statev2.sqlite` maps the T3 thread to its Claude session id (`nativeThreadRef.nativeId`), and the transcript is `<Claude config>/projects/<project realpath, each non-alphanumeric character as ->/<session>.jsonl`. That transcript and the delegated children's stay in the operator's Claude projects folder; the verifier copies the parent's into the run root. The operator's T3 service, settings and data are never touched.

`orchestrator_capabilities` lists a provider's models only for a search, so the `dispatch` case merges the models of every capability call in the transcript before it applies the instance rule.

The T3 Claude runtime uses the operator's real Claude config home. `setup` is a setup feature, so the run snapshots `pstack-models.md` and `CLAUDE.md` there first, and restores and checks their bytes after the case.

## Headless

The `dispatch` case writes a fixture sheet whose `bug-fix` role is `claude:claude-haiku-5-5@low` and a `marker.txt` holding a per-run `crypto.randomUUID()` that the prompt never contains. It asserts the transcript's `Base directory for this skill` line for `poteto-mode` is the candidate plugin path; exactly one `delegate_task` call has `target.providerInstanceId` `claudeAgent`, `target.model` `claude-haiku-5-5` and `target.options` `{"effort":"low"}`; its result names the same provider, model and effort and is settled (`completed`, `result_available`, no pending child runs, question or approval); and its summary holds the marker. The request and response are retained as `delegate-task.json`. The model's prose is never read.
The `dispatch` case writes a fixture sheet whose `bug-fix` role is Haiku 5.5 at `low` and whose `judgment and prose` role is `muse-spark-1.3` at `low`, plus one `marker-N.txt` per lane holding a per-run `crypto.randomUUID()` that the prompt never contains. It asserts:

- the transcript's `Base directory for this skill` line for `poteto-mode` is the candidate plugin path;
- exactly two `delegate_task` calls ran;
- the Claude lane's request and response name `claudeAgent`, `claude-haiku-5-5` and the option `effort` at `low`;
- the Muse lane's instance equals the pure `t3Pick` applied to the parent's own capability results, is never `codex`, and the request and response carry the option `reasoningEffort` at `low` (`instance-rule:muse`);
- each response is settled (`completed`, `result_available`, no pending child runs, question or approval), and its summary holds its lane's marker.

The requests and responses are retained as `delegate-task.json`.

The `setup` case runs `git init` in the fixture directory. It writes a fixture sheet into the snapshotted config home: the role defaults with every non-alias lane on Haiku 5.5 at `low`, `judgment and prose` on `gpt-6-luna` at `low`, the `# defaults: 3` line and `codex writer sandbox: bounded`. That makes the run a qualifying rerun, so setup asks nothing. The prompt puts probe files under `probes/` and smoke-test files under `smoke/` in the fixture directory. It asserts:

- the transcript's `Base directory for this skill` line for `setup-pstack` is the candidate plugin path;
- `orchestrator_capabilities` ran before both probes;
- a settled `delegate_task` probe ran on `claudeAgent` with `claude-haiku-5-5` and `{"effort":"low"}`;
- a `pstack-runner` call ran with `--parent claude --provider codex --model gpt-6-luna --effort low --mode read-only`, and its receipt under `probes/` is `complete` with `pinned-argv` evidence;
- no runner call named `--provider claude`, and no `delegate_task` call named `gpt-6-luna`;
- the first tool call that writes the sheet comes after both probes, and the sheet's mtime is at or after the runner receipt's `completedAt`;
- the sheet holds exactly the fixture's roles, the one setting line and the `# defaults: 3` line, and `CLAUDE.md` holds exactly one import line for the sheet.

The model's prose is never read.
14 changes: 7 additions & 7 deletions .claude/skills/verify-open-pstack/scripts/core.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ describe('registry and ownership', () => {
expect(s.features).toContain('claude:agent-preload:poteto-agent');
expect(s.features).not.toContain('codex:agent-preload:poteto-agent');
});
test('only the T3 dispatch surfaces reach t3:dispatch, and self-test never adds a T3 session', () => {
const reach = (filename: string) => classify([{ filename }], registry).features.includes('t3:dispatch');
test('only the T3 surfaces reach t3:dispatch and t3:setup, and self-test never adds a T3 session', () => {
const reach = (filename: string) => classify([{ filename }], registry).features.filter(f => f.startsWith('t3:'));
for (const filename of ['plugins/pstack/skills/poteto-mode/references/provider-dispatch.md', 'plugins/pstack/skills/poteto-mode/references/codex-tools.md',
'plugins/pstack/skills/setup-pstack/SKILL.md', '.claude/skills/verify-open-pstack/features/recipes.ts',
'.claude/skills/verify-open-pstack/scripts/harness.ts', '.claude/skills/verify-open-pstack/scripts/doctor.ts']) expect(reach(filename)).toBe(true);
'.claude/skills/verify-open-pstack/scripts/harness.ts', '.claude/skills/verify-open-pstack/scripts/doctor.ts']) expect(reach(filename)).toEqual(['t3:dispatch', 't3:setup']);
for (const filename of ['plugins/pstack/skills/poteto-mode/references/model-catalog.md', 'plugins/pstack/skills/poteto-mode/SKILL.md',
'plugins/pstack/hooks/hooks.json', '.claude/skills/verify-open-pstack/scripts/verify.ts']) expect(reach(filename)).toBe(false);
'plugins/pstack/hooks/hooks.json', '.claude/skills/verify-open-pstack/scripts/verify.ts']) expect(reach(filename)).toEqual([]);
const r = receipt(true);
expect(requiredHarnesses(r)).toEqual(['claude', 'codex']);
r.runFeatures = ['t3:dispatch'];
r.runFeatures = ['t3:dispatch', 't3:setup'];
expect(requiredHarnesses(r)).toEqual(['claude', 'codex', 't3']);
expect(requiredFeatures(r, 't3')).toEqual(['dispatch']);
expect(requiredFeatures(r, 't3')).toEqual(['dispatch', 'setup']);
});
test('every runtime ownership permits naming both Grok features; assets, version-only manifests and non-runtime paths do not', () => {
const reach = (file: ChangedFile) => classify([file], registry).features.filter(f => f.startsWith('grok:'));
Expand Down Expand Up @@ -244,7 +244,7 @@ describe('registry and ownership', () => {
const path = '.claude/skills/verify-open-pstack/features/recipes.ts';
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();
...registry.skills.map(skill => `skill-invocation:${skill}`)), 'claude:agent-preload:poteto-agent', 'grok:dispatch', 'grok:setup', 't3:dispatch', 't3:setup'].sort();
for (const file of [{ filename: path }, { filename: 'docs/moved.md', previous_filename: path }]) {
const s = classify([file], registry);
expect(s.features).toEqual(expected);
Expand Down
4 changes: 2 additions & 2 deletions .claude/skills/verify-open-pstack/scripts/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function matches(path: string, pattern: string): boolean {
return pattern.endsWith('/**') ? path.startsWith(pattern.slice(0, -2)) : path === pattern;
}

const T3_DISPATCH_PATHS = [
const T3_PATHS = [
'plugins/pstack/skills/poteto-mode/references/provider-dispatch.md', 'plugins/pstack/skills/poteto-mode/references/codex-tools.md',
'plugins/pstack/skills/setup-pstack/SKILL.md', '.claude/skills/verify-open-pstack/features/recipes.ts',
'.claude/skills/verify-open-pstack/scripts/harness.ts', '.claude/skills/verify-open-pstack/scripts/doctor.ts',
Expand All @@ -43,7 +43,7 @@ export function classify(files: ChangedFile[], registry: Registry): Selection {
if (path !== 'plugins/pstack/assets/logo.png') throw new Error(`Unmapped asset consumer: ${path}`);
features.add('codex:assets:codex'); covered = true;
}
if (T3_DISPATCH_PATHS.includes(path)) features.add('t3:dispatch');
if (T3_PATHS.includes(path)) ['t3:dispatch', 't3:setup'].forEach(f => features.add(f));
Comment thread
github-actions[bot] marked this conversation as resolved.
Resolved
const sharedRecipe = path === '.claude/skills/verify-open-pstack/features/recipes.ts';
if (sharedRecipe) both('catalog', 'writers', ...WRITER_PROVIDERS.map(provider => `writers:${provider}`), 'shipped-tools:watch-pr');
const catalog = registry.catalog.some(p => matches(path, p));
Expand Down
Loading
Loading