Constructive Flow Graphs
Graph module for SDK-authorable computation graphs and merkle store for content-addressed state tracking. Both are provisioned via blueprints with entity scoping.
When to Apply
Use this skill when:
- Creating computation graphs with executions and outputs (graph_module)
- Tracking content-addressed state with merkle trees (merkle_store_module)
- Building flow-based programming pipelines
- Linking to the FBP (Flow-Based Programming) toolkit
Graph Module
Set has_graphs: true on an entity type to provision graph infrastructure:
Tables Created
| Table |
Purpose |
{prefix}_graphs |
Graph definitions (name, config, entity-scoped) |
{prefix}_graph_executions |
Execution records (status, input, timing) |
{prefix}_graph_outputs |
Output artifacts per execution |
Entity Scoping
Graphs are entity-scoped — each entity (org, team, channel) has its own set of graphs, executions, and outputs. Security is enforced via AuthzEntityMembership.
ORM Usage
// Create a graph
await db.orgGraph.create({
data: { entityId: orgId, name: 'data-pipeline', config: { ... } },
select: { id: true },
}).execute();
// Create an execution
await db.orgGraphExecution.create({
data: { graphId, status: 'running', input: { ... } },
select: { id: true },
}).execute();
See graph-module.md for the full reference.
Merkle Store
Set has_merkle_store: true to provision content-addressed state tracking:
Tables Created
| Table |
Purpose |
{prefix}_objects |
Content-addressed blobs (hash → data) |
{prefix}_stores |
Named stores (like git repositories) |
{prefix}_commits |
Commit records (parent, tree, message) |
{prefix}_refs |
Named references (branches/tags → commits) |
Content Addressing
Objects are stored by hash — object_hash_uuid() computes uuid_generate_v5(uuid_ns_url(), jsonb::text). Duplicate content is stored once.
See merkle-store.md for the full reference.
FBP Integration
The FBP (Flow-Based Programming) toolkit lives in the constructive-io/fbp repo:
- fbp-types — type system for flow ports and connections
- fbp-spec — specification language for flow definitions
- fbp-evaluator — execution engine for flow specs
- fbp-graph-editor — visual graph editor component
The graph_module provides the persistence layer; FBP provides the type system and execution engine.
See fbp-integration.md for linking patterns.
References
Cross-References
1---2name: constructive-flow-graphs3description: Graph module and merkle store — SDK-authorable graph infrastructure (graphs, executions, outputs) with entity scoping, content-addressed merkle state tracking (objects, stores, commits, refs), and FBP integration. Use when asked to 'create a graph', 'graph module', 'merkle store', 'content-addressed storage', 'flow-based programming', 'graph executions', 'FBP', or when working with graph_module or merkle_store_module in blueprints.4---56# Constructive Flow Graphs78Graph module for SDK-authorable computation graphs and merkle store for content-addressed state tracking. Both are provisioned via blueprints with entity scoping.910## When to Apply1112Use this skill when:13- Creating computation graphs with executions and outputs (graph_module)14- Tracking content-addressed state with merkle trees (merkle_store_module)15- Building flow-based programming pipelines16- Linking to the FBP (Flow-Based Programming) toolkit1718## Graph Module1920Set `has_graphs: true` on an entity type to provision graph infrastructure:2122### Tables Created2324| Table | Purpose |25|-------|---------|26| `{prefix}_graphs` | Graph definitions (name, config, entity-scoped) |27| `{prefix}_graph_executions` | Execution records (status, input, timing) |28| `{prefix}_graph_outputs` | Output artifacts per execution |2930### Entity Scoping3132Graphs are entity-scoped — each entity (org, team, channel) has its own set of graphs, executions, and outputs. Security is enforced via `AuthzEntityMembership`.3334### ORM Usage3536```typescript37// Create a graph38await db.orgGraph.create({39 data: { entityId: orgId, name: 'data-pipeline', config: { ... } },40 select: { id: true },41}).execute();4243// Create an execution44await db.orgGraphExecution.create({45 data: { graphId, status: 'running', input: { ... } },46 select: { id: true },47}).execute();48```4950See [graph-module.md](./references/graph-module.md) for the full reference.5152## Merkle Store5354Set `has_merkle_store: true` to provision content-addressed state tracking:5556### Tables Created5758| Table | Purpose |59|-------|---------|60| `{prefix}_objects` | Content-addressed blobs (hash → data) |61| `{prefix}_stores` | Named stores (like git repositories) |62| `{prefix}_commits` | Commit records (parent, tree, message) |63| `{prefix}_refs` | Named references (branches/tags → commits) |6465### Content Addressing6667Objects are stored by hash — `object_hash_uuid()` computes `uuid_generate_v5(uuid_ns_url(), jsonb::text)`. Duplicate content is stored once.6869See [merkle-store.md](./references/merkle-store.md) for the full reference.7071## FBP Integration7273The FBP (Flow-Based Programming) toolkit lives in the `constructive-io/fbp` repo:74- **fbp-types** — type system for flow ports and connections75- **fbp-spec** — specification language for flow definitions76- **fbp-evaluator** — execution engine for flow specs77- **fbp-graph-editor** — visual graph editor component7879The graph_module provides the persistence layer; FBP provides the type system and execution engine.8081See [fbp-integration.md](./references/fbp-integration.md) for linking patterns.8283## References8485| File | Content |86|------|---------|87| [graph-module.md](./references/graph-module.md) | Graphs, executions, outputs, entity-scoping |88| [merkle-store.md](./references/merkle-store.md) | Objects, stores, commits, refs |89| [fbp-integration.md](./references/fbp-integration.md) | Links to fbp repo for spec details |9091## Cross-References9293- **Entity types (entity scoping):** [`constructive-entities`](../constructive-entities/SKILL.md)94- **Blueprint definitions:** [`constructive-blueprints`](../constructive-blueprints/SKILL.md)95- **Background jobs (graph execution):** [`constructive-jobs`](../constructive-jobs/SKILL.md)