Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file modified launcher/banner.py
Binary file not shown.
17 changes: 12 additions & 5 deletions pilot/commands/spec-bugfix-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,20 +321,27 @@ Type: Bugfix
CODEX_COMPANION=$(ls ~/.claude/plugins/cache/openai-codex/codex/*/scripts/codex-companion.mjs 2>/dev/null | head -1)
```

2. Launch adversarial review:
2. Launch adversarial review with specific focus text:
```bash
node "$CODEX_COMPANION" adversarial-review --background --base main "Adversarial review of bugfix plan: <plan-path>"
node "$CODEX_COMPANION" adversarial-review --background --base main "Challenge this bugfix plan: <plan summary/root cause>. Plan: <plan-path>. Focus on: wrong root cause, incomplete fix, missing edge cases, regression risk, and whether the fix addresses symptoms vs cause."
```

3. Collect results:
3. Wait for completion:
```bash
node "$CODEX_COMPANION" status <jobId> --wait --timeout-ms 120000 --json
```

4. **Handle Codex result:**
4. **Handle status:**
- `waitTimedOut: true` → Log "Codex review timed out — skipping" and continue.
- `job.status` is `"cancelled"` or exit code non-zero → Log "Codex review failed: <failureMessage>" and continue.
- `job.status` is `"completed"` → Parse output. Map severities: critical/high → must_fix, medium/low → should_fix. Fix all must_fix/should_fix in the plan.
- `job.status` is `"completed"` → fetch full result:

5. Get review findings:
```bash
node "$CODEX_COMPANION" result <jobId> --json
```

6. Parse the result JSON — look for `verdict`, `findings`, `details`. Map severities: critical/high → must_fix, medium/low → should_fix. Fix all must_fix/should_fix in the plan.

---

Expand Down
20 changes: 14 additions & 6 deletions pilot/commands/spec-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,9 @@ Launch Codex review NOW — it runs in parallel with the Claude reviewer above.
CODEX_COMPANION=$(ls ~/.claude/plugins/cache/openai-codex/codex/*/scripts/codex-companion.mjs 2>/dev/null | head -1)
```

2. Launch adversarial review in background:
2. Launch adversarial review in background. Include the plan's goal/summary as focus text so Codex knows what to challenge:
```bash
node "$CODEX_COMPANION" adversarial-review --background --base main "Adversarial review of plan: <plan-path>"
node "$CODEX_COMPANION" adversarial-review --background --base main "Challenge this plan: <plan summary/goal>. Plan file: <plan-path>. Focus on: wrong assumptions, missing edge cases, scope gaps, and design choices that could fail under real-world conditions."
```
Capture the job ID from stdout. **Do NOT wait** — proceed to collect whichever reviewer finishes first.

Expand All @@ -451,14 +451,22 @@ Then Read the file once. If not READY after 5 min, re-launch synchronously.

**If Codex was launched above**, collect its results now:

1. Wait for completion:
```bash
node "$CODEX_COMPANION" status <jobId> --wait --timeout-ms 120000 --json
```

**Handle Codex result:**
- `waitTimedOut: true` → Codex timed out. Log "Codex review timed out — skipping" and continue without Codex findings.
- `job.status` is `"cancelled"` or exit code non-zero → Codex crashed/failed. Log "Codex review failed: <failureMessage>" and continue without Codex findings.
- `job.status` is `"completed"` → Parse output. Map severities: critical/high → must_fix, medium/low → should_fix. Fix all must_fix/should_fix.
2. **Handle status:**
- `waitTimedOut: true` → Log "Codex review timed out — skipping" and continue.
- `job.status` is `"cancelled"` or exit code non-zero → Log "Codex review failed: <failureMessage>" and continue.
- `job.status` is `"completed"` → fetch the full result:

3. Get review findings:
```bash
node "$CODEX_COMPANION" result <jobId> --json
```

4. Parse the result JSON — look for `verdict`, `findings`, `details`. Map severities: critical/high → must_fix, medium/low → should_fix. Fix all must_fix/should_fix.

**If Codex was NOT launched**, proceed after all Claude reviewer must_fix/should_fix resolved.

Expand Down
23 changes: 16 additions & 7 deletions pilot/commands/spec-verify.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,13 @@ Task(
run_in_background=true,
prompt="""
**Plan file:** <plan-path>
**User request:** <original task description that invoked /spec>
**Changed files:** [file list]
**Output path:** <absolute path to findings JSON>
**Runtime environment:** [how to start, port, deploy path]
**Test framework constraints:** [what it can/cannot test]

Review implementation: compliance (plan match), quality (security, bugs, tests, performance), goal (achievement, artifacts, wiring).
Review implementation: compliance (plan match + user request match), quality (security, bugs, tests, performance), goal (achievement, artifacts, wiring).
Performance: check for expensive uncached work on hot paths, heavy dependency imports with lighter alternatives, and repeated invocations that redo work when input hasn't changed.
Write findings JSON to output_path using Write tool.
IMPORTANT: Include the plan file path in your output JSON as the "plan_file" field.
Expand All @@ -145,9 +146,9 @@ Launch Codex review NOW — it runs in parallel with the Claude reviewer above.
CODEX_COMPANION=$(ls ~/.claude/plugins/cache/openai-codex/codex/*/scripts/codex-companion.mjs 2>/dev/null | head -1)
```

2. Launch adversarial review in background using `--scope working-tree` (reviews all uncommitted changes regardless of staging state — works in both worktree and non-worktree mode):
2. Launch adversarial review in background using `--scope working-tree` (reviews all uncommitted changes regardless of staging state — works in both worktree and non-worktree mode). Include the plan's goal as focus text:
```bash
node "$CODEX_COMPANION" adversarial-review --background --scope working-tree "Review changes against spec: <plan-path>"
node "$CODEX_COMPANION" adversarial-review --background --scope working-tree "Challenge this implementation: <plan summary/goal>. Plan: <plan-path>. Focus on: wrong approach, missing edge cases, security gaps, untested paths, and design choices that could fail under load."
```
Capture the job ID from stdout. **Do NOT wait** — proceed to Step 3.2 immediately.

Expand Down Expand Up @@ -207,14 +208,22 @@ For each fix: implement → run relevant tests → log "Fixed: [title]"

**If Codex was launched in Step 3.1**, collect its results now:

1. Wait for completion:
```bash
node "$CODEX_COMPANION" status <jobId> --wait --timeout-ms 120000 --json
```

**Handle Codex result:**
- `waitTimedOut: true` → Codex timed out. Log "Codex review timed out — skipping" and continue without Codex findings.
- `job.status` is `"cancelled"` or exit code non-zero → Codex crashed/failed. Log "Codex review failed: <failureMessage>" and continue without Codex findings.
- `job.status` is `"completed"` → Parse output. Map severities: critical/high → must_fix, medium/low → should_fix. Fix all must_fix/should_fix.
2. **Handle status:**
- `waitTimedOut: true` → Log "Codex review timed out — skipping" and continue.
- `job.status` is `"cancelled"` or exit code non-zero → Log "Codex review failed: <failureMessage>" and continue.
- `job.status` is `"completed"` → fetch the full result:

3. Get review findings:
```bash
node "$CODEX_COMPANION" result <jobId> --json
```

4. Parse the result JSON — look for `verdict`, `findings`, `details`. Map severities: critical/high → must_fix, medium/low → should_fix. Fix all must_fix/should_fix.

**Report:**
```
Expand Down
2 changes: 1 addition & 1 deletion pilot/scripts/mcp-server.cjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pilot/scripts/worker-service.cjs

Large diffs are not rendered by default.

Loading