← Back to Kontasks
Kontask-Flow Relationship Design
Analysis of how kontasks should connect to gvFlows - proposing a graph model
Output
Kontask ↔ Flow Relationship
Current State: No Link
Right now, kontasks and gvFlows are completely separate entities:
// Task has no flowId field interface Task { id: string; type: TaskType; context: TaskContext; // no flowId here } // Flow has no kontaskIds interface GvFlow { sessions: GvSession[]; changes: GvChange[]; // no kontasks: string[] either }
Your Insight: Graph Model
You're absolutely right - flows are a graph, not a sequence. The relationship should be many-to-many:
┌──────────────┐ many-to-many ┌──────────────┐ │ Kontask │◄────────────────────►│ Flow │ └──────────────┘ └──────────────┘ │ │ │ genesis │ ▼ ▼ ┌──────────────┐ ┌──────────────┐ │ Turn │────────────────────────│ Session │ └──────────────┘ └──────────────┘
A kontask can contribute to multiple flows. A flow can have multiple kontasks as evidence.
Proposed Schema Changes
// 1. Add flowIds to kontask context interface TaskContext { flowIds?: string[]; // Flows this kontask contributes to genesisFlowId?: string; // The flow this kontask spawned (if any) turnId?: string; // Which turn created this kontask sessionId?: string; // Which session created this kontask ... } // 2. Add kontaskIds to flow interface GvFlow { ... kontaskIds: string[]; // All kontasks associated with this flow genesisKontaskId?: string; // The kontask that spawned this flow } // 3. Junction table for graph edges (optional, for rich metadata) interface FlowKontaskEdge { flowId: string; kontaskId: string; relationship: 'genesis' | 'evidence' | 'decision' | 'output'; createdAt: string; }
Edge Types (Graph Relationships)
| Edge Type | Meaning | Example |
|---|---|---|
| genesis | Kontask spawned the flow | "Add dark mode" kontask → dark-mode flow |
| evidence | Kontask is work artifact | Output kontask showing code diff |
| decision | Kontask captured a decision | "Use SQLite vs Postgres" approval |
| output | Final deliverable | PR created, feature shipped |
Implementation Path
- Add
flowIdsandgenesisFlowIdto TaskContext - Add
kontaskIdsto GvFlow type - Update
konui_create_taskto auto-link to active flow - Add
linkKontaskToFlow()function for explicit linking - Show kontask list in flow detail view
- Show flow badges in kontask cards
Your intuition is correct: Flows are fundamentally a graph structure. Work doesn't happen linearly - a single investigation can spawn multiple flows, and a flow can accumulate evidence from many kontasks across different sessions. The current model is too flat.
Quick Actions
Original Request
No layout configured
Details
Type
General
Status
Completed
Scope
vibetools
Tags
gvflowskontasksarchitecturedesign
Created
9 Jan 2026, 4:35 pm
Updated
9 Jan 2026, 4:35 pm
Timing
⏱️ 64.7s
0 tools
● TTFE 0%
● Thinking 100%
● Tools 0%
Created By
claude
Raw Data
{
"id": "b2730d3b-2409-49b8-baa9-f78ac39e1edb",
"type": "general",
"status": "completed",
"title": "Kontask-Flow Relationship Design",
"description": "Analysis of how kontasks should connect to gvFlows - proposing a graph model",
"context": {
"output": "<div style=\"background:#1e1e1e;color:#e0e0e0;padding:20px;border-radius:8px;font-family:'Consolas','Monaco',monospace;\">\n<h2 style=\"font-family:sans-serif;color:#fff;margin:0 0 16px 0;\">Kontask ↔ Flow Relationship</h2>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#f43f5e;margin:0 0 12px 0;\">Current State: No Link</h3>\n<p style=\"color:#e0e0e0;line-height:1.6;margin:0;\">Right now, <strong style=\"color:#e5c07b;\">kontasks</strong> and <strong style=\"color:#61afef;\">gvFlows</strong> are completely separate entities:</p>\n<pre style=\"background:#1e1e1e;padding:12px;border-radius:4px;margin:12px 0;font-size:12px;overflow-x:auto;\">\n<span style=\"color:#7f848e;\">// Task has no flowId field</span>\n<span style=\"color:#c678dd;\">interface</span> <span style=\"color:#e5c07b;\">Task</span> {\n id: <span style=\"color:#98c379;\">string</span>;\n type: TaskType;\n context: TaskContext; <span style=\"color:#7f848e;\">// no flowId here</span>\n}\n\n<span style=\"color:#7f848e;\">// Flow has no kontaskIds</span>\n<span style=\"color:#c678dd;\">interface</span> <span style=\"color:#61afef;\">GvFlow</span> {\n sessions: GvSession[];\n changes: GvChange[];\n <span style=\"color:#7f848e;\">// no kontasks: string[] either</span>\n}\n</pre>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#22c55e;margin:0 0 12px 0;\">Your Insight: Graph Model</h3>\n<p style=\"color:#e0e0e0;line-height:1.6;margin:0 0 12px 0;\">You're absolutely right - flows are a <strong style=\"color:#c678dd;\">graph, not a sequence</strong>. The relationship should be many-to-many:</p>\n\n<pre style=\"background:#1e1e1e;padding:12px;border-radius:4px;margin:12px 0;font-size:11px;overflow-x:auto;line-height:1.6;\">\n<span style=\"color:#56b6c2;\">┌──────────────┐</span> <span style=\"color:#98c379;\">many-to-many</span> <span style=\"color:#61afef;\">┌──────────────┐</span>\n<span style=\"color:#56b6c2;\">│ Kontask │</span>◄────────────────────►<span style=\"color:#61afef;\">│ Flow │</span>\n<span style=\"color:#56b6c2;\">└──────────────┘</span> <span style=\"color:#61afef;\">└──────────────┘</span>\n │ │\n │ <span style=\"color:#7f848e;\">genesis</span> │\n ▼ ▼\n<span style=\"color:#e5c07b;\">┌──────────────┐</span> <span style=\"color:#c678dd;\">┌──────────────┐</span>\n<span style=\"color:#e5c07b;\">│ Turn │</span>────────────────────────<span style=\"color:#c678dd;\">│ Session │</span>\n<span style=\"color:#e5c07b;\">└──────────────┘</span> <span style=\"color:#c678dd;\">└──────────────┘</span>\n</pre>\n\n<p style=\"color:#7f848e;font-size:13px;margin-top:12px;\">A kontask can contribute to multiple flows. A flow can have multiple kontasks as evidence.</p>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#61afef;margin:0 0 12px 0;\">Proposed Schema Changes</h3>\n\n<pre style=\"background:#1e1e1e;padding:12px;border-radius:4px;margin:12px 0;font-size:11px;overflow-x:auto;line-height:1.8;\">\n<span style=\"color:#7f848e;\">// 1. Add flowIds to kontask context</span>\n<span style=\"color:#c678dd;\">interface</span> <span style=\"color:#e5c07b;\">TaskContext</span> {\n <span style=\"color:#98c379;\">flowIds?</span>: string[]; <span style=\"color:#7f848e;\">// Flows this kontask contributes to</span>\n <span style=\"color:#98c379;\">genesisFlowId?</span>: string; <span style=\"color:#7f848e;\">// The flow this kontask spawned (if any)</span>\n <span style=\"color:#98c379;\">turnId?</span>: string; <span style=\"color:#7f848e;\">// Which turn created this kontask</span>\n <span style=\"color:#98c379;\">sessionId?</span>: string; <span style=\"color:#7f848e;\">// Which session created this kontask</span>\n ...\n}\n\n<span style=\"color:#7f848e;\">// 2. Add kontaskIds to flow</span>\n<span style=\"color:#c678dd;\">interface</span> <span style=\"color:#61afef;\">GvFlow</span> {\n ...\n <span style=\"color:#98c379;\">kontaskIds</span>: string[]; <span style=\"color:#7f848e;\">// All kontasks associated with this flow</span>\n <span style=\"color:#98c379;\">genesisKontaskId?</span>: string; <span style=\"color:#7f848e;\">// The kontask that spawned this flow</span>\n}\n\n<span style=\"color:#7f848e;\">// 3. Junction table for graph edges (optional, for rich metadata)</span>\n<span style=\"color:#c678dd;\">interface</span> <span style=\"color:#c678dd;\">FlowKontaskEdge</span> {\n <span style=\"color:#98c379;\">flowId</span>: string;\n <span style=\"color:#98c379;\">kontaskId</span>: string;\n <span style=\"color:#98c379;\">relationship</span>: <span style=\"color:#98c379;\">'genesis'</span> | <span style=\"color:#98c379;\">'evidence'</span> | <span style=\"color:#98c379;\">'decision'</span> | <span style=\"color:#98c379;\">'output'</span>;\n <span style=\"color:#98c379;\">createdAt</span>: string;\n}\n</pre>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#f59e0b;margin:0 0 12px 0;\">Edge Types (Graph Relationships)</h3>\n<table style=\"width:100%;font-size:12px;border-collapse:collapse;\">\n<tr style=\"border-bottom:1px solid #444;\">\n<th style=\"color:#7f848e;text-align:left;padding:8px 4px;\">Edge Type</th>\n<th style=\"color:#7f848e;text-align:left;padding:8px 4px;\">Meaning</th>\n<th style=\"color:#7f848e;text-align:left;padding:8px 4px;\">Example</th>\n</tr>\n<tr style=\"border-bottom:1px solid #333;\">\n<td style=\"padding:8px 4px;\"><span style=\"color:#22c55e;\">genesis</span></td>\n<td style=\"color:#e0e0e0;\">Kontask spawned the flow</td>\n<td style=\"color:#7f848e;\">\"Add dark mode\" kontask → dark-mode flow</td>\n</tr>\n<tr style=\"border-bottom:1px solid #333;\">\n<td style=\"padding:8px 4px;\"><span style=\"color:#61afef;\">evidence</span></td>\n<td style=\"color:#e0e0e0;\">Kontask is work artifact</td>\n<td style=\"color:#7f848e;\">Output kontask showing code diff</td>\n</tr>\n<tr style=\"border-bottom:1px solid #333;\">\n<td style=\"padding:8px 4px;\"><span style=\"color:#c678dd;\">decision</span></td>\n<td style=\"color:#e0e0e0;\">Kontask captured a decision</td>\n<td style=\"color:#7f848e;\">\"Use SQLite vs Postgres\" approval</td>\n</tr>\n<tr>\n<td style=\"padding:8px 4px;\"><span style=\"color:#f59e0b;\">output</span></td>\n<td style=\"color:#e0e0e0;\">Final deliverable</td>\n<td style=\"color:#7f848e;\">PR created, feature shipped</td>\n</tr>\n</table>\n</div>\n\n<div style=\"background:#1e1e1e;border:1px solid #22c55e;padding:12px;border-radius:6px;margin-top:16px;\">\n<h4 style=\"color:#22c55e;margin:0 0 8px 0;\">Implementation Path</h4>\n<ol style=\"color:#e0e0e0;margin:0;padding-left:20px;line-height:1.8;font-size:13px;\">\n<li>Add <code style=\"background:#2d2d2d;padding:2px 4px;border-radius:3px;\">flowIds</code> and <code style=\"background:#2d2d2d;padding:2px 4px;border-radius:3px;\">genesisFlowId</code> to TaskContext</li>\n<li>Add <code style=\"background:#2d2d2d;padding:2px 4px;border-radius:3px;\">kontaskIds</code> to GvFlow type</li>\n<li>Update <code style=\"background:#2d2d2d;padding:2px 4px;border-radius:3px;\">konui_create_task</code> to auto-link to active flow</li>\n<li>Add <code style=\"background:#2d2d2d;padding:2px 4px;border-radius:3px;\">linkKontaskToFlow()</code> function for explicit linking</li>\n<li>Show kontask list in flow detail view</li>\n<li>Show flow badges in kontask cards</li>\n</ol>\n</div>\n\n<div style=\"background:#2d2d2d;padding:12px;border-radius:6px;margin-top:16px;\">\n<p style=\"color:#7f848e;margin:0;font-size:13px;\"><strong style=\"color:#fff;\">Your intuition is correct:</strong> Flows are fundamentally a graph structure. Work doesn't happen linearly - a single investigation can spawn multiple flows, and a flow can accumulate evidence from many kontasks across different sessions. The current model is too flat.</p>\n</div>\n</div>",
"requestedAt": "2026-01-09T06:30:00.000Z",
"requestId": "655e6884-4c21-4cd3-8139-27eaedb789ad",
"choices": [
{
"label": "Implement Graph Model",
"value": "Implement the kontask-flow graph model with the schema changes proposed",
"primary": true
},
{
"label": "Design First",
"value": "Let's design the full graph schema in a doc before implementing"
},
{
"label": "Keep Simple",
"value": "Just add a simple flowId field to kontasks for now, we can evolve later"
}
],
"turnTiming": {
"totalMs": 64725,
"ttfeMs": 52,
"thinkingMs": 64673,
"toolExecutionMs": 0,
"toolCallCount": 0,
"thinkingPct": 100,
"toolsPct": 0,
"ttfePct": 0
}
},
"createdBy": "claude",
"createdAt": "2026-01-09T06:35:12.574Z",
"updatedAt": "2026-01-09T06:35:17.656Z",
"requestId": "655e6884-4c21-4cd3-8139-27eaedb789ad",
"scope": "vibetools",
"tags": [
"gvflows",
"kontasks",
"architecture",
"design"
],
"targetUser": "claude"
}