Skip to main content

DevFlow v2 CLI-first engine (projects, stories, execution store, review packets)

Project description

DevFlow Engine (v2)

CLI-first Python engine for DevFlow v2.

Goals

  • Project lifecycle: draft shell -> bind workspace/repo -> init/register/list/remove
  • Story lifecycle: index/validate/register/execute
  • Planning support: repo analysis -> source docs -> scopes -> approved scope -> idea(s) -> DevFlow stories
  • Implementation workflow: "green" gate = tests + typecheck + lint
  • Review workflow: story-driven compliance/soundness/security review packets persisted in SQLite
  • Error workflow: error queue + remediation runs
  • Execution store: .devflow/execution.sqlite

Documentation

  • docs/story-implementation-planning-node.md — per-story planning/gating node before TestDesign/Red, with dependency findings, queue decisions, and registry expectations consumed by downstream implementation nodes.

Install / Dev

This repo is intended to be run with uv.

cd devflow_engine
uv venv
uv pip install -e '.[dev]'

Run the CLI:

devflow --help

Happy path

  1. project shell created in control plane
  2. workspace/repo bound to project
  3. registration DAG runs via devflow project init or devflow project import
  4. project reaches ready_for_source_scope
  5. source docs -> scopes
  6. approved scope -> idea(s)
  7. idea -> DevFlow stories
  8. story -> implementation
  9. implementation -> review

Quickstart

Register an existing repo with DevFlow:

devflow project init --name my-repo

Create and register a new repo from a template:

devflow project import /absolute/path/to/my-repo --init python

Clone and register an existing GitHub repo:

devflow project import owner/repo

Draft story contracts based on repo scan:

devflow plan analyze
ls .devflow/drafts

Validate and register a story:

devflow story validate .devflow/drafts/DF-PLAN-001.yaml
devflow story register .devflow/drafts/DF-PLAN-001.yaml

Run the "green gate":

devflow impl gate
# or
./scripts/green.sh

Generate a review packet:

devflow review run DF-PLAN-001

Inspect errors:

devflow error list

Inspect per-node outputs from a stored run:

# dump a specific run by run_id
python scripts/dump_run_node_outputs.py \
  --run-id <run_uuid>

# or dump the latest run for any DAG by dag_id
python scripts/dump_run_node_outputs.py \
  --dag-id implementation_dag

# second-most-recent run for that DAG
python scripts/dump_run_node_outputs.py \
  --dag-id implementation_dag \
  --latest-index 2

Dumps are written under .devflow/node_output_dumps/<dag>/<label>/<timestamp>/ by default. The navigation path intentionally stays human-readable and omits run IDs / object IDs where possible:

  • <dag> comes from runs.dag_id unless it looks like an ID, in which case the folder falls back to dag
  • <label> is derived from readable config fields such as label, name, title, idea_title, scope_title, or story_title
  • the exact run_id still lands in manifest.json inside the dump directory

Use --output-root /tmp/devflow-dumps to write somewhere else.

Run the source -> scope scaffold end-to-end:

devflow source-scope run \
  --project-id proj_demo \
  --intake-id source_demo \
  --text "Customers approve quotes online. Approved quotes create jobs. Completed jobs create invoices and customers can pay online."

Gate a pre-shaped normalized packet + scope outline deterministically:

devflow source-scope gate \
  --project-id proj_demo \
  --source-packet .devflow/path/to/normalized_source_packet.json \
  --scope-outline .devflow/path/to/scope_outline.json

Story contracts

Story contracts are YAML documents containing:

  • id, title
  • planes: required plane write-ups (product, ux, technical, security, compliance, operations)
  • plane_oracles: list of {plane, anchor} entries used as verification anchors

The contract validator enforces presence of required planes + non-empty plane_oracles.

Execution store

All runs/events/errors/review packets are stored in:

  • .devflow/execution.sqlite

This database is created automatically on first CLI usage.

Workers / Background services

Supabase execution-event listener (devflow worker supabase-events)

This is the DFE-side listener/dispatcher for the devflow_execution_events Supabase table. It is the single long-running process that bridges the control-plane (Supabase) to the local DevFlow engine — picking up queued events and dispatching the appropriate DFE workflow for each.

Normal operation (continuous loop with Realtime):

devflow worker supabase-events

Starts an indefinite polling loop. While running it also opens a Supabase Realtime WebSocket subscription on devflow_execution_events. New INSERT events on that table wake the dispatch loop immediately rather than waiting for the next poll interval (default: 3 s). If the WebSocket connection drops it reconnects automatically in the background; polling continues as the fallback during any gap.

Process a single queued event and exit:

devflow worker supabase-events --once

Useful for manual trigger / smoke testing.

Disable Realtime (polling only):

devflow worker supabase-events --no-realtime

Runs the same polling loop but skips the WebSocket listener entirely. Use this when the websockets Python package is unavailable, or when you need to debug without a live connection.

Additional options:

Flag Default Description
--sleep-seconds N 3.0 Idle sleep between polls (also caps realtime wake latency)
--max-iterations N unlimited Stop after N loop iterations
--json off Emit JSON summary on exit

When queued events are not being picked up — checklist:

  1. Verify the worker is running: there should be a live devflow worker supabase-events process.
  2. Check Supabase credentials: SUPABASE_URL and SUPABASE_SERVICE_KEY (or equivalent config) must be set and valid.
  3. Confirm the event row in devflow_execution_events has status = queued and run_id IS NULL — events with any other status are skipped.
  4. Check that the event's event_type is in the supported set (see docs/queue-worker-infra.mdSupported event types).
  5. Run with --once to get an immediate result and check stderr/stdout for errors.
  6. If Realtime is misbehaving (false wake-ups or missed wakes), try --no-realtime to isolate the issue to the polling path.

See docs/queue-worker-infra.md for full architecture details.

Design notes

  • docs/scope-idea-agentification.md — current scope->idea agentic runtime notes
  • docs/ui-grounding-curtis-medium-tier-doctrine.md — follow-on UI grounding / wireframe planning doctrine from the Curtis pass, including the proposed ui_screen_inventory.json contract and the default medium-tier minimum for customer-facing wireframes

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

devflow_engine-1.1.21.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devflow_engine-1.1.21-py3-none-any.whl (801.4 kB view details)

Uploaded Python 3

File details

Details for the file devflow_engine-1.1.21.tar.gz.

File metadata

  • Download URL: devflow_engine-1.1.21.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for devflow_engine-1.1.21.tar.gz
Algorithm Hash digest
SHA256 8d8af37f0ca4a5f6e3e67b85329037659b102f84ff925ed2f928cc54f3e3ef2c
MD5 a895bbd7054861699a8440441cc5faa9
BLAKE2b-256 1b53854c6219149f9dffa711e6b2d6b073af2ec2f305f19fde150d999b726157

See more details on using hashes here.

File details

Details for the file devflow_engine-1.1.21-py3-none-any.whl.

File metadata

File hashes

Hashes for devflow_engine-1.1.21-py3-none-any.whl
Algorithm Hash digest
SHA256 204826db7904bd5ec70c6701842ed9ad6e96c9d1101b1b5b676ab7b08a3be558
MD5 c5889b62e2cbb01d3f79fbb4007707b2
BLAKE2b-256 dd0afc4e66c0c3fdc3f7d0bf2c5991dfd95f234a36ed555c94dc74af7a808661

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page