Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@
"skills/q-flow/assets/viewer/src/layout-refinement.js",
"skills/q-flow/assets/viewer/src/layout-templates.js",
"skills/q-flow/assets/viewer/src/presentation-graph.js",
"skills/q-flow/assets/viewer/src/layout-semantics.js",
"examples/jeepay/"
"skills/q-flow/assets/viewer/src/layout-semantics.js"
],
"scripts": {
"package": "node scripts/package.mjs"
Expand Down
2 changes: 1 addition & 1 deletion skills/q-flow/references/graph-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ For an explicitly requested conceptual example, describe the relevant business m

### Execution, pairing and nested fragments

See `examples/jeepay/sequence.graph.json` in the repository and package for source-backed unified-order calls, explicit returns, executions and the success callback fragment. The Viewer keeps these fields optional, so legacy graphs still render; the CLI validator requires a bar on the callee of every `sync` call answered by a `return`, from the call's `receive` to the return's `send` (legacy graphs without `replyTo` are never asked). `--fix` adds the missing bars, each nested in the innermost bar of that participant around it. Two answered calls to one callee that interleave (the second opens inside the first and closes after it) are not asked for bars, since bars on one participant cannot cross. New source-grounded sequences must explicitly author known executions, nesting and call/return references; the renderer does not infer bars from paired messages. Include only fragment behavior established by the source. These fields require a Viewer built with sequence execution support.
See [`examples/jeepay/sequence.graph.json`](https://github.com/supermax92/qgraphflow/blob/main/examples/jeepay/sequence.graph.json) in the repository for source-backed unified-order calls, explicit returns, executions and the success callback fragment. The Viewer keeps these fields optional, so legacy graphs still render; the CLI validator requires a bar on the callee of every `sync` call answered by a `return`, from the call's `receive` to the return's `send` (legacy graphs without `replyTo` are never asked). `--fix` adds the missing bars, each nested in the innermost bar of that participant around it. Two answered calls to one callee that interleave (the second opens inside the first and closes after it) are not asked for bars, since bars on one participant cannot cross. New source-grounded sequences must explicitly author known executions, nesting and call/return references; the renderer does not infer bars from paired messages. Include only fragment behavior established by the source. These fields require a Viewer built with sequence execution support.

A return declares `"replyTo": "call-id"`. It must reference an earlier sync/async call with reversed endpoints, in the same operand path, with at most one explicit return per call. Merge alternative outcomes before that return. Unpaired legacy messages stay legal. Paired labels display `C1` / `↩ C1` independently of editable text. Call and return share a color; nested calls form separate groups. Eight group colors are reused deterministically per theme; larger graphs retain unique pair IDs even when colors repeat. Node module colors are independent.

Expand Down
11 changes: 5 additions & 6 deletions tests/plugin-package.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,9 @@ test('the distributed plugin runs independently from its installed location', t
'skills/q-flow/assets/viewer/src/radix-colors.js',
'skills/q-flow/assets/viewer/src/edge-routing.js', 'skills/q-flow/assets/viewer/src/diagrams/registry.js',
'skills/q-flow/assets/viewer/src/export-svg.js', 'skills/q-flow/assets/viewer/src/node-svg.js',
'README.md', ...guides, 'examples/jeepay/flowchart.graph.json', 'bin/qgraphflow.mjs'
'README.md', ...guides, 'bin/qgraphflow.mjs'
]) assert.ok(files.has(required), `Missing packaged file: ${required}`);
assert.ok(files.has('examples/jeepay/collection.graph.json'));
assert.ok([...files].filter(file => file.startsWith('examples/')).every(file => file.startsWith('examples/jeepay/')));
assert.ok(![...files].some(file => file.startsWith('examples/')), 'Example corpora stay in the repository');
assert.ok(!files.has('docs/images/order-flow.svg'));
// Fixed ELK runtime adds about 1.6MB; retain a bounded total install budget.
assert.ok(packed.unpackedSize < 4_000_000, `Unexpected install size: ${packed.unpackedSize}`);
Expand Down Expand Up @@ -186,9 +185,9 @@ test('the distributed plugin runs independently from its installed location', t
}
const installedManifest = readJson(path.join(plugin, 'package.json'));
assert.deepEqual([installedManifest.bin, installedManifest.engines], [pkg.bin, pkg.engines], 'npx and npm resolve the command and the Node range');
assert.match(run(process.execPath, ['bin/qgraphflow.mjs', 'validate', 'examples/jeepay/flowchart.graph.json', '--input-only'], plugin), /"valid":true/);
assert.match(run(process.execPath, ['bin/qgraphflow.mjs', 'validate', path.join(root, 'examples/jeepay/flowchart.graph.json'), '--input-only'], plugin), /"valid":true/);
const graphPath = path.join(temp, '输入 graph.json');
fs.copyFileSync(path.join(plugin, 'examples/jeepay/flowchart.graph.json'), graphPath);
fs.copyFileSync(path.join(root, 'examples/jeepay/flowchart.graph.json'), graphPath);
const scripts = path.join(plugin, 'skills/q-flow/scripts');
run(process.execPath, [path.join(scripts, 'validate-graph.mjs'), graphPath, '--input-only'], temp);
const output = path.join(temp, '项目输出');
Expand Down Expand Up @@ -257,6 +256,6 @@ test('the distributed plugin runs independently from its installed location', t
assert.deepEqual(fs.readFileSync(path.join(npmPlugin, file)), fs.readFileSync(path.join(plugin, file)), file);
if (file !== 'package.json') assert.deepEqual(fs.readFileSync(path.join(npmPlugin, file)), originalRuntime.get(file), file);
}
run(process.execPath, [path.join(npmPlugin, 'skills/q-flow/scripts/generate-viewer.mjs'), path.join(npmPlugin, 'examples/jeepay/flowchart.graph.json'), path.join(temp, 'npm-graph')], temp);
run(process.execPath, [path.join(npmPlugin, 'skills/q-flow/scripts/generate-viewer.mjs'), path.join(root, 'examples/jeepay/flowchart.graph.json'), path.join(temp, 'npm-graph')], temp);
assert.deepEqual(fs.readdirSync(path.join(temp, 'npm-graph')).sort(), ['diagram.svg', 'graph.json', 'index.html']);
});
Loading