[codex] Add Lab local agent guidance support#660
Conversation
fa22043 to
63d3af8
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63d3af8ed6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| def _untrack_git_paths(workspace: Path, paths: tuple[str, ...]) -> None: | ||
| subprocess.run( | ||
| ["git", "rm", "--cached", "--quiet", "--", *paths], |
There was a problem hiding this comment.
Force untracking when doctor fix removes guidance files
_untrack_git_paths runs git rm --cached without -f, which fails when a guidance file has staged content that differs from both HEAD and the working tree (Git’s documented safety check for --cached). In that common “staged + further edited” state, prime lab doctor --fix will not untrack the file even though fix mode is requested, and the check remains WARN. Adding force (or a fallback strategy) is needed so --fix reliably untracks already-tracked Lab guidance files.
Useful? React with 👍 / 👎.
63d3af8 to
b85d751
Compare
Summary
AGENTS.md, rootCLAUDE.md, andenvironments/AGENTS.mdas Prime-managed guidance refreshed byprime lab setup/prime lab sync.CLAUDE.local.mdas the local write space when Claude is configured; preserve it and never overwrite it.prime lab doctorchecks and--fixsupport to detect and untrack Lab generated/local guidance files that were already added to git.VERIFIERS_REFto the merged Verifiers guidance reff43e42c1fabfe2604afc95b9ce62779a8f55d487.Validation
uv run pytest packages/prime/tests/test_lab_setup.py -quv run pytest packages/prime/tests/test_lab_view.py::test_prime_lab_sync_service_refreshes_agent_assets -quv run ruff check packages/prime/src/prime_cli/lab_setup.py packages/prime/tests/test_lab_setup.pyuv run ruff format --check packages/prime/src/prime_cli/lab_setup.py packages/prime/tests/test_lab_setup.pygit diff --check -- packages/prime/src/prime_cli/lab_setup.py packages/prime/tests/test_lab_setup.pyNote
Medium Risk
Moderate risk because it changes
prime lab setup/syncbehavior (always refreshing guidance and mutating.gitignore) and adds adoctor --fixpath that runsgit rm --cachedto alter repo state.Overview
Lab workspaces now treat
AGENTS.md,CLAUDE.md, andenvironments/AGENTS.mdas Prime-managed guidance refreshed byprime lab setup/prime lab sync, while introducing a user-ownedCLAUDE.local.mdthat is auto-created only when theclaudeagent is configured and is never overwritten.The PR expands the default Lab
.gitignoreto cover these guidance files (plus other standard generated paths), ensures.gitignoreis appended during sync, and updatesprime lab doctorwith a new check (and--fixsupport) to detect and automatically untrack previously-committed guidance files viagit ls-files/git rm --cached. It also bumps the pinnedVERIFIERS_REFused for fetching Lab assets.Reviewed by Cursor Bugbot for commit b85d751. Bugbot is set up for automated code reviews on this repo. Configure here.