From 75680c8c5c3a2fb48a5229b7bf485f298f868d00 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sun, 27 Sep 2026 09:59:27 -0400 Subject: [PATCH] Drop the jump route kind from the Petri stream reader Petri removes routing jumps (lithoscomputer/petri: RouteDecision::Jump and the `jump` kind of `route.applied`); nothing ever produced one. The web app no longer reads a `jump` kind, shows a "Jumped" reason or an "Edge type: Jump" row, and the stream round-trip test uses an edge record with its derived transition and back. Co-Authored-By: Claude Opus 5.5 --- .../components/stage-renderers/conditional-decision.tsx | 7 ------- apps/fabro-web/app/components/stage-renderers/helpers.ts | 1 - apps/fabro-web/app/lib/petri-stream.test.ts | 2 -- apps/fabro-web/app/lib/petri-stream.ts | 8 ++------ .../fabro-api/tests/run_stream_item_round_trip.rs | 8 ++++++-- 5 files changed, 8 insertions(+), 18 deletions(-) diff --git a/apps/fabro-web/app/components/stage-renderers/conditional-decision.tsx b/apps/fabro-web/app/components/stage-renderers/conditional-decision.tsx index ff1fb4b9a..13727e1d5 100644 --- a/apps/fabro-web/app/components/stage-renderers/conditional-decision.tsx +++ b/apps/fabro-web/app/components/stage-renderers/conditional-decision.tsx @@ -12,7 +12,6 @@ import type { EdgeSelection } from "./helpers"; const REASON_LABEL: Record = { condition: "Matched condition", unconditional: "Default edge", - jump: "Jumped", preferred_label: "Preferred label", }; @@ -110,12 +109,6 @@ export function ConditionalDecision({ )} - {edge.isJump && ( - <> -
Edge type
-
Jump
- - )} )} diff --git a/apps/fabro-web/app/components/stage-renderers/helpers.ts b/apps/fabro-web/app/components/stage-renderers/helpers.ts index 9380463e2..3aa0d557e 100644 --- a/apps/fabro-web/app/components/stage-renderers/helpers.ts +++ b/apps/fabro-web/app/components/stage-renderers/helpers.ts @@ -85,7 +85,6 @@ export interface EdgeSelection { toNode: string; reason: string; condition: string | null; - isJump: boolean; } // Re-export helper used by renderers that need to read nested properties. diff --git a/apps/fabro-web/app/lib/petri-stream.test.ts b/apps/fabro-web/app/lib/petri-stream.test.ts index 799477e80..55dc013ef 100644 --- a/apps/fabro-web/app/lib/petri-stream.test.ts +++ b/apps/fabro-web/app/lib/petri-stream.test.ts @@ -198,7 +198,6 @@ describe("stage renderers", () => { toNode: "no", reason: "condition", condition: null, - isJump: false, }); expect(findPetriEdgeForStage(gate.stream, "exit@1")).toBeNull(); }); @@ -268,7 +267,6 @@ describe("stage renderers", () => { toNode: "ok", reason: "condition", condition: "outcome=succeeded", - isJump: false, }); }); diff --git a/apps/fabro-web/app/lib/petri-stream.ts b/apps/fabro-web/app/lib/petri-stream.ts index a1b71b0cf..63cb48189 100644 --- a/apps/fabro-web/app/lib/petri-stream.ts +++ b/apps/fabro-web/app/lib/petri-stream.ts @@ -486,8 +486,7 @@ export function debugRowSearchText(row: DebugRow): string { /** * The edge a stage's firing took, from its `route.applied` record: - * `derived.target` is the node Petri resolved, `kind` says whether the edge - * was followed or jumped to. + * `derived.target` is the node Petri resolved. */ export function findPetriEdgeForStage( stream: PetriStream, @@ -499,14 +498,11 @@ export function findPetriEdgeForStage( if (petriStageLabel(item) !== stageLabel) continue; const target = getString(getObject(derived(item), "target"), "name"); if (!target) continue; - const body = petriBody(item); - const kind = getString(body, "kind") ?? "edge"; latest = { fromNode: getString(subjectNode(item), "name") ?? stageLabel, toNode: target, - reason: kind === "jump" ? "jump" : "condition", + reason: "condition", condition: matchedCondition(item) ?? null, - isJump: kind === "jump", }; } return latest; diff --git a/lib/foundation/fabro-api/tests/run_stream_item_round_trip.rs b/lib/foundation/fabro-api/tests/run_stream_item_round_trip.rs index 3147c9646..08b3aec0d 100644 --- a/lib/foundation/fabro-api/tests/run_stream_item_round_trip.rs +++ b/lib/foundation/fabro-api/tests/run_stream_item_round_trip.rs @@ -31,9 +31,13 @@ fn a_petri_item_round_trips_with_its_event_unchanged() { }, "record": { "seq": 23, "origin": "core", "recorded_at": 1_789_323_217_459_u64, - "body": { "event": "route.applied", "kind": "jump", "firing": 3, "target": 7 } + "body": { "event": "route.applied", "kind": "edge", "firing": 3, "group": 0, "edge": 9 } }, - "derived": { "target": { "id": 7, "name": "finalize", "kind": "attractor/command", "meta": { "kind": "command" } } } + "derived": { + "target": { "id": 7, "name": "finalize", "kind": "attractor/command", "meta": { "kind": "command" } }, + "transition": "Continue", + "back": false + } } }); let item: RunStreamItem = serde_json::from_value(value.clone()).unwrap();