files changed

This commit is contained in:
Daniel Edrisian
2025-09-02 15:52:40 -07:00
parent a377542817
commit 31070c28aa
2 changed files with 10 additions and 67 deletions

View File

@@ -61,6 +61,13 @@ def get_diff_text(base_ref: str, head_ref: str) -> str:
return out
def get_changed_files_count(base_ref: str, head_ref: str) -> int:
code, out, _ = _run(["git", "diff", "--name-only", "--no-color", f"{base_ref}...{head_ref}"])
if code != 0:
return 0
return sum(1 for ln in out.splitlines() if ln.strip())
def study_files_in_dir(base: str) -> List[str]:
if not os.path.isdir(base):
return []
@@ -106,7 +113,7 @@ def run_codex_exec(prompt: str, last_message_file: Optional[str] = None) -> Tupl
"codex",
"--",
"-c",
"model_reasoning_effort=high",
"model_reasoning_effort=low",
"exec",
]
if last_message_file:
@@ -247,6 +254,7 @@ def main():
branch = get_current_branch()
base_ref = args.base or resolve_base_ref()
diff_text = get_diff_text(base_ref, "HEAD")
files_changed = get_changed_files_count(base_ref, "HEAD")
if not diff_text.strip():
print("Warning: empty diff vs base; all guides may be irrelevant or pass.", file=sys.stderr)
@@ -265,6 +273,7 @@ def main():
errors_all: List[Tuple[str, str]] = [] # (guide, error)
print(f"Running {total} review(s) against {branch} vs {base_ref}…")
print(f"Files changed: {files_changed}")
print(f"Study dir: {study_dir}")
print(f"Output dir: {out_dir}")
if args.limit is not None and args.limit < total_available:

View File

@@ -1,66 +0,0 @@
**DOs**
- **Set the default model to "codex-mini-latest"**: Update constants, docs, and tests to reflect the new default.
```rust
env_flags! {
pub OPENAI_DEFAULT_MODEL: &str = "codex-mini-latest";
pub OPENAI_API_BASE: &str = "https://api.openai.com/v1";
}
```
- **Update protocol/serialization tests to expect the new default**: Assert the serialized payload includes the correct model.
```rust
let serialized = serde_json::to_string(&event).unwrap();
assert!(serialized.contains("\"model\":\"codex-mini-latest\""));
```
- **Demonstrate overrides with non-default models**: Use models like "o3" or "o4-mini" in examples to show how to override the default.
```toml
# config.toml
model = "o3" # overrides default of "codex-mini-latest"
```
```bash
# CLI override (quoted or unquoted both fine)
codex -c model="o4-mini"
codex -c model=o4-mini
```
- **Keep example comments explicit about overrides**: Make it clear examples are overrides, not the default.
```rust
/// Optional override for the model name (e.g., "o3", "o4-mini")
pub model: Option<String>,
```
- **Document precedence with the updated default**: Ensure README and help text say the CLI defaults to "codex-mini-latest".
```md
4. the default value that comes with Codex CLI (i.e., Codex CLI defaults to `codex-mini-latest`)
```
**DONTs**
- **Dont use the default model in override examples**: Using the default as an “override” confuses readers.
```rust
// Wrong (uses the default as an example override)
/// Optional override for the model name (e.g., "codex-mini-latest")
```
- **Dont leave stale references to the old default**: Remove mentions that imply "o4-mini" is still the default.
```md
- 4. ... defaults to `o4-mini` # Wrong
+ 4. ... defaults to `codex-mini-latest`
```
- **Dont forget to align test fixtures and snapshots**: Any test expecting "o4-mini" as the model must be updated.
```rust
// Wrong
assert!(serialized.contains("\"model\":\"o4-mini\""));
// Correct
assert!(serialized.contains("\"model\":\"codex-mini-latest\""));
```
- **Dont “fix” override examples to mirror the new default**: Keep them as non-default models to clearly illustrate overriding behavior.
```bash
# Wrong: shows default as if it were an override
codex -c model=codex-mini-latest
# Correct: shows a true override
codex -c model=o4-mini
```