Skip to main content

Factory Framework mirrored F | F logo

Factory Framework

Turn plain-Markdown requirements into proven software.

CI Python 3.14+ License: MIT

Factory Framework (ff) connects human product goals to automated tests in plain files inside your repository. Product owners, engineers, and AI coding agents work from one source of truth, and proof reports come from real executions — never manual checkboxes.

Overview · Benefits · Installation · Usage · Example · Documentation

Overview

Teams lose alignment when requirements live in wikis, tests check implementation details instead of user outcomes, and nobody knows what is truly proven.

ff organizes every domain inside factory/ with 1-to-1 file symmetry:

  • Intents (intents/<domain>.md) capture why a capability matters for humans (User Stories recommended).
  • Specs (specs/<domain>.md) define what the system guarantees (Given/When/Then or EARS recommended).
  • Checks (checks/<domain>.yaml + tests/*) map specs and numeric bounds to real tests in any language.
  • Proofs (proofs/<domain>.json) record digests, measured metrics, evidence, and computed PROVEN, FAILING, UNPROVEN, UNCLEAR, or ERROR verdicts.

How Factory Framework links Markdown intents and specs to parallel tests and domain proofs

Benefits

  • Plain Markdown, zero clutter. Write pure headings and prose with zero {#id} anchors or [x] checkboxes. Folder and heading names wire intent <- spec <- check automatically.
  • Computed verdicts you can trust. A spec turns PROVEN only when its checks execute, exit 0, and satisfy every metric bound declared in checks/<domain>.yaml.
  • Polyglot by default. Run Python, Bash, Node.js, Java, Go, or Rust tests in parallel. Scripts can optionally write JSON metrics and evidence to $FF_RECORD, or keep using plain exit codes.
  • Change accountability built in. Document contract shifts in factory/changes/YYYY-MM-DD_<slug>.md or labeled GitHub issues; ff verify --base blocks silent weakening of proven specs, checks, or thresholds.
  • Built for both humans and coding agents. Export polished HTML, Markdown, CSV, or JSONL summaries with ff export, and equip agents with /ff (ff skill install) and optional read-only ff mcp.

Installation

Requires Python 3.14+ on Linux or macOS with uv:

uv tool install --python 3.14 factory-framework

Add optional extras when needed ([pytest] for pytest test-suite helpers, [mcp] for the read-only MCP server):

uv tool install --python 3.14 "factory-framework[pytest,mcp]"

Usage

Scaffold a starter contract, run checks, verify reproducibility, and export a report:

ff init --example          # Add --pytest to scaffold pytest fixtures instead of a standalone script
ff run
ff status
ff verify --strict
ff export -f html -o proof-report.html

Everyday commands at a glance:

  • ff init [--example] [--pytest] — create factory/ with a zero-dependency starter check (or pytest fixtures with --pytest).
  • ff status and ff ls --tree — inspect domain verdicts and trace links from intents to specs and checks.
  • ff show <id> — read full statements, metric bounds, and latest recorded evidence for any item.
  • ff lint and ff verify — check domain symmetry (FF001–FF012), re-run tests, and enforce --base anti-weakening rules (FFR0–FFR4).
  • ff export -f html|md|csv|jsonl — share proof reports with stakeholders.
  • ff skill install and ff mcp — equip coding agents with /ff workflow instructions and read-only contract inspection.

Example

Suppose you want fast, accurate checkout pricing in domain checkout.

1. State why in factory/intents/checkout.md:

# Checkout

## Fast Totals

As a shopper, I want accurate order totals immediately, so that slow pricing never delays my purchase.

2. State what in factory/specs/checkout.md:

# Checkout

## Fast Totals

### Latency

Given a cart with regional shipping rules, when checkout totals are requested, then pricing, tax, and totals return in 50 ms or less.

3. Declare bounds and check targets in factory/checks/checkout.yaml:

version: 1
domain: checkout

checks:
  check_checkout_fast-totals_latency:
    file: tests/check_checkout.py
    metrics:
      p95_ms: { max: 50, precision: 0, unit: ms }

4. Prove it with a behavioral check in factory/tests/check_checkout.py:

import json, os
from pathlib import Path

elapsed_ms, body = call_checkout(items=3, region="EU")
assert body["tax"] > 0 and body["total"] > body["subtotal"]

if record_path := os.environ.get("FF_RECORD"):
    Path(record_path).write_text(
        json.dumps(
            {
                "summary": "Checkout returned tax and totals under 50 ms",
                "metrics": {"p95_ms": elapsed_ms},
                "evidence": [f"p95_ms={elapsed_ms}", f"total={body['total']}"],
            }
        ),
        encoding="utf-8",
    )

Using Bash, JavaScript, Go, Java, or pytest? Point file: at .sh/.mjs/.js scripts, use argv: [go, test, ./...] for compiled binaries, or pass --pytest on ff init for ff_record pytest fixtures.

5. Run and inspect the verdict:

ff run
ff status
Factory: shop-api  |  Proofs: fresh  |  Gate: PASSED
Intents: 1/1 proven  |  Specs: 1/1 proven  |  Checks: 1/1 passing

Explore examples/demo-service/ for a multi-domain pytest + Bash project and examples/checks/ for reusable check recipes.

Documentation

Metadata

Release files for factory-framework 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for factory-framework 0.3.1
File Size Uploaded Provenance Actions
factory_framework-0.3.1.tar.gz 57.0 kB With provenance Details for factory_framework-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for factory-framework 0.3.1
File Interpreter ABI Platform Actions
factory_framework-0.3.1-py3-none-any.whl Python 3 none any Details for factory_framework-0.3.1-py3-none-any.whl

Total release size: 121.2 kB

Release files / factory_framework-0.3.1.tar.gz

Download URL factory_framework-0.3.1.tar.gz
Size 57.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b244c70fed21deb08ade50e29e5045e4cdbefbb425314aa9e905c8816b985ca7
BLAKE2b-256 checksum
How to use checksums
f7648540ddd1494d3c053b6e75139708188a7489b116c1ee92b8cba73bb78a2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / factory_framework-0.3.1-py3-none-any.whl

Download URL factory_framework-0.3.1-py3-none-any.whl
Size 64.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96de17d3bcb89004a240dfab342a3566fad827228d6c1ba1d2805fa026062201
BLAKE2b-256 checksum
How to use checksums
0faf9c9f126f38236b0eda9fafcad2bce88daf409a10bd85fee35b3279319290
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for factory-framework 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for factory_framework-0.3.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page