ReviewOS

also looking at this

craft-native/craft

Brief agents on the environment a fresh checkout cannot infer

#319
Merged glennmichael123 wants to merge fix/agents-environment-briefing into main
4 files +126 -0
9 days ago

AGENTS.md was byte-identical to CLAUDE.md below its title. The one file a coding agent reads before running a command carried the house rules and none of the environment, so every fresh agent rediscovers the same preconditions.

Four separately diagnosed build failures came out of that in a single session, none of them code defects:

  1. An unpinned zig on PATH — the build refuses it, correctly.
  2. The three sibling first-party checkouts absent.
  3. That relative path resolved at the wrong depth, because it is four levels above packages/zig.
  4. Local clones drifted from pins.env, with those pins unreachable by git fetch because they are not branch tips — the action's own comment explains this, and nothing else did.

The briefing states those, plus three traps found the same way:

  • bun run test is the Zig suite; bun run test:sdk is the SDK one. A bare bun test at the root picks up vendored pantry/ fixtures and reports unrelated failures.
  • Zig collects tests only from files its lazy analysis reaches, and src/ios.zig is skipped off Darwin — so all of bridge_error.zig and every bridge_mobile_*.zig test is invisible to the Linux leg of zig-core. For iOS bridge work, read the macos leg.
  • A new scripts/*.test.ts does not run until ci.yml names it. This change wires its own test in for exactly that reason.

It also records that main is not branch-protected (so a red PR can be merged, and must not be), that release archives are built natively per runner rather than cross-compiled, and that bun audit fix is willing to downgrade a package below an advisory window and call it a fix.

Why a test

Documentation that drifts silently is how this happened. checkAgentsGuidelines fails when AGENTS.md repeats CLAUDE.md below its title, when a briefing topic goes missing, or when a rewrite drops a shared house rule — the last because the copy is where those rules came from, and the fix for the drift could otherwise throw them away.

Fail-first, run before writing the briefing: the check rejected the real AGENTS.md with "AGENTS.md repeats CLAUDE.md below its title". After the rewrite, 4 pass. Stashing AGENTS.md alone makes it fail again with the same message.

Local: bunx --bun pickier . 30 warnings / 0 errors (unchanged from main), bun run typecheck clean.

4 changed files on the files tab, with 0 review threads.

Sign in to comment on this pull request.