Metadata-Version: 2.4
Name: local-dark-factory
Version: 0.1.0
Summary: Sovereign, local-first autonomous AI Software Factory orchestrator
Author: Dark Factory Team
License-Expression: MIT
Project-URL: Homepage, https://senssei.github.io/local-dark-factory/
Project-URL: Source, https://github.com/senssei/local-dark-factory
Project-URL: Documentation, https://senssei.github.io/local-dark-factory/
Project-URL: Changelog, https://github.com/senssei/local-dark-factory/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/senssei/local-dark-factory/issues
Keywords: ai,code-generation,local-llm,autonomous-agents,sdlc,offline,zero-cloud,sovereign-ai
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Code Generators
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.31.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: ruff>=0.4.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.6.0; extra == "docs"
Requires-Dist: mkdocs-material>=9.5.0; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.25.0; extra == "docs"
Dynamic: license-file

# Sovereign Dark Factory (`local-dark-factory`)

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Documentation](https://img.shields.io/badge/docs-GitHub%20Pages-teal.svg)](https://senssei.github.io/local-dark-factory/)
[![CI](https://github.com/senssei/local-dark-factory/actions/workflows/ci.yml/badge.svg)](https://github.com/senssei/local-dark-factory/actions/workflows/ci.yml)
[![Zero Cloud Tokens](https://img.shields.io/badge/Cloud%20Tokens-%240.00-success.svg)](intent.md)
[![Hardware](https://img.shields.io/badge/Hardware-NVIDIA%20RTX%205070-76b900.svg)](intent.md)

A local-first, zero-cloud-token **AI Software Factory** that coordinates coding agents in fast, isolated git worktrees, enforces deterministic verification gates, preserves patches and execution evidence, and integrates human-in-the-loop governance.

> *"Make sure you own your AI. AI in the cloud is not aligned with you; it’s aligned with the company that owns it."*

---

## 📖 AI-Native SDLC Architecture

This project follows the **[AI-Native SDLC Playbook](https://claude.com/blog/the-ai-native-sdlc-playbook)**:

| Artifact | Purpose | Status |
|---|---|---|
| [**`intent.md`**](intent.md) | The Planning Artifact: Problem statement, vision, constraints, and success criteria. | ✅ Established |
| [**`spec.md`**](spec.md) | Technical Specification: Architecture, data contracts, and component interfaces. | ✅ Established |
| [**`CLAUDE.md`**](CLAUDE.md) | Project Operating Manual: Build/test commands, non-negotiable rules, and architectural guidelines. | ✅ Established |
| [**`AGENTS.md`**](AGENTS.md) | Agent Instructions: Guidelines for local inference skills (`local-coder`) and code standards. | ✅ Established |
| [**`plan.md`**](plan.md) | Implementation Roadmap: Phased execution plan from domain contracts to E2E CLI. | ✅ Established |
| [**`REVIEW.md`**](REVIEW.md) | Governance & Review Policy: Human-in-the-loop (HITL) criteria and operator commands. | ✅ Established |

---

## 🔗 The Local Stack Integration

Unlike existing cloud-bound prototypes, the Sovereign Dark Factory runs entirely on your workstation without cloud dependencies:

```text
Task Submission (CLI / Trigger)
       │
       ▼
Durable SQLite Workflow Engine (.factory/factory.db)
       │
       ▼
Disposable Git Worktree Sandbox
       │
       ▼
Local Agent Harness (local-coder)
       ├── Ollama (:11434): qwen2.5-coder:14b / 7b
       └── Prism CUDA (:5272): phi4-mini / ONNX GenAI (Prism)
       │
       ▼
Deterministic Verification Gates (test.sh / pytest / cargo / npm)
       │
       ├──[Failed]──► AST Self-Healing Loop (max N retries)
       │
       └──[Passed]──► Evidence Locker (.factory/runs/<RUN_ID>/diff.patch)
                            │
                            ▼
               Human-in-the-Loop Review Gate (dark-factory review --approve)
```

> [!NOTE]
> **Sandbox Isolation Scope**: Git worktrees isolate repository files and branch commits, preventing concurrent runs from colliding. They do not provide OS process or network isolation; verification steps execute on the host with the sanitized environment (stronger process sandboxing is tracked in [plan.md](plan.md) §10.5).

---

## 🚀 Quick Start (Development)

```bash
# 1. Health check local engines & GPU
python3 -m dark_factory.cli doctor

# 2. Run unit tests
pytest tests/ -v

# 3. Submit a dark factory task
python3 -m dark_factory.cli run \
  --repo /path/to/repo \
  --task "Implement thread-safe token bucket limiter" \
  --gates default

# 4. Run the repeatable real-model benchmark suite
dark-factory eval --list

# 5. Browse run history, evidence, and eval reports (local, read-only, 127.0.0.1 only)
dark-factory dashboard
```
