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) links plain-Markdown human goals directly to executable tests inside your repository. Stakeholders, engineers, and AI coding agents read the exact same contract, and verdicts come solely from executed checks — never manual checkboxes.

Overview · Benefits · Installation · Usage · Example · Documentation

Overview

Requirements rot in external wikis when tests verify implementation trivia instead of user outcomes and releases ship on guesswork.

ff organizes every domain inside factory/ using implicit <domain> filenames:

  • Intents (intents/<domain>.md) state why a capability matters for humans (User Stories recommended).
  • Specs (specs/<domain>.md) define what the system guarantees (Given/When/Then or EARS recommended, with optional parent overview prose).
  • Checks (tests/* + optional checks/<domain>.yaml) run real behavioral tests in any language and enforce standard JSON Schema metric bounds.
  • Proofs (proofs/<domain>.json) record file 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 overview prose with zero {#id} anchors or [x] checkboxes. Folder and heading names wire intent <- spec <- check automatically, and splitting a proven spec into deeper child leaves stays frictionless.
  • Zero-boilerplate pytest & polyglot runners. Use Python (ff_record built-in plugin or standard record_property), Bash, Node.js, Go, Java, or Rust in parallel with optional $FF_RECORD JSON output.
  • Standard metric rules & single source of truth. Declare bounds once under specs.<id>.metrics using JSON Schema keywords (minimum, maximum, const, optional unit) — omit checks/<domain>.yaml completely when conventions suffice.
  • Anti-weakening governance. Track breaking shifts in factory/changes/YYYY-MM-DD_<slug>.md (with optional issue: links); ff verify --base blocks silent deletion or weakening of proven specs and bounds.
  • Ready for humans and agents. Export standalone HTML, Markdown, CSV, or JSONL reports with ff export, install the /ff skill from skills/ff/ (or ff skill install), and serve read-only context with ff mcp.

Installation

Requires Python 3.14+ on Linux or macOS with uv:

uv tool install --python 3.14 factory-framework

Include [pytest] for built-in pytest fixtures and [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 tests/test_hello.py with built-in ff_record
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 script (or pytest check via --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 rules, and latest evidence for any item.
  • ff lint and ff verify — check headings, schemas, proof parity, and --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 require fast, accurate checkout totals 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 metric bounds and script target in factory/checks/checkout.yaml:

version: 1
specs:
  spec_checkout_fast-totals_latency:
    metrics:
      p95_ms: { maximum: 50, unit: ms }
checks:
  test_checkout_fast_totals_latency:
    file: tests/check_checkout.py

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 pytest? Omit checks/checkout.yaml's checks: block, name your function test_checkout_fast_totals_latency(ff_record: Recorder), and omit file: — ff discovers tests/test_checkout.py automatically via the built-in pytest11 plugin.

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.4.0

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.4.0
File Size Uploaded Provenance Actions
factory_framework-0.4.0.tar.gz 57.2 kB With provenance Details for factory_framework-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 121.8 kB

Release files / factory_framework-0.4.0.tar.gz

Download URL factory_framework-0.4.0.tar.gz
Size 57.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ddb7cbd1d114e20f10dad2c09856cde2d57ec259a147e50d6965484ec9557e04
BLAKE2b-256 checksum
How to use checksums
c3f0102526b6177f0328dd84fc4f63ef52c25f7a21de16d70f760a0562d1d5b5
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 16, 2026.

Transparency log

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

Download URL factory_framework-0.4.0-py3-none-any.whl
Size 64.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d3d241e543d34800cc9cb2b7be5b79283adb019f8b85e02050fa86d34cec05e4
BLAKE2b-256 checksum
How to use checksums
99ca8aaa2c3f5859d6502599a6d0050453212748661f7f4285cabdacb92b459f
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 16, 2026.

Transparency log

Security for factory-framework 0.4.0

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.4.0.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 16, 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.4.0 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