export

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

ABOUTME: Exports a SpecState as a DOT graph for the DOT Runner constrained runtime DSL. ABOUTME: Synthesizes cards into a fixed 10-phase pipeline with TDD and scenario testing gates.

ABOUTME: Shared lane ordering and card grouping logic for all exporters. ABOUTME: Produces deterministic lane order: Ideas, Plan, Spec first, then extra lanes alphabetically.

ABOUTME: Exports a SpecState as a deterministic Markdown document. ABOUTME: Sections follow spec Section 9.1 ordering: header, optional fields, then lanes with cards.

ABOUTME: Exports a SpecState as a structured YAML document matching spec.yaml format. ABOUTME: Uses gopkg.in/yaml.v3 for serialization with deterministic ordering.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportDOT

func ExportDOT(state *core.SpecState) string

ExportDOT exports the spec state as a DOT graph conforming to the DOT Runner constrained runtime DSL.

Produces a fixed pipeline of 10 phases with TDD enforcement and scenario-driven validation. Card data is aggregated into each phase's prompt rather than mapped 1:1 to nodes.

Pipeline:

start -> plan -> setup -> tdd -> implement -> verify -> verify_ok
verify_ok -> scenario_test [Pass] | implement [Fail]
scenario_test -> scenario_ok
scenario_ok -> review_gate [Pass] | tdd [Fail]
review_gate -> release [Approve] | polish [Fix]
polish -> tdd
release -> done

Card-type-to-phase mapping:

  • plan: ideas, constraints, spec_constraints
  • tdd: tasks, plans (write failing tests first)
  • implement: tasks, plans (make the tests pass)
  • verify: decisions, success_criteria (run unit/integration tests)
  • scenario_test: assumptions, success_criteria (real deps, no mocks)
  • review_gate: open_questions (human must decide)
  • polish: risks

func ExportMarkdown

func ExportMarkdown(state *core.SpecState) string

ExportMarkdown renders a SpecState as a Markdown string with deterministic ordering.

Lane ordering: Ideas, Plan, Spec first (in that order), then any other lanes sorted alphabetically. Cards within each lane are ordered by their order field (float64), with card_id string comparison as a tiebreaker.

func ExportYAML

func ExportYAML(state *core.SpecState) (string, error)

ExportYAML exports the spec state as structured YAML matching the spec.yaml format.

Uses the same deterministic ordering as the Markdown exporter: Ideas, Plan, Spec first, then extra lanes alphabetically. Cards within lanes sorted by order then card_id.

Types

type YamlCard

type YamlCard struct {
	ID        string   `yaml:"id"`
	CardType  string   `yaml:"type"`
	Title     string   `yaml:"title"`
	Body      string   `yaml:"body,omitempty"`
	Order     float64  `yaml:"order"`
	Refs      []string `yaml:"refs,omitempty"`
	CreatedBy string   `yaml:"created_by"`
}

YamlCard is a serializable YAML representation of a single card within a lane.

type YamlLane

type YamlLane struct {
	Name  string     `yaml:"name"`
	Cards []YamlCard `yaml:"cards"`
}

YamlLane is a serializable YAML representation of a lane containing cards.

type YamlSpec

type YamlSpec struct {
	Name            string     `yaml:"name"`
	Version         string     `yaml:"version"`
	OneLiner        string     `yaml:"one_liner"`
	Goal            string     `yaml:"goal"`
	Description     string     `yaml:"description,omitempty"`
	Constraints     string     `yaml:"constraints,omitempty"`
	SuccessCriteria string     `yaml:"success_criteria,omitempty"`
	Risks           string     `yaml:"risks,omitempty"`
	Notes           string     `yaml:"notes,omitempty"`
	Lanes           []YamlLane `yaml:"lanes"`
}

YamlSpec is the top-level serializable YAML representation of the spec state.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL