AP1.15c: Join/Branch-Topologie mit parallel_group und optional_branch.
Deploy Development / deploy (push) Successful in 50s
Test Suite / pytest-backend (push) Successful in 2m18s
Test Suite / lint-backend (push) Successful in 3s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 13s
Deploy Development / deploy (push) Successful in 50s
Test Suite / pytest-backend (push) Successful in 2m18s
Test Suite / lint-backend (push) Successful in 3s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 13s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
364ad44759
commit
d7aefed0de
13 files changed
+321
-43
No files matched your search
@@ -132,7 +132,11 @@ export function computeGateGraphLayout(items, dependencies) {
|
||||
y: node.y + node.height / 2,
|
||||
})
|
||||
|
||||
if (dep.dependency_type === 'related') {
|
||||
if (
|
||||
dep.dependency_type === 'related' ||
|
||||
dep.dependency_type === 'parallel_group' ||
|
||||
dep.dependency_type === 'optional_branch'
|
||||
) {
|
||||
const from = center(sourceNode)
|
||||
const to = center(targetNode)
|
||||
return {
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
/**
|
||||
* Kantentypen für Zielzustands-Graph — AP1.15c erweitert um Topologie.
|
||||
* Siehe ADP_Roadmap_Graph_and_Gate_Checklist_v0.1.md § Join/Branch deferred.
|
||||
* Kantentypen für Zielzustands-Graph — AP1.15c Topologie.
|
||||
* OR-Alternativpfade bewusst nicht enthalten (PO-Deferral).
|
||||
*/
|
||||
|
||||
/** Im Designer AP1.15a/b nutzbar */
|
||||
export const DESIGNER_EDGE_KINDS = ['requires', 'blocks', 'related']
|
||||
/** Basis-Kanten im Designer */
|
||||
export const DESIGNER_EDGE_KINDS = [
|
||||
'requires',
|
||||
'blocks',
|
||||
'related',
|
||||
'parallel_group',
|
||||
'optional_branch',
|
||||
]
|
||||
|
||||
/** AP1.15c — parallel_group, optional_branch; ggf. OR später */
|
||||
export const DEFERRED_TOPOLOGY_EDGE_KINDS = ['parallel_group', 'optional_branch']
|
||||
/** Erfordert group_key bei Anlage */
|
||||
export const EDGE_KINDS_REQUIRING_GROUP_KEY = ['parallel_group']
|
||||
|
||||
export const DESIGNER_EDGE_LABELS = {
|
||||
requires: 'Voraussetzung',
|
||||
@@ -16,3 +22,21 @@ export const DESIGNER_EDGE_LABELS = {
|
||||
parallel_group: 'Parallelgruppe',
|
||||
optional_branch: 'Optional',
|
||||
}
|
||||
|
||||
/** @deprecated use DESIGNER_EDGE_KINDS */
|
||||
export const DEFERRED_TOPOLOGY_EDGE_KINDS = ['parallel_group', 'optional_branch']
|
||||
|
||||
export function edgeKindNeedsGroupKey(kind) {
|
||||
return EDGE_KINDS_REQUIRING_GROUP_KEY.includes(kind)
|
||||
}
|
||||
|
||||
/**
|
||||
* Kanten-Richtung beim Anlegen per Drag (Quelle → Ziel).
|
||||
* requires: Ziel hängt von Quelle ab (from=Ziel, to=Quelle).
|
||||
*/
|
||||
export function resolveDependencyEndpoints(edgeKind, sourceId, targetId) {
|
||||
if (edgeKind === 'requires') {
|
||||
return { from_item_id: targetId, to_item_id: sourceId }
|
||||
}
|
||||
return { from_item_id: sourceId, to_item_id: targetId }
|
||||
}
|
||||
@@ -2,14 +2,33 @@ import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
DEFERRED_TOPOLOGY_EDGE_KINDS,
|
||||
DESIGNER_EDGE_KINDS,
|
||||
edgeKindNeedsGroupKey,
|
||||
resolveDependencyEndpoints,
|
||||
} from './gateGraphTopology.js'
|
||||
|
||||
describe('gateGraphTopology', () => {
|
||||
it('keeps designer and deferred edge kinds separate', () => {
|
||||
it('includes topology kinds in designer', () => {
|
||||
expect(DESIGNER_EDGE_KINDS).toContain('requires')
|
||||
expect(DEFERRED_TOPOLOGY_EDGE_KINDS).toContain('parallel_group')
|
||||
expect(DESIGNER_EDGE_KINDS).toContain('parallel_group')
|
||||
expect(DESIGNER_EDGE_KINDS).toContain('optional_branch')
|
||||
for (const kind of DEFERRED_TOPOLOGY_EDGE_KINDS) {
|
||||
expect(DESIGNER_EDGE_KINDS).not.toContain(kind)
|
||||
expect(DESIGNER_EDGE_KINDS).toContain(kind)
|
||||
}
|
||||
})
|
||||
|
||||
it('requires group_key for parallel_group', () => {
|
||||
expect(edgeKindNeedsGroupKey('parallel_group')).toBe(true)
|
||||
expect(edgeKindNeedsGroupKey('requires')).toBe(false)
|
||||
})
|
||||
|
||||
it('resolves requires edge direction for join semantics', () => {
|
||||
expect(resolveDependencyEndpoints('requires', 'a', 'b')).toEqual({
|
||||
from_item_id: 'b',
|
||||
to_item_id: 'a',
|
||||
})
|
||||
expect(resolveDependencyEndpoints('optional_branch', 'a', 'b')).toEqual({
|
||||
from_item_id: 'a',
|
||||
to_item_id: 'b',
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user