# Upstream provenance

This directory is a fresh import of [pstack](https://github.com/cursor/plugins/tree/main/pstack) by Lauren Tan, adapted for Selesai. It is not a hand-maintained fork: the tree is generated by the offline importer in [`scripts/pstack/`](../../../scripts/pstack/README.md) from a pinned upstream commit, and every deviation from upstream is a checked, recorded step of that import.

- **Pinned upstream commit:** `ca782ed8b3c2c521cead8e1720d55c3a5dbf2347` (plugin version 0.15.48) in https://github.com/cursor/plugins, path `pstack/`.
- **License:** MIT — [LICENSE](LICENSE) (Copyright (c) 2026 Lauren Tan), byte-identical to upstream. No additional license terms exist in the upstream tree.
- **Replaces:** the previous import from upstream commit `7a583913eb1b8d1a0ee76753d1a2cf072e7b54f9` (v0.15.46) with local adaptations; the prior tree (534 files, including the four files with uncommitted edits) is preserved at `/tmp/selesai-pstack-port-baseline/pstack-prior-owned-backup/` with a machine-readable `prior-owned-manifest.json` of every prior file hash.

## Import composition

| | count | meaning |
|---|---|---|
| Imported byte-identical from upstream | 436 | unmodified pinned content in the final pack |
| Excluded upstream files | 19 | documented below; never shipped |
| Retained local files | 1 | `docs/harness/selesai.md` (see below; carried forward, then adapted by a checked recipe) |
| Provenance files | 1 | this file, supplied from the importer template `scripts/pstack/provenance/UPSTREAM.md` |
| Recipe replacements | 100 | Selesai adaptations recorded per file: 88 runnable-pack files (skills, playbooks, scripts, the harness adapter) and 12 public-doc files (`README.md` and the 11 `docs/guide/` pages) |
| Generated manifest | 1 | `UPSTREAM-MANIFEST.json`, hashes every file above |

The complete machine-readable inventory — every file with its sha256 and its source (`upstream`, `retained-local`, `provenance`, or `recipe`) — is [`UPSTREAM-MANIFEST.json`](UPSTREAM-MANIFEST.json). It is generated by the importer and must not be hand-edited. This file is likewise generated: maintain it at `scripts/pstack/provenance/UPSTREAM.md` and re-run the importer; never edit this copy directly.

## Excluded upstream files (19)

| Path(s) | Reason |
|---|---|
| `agents/poteto-agent.md` | Cursor subagent definition; superseded by the native builtin agent `poteto-agent`. |
| `agents/comment-sicko.md` | Cursor subagent definition; superseded by the native read-only builtin `comment-sicko`. |
| `automations/benny/*` (12 files) | Cursor Automations (Benny) pack: Cursor-only webhooks and Slack triggers; explicitly unsupported in Selesai. |
| `docs/harness/claude-code.md` | Claude Code adapter tables; superseded by the retained `docs/harness/selesai.md`. |
| `plugin.json`, `.cursor-plugin/plugin.json`, `.gitignore` | Cursor plugin packaging metadata; Selesai ships this pack from `src/skills/pstack`. |
| `assets/logo.png` | Cursor plugin artwork. |

## Retained local file

`docs/harness/selesai.md` is the Selesai harness reference document superseding upstream `docs/harness/claude-code.md`. It is carried forward from the prior tree (content audited against the pinned base) rather than imported from upstream, and is the only non-upstream content file in the tree at import time besides the provenance document. A checked recipe then extends it with the complete capability matrix and the executed native delegation examples.

## Deviations and reproduction

The imported base is unmodified upstream content. Selesai adaptations are applied on top as checked recipes (see `scripts/pstack/README.md`): each adapted file is replaced wholesale by a recipe that records the exact upstream hash it was authored against, so a recipe can never silently re-apply to changed upstream content. Adapted files appear in `UPSTREAM-MANIFEST.json` with `source: "recipe"`, their pre-adaptation hash (`baseSha256`) and a reason.

To reproduce this pack offline, stage from the pinned tree with the checked recipes; the staged output is byte-identical to this directory (this file and the manifest included):

```sh
# one-time retrieval (network): the pinned tree only
git clone https://github.com/cursor/plugins <dir>
git -C <dir> checkout ca782ed8b3c2c521cead8e1720d55c3a5dbf2347

# offline checks (no network); <tmp-dir> will match src/skills/pstack exactly
node scripts/pstack/import-upstream.mjs verify --source <dir>/pstack
node scripts/pstack/import-upstream.mjs stage --source <dir>/pstack --out <tmp-dir> \
  --retained-from /tmp/selesai-pstack-port-baseline/pstack-prior-owned-backup \
  --recipes scripts/pstack/recipes
```

Two staging runs from the same input produce byte-identical output. The importer fails closed on changed, missing, extra, or symlinked input files rather than guessing. Nothing in this pack may fetch mutable upstream `main` at runtime.
