Repository navigation
feat(graph): a station that waits on someone reads as waiting, not working - #133
Conversation
|
Lore is reviewing this PR — da0e597e-989e-44ed-baea-ebbb6ae7b189. Submit a review that requests changes to have Lore push a fix for it. Comment |
Lore code reviewReviewed revision The story the tests tellThe run graph can now show a custom waiting label on a station that is waiting on a person. The label shows only while the station's visit is still open, and the card grows to fit it. The full story, with its testsThe run graph view takes an optional Tests: A longer waiting label makes the card wider. The same station is drawn wider with the long label than with no label. Tests: The label applies only while the visit is open. Once the station's visit has closed in success, the subtitle goes back to plain "person" and the waiting mark is gone, even though the label is still passed in. Tests: What the checks readThe story holds. In the code, The story holds. It covers the waiting label in the subtitle, The one changed README statement about overlaying an assembly run matches the code in packages/graph, so no gaps were found. |
There was a problem hiding this comment.
Lore review — Changes suggested
2 gaps separate the story the tests tell from the implementation, the issue and the changed documents.
Must fix (2) · Consider (0) · Nits (0)
Reviewed by claude-sonnet-5-5
Submit a review that requests changes to have Lore push a fix for it. Comment @lore review to re-run the review.
Notes on lines outside changed hunks
packages/graph/src/metro/station-visits.test.ts:22 — issue (blocking): Missing test: Waiting entry ignored for a station that is not open
withWaiting in station-visits.ts sets waiting only when status.open && nodeId in waiting. The story and tests only cover an open station that has a waiting entry. Nothing shows that a closed station with a waiting entry stays unmarked, or that a station with no entry is left as it was.
Proposed:
describe("withWaiting", () => {
it("marks only an open station that has a waiting entry", () => {
const stations = withWaiting(
stationVisitsOf([
{ nodeId: "a", iteration: 1, outcome: "success", open: false },
{ nodeId: "b", iteration: 1, open: true },
{ nodeId: "c", iteration: 1, open: true },
]),
{ a: "Waiting for a", b: "Waiting for b" },
);
expect(["a", "b", "c"].map((id) => stations.get(id)?.waiting)).toEqual([undefined, "Waiting for b", undefined]);
});
});
Evidence: packages/graph/src/metro/station-visits.ts 25
Posted by floor, visit 048d9ae1-b8d1-4b6b-99a6-78f7f5226bef.
| waiting: card?.getAttribute("data-waiting"), | ||
| open: card?.getAttribute("data-open"), | ||
| }).toEqual({ subtitle: "person · Waiting for the spec PR", waiting: "true", open: null }); | ||
| }); |
There was a problem hiding this comment.
issue (blocking): Missing test: Longer waiting label widens the card
The pull request says use-node-size reads the same subtitle through StationVisits.waiting, so a longer label widens the card. useNodeSize calls subtitleOf, so this is built. No test compares the width of a waiting card with a non-waiting one.
Proposed:
it("widens the card when the waiting label is longer than open", async () => {
const definition = markerLine({
kind: "human",
entry: "a",
nodeIds: ["a", "merged", "done"],
edges: [
["a", "merged", "success"],
["merged", "done", "success"],
],
});
const run = {
visits: [
{ nodeId: "a", iteration: 1, outcome: "success", open: false },
{ nodeId: "merged", iteration: 1, open: true },
],
};
const widthOf = (container: HTMLElement) =>
Number(container.querySelector('[data-node="merged"] rect')?.getAttribute("width"));
const open = await renderGraph(<RunGraphView definition={definition} run={run} />);
const waiting = await renderGraph(<RunGraphView definition={definition} run={run} waiting={{ merged: "Waiting for the spec pull request to be merged" }} />);
expect(widthOf(waiting.container)).toBeGreaterThan(widthOf(open.container));
});
Evidence: packages/graph/src/use-node-size.ts 8; packages/graph/src/station-subtitle.ts 7; #133 10
…rking
RunGraphView takes waiting={{ id: label }}. An open visit on such a station
shows the label in place of "open" (person · Waiting for the spec PR), marks
the card data-waiting instead of data-open, and draws a solid border in the
wait tone with no march. Lore's run page needs it: a parked human station must
never read as running (lore FR6.23, FR6.72).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Added |
a9fa877 to
0742938
Compare
|
Lore is reviewing this PR — aefacebc-3bd1-48ee-8c92-dbcf2e9082c2. Submit a review that requests changes to have Lore push a fix for it. Comment |
There was a problem hiding this comment.
Lore review — Changes suggested
1 gap separates the story the tests tell from the implementation, the issue and the changed documents.
Must fix (1) · Consider (0) · Nits (0)
Reviewed by claude-sonnet-5-5
Submit a review that requests changes to have Lore push a fix for it. Comment @lore review to re-run the review.
Posted by floor, visit f2877ea3-ce0f-4a00-8d8a-b71213fa91d2.
| waiting: card?.getAttribute("data-waiting"), | ||
| open: card?.getAttribute("data-open"), | ||
| }).toEqual({ subtitle: "person · Waiting for the spec PR", waiting: "true", open: null }); | ||
| }); |
There was a problem hiding this comment.
issue (blocking): Missing test: Waiting label ignored when the visit is closed
withWaiting only attaches a label when status.open is true. No test covers a waiting entry for a station whose visit is closed. The story says only that a waiting station with an open visit shows the label.
Proposed:
it("ignores the waiting label on a station whose visit is closed", async () => {
const definition = markerLine({
kind: "human",
entry: "a",
nodeIds: ["a", "merged", "done"],
edges: [
["a", "merged", "success"],
["merged", "done", "success"],
],
});
const run = {
visits: [
{ nodeId: "a", iteration: 1, outcome: "success", open: false },
{ nodeId: "merged", iteration: 1, outcome: "success", open: false },
],
};
const { container } = await renderGraph(<RunGraphView definition={definition} run={run} waiting={{ merged: "Waiting for the spec PR" }} />);
const card = container.querySelector("[data-node=\"merged\"]");
expect({
waiting: card?.getAttribute("data-waiting"),
text: card?.textContent?.includes("Waiting for the spec PR"),
}).toEqual({ waiting: null, text: false });
});
Evidence: packages/graph/src/metro/station-visits.ts 25
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Added |
|
Lore is reviewing this PR — 7d740e18-3498-42aa-a683-97278e2049af. Submit a review that requests changes to have Lore push a fix for it. Comment |
There was a problem hiding this comment.
Lore review — Approved
The implementation, the issue and the changed documents tell the story the tests tell.
Must fix (0) · Consider (0) · Nits (0)
Reviewed by claude-sonnet-5-5
Submit a review that requests changes to have Lore push a fix for it. Comment @lore review to re-run the review.
Posted by floor, visit 510bf86e-f37c-4fce-905d-70ee3c6d7eb0.
Lore's run page is moving to floor-graph. Its spec says a parked human station, such as
mergedwaiting for the spec PR, must read as waiting on the graph and never as running. Today an open visit there showsperson · openwith the marching border, which reads as work in progress.RunGraphViewnow takeswaiting={{ [stationId]: label }}. For a station with an open visit whose id is inwaiting:open, e.g.person · Waiting for the spec PR;data-waiting="true"and nodata-open, so the march doesn't run;--waittone.The label travels on
StationVisits.waiting, sosubtitleOfand the card's width (use-node-size) read the same subtitle, and a longer label widens the card.The new test,
reads the waiting label in place of open on a waiting station when its visit is open, failed before the change (person · open, nodata-waiting) and fails again when the label is dropped fromsubtitleOf. All 313 graph tests pass, and lint and typecheck are clean. The README documents the prop.🤖 Generated with Claude Code