-
Notifications
You must be signed in to change notification settings - Fork 57
fix(pstack): support Codex setup and current CLI output #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
AojdevStudio
wants to merge
2
commits into
ericlitman:main
from
AojdevStudio:fix/codex-six-model-setup
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
46 changes: 46 additions & 0 deletions
46
plugins/pstack/skills/poteto-mode/scripts/runner/extension-contract.test.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import { expect, test } from "bun:test"; | ||
| import { readFileSync } from "node:fs"; | ||
| import { EFFORTS, PARENTS, PROVIDERS } from "./types.ts"; | ||
|
|
||
| const reference = readFileSync( | ||
| new URL("../../references/provider-dispatch.md", import.meta.url), | ||
| "utf8" | ||
| ); | ||
|
|
||
| test("the documented extension example supplies each lane's complete argv and receipt contract", () => { | ||
| const section = reference.split("## Optional dispatch extensions")[1].split("## Read-time normalization")[0]; | ||
| const example = JSON.parse(section.match(/```json\n([\s\S]*?)\n```/)![1]); | ||
| expect(example.schemaVersion).toBe(1); | ||
| expect(example.families).toHaveLength(1); | ||
| const family = example.families[0]; | ||
| expect(PROVIDERS).not.toContain(family.provider); | ||
| expect(family.receiptSchema).toBe("pstack-runner-v1"); | ||
| expect(new Set(family.selectableEfforts).size).toBe(family.selectableEfforts.length); | ||
| expect(family.selectableEfforts).toContain(family.defaultEffort); | ||
| for (const effort of family.selectableEfforts) expect(EFFORTS).toContain(effort); | ||
| expect(Object.keys(family.launcherArgv).sort()).toEqual([...PARENTS].sort()); | ||
| const values: Record<string, string> = { | ||
| parent: "codex", provider: family.provider, model: family.model, effort: "medium", | ||
| mode: "read-only", promptPath: "/tmp/prompt with spaces.md", cwd: "/tmp/work with spaces", | ||
| outputPath: "/tmp/output.txt", receiptPath: "/tmp/receipt.json", | ||
| }; | ||
| for (const parent of PARENTS) { | ||
| const argv: string[] = family.launcherArgv[parent]; | ||
| expect(argv[0].startsWith("/")).toBe(true); | ||
| const placeholders = argv.filter((arg) => arg.startsWith("{")); | ||
| expect(placeholders.sort()).toEqual(Object.keys(values).map((key) => `{${key}}`).sort()); | ||
| const substituted = argv.map((arg) => arg.startsWith("{") ? values[arg.slice(1, -1)] : arg); | ||
| expect(substituted[argv.indexOf("{promptPath}")]).toBe(values.promptPath); | ||
| expect(substituted[argv.indexOf("{cwd}")]).toBe(values.cwd); | ||
| expect(substituted).toHaveLength(argv.length); | ||
| } | ||
| }); | ||
|
|
||
| test("setup requires an independent provider before any probe or write", () => { | ||
| const setup = readFileSync(new URL("../../../setup-pstack/SKILL.md", import.meta.url), "utf8"); | ||
| const step2 = setup.split("### 2. Load current state")[1].split("### 3.")[0]; | ||
| expect(step2).toContain("at least two distinct providers"); | ||
| expect(step2).toContain("before probing or writing"); | ||
| expect(setup).not.toContain("Require at least one selected family"); | ||
| expect(setup.split("### 9. Behavioral smoke")[1]).toContain("independent cross-judge"); | ||
| }); |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.