langflower 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +20 -15
  2. package/docs/public/README.md +15 -0
  3. package/docs/public/configuration.md +56 -0
  4. package/docs/public/extending.md +58 -0
  5. package/docs/public/getting-started.md +61 -0
  6. package/docs/public/how-it-works.md +39 -0
  7. package/docs/public/product.md +43 -0
  8. package/docs/public/using-the-editor.md +53 -0
  9. package/docs/public/workflows.md +49 -0
  10. package/package.json +3 -2
  11. package/ui-dist/chunk-6DQ2XSRW.js +4 -0
  12. package/ui-dist/{chunk-2AICAC67.js → chunk-Y6VMBLSJ.js} +1 -1
  13. package/ui-dist/index.html +2 -2
  14. package/ui-dist/main-RCFTD5AZ.js +311 -0
  15. package/ui-dist/styles-EOXODOI7.css +1 -0
  16. package/vendor/common-nodes/dist/ai/critique/node.d.ts +141 -23
  17. package/vendor/common-nodes/dist/ai/critique/node.js +33 -31
  18. package/vendor/common-nodes/dist/ai/fake-llm/node.d.ts +6 -6
  19. package/vendor/common-nodes/dist/ai/llm-compaction-ui-schema.d.ts +1 -1
  20. package/vendor/common-nodes/dist/ai/llm-compaction-ui-schema.js +2 -1
  21. package/vendor/common-nodes/dist/ai/llm-panel-ui-schema.d.ts +7 -21
  22. package/vendor/common-nodes/dist/ai/llm-panel-ui-schema.js +8 -4
  23. package/vendor/common-nodes/dist/ai/llm-session-shell.d.ts +2 -0
  24. package/vendor/common-nodes/dist/ai/llm-session-shell.js +3 -3
  25. package/vendor/common-nodes/dist/ai/normalize-max-iterations.d.ts +4 -3
  26. package/vendor/common-nodes/dist/ai/normalize-max-iterations.js +4 -3
  27. package/vendor/common-nodes/dist/ai/openai/normalize-compaction-params.d.ts +2 -2
  28. package/vendor/common-nodes/dist/ai/openai/normalize-compaction-params.js +1 -1
  29. package/vendor/common-nodes/dist/ai/openai-llm/node.d.ts +9 -9
  30. package/vendor/common-nodes/dist/ai/resolve-chat-provider-model.d.ts +10 -0
  31. package/vendor/common-nodes/dist/ai/resolve-chat-provider-model.js +8 -0
  32. package/vendor/common-nodes/dist/ai/review/node.d.ts +138 -15
  33. package/vendor/common-nodes/dist/ai/review/node.js +29 -22
  34. package/vendor/common-nodes/dist/ai/run-host-services.d.ts +8 -0
  35. package/vendor/common-nodes/dist/ai/sub-agent/node.d.ts +9 -9
  36. package/vendor/common-nodes/dist/ai/sub-agent/node.js +4 -3
  37. package/vendor/common-nodes/dist/hitl/chat-input/node.js +1 -0
  38. package/vendor/common-nodes/dist/hitl/review-gate/node.js +5 -0
  39. package/vendor/node-sdk/dist/node-factory/define-llm-node/default-llm-ports.js +2 -0
  40. package/vendor/node-sdk/dist/node-factory/define-reactive-node/define-reactive-node.d.ts +1 -1
  41. package/vendor/node-sdk/dist/node-factory/define-reactive-node/io-helpers.d.ts +5 -12
  42. package/vendor/node-sdk/dist/node-factory/define-reactive-node/port-meta.d.ts +13 -0
  43. package/vendor/runtime/dist/runtime-runner.js +7 -4
  44. package/vendor/runtime/dist/runtime.d.ts +1 -1
  45. package/vendor/runtime/dist/types.d.ts +12 -0
  46. package/vendor/server/dist/bridge/attach-langflower-bridge.d.ts +4 -1
  47. package/vendor/server/dist/bridge/attach-langflower-bridge.js +16 -5
  48. package/vendor/server/dist/bridge/bridge-event-log.d.ts +12 -0
  49. package/vendor/server/dist/bridge/bridge-event-log.js +199 -0
  50. package/vendor/server/dist/bridge/build-execution-context.d.ts +1 -1
  51. package/vendor/server/dist/bridge/build-execution-context.js +3 -0
  52. package/vendor/server/dist/bridge/emit-bootstrap.d.ts +4 -2
  53. package/vendor/server/dist/bridge/emit-bootstrap.js +6 -2
  54. package/vendor/server/dist/bridge/settings-draft-controller.d.ts +14 -0
  55. package/vendor/server/dist/bridge/settings-draft-controller.js +178 -0
  56. package/vendor/server/dist/bridge/wire-config-handlers.d.ts +8 -1
  57. package/vendor/server/dist/bridge/wire-config-handlers.js +44 -16
  58. package/vendor/server/dist/bridge/wire-editor-handlers.d.ts +8 -1
  59. package/vendor/server/dist/bridge/wire-editor-handlers.js +40 -1
  60. package/vendor/server/dist/bridge/wire-runner-handlers.js +3 -1
  61. package/vendor/server/dist/config/langflower-config.service.d.ts +2 -0
  62. package/vendor/server/dist/config/langflower-config.service.js +24 -1
  63. package/vendor/server/dist/config/resolve-draft-provider-credentials.d.ts +18 -0
  64. package/vendor/server/dist/config/resolve-draft-provider-credentials.js +60 -0
  65. package/vendor/server/dist/create-server.js +5 -3
  66. package/vendor/server/dist/session/build-session-bootstrap.d.ts +3 -1
  67. package/vendor/server/dist/session/build-session-bootstrap.js +9 -0
  68. package/vendor/server/dist/session/langflower-session.d.ts +7 -2
  69. package/vendor/server/dist/session/langflower-session.js +9 -1
  70. package/vendor/server/dist/session/settings-draft-session.d.ts +24 -0
  71. package/vendor/server/dist/session/settings-draft-session.js +82 -0
  72. package/vendor/server/skeleton/schemas/langflower-config.schema.json +4 -0
  73. package/vendor/server/skeleton/skills/langflower-helper/SKILL.md +20 -8
  74. package/vendor/server/skeleton/skills/langflower-helper/architecture.md +5 -0
  75. package/vendor/server/skeleton/skills/langflower-helper/layout.md +18 -16
  76. package/vendor/server/skeleton/workflows/simple-coder.json +249 -19
  77. package/vendor/server/skeleton/workflows/starter.json +31 -20
  78. package/vendor/shared/dist/langflower-bus-config.d.ts +50 -10
  79. package/vendor/shared/dist/langflower-bus-config.js +52 -11
  80. package/vendor/shared/dist/langflower-config/merge-langflower-config-layers.test.js +4 -0
  81. package/vendor/shared/dist/langflower-config/parse-default-chat-model.d.ts +14 -0
  82. package/vendor/shared/dist/langflower-config/parse-default-chat-model.js +38 -0
  83. package/vendor/shared/dist/langflower-config/parse-default-chat-model.test.d.ts +1 -0
  84. package/vendor/shared/dist/langflower-config/parse-default-chat-model.test.js +41 -0
  85. package/vendor/shared/dist/langflower-config/resolve-server-logs-enabled.d.ts +6 -0
  86. package/vendor/shared/dist/langflower-config/resolve-server-logs-enabled.js +5 -0
  87. package/vendor/shared/dist/langflower-config/resolve-server-logs-enabled.test.d.ts +1 -0
  88. package/vendor/shared/dist/langflower-config/resolve-server-logs-enabled.test.js +11 -0
  89. package/vendor/shared/dist/langflower-config/settings-draft.d.ts +44 -0
  90. package/vendor/shared/dist/langflower-config/settings-draft.js +143 -0
  91. package/vendor/shared/dist/langflower.d.ts +7 -2
  92. package/vendor/shared/dist/langflower.js +3 -0
  93. package/vendor/shared/dist/types/langflower-bootstrap.d.ts +6 -1
  94. package/vendor/shared/dist/types/langflower-config.d.ts +65 -0
  95. package/vendor/shared/dist/types/langflower-editor.d.ts +19 -0
  96. package/ui-dist/chunk-6ZABW4JL.js +0 -4
  97. package/ui-dist/main-XI7IOZKZ.js +0 -311
  98. package/ui-dist/styles-TQGRAC7Q.css +0 -1
