Skip to content

docs(agent-guidance): document fresh-worktree prerequisites for full validation#861

Open
brandonpayton wants to merge 2 commits into
mainfrom
docs/full-validation-prereqs
Open

docs(agent-guidance): document fresh-worktree prerequisites for full validation#861
brandonpayton wants to merge 2 commits into
mainfrom
docs/full-validation-prereqs

Conversation

@brandonpayton

Copy link
Copy Markdown
Member

Why

A new git worktree (and a fresh checkout) does not inherit git submodules, a musl sysroot, node_modules, or fetched test binaries — so Vitest and the conformance/browser suites can't run until those are built or fetched. This was being treated as "cannot validate" rather than a one-time setup step.

What

Document the exact prerequisite sequence in docs/agent-guidance/validation.md (new "Preparing a fresh checkout or worktree" section) and docs/agent-guidance/build-docs-and-prs.md ("First build in a fresh checkout or worktree"):

  1. git submodule update --init --recursive (musl, libc-test, os-test) — with the stray-libc/musl recovery (rm -rf libc/musl && git submodule update --init libc/musl).
  2. scripts/build-musl.sh — sysroot (~20s).
  3. bash build.sh — kernel wasm → local-binaries/kernel.wasm + host + rootfs.vfs (~1.5min).
  4. npm ci (root — provides tsx for the conformance runners) and (cd host && npm ci).
  5. scripts/fetch-binaries.sh — prebuilt test binaries the source build doesn't produce (e.g. programs/wasm64/hello64.wasm).

Plus an explicit instruction: do not report "I can't run Vitest/conformance/browser" because a fresh worktree lacks artifacts — build/fetch them and report the real result, or name the exact step that failed.

Verified

Ran the sequence end-to-end in a fresh worktree: kernel wasm + sysroot + rootfs built; vitest ran (778 pass — the only failures were a missing fetched hello64.wasm); Sortix conformance ran 10/10. Each of these previously reported a not-found artifact until the corresponding step above was run.

🤖 Generated with Claude Code

brandonpayton and others added 2 commits July 9, 2026 01:51
…validation

A new git worktree (and a fresh checkout) does not inherit git submodules, a
musl sysroot, node_modules, or fetched test binaries, so Vitest and the
conformance/browser suites cannot run until those are built or fetched. Agents
were treating this as "cannot validate" rather than a setup step.

Document the exact sequence in validation.md and build-docs-and-prs.md:
submodule init (with the stray-libc/musl recovery), build-musl.sh (sysroot),
build.sh (kernel wasm → local-binaries/kernel.wasm + rootfs), root + host
`npm ci` (root provides tsx for the conformance runners), and
fetch-binaries.sh. Add the explicit instruction not to report "I can't run
Vitest/conformance/browser" because a fresh worktree lacks artifacts — build or
fetch them and report the real result, or name the exact step that failed.

Verified by running the sequence end-to-end in a fresh worktree: kernel wasm +
sysroot + rootfs build, `vitest` (778 pass; the only failures were a missing
fetched `programs/wasm64/hello64.wasm`), and Sortix conformance (10/10) all ran.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…uidance

Two additions learned from running the full suite in a fresh worktree:
- The wasm64 Vitest cases need an LP64 hello64.wasm that fetch-binaries.sh does
  not carry; build it with build-musl.sh --arch wasm64posix + build-programs.sh.
- A few package/demo tests (e.g. the Erlang ring benchmark) can fail for
  environment/artifact reasons unrelated to a diff. Reproduce on a pristine
  origin/main kernel-wasm build before attributing the failure to your change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant