Skip to content

feat(graph): a station that waits on someone reads as waiting, not working - #133

Merged
gedaiu merged 3 commits into
mainfrom
feat/graph-waiting-label
Nov 24, 2026
Merged

gedaiu merged 3 commits into
mainfrom
feat/graph-waiting-label

Conversation

@gedaiu

@gedaiu gedaiu commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Lore's run page is moving to floor-graph. Its spec says a parked human station, such as merged waiting for the spec PR, must read as waiting on the graph and never as running. Today an open visit there shows person · open with the marching border, which reads as work in progress.

RunGraphView now takes waiting={{ [stationId]: label }}. For a station with an open visit whose id is in waiting:

  • the subtitle shows the label in place of open, e.g. person · Waiting for the spec PR;
  • the card gets data-waiting="true" and no data-open, so the march doesn't run;
  • its border is solid in the --wait tone.

The label travels on StationVisits.waiting, so subtitleOf and 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, no data-waiting) and fails again when the label is dropped from subtitleOf. All 313 graph tests pass, and lint and typecheck are clean. The README documents the prop.

🤖 Generated with Claude Code

@lore-agent

lore-agent Bot commented Nov 24, 2026

Copy link
Copy Markdown

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 review to re-run the review.

@lore-agent

lore-agent Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Lore code review

Reviewed revision e726bab276de0b15f06630acbe3c1c16b7a86485 · Approved · 0 gaps

The story the tests tell

The 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 tests

The run graph view takes an optional waiting map from station id to a label. When a human station has an open visit and a label, its subtitle reads "person · " followed by the label, so the subtitle is "person · Waiting for the spec PR". The card is marked as waiting, and it no longer carries the open marker it would otherwise have.

Tests: packages/graph/src/RunGraphView.run.test.tsx (119)

A longer waiting label makes the card wider. The same station is drawn wider with the long label than with no label.

Tests: packages/graph/src/RunGraphView.run.test.tsx (147)

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: packages/graph/src/RunGraphView.run.test.tsx (171)

What the checks read

The story holds. In the code, withWaiting labels only open visits and subtitleOf reads the label in place of "open". data-waiting replaces data-open, and the three tests cover the open, wider-card and closed-visit paths. I found no contradiction or untested behaviour.

The story holds. It covers the waiting label in the subtitle, data-waiting replacing data-open, the wider card, and the closed-visit case. The solid --wait border is built in CSS but has no test, and I did not report it as a gap.

The one changed README statement about overlaying an assembly run matches the code in packages/graph, so no gaps were found.

@lore-agent lore-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 });
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

gedaiu and others added 2 commits November 24, 2026 15:28
…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>
@gedaiu

gedaiu commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Added widens merged's card when its waiting label Waiting for the spec PR is longer than open. It fails when the card's size ignores the waiting label. I also rebased the branch onto main. @lore review

@gedaiu
gedaiu force-pushed the feat/graph-waiting-label branch from a9fa877 to 0742938 Compare November 24, 2026 14:28
@lore-agent

lore-agent Bot commented Nov 24, 2026

Copy link
Copy Markdown

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 @lore review to re-run the review.

@lore-agent lore-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 });
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@gedaiu

gedaiu commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Added reads person with no waiting label or mark on merged once its visit closed in success. It fails when withWaiting labels a station whose visit is closed. The width ask is already covered by widens merged's card when its waiting label Waiting for the spec PR is longer than open, in the previous commit. @lore review

@lore-agent

lore-agent Bot commented Nov 24, 2026

Copy link
Copy Markdown

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 @lore review to re-run the review.

@lore-agent lore-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@gedaiu
gedaiu merged commit e4dde16 into main Nov 24, 2026
22 checks passed
@gedaiu
gedaiu deleted the feat/graph-waiting-label branch November 24, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant