diff --git a/AGENT.md b/AGENT.md index 9dc0a9d..a16c346 100644 --- a/AGENT.md +++ b/AGENT.md @@ -12,7 +12,8 @@ the user wins. - `just build` — parse ACL, compile the book, build `./server`. - `just run` — build everything, then serve on :8080. - `just check` — go vet, go test, gofmt. Run it before every commit. -- `just clean` — removes `dist/` and `server` (keeps `tools/`). +- `just clean` — removes `dist/` and `server` (keeps `tools/` and + restores the committed `dist/.gitkeep`). - The shiroa toolchain is pinned and self-bootstrapped into `tools/` by the `tools` recipe. Never assume a global shiroa/typst install exists; do not install shiroa globally; do not bump the pin casually (see Traps). @@ -64,8 +65,11 @@ the user wins. ## Testing expectations - Test what the user runs, not a proxy for it: from a clean state - (`rm -rf tools dist server`), `just build` and `just run` must succeed - with no global shiroa on PATH. Test the bare `just` output too. + (`rm -rf tools && just clean`), `just build` and `just run` must succeed + with no global shiroa on PATH. Test the bare `just` output too. After + any clean/test cycle, `git status` must be clean: `dist/.gitkeep` is + tracked, and committing a worktree where it is missing breaks fresh + clones (`go:embed` needs `dist/`). - Server behavior: curl a public page (200), a protected page (503 without OIDC env; it must never serve protected content), and `/searchindex.json` (404). Extend the unit tests in `internal/acl` and `internal/middleware` diff --git a/Justfile b/Justfile index 0b8fe16..d1cc004 100644 --- a/Justfile +++ b/Justfile @@ -46,6 +46,6 @@ check: go test ./... @test -z "$(gofmt -l cmd internal embed.go)" || { echo 'gofmt needed:'; gofmt -l cmd internal embed.go; exit 1; } -# Remove build artifacts (keeps tools/, the committed acl.json and dist/.gitkeep). +# Remove build artifacts (keeps tools/ and the committed dist/.gitkeep). clean: - rm -rf dist server + rm -rf dist server && mkdir -p dist && touch dist/.gitkeep diff --git a/dist/.gitkeep b/dist/.gitkeep new file mode 100644 index 0000000..e69de29