diff --git a/AGENTS.md b/AGENTS.md index 4ba75ba..8f5c18d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,7 +21,7 @@ implementing it one task at a time. ## Files you must never edit - `PLAN.md`, `docs/plans/`, `AGENTS.md` -- Anything a task told you to copy from `docs/plans/**/files/`: tests, testdata, `Makefile`, +- Anything a task told you to copy from `docs/plans/**/_files/`: tests, testdata, `Makefile`, scripts, `example.toml`, `cmd/fakeupstream`. If a copied test fails, your code is wrong. ## Code rules diff --git a/docs/plans/v0/01-module-gate-config.md b/docs/plans/v0/01-module-gate-config.md index a08ad55..49f4cba 100644 --- a/docs/plans/v0/01-module-gate-config.md +++ b/docs/plans/v0/01-module-gate-config.md @@ -103,10 +103,10 @@ Rules the tests check: ```sh git switch -c v0 mkdir -p scripts internal/config/testdata -cp docs/plans/v0/files/Makefile docs/plans/v0/files/go.sum . -cp docs/plans/v0/files/scripts/check-lines.sh scripts/ -cp docs/plans/v0/files/internal/config/config_test.go internal/config/ -cp docs/plans/v0/files/internal/config/testdata/*.toml internal/config/testdata/ +cp docs/plans/v0/_files/Makefile docs/plans/v0/_files/go.sum . +cp docs/plans/v0/_files/scripts/check-lines.sh scripts/ +cp docs/plans/v0/_files/internal/config/config_test.go internal/config/ +cp docs/plans/v0/_files/internal/config/testdata/*.toml internal/config/testdata/ ``` Read `Makefile` and `internal/config/config_test.go`. The test names every rule above. @@ -139,7 +139,7 @@ git commit ## Done when - `go test ./internal/config/` is `ok`; `make gate` prints `gate: ok`. -- `cmp internal/config/config_test.go docs/plans/v0/files/internal/config/config_test.go` prints nothing. +- `cmp internal/config/config_test.go docs/plans/v0/_files/internal/config/config_test.go` prints nothing. ## Stop and report if diff --git a/docs/plans/v0/02-health.md b/docs/plans/v0/02-health.md index 83f0b0d..5d49748 100644 --- a/docs/plans/v0/02-health.md +++ b/docs/plans/v0/02-health.md @@ -81,7 +81,7 @@ Rules the tests check: ```sh git switch v0 -cp docs/plans/v0/files/internal/health/health_test.go internal/health/ +cp docs/plans/v0/_files/internal/health/health_test.go internal/health/ ``` Read the test. `newFake` is the router stand-in; `TestFailureThenRecoveryNeedsTwoPolls` is rule 3 @@ -102,7 +102,7 @@ git commit ## Done when - `go test -race -count=1 ./internal/health/` is `ok`; `make gate` prints `gate: ok`. -- `cmp internal/health/health_test.go docs/plans/v0/files/internal/health/health_test.go` prints nothing. +- `cmp internal/health/health_test.go docs/plans/v0/_files/internal/health/health_test.go` prints nothing. ## Stop and report if diff --git a/docs/plans/v0/03-proxy.md b/docs/plans/v0/03-proxy.md index 2932b39..8ac725f 100644 --- a/docs/plans/v0/03-proxy.md +++ b/docs/plans/v0/03-proxy.md @@ -92,7 +92,7 @@ Rules the tests check, in the order `ServeHTTP` applies them. Every error answer ```sh git switch v0 -cp docs/plans/v0/files/internal/proxy/proxy_test.go internal/proxy/ +cp docs/plans/v0/_files/internal/proxy/proxy_test.go internal/proxy/ ``` Read the test. `fakeHealth` stands in for the table; `newUpstream` records what arrived. @@ -113,7 +113,7 @@ git commit ## Done when - `go test -race -count=1 ./internal/proxy/` is `ok`; `make gate` prints `gate: ok`. -- `cmp internal/proxy/proxy_test.go docs/plans/v0/files/internal/proxy/proxy_test.go` prints nothing. +- `cmp internal/proxy/proxy_test.go docs/plans/v0/_files/internal/proxy/proxy_test.go` prints nothing. ## Stop and report if diff --git a/docs/plans/v0/04-admin-main.md b/docs/plans/v0/04-admin-main.md index 69956c9..9ee00fa 100644 --- a/docs/plans/v0/04-admin-main.md +++ b/docs/plans/v0/04-admin-main.md @@ -82,9 +82,9 @@ not change it. ```sh git switch v0 mkdir -p cmd/fakeupstream cmd/crossbar internal/admin -cp docs/plans/v0/files/cmd/fakeupstream/main.go cmd/fakeupstream/ -cp docs/plans/v0/files/example.toml . -cp docs/plans/v0/files/internal/admin/admin_test.go internal/admin/ +cp docs/plans/v0/_files/cmd/fakeupstream/main.go cmd/fakeupstream/ +cp docs/plans/v0/_files/example.toml . +cp docs/plans/v0/_files/internal/admin/admin_test.go internal/admin/ ``` - [ ] **2. See the test fail.** `go test ./internal/admin/`. Expected: it does not compile. @@ -119,7 +119,7 @@ git commit - The admin test passes, the three-second run exits 0 with both log lines, the missing-config run exits 1, `make gate` prints `gate: ok`. -- `cmp cmd/fakeupstream/main.go docs/plans/v0/files/cmd/fakeupstream/main.go` and the same for +- `cmp cmd/fakeupstream/main.go docs/plans/v0/_files/cmd/fakeupstream/main.go` and the same for `example.toml` and `internal/admin/admin_test.go` print nothing. ## Stop and report if diff --git a/docs/plans/v0/05-smoke-readme-deploy.md b/docs/plans/v0/05-smoke-readme-deploy.md index 896e963..2f0deb7 100644 --- a/docs/plans/v0/05-smoke-readme-deploy.md +++ b/docs/plans/v0/05-smoke-readme-deploy.md @@ -32,7 +32,7 @@ spread over at least 600 ms, not in one burst; and crossbar wrote a request log ```sh git switch v0 mkdir -p tools deploy -cp docs/plans/v0/files/tools/smoke.sh tools/ +cp docs/plans/v0/_files/tools/smoke.sh tools/ make smoke ``` @@ -111,7 +111,7 @@ git commit ## Done when - `make smoke` prints `smoke: ok (…)`; `make gate` prints `gate: ok`; `README.md` has the seven - sections; `cmp tools/smoke.sh docs/plans/v0/files/tools/smoke.sh` prints nothing. + sections; `cmp tools/smoke.sh docs/plans/v0/_files/tools/smoke.sh` prints nothing. ## Stop and report if diff --git a/docs/plans/v0/README.md b/docs/plans/v0/README.md index 72e039a..73418dc 100644 --- a/docs/plans/v0/README.md +++ b/docs/plans/v0/README.md @@ -12,7 +12,7 @@ no `/slots`, no queueing. **Architecture:** four small packages under `internal/` — `config` (TOML + validation), `health` (poller + table), `proxy` (route → host → `httputil.ReverseProxy`), `admin` (read-only JSON) — and two binaries under `cmd/`: `crossbar` and the given `fakeupstream`. Behaviour is pinned by -the tests in `files/`, which were run against a private reference implementation at each task's +the tests in `_files/`, which were run against a private reference implementation at each task's end state; the reference is not in this repository and the implementer must not look for it. **Tech stack:** Go 1.26, standard library, `github.com/BurntSushi/toml` v1.6.0. Nothing else. @@ -53,10 +53,19 @@ stops at the first task that does not end with a commit, a clean tree and a `don 1. `git log --oneline master..v0`: five commits with the `Implemented-By` trailer. 2. Copied files are unchanged: - `for f in $(cd docs/plans/v0/files && find . -type f); do cmp "docs/plans/v0/files/$f" "$f"; done` + `for f in $(cd docs/plans/v0/_files && find . -type f); do cmp "docs/plans/v0/_files/$f" "$f"; done` 3. `git diff master..v0 --stat -- PLAN.md AGENTS.md docs/plans` is empty. 4. `make gate` and `make smoke` on straylight. 5. Read every source file against its task. Probe from outside with inputs the tests do not contain: a route with query strings and encoded characters, a host that hangs after headers, a 3 MB request body, `/_crossbar/hosts` while a poll is in flight, SIGTERM during a stream. 6. Write findings under "Reviews" in `docs/implementer-log.md`. + +## Changes during the run + +- 2026-09-25, task 01, first attempt: the given files lived under `docs/plans/v0/files/`, which + Go's `./...` pattern includes, so `go vet ./...` in the gate tried to build the tests of tasks + 02–04 against packages that did not exist yet. Ornith diagnosed this correctly and stopped + investigating instead of editing the Makefile. Fixed by moving the directory to `_files/` + (directories starting with `_` are ignored by the go tool); every task file updated. Task 01 + restarted from a clean tree. diff --git a/docs/plans/v0/files/Makefile b/docs/plans/v0/_files/Makefile similarity index 100% rename from docs/plans/v0/files/Makefile rename to docs/plans/v0/_files/Makefile diff --git a/docs/plans/v0/files/cmd/fakeupstream/main.go b/docs/plans/v0/_files/cmd/fakeupstream/main.go similarity index 100% rename from docs/plans/v0/files/cmd/fakeupstream/main.go rename to docs/plans/v0/_files/cmd/fakeupstream/main.go diff --git a/docs/plans/v0/files/example.toml b/docs/plans/v0/_files/example.toml similarity index 100% rename from docs/plans/v0/files/example.toml rename to docs/plans/v0/_files/example.toml diff --git a/docs/plans/v0/files/go.sum b/docs/plans/v0/_files/go.sum similarity index 100% rename from docs/plans/v0/files/go.sum rename to docs/plans/v0/_files/go.sum diff --git a/docs/plans/v0/files/internal/admin/admin_test.go b/docs/plans/v0/_files/internal/admin/admin_test.go similarity index 100% rename from docs/plans/v0/files/internal/admin/admin_test.go rename to docs/plans/v0/_files/internal/admin/admin_test.go diff --git a/docs/plans/v0/files/internal/config/config_test.go b/docs/plans/v0/_files/internal/config/config_test.go similarity index 100% rename from docs/plans/v0/files/internal/config/config_test.go rename to docs/plans/v0/_files/internal/config/config_test.go diff --git a/docs/plans/v0/files/internal/config/testdata/bad-default-model.toml b/docs/plans/v0/_files/internal/config/testdata/bad-default-model.toml similarity index 100% rename from docs/plans/v0/files/internal/config/testdata/bad-default-model.toml rename to docs/plans/v0/_files/internal/config/testdata/bad-default-model.toml diff --git a/docs/plans/v0/files/internal/config/testdata/bad-listen.toml b/docs/plans/v0/_files/internal/config/testdata/bad-listen.toml similarity index 100% rename from docs/plans/v0/files/internal/config/testdata/bad-listen.toml rename to docs/plans/v0/_files/internal/config/testdata/bad-listen.toml diff --git a/docs/plans/v0/files/internal/config/testdata/bad-unknown-host.toml b/docs/plans/v0/_files/internal/config/testdata/bad-unknown-host.toml similarity index 100% rename from docs/plans/v0/files/internal/config/testdata/bad-unknown-host.toml rename to docs/plans/v0/_files/internal/config/testdata/bad-unknown-host.toml diff --git a/docs/plans/v0/files/internal/config/testdata/bad-unknown-key.toml b/docs/plans/v0/_files/internal/config/testdata/bad-unknown-key.toml similarity index 100% rename from docs/plans/v0/files/internal/config/testdata/bad-unknown-key.toml rename to docs/plans/v0/_files/internal/config/testdata/bad-unknown-key.toml diff --git a/docs/plans/v0/files/internal/config/testdata/good.toml b/docs/plans/v0/_files/internal/config/testdata/good.toml similarity index 100% rename from docs/plans/v0/files/internal/config/testdata/good.toml rename to docs/plans/v0/_files/internal/config/testdata/good.toml diff --git a/docs/plans/v0/files/internal/health/health_test.go b/docs/plans/v0/_files/internal/health/health_test.go similarity index 100% rename from docs/plans/v0/files/internal/health/health_test.go rename to docs/plans/v0/_files/internal/health/health_test.go diff --git a/docs/plans/v0/files/internal/proxy/proxy_test.go b/docs/plans/v0/_files/internal/proxy/proxy_test.go similarity index 100% rename from docs/plans/v0/files/internal/proxy/proxy_test.go rename to docs/plans/v0/_files/internal/proxy/proxy_test.go diff --git a/docs/plans/v0/files/scripts/check-lines.sh b/docs/plans/v0/_files/scripts/check-lines.sh similarity index 100% rename from docs/plans/v0/files/scripts/check-lines.sh rename to docs/plans/v0/_files/scripts/check-lines.sh diff --git a/docs/plans/v0/files/tools/smoke.sh b/docs/plans/v0/_files/tools/smoke.sh similarity index 100% rename from docs/plans/v0/files/tools/smoke.sh rename to docs/plans/v0/_files/tools/smoke.sh