Skip to content

SovranAMR/foreman-autonomous

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

TypeScript Node.js Tests LOC License


    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•—   โ–ˆโ–ˆโ•—
    โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•‘
    โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—  โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘
    โ–ˆโ–ˆโ•”โ•โ•โ•  โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•  โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘
    โ–ˆโ–ˆโ•‘     โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ•šโ•โ• โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•‘
    โ•šโ•โ•      โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•     โ•šโ•โ•โ•šโ•โ•  โ•šโ•โ•โ•šโ•โ•  โ•šโ•โ•โ•โ•

The AI That Doesn't Just Write Code โ€” It Thinks Before It Writes

4-layer cognitive pipeline ยท 52 tools ยท 22 engines ยท Built-in hallucination guard


What Is Foreman?

Foreman is an autonomous AI software engineer that decomposes complex tasks through a 4-layer cognitive pipeline, executes them with real tools, verifies results against ground truth, and rolls back failures automatically.

It doesn't paste code and hope for the best. It thinks in layers, verifies against reality, and catches its own hallucinations before they reach your codebase.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         YOUR TASK                               โ”‚
โ”‚              "Add dark mode with system preference sync"        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
                               โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿ”ฎ VISIONER                                                     โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
โ”‚  Defines the soul of the change. Not features โ€” the FEELING.     โ”‚
โ”‚  Emotion target, focal point, color philosophy, forbidden list.  โ”‚
โ”‚  Budget: 5% of token window ยท Confidence threshold: 0.4+        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
                               โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  โš’๏ธ  STRATEGIST                                                   โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
โ”‚  Decomposes vision into execution blocks and atomic tasks.       โ”‚
โ”‚  Each block is a milestone. Each atom is one verifiable change.  โ”‚
โ”‚  Budget: 10% of token window ยท Confidence threshold: 0.3+       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
                               โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿ” RESEARCHER                                                   โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
โ”‚  Gathers context. Reads files, greps code, searches the web.     โ”‚
โ”‚  Builds a knowledge base for the worker to act on.               โ”‚
โ”‚  Budget: 15% of token window ยท Confidence threshold: 0.2+       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
                               โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๐Ÿ”จ WORKER                                                       โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
โ”‚  Executes via 8-step protocol:                                   โ”‚
โ”‚  read โ†’ context โ†’ impact โ†’ decide โ†’ predict โ†’ execute โ†’ verify  โ”‚
โ”‚  โ†’ report                                                        โ”‚
โ”‚  Budget: 8K tokens/atom ยท Max 20 operations/atom                 โ”‚
โ”‚                                                                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚  ๐Ÿ”ฌ REVIEWER (Independent Tribunal)                         โ”‚ โ”‚
โ”‚  โ”‚  Different model reviews worker's output against vision.    โ”‚ โ”‚
โ”‚  โ”‚  Verdicts: PASS ยท REJECT ยท NEEDS_REVISION                  โ”‚ โ”‚
โ”‚  โ”‚  Worker can't grade its own homework.                       โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Why Foreman?

Most AI coding tools operate as single-turn autocomplete โ€” you ask, they answer, you fix their mistakes.

Foreman operates as a multi-turn autonomous engineer:

Traditional AI Coding Foreman
Single LLM call โ†’ paste code 4-layer pipeline โ†’ verified output
No verification Build/test parsing with regression detection
Hallucinated imports, fake APIs Ground truth engine + fact checker
Manual rollback Automatic git-based rollback (atom/block/pipeline)
One model, pray it works Multi-provider routing with instant failover
No cost awareness Per-model, per-phase cost tracking with budget alerts
Context overflow = garbage Layer-aware token budgets with progressive compression

Architecture

                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚     Messaging Gateway     โ”‚
                    โ”‚   Telegram ยท WhatsApp     โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚      Orchestrator         โ”‚
                    โ”‚   Pipeline Coordinator    โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
          โ”‚                      โ”‚                      โ”‚
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚   Engine     โ”‚       โ”‚  Cognitive   โ”‚       โ”‚  Pipeline    โ”‚
   โ”‚  30+ subsys  โ”‚       โ”‚   Router     โ”‚       โ”‚  Observer    โ”‚
   โ”‚  coordinated โ”‚       โ”‚ Multi-prov   โ”‚       โ”‚  Full trace  โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ”‚  load bal.   โ”‚       โ”‚  JSONL logs  โ”‚
          โ”‚               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
          โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚     โ”‚     โ”‚         โ”‚          โ”‚          โ”‚          โ”‚
    โ–ผ     โ–ผ     โ–ผ         โ–ผ          โ–ผ          โ–ผ          โ–ผ
  Exec  Edit  Git     Rollback  Security  Halluc.    Cost
  Eng.  Eng.  Eng.    Engine    Scanner   Guard     Tracker
    โ”‚     โ”‚     โ”‚         โ”‚          โ”‚          โ”‚          โ”‚
    โ–ผ     โ–ผ     โ–ผ         โ–ผ          โ–ผ          โ–ผ          โ–ผ
  Shell  File  Commit  Revert    Scan for   Ground    Track
  Cmds   Edits Diff    Changes   Secrets    Truth     $/token
         Range Branch  on Fail   Vulns      Facts

The 22 Engines

Every engine is a standalone module with its own types, tests, and responsibility boundary.

 ENGINE                     โ”‚ WHAT IT DOES
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
 ExecutionEngine            โ”‚ Shell commands with security filtering, timeouts,
                            โ”‚ background execution, process tracking
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 EditEngine                 โ”‚ Surgical text replacements with context-aware
                            โ”‚ matching, undo history, range edits
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 GitEngine                  โ”‚ Commits, branches, diffs, history, merge
                            โ”‚ conflict detection, stash management
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 VerificationEngine         โ”‚ Parse build/test output from ANY runner (Jest,
                            โ”‚ Vitest, node:test, Mocha, pytest). Extract errors
                            โ”‚ with file:line. Detect regressions across runs.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 RollbackEngine             โ”‚ Git-based undo at atom, block, or pipeline level.
                            โ”‚ Stash guard saves WIP before rollback. Full
                            โ”‚ rollback history with preview before execution.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 SecurityScanner            โ”‚ 5-capability project scanner: secret leak
                            โ”‚ detection (AWS, GitHub, Stripe, etc.), dependency
                            โ”‚ audit, .gitignore validation, hardcoded values,
                            โ”‚ file permission checks.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 HallucinationGuard         โ”‚ Hook-based guardrails integrated with
                            โ”‚ GroundTruthEngine + FactChecker. Blocks
                            โ”‚ fabricated commands, files, and links BEFORE
                            โ”‚ they reach the codebase.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 GroundTruthEngine          โ”‚ Extracts VERIFIED facts from the project:
                            โ”‚ package.json, entry points, available commands,
                            โ”‚ file structure. Zero guessing.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 FactChecker                โ”‚ Validates LLM output against ground truth.
                            โ”‚ Catches hallucinated npm packages, fake CLI
                            โ”‚ commands, non-existent files. Strict mode
                            โ”‚ blocks on ANY violation.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 CognitiveLoadBalancer      โ”‚ Multi-provider LLM router. When Provider A
                            โ”‚ hits rate limits (429), instantly routes to
                            โ”‚ Provider B. Zero downtime. RPM tracking per
                            โ”‚ endpoint with cooldown windows.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 CostTracker                โ”‚ Per-model pricing (input/output/cache tokens),
                            โ”‚ phase-level cost breakdown, session-level
                            โ”‚ cumulative tracking, budget alerts.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 PipelineObserver           โ”‚ Full pipeline observability: every phase, block,
                            โ”‚ atom tracked with timing. Every tool call logged.
                            โ”‚ JSONL files for post-mortem. Human-readable
                            โ”‚ summary generation.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 ContextIntelligence        โ”‚ Layer-aware token budgets (Visioner 40%,
                            โ”‚ Worker 20%). Relevance-based thought retention.
                            โ”‚ 3-tier progressive summarization (full โ†’
                            โ”‚ condensed โ†’ headline). Decision anchoring:
                            โ”‚ high-confidence thoughts never dropped.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 ReviewerGate               โ”‚ Independent quality tribunal. DIFFERENT model
                            โ”‚ reviews the Worker's output against the Vision
                            โ”‚ document. Verdicts: PASS / REJECT /
                            โ”‚ NEEDS_REVISION. Breaks echo chamber bias.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 BrowserEngine              โ”‚ Headless Chrome/Firefox via Playwright.
                            โ”‚ Navigate, screenshot, extract content, interact
                            โ”‚ with elements. Screenshot โ†’ base64 for LLM
                            โ”‚ vision analysis. PDF generation.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 SubAgentEngine             โ”‚ Spawn isolated sub-agents with their own forge
                            โ”‚ pipelines. Parent-child linking, concurrent
                            โ”‚ execution, inter-agent messaging, shared memory,
                            โ”‚ result aggregation, timeout + auto-kill.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 AgentRegistry (Mesh)       โ”‚ Central agent lifecycle: registration, state
                            โ”‚ transitions, heartbeat monitoring, health
                            โ”‚ scoring, event-driven coordination.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 StreamingPipeline          โ”‚ Real-time pipeline output: phase/block/atom
                            โ”‚ events, tool call streaming, token-by-token LLM
                            โ”‚ output, cost updates, multiple output targets.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 ApprovalEngine             โ”‚ Human-in-the-loop for destructive operations.
                            โ”‚ Gates dangerous shell commands, maintains audit
                            โ”‚ log of approved/denied operations.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 CompactionEngine           โ”‚ Context window management. When thought chains
                            โ”‚ fill up: summarize via LLM, write to
                            โ”‚ chain.contextSummary, use summary instead of
                            โ”‚ full history.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 BatchFileEngine            โ”‚ Atomic multi-file writes with rollback.
                            โ”‚ Write 10 files at once โ€” if any fails, ALL
                            โ”‚ revert. Used by Worker for multi-file changes.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
 MediaEngine                โ”‚ Media file analysis: images, screenshots,
                            โ”‚ documents. Integrates with LLM vision models
                            โ”‚ for visual QA.
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

The 52 Tools

Every tool the LLM can invoke during execution. Each tool delegates to an engine for security and consistency.

 CATEGORY          โ”‚ TOOLS
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
                   โ”‚
 ๐Ÿ–ฅ๏ธ  Shell          โ”‚ bash (async, timeout, background, yield_ms)
                   โ”‚ list_processes ยท poll_process ยท process_log
                   โ”‚ kill_process ยท kill_processes
                   โ”‚
 ๐Ÿ“ Filesystem     โ”‚ read_file (line-range) ยท write_file ยท edit_file
                   โ”‚ edit_range ยท edit_undo ยท delete_file ยท list_dir
                   โ”‚ search_files ยท grep ยท search_in_files
                   โ”‚ batch_write (atomic multi-file) ยท batch_ops
                   โ”‚
 ๐Ÿ”€ Git            โ”‚ git_status ยท git_commit ยท git_diff ยท git_log
                   โ”‚
 ๐Ÿ”’ Security       โ”‚ security_scan
                   โ”‚
 โœ… Verification    โ”‚ verify_build ยท verify_tests
                   โ”‚
 ๐ŸŒ Web            โ”‚ web_search (Brave API) ยท web_fetch
                   โ”‚ analyze_link ยท classify_url
                   โ”‚
 ๐Ÿ“ Markdown       โ”‚ parse_markdown ยท extract_code
                   โ”‚
 ๐Ÿ“Š Analysis       โ”‚ diff_preview ยท semantic_search
                   โ”‚
 ๐Ÿ’พ Memory         โ”‚ memory_read ยท memory_write ยท memory_search
                   โ”‚
 โฐ Scheduling     โ”‚ cron_list ยท cron_add ยท cron_remove
                   โ”‚
 ๐Ÿง‘โ€๐Ÿ’ป Sessions       โ”‚ session_list ยท session_spawn ยท spawn_subagent
                   โ”‚
 ๐ŸŒ Browser        โ”‚ browser_navigate ยท browser_screenshot
                   โ”‚ browser_extract ยท browser_pdf
                   โ”‚
 ๐Ÿ“ฆ Media          โ”‚ analyze_media ยท download_file
                   โ”‚
 ๐Ÿ“ˆ System         โ”‚ cache_stats ยท approval_audit
                   โ”‚
 ๐Ÿ”ฅ Pipeline       โ”‚ forge_pipeline (recursive โ€” pipeline within pipeline)
                   โ”‚

Safety Systems

Foreman doesn't trust itself. Multiple independent systems prevent damage:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    SAFETY STACK                          โ”‚
โ”‚                                                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Layer 1: DANGEROUS COMMAND FILTER                 โ”‚  โ”‚
โ”‚  โ”‚ Blocks: rm -rf /, sudo, fork bombs, npm publish,  โ”‚  โ”‚
โ”‚  โ”‚ git push --force, reverse shells, disk wipes       โ”‚  โ”‚
โ”‚  โ”‚ 20+ regex patterns ยท Zero false negatives          โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Layer 2: APPROVAL ENGINE                          โ”‚  โ”‚
โ”‚  โ”‚ Human-in-the-loop for destructive operations.      โ”‚  โ”‚
โ”‚  โ”‚ Full audit trail of every approved/denied command.  โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Layer 3: HALLUCINATION GUARD                      โ”‚  โ”‚
โ”‚  โ”‚ Ground truth extraction โ†’ fact checking โ†’ block.   โ”‚  โ”‚
โ”‚  โ”‚ Catches fake packages, non-existent commands,      โ”‚  โ”‚
โ”‚  โ”‚ hallucinated file paths. Strict mode = zero        โ”‚  โ”‚
โ”‚  โ”‚ tolerance.                                         โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Layer 4: VERIFICATION ENGINE                      โ”‚  โ”‚
โ”‚  โ”‚ Parses real build/test output. Detects regressions โ”‚  โ”‚
โ”‚  โ”‚ by comparing against previous runs. Fails the atom โ”‚  โ”‚
โ”‚  โ”‚ if tests break.                                    โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Layer 5: REVIEWER GATE                            โ”‚  โ”‚
โ”‚  โ”‚ Independent LLM (different model) reviews output   โ”‚  โ”‚
โ”‚  โ”‚ against vision. Worker can't grade its own work.   โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Layer 6: ROLLBACK ENGINE                          โ”‚  โ”‚
โ”‚  โ”‚ If verification fails โ†’ automatic git revert.      โ”‚  โ”‚
โ”‚  โ”‚ Atom-level, block-level, or full pipeline revert.  โ”‚  โ”‚
โ”‚  โ”‚ Stash guard preserves WIP. Full rollback history.  โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Layer 7: SECURITY SCANNER                         โ”‚  โ”‚
โ”‚  โ”‚ Scans for leaked secrets (AWS, GitHub, Stripe),    โ”‚  โ”‚
โ”‚  โ”‚ vulnerable deps, missing .gitignore entries,       โ”‚  โ”‚
โ”‚  โ”‚ hardcoded values, bad file permissions.             โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Context Intelligence

Most AI tools dump the entire chat history into the context window until it overflows. Foreman has a 5-tier system:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  CONTEXT INTELLIGENCE โ€” 5-TIER SYSTEM                       โ”‚
โ”‚                                                             โ”‚
โ”‚  1. LAYER-AWARE BUDGETS                                     โ”‚
โ”‚     Visioner gets 40% (needs full picture)                  โ”‚
โ”‚     Strategist gets 25%                                     โ”‚
โ”‚     Researcher gets 15%                                     โ”‚
โ”‚     Worker gets 20% (tactical, focused)                     โ”‚
โ”‚                                                             โ”‚
โ”‚  2. RELEVANCE-BASED RETENTION                               โ”‚
โ”‚     Not FIFO. A thought about "TypeScript types" stays      โ”‚
โ”‚     when working on types, drops when working on CSS.       โ”‚
โ”‚     Similarity engine scores every thought.                 โ”‚
โ”‚                                                             โ”‚
โ”‚  3. PROGRESSIVE SUMMARIZATION (3 tiers)                     โ”‚
โ”‚     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”‚
โ”‚     โ”‚   FULL     โ”‚  โ”‚ CONDENSED  โ”‚  โ”‚  HEADLINE  โ”‚         โ”‚
โ”‚     โ”‚  Recent    โ”‚โ†’ โ”‚  Medium    โ”‚โ†’ โ”‚   Old      โ”‚         โ”‚
โ”‚     โ”‚  Complete  โ”‚  โ”‚ Input+Out  โ”‚  โ”‚  One-line  โ”‚         โ”‚
โ”‚     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ”‚
โ”‚                                                             โ”‚
โ”‚  4. DECISION ANCHORING                                      โ”‚
โ”‚     High-confidence decisions are PINNED โ€” never dropped    โ”‚
โ”‚     regardless of age. They anchor the entire chain.        โ”‚
โ”‚                                                             โ”‚
โ”‚  5. CROSS-CHAIN CONTEXT                                     โ”‚
โ”‚     Worker chains get relevant parts from parent            โ”‚
โ”‚     strategist chains. Not everything โ€” just what matters.  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Multi-Provider LLM Routing

                  Engine.callLLM()
                        โ”‚
                        โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚   Cognitive      โ”‚
              โ”‚   Load Balancer  โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ”‚
         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
         โ”‚             โ”‚             โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”
    โ”‚ Kimi    โ”‚   โ”‚ Gemini  โ”‚   โ”‚Anthropicโ”‚
    โ”‚ K2.5    โ”‚   โ”‚ 3.1 Pro โ”‚   โ”‚ Claude  โ”‚
    โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜
         โ”‚             โ”‚             โ”‚
         โ”‚  HTTP 429?  โ”‚             โ”‚
         โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ             โ”‚
         โ”‚             โ”‚  HTTP 429?  โ”‚
         โ”‚             โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ
         โ”‚             โ”‚             โ”‚
    Zero sleep. Zero downtime. Instant failover.

Supported providers: Kimi (Moonshot K2.5), Gemini (3.1 Pro), Anthropic (Claude), OpenAI (GPT-4o), Antigravity (Google)

Per-layer model preferences: Each pipeline layer can use a different default model with its own fallback chain.


The Worker's 8-Step Protocol