@@ -0,0 +1,82 @@
1
+ import { configToDraft, mergeDraftPatch, providerConnectionKey, redactDraftSecrets, sameDraft, } from '@langflower/shared/langflower.js';
2
+ export const emptySettingsDraftStore = () => ({
3
+ project: undefined,
4
+ global: undefined,
5
+ });
6
+ export const idleConnectionsForDraft = (draft) => Object.fromEntries(draft.providers.map((_, index) => [
7
+ providerConnectionKey(index),
8
+ { state: 'idle' },
9
+ ]));
10
+ /**
11
+ * Initial connection map after seeding from disk: rows with a Base URL start
12
+ * as `checking` so the UI does not show the empty-URL hint until a probe runs.
13
+ */
14
+ const initialConnectionsForDraft = (draft) => Object.fromEntries(draft.providers.map((row, index) => [
15
+ providerConnectionKey(index),
16
+ row.baseURL.trim().length > 0
17
+ ? { state: 'checking' }
18
+ : { state: 'idle' },
19
+ ]));
20
+ export const seedScopeDraft = (layerConfig) => {
21
+ const baseline = configToDraft(layerConfig);
22
+ return {
23
+ draft: baseline,
24
+ baseline,
25
+ connections: initialConnectionsForDraft(baseline),
26
+ };
27
+ };
28
+ /** Indexes of draft rows that should be probed (non-empty Base URL). */
29
+ export const providerIndexesWithBaseUrl = (draft) => draft.providers.flatMap((row, index) => row.baseURL.trim().length > 0 ? [index] : []);
30
+ export const buildDraftSnapshot = (scope, state) => ({
31
+ scope,
32
+ draft: redactDraftSecrets(state.draft),
33
+ baseline: redactDraftSecrets(state.baseline),
34
+ dirty: !sameDraft(redactDraftSecrets(state.draft), redactDraftSecrets(state.baseline)) || state.draft.providers.some((row) => row.apiKey.trim().length > 0),
35
+ connections: state.connections,
36
+ });
37
+ export const applyDraftPatch = (previous, incoming) => {
38
+ const merged = mergeDraftPatch(previous.draft, incoming);
39
+ const probeIndexes = [];
40
+ const max = Math.max(previous.draft.providers.length, merged.providers.length);
41
+ for (let index = 0; index < max; index++) {
42
+ const before = previous.draft.providers[index];
43
+ const after = merged.providers[index];
44
+ if (after === undefined) {
45
+ continue;
46
+ }
47
+ const urlChanged = (before?.baseURL ?? '') !== after.baseURL;
48
+ const keyChanged = (before?.apiKey ?? '') !== after.apiKey;
49
+ if (urlChanged || keyChanged) {
50
+ probeIndexes.push(index);
51
+ }
52
+ }
53
+ const connections = {};
54
+ for (let index = 0; index < merged.providers.length; index++) {
55
+ const key = providerConnectionKey(index);
56
+ if (probeIndexes.includes(index)) {
57
+ const baseURL = merged.providers[index].baseURL.trim();
58
+ connections[key] =
59
+ baseURL.length === 0
60
+ ? { state: 'idle' }
61
+ : { state: 'checking' };
62
+ }
63
+ else {
64
+ connections[key] = previous.connections[key] ?? { state: 'idle' };
65
+ }
66
+ }
67
+ return {
68
+ next: {
69
+ draft: merged,
70
+ baseline: previous.baseline,
71
+ connections,
72
+ },
73
+ probeIndexes: probeIndexes.filter((index) => merged.providers[index].baseURL.trim().length > 0),
74
+ };
75
+ };
76
+ export const setConnectionStatus = (state, index, status) => ({
77
+ ...state,
78
+ connections: {
79
+ ...state.connections,
80
+ [providerConnectionKey(index)]: status,
81
+ },
82
+ });
@@ -18,6 +18,10 @@
18
18
  "type": "string",
19
19
  "description": "Optional default model id (provider/model or bare id)."
20
20
  },
21
+ "serverLogs": {
22
+ "type": "boolean",
23
+ "description": "Bridge diagnostic JSONL logging under `.langflower/logs/`. Omit to inherit; true enables; false disables."
24
+ },
21
25
  "provider": {
22
26
  "type": "object",
23
27
  "additionalProperties": {
@@ -71,12 +71,15 @@ do not say coding pipelines “don’t exist” or are unavailable.
71
71
  provider configured, they are seeded on first-run → load → composer **Start**.
72
72
  - **Can:** Second `langflower start` on an existing `.langflower/` **reuses**
73
73
  it as-is (no wipe).
74
- - **Can:** Configure providers via `.langflower/langflower.jsonc` (prefer
75
- `{env:VAR}`). Bootstrap never invents API keys.
74
+ - **Can:** Configure providers via **Settings** (Global opens on first connect
75
+ when none are configured) or `.langflower/langflower.jsonc` (prefer
76
+ `{env:VAR}`). Bootstrap never invents API keys. Simple nodes / Fake LLM work
77
+ without a provider; a real OpenAI-compatible provider is required for live
78
+ model runs and seeded coding samples.
76
79
  - **Cannot:** Claim bootstrap invents secrets, or that a polished
77
- **named-path** empty-provider fail-closed error is already shipped — tell
78
- users to edit `langflower.jsonc`; prefer fail over hang, without inventing
79
- a finished error UX.
80
+ **named-path** empty-provider fail-closed error on run is already shipped —
81
+ tell users to add a provider in Settings or `langflower.jsonc`; prefer fail
82
+ over hang, without inventing a finished run-error UX.
80
83
 
81
84
  ### 3. Skeleton and samples
82
85
 
@@ -95,9 +98,12 @@ do not say coding pipelines “don’t exist” or are unavailable.
95
98
  ### 4. Providers and Settings
96
99
 
97
100
  - **Can:** Gear opens **Settings** in the **right aside**, swapping feed /
98
- inspector; canvas stays. Project and Global scopes; merge **project >
99
- global**; Save applies without a full app reload. Keys are write-only;
100
- prefer `{env:VAR}`.
101
+ inspector; canvas stays. Open/close/scope are server-driven. Project and
102
+ Global scopes; merge **project > global**; Save applies without a full app
103
+ reload. Keys are write-only; prefer `{env:VAR}`.
104
+ - **Can:** With no providers configured, connect opens **Global Settings** with
105
+ onboarding copy (add OpenAI-compatible provider; Fake LLM / simple nodes
106
+ still work).
101
107
  - **Cannot:** Treat Settings as the selected-node inspector (ports/params).
102
108
  - **Cannot:** Reveal a saved API key in the UI.
103
109
 
@@ -126,6 +132,7 @@ do not say coding pipelines “don’t exist” or are unavailable.
126
132
  | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
127
133
  | `starter` | Onboarding chat + this skill + Writer Sub-Agent (`langflower-workflow-writer` + `langflower-node-writer`) — default open after seed |
128
134
  | Skeleton stubs | `simple-coder`, `advanced-coder`, `kb-create`, `kb-navigate`, … seeded on first-run; with provider → Start |
135
+ | `simple-coder` | Plan⇄HITL→Coder⇄HITL→Finish smoke spine + `common-memory-tools` on Plan/Coder/Researcher/Worker; Researcher Sub-Agent under Plan, Worker under Coder — **not** full multi-loop `coding-agent` |
129
136
  | `kb-create` | Memory / project wiki create: Orchestrator **indexes** the repo with `glob`/`read`, persists `history/work-queue.md`, then **serially** spawns Explorer → Composer **one unit at a time**; `common-memory-tools` writes `core/*` + `modules/*`; Review rejects non-empty Pending or thin overviews |
130
137
  | `kb-navigate` | Memory navigate: Navigator + Searcher + memory tree/grep/section tools; HITL Review Gate for follow-ups |
131
138
  | `basic-coder` | Basic coding harness (Plan⇄HITL→Coder⇄HITL→Finish) — not a toy, **not** full multi-loop `coding-agent` |
@@ -213,9 +220,14 @@ When the user asks to “create a project wiki”, “build a knowledge base”,
213
220
  `tsc` / IDE types act as compile-time validators before Custom → **Update**.
214
221
  Packs under `.langflower/nodes/<pack>/`; user runs `npm install` in the pack.
215
222
  See `instructions.md` and `nodes/my-nodes/README.md`.
223
+ Nodes may **intentionally keep in-memory internal state across runs**
224
+ (Stop / done / Start) until the user loads another workflow or shuts down
225
+ Langflower — not the same as Checkpoint resume after process kill.
216
226
  - **Cannot:** Plain JS as the authoring path, Go, Python, or other languages.
217
227
  Server auto-install. Sandboxed arbitrary user-node execution as shipped.
218
228
  Custom-pack compiler as product-Implementable.
229
+ Claim that every node always resets on Stop, or that in-memory node state
230
+ survives process restart without Checkpoints.
219
231
 
220
232
  ### 12. Status vocabulary
221
233
 
@@ -49,6 +49,11 @@ Project product data for Langflower lives under **`.langflower/`**.
49
49
  - Nodes and edges run on a **reactive runtime**: ports are live streams. A node
50
50
  may receive and emit **at any time** while the run is alive — not a single
51
51
  batch “call node → return once”.
52
+ - Canvas node instances stay alive across **Stop / done / Start** while the
53
+ same workflow is loaded. Authors may **intentionally** keep in-memory
54
+ internal state across runs until the user **loads another workflow** or
55
+ **shuts down Langflower**. That is not durable Checkpoint resume after
56
+ process restart.
52
57
  - **HITL loops** (Review Gate, feedback ports, composer Start/Send) are normal
53
58
  **internal waiting state of nodes**, not a separate product “interrupt the
54
59
  engine” mechanism.
@@ -10,27 +10,28 @@ Facts for UI chrome and on-disk paths. Prefer this file over guessing.
10
10
  custom packs after disk changes.
11
11
  - **Center** — canvas (nodes, edges, selection).
12
12
  - **Right aside** — mutually exclusive modes: **feed** | **inspector** |
13
- **Settings**. Opening Settings (gear) swaps out feed/inspector; canvas stays.
13
+ **Settings**. Opening Settings (gear or empty-provider onboarding) swaps out
14
+ feed/inspector; canvas stays. Settings open/close is server-driven.
14
15
  - **Composer (bottom)** — **Start** / Hard **Stop** / soft **Pause**; HITL
15
16
  input and actions; `permission.ask` Allow/Deny while a run needs them.
16
17
 
17
18
  ## Where can I…?
18
19
 
19
- | Goal | Where |
20
- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
21
- | Change provider / API key | Gear → **Settings** (right aside), or edit `.langflower/langflower.jsonc` (prefer `{env:VAR}`) |
22
- | Start a Chat Input graph | Composer **Start** — not plain **Run** (Run stays disabled for those graphs) |
23
- | See run output / stream | Right aside **feed** |
24
- | Answer HITL / send into a waiting node | Composer + feed context |
25
- | Allow or Deny `permission.ask` | Composer permission controls |
26
- | Soft-pause last feed agent / continue | Composer **Pause** (per-node) / Send or Resume (soft pause ≠ Hard Stop) |
27
- | Hard-stop a run | Composer **Stop** |
28
- | Edit selected node params / ports | Select node → right aside **inspector** (not Settings) |
29
- | Add or reload custom nodes | Put pack under `.langflower/nodes/<pack>/`, then Custom → **Update** |
30
- | Switch workflow | Topbar workflow list |
31
- | Open Settings without leaving canvas | Gear — Settings in right aside |
32
- | Find sample coding graphs | Skeleton / demo-project workflow files — **manual copy** into project, then load → Start. No Sample workflows catalog UI. |
33
- | Project instructions for agents | `.langflower/instructions.md` |
20
+ | Goal | Where |
21
+ | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
22
+ | Change provider / API key | Gear → **Settings** (right aside; Global auto-opens when none configured), or edit `.langflower/langflower.jsonc` (prefer `{env:VAR}`) |
23
+ | Start a Chat Input graph | Composer **Start** — not plain **Run** (Run stays disabled for those graphs) |
24
+ | See run output / stream | Right aside **feed** |
25
+ | Answer HITL / send into a waiting node | Composer + feed context |
26
+ | Allow or Deny `permission.ask` | Composer permission controls |
27
+ | Soft-pause last feed agent / continue | Composer **Pause** (per-node) / Send or Resume (soft pause ≠ Hard Stop) |
28
+ | Hard-stop a run | Composer **Stop** |
29
+ | Edit selected node params / ports | Select node → right aside **inspector** (not Settings) |
30
+ | Add or reload custom nodes | Put pack under `.langflower/nodes/<pack>/`, then Custom → **Update** |
31
+ | Switch workflow | Topbar workflow list |
32
+ | Open Settings without leaving canvas | Gear — Settings in right aside |
33
+ | Find sample coding graphs | Skeleton / demo-project workflow files — **manual copy** into project, then load → Start. No Sample workflows catalog UI. |
34
+ | Project instructions for agents | `.langflower/instructions.md` |
34
35
 
35
36
  ## On-disk `.langflower/` map
36
37
 
@@ -42,6 +43,7 @@ Facts for UI chrome and on-disk paths. Prefer this file over guessing.
42
43
  | `nodes/` | Custom node packs (e.g. `my-nodes/`) |
43
44
  | `instructions.md` | Project-level agent instructions |
44
45
  | `runs/` | Run artifacts / checkpoints when created |
46
+ | `logs/` | Server bridge diagnostic JSONL logs when the server runs |
45
47
 
46
48
  ## Out of chrome
47
49
 
@@ -2,17 +2,17 @@
2
2
  "$schema": "../schemas/workflow.schema.json",
3
3
  "metadata": {
4
4
  "name": "Simple coder",
5
- "description": "Plan → coder HITL loop. Product coding smoke spine (successor intent to basic-coder). Configure a provider before running.",
5
+ "description": "Plan (+ Researcher) → coder (+ Worker) with HITL loops and shared Memory Tools. Product coding smoke spine (successor intent to basic-coder). Configure a provider before running.",
6
6
  "createdAt": "2026-07-24T00:00:00.000Z",
7
- "updatedAt": "2026-07-24T00:00:00.000Z"
7
+ "updatedAt": "2026-08-05T16:14:41.418Z"
8
8
  },
9
9
  "graph": {
10
10
  "viewport": {
11
- "x": -117.39587175846478,
12
- "y": 91.64430031530618,
13
- "scale": 0.5197751407121728,
14
- "width": 756.1875,
15
- "height": 1009.0625
11
+ "x": -87.54590555669785,
12
+ "y": -12.974709392232825,
13
+ "scale": 0.7169036842821539,
14
+ "width": 719.0625,
15
+ "height": 1005.328125
16
16
  },
17
17
  "nodes": [
18
18
  {
@@ -28,6 +28,19 @@
28
28
  "label": "Goal"
29
29
  }
30
30
  },
31
+ {
32
+ "id": "memory-tools",
33
+ "type": "common-memory-tools",
34
+ "params": {},
35
+ "inputs": {},
36
+ "ui": {
37
+ "position": {
38
+ "x": 40,
39
+ "y": 40
40
+ },
41
+ "label": "Memory Tools"
42
+ }
43
+ },
31
44
  {
32
45
  "id": "plan",
33
46
  "type": "common-openai-llm",
@@ -37,15 +50,58 @@
37
50
  "model": "",
38
51
  "maxIterations": 8
39
52
  },
40
- "inputs": {},
53
+ "inputs": {
54
+ "systemPrompt": "## 1. SYSTEM IDENTITY & GRAPH CONTEXT\r\nYou are an autonomous AI specialist executing within a Stateful Multi-Agent Graph Harness.\r\n\r\n* Graph Topology: The workflow is a directed graph containing conditional loops (feedback loops). The Harness automatically routes your text output to the next node in the topology based on the current edge.\r\n* Routing Autonomy: You do not write structural routing tags (like TO: NextAgent). Instead, you dictate graph progression by your analytical conclusions and the direct instructional payload you generate for the subsequent node.\r\n\r\n------------------------------\r\n## 2. MEMORY WORKSPACE CONTRACT (.langflower/memory)\r\nYou do not pass raw code blocks, massive specifications, or large test artifacts inside your conversational text context. Instead, you operate on a shared file system. You must read and persist heavy artifacts strictly through your memory tools using the following structural invariants:\r\n\r\n* core/project_summary.md — Global requirements, scope, high-level specification.\r\n* core/tasks_queue.md — The global work ledger. Tasks must use the status pattern: [BACKLOG | IN_PROGRESS | VALIDATING | DONE | FAILED].\r\n* core/codebase_map.md — Repository structure, architectural patterns, schemas, API contracts.\r\n* core/problems.md — Active and solved runtime regressions, edge-case failures, hidden dependencies, and non-obvious bugs. Agents must read this to avoid repeating past mistakes and log new anomalies immediately upon discovery.\r\n* core/principles.md — Persistent architectural decisions, validated optimization patterns, team-level best practices, and immutable structural design choices settled during execution.\r\n* verification/test_reports.md — Unit test outputs, edge-case coverage matrix, runtime crash logs.\r\n* history/agent_logs.md — Chronological ledger of transitions for agent-to-agent observability.\r\n\r\n------------------------------\r\n## 3. OPERATIONAL PROTOCOL (READ-THINK-WRITE-PROMPT)\r\nWhenever you receive control from the Harness, you must strictly follow this 4-step execution lifecycle:\r\n\r\n## Step 1: Read & Synchronize\r\nDo not guess the state of the project. Read the dynamic instructions sent by the previous agent in the input prompt.\r\n1. Immediately call `read_memory_section` or `search_memory_grep` on the file paths specified in that prompt to pull the latest state from the disk.\r\n2. Check the task status in `core/tasks_queue.md`. If your incoming task is marked as `FAILED` or `VALIDATING`, you are **strictly required** to read `core/problems.md` and cross-reference historical logs to identify previous regressions, failed attempts, and hidden roadblocks before writing any new code or logic.\r\n\r\n## Step 2: Analyze & Execute (with Subagent Delegation Strategy)\r\nProcess the task using your specialized domain logic. Before executing tasks completely yourself, evaluate your available system capabilities:\r\n* **Subagent Tool Evaluation**: Check your available tools for subagent or worker orchestration capabilities (e.g., `spawn_subagent`, `delegate_to_worker`).\r\n* **Delegation Preference**: If subagent tools are present, you must prefer delegating tasks that are structurally **simple but lengthy** (e.g., bulk code formatting, extensive repetitive unit test generation, comprehensive docstring writing, large-scale structural migrations, or rote text conversions).\r\n* **Execution Boundary**: Keep the high-level orchestrational logic, critical structural decision-making, and edge-case evaluations within your own execution scope. Pass off the high-volume, low-complexity compute workloads.\r\n* **Storage updates**: If you or your subagents modify source code, architecture specifications, or test reports, write those updates directly back to the .langflower/memory/ directory using `update_memory_section` or `append_memory_log`.\r\n\r\n## Step 3: Determine Loop vs. Progression\r\nEvaluate your own output, your delegated subagents' completions, or the output of the node before you:\r\n* If an error/regression is detected (or a subagent execution fails): Log the failure details inside `core/problems.md` and formulate a corrective payload to trigger a feedback loop (e.g., sending a task back for rework).\r\n* If criteria are met: If you discovered a highly stable pattern or made an immutable architectural choice during execution, log it in `core/principles.md`. Then, formulate a progressive payload to advance the graph to the next stage.\r\n\r\n## Step 4: Generate the Next Directive Payload\r\nYour final text output must act as a clear, high-density, context-rich directive for the next node in the graph. You must structure this payload using the explicit Direct Instructional Format.\r\n\r\n------------------------------\r\n## 4. DIRECT INSTRUCTIONAL FORMAT (PAYLOAD DSL)\r\nYour final text message must explicitly instruct the next node by answering three fundamental questions: What needs to be done? Where is the specification? Where is the context?\r\nYou must include this explicit structure at the very end of your response:\r\n\r\nYou are executing [Task Name/Action].\r\n- **Directive**: [Clear, granular, actionable statement of what the next agent must execute]\r\n- **Instruction Details**: See `[file_path]` under heading `[## Heading Name]`\r\n- **Context Files**: Read `[file_path_1]`, `[file_path_2]` to understand the background state or code changes.\r\n- **Iteration Count**: [Current attempt number if cycling inside a loop, e.g., Attempt #1, Attempt #2]\r\n\r\n------------------------------\r\n## 5. ROBUSTNESS & ANTI-LOOP INVARIANTS\r\n\r\n 1. Atomic Logs: Use `append_memory_log` strictly for chronological history and error tracking. Never overwrite the history file.\r\n 2. No Text Duplication: Do not print entire files or source code blocks inside the direct prompt payload. Keep the payload dense, clean, and instructional. Force the next agent to read from the disk workspace.\r\n 3. Stuck Loop Detection: If the Iteration Count exceeds 3 for the exact same sub-task, flag a systemic block, modify your directive to include debugging telemetry, or route the state to the Human-In-The-Loop (HITL) node for manual triage.\r\n 4. Efficient Delegation Boundaries: Do not spawn subagents for tasks requiring multi-layered architectural reasoning. If a subagent stalls or returns errors twice consecutively on a delegated simple task, reclaim the execution context and handle the task directly within your main loop to avoid cascade routing degradation.\n\n------------------------------\n## ROLE: Plan\nYou are Plan in this Simple coder workflow. Prefer spawn_subagent Researcher for long read-only survey. Keep orchestration and plan decisions yourself. End with Direct Instructional Format for Coder."
55
+ },
41
56
  "ui": {
42
57
  "position": {
43
58
  "x": 320,
44
- "y": 120
59
+ "y": 220
45
60
  },
46
61
  "label": "Plan"
47
62
  }
48
63
  },
64
+ {
65
+ "id": "researcher",
66
+ "type": "common-sub-agent",
67
+ "params": {
68
+ "name": "Researcher",
69
+ "description": "Read-only survey specialist for Plan — repo/memory exploration without code edits",
70
+ "skillIds": [],
71
+ "rolePreset": "explorer",
72
+ "providerId": "",
73
+ "model": "",
74
+ "maxIterations": 12,
75
+ "contextSize": 32768,
76
+ "compactOnError": false,
77
+ "toolPermissions": {
78
+ "read": "allow",
79
+ "glob": "deny",
80
+ "grep": "deny",
81
+ "edit": "deny",
82
+ "write": "ask",
83
+ "create": "ask",
84
+ "delete": "deny",
85
+ "bash": "deny",
86
+ "get_memory_tree": "allow",
87
+ "read_memory_section": "allow",
88
+ "search_memory_grep": "allow",
89
+ "append_memory_log": "allow",
90
+ "update_memory_section": "allow",
91
+ "create_memory_file": "allow"
92
+ }
93
+ },
94
+ "inputs": {
95
+ "systemPrompt": "## 1. SYSTEM IDENTITY & GRAPH CONTEXT\r\nYou are an autonomous AI specialist executing within a Stateful Multi-Agent Graph Harness.\r\n\r\n* Graph Topology: The workflow is a directed graph containing conditional loops (feedback loops). The Harness automatically routes your text output to the next node in the topology based on the current edge.\r\n* Routing Autonomy: You do not write structural routing tags (like TO: NextAgent). Instead, you dictate graph progression by your analytical conclusions and the direct instructional payload you generate for the subsequent node.\r\n\r\n------------------------------\r\n## 2. MEMORY WORKSPACE CONTRACT (.langflower/memory)\r\nYou do not pass raw code blocks, massive specifications, or large test artifacts inside your conversational text context. Instead, you operate on a shared file system. You must read and persist heavy artifacts strictly through your memory tools using the following structural invariants:\r\n\r\n* core/project_summary.md — Global requirements, scope, high-level specification.\r\n* core/tasks_queue.md — The global work ledger. Tasks must use the status pattern: [BACKLOG | IN_PROGRESS | VALIDATING | DONE | FAILED].\r\n* core/codebase_map.md — Repository structure, architectural patterns, schemas, API contracts.\r\n* core/problems.md — Active and solved runtime regressions, edge-case failures, hidden dependencies, and non-obvious bugs. Agents must read this to avoid repeating past mistakes and log new anomalies immediately upon discovery.\r\n* core/principles.md — Persistent architectural decisions, validated optimization patterns, team-level best practices, and immutable structural design choices settled during execution.\r\n* verification/test_reports.md — Unit test outputs, edge-case coverage matrix, runtime crash logs.\r\n* history/agent_logs.md — Chronological ledger of transitions for agent-to-agent observability.\r\n\r\n------------------------------\r\n## 3. OPERATIONAL PROTOCOL (READ-THINK-WRITE-PROMPT)\r\nWhenever you receive control from the Harness, you must strictly follow this 4-step execution lifecycle:\r\n\r\n## Step 1: Read & Synchronize\r\nDo not guess the state of the project. Read the dynamic instructions sent by the previous agent in the input prompt.\r\n1. Immediately call `read_memory_section` or `search_memory_grep` on the file paths specified in that prompt to pull the latest state from the disk.\r\n2. Check the task status in `core/tasks_queue.md`. If your incoming task is marked as `FAILED` or `VALIDATING`, you are **strictly required** to read `core/problems.md` and cross-reference historical logs to identify previous regressions, failed attempts, and hidden roadblocks before writing any new code or logic.\r\n\r\n## Step 2: Analyze & Execute (with Subagent Delegation Strategy)\r\nProcess the task using your specialized domain logic. Before executing tasks completely yourself, evaluate your available system capabilities:\r\n* **Subagent Tool Evaluation**: Check your available tools for subagent or worker orchestration capabilities (e.g., `spawn_subagent`, `delegate_to_worker`).\r\n* **Delegation Preference**: If subagent tools are present, you must prefer delegating tasks that are structurally **simple but lengthy** (e.g., bulk code formatting, extensive repetitive unit test generation, comprehensive docstring writing, large-scale structural migrations, or rote text conversions).\r\n* **Execution Boundary**: Keep the high-level orchestrational logic, critical structural decision-making, and edge-case evaluations within your own execution scope. Pass off the high-volume, low-complexity compute workloads.\r\n* **Storage updates**: If you or your subagents modify source code, architecture specifications, or test reports, write those updates directly back to the .langflower/memory/ directory using `update_memory_section` or `append_memory_log`.\r\n\r\n## Step 3: Determine Loop vs. Progression\r\nEvaluate your own output, your delegated subagents' completions, or the output of the node before you:\r\n* If an error/regression is detected (or a subagent execution fails): Log the failure details inside `core/problems.md` and formulate a corrective payload to trigger a feedback loop (e.g., sending a task back for rework).\r\n* If criteria are met: If you discovered a highly stable pattern or made an immutable architectural choice during execution, log it in `core/principles.md`. Then, formulate a progressive payload to advance the graph to the next stage.\r\n\r\n## Step 4: Generate the Next Directive Payload\r\nYour final text output must act as a clear, high-density, context-rich directive for the next node in the graph. You must structure this payload using the explicit Direct Instructional Format.\r\n\r\n------------------------------\r\n## 4. DIRECT INSTRUCTIONAL FORMAT (PAYLOAD DSL)\r\nYour final text message must explicitly instruct the next node by answering three fundamental questions: What needs to be done? Where is the specification? Where is the context?\r\nYou must include this explicit structure at the very end of your response:\r\n\r\nYou are executing [Task Name/Action].\r\n- **Directive**: [Clear, granular, actionable statement of what the next agent must execute]\r\n- **Instruction Details**: See `[file_path]` under heading `[## Heading Name]`\r\n- **Context Files**: Read `[file_path_1]`, `[file_path_2]` to understand the background state or code changes.\r\n- **Iteration Count**: [Current attempt number if cycling inside a loop, e.g., Attempt #1, Attempt #2]\r\n\r\n------------------------------\r\n## 5. ROBUSTNESS & ANTI-LOOP INVARIANTS\r\n\r\n 1. Atomic Logs: Use `append_memory_log` strictly for chronological history and error tracking. Never overwrite the history file.\r\n 2. No Text Duplication: Do not print entire files or source code blocks inside the direct prompt payload. Keep the payload dense, clean, and instructional. Force the next agent to read from the disk workspace.\r\n 3. Stuck Loop Detection: If the Iteration Count exceeds 3 for the exact same sub-task, flag a systemic block, modify your directive to include debugging telemetry, or route the state to the Human-In-The-Loop (HITL) node for manual triage.\r\n 4. Efficient Delegation Boundaries: Do not spawn subagents for tasks requiring multi-layered architectural reasoning. If a subagent stalls or returns errors twice consecutively on a delegated simple task, reclaim the execution context and handle the task directly within your main loop to avoid cascade routing degradation.\n\n------------------------------\n## ROLE: Researcher\nYou are Researcher. Read-only survey with harness read/glob/grep plus memory tools only. No code edits. Return structured findings for Plan."
96
+ },
97
+ "ui": {
98
+ "position": {
99
+ "x": 320,
100
+ "y": 960
101
+ },
102
+ "label": "Researcher"
103
+ }
104
+ },
49
105
  {
50
106
  "id": "coder",
51
107
  "type": "common-openai-llm",
@@ -53,19 +109,76 @@
53
109
  "rolePreset": "coder",
54
110
  "providerId": "",
55
111
  "model": "",
56
- "maxIterations": 8
112
+ "maxIterations": 8,
113
+ "toolPermissions": {
114
+ "read": "allow",
115
+ "glob": "allow",
116
+ "grep": "allow",
117
+ "edit": "allow",
118
+ "write": "allow",
119
+ "create": "allow",
120
+ "delete": "ask",
121
+ "bash": "ask",
122
+ "get_memory_tree": "allow",
123
+ "read_memory_section": "allow",
124
+ "search_memory_grep": "allow",
125
+ "append_memory_log": "allow",
126
+ "update_memory_section": "allow",
127
+ "create_memory_file": "allow"
128
+ }
57
129
  },
58
130
  "inputs": {
59
- "systemPrompt": "You receive a Plan agent summary as the user prompt. Implement the plan with harness tools. Prefer minimal edits. Summarize files changed in your final response."
131
+ "systemPrompt": "## 1. SYSTEM IDENTITY & GRAPH CONTEXT\r\nYou are an autonomous AI specialist executing within a Stateful Multi-Agent Graph Harness.\r\n\r\n* Graph Topology: The workflow is a directed graph containing conditional loops (feedback loops). The Harness automatically routes your text output to the next node in the topology based on the current edge.\r\n* Routing Autonomy: You do not write structural routing tags (like TO: NextAgent). Instead, you dictate graph progression by your analytical conclusions and the direct instructional payload you generate for the subsequent node.\r\n\r\n------------------------------\r\n## 2. MEMORY WORKSPACE CONTRACT (.langflower/memory)\r\nYou do not pass raw code blocks, massive specifications, or large test artifacts inside your conversational text context. Instead, you operate on a shared file system. You must read and persist heavy artifacts strictly through your memory tools using the following structural invariants:\r\n\r\n* core/project_summary.md — Global requirements, scope, high-level specification.\r\n* core/tasks_queue.md — The global work ledger. Tasks must use the status pattern: [BACKLOG | IN_PROGRESS | VALIDATING | DONE | FAILED].\r\n* core/codebase_map.md — Repository structure, architectural patterns, schemas, API contracts.\r\n* core/problems.md — Active and solved runtime regressions, edge-case failures, hidden dependencies, and non-obvious bugs. Agents must read this to avoid repeating past mistakes and log new anomalies immediately upon discovery.\r\n* core/principles.md — Persistent architectural decisions, validated optimization patterns, team-level best practices, and immutable structural design choices settled during execution.\r\n* verification/test_reports.md — Unit test outputs, edge-case coverage matrix, runtime crash logs.\r\n* history/agent_logs.md — Chronological ledger of transitions for agent-to-agent observability.\r\n\r\n------------------------------\r\n## 3. OPERATIONAL PROTOCOL (READ-THINK-WRITE-PROMPT)\r\nWhenever you receive control from the Harness, you must strictly follow this 4-step execution lifecycle:\r\n\r\n## Step 1: Read & Synchronize\r\nDo not guess the state of the project. Read the dynamic instructions sent by the previous agent in the input prompt.\r\n1. Immediately call `read_memory_section` or `search_memory_grep` on the file paths specified in that prompt to pull the latest state from the disk.\r\n2. Check the task status in `core/tasks_queue.md`. If your incoming task is marked as `FAILED` or `VALIDATING`, you are **strictly required** to read `core/problems.md` and cross-reference historical logs to identify previous regressions, failed attempts, and hidden roadblocks before writing any new code or logic.\r\n\r\n## Step 2: Analyze & Execute (with Subagent Delegation Strategy)\r\nProcess the task using your specialized domain logic. Before executing tasks completely yourself, evaluate your available system capabilities:\r\n* **Subagent Tool Evaluation**: Check your available tools for subagent or worker orchestration capabilities (e.g., `spawn_subagent`, `delegate_to_worker`).\r\n* **Delegation Preference**: If subagent tools are present, you must prefer delegating tasks that are structurally **simple but lengthy** (e.g., bulk code formatting, extensive repetitive unit test generation, comprehensive docstring writing, large-scale structural migrations, or rote text conversions).\r\n* **Execution Boundary**: Keep the high-level orchestrational logic, critical structural decision-making, and edge-case evaluations within your own execution scope. Pass off the high-volume, low-complexity compute workloads.\r\n* **Storage updates**: If you or your subagents modify source code, architecture specifications, or test reports, write those updates directly back to the .langflower/memory/ directory using `update_memory_section` or `append_memory_log`.\r\n\r\n## Step 3: Determine Loop vs. Progression\r\nEvaluate your own output, your delegated subagents' completions, or the output of the node before you:\r\n* If an error/regression is detected (or a subagent execution fails): Log the failure details inside `core/problems.md` and formulate a corrective payload to trigger a feedback loop (e.g., sending a task back for rework).\r\n* If criteria are met: If you discovered a highly stable pattern or made an immutable architectural choice during execution, log it in `core/principles.md`. Then, formulate a progressive payload to advance the graph to the next stage.\r\n\r\n## Step 4: Generate the Next Directive Payload\r\nYour final text output must act as a clear, high-density, context-rich directive for the next node in the graph. You must structure this payload using the explicit Direct Instructional Format.\r\n\r\n------------------------------\r\n## 4. DIRECT INSTRUCTIONAL FORMAT (PAYLOAD DSL)\r\nYour final text message must explicitly instruct the next node by answering three fundamental questions: What needs to be done? Where is the specification? Where is the context?\r\nYou must include this explicit structure at the very end of your response:\r\n\r\nYou are executing [Task Name/Action].\r\n- **Directive**: [Clear, granular, actionable statement of what the next agent must execute]\r\n- **Instruction Details**: See `[file_path]` under heading `[## Heading Name]`\r\n- **Context Files**: Read `[file_path_1]`, `[file_path_2]` to understand the background state or code changes.\r\n- **Iteration Count**: [Current attempt number if cycling inside a loop, e.g., Attempt #1, Attempt #2]\r\n\r\n------------------------------\r\n## 5. ROBUSTNESS & ANTI-LOOP INVARIANTS\r\n\r\n 1. Atomic Logs: Use `append_memory_log` strictly for chronological history and error tracking. Never overwrite the history file.\r\n 2. No Text Duplication: Do not print entire files or source code blocks inside the direct prompt payload. Keep the payload dense, clean, and instructional. Force the next agent to read from the disk workspace.\r\n 3. Stuck Loop Detection: If the Iteration Count exceeds 3 for the exact same sub-task, flag a systemic block, modify your directive to include debugging telemetry, or route the state to the Human-In-The-Loop (HITL) node for manual triage.\r\n 4. Efficient Delegation Boundaries: Do not spawn subagents for tasks requiring multi-layered architectural reasoning. If a subagent stalls or returns errors twice consecutively on a delegated simple task, reclaim the execution context and handle the task directly within your main loop to avoid cascade routing degradation.\n\n------------------------------\n## ROLE: Coder\nYou are Coder. Implement from the plan payload with harness tools. Prefer spawn_subagent Worker for lengthy simple edits/tests. Keep critical structural decisions yourself. Summarize files changed in your final response."
60
132
  },
61
133
  "ui": {
62
134
  "position": {
63
135
  "x": 1080,
64
- "y": 160
136
+ "y": 200
65
137
  },
66
138
  "label": "Coder"
67
139
  }
68
140
  },
141
+ {
142
+ "id": "worker",
143
+ "type": "common-sub-agent",
144
+ "params": {
145
+ "name": "Worker",
146
+ "description": "Scoped implementer for Coder — lengthy simple edits, tests, and rote changes",
147
+ "skillIds": [],
148
+ "rolePreset": "custom",
149
+ "providerId": "",
150
+ "model": "",
151
+ "maxIterations": 12,
152
+ "contextSize": 32768,
153
+ "compactOnError": false,
154
+ "toolPermissions": {
155
+ "read": "allow",
156
+ "glob": "allow",
157
+ "grep": "allow",
158
+ "edit": "allow",
159
+ "write": "allow",
160
+ "create": "allow",
161
+ "delete": "ask",
162
+ "bash": "ask",
163
+ "get_memory_tree": "allow",
164
+ "read_memory_section": "allow",
165
+ "search_memory_grep": "allow",
166
+ "append_memory_log": "allow",
167
+ "update_memory_section": "allow",
168
+ "create_memory_file": "allow"
169
+ }
170
+ },
171
+ "inputs": {
172
+ "systemPrompt": "## 1. SYSTEM IDENTITY & GRAPH CONTEXT\r\nYou are an autonomous AI specialist executing within a Stateful Multi-Agent Graph Harness.\r\n\r\n* Graph Topology: The workflow is a directed graph containing conditional loops (feedback loops). The Harness automatically routes your text output to the next node in the topology based on the current edge.\r\n* Routing Autonomy: You do not write structural routing tags (like TO: NextAgent). Instead, you dictate graph progression by your analytical conclusions and the direct instructional payload you generate for the subsequent node.\r\n\r\n------------------------------\r\n## 2. MEMORY WORKSPACE CONTRACT (.langflower/memory)\r\nYou do not pass raw code blocks, massive specifications, or large test artifacts inside your conversational text context. Instead, you operate on a shared file system. You must read and persist heavy artifacts strictly through your memory tools using the following structural invariants:\r\n\r\n* core/project_summary.md — Global requirements, scope, high-level specification.\r\n* core/tasks_queue.md — The global work ledger. Tasks must use the status pattern: [BACKLOG | IN_PROGRESS | VALIDATING | DONE | FAILED].\r\n* core/codebase_map.md — Repository structure, architectural patterns, schemas, API contracts.\r\n* core/problems.md — Active and solved runtime regressions, edge-case failures, hidden dependencies, and non-obvious bugs. Agents must read this to avoid repeating past mistakes and log new anomalies immediately upon discovery.\r\n* core/principles.md — Persistent architectural decisions, validated optimization patterns, team-level best practices, and immutable structural design choices settled during execution.\r\n* verification/test_reports.md — Unit test outputs, edge-case coverage matrix, runtime crash logs.\r\n* history/agent_logs.md — Chronological ledger of transitions for agent-to-agent observability.\r\n\r\n------------------------------\r\n## 3. OPERATIONAL PROTOCOL (READ-THINK-WRITE-PROMPT)\r\nWhenever you receive control from the Harness, you must strictly follow this 4-step execution lifecycle:\r\n\r\n## Step 1: Read & Synchronize\r\nDo not guess the state of the project. Read the dynamic instructions sent by the previous agent in the input prompt.\r\n1. Immediately call `read_memory_section` or `search_memory_grep` on the file paths specified in that prompt to pull the latest state from the disk.\r\n2. Check the task status in `core/tasks_queue.md`. If your incoming task is marked as `FAILED` or `VALIDATING`, you are **strictly required** to read `core/problems.md` and cross-reference historical logs to identify previous regressions, failed attempts, and hidden roadblocks before writing any new code or logic.\r\n\r\n## Step 2: Analyze & Execute (with Subagent Delegation Strategy)\r\nProcess the task using your specialized domain logic. Before executing tasks completely yourself, evaluate your available system capabilities:\r\n* **Subagent Tool Evaluation**: Check your available tools for subagent or worker orchestration capabilities (e.g., `spawn_subagent`, `delegate_to_worker`).\r\n* **Delegation Preference**: If subagent tools are present, you must prefer delegating tasks that are structurally **simple but lengthy** (e.g., bulk code formatting, extensive repetitive unit test generation, comprehensive docstring writing, large-scale structural migrations, or rote text conversions).\r\n* **Execution Boundary**: Keep the high-level orchestrational logic, critical structural decision-making, and edge-case evaluations within your own execution scope. Pass off the high-volume, low-complexity compute workloads.\r\n* **Storage updates**: If you or your subagents modify source code, architecture specifications, or test reports, write those updates directly back to the .langflower/memory/ directory using `update_memory_section` or `append_memory_log`.\r\n\r\n## Step 3: Determine Loop vs. Progression\r\nEvaluate your own output, your delegated subagents' completions, or the output of the node before you:\r\n* If an error/regression is detected (or a subagent execution fails): Log the failure details inside `core/problems.md` and formulate a corrective payload to trigger a feedback loop (e.g., sending a task back for rework).\r\n* If criteria are met: If you discovered a highly stable pattern or made an immutable architectural choice during execution, log it in `core/principles.md`. Then, formulate a progressive payload to advance the graph to the next stage.\r\n\r\n## Step 4: Generate the Next Directive Payload\r\nYour final text output must act as a clear, high-density, context-rich directive for the next node in the graph. You must structure this payload using the explicit Direct Instructional Format.\r\n\r\n------------------------------\r\n## 4. DIRECT INSTRUCTIONAL FORMAT (PAYLOAD DSL)\r\nYour final text message must explicitly instruct the next node by answering three fundamental questions: What needs to be done? Where is the specification? Where is the context?\r\nYou must include this explicit structure at the very end of your response:\r\n\r\nYou are executing [Task Name/Action].\r\n- **Directive**: [Clear, granular, actionable statement of what the next agent must execute]\r\n- **Instruction Details**: See `[file_path]` under heading `[## Heading Name]`\r\n- **Context Files**: Read `[file_path_1]`, `[file_path_2]` to understand the background state or code changes.\r\n- **Iteration Count**: [Current attempt number if cycling inside a loop, e.g., Attempt #1, Attempt #2]\r\n\r\n------------------------------\r\n## 5. ROBUSTNESS & ANTI-LOOP INVARIANTS\r\n\r\n 1. Atomic Logs: Use `append_memory_log` strictly for chronological history and error tracking. Never overwrite the history file.\r\n 2. No Text Duplication: Do not print entire files or source code blocks inside the direct prompt payload. Keep the payload dense, clean, and instructional. Force the next agent to read from the disk workspace.\r\n 3. Stuck Loop Detection: If the Iteration Count exceeds 3 for the exact same sub-task, flag a systemic block, modify your directive to include debugging telemetry, or route the state to the Human-In-The-Loop (HITL) node for manual triage.\r\n 4. Efficient Delegation Boundaries: Do not spawn subagents for tasks requiring multi-layered architectural reasoning. If a subagent stalls or returns errors twice consecutively on a delegated simple task, reclaim the execution context and handle the task directly within your main loop to avoid cascade routing degradation.\n\n------------------------------\n## ROLE: Worker\nYou are Worker. Execute the scoped spawn task with harness tools; update memory when artifacts or tests change. Return a short completion summary."
173
+ },
174
+ "ui": {
175
+ "position": {
176
+ "x": 1080,
177
+ "y": 960
178
+ },
179
+ "label": "Worker"
180
+ }
181
+ },
69
182
  {
70
183
  "id": "f67ee3a6-c8ea-4bad-bb7d-d0c1c3e90521",
71
184
  "type": "common-hitl-review-gate",
@@ -73,8 +186,8 @@
73
186
  "inputs": {},
74
187
  "ui": {
75
188
  "position": {
76
- "x": 620,
77
- "y": 780
189
+ "x": 640,
190
+ "y": 760
78
191
  }
79
192
  }
80
193
  },
@@ -85,8 +198,8 @@
85
198
  "inputs": {},
86
199
  "ui": {
87
200
  "position": {
88
- "x": 1094.219576990285,
89
- "y": 782.6495614795315
201
+ "x": 1380,
202
+ "y": 760
90
203
  }
91
204
  }
92
205
  },
@@ -97,8 +210,34 @@
97
210
  "inputs": {},
98
211
  "ui": {
99
212
  "position": {
100
- "x": 1462.316578408799,
101
- "y": 804.9460874158642
213
+ "x": 1940,
214
+ "y": 800
215
+ }
216
+ }
217
+ },
218
+ {
219
+ "id": "d80650bf-8250-488c-9773-b2f0622517b8",
220
+ "type": "common-router",
221
+ "params": {},
222
+ "inputs": {},
223
+ "ui": {
224
+ "position": {
225
+ "x": 740,
226
+ "y": 40
227
+ }
228
+ }
229
+ },
230
+ {
231
+ "id": "db0c5a0e-0ebd-49ef-bed9-c42edec92a48",
232
+ "type": "common-hitl-review-gate",
233
+ "params": {},
234
+ "inputs": {},
235
+ "ui": {
236
+ "position": {
237
+ "x": 1640,
238
+ "y": 800,
239
+ "width": 188.875,
240
+ "height": 141.0625
102
241
  }
103
242
  }
104
243
  }
@@ -111,6 +250,41 @@
111
250
  "toNodeId": "plan",
112
251
  "toPort": ["userPrompt", 0]
113
252
  },
253
+ {
254
+ "edgeId": "e-mem-plan",
255
+ "fromNodeId": "memory-tools",
256
+ "fromPort": ["tools", 0],
257
+ "toNodeId": "plan",
258
+ "toPort": ["tools", 0]
259
+ },
260
+ {
261
+ "edgeId": "e-mem-researcher",
262
+ "fromNodeId": "memory-tools",
263
+ "fromPort": ["tools", 0],
264
+ "toNodeId": "researcher",
265
+ "toPort": ["tools", 0]
266
+ },
267
+ {
268
+ "edgeId": "e-reg-researcher",
269
+ "fromNodeId": "researcher",
270
+ "fromPort": ["registration", 0],
271
+ "toNodeId": "plan",
272
+ "toPort": ["subagentRegistration", 0]
273
+ },
274
+ {
275
+ "edgeId": "e-spawn-researcher",
276
+ "fromNodeId": "plan",
277
+ "fromPort": ["subagent", 0],
278
+ "toNodeId": "researcher",
279
+ "toPort": ["task", 0]
280
+ },
281
+ {
282
+ "edgeId": "e-result-researcher",
283
+ "fromNodeId": "researcher",
284
+ "fromPort": ["result", 0],
285
+ "toNodeId": "plan",
286
+ "toPort": ["subagentResult", 0]
287
+ },
114
288
  {
115
289
  "edgeId": "0001374a-48f7-4251-8760-535f0ee8060b",
116
290
  "fromNodeId": "plan",
@@ -132,6 +306,27 @@
132
306
  "toNodeId": "coder",
133
307
  "toPort": ["userPrompt", 0]
134
308
  },
