ForgeRail / Health Research

Codex Speed Inside ForgeApps

Concrete repository changes and durable operating practices that reduce discovery, validation, and local startup time without sacrificing verification.

Executive finding. Git is not the bottleneck. ForgeApps is slowed by breadth: broad filesystem discovery, repeated uncached validation, fragmented TypeScript projects, and synchronous startup work.
32,846Tracked files
239,053Files on disk
6.877 sForgeRail typecheck
147 msGit status

Internal

Current Repository Evidence

Read-only measurements from C:\Users\AdamK\Documents\forgeapps on 17 July 2026. The checkout contained concurrent work; no source, board, deployment, database, or external-system records were changed during research.

MeasurementResultInterpretation
git status --short --untracked-files=normal147 ms · 32 linesFast enough; not a leading optimization target.
git status --short --untracked-files=no70 ms · 21 linesOnly 77 ms saved; hiding untracked work is not worth the risk.
git ls-files63 ms · 32,846 filesGit-aware inventory remains efficient.
rg --files .66 ms · 22,925 filesDefault source-visible breadth is still large.
rg --files apps/forgerail/src19 ms · 150 filesScoped discovery sees 153× fewer files.
Local filesystem inventory239,053 filesGeneric walkers see dependencies, generated output, and local evidence.
Root node_modules147,519 files · 1.60 GBMust be excluded from recursive agent tooling.
outputs/1,600 files · 21.04 GBLarge media/output trees should not enter routine search or indexing.
Instruction surfaces2,057 AGENTS files on disk; 261 generated/dependency copiesEffective root-to-ForgeRail source chain is only 5,644 bytes; discovery duplication is the concern.
Skill library630 instruction files · 4.16 MBMetadata-first discovery is appropriate; wholesale content loading is not.
Package topology92 named manifests · 80 workspace edges70 build, 71 test, 69 typecheck, and 61 lint scripts create a broad validation surface.
ForgeRail tsc --noEmit6,877 ms · passedIncremental checking has measurable potential.
pnpm package listing514 ms · failed[ERR_SQLITE_ERROR] unable to open database file.
Repo context launcher~214 ms · failedError: spawn EPERM from the esbuild worker.

Ranked Delivery Options

Thirteen Proposals

Impact ranks expected end-to-end Codex time savings. “Automate” means the change can be safely machine-enforced after its stated acceptance gate.

Default To Owning-Workspace Discovery

Route searches and context resolution to the closest workspace before considering the monorepo. Targets: root AGENTS.md, workspace resolver, health checklist.

Impact / confidence
Very high / high
Effort / risk
Low / low
Success
≥90% of routine searches begin in the owning workspace.
Automate
Yes

Adopt One Recursive-Tool Exclusion Contract

Exclude .git, dependencies, builds, Vercel output, local media, browser evidence, and caches while retaining canonical source evidence.

Impact / confidence
Very high / high
Effort / risk
Medium / low
Success
Generic inventory approaches tracked/source scale instead of 239,053 files.
Automate
After allowlist tests

Cache Validation Results

Add content-addressed results around scripts/repo-check.ts for typecheck, test, lint, and build inputs.

Impact / confidence
High / high
Effort / risk
Medium-high / medium
Success
Warm unchanged validation is ≥70% faster with correct invalidation.
Automate
After shadow mode

Pilot Incremental TypeScript In ForgeRail

Use an ignored, explicit tsBuildInfoFile and benchmark cold and warm --noEmit checks.

Impact / confidence
High / high
Effort / risk
Low-medium / low
Success
Warm typecheck below 2.5 s versus the 6.877 s baseline.
Automate
Yes

Move Publishing Off The Dev-Ready Critical Path

Skip unchanged requirements/meeting staging by hash, then evaluate background or lazy staging in apps/forgerail/vite.config.ts.

Impact / confidence
High / high
Effort / risk
Medium / medium
Success
Warm server-ready event under 1 s; staged output remains hash-identical.
Automate
With regression tests

Repair Managed-Profile Tool Execution

Resolve pnpm SQLite store access and esbuild child-process spawning without widening unrelated permissions.

Impact / confidence
High / high
Effort / risk
Medium / medium
Success
pnpm list and repo context/dry-run commands succeed in Codex.
Automate
Partly

Publish Speed Telemetry On /health

Track search breadth, check latency, dev-ready latency, cache effectiveness, checkout breadth, and tool readiness with timestamps.

Impact / confidence
Medium-high / high
Effort / risk
Medium / low
Success
Visible p50/p95 trends; missing collectors always render Unknown.
Automate
Yes

Unify ForgeRail Port Ownership

Choose one source for port 4225/4208 across package script, Vite config, README, and launch registry.

Impact / confidence
Medium / high
Effort / risk
Low / low
Success
Startup logs, route probe, docs, and registry agree.
Automate
Yes

Validate Affected Dependents

Extend changed-workspace checks with pnpm’s dependency and dependent selectors when shared packages change.

Impact / confidence
Medium / high
Effort / risk
Medium / medium
Success
Shared UI changes validate affected consumers without checking all packages.
Automate
After graph tests

Tune Vitest With Evidence

Set focused test.dir; benchmark threads and non-isolated projects only where cleanup is proven.

