Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
00757e9
docs: record pstack-flex fork point and provenance
thisguymartin Sep 25, 2026
09373fa
feat(runner): add deepseek and minimax gateway providers
thisguymartin Sep 25, 2026
6fa309a
feat(runner): gateway preflight with OAuth-leak guard
thisguymartin Sep 25, 2026
09816a6
refactor(runner): derive gateway lanes from one provider list
thisguymartin Sep 28, 2026
53930c8
fix(runner): isolate gateway routing and reject model mismatches
thisguymartin Sep 28, 2026
1c22878
docs(dispatch): flex model matrix, routes, and receipt semantics
thisguymartin Sep 25, 2026
da63250
feat(setup): assignment-first setup with flex families
thisguymartin Sep 25, 2026
ff22251
docs: LANES.md pricing, zero-subscription walkthrough, CHANGES entry
thisguymartin Sep 25, 2026
eaf79fd
docs: add usage guide with diagrams, flows, and lane examples
thisguymartin Sep 25, 2026
69d5e1e
docs(readme): link the usage guide and install from this fork
thisguymartin Sep 25, 2026
5ede982
docs(lanes): document adding a gateway provider
thisguymartin Sep 28, 2026
92dc0bc
docs(lanes): align gateway guidance with verified model receipts
thisguymartin Sep 28, 2026
680577a
Merge pull request #1 from thisguymartin/flex/gateway-providers
thisguymartin Sep 28, 2026
375becd
Merge pull request #2 from thisguymartin/flex/dispatch-and-docs
thisguymartin Sep 28, 2026
29068bf
feat: add DeepSeek Pro and MiniMax preview model choices
thisguymartin Sep 28, 2026
d581d2b
Merge pull request #6 from thisguymartin/flex/multiple-gateway-models
thisguymartin Sep 28, 2026
83a16f1
feat(pstack): support GPT-6 role families
thisguymartin Sep 28, 2026
492f77f
Merge remote-tracking branch 'origin/main' into pr9-work
thisguymartin Sep 28, 2026
c27f756
docs: document optional GPT-6 Codex families
thisguymartin Sep 28, 2026
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
18 changes: 18 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
# CHANGES — applied substitutions

## Unreleased: multiple gateway model choices

- Add DeepSeek V4 Pro and MiniMax M3.1 Flash Preview as independent setup families alongside existing Flash and M3 choices. Keep provider-owned routing and existing descriptors.
- Validate unique model families and provider/model pairs instead of requiring one row per provider; cover both parent routes and substituted-model rejection.
- Document preview Token Plan access, model-specific thinking semantics, and required installed live validation. Tracked in [pstack-flex #5](https://github.com/thisguymartin/pstack-flex/issues/5).

This port applies the Cursor → Claude Code substitutions in skill bodies. Earlier drafts left them flagged; this revision resolves them. A later pass added a Codex build that shares the same skills; see [Codex port](#codex-port) below.

## pstack-flex (unreleased) — gateway lanes and optional families

Fork of open-pstack v1.4.1. Additive changes, all in port-owned files:

- Runner: new gateway providers `deepseek` and `minimax` (`runner/flex-providers.ts`). Each spawns the stock `claude` binary with the exact claude argv, plus injected environment: the lab's Anthropic-compatible endpoint, `ANTHROPIC_AUTH_TOKEN` from `DEEPSEEK_API_KEY`/`MINIMAX_API_KEY`, model pins, and an isolated `CLAUDE_CONFIG_DIR` (`~/.pstack-flex/<provider>`). Inherited `ANTHROPIC_*` values are deleted before injection so a parent's credentials or endpoint never bleed into a gateway child.
- OAuth-leak guard: a gateway lane refuses to start (in-process, `unauthenticated` receipt, exit 77) when its API key variable is missing or when its config dir carries a claude.ai OAuth credentials file, so a claude.ai login can never be pointed at a third-party endpoint.
- Gateway preflight is `claude --version`; the one-shot invocation is the real auth test. Gateway receipts force `costUsd` to null (the CLI prices at Anthropic rates) and match served models case-insensitively, falling back to `modelEvidence: "pinned-argv"` like Codex.
- `provider-dispatch.md`: new additive "Flex model matrix" section, extended route table, gateway preflight semantics, and the panel-diversity rule (arena runners and interrogate reviewers span at least two providers unless the operator explicitly confirms otherwise). The stock model matrix is byte-unchanged.
- Optional GPT-6 families: the additional model matrix declares `codex:gpt-6-astra`, `codex:gpt-6-sol`, and `codex:gpt-6-luna` with default effort `high` and selectable `low`, `medium`, `high`, `xhigh`, and `max`. Setup can assign and probe each for `architect runners` or another configurable role. Codex parents use native `spawn_agent`; Claude Code parents use the external Codex runner. GPT-6 Sol has its own `sol-6` family. Stock models and first-run role assignments stay unchanged.
- `setup-pstack`: role assignments are selected first, and only assigned families get effort questions and probes; there is no requirement to assign every matrix family (mirrors upstream PR #73 / issue #72). The first-run sheet, its stock quad, and the fail-closed write rules are unchanged.
- Tests: the model-matrix contract gains a flex-matrix section check cross-validated against the runner's gateway specs; runner, commands, parse-output, and CLI tests cover env injection, the guard, cost nulling, and case-insensitive verification. Nothing in the suite performs network I/O.

## 1.4.1 syncs to Cursor pstack 0.15.1

Open Pstack 1.4.1 tracks Cursor pstack 0.15.1 at `f8abeddd1862dc73704e3d719dd73df0d51b8c71`. Poteto-mode now requires each claim to include its evidence or a measured, inferred, or guess label in the same sentence. Agents also run any check they can run themselves instead of handing that check to the user. No playbook, model, runtime, or dependency changed.
Expand Down
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2026 Lauren Tan
Copyright (c) 2026 Martin Patino (pstack-flex modifications)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This plugin is a port of upstream MIT-licensed work. All upstream copyright notices and license terms are preserved. The open-pstack history begins from `michael-denyer/pstack-claude` through proven import commit `053ed78732e3b71826933170eafe7f7782dda844`.

## pstack-flex provenance

This repository, **pstack-flex** (Martin Patino), is a fork of [ericlitman/open-pstack](https://github.com/ericlitman/open-pstack) at v1.4.1 (`de67e6b40511814171e5e4c8ad7af3b79f07c9ee`), which ports [Lauren Tan's pstack](https://github.com/cursor/plugins/tree/main/pstack) (Cursor) to Claude Code and Codex. Provenance chain: pstack-flex <- ericlitman/open-pstack <- cursor/plugins/pstack. All licenses remain MIT; every upstream license and notice file is preserved. The flex gateway providers, optional families, docs, and tests are (c) 2026 Martin Patino, MIT, and are inventoried in [UPSTREAM-FLEX.md](UPSTREAM-FLEX.md).

## Upstream sources

| Component | Upstream | Copyright | License | License file |
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Lauren built pstack from the skills she uses to ship code at Cursor. In a [55-mi

Open Pstack is an unofficial community project that makes pstack work in Claude Code and Codex. If Cursor is your main coding environment, use [Lauren's original pstack](https://github.com/cursor/plugins/tree/main/pstack). If Claude Code or Codex is your main coding environment, use this repository.

## This fork: pstack-flex

**pstack-flex** is a fork of [ericlitman/open-pstack](https://github.com/ericlitman/open-pstack) at v1.4.1. Setup can assign only the model families you have. The `deepseek:*` and `minimax:*` routes run the stock `claude` binary against each lab's Anthropic-compatible endpoint with that lab's API key. The runner isolates Claude configuration, strips inherited provider routing and Anthropic headers, and rejects OAuth credentials found in the gateway config directory. Gateway receipts keep token usage but set `costUsd` to null because Claude Code's cost estimate uses Anthropic prices.

The [lane guide](docs/LANES.md) covers setup, costs, and safety notes. The fork's provenance and sync process are recorded in [UPSTREAM-FLEX.md](UPSTREAM-FLEX.md). Anthropic does not support pointing Claude Code at non-Anthropic endpoints; use synthetic data for gateway testing and keep API keys in your local environment.

New here? **[docs/USAGE.md](docs/USAGE.md)** is the walkthrough: diagrams of how work flows through the lanes, three setup configurations (full frontier, hybrid saver, zero-subscription), copy-paste examples for the daily skills, and troubleshooting.

## What pstack does

pstack is a plugin for coding agents. It is not a new model or a hosted service. It gives your agent engineering rules, step-by-step workflows for different kinds of work, focused skills, and small local tools.
Expand Down Expand Up @@ -39,7 +47,7 @@ You need a current Claude Code or Codex installation. For the full four-model re
Run these commands inside Claude Code:

```text
/plugin marketplace add ericlitman/open-pstack
/plugin marketplace add thisguymartin/pstack-flex
/plugin install pstack@open-pstack
/reload-plugins
```
Expand All @@ -49,7 +57,7 @@ Run these commands inside Claude Code:
Run these commands in your shell:

```shell
codex plugin marketplace add ericlitman/open-pstack --ref main
codex plugin marketplace add thisguymartin/pstack-flex --ref main
codex plugin add pstack@open-pstack
```

Expand Down Expand Up @@ -80,7 +88,7 @@ In Codex, ask:
Use pstack:setup-pstack to configure pstack.
```

Setup checks the models you can actually run, shows how each one will start, and asks before saving the choices. The current default group uses Fable, GPT-5.6 Sol, Grok 4.6, and Opus.
Setup checks the models you can actually run, shows how each one will start, and asks before saving the choices. The current default group uses Fable, GPT-5.6 Sol, Grok 4.6, and Opus. You can also assign GPT-6 Astra, Sol, or Luna to any role through Codex.

An older model sheet starts using the rolling aliases in memory as soon as this release is installed. Run setup once after updating to persist that migration. It replaces versioned Fable and Opus entries while preserving every role assignment and effort selection.

Expand Down
46 changes: 46 additions & 0 deletions UPSTREAM-FLEX.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Flex fork synchronization

pstack-flex layers on top of open-pstack's own upstream tracking. Two sync relationships exist:

1. `cursor/plugins/pstack` -> `ericlitman/open-pstack` — documented in [UPSTREAM.md](UPSTREAM.md), unchanged by this fork.
2. `ericlitman/open-pstack` -> `thisguymartin/pstack-flex` — this document.

## Fork point

| Source | Value |
| --- | --- |
| Repository | `https://github.com/ericlitman/open-pstack.git` |
| Tag | `v1.4.1` |
| Commit | `de67e6b40511814171e5e4c8ad7af3b79f07c9ee` |
| Tracks Cursor pstack | `0.15.1` (`f8abedd`) |

The fork keeps full upstream history. The `upstream` remote points at ericlitman/open-pstack.

## What the fork owns

All flex changes are additive and live in port-owned files so upstream merges stay cheap:

- `plugins/pstack/skills/poteto-mode/scripts/runner/flex-providers.ts` and `flex-providers.test.ts` (new)
- Gateway-provider hooks in `runner/{types,commands,run,parse-output,cli}.ts` and their tests
- The "Additional model matrix" and "Flex model matrix" sections and route-table columns in `references/provider-dispatch.md`
- The assignment-first restructure of `skills/setup-pstack/SKILL.md`
- `docs/LANES.md`, this file, the README fork section, and the NOTICE/LICENSE/CHANGES additions

The stock model matrix, the first-run sheet, every upstream skill body, and the static quad invariants are byte-unchanged. Flex rows and setup instructions are additive.

## Merge procedure

```shell
git fetch upstream
git switch -c merge-rehearsal
git merge --no-ff --no-commit upstream/main
# inspect, resolve, run the full local gate, then merge for real or abort
```

Expected conflict surface on future upstream releases:

- `plugins/pstack/skills/setup-pstack/SKILL.md` — upstream issue #88 (1.5.0, syncing Cursor pstack 0.15.5) folds upstream PR #73, which moves setup to the same assignment-first, probe-only-assigned shape this fork already uses. Resolve toward upstream's wording wherever it covers the same rule; keep the flex families and the diversity rule.
- `plugins/pstack/skills/poteto-mode/scripts/runner/model-matrix.test.ts` — upstream 1.5.0 changes the stock panel to three lanes. Take upstream's stock assertions verbatim; the flex-matrix describe block is fork-owned and should survive as-is.
- `plugins/pstack/skills/poteto-mode/references/provider-dispatch.md` — stock matrix and default-panel prose are upstream's; the flex section is fork-owned.

After every merge: run the full local gate (`bun install --frozen-lockfile`, `bun run test`, `bun run typecheck`, manifest JSON parse, `PSTACK_STATIC_ONLY=1 bash tests/skill-collision-repro.sh`), then record the installed version, action, and observed result for each affected harness in the pull request before tagging.
Loading