Skip to content

roydsouza/dark-factory

Repository files navigation

Dark Factory

The unified coding workflow engine for AntiGravity Station. Every project built at the station — including dark-factory itself — runs through this pipeline.

Dark Factory enforces separation between who plans, who builds, who reviews, and who audits. Artifact-gated transitions mean no phase can begin until the previous one produced a verified file on disk. No prose claims. No self-certification.


The Five Entities

Entity Type Role Output
Architect Internal persona Requirements → TASKS.md TASKS.md with escalation flags
Forge Internal persona Implementation Briefing in crucible-inbox/
Crucible Internal persona Adversarial review Verdict in crucible-verdicts/
Skeptic Local LLM (Qwen 3.5) Independent challenge Feedback in crucible-inbox/
Auditor External session Final authority Verdict in auditor-feedback/

Internal personas are AntiGravity/Gemini operating under strict role constraints. Skeptic and Auditor run in completely separate processes with no shared context.


The Pipeline

[Architect:]  requirements → TASKS.md
      ↓           gate: architect-pre-handoff.sh
[Forge:]      TASKS.md → code → crucible-inbox/forge-briefing.md
      ↓           gate: forge-pre-submit.sh
[Crucible:]   reads briefing from disk (FRESH CONTEXT, no conversation bleed)
              re-runs verification independently
              → CONDITIONAL / VETOED: back to Forge
              → CLEARED: proceed
      ↓           gate: crucible-pre-skeptic.sh
  Skeptic      adversarial challenge via MCP
              → new issues: back to Forge
              → satisfied: proceed
      ↓           gate: auditor-pre-request.sh
  Roy HITL    decides whether to invoke Auditor
[Auditor:]    separate session, reads auditor-inbox/, writes auditor-feedback/
      ↓
[Crucible:]   processes verdict → marks task [x]

Directory Layout

dark-factory/
├── CONTEXT.md           Canonical agent context — all agents read this first
├── PROCESS.md           Full workflow specification with artifact formats
├── RUNBOOK.md           Roy's operational guide — how to drive a PIV cycle
├── CLAUDE.md            Claude Code supplement
├── GEMINI.md            Gemini CLI supplement
│
├── personas/            Persona protocols and gate scripts
│   ├── architect/       charter.py, gate.py, protocol.md
│   ├── forge/           charter.py, gate.py, protocol.py
│   ├── crucible/        charter.py, gate.py, protocol.py, skeptic_bridge.md
│   └── ANTIGRAVITY_RULES.md    Anti-hallucination rules H-1..H-6
│
├── workflows/           YAML workflow definitions
│   ├── piv-standard.yaml       Full PIV loop (standard use)
│   ├── piv-hotfix.yaml         Abbreviated loop (trivial [skip-skeptic] tasks only)
│   └── audit-only.yaml         Standalone Auditor review
│
├── gates/               Deterministic bash gate scripts — no AI, exit 0/1
│   ├── gate-lib.sh              Shared gate utilities
│   ├── architect-pre-handoff.sh
│   ├── forge-pre-submit.sh
│   ├── crucible-pre-verdict.sh
│   ├── crucible-pre-skeptic.sh
│   └── auditor-pre-request.sh
│
├── harness/             Python infrastructure
│   ├── harness_lib.py           Lock, signals, gate formatting
│   └── executor.py              Workflow executor — detects active phase, prints protocol
│
├── skeptic/             Local Skeptic MCP server (Qwen 3.5 via llm-gateway)
│   ├── server.py                FastMCP server exposing challenge_agent()
│   ├── skeptic.py               ReAct loop agent
│   ├── personas.json            hawk, inspector, advocate, monkey
│   └── CONTEXT.md               Skeptic role and invocation guide
│
├── auditors/            External Auditor setup files
│   ├── README.md                Auditor protocol overview
│   ├── claude-code.md           Claude Code as Auditor — setup and verdict format
│   └── gemini-cli.md            Gemini CLI as Auditor
│
├── factory/             Factory engine — STASIS, Z3, Aethereum-Spine, lifecycle
│   ├── CONTEXT.md               Component table, verification commands, current state
│   ├── OPERATIONS.md            Spacecraft lifecycle operations
│   ├── bridge/                  dock.sh, launch.sh, pre-submit.sh, bootstrap.sh
│   ├── core/stasis/             STASIS 3-tier language (Datalog/CHR/Prolog)
│   ├── core/safety-rail/        Z3 Safety Rail (Rust + Wasmtime)
│   ├── core/aethereum-spine/    Go orchestration spine
│   └── merkle-log/              Append-only audit trail — never delete entries
│
└── assembly-lines/      Per-project working directories
    ├── README.md                How to create and use assembly lines
    ├── _template/               Scaffold for new assembly lines
    └── dark-factory-core/       dark-factory's own self-improvement line

Start Here

You are... Read first
Roy (operator running a task) RUNBOOK.md — the trigger sequence
AntiGravity/Gemini starting a session CONTEXT.md → your persona's protocol.md
Claude Code invoked as Auditor auditors/claude-code.md
Reading the codebase for the first time This file → CONTEXT.mdPROCESS.md

Infrastructure Dependency

The Skeptic requires llm-gateway running on port 8000 (Qwen 3.5 model loaded). All other components are self-contained. See ~/antigravity/llm-gateway/ for gateway setup.

About

Dark Factory: unified coding workflow engine (Architect/Forge/Crucible/Skeptic/Auditor)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors