FactoryWager Wiki

Proof contracts

Match evidence to the claim. Green pre-commit alone does not prove a journey or deployed health.

New claim? → fill out CLAIM-DISCOVERY.md first (bun run docs:claim-discovery).

Upstream: harness-engineering proof thesis.

Markdown here is only a pointer. Enforcement is lint (error), tsconfig.check.json / brand types, and the ratchets named under each artefact.

Claim kinds

Named critical paths

Gate class

How each claim is enforced day-to-day. SSOT: ProofPath.gateClass + gateRef in lib/harness/proof.ts. Catalog meta (completeness · evidence⊇freshRerun · freshRerunKind) always applies. Classes:

id class gate / workflow
branded-ids continuous pre-commit brands staged‖smart; ci:harness smart; types when branded staged or --full
install-verify continuous ci:core · harness-gates
install-verify-journey human-only bun run test:install-verify
test-changed continuous ci:harness · harness-gates
search-governance workflow search-governance.yml · search:bench:gate
search-governance-basic workflow search-governance.yml · test:search-governance
runtime-cli-boundaries continuous ci:harness boundary-fixtures · bun test tests/fixtures/runtime-cli/
bun-shell-boundaries continuous ci:harness boundary-fixtures · bun test tests/fixtures/bun-shell/
fs-native-boundaries continuous ci:harness boundary-fixtures · fs-bun + bun-glob-scan
image-metadata-boundaries human-only bun test ./tests/image-metadata.test.ts
deep-equals-boundaries human-only bun test ./tests/deep-equals.test.ts
peek-settle-boundaries human-only bun test ./tests/peek-settle.test.ts
bun-time-boundaries human-only bun test ./tests/time.test.ts
cloudflare-pages-env-ssot human-only bun test tests/r2-env.test.ts
terminal-pty-boundaries human-only bun test ./tests/terminal.test.ts
console-depth-boundaries human-only bun test tests/console-depth.test.ts
github-repository-ref-boundaries human-only bun test tests/github-repository-ref.test.ts
macros-embed-boundaries human-only bun test tests/macros/embed-commit.test.ts
security-hash-boundaries continuous ci:harness boundary-fixtures · bun test tests/fixtures/security-hash/
url-pattern-boundaries continuous ci:harness boundary-fixtures · bun test tests/bun-site-url.test.ts
social-metadata-boundaries continuous ci:harness boundary-fixtures · bun test tests/fixtures/social-metadata/
blog-extraction-boundaries continuous ci:harness boundary-fixtures · bun test tests/fixtures/blog-extraction/
fetch-page-boundaries continuous ci:harness boundary-fixtures · bun test tests/fixtures/fetch-page/
factory-registry-cli-v1 human-only bun test tests/registry.test.ts tests/cli.test.ts
factory-registry-pages-proxy-v1 human-only bun test tests/registry-pages-function.test.ts
factory-registry-integrity-v1 human-only bun test tests/factory-production.test.ts
blog-codeblocks-boundaries continuous ci:harness · bun test tests/bun-blog-codeblocks.test.ts tests/blog-codeblock-join.test.ts
blog-codeblocks-journey human-only bun test tests/journey/blog-codeblocks-journey.test.ts
multi-tenant-portal-v1 human-only bun test tests/registry-pages-function.test.ts
accounts-r2-v1 human-only bun test tests/accounts-r2.test.ts
operations-ssot-v1 human-only operations Phase 1–3 unit suites
telegram-webhook-v1 human-only bun test tests/telegram-bot.test.ts
ops-loop-throughput human-only bun test tests/ops-loop-hardening.test.ts
ops-snapshot-cron-v1 human-only bun test tests/ops-snapshot-cron.test.ts
channel-meta-verification-v1 continuous ci:harness channel-meta step · also check:release-tracker
blog-extraction-journey human-only bun test tests/journey/blog-extraction.test.ts
bun-http-server-docs continuous ci:harness boundary-fixtures · bun test tests/bun-docs-catalog.test.ts
path-bun continuous pre-commit (lib|tools staged) · ci:harness
bun-env continuous pre-commit (lib|scripts staged) · ci:harness · eslint prefer-bun-env
invisible-chars continuous pre-commit (spine/test .ts staged) · ci:harness
unknown-param continuous pre-commit / ci:harness eslint
day-loop-typecheck workflow typescript-checks.yml · type-check (required check)
lib-docs-typecheck workflow typescript-checks.yml · type-check (required check)
lib-utils-typecheck workflow typescript-checks.yml · type-check (required check)
lib-core-typecheck workflow typescript-checks.yml · type-check (required check)
lib-security-typecheck workflow typescript-checks.yml · type-check (required check)
bun-cron human-only bun run test:cron
cron-os-persistent human-only bun run test:cron-os
docs-integrity human-only bun-doc-refs schedule --once · spine tenant
audit-findings-catalog continuous pre-commit (audit SSOT staged) · ci:harness · bun run audit:verify
spine-multi-tenant human-only spine:schedule:once -- --tenant=install-verify
spine-maintenance-runbooks human-only bun run test:tenant-runbooks (live tenant freshReruns; heavy)
spine-tenant-heal human-only bun run test:tenant-heal
harness-coverage-ratchet continuous ci:harness dual-catalog · test:code-quality
harness-orphan-modules continuous ci:harness dual-catalog · test:code-quality
harness-complexity-floor continuous pre-commit staged lib/harness; also test:code-quality in ci:harness
code-quality-tenants continuous ci:harness dual-catalog · bun run test:code-quality
ci-deploy-runbooks continuous ci:harness dual-catalog · bun run test:ci-deploy
ci-core-envelope continuous live gate ci:core; freshRerun = catalog docs:ci-deploy
typescript-ci-gate workflow typescript-checks.yml (required); freshRerun = catalog
deploy-production-preflight human-only catalog via docs:ci-deploy; behavior = deploy:production
deploy-staging-script human-only catalog via docs:ci-deploy; behavior = deploy:staging
bun-migrate-status human-only catalog via docs:ci-deploy; behavior = migrate:status

Counts (must match gateClass tallies):

continuous 25 · workflow 8 · human-only 29.

Discover (display only, not gates): bun run harness:status · bun run docs:fresh-rerun.

Lib surface — docs vs Bun vs other external

Routing for lib/ modules. Bun docs = oven-sh / bun.com. Other external = non-Bun (pinned types, thesis, Actions wire, etc.). Repo docs stay in-tree.

Claim-backed

Module / claim Repo docs Bun docs Other external
branded-ids · lib/types/branded* lib/types/branded/README.md · skill .agents/skills/branded-ids/ domain-modeling · parse, don’t validate
bun-time-boundaries · lib/time.ts claim in this file · tests/time.test.ts utils (nanoseconds, sleep, randomUUIDv7, version)
deep-equals-boundaries · lib/deep-equals.ts claim · tests/deep-equals.test.ts Bun.deepEquals
peek-settle-boundaries · lib/peek-settle.ts claim · tests/peek-settle.test.ts Bun.peek
terminal-pty-boundaries · lib/terminal.ts claim · tests/terminal.test.ts Bun.Terminal / PTY
console-depth-boundaries · lib/console-depth.ts AGENTS.md · BUN_NATIVE_CAPABILITIES.md · tests/console-depth.test.ts · bench tools/benchmarks/console-depth-perf.ts runtime/console · utils (inspect · stringWidth) · markdown.ansi · color · sliceAnsi bun-types pin
github-repository-ref-boundaries · lib/github-repository-ref.ts AGENTS.md · AUTHORITY.md · lib/docs/repo-docs.ts Bun.env · spawnSync GitHub Actions GITHUB_REPOSITORY*
macros-embed-boundaries · lib/macros/ lib/macros/README.md · AUTHORITY.md · tests/macros/embed-commit.test.ts bundler · macros · serializability · plugins (unused)
image-metadata-boundaries · lib/image-metadata.ts claim · lib/screenshot-remediation.ts · tests/image-metadata.test.ts Bun.Image
url-pattern-boundaries · lib/docs/bun-site-url.ts claim · tests/bun-site-url.test.ts URLPattern
social-metadata-boundaries · lib/docs/extract-metadata.ts claim · tests/fixtures/social-metadata/ HTMLRewriter social meta · HTMLRewriter
blog-extraction-boundaries · lib/docs/blog-extract.ts claim · tests/fixtures/blog-extraction/ HTMLRewriter
fetch-page-boundaries · lib/docs/fetch-page.ts claim · tests/fixtures/fetch-page/ fetch Bun issue oven-sh/bun#21633 (fetch.preconnect deferred)
path-bun · lib/path-bun.ts claim · bun run check:path-bun Bun path helpers (via lib/path-bun + bun-doc-refs)
bun-env claim · bun run check:bun-env Bun.env · environment variables
cloudflare-pages-env-ssot · config/r2-env.ts tenants/cloudflare-pages.md · .env.example · public/index.html Cloudflare Pages / Wrangler (dashboard + API; not Bun)
harness ratchets (coverage · orphans · complexity) lib/harness/README.md · code-quality.md harness-engineering
type-check islands · lib/{docs,utils,core,security} claims lib-*-typecheck · tsconfig.check.json
audit-findings-catalog · lib/audit/ docs/audit/README.md
factory-registry-cli-v1 · lib/factory/ claim this file · tests/registry.test.ts · tests/cli.test.ts · object-store.ts · markdown.ts S3Client · Bun.semver · Bun.file · Bun.write · Bun.CryptoHasher · Bun.env · Bun.markdown · Bun.TOML · Bun.inspect.table · Bun.spawn Cloudflare R2 (S3 SigV4)
factory-registry-pages-proxy-v1 · functions/api/registry/ claim this file · tests/registry-pages-function.test.ts · public/portal/ · public/registry/registry.json Pages Functions · R2 bindingsno Bun.* on edge Cloudflare Pages + R2 binding
factory-registry-integrity-v1 · lib/factory/{health,integrity,monitoring,alerts,server}.ts tenants/registry-integrity.md · tests/factory-production.test.ts Bun.cron · Bun.CryptoHasher · Bun.serve Cloudflare Pages + R2 binding · Slack · Telegram

Inventory-only (no dedicated claim yet)

Module Repo docs Bun docs Other external
lib/gate-map.ts · lib/gate-report-monorepo.ts file headers · .agents/skills/ast-grep/gate-map.json Bun.env · Bun.file · Bun.spawn kimi-toolchain JSON summary (optional gate step)
lib/projects-scan.ts file header · bun run registry:projects consumers Glob · Bun.file · spawnSync · Bun.which · Bun.peek
lib/text.ts slugify helpers (Mintlify/GitHub-style) Bun.stringWidth (related width work lives in console-depth)
lib/index.ts barrel re-exports
lib/mcp/ · lib/r2/ · lib/rss/ · lib/package/ · lib/ai/ · lib/theme/ · lib/performance/ · lib/shared/ · lib/constants/ domain README.md indexes · bun run lib:domains:check varies per module @see product/Cloudflare/R2 as applicable

Resolve Bun URLs via bun tools/bun-doc-refs.ts suggest "<api>" before inventing new @see lines.

Fresh-rerun

Every path above has a freshRerun command in lib/harness/proof.ts. RatchetFRESH-RERUN.md · paste command output in the PR body when touching the claim’s owner.

New claim → discovery first

Do not invent a ProofPath by editing files ad hoc. Fill CLAIM-DISCOVERY.md (Q0–Q14) so ceremony path (slim vs full), claim / kinds / gateClass / gateRef / evidence / freshRerun / freshRerunKind, contract asserts, and PR paste are decided before code. Ratchetbun run docs:claim-discovery · answered questionnaire in the PR or commit trail

Verification lane taxonomy (Bun product pillars)

Each proof row carries subsystem (orthogonal to release channel in semanticTags). SSOT: lib/verification/types.ts · lib/verification/subsystem.ts · tools/canonical-helpers.ts.

Subsystem Script Lib module Proof JSON Canonical source
runtime tools/verify-bun-release.ts lib/docs/bun-release-tracker.ts public/registry/release-features.json Blog anchors + living runtime docs
runtime tools/verify-bun-runtime-nits.ts lib/verification/bun-runtime-nits-probes.ts public/registry/bun-runtime-nits-proof.json CANONICAL_RUNTIME_NITS_TOKENS
package-manager tools/verify-install-platform.ts lib/verification/install-platform.ts public/registry/install-platform.json CANONICAL_INSTALL_PLATFORM_TOKENS
package-manager tools/verify-install-env.ts lib/verification/install-env-probes.ts public/registry/install-env-proof.json CANONICAL_INSTALL_ENV_TOKENS
networking tools/verify-networking.ts --save · tools/verify-channel.ts --suite=networking lib/http/networking-proof.ts public/registry/networking-proof.json · networking-channel-proof.json fetch/DNS/preconnect docs
bundler tools/verify-bundler.ts (optional) lib/verification/bundler-loader-probes.ts public/registry/bundler-loaders-proof.json bundler/loaders docs
(meta) tools/verify-proof-taxonomy.ts --save lib/verification/proof-taxonomy.ts · proof-consistency.ts public/registry/proof-taxonomy-audit.json contract shape + cross-proof parity

Each proof row may carry subsystem, introducedIn, canonicalKey, canonicalKind, canonicalStability (see tools/canonical-helpers.ts).

Ratchetbun run verify-all · bun run verify:proof-taxonomy · bun run check:release-tracker · bun test tests/verification-canonical-coverage.test.ts · bun test tests/canonical-helpers.test.ts · bun test tests/verification-proof-consistency.test.ts · bun test tests/verification-proof-taxonomy.test.ts

Agent checklist before “done”

  1. For a new claim: complete CLAIM-DISCOVERY.md (slim or full path from Q0).
  2. State the claim in one sentence (ProofPath.claim).
  3. Pick kind(s), gateClass + gateRef, freshRerunKind (claim | catalog), and owner.
  4. Parent catalogs only: set childIds (CI / CQ / spine) so dual-catalog membership can’t drift.
  5. Point at evidence paths or commands that actually ran.
  6. If the change touches a claim owner, run that claim’s freshRerun and keep the output (PR body) — FRESH-RERUN.md.
  7. If evidence is missing, either run it or downgrade the claim.

Code SSOT: lib/harness/proof.ts. Discover: bun run harness:status · bun run docs:fresh-rerun · bun run docs:claim-discovery.