Skip to content

[codex] Add Lab local agent guidance support#660

Open
willccbb wants to merge 1 commit into
mainfrom
codex/lab-local-agent-guidance
Open

[codex] Add Lab local agent guidance support#660
willccbb wants to merge 1 commit into
mainfrom
codex/lab-local-agent-guidance

Conversation

@willccbb
Copy link
Copy Markdown
Member

@willccbb willccbb commented May 15, 2026

Summary

  • Treat root AGENTS.md, root CLAUDE.md, and environments/AGENTS.md as Prime-managed guidance refreshed by prime lab setup / prime lab sync.
  • Use Claude-native CLAUDE.local.md as the local write space when Claude is configured; preserve it and never overwrite it.
  • Add Lab git hygiene guardrails: ignore generated guidance, Claude local guidance, outputs, caches, and environment build artifacts.
  • Add prime lab doctor checks and --fix support to detect and untrack Lab generated/local guidance files that were already added to git.
  • Bump VERIFIERS_REF to the merged Verifiers guidance ref f43e42c1fabfe2604afc95b9ce62779a8f55d487.

Validation

  • uv run pytest packages/prime/tests/test_lab_setup.py -q
  • uv run pytest packages/prime/tests/test_lab_view.py::test_prime_lab_sync_service_refreshes_agent_assets -q
  • uv run ruff check packages/prime/src/prime_cli/lab_setup.py packages/prime/tests/test_lab_setup.py
  • uv run ruff format --check packages/prime/src/prime_cli/lab_setup.py packages/prime/tests/test_lab_setup.py
  • git diff --check -- packages/prime/src/prime_cli/lab_setup.py packages/prime/tests/test_lab_setup.py

Note

Medium Risk
Moderate risk because it changes prime lab setup/sync behavior (always refreshing guidance and mutating .gitignore) and adds a doctor --fix path that runs git rm --cached to alter repo state.

Overview
Lab workspaces now treat AGENTS.md, CLAUDE.md, and environments/AGENTS.md as Prime-managed guidance refreshed by prime lab setup/prime lab sync, while introducing a user-owned CLAUDE.local.md that is auto-created only when the claude agent is configured and is never overwritten.

The PR expands the default Lab .gitignore to cover these guidance files (plus other standard generated paths), ensures .gitignore is appended during sync, and updates prime lab doctor with a new check (and --fix support) to detect and automatically untrack previously-committed guidance files via git ls-files/git rm --cached. It also bumps the pinned VERIFIERS_REF used for fetching Lab assets.

Reviewed by Cursor Bugbot for commit b85d751. Bugbot is set up for automated code reviews on this repo. Configure here.

@willccbb willccbb marked this pull request as ready for review May 15, 2026 04:27
@willccbb willccbb force-pushed the codex/lab-local-agent-guidance branch from fa22043 to 63d3af8 Compare May 15, 2026 05:18
@willccbb willccbb marked this pull request as draft May 15, 2026 05:18
@willccbb willccbb marked this pull request as ready for review May 22, 2026 07:30
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@willccbb willccbb force-pushed the codex/lab-local-agent-guidance branch from 63d3af8 to b85d751 Compare May 22, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant