ForgeDocs

Forge-only rules

Forge must work the same for every repository and every CI. Product code (src/, convex/ and the scripts/*.mjs files the package ships) may give Forge's own recipe extra speed, but only behind the one predicate for it, and never at another project's expense:

  • Forge's standard check is node scripts/forge-check.mjs. isStandardForgeCheck in src/standard-check.ts is the only place that decides it; its extra inputs are STANDARD_CHECK_INPUTS in the same file.
  • Forge's Node test layout is Node's test runner over tests/*.test.mjs (layout: 'forge-node' in src/project-test-runner.ts). Its import-graph selector (scripts/test-impact.mjs and the scripts/test-*.mjs it uses) reads that layout. The layout is chosen only when the project declares that runner (preflight.tests) or has Forge's own check entry; an outside project with node --test over tests/*.test.mjs is not it. Any other project uses its own test runner and, in local preflight, the generic JS/TS import graph (src/js-import-graph.ts).

Every other project gets the same fast paths through configuration (check definition, docsPaths, forge.preflight.tests) or inference that never runs repository code. The BYOCI parity test proves the landing fast paths do.

The guard

tests/forge-only-rules.test.mjs runs in npm run verify. It scans product code for the literals that have hidden Forge-only fast paths before, and fails on a hit that this page does not list, on a listed file whose hit count changed, and on a stale row. To add one, route the branch through isStandardForgeCheck or the project test runner first; list it here only when it is Forge's own recipe, with why and what other repositories get instead.

RuleMatches
check-entrythe literal scripts/forge-check.mjs
standard-from-argsdeciding Forge's check from check.args[0], args.length === 1 or executable === 'node'
tests-foldera regular expression anchored on ^tests/, a startsWith('tests/') prefix test, or a .test.mjs string or pattern
docs-foldera regular expression anchored on ^docs/ or a startsWith('docs/') prefix test
forge-foldersan alternation or list of Forge's top-level folders (src, web, convex, site, scripts, tests, dist)
npm-lockfilethe literal package-lock.json
node-testthe argument --test (Node's test runner)
build-foldersproduct code and shipped scripts: a folder list or alternation with dist, build or coverage, as used to skip or drop paths
js-extensionproduct code and shipped scripts: a JavaScript/TypeScript extension pattern such as /\.[cm]?[jt]sx?$/, as used to gate a feature
package-json-configproduct code and shipped scripts: package.json read as a config source
ecosystem-lockfileoutside the registry: a lockfile name the ecosystem registry lists (npm's own is npm-lockfile), quoted or in a regular expression
ecosystem-foldersoutside the registry: two different distinctive registry folder names on one line (.venv, __pycache__, node_modules), or one alone as a list row
ecosystem-extensionsoutside the registry: two registry code extensions joined as alternatives (py|go), or a [/\.ext$/, …] table row

build-folders, js-extension and package-json-config come from the JS/Node/npm audit (875a57cc). The ecosystem-* rules (Issue 9c0ece48) keep ecosystem knowledge in one registry, src/ecosystems.ts: their names come from the registry itself, so a new entry's lockfiles, folders and extensions are guarded too. Comment lines do not count. The registry is checked against the Forge-only rules only; for an ecosystem-* row, the fourth column says why the literal stays outside it. A gate on them must hold for every ecosystem; rows that name an "any-ecosystem slice" Issue are live cases that slice fixes.

Allowlist

FileRuleHitsWhy it is Forge-onlyOther repositories get
src/standard-check.tscheck-entry2defines the standard check entry— (the predicate itself)
src/standard-check.tsstandard-from-args2the one predicate for Forge's check— (the predicate itself)
src/public-governance.tscheck-entry1a default owner-approval path for Forge's own check scripttheir own check and setup entries, protected the same way (definedCheckEntryPaths)
src/github-actions-workflow.tscheck-entry2the workflow Forge generates for its standard checktheir own configured command and workflow
src/hosted-actions-export.tscheck-entry1the marker inside that generated workflowtheir own configured command
scripts/script-impact.mjscheck-entry1Forge's selector treats its check entry as globaltheir check entries are global-risk (checkRunEntryPaths)
scripts/script-impact.mjsforge-folders1Forge's selector maps scripts to its own product foldersthe project runner and the generic import graph
scripts/test-impact.mjsforge-folders4Forge's selector inventory and product foldersthe project runner and the generic import graph
scripts/test-impact.mjstests-folder9Forge's selector reads tests/*.test.mjstheir runner's test globs
scripts/test-impact.mjsnpm-lockfile2Forge's selector classifies installed packages from its npm lockfiledeclared dependencies of every manifest (src/js-import-graph.ts)
scripts/browser-test-policy.mjstests-folder1the mixed static/browser docs test; hosted use is behind isStandardForgeChecktheir own configured command and test runner; no browser annotation when these files are absent
scripts/test-browser-names.mjstests-folder1Forge's browser fixtures (*-browser.test.mjs by name, plus older registered ones); hosted use is behind isStandardForgeCheck, and preflight never counts a skip in such a file as a passtheir own configured command and test runner; preflight checks for Chromium only when the project's own Playwright loads
scripts/browser-test-policy.mjsforge-folders2the web import closure in Forge's standard-check layout, reusing its import graphtheir own configured command and test runner
scripts/browser-test-policy.mjsnpm-lockfile1a change to Forge's Playwright lock selects its browser coveragetheir own dependency and toolchain setup
scripts/browser-test-policy.mjspackage-json-config1a change to Forge's package manifest selects its browser coveragetheir own configured command and setup
scripts/check-browser-runtime.mjspackage-json-config1the standard executor resolves Forge's installed Playwright from the Candidate package context before browser fixtures runtheir own configured check command; this probe is not run
src/hosted-actions-job-plan.tsnpm-lockfile2reads the exact Playwright version and names a missing pin only for a standard-check browser jobtheir own declared toolchains and check command
src/hosted-actions-job-run.tsnpm-lockfile1the standard-check browser shard's one setup retry installs the same pinned Playwright version when the cache is missingtheir own declared toolchains and check command; no retry runs
scripts/test-import-graph.mjsforge-folders3Forge's import graph resolves its source domains and Convex namesthe generic JS/TS import graph
scripts/test-import-graph.mjstests-folder1Forge's import graph limits edges to a test file to other test filesthe generic JS/TS import graph
scripts/test-import-graph.mjsnpm-lockfile4Forge's import graph: external packages from its npm lockfiledeclared dependencies of every manifest
scripts/test-import-facts.mjsforge-folders2Forge's selector extracts unresolved path facts for its own source domainsthe generic JS/TS import graph
scripts/test-import-loaders.mjsforge-folders1Forge's selector extracts domains from its computed loader callsthe generic JS/TS import graph
scripts/test-directory-path.mjsforge-folders2Forge's selector: directory reads in its tests and scriptsthe generic JS/TS import graph
scripts/check-path-scopes.mjsdocs-folder1Forge's own repository path-scope check treats docs/ as documentationnot run
scripts/check-path-scopes.mjsjs-extension1Forge's own JSON asset readers are JS/TS modules; unknown or unobserved data stays fulleach project's own test runner and generic import graph
scripts/core-queue-paths.mjstests-folder5Forge's own Guard 4 (6abdde40): its queue simulation, cost guard, core-path drift check and incident replay registry run for every change to its own queue pathsnot run; their own configured command and test runner
scripts/control-build-key.mjspackage-json-config1the build key of Forge's own CLInot used
scripts/docs-readers.mjsjs-extension1Forge's tested-docs reader scan matches JS/TS importersdeclared docsPaths on their check definition
scripts/script-impact.mjstests-folder4Forge's selector maps scripts to named tests in tests/the project runner and the generic import graph
scripts/script-impact.mjsbuild-folders1an npm script-name pattern (build), not a folder—
scripts/script-impact.mjspackage-json-config1Forge's selector reads its own npm scriptsthe project runner and the generic import graph
scripts/test-directory-path.mjsjs-extension1Forge's selector: directory reads in its JS tests and scriptsthe generic JS/TS import graph
scripts/test-directory-path.mjspackage-json-config1Forge's selector reads its own package manifestthe generic JS/TS import graph
scripts/test-impact.mjsjs-extension2Forge's selector names modules and test files by JS/TS extensionthe project runner and the generic import graph
scripts/test-impact.mjspackage-json-config2Forge's selector treats its own manifest as globalthe project runner and the generic import graph
scripts/test-import-facts.mjsbuild-folders2Forge's selector recognizes literals and templates that name its build foldersthe generic JS/TS import graph
scripts/test-import-loaders.mjsbuild-folders1Forge's selector records its build folder as a computed loader domainthe generic JS/TS import graph
scripts/test-name-watchers.mjsjs-extension1Forge's selector: JS/TS modules a test namesnamed tests by module stem (runnerSelection)
scripts/test-tiebreak.mjsjs-extension1Forge's preflight ranking strips JS/TS extensions from test nameschanged, named and imported tests in that order
src/explicit-test-runner.tstests-folder1an explicit test list for Forge's standard check names tests/*.test.mjs filestheir runner's test files (resolveTestRunner)
src/project-test-runner.tstests-folder1FORGE_TEST_GLOB, the glob of Forge's Node test layouta declared runner or inferred vitest, jest and pytest globs
scripts/docs-readers.mjsforge-folders1Forge's tested-docs reader scan over its tests and scriptsdeclared docsPaths on their check definition
scripts/docs-readers.mjstests-folder1Forge's tested-docs reader scandeclared docsPaths on their check definition
scripts/test-tree-readers.mjspackage-json-config2The selector follows file lists from the repository's own package manifestsNo manifest scope unless the test reads a package manifest
scripts/test-tree-scanners.mjstests-folder1Forge's node selector: which of its test files scan a repository folderchanged, named and imported tests (runnerSelection); no folder-scan detection yet
scripts/selection-guard.mjstests-folder1Forge's selection guard over its test layouttheir command's own selection
scripts/test-closeness.mjstests-folder4Forge's preflight ranking over its test layoutchanged, named and imported tests in that order
scripts/test-coverage.mjstests-folder5Forge's per-test coverage recordsfull checks; no per-test coverage
scripts/test-shards.mjstests-folder1Forge's standard-check shardstheir command in one job
scripts/test-name-watchers.mjstests-folder1Forge's selector: modules a test namesnamed tests by module stem (runnerSelection)
scripts/convex-function-names.mjstests-folder2Forge's selector: Convex functions its tests call by namethe generic JS/TS import graph
scripts/check-path-scopes.mjsforge-folders11Forge's own repository path-scope check (npm run check)not run; their checks are their own
scripts/check-path-scopes.mjstests-folder5Forge's own repository path-scope checknot run
scripts/control-build-key.mjsnpm-lockfile1the build key of Forge's own CLInot used
scripts/control-deps-key.mjsnpm-lockfile1the dependency key of Forge's own CLInot used
scripts/github-actions-check.mjsnpm-lockfile1the Actions executor installs with npm ci only for npm-locked or standard planstheir own actions.setup command
src/agent-preflight.tsforge-folders1the Forge-layout preflight inventorythe project runner over every path, with the generic import graph
src/agent-preflight.tstests-folder1the Forge-layout runner fallback inventorytheir runner's test globs
src/agent-preflight.tsnpm-lockfile1the Forge-layout selector inventorydeclared dependencies of every manifest
src/agent-preflight.tsnode-test1Forge-layout preflight runs Node's runnertheir runner's command (runnerCommand)
src/junit-coverage.tstests-folder1Cargo's own tests/NAME.rs test-binary layout, not Forge's (JUnit coverage of Rust union tests)— (Cargo's convention for every Rust crate)
src/intent-test-contract.tstests-folder1standardTestPath: the files Forge's selector and shards readcontractTestPath: any test path
src/scoped-recheck.tstests-folder1the scoped recheck of the standard plantheir whole command, or the selection their command reports
src/semantic-check-command.tsnode-test1Forge's layout runs union tests with Node's runnertheir runner's command, or SEMANTIC_TESTS_UNAVAILABLE
src/test-script-runner.tsnode-test1recognises node --test in a package.json test scriptthe same inference for vitest and jest
src/test-script-runner.tsjs-extension1a JS test-script path argument names a file, not a folderthe same
src/preflight-weakened-tests.tsjs-extension2the weakened-test check parses JS/TS test files only (any project's, not only Forge's layout)the same for their JS/TS tests; tests in other languages are not judged and get no flag
src/package-graph-dotnet-js.tsjs-extension1JS/TS test file names: a JS package with tests but no test script makes the package graph's selection fulleach ecosystem's own test sources (Gradle src/test)
src/project-test-runner.tsnode-test2recognises node --test in any project's test scriptthe same inference for vitest and jest
src/heavy-slots.tsnode-test1nforge heavy refuses an unscoped node --testthe same guard for any project
src/heavy-hold.tsnode-test1the slot-cap preload restarts an uncapped node --test with the slot's --test-concurrency (7008ff18)Go tools get GOMAXPROCS, rayon tools RAYON_NUM_THREADS; other test runners' own worker settings are not set yet
src/heavy-test-preloads.tsnode-test1finds the preloads a project's test script passes to node --testthe same notice for any project whose test script runs node --test
src/work-docs-admission.tsforge-folders1docs admission of a native standard-check rundeclared docsPaths
src/work-docs-admission.tsnpm-lockfile1docs admission of a native standard-check rundeclared docsPaths
src/integration-preview-checks.tsnpm-lockfile2integration previews install with npm ci only for npm-locked projectstheir check sets up its own dependencies
src/heavy-hold.tsbuild-folders1the hold history names a command a build from its words (build, esbuild, webpack, rollup, vite); the words are not storedthe word build (cargo build, go build, gradle build) classes every ecosystem's build; other tool names read as other
src/actions-toolchains.tsbuild-folders1the dependency seed skips dependency, build and VCS folders of every ecosystem while finding lockfiles (432164bf)the same list for every repository
src/npm-install.tsnpm-lockfile1npm's own install reads its lockfile for scripted packages (slice H, 4ce67b9a)pnpm, Yarn and Bun use their own (src/package-manager-install.ts)
src/package-manager.tspackage-json-config5JS package managers keep packageManager and workspaces in package.json (slice H, 4ce67b9a)non-JS repositories install with their own tooling
src/package-manager-install.tspackage-json-config1reads the JS install scripts the package manager would run (slice H, 4ce67b9a)the same for every JS package manager
src/shared-dependencies.tsnpm-lockfile2Lanes share an npm install keyed by the exact lockfileeach Lane installs with its own tooling
src/gh-cli-options.tsbuild-folders1a gh JSON field named coverage, not a folder—
src/js-import-graph.tsbuild-folders1reads a JS package's built exports target as its src/ sourcethe same for every JS/TS repository
src/agent-preflight.tspackage-json-config6preflight config (budget, per-file test timeout), guards, the Forge-layout inventory and independent static selection read the optional package.json fallbacka neutral root forge.json; package.json is optional for every ecosystem
src/cli-installation.tspackage-json-config1Forge's own CLI package name, version and protocolproject manifests are untouched
src/explicit-test-runner.tspackage-json-config2the project test runner declaration (any-ecosystem slice F, e89be958)after F: a neutral root file
src/heavy-build.tspackage-json-config1Forge's own CLI buildnot used
src/heavy-test-preloads.tspackage-json-config1reads the project's own test script to name preloads a focused run skipsthe same notice for any project with a test script
src/hosted-mac-execute.tspackage-json-config1the project test runner declaration for union tests (any-ecosystem slice F, e89be958)after F: a neutral root file
src/integration-preview-checks.tspackage-json-config2native integration previews infer static checks from package.json scripts (audit 875a57cc finding 14)explicitly marked static checks
src/intent-contract-selection.tspackage-json-config2the project test runner declaration (any-ecosystem slice F, e89be958)after F: a neutral root file
src/js-import-graph.tspackage-json-config1every package.json is data for the JS/TS import graphthe same for every JS/TS repository; others keep path selection
src/landing-environment.tspackage-json-config1Forge's own runtime manifest pins the landing runtimenot used
src/remote-check-plan.tspackage-json-config1the project test runner declaration (any-ecosystem slice F, e89be958)after F: a neutral root file
src/shared-dependencies.tspackage-json-config6Lane dependency sharing is npm-only (any-ecosystem slice H, 4ce67b9a)each Lane installs with its own tooling
src/workspace-test-runner.tspackage-json-config1the project test runner declaration (any-ecosystem slice F, e89be958)after F: a neutral root file
src/code-imports.tsjs-extension1contract import signals are JS/TS-only (any-ecosystem slice E, 7e97573d)after E: contract unknown, never independence
src/contract-exports.tsjs-extension1contract export facts are JS/TS-only (any-ecosystem slice E, 7e97573d)after E: contract unknown, never independence
src/first-check-risk.tsjs-extension1labels nested JS build configs as global-risk (any-ecosystem slice G, 6af95601 adds the other ecosystems)root configs; after G nested build inputs too
src/hosted-overlap-text.tsjs-extension1symbol overlap facts (and the JS parse that reads them) are JS/TS-only (any-ecosystem slice E, 7e97573d)line-range overlap only; no parse
src/intent-test-contract.tsjs-extension2contract test names are JS/TS shapes (any-ecosystem slice F, e89be958)after F: any test name shape
src/js-import-graph.tsjs-extension1the JS/TS import graph parses only JS/TS filespath and package selection
src/project-test-runner.tsjs-extension2node, vitest and jest runner inference and module-name matching for JS runnersa declared runner; per-ecosystem inference in 1f2121cb
src/tested-docs.tsjs-extension1Forge's standard selector scans these files for Markdown readersdeclared docsPaths
src/dependency-link.tspackage-json-config1reads the bin field of a JS workspace package to link its bins into the Lane's node_modules/.bin (de6620eb)non-JS repositories have no node_modules link
src/preflight-dependencies.tspackage-json-config1reads the dependency sections of a JS package's manifest to tell a declared-but-uninstalled package (setup gap) from an undeclared import (real failure) (9ab983fd)non-JS repositories have no node_modules check
src/hosted-actions-job-plan.tspackage-json-config1the project test runner declaration for the Actions shard plan (any-ecosystem slice F, e89be958)forge.json first, then package.json
src/install-script-allowlist.tspackage-json-config5reads npm/pnpm/Bun install-script allowlists where those tools keep themthe same; other ecosystems run no install scripts here
src/package-graph-dotnet-js.tspackage-json-config5the JS workspace part of the any-ecosystem package graph reads its manifests as dataeach ecosystem's own manifest
src/project-test-runner.tspackage-json-config1names where a runner was declared (forge.json or package.json)forge.json
src/project-config.tspackage-json-config2package.json forge.preflight is the fallback after a neutral forge.json (slice F, e89be958)forge.json
src/package-graph-jvm.tsbuild-folders3Maven's <build> XML tag, not a folder—
src/package-graph-python.tsbuild-folders1the Python package finder skips Python build and virtualenv folderseach ecosystem skips its own
scripts/github-actions-check.mjsecosystem-lockfile1the Actions executor's npm ci reads npm's own lockfile pairtheir own actions.setup command
src/actions-toolchains.tsecosystem-lockfile1a validation-message example (**/go.sum)—
src/actions-toolchains.tsecosystem-folders1the seed program's skip list is part of the generated workflow bytes (432164bf)the same list for every repository
src/contract-packages.tsecosystem-extensions1contract-unknown code extensions, wider than the registry on purpose (any-ecosystem slice E, 7e97573d)contract unknown, never independence
src/contract-structural.tsecosystem-extensions1the languages that have a structural contract reader (slice E)contract unknown, never independence
src/files.tsecosystem-folders2analysis skips JS installs and Next.js output by name; build folders follow the ignore rulesthe same for every repository
src/first-check-risk.tsecosystem-lockfile2risk rule v1 is frozen (plans pin the rule version); a new ecosystem adds its inputs in the next rule versionthe same rule for every repository
src/package-ci-flags.tsecosystem-extensions1the CI-flag reader: words that name test targets in Python, Go, Rust and .NET commands— (lexical reading of their own CI)
src/package-graph-python.tsecosystem-lockfile2the Python reader runs pytest through uv or poetry from its own lockfilethe same for every Python repository
src/package-graph-jvm.tsecosystem-folders1Gradle and Kotlin plugin ids (org.gradle.*, org.jetbrains.kotlin.*) read like folder namesthe same for every repository
src/package-graph-python.tsecosystem-folders1the Python reader skips Python build and virtualenv folderseach ecosystem skips its own
src/junit-report.tsjs-extension1labels code files of every listed language, JS/TS among them (written out: the module ships self-contained)the same
src/junit-report.tsecosystem-extensions1ships self-contained in the check payload (no local imports); a test keeps it equal to the registry's code extensionsthe same for every repository

BYOCI parity

tests/byoci-parity.test.mjs runs each landing fast path twice on the same pnpm-style tree (packages/*/src, a linked folder and a submodule, the shape of the repository behind 05df5aed): once with Forge's standard check and once with a project command (bash ci/check.sh). Each pair must reach the same outcome. That includes a shared check that passes late, after main moved: the cohort recomposes on the new main (over several source steps for large States) and checks once more as one cohort; no member rechecks alone. Listed differences:

Fast pathStandard checkProject command
Global-risk inputsits entry plus STANDARD_CHECK_INPUTSthe files its command and setup action name