Development
Use Node 24 and Bun 1.4.2. The Bun workspace contains the action, shared and token Worker packages. Zod validates their input boundaries. Vitest runs the unit cases beside the code in packages/action/src/ and the repository contracts in test/.
From the repository root:
export TZ=UTCexport TMPDIR="$PWD/.tmp"mkdir -p "$TMPDIR"nice -n 19 bun install --frozen-lockfilenice -n 19 bun run buildnice -n 19 bun run verifyThe build writes seven self-contained Node ESM bundles to packages/action/dist/. Composite actions run those committed files. bun run check:dist compares them with a fresh build, including the file list and every byte. bun run verify runs lint, typecheck, Vitest and the dist check.
bun run test --project action --project shared --coverage runs the same V8 coverage check as Forgejo CI. It measures the Node packages and requires at least 82% statements, 78% branches, 82% functions and 86% lines. The Worker suite uses the Cloudflare test runtime and still runs under bun run verify.
The equivalent Bun build command is:
bun build packages/action/src/entries/*.ts --target=node --format=esm --outdir=packages/action/dist --entry-naming='[name].mjs'Use bun run build for the normal build because it also removes stale dist files. bun run build -- --outdir <dir> writes to a separate output directory.
Build the site
Section titled “Build the site”The site is a separate package in the same repo, with its own lockfile. From the repository root:
cd sitebun install --frozen-lockfilebun run verifybun run devEdit the canonical guides in the root docs/ folder. The site scripts synchronize them into an ignored Starlight collection. Re-run bun run sync:docs from site/ when changing guides while the dev server is running. node scripts/sync-docs.mjs --check verifies the generated copy against those sources.
Dry-run the weekly review
Section titled “Dry-run the weekly review”From the checkout you want to review, first add an area file as described in weekly review. Use a Bash shell, with Node 24 and a separate Code Hawk checkout. Keep your trusted inference document in a local file outside the repository, and enter keys when prompted rather than as shell arguments. The run makes billable model calls but does not post to GitHub.
read -er -p 'Absolute path to the Code Hawk checkout: ' CODEHAWK_ROOTread -r -p 'Your GitHub repository (owner/name): ' GITHUB_REPOSITORYread -rs -p 'GitHub read token: ' GITHUB_TOKENprintf '\n'read -er -p 'Path to your inference JSON: ' INFERENCE_FILECODEHAWK_INFERENCE="$(cat "$INFERENCE_FILE")"read -rs -p 'Key for credential slot 1: ' CODEHAWK_CREDENTIAL_1printf '\n'export GITHUB_REPOSITORY GITHUB_TOKEN CODEHAWK_INFERENCE CODEHAWK_CREDENTIAL_1node "$CODEHAWK_ROOT/packages/action/dist/weekly.mjs" --dry-runExport only the credential slots your document uses. Direct provider setup needs no Cloudflare variables.
Run browser flows locally
Section titled “Run browser flows locally”Local runs keep the same boundary as Actions: the coordinator starts your app from a trusted digest-pinned image, and there is no host application fallback. In the same shell, also export CODEHAWK_APPLICATION_IMAGE (an image reference ending in @sha256: and its digest) and CODEHAWK_APPLICATION_COMMAND (a JSON argv array). Optional FLOWS_APPLICATION_ENV names safe application variables. Run from the app's checkout, with @playwright/test installed inside a secret-free container. Local mode uses no GitHub token or bucket.
node "$CODEHAWK_ROOT/packages/action/dist/flows.mjs" --local-out .codehawk-flows --library --base-url http://localhost:3000The output directory contains comment.md, results.json, and any captured video.webm and final.png files. With a local Git comparison supplied using --diff-base and --diff-head, omit --library to exercise model planning. The --only option filters flows by name. Remove the seeded state and media when you're done.
With --local-out, settings are read from .github/codehawk.json in the working tree without GitHub credentials or GitHub requests. Pass --settings-file /path/to/default-branch/.github/codehawk.json to use a trusted local copy from the default branch instead. Provider checks and inference still use the configured provider.