Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

v0.1.0 Architecture and Design Review Baseline

1. Objective

Define one implementation-ready baseline for devflow so we can:

  1. Agree architecture boundaries.

  2. Lock design details and non-goals.

  3. Run a review gate before implementation starts.

This document consolidates the existing brainstorm and decision docs into one practical plan.

2. Scope and Non-Goals

In scope for v0.1.0:

Out of scope for v0.1.0:

3. Architecture Overview

Architecture constraints:

4. Workspace Structure (Target)

devflow/
  Cargo.toml
  crates/
    devflow-core/
    devflow-cli/
    devflow-policy/
    devflow-gh/
    devflow-ext-rust/
    devflow-ext-node/
  examples/
    rust-lib/
    node-ts/
  docs/

Ownership boundaries:

5. Canonical Command Contract

Command hierarchy for developer experience

Based on common workflows across Rust, Node, Python, JVM, and polyglot repos, commands work best when split into two levels:

First-principles rules used:

Primary commands (v0.1.0 baseline)

Primary commandPurposeTypical effect
setupPrepare local/CI prerequisites.Installs/syncs toolchains, dependencies, and optional container prerequisites.
fmtFormat source according to project rules.Uses selectors such as fmt:check (read-only) and fmt:fix (mutating).
lintRun static and policy checks.Reports code quality and policy violations.
buildCompile/package artifacts.Produces build outputs for current profile.
testRun automated tests.Executes selected test suites (test:unit, test:integration, etc.).
packageAssemble distributable outputs.Produces artifacts/images/bundles and metadata.
checkExecute policy-defined non-mutating gate.Composes selectors for contexts like check:pr, check:main, check:release.
releaseExecute release orchestration steps.Produces release candidates, publish steps, and release metadata.
ciManage CI contract generation and validation.Handles selectors such as ci:generate, ci:check, and ci:plan.

Secondary command families

Secondary commands may be exposed as:

Command behavior rules

Alternative considered

Alternative: many narrow top-level commands (unit-test, integration-test, security-scan, package, release-check). Decision: reject for v0.1.0 because it increases cognitive load and weakens cross-stack portability.

6. Configuration Contract (devflow.toml)

Minimum schema for v0.1.0:

[project]
name = "example"
stack = ["rust"]

[container]
image = "ghcr.io/org/repo-ci"
fingerprint_inputs = ["Dockerfile", "Makefile", "src-scripts/**", "rust-toolchain.toml"]

[cache]
root = ".cache/devflow"
strategy = "layered"

[targets]
pr = ["fmt:check", "lint:static", "build:debug", "test:unit", "test:integration"]
main = ["fmt:check", "lint:static", "build:release", "test:unit", "test:integration", "test:smoke"]
staging = ["fmt:check", "lint:static", "build:release", "test:unit", "test:integration", "test:smoke", "package:artifact"]

Rules:

7. Execution and Runtime Design

Execution model:

  1. Load devflow.toml.

  2. Resolve stack extensions.

  3. Build command DAG.

  4. Select runtime profile (container, host, or auto).

  5. Resolve execution identity (container fingerprint or host toolchain fingerprint).

  6. Resolve and restore cache layers.

  7. Execute task graph with deterministic ordering.

  8. Emit check status and artifacts.

Runtime profile policy:

Determinism & Orchestration constraints:

8. Container and Cache Design

Deep Dive: For a dedicated exploration of container debugging, engine determinism, and exact stack-agnostic volume mappings, refer to the Container and Cache Execution Design document.

Canonical cache root:

Policy:

9. CI Design Contract (GitHub Actions)

Job topology:

CI contract:

10. Extension System Design

Extension API requirements:

Extension discovery model

v0.1.0 supports two discovery sources:

  1. Built-in extensions linked with the binary.

  2. Local project extensions declared by path in config.

Post-v0.1.0 registry support (planned):

Extension declaration (proposed)

[extensions.rust]
source = "builtin"
version = "^0.1"

[extensions.node]
source = "builtin"
version = "^0.1"

[extensions.custom_lint]
source = "path"
path = "./tools/devflow-ext-custom-lint"
version = "0.1.0"

Versioning and compatibility checks

Extension loading lifecycle

  1. Discover configured extensions.

  2. Resolve versions against lock/constraints.

  3. Validate checksums/signatures (when source supports it).

  4. Run compatibility checks.

  5. Build command capability map.

  6. Load execution adapter and run health probe.

  7. Register into command dispatcher.

Compatibility lock file (proposed)

devflow.lock captures:

v0.1.0 extension sequence:

  1. devflow-ext-rust (first class).

  2. devflow-ext-node (baseline parity).

Deferred:

11. Phase-Gated Delivery Plan

Phase A0: governance and ADRs. Phase A1: core engine + command graph + container/cache contract. Phase A2: extension API with Rust and Node support. Phase A3: distribution and docs.

Mandatory phase gates:

12. Design Review Findings

Key strengths:

Key risks:

Required mitigations:

13. Review Checklist (Pre-Implementation Gate)

Architecture:

Runtime:

CI/Policy:

Developer UX:

Extensions:

14. Decisions to Confirm Before Implementation

  1. Cache env var name: DEVFLOW_CACHE_ROOT.

  2. PR gate defaults: keep test:smoke required in PR or move to main only.

  3. Runtime profile default: container for all projects, or auto with host fallback by default.

  4. Node extension scope in v0.1.0: baseline (fmt/lint/test/build) or full parity including test:smoke.

  5. Extension discovery scope in v0.1.0: built-in only, or built-in + local-path extensions.

  6. Workflow ownership: generated files committed to repo or generated on-demand in CI.

15. Implementation Start Condition

Implementation begins only when section 14 decisions are confirmed and section 13 checklist is approved.