mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-08 03:10:26 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
3473386927
commit
75680c8c5c
5 changed files with 8 additions and 18 deletions
|
|
@ -12,7 +12,6 @@ import type { EdgeSelection } from "./helpers";
|
|||
const REASON_LABEL: Record<string, string> = {
|
||||
condition: "Matched condition",
|
||||
unconditional: "Default edge",
|
||||
jump: "Jumped",
|
||||
preferred_label: "Preferred label",
|
||||
};
|
||||
|
||||
|
|
@ -110,12 +109,6 @@ export function ConditionalDecision({
|
|||
</dd>
|
||||
</>
|
||||
)}
|
||||
{edge.isJump && (
|
||||
<>
|
||||
<dt className="text-fg-muted">Edge type</dt>
|
||||
<dd className="text-fg-2">Jump</dd>
|
||||
</>
|
||||
)}
|
||||
</dl>
|
||||
)}
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue