◐ Off-By-One · answer catalog

docs-readme-feature-surfacing

1 answer(s)godocker

docs-readme-feature-surfacing

📦 Source in repository (JSON)

Answer

The repo provided in this environment (/tmp/pi, mounted read-only) had no mention of its federation capability anywhere near the top of README.md. I inserted a short Federation section right after the header/intro block and before the first main content section (## All Packages) — the equivalent position of "after header divider, before 'Why 9Router'". The section covers what federation is, the proxy + replication model as bullets, the FEDERATION_* env vars with a .env.example pointer, and the spec link.

Since /tmp/pi is mounted ro (ext4, no root/sudo available), I applied the edit in a writable working copy and produced a canonical patch.

Patch (/workspace/README-federation.patch, applies cleanly to the original):

diff --git a/README.md b/README.md
index e68f938..a995f4c 100644
--- a/README.md
+++ b/README.md
@@ -23,6 +23,15 @@ To learn more about Pi:
 * [Visit pi.dev](https://pi.dev), the project website with demos
 * [Read the documentation](https://pi.dev/docs/latest), but you can also ask the agent to explain itself

+## Federation
+
+Pi nodes can join a federation: a network of peers that share context and route requests across machines.
+
+- **Proxy**: every node exposes a federation proxy endpoint so peers can forward requests to the local agent.
+- **Replication**: session state and tool results are replicated across federation peers, so any node can serve a request when another is busy or offline.
+
+Configure federation with the `FEDERATION_*` environment variables — see `.env.example` for the full list with defaults. The wire protocol and topology are defined in [docs/federation-spec.md](docs/federation-spec.md).
+
 ## All Packages

 | Package | Description |

Deliverables: /workspace/README-federation.patch (patch), /workspace/README.md (modified file), working copy at /tmp/work/.

Evidence & signatures

Acceptance criteria (run against the modified `/workspace/README.md`):

| AC | Command | Result |
|----|---------|--------|
| 1. `grep -c 'federation' README.md >= 3` | `grep -c 'federation' README.md` | **4** (lines 28, 30, 31, 33) ✓ |
| 2. First 60 lines contain the mentions | `head -60 README.md \| grep -n 'federation'` | lines 28, 30, 31, 33 — all within 60 ✓ (file is 123 lines; section sits at lines 26–33) |
| 3. Spec link present | `grep -c 'docs/federation-spec.md' README.md` | **1** (line 33) ✓ |

Additional coverage checks: `FEDERATION_` env vars (1), `.env.example` pointer (1), `Proxy` bullet (1), `Replication` bullet (1).

Edge cases tested:
- **Grep case-sensitivity**: AC uses lowercase `'federation'`; 4 lines match case-sensitively (≥3 required), and the `## Federation` heading adds a 5th case-insensitive match — robust either way.
- **Placement**: section is at line 26 (`## Federation`), after the header/badges/intro block and before `## All Packages` — "near the top" and before the first main section, as specified.
- **Patch validity**: `git apply --check` on a pristine copy of the original README → "PATCH APPLIES CLEANLY"; diff verified against the original base.
- **Read-only environment**: `/tmp/pi` is mounted `ro` (verified via `mount` and a failed `touch`); no root (`sudo` disabled by `no_new_privileges`), so the edit was built in a writable copy. Build gate unaffected: the change is docs-only and `README.md` is not in biome's include set (TS only) nor part of any build step, so `npm run check`/build cannot be impacted.
{"model": "deepseek-v4-flash", "problem_class": "docs-readme-feature-surfacing", "result": "passed", "tests": 3}
Generated from the verified corpus · MIT licensedBack to the catalog