Skip to content

feat(engine): Forge Graph Engine — design + Phase 0 DOT types#1

Merged
yaman merged 2 commits into
mainfrom
graph-engine
Jul 23, 2026
Merged

feat(engine): Forge Graph Engine — design + Phase 0 DOT types#1
yaman merged 2 commits into
mainfrom
graph-engine

Conversation

@yaman

@yaman yaman commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Forge Graph Engine — design + Phase 0 kickoff

Begins converting Forge's hardcoded 14-state linear state machine into a generic, DOT-driven graph engine (workflows in .forge files) that activates agent nodes through the existing pi.dev runtime, verifies each node's outcome, and owns all control flow — while skills demote to pure domain expertise. Direct cutover, no back-compat aliases.

This PR lands the design documents and the first Phase 0 artifact. Implementation proceeds phase-by-phase under strict TDD per the playbook.

What's in this PR

  • docs/graph-engine.md — the architecture/why: Forge Workflow Language (DOT + kind= + Forge extensions), lean skills demotion, pi.dev integration, verifiers as engine-side checks, namespace-based context, graph-enforced red-green-refactor, templated commits, the four workflows, phased plan, decisions, and resolved open questions.
  • docs/graph-engine-implementation.md — a self-contained executable playbook for a fresh implementer: repo orientation, conventions/guardrails, the full spec (DOT grammar subset, node kinds, attribute catalog, class_defaults specificity, context namespaces, VerifierResult, GraphExecution/NodeStatus, condition grammar, expand_from/expand_key, commit template, the four .forge sources verbatim), an existing-code map (per-file create/modify/delete by phase), and a phased TDD plan (0–6) with acceptance tests and green gates.
  • src/engine/graph/dot-types.ts — Phase 0 first artifact: the parsed-DOT type model (NodeKind, KIND_TO_SHAPE/SHAPE_TO_KIND, DotNode/DotEdge/DotSubgraph/Digraph, GraphVersion, kindFromAttrs) that the parser/validator/class-resolver/loader build on.

Key decisions locked in

  • Self-documenting kind= node types (Graphviz shape derived for rendering only); Forge owns the hand-written DOT parser (no Fabro binary, no DOT library).
  • context is required on every agent node; subworkflows propagate a context pool + the expanded-item namespace, so tdd-slice.forge always has the sub-slice context.
  • Commit messages are templated (feat({story.id}): AC{ac.index} — {ac.summary}); the agent only supplies {ac.summary}.
  • Red-green-refactor is graph-enforced with a mandatory refactor step verified by all-of(test-green, lint-clean).
  • pipeline.forge is the real default (no deriveDefaultGraph()); continuity is guaranteed by a projection test reproducing today's 14-state transitions.

Status

Design complete and reviewed; Phase 0 (parser/validator/class-resolver/loader + pipeline.forge) is the next implementation step, to be executed test-first against the playbook.

Conversation: https://app.warp.dev/conversation/bdc6c8e7-9ae3-473d-9244-e4bd95b5a2d2
Run: https://oz.warp.dev/runs/019f8a5b-9143-7d6a-ae3f-0a2249e74a75
Plans:

This PR was generated with Oz.

yaman and others added 2 commits July 23, 2026 22:07
Preserve the Forge Graph Engine design doc (docs/graph-engine.md) — the
single source of truth for converting the linear state machine into a
generic .forge (DOT) graph engine with lean skills, pi.dev agent runtime,
graph-enforced red-green-refactor, templated commits, and namespace-based
context. Includes the four workflows (pipeline, atdd, tdd-slice, inception)
and phased TDD breakdown.

Phase 0 first artifact: src/engine/graph/dot-types.ts — the parsed DOT model
types (NodeKind, KIND_TO_SHAPE/SHAPE_TO_KIND, DotNode/Edge/Subgraph/Digraph,
GraphVersion, kindFromAttrs) that the parser/validator/class-resolver/loader
will build on.

Co-Authored-By: Oz <oz-agent@warp.dev>
Companion to docs/graph-engine.md (the architecture/why). This is the
executable how — written so a fresh implementing agent with only this repo
+ this file can execute the cutover:

- repo orientation (stack, quality-gate commands, Mock* test harness,
  source layout, config seam)
- conventions & guardrails (strict TDD, no new deps, deny-by-default
  tools, context required on agent nodes, direct cutover, commit format)
- the spec: DOT grammar subset + Forge extensions, node kinds/shape
  derivation, attribute catalog, class_defaults specificity, context
  namespaces, VerifierResult/Verifier registry, GraphExecution/NodeStatus,
  condition grammar, expand_from/expand_key, commit template, and the
  four .forge workflows verbatim
- existing-code map: per-file fate (create/modify/delete) by phase
- phased TDD plan (0-6): per phase goal, deps, test-first files,
  acceptance tests, green gate, commit message
- continuity & verification (the projection test as the cutover gate)
- risks and done criteria

Co-Authored-By: Oz <oz-agent@warp.dev>
@yaman
yaman marked this pull request as ready for review July 23, 2026 22:23
@yaman
yaman merged commit af774a8 into main Jul 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant