One panel's whole world in one call: effective config in, echoed config + cascade result + undirected edge list out. Edges are [from, to] pairs with from < to in deterministic node order; Graph.Edges() walks the adjacency once, GraphEdges(config) rebuilds the seeded world (~25us) so Result stays lean and /api/comparison stays untouched. This closes the topology gap the design brief flagged; the frontend's seeded d3-force layout consumes these pairs. Go bits: [][2]int is a slice of fixed-size arrays; [2]int is a value type, comparable, and JSON-marshals to [a, b], exactly the wire shape the spec asks for. tygo regen includes a fix: engine.Strategy now maps to the generated Strategy type instead of decaying to 'any' in ScenarioRequest. Verified live through the dev stack: 7/120 reached, 351 edges.
18 lines
674 B
YAML
18 lines
674 B
YAML
# Generates the frontend's TypeScript types from the Go structs, which are
|
|
# the single source of truth for parameters and results (see tool-handoff.md).
|
|
# Regenerate with: go generate ./...
|
|
packages:
|
|
- path: "github.com/JustinZeus/spreadlab/internal/engine"
|
|
output_path: "web/src/types/engine.ts"
|
|
include_files:
|
|
- "scenario.go"
|
|
- path: "github.com/JustinZeus/spreadlab/internal/api"
|
|
output_path: "web/src/types/api.ts"
|
|
include_files:
|
|
- "api.go"
|
|
frontmatter: |
|
|
import type { Config, Result, Strategy } from "./engine";
|
|
type_mappings:
|
|
engine.Config: "Config"
|
|
engine.Result: "Result"
|
|
engine.Strategy: "Strategy"
|