mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-08 13:39:45 +08:00
fix: resolve codex exec -C repo root eagerly to prevent wrong-project reviews (v0.12.6.0) (#549)
* refactor: remove 6 dead resolver function copies from gen-skill-docs.ts
These functions were moved to scripts/resolvers/{review,design}.ts but the
old copies in gen-skill-docs.ts were never deleted. They are defined but
never called — the RESOLVERS map from resolvers/index.ts is the live
dispatch. The dead copies had already diverged from the live versions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: resolve codex exec -C repo root eagerly to prevent wrong-project reviews
When codex exec commands run in background bash tasks (e.g., Conductor
workspaces), $(git rev-parse --show-toplevel) evaluates in whatever cwd
the background shell inherits, which may be a different project. Fix by
resolving _REPO_ROOT once at the top of each bash block and referencing
the stored value in -C.
12 occurrences fixed across 4 source files:
- codex/SKILL.md.tmpl (3)
- autoplan/SKILL.md.tmpl (3)
- scripts/resolvers/review.ts (3)
- scripts/resolvers/design.ts (3)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test: regression guard for codex exec inline git rev-parse in -C flag
Scans all .tmpl and resolver .ts source files for codex exec commands
that use inline $(git rev-parse --show-toplevel) in the -C flag. This
pattern causes wrong-project reviews in Conductor workspaces. The test
ensures nobody reintroduces the old pattern.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore: bump version and changelog (v0.12.6.0)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: address adversarial review findings — codex review cwd, test scope, fail-loud
1. codex review commands now cd to $_REPO_ROOT (review doesn't support -C)
2. Autoplan codex commands converted from prose "Prerequisite" to fenced bash blocks
3. || pwd fallback replaced with hard fail — silent wrong-dir is worse than error
4. Regression test now scans all resolver .ts files + generated SKILL.md files
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test: harden regression test — Bun.Glob, SKILL.md scan, codex review check
Fixes three gaps found by adversarial review:
1. fs.readdirSync recursive hits ELOOP on .claude/skills/gstack symlink.
Switched to Bun.Glob with followSymlinks:false.
2. Generated SKILL.md files now scanned (not just .tmpl sources).
3. New test: codex review commands must not use inline git rev-parse
(codex review doesn't support -C, so cd "$_REPO_ROOT" is the fix).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -587,13 +587,16 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
|
||||
Run them simultaneously (Agent tool for subagent, Bash for Codex).
|
||||
|
||||
**Codex CEO voice** (via Bash):
|
||||
Command: `codex exec "You are a CEO/founder advisor reviewing a development plan.
|
||||
```bash
|
||||
_REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
|
||||
codex exec "You are a CEO/founder advisor reviewing a development plan.
|
||||
Challenge the strategic foundations: Are the premises valid or assumed? Is this the
|
||||
right problem to solve, or is there a reframing that would be 10x more impactful?
|
||||
What alternatives were dismissed too quickly? What competitive or market risks are
|
||||
unaddressed? What scope decisions will look foolish in 6 months? Be adversarial.
|
||||
No compliments. Just the strategic blind spots.
|
||||
File: <plan_path>" -C "$(git rev-parse --show-toplevel)" -s read-only --enable web_search_cached`
|
||||
File: <plan_path>" -C "$_REPO_ROOT" -s read-only --enable web_search_cached
|
||||
```
|
||||
Timeout: 10 minutes
|
||||
|
||||
**Claude CEO subagent** (via Agent tool):
|
||||
@@ -692,7 +695,9 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
|
||||
- Dual voices: always run BOTH Claude subagent AND Codex if available (P6).
|
||||
|
||||
**Codex design voice** (via Bash):
|
||||
Command: `codex exec "Read the plan file at <plan_path>. Evaluate this plan's
|
||||
```bash
|
||||
_REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
|
||||
codex exec "Read the plan file at <plan_path>. Evaluate this plan's
|
||||
UI/UX design decisions.
|
||||
|
||||
Also consider these findings from the CEO review phase:
|
||||
@@ -704,7 +709,8 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
|
||||
accessibility requirements (keyboard nav, contrast, touch targets) specified or
|
||||
aspirational? Does the plan describe specific UI decisions or generic patterns?
|
||||
What design decisions will haunt the implementer if left ambiguous?
|
||||
Be opinionated. No hedging." -C "$(git rev-parse --show-toplevel)" -s read-only --enable web_search_cached`
|
||||
Be opinionated. No hedging." -C "$_REPO_ROOT" -s read-only --enable web_search_cached
|
||||
```
|
||||
Timeout: 10 minutes
|
||||
|
||||
**Claude design subagent** (via Agent tool):
|
||||
@@ -762,14 +768,17 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
|
||||
- Dual voices: always run BOTH Claude subagent AND Codex if available (P6).
|
||||
|
||||
**Codex eng voice** (via Bash):
|
||||
Command: `codex exec "Review this plan for architectural issues, missing edge cases,
|
||||
```bash
|
||||
_REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
|
||||
codex exec "Review this plan for architectural issues, missing edge cases,
|
||||
and hidden complexity. Be adversarial.
|
||||
|
||||
Also consider these findings from prior review phases:
|
||||
CEO: <insert CEO consensus table summary — key concerns, DISAGREEs>
|
||||
Design: <insert Design consensus table summary, or 'skipped, no UI scope'>
|
||||
|
||||
File: <plan_path>" -C "$(git rev-parse --show-toplevel)" -s read-only --enable web_search_cached`
|
||||
File: <plan_path>" -C "$_REPO_ROOT" -s read-only --enable web_search_cached
|
||||
```
|
||||
Timeout: 10 minutes
|
||||
|
||||
**Claude eng subagent** (via Agent tool):
|
||||
|
||||
Reference in New Issue
Block a user