Impact / confidence
Medium / medium
Effort / risk
Medium / medium
Success
≥25% representative reduction with identical repeated results.
Automate
Experimental

Generate A Compact Skill Index

Select skills from validated metadata, then load only the chosen instruction and required references.

Impact / confidence
Medium / medium-high
Effort / risk
Medium / low
Success
Selection reads one small index plus selected skill content.
Automate
Yes

Add References Only Along Real TypeScript Boundaries

Build a solution graph for shared packages and true consumers—not a forced all-app project.

Impact / confidence
Medium / medium
Effort / risk
High / medium-high
Success
Lower warm build/editor cost without declaration or navigation regressions.
Automate
Manual rollout

Profile Vite Before Refactoring Imports

Use plugin-transform and CPU profiles to identify expensive hooks, modules, and resolution waterfalls.

Impact / confidence
Low-medium / medium
Effort / risk
Low / low
Success
Profile evidence identifies the dominant startup and transform costs.
Automate
Diagnostic only

Delivery Shape

Quick Wins And Structural Work

Ship the bounded, observable changes first. Treat cache orchestration and project-graph redesign as experiments with baselines and rollback paths.

Quick Wins

  • Scoped-search and exclusion guidance.
  • ForgeRail incremental typecheck pilot.
  • Single-source port correction.
  • Hash-based skip for unchanged startup staging.
  • Health timing schema with explicit Unknown states.
  • Managed-profile toolchain probes.

Structural Changes

  • Task-result cache or orchestrator.
  • Dependency-aware affected graph.
  • Selective TypeScript composite/reference conversion.
  • Persistent test transformation cache.
  • Relocation of heavyweight local media/output stores outside routine indexing scope.

Guardrails

Rejected Or Low-Value Ideas

These ideas either save too little today, hide important evidence, or add structural risk before measurement justifies them.

Do Not Default To These

  • Disable untracked-file reporting globally: only 77 ms saved and new work becomes easier to miss.
  • Raise Codex instruction byte limits: the relevant chain is 5,644 bytes.
  • Delete generated directories: destructive and unnecessary when tools exclude them.
  • Convert everything to Turborepo immediately: establish cache-hit evidence first.

Benchmark Before Adoption

  • Disable Vitest isolation globally.
  • Increase task parallelism indiscriminately.
  • Use model Fast mode as the whole solution.
  • Add Git LFS as a Codex-speed measure.
  • Enable Git FSMonitor or untracked cache while status remains 147 ms.

Proposed Product Content

ForgeRail /health

The page should describe evidence, not reassurance. Each card needs a command or collector, timestamp, commit, result, and explicit stale/unavailable state.

Hero

Codex Delivery Speed. Measures the local friction between a request and verified code. Missing evidence remains Unknown.

Recommended Cards

  • Search Scope
  • Focused Typecheck
  • Changed-Workspace Check
  • Dev Server Ready
  • Local Checkout Breadth
  • Toolchain Readiness
  • Cache Effectiveness
  • Instruction Scope

Durable Checklist

  • Start in the owning workspace.
  • Use Git-aware discovery.
  • Exclude generated trees.
  • Run focused gates first.
  • Reuse validated caches.
  • Keep startup work relevant.
  • Separate cold and warm timing.
  • Record command and timestamp.
  • Show missing data as Unknown.
  • Never infer live health locally.

External

Primary Guidance

Current official OpenAI and primary tooling documentation supports smaller effective instruction scope, affected-package selection, incremental compilation, and evidence-led Vite/Vitest tuning.

OpenAI Codex

Codex merges one instruction file per directory from repository root to the working directory and stops at a default 32 KiB. Model Fast mode is separate from repository/tool latency.

AGENTS.md guidance · Speed modes

pnpm 11

Filters can select exact workspaces, dependencies, dependents, directory sets, and projects changed since a Git reference. Recursive execution defaults to four concurrent tasks.

Filtering · Recursive execution

TypeScript

Project references and build mode avoid unnecessary recompilation; incremental compilation persists project-graph information for later runs.

Project references · Incremental builds

Vite And Vitest

Profile slow startup/plugin hooks before refactoring. Limit test-directory search and benchmark pools, isolation, caching, and sharding rather than applying them blindly.

Vite performance · Vitest performance

Git

Porcelain output is the stable automation surface. Current local timings do not justify making Git configuration a leading intervention.

git status documentation

Coverage And Caveats

What Was And Was Not Proven

Research used local source and health-page evidence plus current primary public documentation. Internal communications, client material, and unrelated business systems were intentionally excluded.

Provider Coverage

  • Local repository, Git, filesystem, package manifests, TypeScript configs, ForgeRail startup, skills, and current health-page source.
  • Official OpenAI Codex documentation.
  • Primary pnpm, TypeScript, Vite, Vitest, and Git documentation.
  • No model-generated claim was treated as evidence.

Unknown / Unavailable

  • Supabase health snapshots were not queried.
  • Build, test, lint, and dev-ready benchmarks were not run because they may write caches or generated output.
  • pnpm listing failed with SQLite access error.
  • Repo context failed with esbuild spawn EPERM.
  • The injected Vercel-unavailable note conflicts with a local command resolution; Vercel functionality was not exercised.
  • Measurements are a 17 July 2026 workstation snapshot, not long-term p50/p95 data.