309
+ {
310
+ "edgeId": "e-reg-worker",
311
+ "fromNodeId": "worker",
312
+ "fromPort": ["registration", 0],
313
+ "toNodeId": "coder",
314
+ "toPort": ["subagentRegistration", 0]
315
+ },
316
+ {
317
+ "edgeId": "e-spawn-worker",
318
+ "fromNodeId": "coder",
319
+ "fromPort": ["subagent", 0],
320
+ "toNodeId": "worker",
321
+ "toPort": ["task", 0]
322
+ },
323
+ {
324
+ "edgeId": "e-result-worker",
325
+ "fromNodeId": "worker",
326
+ "fromPort": ["result", 0],
327
+ "toNodeId": "coder",
328
+ "toPort": ["subagentResult", 0]
329
+ },
135
330
  {
136
331
  "edgeId": "5647d587-512e-4c04-968c-c0f2c866163a",
137
332
  "fromNodeId": "coder",
@@ -147,11 +342,46 @@
147
342
  "toPort": ["feedback", 0]
148
343
  },
149
344
  {
150
- "edgeId": "fe17cdd0-c337-4ea5-bc83-be960e3532f1",
345
+ "edgeId": "9078315a-1b02-4ce9-a976-2326a317bf2a",
346
+ "fromNodeId": "memory-tools",
347
+ "fromPort": ["tools", 0],
348
+ "toNodeId": "d80650bf-8250-488c-9773-b2f0622517b8",
349
+ "toPort": ["ch", 0]
350
+ },
351
+ {
352
+ "edgeId": "a1619a9f-c0b4-4eab-a9db-ff36e5a45961",
353
+ "fromNodeId": "d80650bf-8250-488c-9773-b2f0622517b8",
354
+ "fromPort": ["ch", 0],
355
+ "toNodeId": "coder",
356
+ "toPort": ["tools", 0]
357
+ },
358
+ {
359
+ "edgeId": "59638f55-bf1f-4345-b711-87c9bef04639",
360
+ "fromNodeId": "d80650bf-8250-488c-9773-b2f0622517b8",
361
+ "fromPort": ["ch", 0],
362
+ "toNodeId": "worker",
363
+ "toPort": ["tools", 0]
364
+ },
365
+ {
366
+ "edgeId": "6561ab66-3218-4870-a5af-bffc1b0f1f67",
151
367
  "fromNodeId": "dcf00a52-7d55-4242-8dac-3896414e5d88",
152
368
  "fromPort": ["response", 0],
369
+ "toNodeId": "db0c5a0e-0ebd-49ef-bed9-c42edec92a48",
370
+ "toPort": ["result", 0]
371
+ },
372
+ {
373
+ "edgeId": "a24ad4d0-134c-4f5a-b6b3-0751e04d29d6",
374
+ "fromNodeId": "db0c5a0e-0ebd-49ef-bed9-c42edec92a48",
375
+ "fromPort": ["response", 0],
153
376
  "toNodeId": "f9df4410-fa4a-459f-8d89-603f9fb29198",
154
377
  "toPort": ["value", 0]
378
+ },
379
+ {
380
+ "edgeId": "3b7f3889-3bd2-4e50-85fa-0aa7fe8dd771",
381
+ "fromNodeId": "db0c5a0e-0ebd-49ef-bed9-c42edec92a48",
382
+ "fromPort": ["feedback", 0],
383
+ "toNodeId": "plan",
384
+ "toPort": ["feedback", 1]
155
385
  }
156
386
  ]
157
387
  }