[PR #1451] [MERGED] AGENTS.md and docs/architecture.md: a map of the code for agents #3530

Closed
opened 2026-11-03 04:10:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1451
Author: @ludovic111
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @ludovic111

Base: main ← Head: docs/agent-map


📝 Commits (2)

  • 2eb6992 AGENTS.md and docs/architecture.md: a map of the code for agents
  • 1960dc6 AGENTS.md: agents never add release-now

📊 Changes

4 files changed (+234 additions, -0 deletions)

View changed files

➕ AGENTS.md (+175 -0)
➕ CLAUDE.md (+1 -0)
📝 docs/README.md (+1 -0)
➕ docs/architecture.md (+57 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

Workstream 9, first half (review-plan.md §2 row 9): an in-repo map so agents find code without grepping the whole tree. Docs only.

  • AGENTS.md (175 lines; CLAUDE.md is a symlink to it):
    • the rules that bite: no Mojang files, data isolation for any game or launcher run, the agent markers, attribution;
    • each crate and what it owns;
    • build and test fast: pr_ready, parity.py --changed / --changed-files --list, lan_e2e, agent_control_e2e, how harnesses are built (script + Java oracle + probe or fixture), how many harnesses a change reruns (measured), and the macOS wasm-guest link caveat until #1446;
    • where each horizon-client subsystem lives, as file paths and function names;
    • how Game is organised, and the fields that say which mode runs (remote, lan, integrated, serving, dedicated);
    • as_guest and level swapping;
    • the two single-player paths (in-frame by default since #1428, and --server-thread), with commands to test both;
    • where vanilla's reference code is and how harnesses compare against it.
  • docs/architecture.md: feature → files → checks for the 40 areas changed most in the last 30 days. The areas come from git log --since=30.days --name-only (3461 commits), grouped and counted per area. Each harness name in it was checked against tools/test_*_parity.py, and each lan_e2e check against CHECKS.
  • docs/README.md: one line linking both.

Every path cited was checked to exist (script over both files). The function names were checked with grep.

The survey's scanner resolved every path from the repo root. In context, each one is right:

Path flagged Where Why it is correct
docs/agents.md docs/agent-control.md ../website/docs/agents.md, launcher/src/backend.rs website/docs/agents.md the file is website/docs/agents.md, and both references resolve to it
docs/nav.json website/README.md layout block, website/build.mjs comments relative to website/; website/docs/nav.json exists
docs/porting-from-fabric.md docs/research/java-mod-compat.md "To be written as … once API 0.2 lands" a planned page, named as such
tools/server.py docs/server.md, docs/java-packs.md "retired on 2026-10-19" history of the retired Fabric starter

AGENTS.md says that paths under website/ are relative to website/, so an agent won't misread them.

Measured gain: locating the code for 5 recent PRs

Method: without the map, the agent's first search is git grep -n -i <term> -- crates launcher on the task's key term. That output is what it reads before it can pick files. With the map, it reads the matching AGENTS.md / architecture.md rows, which name the files.

Task (PR) Code it changed Without map: first grep returns With map: rows → files to open
Metal GPU frame timer (#1397) gfx/timing.rs, gfx.rs timer|timestamp: 351 lines (32 kB), 67 files Rendering row → gfx.rs, gfx/timing.rs: 2 files
Explosions push minecarts (#1318) game/explosion.rs, game/minecarts.rs explo|minecart: 809 lines (82 kB), 117 files rows 27 + 40 → 2 files
Server's mob data reaches clients (#1421) game/remote_mob_data.rs, lan/entity.rs, entity_nbt.rs, game/lan.rs entity_data|EntityData: 141 lines (14 kB), 33 files Multiplayer client + LAN host rows → remote_*.rs, lan/entity.rs, lan/tracking.rs, game/lan.rs: ~5 files
/setworldspawn (#1410) game/commands.rs (+ guests' respawn in lan_actions.rs) setworldspawn: 13 lines, 7 files Commands row → game/commands.rs: 1 file (the grep was already precise; little gain)
Mount inventories for a server's players (#1325) game/mount_menu.rs, menu.rs, game/remote.rs, new game/lan_mount_menu.rs mount: 1476 lines (148 kB), 242 files Vehicles + Guests' actions + Containers rows → mount_menu.rs, menu.rs, remote.rs, lan_actions.rs, and the lan_<feature>.rs pattern for the new file: 4 files
Total 2790 lines (~277 kB, ~70k tokens), 466 candidate files ~14 files, plus reading AGENTS.md once per session (175 lines, 16.8 kB, ~4k tokens) and architecture.md if needed (57 lines, 9.5 kB)

In every case the map's rows named the file the PR changed. The exception is a file the PR created, where the map shows the sibling pattern instead. The "without" column is an upper bound: an agent narrows its search after the first grep. Even so, the first search alone returns about 16× the bytes of AGENTS.md (10× AGENTS.md plus architecture.md).

Self-check

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 1487a1bff, 15 s)

Check Result
Scope ✅ 4 files, +234 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt / clippy / tests ➖ no Rust change
Parity ➖ no harness affected
Label skip-release

Needs Ludovic

  • Nothing blocking. Once #1446 merges, drop the macOS caveat line in AGENTS.md "Build and test fast".
  • The second half of workstream 9 (splitting Game's fields and the 3k+ line files) waits for an empty PR queue, as the plan says.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1451 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `docs/agent-map` --- ### 📝 Commits (2) - [`2eb6992`](https://github.com/horizon-rust/horizon/commit/2eb699228a0064182aa9a8e8da4412c6cd1b6a4e) AGENTS.md and docs/architecture.md: a map of the code for agents - [`1960dc6`](https://github.com/horizon-rust/horizon/commit/1960dc6eb26600d32145eecece3d494ee4f9d019) AGENTS.md: agents never add release-now ### 📊 Changes **4 files changed** (+234 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `AGENTS.md` (+175 -0) ➕ `CLAUDE.md` (+1 -0) 📝 `docs/README.md` (+1 -0) ➕ `docs/architecture.md` (+57 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Workstream 9, first half (review-plan.md §2 row 9): an in-repo map so agents find code without grepping the whole tree. Docs only. - **`AGENTS.md`** (175 lines; `CLAUDE.md` is a symlink to it): - the rules that bite: no Mojang files, data isolation for any game or launcher run, the agent markers, attribution; - each crate and what it owns; - build and test fast: pr_ready, `parity.py --changed` / `--changed-files --list`, lan_e2e, agent_control_e2e, how harnesses are built (script + Java oracle + probe or fixture), how many harnesses a change reruns (measured), and the macOS wasm-guest link caveat until #1446; - where each horizon-client subsystem lives, as file paths and function names; - how `Game` is organised, and the fields that say which mode runs (`remote`, `lan`, `integrated`, `serving`, `dedicated`); - `as_guest` and level swapping; - the two single-player paths (in-frame by default since #1428, and `--server-thread`), with commands to test both; - where vanilla's reference code is and how harnesses compare against it. - **`docs/architecture.md`**: feature → files → checks for the 40 areas changed most in the last 30 days. The areas come from `git log --since=30.days --name-only` (3461 commits), grouped and counted per area. Each harness name in it was checked against `tools/test_*_parity.py`, and each lan_e2e check against `CHECKS`. - **`docs/README.md`**: one line linking both. Every path cited was checked to exist (script over both files). The function names were checked with grep. ## The 4 "dead links" from the survey: none are broken, so nothing changed The survey's scanner resolved every path from the repo root. In context, each one is right: | Path flagged | Where | Why it is correct | |---|---|---| | `docs/agents.md` | docs/agent-control.md `../website/docs/agents.md`, launcher/src/backend.rs `website/docs/agents.md` | the file is `website/docs/agents.md`, and both references resolve to it | | `docs/nav.json` | website/README.md layout block, website/build.mjs comments | relative to `website/`; `website/docs/nav.json` exists | | `docs/porting-from-fabric.md` | docs/research/java-mod-compat.md "To be written as … once API 0.2 lands" | a planned page, named as such | | `tools/server.py` | docs/server.md, docs/java-packs.md "retired on 2026-10-19" | history of the retired Fabric starter | AGENTS.md says that paths under `website/` are relative to `website/`, so an agent won't misread them. ## Measured gain: locating the code for 5 recent PRs Method: without the map, the agent's first search is `git grep -n -i <term> -- crates launcher` on the task's key term. That output is what it reads before it can pick files. With the map, it reads the matching AGENTS.md / architecture.md rows, which name the files. | Task (PR) | Code it changed | Without map: first grep returns | With map: rows → files to open | |---|---|---|---| | Metal GPU frame timer (#1397) | `gfx/timing.rs`, `gfx.rs` | `timer\|timestamp`: 351 lines (32 kB), 67 files | Rendering row → `gfx.rs`, `gfx/timing.rs`: **2 files** | | Explosions push minecarts (#1318) | `game/explosion.rs`, `game/minecarts.rs` | `explo\|minecart`: 809 lines (82 kB), 117 files | rows 27 + 40 → **2 files** | | Server's mob data reaches clients (#1421) | `game/remote_mob_data.rs`, `lan/entity.rs`, `entity_nbt.rs`, `game/lan.rs` | `entity_data\|EntityData`: 141 lines (14 kB), 33 files | Multiplayer client + LAN host rows → `remote_*.rs`, `lan/entity.rs`, `lan/tracking.rs`, `game/lan.rs`: **~5 files** | | `/setworldspawn` (#1410) | `game/commands.rs` (+ guests' respawn in `lan_actions.rs`) | `setworldspawn`: 13 lines, 7 files | Commands row → `game/commands.rs`: **1 file** (the grep was already precise; little gain) | | Mount inventories for a server's players (#1325) | `game/mount_menu.rs`, `menu.rs`, `game/remote.rs`, new `game/lan_mount_menu.rs` | `mount`: 1476 lines (148 kB), 242 files | Vehicles + Guests' actions + Containers rows → `mount_menu.rs`, `menu.rs`, `remote.rs`, `lan_actions.rs`, and the `lan_<feature>.rs` pattern for the new file: **4 files** | | **Total** | | **2790 lines (~277 kB, ~70k tokens), 466 candidate files** | **~14 files**, plus reading AGENTS.md once per session (175 lines, 16.8 kB, ~4k tokens) and architecture.md if needed (57 lines, 9.5 kB) | In every case the map's rows named the file the PR changed. The exception is a file the PR created, where the map shows the sibling pattern instead. The "without" column is an upper bound: an agent narrows its search after the first grep. Even so, the first search alone returns about 16× the bytes of AGENTS.md (10× AGENTS.md plus architecture.md). ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 1487a1bff, 15 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +234 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt / clippy / tests | ➖ no Rust change | | Parity | ➖ no harness affected | | Label | `skip-release` | ## Needs Ludovic - Nothing blocking. Once #1446 merges, drop the macOS caveat line in AGENTS.md "Build and test fast". - The second half of workstream 9 (splitting `Game`'s fields and the 3k+ line files) waits for an empty PR queue, as the plan says. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:10:13 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3530
No description provided.