FactoryWager Wiki

FactoryWager Enterprise Platform

Bun-native monorepo — shared harness in lib/ and packages/; apps under projects/active/. Each project may own its own workspace.

Canonical docs

Role Doc
This hub README.md
AI agents AGENTS.mddocs/AGENTS.md
Workspace map STRUCTURE.md
Coding standards .custom-instructions.md · quick: docs/DEVELOPMENT-STANDARDS.md
Bun install policy docs/UNIFIED.md
Import boundaries docs/IMPORT_BOUNDARIES.md
Wire boundary (parse once) docs/WIRE_BOUNDARY.md
Portal foundation docs/portal-foundation.md
Projects triage projects/README.md
Docs index docs/README.md
Path SSOT (code) lib/docs/repo-docs.ts (CANONICAL_REPO_DOCS)
Harness thesis lopopolo/harness-engineering (domain types; prefer artifact over codebase)

Remotes: originproject-R-score. cascadecascade-mover-v3 (private git remote; do not default-push there).

Quick Start

bun run install:all      # isolated linker + global store (bun.com/docs/pm/global-store)
bun run install:verify   # sanity-check cache dir, links/, and no ./~ drift
bun run help             # Categorized commands (SSOT; optional: bun run cli:docs)
bun run type-check       # Day-loop check (tsconfig.check.json)
bun run build:affected   # Changed packages only (bun --filter ...)
bun run packages:list    # Browse all packages with version/registry/triage

Install policy detail: docs/UNIFIED.md.

Architecture

packages/                        @factorywager/* — 8 internal packages (root workspace)
lib/                             Shared harness (brands, security, scan, console-depth)
projects/active/factorywager/    Registry platform (+ workspace packages)
projects/active/sports-terminal-os/  Sports Terminal OS (root workspace member)
projects/active/kimiremote/      Sports proxy — own repo (gitignored here)
projects/active/enterprise/      Nested products (cascade/bet-ticker own repos, gitignored)
projects/active/*                Independent apps by category — see projects/README.md

Triage tiers experimental/ / archive/ are documented under projects/; only active/ is populated today. Full map: STRUCTURE.md. Agent scope (what not to load): projects/README.md.

Key Commands

Command Description
bun run help Interactive categorized commands (--verbose for all)
bun run cli:docs Regenerate docs/CLI.md
bun run type-check Day-loop typecheck (tsconfig.check.json)
bun run build:affected / test:affected Changed packages only (--filter)
bun run packages:list List packages (scaffolds hidden; --include-scaffolds / --paths)
bun run validate:workspaces Validate workspace coverage
bun run lint ESLint on lib/
bun run lint:harness Harness ESLint config (lib, scripts, packages, server, config, tools)
bun run format:core Prettier harness format (format:harness)
bun run check:brands:all Branded ID gates (manifest + smart + types)
bun run fix:console-log Bulk replace console.log → console.info
bun run fix:scan-any-types Scan for any types
bun run dev Start platform server
bun run deployment:readiness Deployment readiness matrix

See bun run help --verbose (regenerate long docs/CLI.md with bun run cli:docs only when needed).

Code Quality & Fix Tools

Antipattern remediation (after major refactors). Conventions: .custom-instructions.md.

Implementations: scripts/fix-*.ts (e.g. scripts/fix-console-log.ts).

Shared Configuration

Project Policies