fix(pstack): persist pstack-models in the repo - #325
Open
imikushin wants to merge 4 commits into
Open
Conversation
Lock the contract before the retarget. The check fails while skills still write ~/.cursor/rules/pstack-models.mdc. Co-authored-by: Ivan Mikushin <imikushin@users.noreply.github.com>
Write and read .cursor/rules/pstack-models.mdc so cloud agents keep the mapping after the VM goes away. Co-authored-by: Ivan Mikushin <imikushin@users.noreply.github.com>
The check already excludes its own script. Hide-the-needle printf made that harder to see. Co-authored-by: Ivan Mikushin <imikushin@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The new path-check script excludes an entire scripts directory from its forbidden-path scan, which can let future regressions slip through unnoticed.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates pstack’s model-configuration contract so cloud agents can persist role→model mappings by storing them in the repository (.cursor/rules/pstack-models.mdc) rather than in a VM-local home directory.
Changes:
- Retarget skill documentation to read/write
.cursor/rules/pstack-models.mdcinstead of~/.cursor/rules/pstack-models.mdc. - Update setup guidance to seed from an old home rule once (when the repo file is missing) and instruct users to commit the repo rule.
- Add a verification script that fails if the deprecated home-path contract reappears.
File summaries
| File | Description |
|---|---|
| pstack/skills/swarm/SKILL.md | Updates swarm’s model lookup path to the repo rule file. |
| pstack/skills/setup-pstack/SKILL.md | Updates setup instructions to write the repo rule and explains cloud-agent persistence/commit expectations. |
| pstack/skills/setup-pstack/scripts/check-pstack-models-path.sh | Adds a guard script to prevent reintroducing the deprecated home-path contract. |
| pstack/skills/interrogate/SKILL.md | Updates interrogate’s reviewer model lookup path to the repo rule file. |
| pstack/skills/arena/SKILL.md | Updates arena’s runner/cross-judge model lookup path to the repo rule file. |
| pstack/README.md | Documents the new repo rule path as the output of /setup-pstack. |
| pstack/docs/guide/01-setup.md | Updates setup guide to the repo rule path and instructs committing it for cloud agents. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Keep other files under setup-pstack/scripts in the forbidden-path grep. Co-authored-by: Ivan Mikushin <imikushin@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
/setup-pstackwrote~/.cursor/rules/pstack-models.mdc. A cloud agent VM throws that home directory away. The next cloud agent never sees the mapping.The file has to live in the workspace at
.cursor/rules/pstack-models.mdc. Cursor already loads repo rules for cloud agents. Skills that Read the file find it there too.Scope
pstack/skills/setup-pstack/SKILL.mdwrites.cursor/rules/pstack-models.mdc. It seeds from a leftover home rule when the repo file is missing. It tells the user to commit the file and not gitignore it.arena,swarm, andinterrogateread the same repo path.pstack/docs/guide/01-setup.mdandpstack/README.mdname the new path.pstack/skills/setup-pstack/scripts/check-pstack-models-path.shfails if the home path returns.Tradeoffs
Setup still reads a leftover home rule once, then writes only the repo file. Readers do not keep a dual path. People who already have a home file need to re-run
/setup-pstackor copy the file into the repo.The mapping is now per repo, not user-global. That is the point for cloud agents. Desktop users who wanted one mapping across every project now keep it in each repo.
Blast Radius
Any agent that runs
/setup-pstackor reads the rule path. Skills that only say "configured via /setup-pstack" keep working becausealwaysApply: truestill injects the rule once it is in the repo.No runtime application code.
Verification
Ran
pstack/skills/setup-pstack/scripts/check-pstack-models-path.shbefore the retarget. It printed every home-path hit and exited 1.Ran the same script after the retarget. Exit 0.
git grepfinds no home-path contract under skills or docs.Wrote a dummy rule to a temp workspace
.cursor/rules/pstack-models.mdc. The home file stayed absent.Comment Sicko found no comments. It flagged the check's hidden needle. The script now names the home path as a literal and excludes its own directory.