FactoryWager Wiki

FactoryWager harness index (JIT)

Hold the model fixed; improve context + tools. Upstream: lopopolo/harness-engineering (transform ideas into our owners — do not clone their tree). Prefer artifact over “codebase.”

When a decision is unresolved, read one owner below — do not load the full standards stack.

Markdown format does not change enforcement. Hard gates stay: lint (error + --max-warnings 0), tsconfig.check.json / brand types, proof journeys. Each invariant below names its ratchet.

Contract docs format (settled)

Orthogonal to gates: prose is a terminal-readable routing layer; evidence lives in tests / type-check / proof.ts.

When unresolved → read

Invariants (always enforced)

Upstream thesis → FactoryWager owner

Setup (hooks + CI)

bun install                 # prepare → husky
# pre-commit: hygiene ‖ harness → ast-grep
# pre-push:   install:verify --quiet
bun run ci:harness:fast     # quiet local parity (no hygiene)
bun run ci:harness          # quiet harness envelope
bun run ci:core             # install verify · hygiene · ci:harness (= GHA body)
# Actions offline (billing)? Local proof = required-check bodies:
#   bun run ci:core
#   bun run ts:verify && bun run imports:verify && bun run type-check:ci && bun run type-check:full

CI tiers

Required checks: Harness Gates + Type Check — see AUTHORITY.md. When Actions cannot start, local ci:core + type-check is the proof; GitHub status stays red until billing restores. Velocity / install-tax: VELOCITY_BASELINE.md. Pre-commit write tools fail if staged≠worktree (re-stage + retry).

Day loop (honest)

Full map: day-loop.md · curated Bun flags NOTE: ../guides/bun-test-flags-1.3.13.md.

bun run docs:harness            # this index → bun ./file.md (native ANSI, no VM)
bun run harness:status          # local ratchets + timings SSOT (ansiMarkdown)
#   bun run harness:status -- --table              # Bun.inspect family map + inspect.table
#   bun run harness:status -- --show-actions-noise # unmute GHA 0-step / billing checks
bun run help
bun run type-check              # tsconfig.check.json — spine agent surfaces
bun run build:affected          # git-true workspaces → bun --filter
bun run test:affected           # workspace package.json "test" scripts
bun run test:changed            # --changed (dirty)
bun run test:changed:main       # --main-head → origin/main|main
#   bun run test:changed -- HEAD~1
#   bun run test:changed -- main --parallel
#   bun run test:changed:watch
bun run test:isolate            # --isolate (fresh global per file)
bun run test:parallel           # --parallel (workers; auto --isolate)
#   SHARD=1/3 bun run test:shard
bun run ci:harness:fast         # before push (quiet)
bun run proof:install           # install only (also pre-push --quiet)
bun run check:path-bun && bun run check:bun-env
bun run projects:roots:check    # product-leaf README + package.json (also ∥ cheap / pre-commit on projects/)
bun run lib:domains:check       # lib/*/ README indexes (also ∥ cheap / pre-commit on lib/)
bun run build:defines           # AST --define BUILD_* + DEBUG=false (prod DCE); runtime config stays Bun.env
#   bun run build:defines:dev       # DEBUG=true
#   bun run build:defines:compile   # standalone dist/fw-build-info

test:affected = workspaces; test:changed = import-graph (bun-test-changed.ts). Empty set exits 0. Docs: v1.3.13 --isolate / --parallel · --shard · --changed.

Terminal markdown: static files via bun ./file.md; live CLIs via ansiMarkdown / Bun.markdown.ansi (docs/BUN_NATIVE_CAPABILITIES.md · markdown ANSI). Opt-in inspect family: bun run harness:status -- --table (Bun.inspect · custom · table). Actions 0-step / billing checks stay muted; --show-actions-noise to show. When Actions is offline, local merge proof remains bun run ci:core (AUTHORITY.md).

Local theses (FactoryWager)

  1. Parse once at the boundary into brands/structs.
  2. One concept → one owner (brands manifest, path-bun, cli-args, repo-docs).
  3. Repository teaches the agent — AGENTS routes; ratchets block regressions.
  4. Prove the claim — match evidence kind to the statement (PROOF.md).
  5. Finish migrations — no dual eras as prompt material.
  6. Feedback → infrastructure — lesson template promotes into type/lint/skill/doc-map.
  7. Attention budget — JIT this index; deep docs stay linked.
  8. Whole job + lanes — one trajectory owns closeout; disjoint files for parallel agents.

Discovery wave (platform + proof)

Parallel agent lanes for platform mapping — run from broad to narrow:

Wave Command / owner Output
0 bun run harness:status ratchet + claim inventory
1 bun run cloudflare:env · MCP cloudflare Pages API domain pins · deploy state
2 bun run verify:proof-taxonomy:save · bun run check:release-tracker 13 contracts · 20 consistency
3 bun run ops:snapshot · bun run verify:portal · verify:pages-edge live portal + Pages edge

Routing SSOT: docs/platform-routing.md · proof taxonomy: PROOF.md.

verify-all pipeline (ordered)

  1. defaults · networking · release · package-info
  2. install-env · registry-client · install-platform (dry-run)
  3. runtime-nits · bundler · doc-index · docs-coverage
  4. inline artifact sanity (bun-utils-test · install-platform · install-env · registry-client · bundler-loaders)
  5. channel-meta merge · proof-taxonomy audit · portal live · script-flag order

check:release-tracker

Tests + release verify: bun-release-tracker · bun-runtime-nits-probes · install-platform/env · verification-channels · canonical-coverage · proof-taxonomy (+ tool) · proof-consistency · release-preview · docs-coverage · resolve-bun-binary · bun tools/verify-bun-release.ts.