From 4ceea4279c55c68ac41951e6307af2711c73eb6f Mon Sep 17 00:00:00 2001 From: Camgineer Date: Mon, 14 Sep 2026 15:42:10 -0400 Subject: [PATCH 1/4] feat(cstack): align model policy with Codex spawn seats Fable and Opus are lead-only. Spawn seats are Astra, Sol, Grok, Luna, and Muse Max. Sol always reviews. Grok implements. Always set spawn model so a Fable parent cannot leak into workers. --- .codex-plugin/plugin.json | 2 +- package.json | 2 +- policy/models.md | 199 ++++++++++++++++++-------------------- 3 files changed, 95 insertions(+), 108 deletions(-) diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 6610fca..3a39cd3 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "cstack", - "version": "0.2.0", + "version": "0.3.0", "description": "Codex plugin packaging PStack, Cursor Team Kit, and Matt Pocock skills.", "author": { "name": "Camgineer", diff --git a/package.json b/package.json index a869d45..9caa4d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cstack", - "version": "0.2.0", + "version": "0.3.0", "private": true, "description": "C-Stack Codex plugin", "scripts": { diff --git a/policy/models.md b/policy/models.md index 8ac7919..38ee604 100644 --- a/policy/models.md +++ b/policy/models.md @@ -1,139 +1,126 @@ # C-Stack model policy -Single source for Cameron's model choices across all PStack skills, playbooks, and modes, including Planning Mode, Poteto Mode, and future modes, in repositories and outside them. C-Stack owns this policy. Global AGENTS.md should only point at C-Stack. This is instruction policy, not an automatic router or upstream configuration schema. Vendor skills remain unchanged. +Single source for model choices across PStack skills, playbooks, and modes. C-Stack owns this policy. Global AGENTS.md only points here. Vendor skill slugs do not win. -## Operating model +This is instruction policy. It does not change Codex or OpenCodex config by itself. -Sol Medium is the durable driver for phase one and phase two. It owns the user conversation, research integration, decisions, project record, coordination, implementation supervision, finding resolution, and final delivery. +## Identifiers -Every material plan in Planning Mode must pass one independent Astra Medium readiness audit before it becomes Ready. Astra challenges the plan and returns concrete findings. Sol resolves them. Astra rechecks only the changed or disputed parts. Poteto Mode starts only after the plan can stand alone without hidden product decisions. Small requests that do not need material planning may bypass Planning Mode rather than weakening this exit gate. +Leads are not spawn seats. -Do not add a general Astra audit at the end of phase two. Use the required independent implementation review and repository verification gates. +| Name | Slug | Seat | +| --- | --- | --- | +| Fable | `anthropic/claude-fable-5-1` | Lead only | +| Opus | `anthropic/claude-opus-5` | Lead only | +| Astra | `gpt-6-astra` | Spawn | +| Sol | `gpt-5.6-sol` | Spawn | +| Grok | `combo/grok-4.6` | Spawn | +| Luna | `gpt-5.6-luna` | Spawn | +| Muse | `cursor/muse-spark-1.3` | Spawn | -## Role defaults +Spawn uses at most five models. Those five are Astra, Sol, Grok, Luna, and Muse. Combo is the slug for Grok, not a second model. Fable and Opus never occupy a spawn seat. -Use at most five distinct model identifiers, including fallbacks and panel members. Roles may share models. Reasoning efforts do not count as separate models. +If the live spawn tool's model list is not these five, stop and report. Do not use Gemini, Terra, Haiku, Sonnet, Composer, or inherit-parent as a policy route. -| Work | Model | Reasoning | Boundary | -| --- | --- | --- | --- | -| Durable lead and orchestration | Sol | Medium | Own both phases, continuity, decisions, coordination, and delivery. | -| Planning, explanation, research synthesis, architecture, diagnosis, technical adjudication, and release coordination | Sol | Medium | General reasoning route. Product choices still belong to Cameron. | -| Final phase-one readiness audit | Astra | Medium | Independent one-time gate plus focused recheck. Do not rewrite the plan by default. | -| Artistic creation and judgment across 2D and 3D | Astra | Medium | Creative direction, image reasoning, generation direction and acceptance, Meshy, Blender, Godot scene art, geometry, rigs, animation, materials, lighting, composition, and renders. | -| Autonomous exploratory gameplay | Astra | Medium | Operate a qualified game-control bridge, explore behavior, recover from stuck states, and retain observations. This is not human playtesting. | -| Bounded implementation | Luna | Extra High | Well-specified work, including complete features, with contained impact, clear checks and no unresolved design decision. Route difficult debugging, complex interactions, migrations and other high-risk work to Grok even when the ticket is clear. | -| Standard and complex implementation or refactoring | Grok | High | Other code work within an approved contract, including test and verification-harness code. | -| Independent code-contract and security-diff validation | Sol | Medium | Inspect requirements, exact changes, defects, and proof independently. | -| Routine CLI/API operation and live proof | Grok | High | Operate the actual runtime and retain evidence. This includes authorized deployment or rollback mutation. | -| Routine browser or native UI operation and proof | Sol | Medium | Operate the interface and check agreed behavior. Creative visual acceptance remains Astra. | -| Alternate-family judgment | Gemini | High | Required independent critique from a family distinct from Astra and Sol. | -| Bounded extraction and code exploration | Luna | High | Read-only source-backed findings. Sol handles causal or architectural synthesis. | - -Exact identifiers: Astra is `gpt-6-astra`; Sol is `gpt-5.6-sol`; Grok is `combo/grok-4.6`; Luna is `gpt-5.6-luna`; Gemini is `combo/gemini-3.8.flash`. - -Use standard non-Fast service tiers. Keep Sol and Astra at Medium. Higher effort is not a standard retry path. A later qualification may change a role or effort, but a model label, file count, missed requirement, unavailable tool, or unused allowance does not justify escalation. - -Choose for quality first and completed delivery speed second. Cost is tertiary. Public benchmarks and practitioner reports provide context, not routing policy. - -## Artistic and gameplay boundaries - -Astra owns artistic reasoning, tool direction, iteration, and acceptance. The selected image, video, 3D, or DCC tool produces the artifact. A deterministic file conversion or pinned-baseline pixel comparison does not become Astra work merely because the file is visual. - -Autonomous exploratory gameplay checks functional paths, recovery, visual state, unexpected behavior, and long-running scenarios. Scripted gameplay regression routes through ordinary implementation and proof roles. Human players judge fun, feel, clarity, pacing, frustration, fairness, accessibility experience, and desirability. A synthetic player never proves representative human experience. +## Leads -Real-time action play requires a qualified low-latency controller. Until then, use games that tolerate deliberation, input bursts, a virtual clock, or pause-while-thinking operation. +Create a new lead at Medium. Cameron may change parent effort. This policy does not fight that. -## Implementation and review routing - -1. Sol Medium owns the Ready ticket and selects workers from the approved contract. -2. Use Luna Extra High when the Bounded implementation boundary holds. Use Grok High for all other non-art implementation. -3. When bounded implementation exceeds its boundary or a focused Luna repair leaves a substantive defect, preserve valid work and hand it to Grok. -4. A substantive Grok defect allows one focused Grok repair. If it remains, Sol diagnoses the mechanism and corrects the plan. A fresh Grok worker may implement the corrected contract. Changing model or effort does not reset retry limits. -5. A fresh Sol Medium reviewer checks the ticket, exact changes, worker adjustments, defects, and proof. The implementer never grades itself. -6. Resolve routine technical findings within the approved scope. Return material product, design, authority, access, or acceptance choices to Cameron. -7. Do not route hard code work to Astra as a generic rescue. Astra is reserved for the readiness, artistic, and exploratory-gameplay roles above. - -## Proof channels +| Lead | When | +| --- | --- | +| Fable Medium | Engineering and critical bots | +| Opus Medium | Other important bots | +| Sol | Only if the Anthropic lead route is down | -Roles state what an agent owns. Proof channels state how a claim is demonstrated. A model assignment never proves that a tool, runtime, or permission exists. +The lead owns grilling, routing, worker selection, context for each spawn, and delivery. It does not write product code. It does not serve as its own readiness gate. -Global policy selects the model for a canonical role. Each repository's verification skill owns: +This policy cannot switch an already-running parent. -- launch and doctor checks; -- build, test, lint, migration, and runtime commands; -- supported CLI, API, browser, native-app, image, DCC, game-engine, and gameplay-control tools; -- environment, port, process, database, engine, editor, and user-data ownership; -- feature-to-proof-channel mapping; -- observable pass and failure criteria; -- screenshots, traces, logs, recordings, reports, revision receipts, and other retained artifacts; -- cleanup and recovery. +## Workers -Match the proof route to the claim: +Right-size model, effort, and context for every spawn. Effort may be low through max. Muse's panel seat stays Max. -- Grok High executes CLI/API proof. -- Sol Medium executes routine browser/native UI proof. -- Astra Medium performs creative visual acceptance and autonomous exploratory gameplay. -- Deterministic image parity uses the pinned baseline and comparison harness. Astra is needed only when the baseline or visual quality itself is in question. -- Human experience claims require human evidence. +| Work | Model | Starting effort | Boundary | +| --- | --- | --- | --- | +| Default review, code-contract, security diff | Sol | Medium | Fresh worker. The implementer never grades itself. | +| Routine browser or native UI proof | Sol | Medium | Creative visual acceptance stays Astra. | +| Second reviewer for interrogate, arena, and other panels | Muse | Max | Spawn with Sol. Do not downshift Muse. Default review is still Sol alone. | +| Implementation and CLI/API proof | Grok | High | All non-art product code. Raise or lower with hardness. | +| Bounded cheap implementation | Luna | High | Clear ticket, contained impact, obvious checks. Unclear or high-risk work is Grok. | +| Bounded extraction and code exploration | Luna | Medium | Read-only. Synthesis stays with the lead or Sol. | +| Independent readiness audit | Astra | Medium | Fresh session. Inspect the exact plan revision plus primary requirements. Findings only. The lead resolves them. Recheck only what changed. | +| Art, 3D, Image 2.5 acceptance, exploratory play | Astra | Medium | Astra directs and accepts. The generator or DCC tool produces the artifact. Astra never writes product code. | -Workers must use every shipped surface required by the repository's verification skill. A later green run does not erase an intermittent failure. Evidence identifies the exact revision and runtime. +## Codex spawn -## PStack role mapping +`spawn_agent` can override only the five spawn slugs. Children inherit the parent if `model` is omitted. Fable and Opus parents would leak into workers. Always set `model` and `reasoning_effort`. -Resolve specialized work first, then the actual work role, then profile aliases. Classify by the claim and artifact, not the application name. +Use `pstack-poteto-agent` for Poteto coding delegates. Still set an explicit worker model from the five. Do not let it inherit the lead. -| PStack role or workflow | Apply | -| --- | --- | -| Planning Mode main agent | Sol Medium | -| Planning Mode final readiness reviewer | Fresh Astra Medium | -| Poteto Mode main agent | Sol Medium. This policy cannot switch an already-running parent. | -| Feature, refactoring, bug-fix, performance, and hill-climb workers | Luna Bounded or Grok Standard, except Astra artistic work | -| How explorer and bounded Why evidence collection | Luna High | -| How explainer, Why causal synthesis, Architect, specifications, tickets, diagnosis, and technical adjudication | Sol Medium | -| Interrogate and code-review lanes | Sol Medium for code contract; Gemini High when alternate-family judgment is required | -| Arena runners and Swarm workers | Route each actual assignment. Preserve required lane count and model-family diversity. | -| Comment Sicko | Sol Medium, read-only | -| CLI/API live lane | Grok High | -| Routine UI live lane | Sol Medium | -| Artistic or exploratory-gameplay live lane | Astra Medium | -| Any unnamed role | Sol Medium classifies it without gaining new authority | +Use `pstack-comment-sicko` for comment audits. It is pinned to Sol Medium. Do not change that pin. -`Judgment`, `tooling`, `investigator`, `synthesizer`, `instruction-following`, and `fast` are descriptive profiles, not model choices. Route their actual assignment. `Fast` never changes service tier. +`ocx-*` profiles pin a model and ignore `model`. Use an `ocx-*` profile only when it is one of Astra, Sol, Grok, Luna, or Muse. Do not use Gemini or Terra profiles. -## Panels and independence +`default`, `explorer`, and `worker` also inherit. Set `model` on those too. -Preserve every selected workflow's lane count, independence, distinct-model, and alternate-family requirements. Separate agents on one model provide context independence but do not satisfy a distinct-model or cross-family requirement. +Pass only the context the worker needs. Do not fork the parent thread by default. -Gemini High fills a required alternate-family judgment lane when eligible. If unavailable, use only the workflow's explicit reduced-panel rule. Otherwise stop the gate. Do not substitute Astra or Sol and claim family diversity. +## Independence -The Astra readiness reviewer must be fresh and must inspect the exact plan revision plus primary requirements and evidence. Any material plan change after the verdict requires a focused recheck. +Sol reviews Fable-led and Opus-led work. Muse is a second reviewer, not the default. Grok never reviews its own diff. Fable and Opus never spawn. Astra readiness is a fresh agent. It does not rewrite the plan. -## Dispatch, receipts, and fallback +## Implementation path -1. Read the selected skill and assignment. Apply current user choices, specialized roles, actual work, then aliases. -2. Check the dispatch tool's supported models and efforts. Request the exact pair. Keep requested settings separate from observed settings. -3. Record requested and observed model, effort, provider, failover, role, policy revision, repository, and runtime. Combo results are provider-specific. A combo configuration is not a route receipt. -4. Include this policy path and the resolved pair in delegated work. Preserve scope, permissions, and required independence. -5. Luna unavailable or outside the bounded implementation boundary: use Grok High. -6. Grok unavailable for code or CLI/API operation: use Sol Medium and report the fallback. Do not lower acceptance. -7. Sol unavailable for durable ownership or required review: stop the affected phase or gate. Astra does not substitute for routine leadership. -8. Astra unavailable for readiness, artistic work, or exploratory gameplay: stop only that affected gate or specialist assignment. -9. Gemini unavailable for required family diversity: use only an explicit reduced-panel rule or stop the gate. -10. Tool, access, observation, and runtime failures need their own remedy. They are not model failures. +1. The lead owns the ticket and picks workers. +2. Use Luna for bounded cheap work. Use Grok for every other non-art implementation. +3. If Luna exceeds its boundary or leaves a real defect, keep valid work and hand it to Grok. +4. One focused Grok repair is allowed. If it still fails, Sol diagnoses. A fresh Grok worker implements the corrected contract. +5. A fresh Sol reviewer checks the ticket, the exact changes, defects, and proof. +6. For interrogate or a required panel, spawn Sol and Muse Max on the same artifact. +7. Return product, design, authority, and acceptance choices to Cameron. -## Policy-change verification +## Proof -For each policy revision, use an exact independently reviewed handoff identifying the authorized files, candidate hashes, current baseline hashes, qualification scope and rollback. This policy does not authorize its own activation or additional configuration changes. +Roles are not proof. Repository verification skills own commands, tools, and pass criteria. -1. Sol owns activation and the retained record. Recheck live baseline hashes immediately before applying each reviewed change. Stop affected writes if another session changed the baseline. -2. Apply only the handoff's authorized candidate files. Re-read them and verify candidate hashes. Preserve a per-file receipt if application is interrupted. -3. In fresh sessions, qualify the roles affected by the change using the handoff's approved proof. Retain requested and observed model, effort, provider and failover. CLI-only results do not qualify Desktop. An unobserved route remains unverified. -4. Confirm Poteto main resolves to Sol; unnamed roles are classified by Sol; Astra remains confined to readiness, artistic and exploratory-gameplay work plus separately authorized policy audits; required panel independence remains intact; repositories still own proof tools and commands. -5. Roll back affected run-owned changes if a required route, boundary or gate fails. Restore from the retained baseline only when the current files still match the run-owned state. Preserve concurrent edits and stop for reconciliation when they do not. -6. Retain failed and restored-state evidence. Stop only affected PStack work until recovery and required qualification pass. Never treat an unrelated later success as proof of an earlier failed revision. +- Grok executes CLI/API proof. +- Sol executes routine UI proof. +- Astra executes creative visual acceptance and exploratory play. +- Human feel still needs a human. -## Configuration and authority boundary +## PStack mapping -Keep this policy global. Repositories own project standards, permissions, verification commands, tools, and evidence contracts, not copies of this model list. +Vendor skills name Cursor slugs. Resolve them here. -Model selection does not grant execution, merge, deployment, external-message, account, permission, or destructive authority. Vendor defaults do not bypass readiness or answer material user decisions silently. +| PStack role | Apply | +| --- | --- | +| Planning or Poteto main agent | The running lead. New engineering leads are Fable. New other important leads are Opus. | +| Planning readiness reviewer | Fresh Astra | +| Feature, refactor, bug-fix, perf, hill-climb workers | Luna or Grok. Art is Astra. | +| How explorer, bounded Why collection | Luna | +| How explainer, Why synthesis, Architect, specs, tickets, diagnosis | The lead, or Sol when spawned | +| Interrogate and code-review | Sol. Add Muse Max when a panel is required. | +| Arena runners and Swarm workers | The actual assignment. Use only spawn slugs. Keep required lane count. | +| Comment Sicko | Sol Medium, `pstack-comment-sicko` | +| CLI/API live lane | Grok | +| Routine UI live lane | Sol | +| Art or exploratory play | Astra | +| Unnamed role | The lead classifies it. No new authority. | + +Judgment, tooling, investigator, synthesizer, and fast are labels, not models. Route the actual work. + +## Fallback + +1. Request the exact slug and effort. Record requested versus observed. +2. Luna unavailable or out of bounds: Grok. +3. Grok unavailable for implementation or CLI: Sol, and say so. +4. Sol unavailable for review: stop the review gate. Astra does not replace Sol. +5. Muse unavailable for a panel: Sol alone plus the workflow's reduced-panel rule. Do not substitute Grok. +6. Astra unavailable for readiness or art: stop that gate only. +7. Fable unavailable as lead: Opus if the bot is not critical, else Sol. +8. Opus unavailable as lead: Sol. +9. A missing spawn slug is a config problem, not a reason to pick Gemini. + +## Authority + +This policy is global. Repositories own standards, permissions, verification, and evidence. Model choice does not grant merge, deploy, message, or destructive authority. From d50e8fae46807996c2d40d01c7ddca0556c88f53 Mon Sep 17 00:00:00 2001 From: Camgineer Date: Mon, 14 Sep 2026 16:01:20 -0400 Subject: [PATCH 2/4] fix(cstack): send Comment Sicko to Luna and interrogate to Muse Max Comment hunting does not need Sol. Everyday review stays Sol. Adversarial review uses Muse Max. --- policy/models.md | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/policy/models.md b/policy/models.md index 38ee604..829c93a 100644 --- a/policy/models.md +++ b/policy/models.md @@ -27,7 +27,7 @@ If the live spawn tool's model list is not these five, stop and report. Do not u Create a new lead at Medium. Cameron may change parent effort. This policy does not fight that. | Lead | When | -| --- | --- | +| --- | --- | --- | | Fable Medium | Engineering and critical bots | | Opus Medium | Other important bots | | Sol | Only if the Anthropic lead route is down | @@ -38,13 +38,14 @@ This policy cannot switch an already-running parent. ## Workers -Right-size model, effort, and context for every spawn. Effort may be low through max. Muse's panel seat stays Max. +Right-size model, effort, and context for every spawn. Effort may be low through max. Muse's interrogate seat stays Max. | Work | Model | Starting effort | Boundary | | --- | --- | --- | --- | -| Default review, code-contract, security diff | Sol | Medium | Fresh worker. The implementer never grades itself. | +| Everyday review, code-contract, security diff | Sol | Medium | Fresh worker. The implementer never grades itself. | | Routine browser or native UI proof | Sol | Medium | Creative visual acceptance stays Astra. | -| Second reviewer for interrogate, arena, and other panels | Muse | Max | Spawn with Sol. Do not downshift Muse. Default review is still Sol alone. | +| Interrogate, arena, and adversarial code review | Muse | Max | Do not downshift Muse. Everyday review stays Sol. | +| Comment audit | Luna | Medium | Keep-list comment hunt. Do not spend Sol on this. | | Implementation and CLI/API proof | Grok | High | All non-art product code. Raise or lower with hardness. | | Bounded cheap implementation | Luna | High | Clear ticket, contained impact, obvious checks. Unclear or high-risk work is Grok. | | Bounded extraction and code exploration | Luna | Medium | Read-only. Synthesis stays with the lead or Sol. | @@ -57,7 +58,7 @@ Right-size model, effort, and context for every spawn. Effort may be low through Use `pstack-poteto-agent` for Poteto coding delegates. Still set an explicit worker model from the five. Do not let it inherit the lead. -Use `pstack-comment-sicko` for comment audits. It is pinned to Sol Medium. Do not change that pin. +Use `pstack-comment-sicko` for comment audits. Pin it to Luna Medium. Sol is wasted on comment hunting. `ocx-*` profiles pin a model and ignore `model`. Use an `ocx-*` profile only when it is one of Astra, Sol, Grok, Luna, or Muse. Do not use Gemini or Terra profiles. @@ -67,7 +68,7 @@ Pass only the context the worker needs. Do not fork the parent thread by default ## Independence -Sol reviews Fable-led and Opus-led work. Muse is a second reviewer, not the default. Grok never reviews its own diff. Fable and Opus never spawn. Astra readiness is a fresh agent. It does not rewrite the plan. +Sol does everyday review of Fable-led and Opus-led work. Muse Max does interrogate and adversarial review. Grok never reviews its own diff. Fable and Opus never spawn. Astra readiness is a fresh agent. It does not rewrite the plan. ## Implementation path @@ -76,7 +77,7 @@ Sol reviews Fable-led and Opus-led work. Muse is a second reviewer, not the defa 3. If Luna exceeds its boundary or leaves a real defect, keep valid work and hand it to Grok. 4. One focused Grok repair is allowed. If it still fails, Sol diagnoses. A fresh Grok worker implements the corrected contract. 5. A fresh Sol reviewer checks the ticket, the exact changes, defects, and proof. -6. For interrogate or a required panel, spawn Sol and Muse Max on the same artifact. +6. For interrogate or adversarial review, spawn Muse Max. Spawn Sol plus Muse Max only when the workflow requires two reviewers. 7. Return product, design, authority, and acceptance choices to Cameron. ## Proof @@ -93,15 +94,16 @@ Roles are not proof. Repository verification skills own commands, tools, and pas Vendor skills name Cursor slugs. Resolve them here. | PStack role | Apply | -| --- | --- | +| --- | --- | --- | | Planning or Poteto main agent | The running lead. New engineering leads are Fable. New other important leads are Opus. | | Planning readiness reviewer | Fresh Astra | | Feature, refactor, bug-fix, perf, hill-climb workers | Luna or Grok. Art is Astra. | | How explorer, bounded Why collection | Luna | | How explainer, Why synthesis, Architect, specs, tickets, diagnosis | The lead, or Sol when spawned | -| Interrogate and code-review | Sol. Add Muse Max when a panel is required. | +| Everyday code-review | Sol | +| Interrogate | Muse Max | | Arena runners and Swarm workers | The actual assignment. Use only spawn slugs. Keep required lane count. | -| Comment Sicko | Sol Medium, `pstack-comment-sicko` | +| Comment Sicko | Luna Medium, `pstack-comment-sicko` | | CLI/API live lane | Grok | | Routine UI live lane | Sol | | Art or exploratory play | Astra | @@ -115,7 +117,7 @@ Judgment, tooling, investigator, synthesizer, and fast are labels, not models. R 2. Luna unavailable or out of bounds: Grok. 3. Grok unavailable for implementation or CLI: Sol, and say so. 4. Sol unavailable for review: stop the review gate. Astra does not replace Sol. -5. Muse unavailable for a panel: Sol alone plus the workflow's reduced-panel rule. Do not substitute Grok. +5. Muse unavailable for interrogate: Sol, and say so. Do not substitute Grok. 6. Astra unavailable for readiness or art: stop that gate only. 7. Fable unavailable as lead: Opus if the bot is not critical, else Sol. 8. Opus unavailable as lead: Sol. @@ -124,3 +126,4 @@ Judgment, tooling, investigator, synthesizer, and fast are labels, not models. R ## Authority This policy is global. Repositories own standards, permissions, verification, and evidence. Model choice does not grant merge, deploy, message, or destructive authority. + From 97c6084f0a6f9d7d95f21d83693a822400056746 Mon Sep 17 00:00:00 2001 From: Camgineer Date: Mon, 14 Sep 2026 19:21:27 -0400 Subject: [PATCH 3/4] feat(cstack): add a local model overlay outside the plugin cache Plugin defaults stay in policy/models.md. /setup-pstack writes ~/.agents/cstack-models.md with only changed roles so upgrades do not wipe personal maps. --- README.md | 2 + hooks/scripts/poteto-mode-state.mjs | 6 +- policy/defaults.md | 2 +- policy/models.md | 22 ++++++++ skills/setup-pstack/SKILL.md | 85 +++++++++-------------------- tests/inventory.test.mjs | 4 ++ 6 files changed, 58 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index f4455c8..7b8a612 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,5 @@ Start a fresh task after install. To refresh later: codex plugin marketplace upgrade cstack codex plugin add cstack@cstack ``` + +To change models without forking the plugin, run `/setup-pstack`. It writes `~/.agents/cstack-models.md`. Plugin updates do not replace that file. diff --git a/hooks/scripts/poteto-mode-state.mjs b/hooks/scripts/poteto-mode-state.mjs index 4e3bd52..a9a1ec8 100644 --- a/hooks/scripts/poteto-mode-state.mjs +++ b/hooks/scripts/poteto-mode-state.mjs @@ -213,7 +213,7 @@ export async function handleHook(input, options = {}) { return { hookSpecificOutput: { hookEventName: "SessionStart", - additionalContext: "C-Stack remains active for this resumed or compacted session. Apply $cstack:poteto-mode, $cstack:simple-as-writing, policy/coding-standards.md, and policy/models.md. Do not infer authority beyond the user request.", + additionalContext: "C-Stack remains active for this resumed or compacted session. Apply $cstack:poteto-mode, $cstack:simple-as-writing, policy/coding-standards.md, and policy/models.md. Named roles in ~/.agents/cstack-models.md win when that file exists. Do not infer authority beyond the user request.", }, }; } @@ -245,7 +245,7 @@ export async function handleHook(input, options = {}) { return { hookSpecificOutput: { hookEventName: "UserPromptSubmit", - additionalContext: "C-Stack defaults are active. Apply $cstack:poteto-mode, $cstack:simple-as-writing, policy/coding-standards.md, and policy/models.md. Default activation does not expand user authority.", + additionalContext: "C-Stack defaults are active. Apply $cstack:poteto-mode, $cstack:simple-as-writing, policy/coding-standards.md, and policy/models.md. Named roles in ~/.agents/cstack-models.md win when that file exists. Default activation does not expand user authority.", }, }; } @@ -260,7 +260,7 @@ export async function handleHook(input, options = {}) { return { hookSpecificOutput: { hookEventName: "UserPromptSubmit", - additionalContext: "C-Stack is active for this session. Apply $cstack:poteto-mode, $cstack:simple-as-writing, policy/coding-standards.md, and policy/models.md. Do not infer authority beyond the user request.", + additionalContext: "C-Stack is active for this session. Apply $cstack:poteto-mode, $cstack:simple-as-writing, policy/coding-standards.md, and policy/models.md. Named roles in ~/.agents/cstack-models.md win when that file exists. Do not infer authority beyond the user request.", }, }; } diff --git a/policy/defaults.md b/policy/defaults.md index ab7cb21..608a089 100644 --- a/policy/defaults.md +++ b/policy/defaults.md @@ -4,6 +4,6 @@ Apply C-Stack for this session. - Writing: `skills/simple-as-writing/SKILL.md` - Coding standards: `policy/coding-standards.md` -- Model policy: `policy/models.md` +- Model policy: `policy/models.md`. Named roles in `~/.agents/cstack-models.md` win when that file exists. - Session mode: `skills/poteto-mode/SKILL.md` unless the user said `disable $poteto-mode` diff --git a/policy/models.md b/policy/models.md index 829c93a..863605c 100644 --- a/policy/models.md +++ b/policy/models.md @@ -4,6 +4,28 @@ Single source for model choices across PStack skills, playbooks, and modes. C-St This is instruction policy. It does not change Codex or OpenCodex config by itself. +## Overlay + +`policy/models.md` is the shipped default. It is replaced when the plugin updates. + +If `~/.agents/cstack-models.md` exists, named roles in that file replace the matching rows below. Missing roles keep this file. Run `$cstack:setup-pstack` to write or edit the overlay. Do not copy this file into the overlay. Do not edit the plugin cache. + +Spawn seats remain at most five distinct spawn slugs after overlay. Lead slugs are not spawn seats. + +| Overlay key | Policy row | +| --- | --- | +| engineering-lead | Fable engineering lead | +| other-lead | Opus other important lead | +| reviewer | Everyday Sol review | +| interrogate | Muse Max adversarial review | +| implementer | Grok implementation | +| cheap | Luna bounded implementation | +| extraction | Luna extraction | +| comment-audit | Luna comment audit | +| readiness | Astra readiness | +| art | Astra art and play | + + ## Identifiers Leads are not spawn seats. diff --git a/skills/setup-pstack/SKILL.md b/skills/setup-pstack/SKILL.md index ac91245..3f7ec88 100644 --- a/skills/setup-pstack/SKILL.md +++ b/skills/setup-pstack/SKILL.md @@ -1,74 +1,41 @@ --- name: setup-pstack -description: Configure which models pstack uses per role and at what reasoning budget. Detects your available models and writes an always-applied rule that overrides the skill defaults. Use for /setup-pstack, "configure pstack models", "pstack budget", or changing pstack's model choices. +description: Configure C-Stack model roles. Writes a local overlay that plugin updates do not replace. Use for /setup-pstack, configure pstack models, or changing C-Stack model choices. --- -# Setup pstack +# Setup C-Stack models -Write `~/.cursor/rules/pstack-models.mdc`, an always-applied rule that sets pstack's model per role. +Plugin defaults live in `policy/models.md`. They return on every plugin update. -## Steps - -### 1. Detect available models - -Enumerate the model slugs you can pass to a `Task` subagent in this session. That is the dependable source. If Cursor also exposes a models API or CLI that lists the user's entitled models, prefer it for completeness. If you cannot detect any, ask the user to paste the slugs they have access to. Never write a real slug you have not confirmed is available. The aliases `inherit-parent` and `auto` are always valid even though they are not detected slugs. - -### 2. Load current state - -The default role-to-model mapping is the rule shape shown in step 5 below. If `~/.cursor/rules/pstack-models.mdc` already exists, read it and treat its `# budget` line and its role values as the current choices. Otherwise start from those defaults. - -### 3. Budget, map, and confirm - -**(a) Ask for a budget.** Prefer AskQuestion over free text. Offer these four options with these exact labels, and name the current budget when the rule records one. - -- `unlimited — keep max` -- `large — xhigh reasoning` -- `medium — high reasoning` -- `small — medium reasoning` +Personal choices live in `~/.agents/cstack-models.md`. That file is outside the plugin cache. Named roles there replace the plugin default. Missing roles keep the default. Delete the file, or delete a line, to restore shipped defaults. -**(b) Apply it.** Build the working table from the skill defaults, and on a re-run keep any role you changed by family, list, or alias (`inherit-parent`, `auto`). `unlimited` leaves every effort as in that table. `large`, `medium`, and `small` set the effort token of every real slug, panel entries included, to `xhigh`, `high`, or `medium`. The effort token is the last token, or the one before a trailing `fast`, on the ladder `max` > `xhigh` > `high` > `medium` > `low`. If the result is not a detected slug, use the same family's detected slug with the highest effort at or below the target, else mark the role as needing a choice. `inherit-parent` and `auto` do not change. So `small` turns `claude-fable-5-1-thinking-max` into `claude-fable-5-1-thinking-medium`, and `grok-4.6-fast-xhigh` into `cursor-grok-4.6-medium-fast` when only that form is detected. +Never write model choices into the plugin cache or this repository. -**(c) Show the roles and confirm.** Show every role with its model, marking any real slug not in the detected set as needing a choice. Ask whether to accept as-is or change specific roles, offering the detected models plus `inherit-parent` and `auto` (both mean: this role runs on the parent chat model, which is how Auto users stay on Auto) as the options. Prefer AskQuestion over free text. For panel roles (arena runners, architect runners, interrogate reviewers) the value is a list, and one subagent runs per entry, alias entries included, so the list length sets the count. `arena cross-judge pool` is also a list, but Arena selects one value from it whose model family differs from the parent's when possible. `swarm workers` is the default model for every worker unless a race or comparison assigns another model per arm. - -### 4. Validate - -Every real slug written must be in the detected set. `inherit-parent` and `auto` always pass. If a chosen real slug is not available, stop and ask again. +## Steps -### 5. Write the rule +1. Read `policy/models.md`. +2. Read `~/.agents/cstack-models.md` if it exists. +3. Enumerate spawn-tool slugs in this session. Never write a spawn slug the live spawn tool cannot take. Lead-only slugs may use create_thread. +4. Show the resolved table: role, plugin default, overlay value, resolved value. +5. Ask which roles to change. Spawn seats stay at most five distinct spawn slugs. Leads are not spawn seats. +6. Write `~/.agents/cstack-models.md` with only the roles that differ from `policy/models.md`. Keep overlay roles the user did not change. +7. Tell the user the overlay path and that plugin updates will not touch it. -Write `~/.cursor/rules/pstack-models.mdc` with `alwaysApply: true`, a `# budget` line with the chosen label and its target effort, and one line per role, using the same labels poteto-mode uses. Overwrite the whole file so re-runs stay idempotent. Shape: +## Overlay shape ``` ---- -description: pstack per-role model choices (overrides skill defaults) -alwaysApply: true ---- -# pstack model configuration. One line per role. Delete a line to fall back to the skill default. -# `inherit-parent` or `auto` as a value: the role runs on the parent chat model (omit Task `model`). Alias entries in a panel list still count toward its fan-out. -# budget: unlimited (max) -feature, refactoring: grok-4.6-fast-xhigh -bug-fix: grok-4.6-fast-xhigh -perf-issue: grok-4.6-fast-xhigh -hillclimb: grok-4.6-fast-xhigh -judgment and prose: claude-fable-5-1-thinking-max -hardest tasks: claude-fable-5-1-thinking-max -how explorer: grok-4.6-fast-xhigh -how explainer: claude-fable-5-1-thinking-max -why investigators: grok-4.6-fast-xhigh -why synthesizer: claude-fable-5-1-thinking-max -reflect tooling: gpt-5.6-sol-max -reflect judgment, divergent, synthesizer: claude-fable-5-1-thinking-max -arena runners: claude-fable-5-1-thinking-max, gpt-5.6-sol-max, grok-4.6-fast-xhigh, claude-opus-5-thinking-xhigh -arena cross-judge pool: claude-fable-5-1-thinking-max, gpt-5.6-sol-max, grok-4.6-fast-xhigh, claude-opus-5-thinking-xhigh -swarm workers: grok-4.6-fast-xhigh -architect runners: claude-fable-5-1-thinking-max, gpt-5.6-sol-max, grok-4.6-fast-xhigh, claude-opus-5-thinking-xhigh -interrogate reviewers: claude-fable-5-1-thinking-max, gpt-5.6-sol-max, grok-4.6-fast-xhigh, claude-opus-5-thinking-xhigh +# C-Stack model overlay. Named roles replace policy/models.md. Delete a line to restore the plugin default. +engineering-lead: anthropic/claude-fable-5-1 medium +other-lead: anthropic/claude-opus-5 medium +reviewer: gpt-5.6-sol medium +interrogate: cursor/muse-spark-1.3 max +implementer: combo/grok-4.6 high +cheap: gpt-5.6-luna high +extraction: gpt-5.6-luna medium +comment-audit: gpt-5.6-luna medium +readiness: gpt-6-astra medium +art: gpt-6-astra medium ``` -### 6. Confirm - -Tell the user the rule was written and that it applies to new sessions. Re-running this skill updates it. - -### 7. Offer a verification skill (optional) +Valid role keys are exactly those names. -Check whether the project has a way to drive the real app for proof (a `verify-*` skill, or an existing harness). If not, offer once: "want a project-local verification skill, so agents can drive the app the way a user does and prove changes work? I can generate one with /create-verification-skill." On yes, invoke `/create-verification-skill` (resolves wherever pstack is installed: workspace, user, or plugin). On no, move on without pushing. diff --git a/tests/inventory.test.mjs b/tests/inventory.test.mjs index f61742f..4575447 100644 --- a/tests/inventory.test.mjs +++ b/tests/inventory.test.mjs @@ -51,4 +51,8 @@ test('pinned original sources remain present', async () => { await fs.access(path.join(root, 'policy/coding-standards.md')); await fs.access(path.join(root, 'policy/models.md')); await fs.access(path.join(root, 'policy/defaults.md')); + const models = await fs.readFile(path.join(root, 'policy/models.md'), 'utf8'); + const setup = await fs.readFile(path.join(root, 'skills/setup-pstack/SKILL.md'), 'utf8'); + assert.ok(models.includes('~/.agents/cstack-models.md')); + assert.ok(setup.includes('~/.agents/cstack-models.md')); }); From d6d54d2f9c3abcdad56eb4d75076a45120fbe513 Mon Sep 17 00:00:00 2001 From: Camgineer Date: Mon, 14 Sep 2026 19:43:28 -0400 Subject: [PATCH 4/4] refactor(cstack): rename shipped model policy to cstack-models.md Keep the plugin default and the local overlay on the same filename. Overlay stays at ~/.agents/cstack-models.md. --- hooks/scripts/poteto-mode-state.mjs | 6 +++--- policy/{models.md => cstack-models.md} | 2 +- policy/defaults.md | 2 +- skills/bot-design/SKILL.md | 2 +- skills/setup-pstack/SKILL.md | 8 ++++---- tests/inventory.test.mjs | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) rename policy/{models.md => cstack-models.md} (98%) diff --git a/hooks/scripts/poteto-mode-state.mjs b/hooks/scripts/poteto-mode-state.mjs index a9a1ec8..7ccdf53 100644 --- a/hooks/scripts/poteto-mode-state.mjs +++ b/hooks/scripts/poteto-mode-state.mjs @@ -213,7 +213,7 @@ export async function handleHook(input, options = {}) { return { hookSpecificOutput: { hookEventName: "SessionStart", - additionalContext: "C-Stack remains active for this resumed or compacted session. Apply $cstack:poteto-mode, $cstack:simple-as-writing, policy/coding-standards.md, and policy/models.md. Named roles in ~/.agents/cstack-models.md win when that file exists. Do not infer authority beyond the user request.", + additionalContext: "C-Stack remains active for this resumed or compacted session. Apply $cstack:poteto-mode, $cstack:simple-as-writing, policy/coding-standards.md, and policy/cstack-models.md. Named roles in ~/.agents/cstack-models.md win when that file exists. Do not infer authority beyond the user request.", }, }; } @@ -245,7 +245,7 @@ export async function handleHook(input, options = {}) { return { hookSpecificOutput: { hookEventName: "UserPromptSubmit", - additionalContext: "C-Stack defaults are active. Apply $cstack:poteto-mode, $cstack:simple-as-writing, policy/coding-standards.md, and policy/models.md. Named roles in ~/.agents/cstack-models.md win when that file exists. Default activation does not expand user authority.", + additionalContext: "C-Stack defaults are active. Apply $cstack:poteto-mode, $cstack:simple-as-writing, policy/coding-standards.md, and policy/cstack-models.md. Named roles in ~/.agents/cstack-models.md win when that file exists. Default activation does not expand user authority.", }, }; } @@ -260,7 +260,7 @@ export async function handleHook(input, options = {}) { return { hookSpecificOutput: { hookEventName: "UserPromptSubmit", - additionalContext: "C-Stack is active for this session. Apply $cstack:poteto-mode, $cstack:simple-as-writing, policy/coding-standards.md, and policy/models.md. Named roles in ~/.agents/cstack-models.md win when that file exists. Do not infer authority beyond the user request.", + additionalContext: "C-Stack is active for this session. Apply $cstack:poteto-mode, $cstack:simple-as-writing, policy/coding-standards.md, and policy/cstack-models.md. Named roles in ~/.agents/cstack-models.md win when that file exists. Do not infer authority beyond the user request.", }, }; } diff --git a/policy/models.md b/policy/cstack-models.md similarity index 98% rename from policy/models.md rename to policy/cstack-models.md index 863605c..dee602f 100644 --- a/policy/models.md +++ b/policy/cstack-models.md @@ -6,7 +6,7 @@ This is instruction policy. It does not change Codex or OpenCodex config by itse ## Overlay -`policy/models.md` is the shipped default. It is replaced when the plugin updates. +`policy/cstack-models.md` is the shipped default. It is replaced when the plugin updates. If `~/.agents/cstack-models.md` exists, named roles in that file replace the matching rows below. Missing roles keep this file. Run `$cstack:setup-pstack` to write or edit the overlay. Do not copy this file into the overlay. Do not edit the plugin cache. diff --git a/policy/defaults.md b/policy/defaults.md index 608a089..4eda946 100644 --- a/policy/defaults.md +++ b/policy/defaults.md @@ -4,6 +4,6 @@ Apply C-Stack for this session. - Writing: `skills/simple-as-writing/SKILL.md` - Coding standards: `policy/coding-standards.md` -- Model policy: `policy/models.md`. Named roles in `~/.agents/cstack-models.md` win when that file exists. +- Model policy: `policy/cstack-models.md`. Named roles in `~/.agents/cstack-models.md` win when that file exists. - Session mode: `skills/poteto-mode/SKILL.md` unless the user said `disable $poteto-mode` diff --git a/skills/bot-design/SKILL.md b/skills/bot-design/SKILL.md index a754f67..1e78d78 100644 --- a/skills/bot-design/SKILL.md +++ b/skills/bot-design/SKILL.md @@ -5,7 +5,7 @@ description: Design a persistent Codex bot. Missing Bot Factory, design a child # Design a bot -Read `references/operating-contract.md` before any write. Grill with `$cstack:grilling`. For a coding bot, also apply `$cstack:poteto-mode`. Read model choices from C-Stack `policy/models.md`. +Read `references/operating-contract.md` before any write. Grill with `$cstack:grilling`. For a coding bot, also apply `$cstack:poteto-mode`. Read model choices from C-Stack `policy/cstack-models.md`. ## Find Bot Factory diff --git a/skills/setup-pstack/SKILL.md b/skills/setup-pstack/SKILL.md index 3f7ec88..c6879c4 100644 --- a/skills/setup-pstack/SKILL.md +++ b/skills/setup-pstack/SKILL.md @@ -5,7 +5,7 @@ description: Configure C-Stack model roles. Writes a local overlay that plugin u # Setup C-Stack models -Plugin defaults live in `policy/models.md`. They return on every plugin update. +Plugin defaults live in `policy/cstack-models.md`. They return on every plugin update. Personal choices live in `~/.agents/cstack-models.md`. That file is outside the plugin cache. Named roles there replace the plugin default. Missing roles keep the default. Delete the file, or delete a line, to restore shipped defaults. @@ -13,18 +13,18 @@ Never write model choices into the plugin cache or this repository. ## Steps -1. Read `policy/models.md`. +1. Read `policy/cstack-models.md`. 2. Read `~/.agents/cstack-models.md` if it exists. 3. Enumerate spawn-tool slugs in this session. Never write a spawn slug the live spawn tool cannot take. Lead-only slugs may use create_thread. 4. Show the resolved table: role, plugin default, overlay value, resolved value. 5. Ask which roles to change. Spawn seats stay at most five distinct spawn slugs. Leads are not spawn seats. -6. Write `~/.agents/cstack-models.md` with only the roles that differ from `policy/models.md`. Keep overlay roles the user did not change. +6. Write `~/.agents/cstack-models.md` with only the roles that differ from `policy/cstack-models.md`. Keep overlay roles the user did not change. 7. Tell the user the overlay path and that plugin updates will not touch it. ## Overlay shape ``` -# C-Stack model overlay. Named roles replace policy/models.md. Delete a line to restore the plugin default. +# C-Stack model overlay. Named roles replace policy/cstack-models.md. Delete a line to restore the plugin default. engineering-lead: anthropic/claude-fable-5-1 medium other-lead: anthropic/claude-opus-5 medium reviewer: gpt-5.6-sol medium diff --git a/tests/inventory.test.mjs b/tests/inventory.test.mjs index 4575447..d22f4d8 100644 --- a/tests/inventory.test.mjs +++ b/tests/inventory.test.mjs @@ -49,9 +49,9 @@ test('pinned original sources remain present', async () => { await fs.access(path.join(root, 'vendor/cursor-team-kit/skills/deslop/SKILL.md')); await fs.access(path.join(root, 'vendor/mattpocock-skills/skills/productivity/grilling/SKILL.md')); await fs.access(path.join(root, 'policy/coding-standards.md')); - await fs.access(path.join(root, 'policy/models.md')); + await fs.access(path.join(root, 'policy/cstack-models.md')); await fs.access(path.join(root, 'policy/defaults.md')); - const models = await fs.readFile(path.join(root, 'policy/models.md'), 'utf8'); + const models = await fs.readFile(path.join(root, 'policy/cstack-models.md'), 'utf8'); const setup = await fs.readFile(path.join(root, 'skills/setup-pstack/SKILL.md'), 'utf8'); assert.ok(models.includes('~/.agents/cstack-models.md')); assert.ok(setup.includes('~/.agents/cstack-models.md'));