Every atomic task follows this protocol โ€” no exceptions:

  โ”Œโ”€โ”€โ”€ STEP 1: READ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  Read the relevant files. Know what exists.                โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
  โ”Œโ”€โ”€โ”€ STEP 2: CONTEXT โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  Understand HOW this fits into the larger codebase.        โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
  โ”Œโ”€โ”€โ”€ STEP 3: IMPACT โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  What will break? What depends on what I'm changing?       โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
  โ”Œโ”€โ”€โ”€ STEP 4: DECIDE โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  Choose the approach. State what I WILL and WON'T do.      โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
  โ”Œโ”€โ”€โ”€ STEP 5: PREDICT โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  What should the output look like? Predict before doing.   โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
  โ”Œโ”€โ”€โ”€ STEP 6: EXECUTE โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  Write code, run commands. Through ExecutionEngine only.   โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
  โ”Œโ”€โ”€โ”€ STEP 7: VERIFY โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  Did it work? Run tests. Parse build output. Check diff.   โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
  โ”Œโ”€โ”€โ”€ STEP 8: REPORT โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  Summary of what changed, what was verified, confidence.   โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

If any step is incomplete โ†’ retry. If retry fails โ†’ BLOCK signal propagates up.


Pipeline Observability

Every forge run produces full observability:

.foreman/observer/
โ”œโ”€โ”€ pipeline-2026-03-01T19-30-00.jsonl    # Every event, timestamped
โ”œโ”€โ”€ pipeline-2026-03-01T19-30-00.md       # Human-readable summary
โ””โ”€โ”€ ...

Summary includes:
  โœฆ Total phases, blocks, atoms executed
  โœฆ Per-atom: duration, attempts, tool calls, operations, confidence
  โœฆ Per-phase: token cost, elapsed time
  โœฆ Total pipeline cost in USD
  โœฆ Rejection feedback from Reviewer
  โœฆ Rollback events (if any)

CLI

# โ”€โ”€โ”€ User Commands โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
foreman                     # Start (auto-activates Telegram if configured)
foreman setup               # Configure API keys (interactive)
foreman init <name>         # Create a new project
foreman status              # System health โ€” memory, sessions, cache, providers
foreman run <task>          # Run a task through the full forge pipeline
foreman task add            # Add a task to the board
foreman task list           # List tasks
foreman task show <id>      # Task details
foreman task done <id>      # Mark task as done
foreman board               # Kanban board view
foreman doctor              # System health check
foreman serve               # Start Telegram/WhatsApp gateway

# โ”€โ”€โ”€ Internals (debug/inspect) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
foreman internals thoughts  # List all thoughts
foreman internals chains    # List all chains
foreman internals history   # State transition history
foreman internals memory    # Memory entries
foreman internals sessions  # Active sessions
foreman internals cache     # Cache statistics
foreman internals providers # Provider status

Messaging

Foreman runs as a Telegram bot or WhatsApp bot.

The LLM decides when to use the full forge pipeline vs. direct tool calls based on task complexity. Conversation history persisted to disk with 24h TTL.

# Start with environment variable
export FOREMAN_TELEGRAM_TOKEN="your_bot_token"
foreman                     # Auto-starts Telegram gateway

# Or via CLI
foreman serve --telegram <token> --allow <user_id>

Security: Sender allowlisting โ€” only approved user IDs can interact.


Project Stats

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚          F O R E M A N   S T A T S       โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Source files      โ”‚                   99 โ”‚
โ”‚ Test files        โ”‚                   53 โ”‚
โ”‚ Total LOC         โ”‚              ~57,000 โ”‚
โ”‚ Tests passing     โ”‚                  654 โ”‚
โ”‚ LLM tools         โ”‚                   52 โ”‚
โ”‚ CLI commands      โ”‚                   47 โ”‚
โ”‚ Engines           โ”‚                   22 โ”‚
โ”‚ LLM Providers     โ”‚                    5 โ”‚
โ”‚ Commits           โ”‚                 348+ โ”‚
โ”‚ Language          โ”‚  TypeScript (strict) โ”‚
โ”‚ Runtime           โ”‚        Node.js 22+  โ”‚
โ”‚ Test framework    โ”‚  node:test + assert  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Built with โš’๏ธ  by @SovranAMR            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Development

npm install
npm test                      # Run all 654 tests
npx tsx src/cli.ts status     # Check engine status
npx tsx src/cli.ts doctor     # Full system health check

The Forge Pipeline โ€” Deep Dive

This is the heart of Foreman. Not a wrapper around an LLM โ€” a cognitive execution engine with 2,830 lines of orchestration logic that turns a single task into verified, committed code.

                         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ”‚    "Add OAuth2     โ”‚
                         โ”‚   to the API"      โ”‚
                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                   โ”‚
          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
          โ”‚                        โ”‚                        โ”‚
          โ–ผ                        โ–ผ                        โ–ผ
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚ Hallucinationโ”‚        โ”‚   Ground     โ”‚         โ”‚   Rollback   โ”‚
   โ”‚ Guard Init   โ”‚        โ”‚   Truth      โ”‚         โ”‚  Checkpoint  โ”‚
   โ”‚ (strict mode)โ”‚        โ”‚  Extraction  โ”‚         โ”‚  (pipeline)  โ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
          โ”‚                      โ”‚                        โ”‚
          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                                 โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚  ๐Ÿ”ฎ PHASE 1: VISION     โ”‚
                    โ”‚  Budget: 5% of tokens   โ”‚
                    โ”‚  Confidence min: 0.4     โ”‚
                    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
                    โ”‚  + Project context       โ”‚
                    โ”‚  + Identity context      โ”‚
                    โ”‚  + Memory recall         โ”‚
                    โ”‚                          โ”‚
                    โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
                    โ”‚  โ”‚ HUMAN CHECKPOINT   โ”‚  โ”‚
                    โ”‚  โ”‚ (interactive mode)  โ”‚  โ”‚
                    โ”‚  โ”‚ Approve / Revise /  โ”‚  โ”‚
                    โ”‚  โ”‚ Abort the vision    โ”‚  โ”‚
                    โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                                 โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚  โš’๏ธ PHASE 2: DECOMPOSE  โ”‚
                    โ”‚  Budget: 5% of tokens   โ”‚
                    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
                    โ”‚  Sizing rules enforced:  โ”‚
                    โ”‚  1 file โ†’ 1-2 blocks     โ”‚
                    โ”‚  2-5 files โ†’ 2-3 blocks  โ”‚
                    โ”‚  5-15 files โ†’ 3-5 blocks โ”‚
                    โ”‚  Hard cap: 8 blocks max  โ”‚
                    โ”‚                          โ”‚
                    โ”‚  Dependency graph built   โ”‚
                    โ”‚  โ†’ topological sort       โ”‚
                    โ”‚  โ†’ execution waves        โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€ FOR EACH BLOCK โ”€โ”€โ”€โ”€โ”
         โ”‚                       โ”‚        (wave-ordered)   โ”‚
         โ”‚              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ”‚
         โ”‚              โ”‚ ๐Ÿ” RESEARCH      โ”‚               โ”‚
         โ”‚              โ”‚ Budget: 15%      โ”‚               โ”‚
         โ”‚              โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค               โ”‚
         โ”‚              โ”‚ โ€ข Hot memories   โ”‚               โ”‚
         โ”‚              โ”‚ โ€ข Warm memories  โ”‚               โ”‚
         โ”‚              โ”‚ โ€ข Semantic recallโ”‚               โ”‚
         โ”‚              โ”‚ โ€ข Embedding srch โ”‚               โ”‚
         โ”‚              โ”‚ โ€ข Cross-chain ctxโ”‚               โ”‚
         โ”‚              โ”‚ โ€ข Web search     โ”‚               โ”‚
         โ”‚              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ”‚
         โ”‚                       โ”‚                         โ”‚
         โ”‚              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ”‚
         โ”‚              โ”‚ โš›๏ธ ATOMIZE       โ”‚               โ”‚
         โ”‚              โ”‚ (per block)      โ”‚               โ”‚
         โ”‚              โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค               โ”‚
         โ”‚              โ”‚ 1 file โ†’ 1-2     โ”‚               โ”‚
         โ”‚              โ”‚ 2-5 files โ†’ 2-4  โ”‚               โ”‚
         โ”‚              โ”‚ Hard cap: 6/blockโ”‚               โ”‚
         โ”‚              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ”‚
         โ”‚                       โ”‚                         โ”‚
         โ”‚     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€ FOR EACH ATOM โ”€โ”€โ”  โ”‚
         โ”‚     โ”‚                 โ”‚    (max 3 retries)   โ”‚  โ”‚
         โ”‚     โ”‚        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ ๐Ÿ”จ EXECUTE       โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ Budget: 65%      โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ 8K tokens/atom   โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ 20 ops max/atom  โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚                  โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ TWO MODES:       โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚                  โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ A) Tool Mode     โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚    LLM calls 52  โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚    tools live    โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚    (real-time)    โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚                  โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ B) Extraction    โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚    1 LLM call โ†’  โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚    post-hoc parse โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚    + execute      โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚                  โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ Pre-reads files  โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ from atom desc   โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ (zero halluc.)   โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚  โ”‚
         โ”‚     โ”‚                 โ”‚                      โ”‚  โ”‚
         โ”‚     โ”‚        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ ๐Ÿ”ฌ VERIFY        โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ Build output     โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ parsing (Jest,   โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ Vitest, pytest)  โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ Regression check โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ Code fence scan  โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ Pattern analysis โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚  โ”‚
         โ”‚     โ”‚                 โ”‚                      โ”‚  โ”‚
         โ”‚     โ”‚        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ โš–๏ธ REVIEWER GATE โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ Phase 1: Quick   โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ local check (no  โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ LLM cost)        โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚                  โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ Phase 2: Full    โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ LLM review       โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ (DIFFERENT model) โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚                  โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ PASS โ†’ commit    โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ REJECT โ†’ rollbackโ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚  + retry w/      โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚  feedback        โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚  โ”‚
         โ”‚     โ”‚                 โ”‚                      โ”‚  โ”‚
         โ”‚     โ”‚        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ โœ… AUTO-COMMIT   โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ Git commit with  โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ chain/thought    โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ”‚ metadata         โ”‚            โ”‚  โ”‚
         โ”‚     โ”‚        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚  โ”‚
         โ”‚     โ”‚                                       โ”‚  โ”‚
         โ”‚     โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚  โ”‚
         โ”‚     โ”‚  โ”‚ ON FAILURE:                      โ”‚ โ”‚  โ”‚
         โ”‚     โ”‚  โ”‚ โ€ข Git rollback to last atom      โ”‚ โ”‚  โ”‚
         โ”‚     โ”‚  โ”‚ โ€ข Inject rejection feedback      โ”‚ โ”‚  โ”‚
         โ”‚     โ”‚  โ”‚ โ€ข Retry (max 3 attempts)         โ”‚ โ”‚  โ”‚
         โ”‚     โ”‚  โ”‚ โ€ข 50%+ atoms fail โ†’ abandon blockโ”‚ โ”‚  โ”‚
         โ”‚     โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚  โ”‚
         โ”‚     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
         โ”‚                                                โ”‚
         โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
         โ”‚  โ”‚ ๐Ÿชž REFLECTION (every 5 atoms)             โ”‚  โ”‚
         โ”‚  โ”‚ Vision drift check โ€” are we still         โ”‚  โ”‚
         โ”‚  โ”‚ building what we said we would?            โ”‚  โ”‚
         โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚  ๐Ÿ“Š PIPELINE COMPLETE     โ”‚
                    โ”‚                           โ”‚
                    โ”‚  โ€ข Observer summary (MD)   โ”‚
                    โ”‚  โ€ข JSONL event log         โ”‚
                    โ”‚  โ€ข Cost report             โ”‚
                    โ”‚  โ€ข Memory persistence      โ”‚
                    โ”‚  โ€ข Session close           โ”‚
                    โ”‚  โ€ข Git stash restore       โ”‚
                    โ”‚  โ€ข Forge bridge notify     โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

What Happens Under the Hood

Every forge run triggers 17 coordinated subsystems before a single line of code is written:

 STEP โ”‚ SUBSYSTEM               โ”‚ WHAT HAPPENS
โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
  1   โ”‚ HallucinationGuard      โ”‚ Scans project, builds ground truth map
  2   โ”‚ HooksEngine             โ”‚ Fires before_pipeline โ€” can BLOCK
  3   โ”‚ RollbackEngine          โ”‚ Creates pipeline-level git checkpoint
  4   โ”‚ SessionManager          โ”‚ Auto-starts session (user never deals with this)
  5   โ”‚ MultiSessionManager     โ”‚ Creates named forge session for context
  6   โ”‚ SessionLifecycle        โ”‚ Registers session with slug identifier
  7   โ”‚ IdentityEngine          โ”‚ Loads identity context from memory
  8   โ”‚ PipelineResumeEngine    โ”‚ Clears stale checkpoints from crashed runs
  9   โ”‚ StateManager            โ”‚ Resets activeChainId, transitions to idle
 10   โ”‚ MemoryManager           โ”‚ Cleans up expired/cold memories
 11   โ”‚ CacheManager            โ”‚ Purges expired cache entries
 12   โ”‚ GitEngine               โ”‚ Stash guard โ€” saves uncommitted work
 13   โ”‚ GitEngine               โ”‚ Creates isolated task branch
 14   โ”‚ StreamingPipeline       โ”‚ Announces pipeline start to all targets
 15   โ”‚ ForgeBridge             โ”‚ Notifies gateway about pipeline start
 16   โ”‚ PipelineObserver        โ”‚ Starts JSONL event logging
 17   โ”‚ CostTracker             โ”‚ Initializes per-phase cost tracking

Token Budget Enforcement

The pipeline doesn't let any phase eat the budget. Hard limits enforced at runtime:

 PHASE        โ”‚ BUDGET  โ”‚ PURPOSE
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
 Vision       โ”‚   5%    โ”‚ Define the soul โ€” must be concise
 Decompose    โ”‚   5%    โ”‚ Structural, not verbose
 Research     โ”‚  15%    โ”‚ Heavy but bounded context gathering
 Execute      โ”‚  65%    โ”‚ Bulk of tokens for actual work
 Reflect      โ”‚   5%    โ”‚ Periodic vision drift checks
 Review       โ”‚   5%    โ”‚ Independent tribunal calls
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
 Session max  โ”‚   2M    โ”‚ Hard ceiling โ€” pipeline stops if hit
 Per atom     โ”‚   8K    โ”‚ Forces focused, atomic changes
 Per block    โ”‚  40K    โ”‚ Prevents block sprawl

The Retry-Rollback-Feedback Loop

When an atom fails, Foreman doesn't just retry blindly. It rolls back, explains why it failed, and retries with that context:

  Atom Attempt 1
       โ”‚
       โ–ผ
  Worker writes code โ”€โ”€โ†’ Reviewer REJECTS
       โ”‚                 "Vision says no external deps,
       โ”‚                  you imported lodash"
       โ”‚
       โ–ผ
  โช Git rollback to pre-atom state
       โ”‚
       โ–ผ
  Atom Attempt 2
  (injected context):
  "โš ๏ธ PREVIOUS ATTEMPT REJECTED:
   Vision says no external deps,
   you imported lodash.
   Fix this. Do NOT repeat."
       โ”‚
       โ–ผ
  Worker writes code โ”€โ”€โ†’ Reviewer PASSES โœ…
       โ”‚
       โ–ผ
  Auto-commit with metadata

After 3 failed attempts โ†’ atom is skipped. If 50%+ atoms in a block fail โ†’ entire block is abandoned.

Two Execution Modes

 MODE A: TOOL MODE (FOREMAN_TOOL_MODE=1)
 โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
 LLM calls tools in real-time. Multiple API round-trips per atom.
 More powerful โ€” LLM can read a file, decide, write, verify, iterate.
 Higher cost, rate-limit sensitive.

   LLM โ”€โ”€callโ”€โ”€โ†’ read_file("src/auth.ts")
   LLM โ†โ”€resultโ”€โ”€ (file contents)
   LLM โ”€โ”€callโ”€โ”€โ†’ edit_file("src/auth.ts", ...)
   LLM โ†โ”€resultโ”€โ”€ (success)
   LLM โ”€โ”€callโ”€โ”€โ†’ bash("npm test")
   LLM โ†โ”€resultโ”€โ”€ (12 passing)
   LLM โ”€โ”€callโ”€โ”€โ†’ git_commit("add OAuth2 middleware")
   LLM โ†โ”€resultโ”€โ”€ (abc1234)

 MODE B: EXTRACTION MODE (default)
 โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
 Single LLM call. Foreman parses the response post-hoc,
 extracts file writes and shell commands, executes them
 through ExecutionEngine.

   LLM โ”€โ”€single callโ”€โ”€โ†’ (full 8-step protocol response)
         โ”‚
         โ–ผ
   WorkerExecutor.extractOperations()
   โ”œโ”€โ”€ write_file: src/auth.ts (detected)
   โ”œโ”€โ”€ edit_file: src/server.ts (detected)
   โ””โ”€โ”€ bash: npm test (detected)
         โ”‚
         โ–ผ
   ExecutionEngine runs each operation
   SecurityScanner blocks dangerous commands
   ApprovalEngine gates destructive ops

Pre-Execution File Analysis

Before the Worker touches anything, Foreman pre-reads the files mentioned in the atom description:

  Atom: "Add rate limiting to src/middleware/auth.ts"
                    โ”‚
                    โ–ผ
  Regex extracts: ["src/middleware/auth.ts"]
                    โ”‚
                    โ–ผ
  Reads actual file contents (max 3 files, 50 lines preview)
                    โ”‚
                    โ–ผ
  Injects into Worker context:
  "PRE-READ FILES (real contents โ€” do NOT hallucinate):
   [FILE: src/middleware/auth.ts] (127 lines)
   import { verify } from 'jsonwebtoken';
   ..."

The Worker sees real code, not imagined code. This is why Foreman's edits actually work.

Research Phase Intelligence

Each block gets 6 layers of context before execution:

 SOURCE                โ”‚ HOW IT WORKS
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
 Hot Memories          โ”‚ Recent, frequently accessed โ€” FIFO top 3
 Warm Memories         โ”‚ Tag-matched to block keywords
 Semantic Recall       โ”‚ Similarity engine scores past thoughts
 Embedding Search      โ”‚ Vector search over project codebase
 Cross-Chain Context   โ”‚ Relevant insights from parallel chains
 Web Search            โ”‚ Brave API โ€” best practices for the task

Dependency-Aware Block Ordering

Blocks aren't executed linearly. The Strategist produces a dependency graph, and Foreman computes execution waves:

  Block 1: Database schema        โ”€โ”
  Block 2: API routes             โ”€โ”คโ”€โ”€โ†’ Wave 0 (parallel-safe)
  Block 3: Auth middleware        โ”€โ”˜
  Block 4: API integration tests  โ”€โ”€โ†’ Wave 1 (depends on 1,2,3)
  Block 5: Frontend components    โ”€โ”€โ†’ Wave 1 (depends on 2)
  Block 6: E2E tests              โ”€โ”€โ†’ Wave 2 (depends on 4,5)

  Execution: W0:[1,2,3] โ†’ W1:[4,5] โ†’ W2:[6]

Within each wave, blocks run sequentially (shared filesystem safety). Future: parallel execution within waves.


How It Thinks โ€” A Real Example

Task: "Add a rate limiting middleware to the Express API"

Phase 1 โ€” ๐Ÿ”ฎ Vision (5% budget)
  "Rate limiting protects the API from abuse. Must be transparent
   (X-RateLimit headers), configurable per-route, and fail gracefully
   with 429 responses. No external dependencies if possible."

Phase 2 โ€” โš’๏ธ Strategy (10% budget)
  Block 1: Create rate limiter module (sliding window algorithm)
    Atom 1.1: Implement token bucket with configurable limits
    Atom 1.2: Add per-route configuration support
  Block 2: Integrate middleware
    Atom 2.1: Wire into Express app with default limits
    Atom 2.2: Add X-RateLimit-* response headers
  Block 3: Verify
    Atom 3.1: Write tests for edge cases (burst, reset, per-IP)
    Atom 3.2: Run existing tests โ€” verify zero regressions

Phase 3 โ€” ๐Ÿ” Research (15% budget)
  Read: src/server.ts, src/middleware/, package.json
  Grep: "rate" "limit" "throttle" across codebase
  Web: IETF rate limiting headers spec (RFC 6585)

Phase 4 โ€” ๐Ÿ”จ Worker (per atom, 8-step protocol)
  For each atom:
    read โ†’ context โ†’ impact โ†’ decide โ†’ predict โ†’ execute โ†’ verify โ†’ report
  
  After each atom:
    โ†’ VerificationEngine parses test output
    โ†’ ReviewerGate (different model) checks against Vision
    โ†’ If REJECT โ†’ retry with feedback
    โ†’ If tests fail โ†’ RollbackEngine reverts to last checkpoint

Result: Rate limiter added, 12 tests passing, 0 regressions, $0.03 cost

File Structure

foreman/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ orchestrator.ts              # 4-layer pipeline coordinator
โ”‚   โ”œโ”€โ”€ engine.ts                    # Core engine โ€” 30+ subsystems
โ”‚   โ”œโ”€โ”€ tools.ts                     # 52 LLM tool definitions
โ”‚   โ”œโ”€โ”€ types.ts                     # Core type system
โ”‚   โ”œโ”€โ”€ prompts.ts                   # Layer-specific system prompts
โ”‚   โ”œโ”€โ”€ parser.ts                    # Structured output parser
โ”‚   โ”œโ”€โ”€ validators.ts                # Confidence + protocol validation
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ # โ”€โ”€โ”€ Execution โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚   โ”œโ”€โ”€ execution-engine.ts          # Shell commands + process mgmt
โ”‚   โ”œโ”€โ”€ worker-executor.ts           # 8-step protocol bridge
โ”‚   โ”œโ”€โ”€ edit-engine.ts               # Surgical text edits
โ”‚   โ”œโ”€โ”€ batch-file-engine.ts         # Atomic multi-file writes
โ”‚   โ”œโ”€โ”€ git-engine.ts                # Git operations
โ”‚   โ”œโ”€โ”€ diff-engine.ts               # Diff generation + summary
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ # โ”€โ”€โ”€ Intelligence โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚   โ”œโ”€โ”€ cognitive-router.ts          # Multi-provider load balancer
โ”‚   โ”œโ”€โ”€ context-intelligence.ts      # 5-tier context management
โ”‚   โ”œโ”€โ”€ context-compression.ts       # Progressive summarization
โ”‚   โ”œโ”€โ”€ context-guard.ts             # Context window enforcement
โ”‚   โ”œโ”€โ”€ compaction-engine.ts         # LLM-based thought compression
โ”‚   โ”œโ”€โ”€ similarity-engine.ts         # Text similarity scoring
โ”‚   โ”œโ”€โ”€ embedding-engine.ts          # Embedding-based search
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ # โ”€โ”€โ”€ Safety โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚   โ”œโ”€โ”€ hallucination-guard.ts       # Pipeline-integrated guard
โ”‚   โ”œโ”€โ”€ ground-truth-engine.ts       # Codebase fact extraction
โ”‚   โ”œโ”€โ”€ fact-checker.ts              # LLM output validation
โ”‚   โ”œโ”€โ”€ ground-truth-validator.ts    # Worker output validation
โ”‚   โ”œโ”€โ”€ security-scanner.ts          # Project security scan
โ”‚   โ”œโ”€โ”€ verification-engine.ts       # Build/test/server parsing
โ”‚   โ”œโ”€โ”€ reviewer-gate.ts             # Independent review tribunal
โ”‚   โ”œโ”€โ”€ rollback-engine.ts           # Git-based undo system
โ”‚   โ”œโ”€โ”€ approval-engine.ts           # Human-in-the-loop gate
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ # โ”€โ”€โ”€ Observability โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚   โ”œโ”€โ”€ pipeline-observer.ts         # Full pipeline tracing
โ”‚   โ”œโ”€โ”€ streaming-pipeline.ts        # Real-time event streaming
โ”‚   โ”œโ”€โ”€ cost-tracker.ts              # Per-model cost tracking
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ # โ”€โ”€โ”€ LLM Providers โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚   โ”œโ”€โ”€ provider.ts                  # Provider interface + registry
โ”‚   โ”œโ”€โ”€ kimi-provider.ts             # Moonshot Kimi K2.5
โ”‚   โ”œโ”€โ”€ gemini-provider.ts           # Google Gemini
โ”‚   โ”œโ”€โ”€ anthropic-provider.ts        # Anthropic Claude
โ”‚   โ”œโ”€โ”€ openai-provider.ts           # OpenAI GPT-4o
โ”‚   โ”œโ”€โ”€ antigravity-provider.ts      # Google Antigravity
โ”‚   โ”œโ”€โ”€ model-fallback.ts            # Error classification + fallback
โ”‚   โ”œโ”€โ”€ model-discovery.ts           # Available model detection
โ”‚   โ”œโ”€โ”€ retry.ts                     # Retry with backoff
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ # โ”€โ”€โ”€ Multi-Agent โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚   โ”œโ”€โ”€ subagent-engine.ts           # Sub-agent lifecycle
โ”‚   โ”œโ”€โ”€ agent-mesh/                  # Agent registry + health
โ”‚   โ”‚   โ”œโ”€โ”€ agent-registry.ts
โ”‚   โ”‚   โ”œโ”€โ”€ types.ts
โ”‚   โ”‚   โ””โ”€โ”€ index.ts
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ # โ”€โ”€โ”€ Messaging โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚   โ”œโ”€โ”€ messaging-gateway.ts         # Central message hub
โ”‚   โ”œโ”€โ”€ telegram-channel.ts          # Telegram bot
โ”‚   โ”œโ”€โ”€ whatsapp-channel.ts          # WhatsApp (Baileys)
โ”‚   โ”œโ”€โ”€ channel.ts                   # Channel interface
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ # โ”€โ”€โ”€ Web & Research โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚   โ”œโ”€โ”€ browser-engine.ts            # Headless Playwright
โ”‚   โ”œโ”€โ”€ web-search-engine.ts         # Brave Search API
โ”‚   โ”œโ”€โ”€ web-fetch-engine.ts          # URL content extraction
โ”‚   โ”œโ”€โ”€ research-engine.ts           # Research coordination
โ”‚   โ”œโ”€โ”€ link-intelligence.ts         # URL classification
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ # โ”€โ”€โ”€ State & Memory โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚   โ”œโ”€โ”€ state.ts                     # State persistence
โ”‚   โ”œโ”€โ”€ memory-manager.ts            # Memory CRUD
โ”‚   โ”œโ”€โ”€ memory-md-bridge.ts          # Memory.md sync
โ”‚   โ”œโ”€โ”€ session-manager.ts           # Session persistence
โ”‚   โ”œโ”€โ”€ multi-session.ts             # Multi-chat sessions
โ”‚   โ”œโ”€โ”€ session-lifecycle.ts         # Session lifecycle hooks
โ”‚   โ”œโ”€โ”€ cache-manager.ts             # Response cache
โ”‚   โ”œโ”€โ”€ thought-manager.ts           # Thought persistence
โ”‚   โ”œโ”€โ”€ chain-manager.ts             # Chain persistence
โ”‚   โ”œโ”€โ”€ chain-repair.ts              # Chain health checks
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ # โ”€โ”€โ”€ Infrastructure โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ”‚   โ”œโ”€โ”€ cli.ts                       # 47 CLI commands
โ”‚   โ”œโ”€โ”€ config.ts                    # ~/.foreman configuration
โ”‚   โ”œโ”€โ”€ theme.ts                     # Forge visual theme
โ”‚   โ”œโ”€โ”€ animations.ts                # CLI animations
โ”‚   โ”œโ”€โ”€ rate-limiter.ts              # Request rate limiting
โ”‚   โ”œโ”€โ”€ process-registry.ts          # Background process tracking
โ”‚   โ”œโ”€โ”€ command-queue.ts             # Sequential command queue
โ”‚   โ”œโ”€โ”€ task-manager.ts              # Task board
โ”‚   โ”œโ”€โ”€ task-scheduler.ts            # Scheduled tasks
โ”‚   โ”œโ”€โ”€ cron-engine.ts               # Cron job management
โ”‚   โ”œโ”€โ”€ project-detector.ts          # Project type detection
โ”‚   โ”œโ”€โ”€ identity-engine.ts           # Agent identity
โ”‚   โ”œโ”€โ”€ hooks-engine.ts              # Pipeline hooks
โ”‚   โ”œโ”€โ”€ onboarding.ts                # First-run setup
โ”‚   โ”œโ”€โ”€ errors.ts                    # Error types + helpers
โ”‚   โ”œโ”€โ”€ markdown-intelligence.ts     # Markdown parsing
โ”‚   โ”œโ”€โ”€ transcript-repair.ts         # Broken transcript repair
โ”‚   โ”œโ”€โ”€ forge-gateway.ts             # Forge bridge
โ”‚   โ”œโ”€โ”€ media-engine.ts              # Media analysis
โ”‚   โ”œโ”€โ”€ message-actions.ts           # Message action handlers
โ”‚   โ”œโ”€โ”€ interactive-confirm.ts       # Interactive prompts
โ”‚   โ”œโ”€โ”€ pipeline-resume.ts           # Checkpoint/resume
โ”‚   โ””โ”€โ”€ file-watcher.ts              # File change detection
โ”‚
โ”œโ”€โ”€ bin/
โ”‚   โ””โ”€โ”€ foreman                      # CLI entry point
โ”‚
โ”œโ”€โ”€ foreman-showcase/
โ”‚   โ””โ”€โ”€ index.html                   # Product showcase page
โ”‚
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ tsconfig.json

Built with โš’๏ธ by @SovranAMR

"It doesn't just write code. It thinks, verifies, and takes responsibility."

About

Autonomous AI Coding Agent with a 4-layer cognitive pipeline and HallucinationGuard. Built for production-grade reliability.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages