Skip to content

Landscape sweep: the gateway lane home carries the host's Codex user instructions (AGENTS.md) - #418

Merged
seathatflowsinourveins merged 2 commits into
mainfrom
claude/sweep-lane-agents-md-20260927
Sep 27, 2026
Merged

seathatflowsinourveins merged 2 commits into
mainfrom
claude/sweep-lane-agents-md-20260927

Conversation

@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator

What

The landscape sweep's OmniRoute lane (build_args.py --gpt6-provider omniroute) runs Codex with CODEX_HOME set to a lane-local home. That home held only config.toml and the stack-worker profile.

Codex reads $CODEX_HOME/AGENTS.md as its global instructions. So the lane's GPT-6 never got the repository's top rule or RTK's instructions, while the native lane's workers get both from ~/.codex/AGENTS.md. This is one cause of the low RTK prefix rate measured on GPT-6 lanes (M6c).

Change

  • build_args.py: new codex_user_instructions() imports the checkout's tools/adoption/apply_codex_lane.py and returns its agents_block(), the same pattern render_codex_template already uses for render_config.
    • That block is the managed block of adoption/templates/codex.AGENTS.template.md: the top rule, rtk-ai/rtk v0.50.0's hooks/rtk-awareness-full.md verbatim, and the RTK exactness exceptions.
    • stage_lane_home writes it as codex-home/AGENTS.md and records its agents_sha256 in staged.json. There is no copy of the text in the harness.
  • Docs:

Verification

  • New test test_lane_home_carries_the_hosts_codex_user_instructions: the staged AGENTS.md equals the template bytes, and its sha256 is recorded. It fails before the change, because no AGENTS.md is written.
  • 10 covering modules: 719 run, OK. These include test_landscape_sweep_harness, test_codex_worker_lane, test_adoption_docs_consistency and test_render_config.
  • python3 scripts/validate.py: passed.

SOTA sources

  • rtk-ai/rtk v0.50.0 hooks/codex/README.md: RTK's Codex integration writes the awareness document to RTK.md, referenced from AGENTS.md. This repository inlines it, because Codex expands no @ reference (docs/decisions/2026-09-26-codex-worker-lane.md:29).
  • The host installer tools/adoption/apply_codex_lane.py (agents_block()) and its template adoption/templates/codex.AGENTS.template.md.
  • openai/codex rust-v0.157.1 codex-rs/codex-home/src/instructions/mod.rs:41-62: load_from_codex_home reads AGENTS.override.md, then AGENTS.md, from codex_home as the "global AGENTS.md instructions".

🤖 Generated with Claude Code

@seathatflowsinourveins seathatflowsinourveins added the lane:foundation Foundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers label Sep 27, 2026
seathatflowsinourveins pushed a commit that referenced this pull request Sep 27, 2026
… installer import

GPT-6 review of 2854514 (P3): importing tools/adoption/apply_codex_lane.py
runs its line 69, which prepends the repository root to sys.path, so
sys.path.pop(0) removed that root and left tools/adoption ahead of the
harness. codex_user_instructions() now snapshots and restores the full
sys.path. New test (installer unloaded first): red without the fix, green
with it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator Author

GPT-6 cross-family review of 2854514e: needs_changes (one P3). Repair round: 5d9276bf. (codex exec -p stack-worker -s read-only -m gpt-6-astra, reasoning effort max, with the Codex token-practice block)

Finding Fix
P3: importing tools/adoption/apply_codex_lane.py runs its line 69, which prepends the repository root, so sys.path.pop(0) removed that root and left tools/adoption ahead of the harness codex_user_instructions() snapshots and restores the whole sys.path. The new test test_reading_the_instructions_leaves_the_import_path_unchanged unloads the installer first: red without the fix, green with it.

The review found nothing else. Its requested checks passed: 172 tests (11 skipped) and scripts/validate.py. The red control failed on the missing AGENTS.md, as expected. The reviewer's own token-tool line reports context-mode, RTK, Serena, QMD and ai-memory used, and SocratiCode attempted.

After the repair: python3 -m unittest tests.test_landscape_sweep_harness tests.test_codex_worker_lane ran 173, OK. validate.py passed. The staged block's sha256 (7ce4fbc3…) equals the host's installed managed block. Bounded loop: no further review round; CI verifies the head.

🤖 Generated with Claude Code

Scout and others added 2 commits September 27, 2026 14:52
…instructions (AGENTS.md)

The OmniRoute lane (build_args.py --gpt6-provider omniroute) runs Codex with
CODEX_HOME set to a lane-local home holding only config.toml and the
stack-worker profile. Codex reads $CODEX_HOME/AGENTS.md as global
instructions, so the lane's GPT-6 got neither the repository's top rule nor
RTK's instructions, which the native lane's workers get from
~/.codex/AGENTS.md. That is one cause of the low RTK prefix rate measured on
GPT-6 lanes (M6c).

- build_args.py: codex_user_instructions() imports the checkout's
  tools/adoption/apply_codex_lane.py and returns agents_block(), the
  managed block of adoption/templates/codex.AGENTS.template.md (the top
  rule, rtk-ai/rtk v0.50.0 hooks/rtk-awareness-full.md verbatim, the RTK
  exactness exceptions). stage_lane_home writes it as codex-home/AGENTS.md
  and records agents_sha256 in staged.json. No copy of the text.
- tests: the staged AGENTS.md equals the template bytes and its sha256 is
  recorded; red before the change (no AGENTS.md).
- README (harness) lists the third file. recipes/README.md's OmniRoute
  "Workers" bullet no longer says the lane has no key filter (#393 added
  [shell_environment_policy.filters]) and names AGENTS.md.

Tests: 10 covering modules, 719 run, OK. validate.py passed.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… installer import

GPT-6 review of 2854514 (P3): importing tools/adoption/apply_codex_lane.py
runs its line 69, which prepends the repository root to sys.path, so
sys.path.pop(0) removed that root and left tools/adoption ahead of the
harness. codex_user_instructions() now snapshots and restores the full
sys.path. New test (installer unloaded first): red without the fix, green
with it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@seathatflowsinourveins
seathatflowsinourveins force-pushed the claude/sweep-lane-agents-md-20260927 branch from 5d9276b to bf3846a Compare September 27, 2026 18:53
@seathatflowsinourveins
seathatflowsinourveins merged commit a260a0f into main Sep 27, 2026
24 checks passed
@seathatflowsinourveins
seathatflowsinourveins deleted the claude/sweep-lane-agents-md-20260927 branch September 27, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane:foundation Foundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant