Merge branch 'main' into web-layout
Take main's newer smoke behaviour where they met: the binary capture is run 449 (opened through openRunDetail), and a running run must show no aggregate Changes section. Keep the layout's shell-aware checks and its L2-L4 rows; L7 stays todo with the view-level fixes recorded.
This commit is contained in:
+192
-33
@@ -2198,7 +2198,10 @@ try {
|
||||
if (!row.icon) throw new Error(`row ${row.runId} has no status icon`);
|
||||
if (!row.label) throw new Error(`row ${row.runId} has no primary label`);
|
||||
if (!row.desc.includes(" · ")) throw new Error(`row ${row.runId} description is wrong: ${row.desc}`);
|
||||
if (row.dismissName !== "Dismiss") {
|
||||
// The dismiss control is named for the row it clears (L7 M6), e.g.
|
||||
// `Dismiss Web: live decision confirm (R11)`; the run id appears only for a
|
||||
// repeated label, so assert the shared prefix rather than the old bare word.
|
||||
if (!row.dismissName.startsWith("Dismiss ")) {
|
||||
throw new Error(`row ${row.runId}'s trailing control is not named Dismiss: ${row.dismissName}`);
|
||||
}
|
||||
const rank = kindRanks[row.kind];
|
||||
@@ -3164,6 +3167,29 @@ try {
|
||||
console.log(` expanded: ${expanded.summary} — ${expanded.rows} row(s)`);
|
||||
console.log(` note: ${expanded.note}`);
|
||||
console.log(` kinds: ${[...new Set(expanded.kinds)].join(", ")}`);
|
||||
// The summary is the final state: retry_test.go was modified in two
|
||||
// implementer visits (+30 -12, then +42 -12). The row must show the last
|
||||
// visit's +42 -12, not their +72 -24 sum, and only the one stage name.
|
||||
const finalState = await page.evaluate(`(() => {
|
||||
const row = [...document.querySelectorAll(".run-detail .changes-list .change-row")]
|
||||
.find((n) => n.querySelector(".change-path")?.textContent === "internal/server/retry_test.go");
|
||||
if (!row) return null;
|
||||
return {
|
||||
stat: [...row.querySelectorAll(".change-stat span")].map((n) => n.textContent).join(" "),
|
||||
meta: row.querySelector(".change-meta")?.textContent ?? "",
|
||||
};
|
||||
})()`);
|
||||
if (!finalState) throw new Error("run 438's Changes list lost internal/server/retry_test.go");
|
||||
if (finalState.stat !== "+42 -12") {
|
||||
throw new Error(`run 438 did not show retry_test.go's final-visit stat: ${finalState.stat}`);
|
||||
}
|
||||
if (finalState.meta !== "changed by implementer") {
|
||||
throw new Error(`run 438's retry_test.go stage list is wrong: ${finalState.meta}`);
|
||||
}
|
||||
if (!collapsed.title.includes("+934 -156")) {
|
||||
throw new Error(`run 438's header is not the final-state stat: ${collapsed.title}`);
|
||||
}
|
||||
console.log(` final state: retry_test.go ${finalState.stat} — ${finalState.meta}`);
|
||||
await page.evaluate(`document.querySelector(".run-detail .changes-list .change-row")?.scrollIntoView({ block: "center" })`);
|
||||
shots.push(await page.screenshot(`${out}/29-run-438-changes-expanded.png`));
|
||||
|
||||
@@ -3262,13 +3288,64 @@ try {
|
||||
await page.waitForSelector(".change-viewer", { timeout: 15000 });
|
||||
await closeChangeViewer("backdrop");
|
||||
|
||||
// Part 1: each visit's "This run" carries its own capture. Run 438's second
|
||||
// implementer visit changed only retry_test.go and must not show the run-wide
|
||||
// aggregate (or the first visit's docs/runner rows).
|
||||
step("opening run 438's second implementer visit: its own File changes");
|
||||
await page.clickText(".detail .detail-tabs .detail-tab", "Timeline");
|
||||
await page.waitForSelector(".detail .timeline-row", { timeout: 15000 });
|
||||
await page.click('.detail .timeline-row[data-stage-key="implementer"][data-visit-index="1"]');
|
||||
await page.waitForSelector(".stage-pane", { timeout: 15000 });
|
||||
await page.clickText(".stage-pane .section-toggle", "This run");
|
||||
await page.waitForSelector(".stage-pane .codeblock", { timeout: 15000 });
|
||||
const visitChanges = await page.evaluate(`(() => {
|
||||
const row = [...document.querySelectorAll(".stage-pane .kv-row")]
|
||||
.find((n) => n.querySelector(".kv-key")?.textContent === "File changes");
|
||||
const block = [...document.querySelectorAll(".stage-pane .codeblock")]
|
||||
.find((n) => n.querySelector(".codeblock-label")?.textContent === "Changed files");
|
||||
return {
|
||||
summary: row?.querySelector(".kv-val")?.textContent ?? "",
|
||||
files: block?.querySelector(".codeblock-body")?.textContent ?? "",
|
||||
labels: [...document.querySelectorAll(".stage-pane .codeblock-label")].map((n) => n.textContent),
|
||||
};
|
||||
})()`);
|
||||
if (!visitChanges.summary.startsWith("partial (1 files), 2 skipped · Excluded protected")) {
|
||||
throw new Error(`the implementer visit's File changes is wrong: ${visitChanges.summary}`);
|
||||
}
|
||||
if (visitChanges.files !== "modified internal/server/retry_test.go +42 -12") {
|
||||
throw new Error(`the implementer visit's Changed files is wrong: ${visitChanges.files}`);
|
||||
}
|
||||
if (visitChanges.files.includes("docs/notes") || visitChanges.files.includes("runner.go")) {
|
||||
throw new Error(`the visit pane leaked another visit's files: ${visitChanges.files}`);
|
||||
}
|
||||
console.log(` implementer visit 2: ${visitChanges.summary}`);
|
||||
console.log(` changed files: ${visitChanges.files}`);
|
||||
await page.evaluate(`(() => {
|
||||
const row = [...document.querySelectorAll(".stage-pane .kv-row")]
|
||||
.find((n) => n.querySelector(".kv-key")?.textContent === "File changes");
|
||||
row?.scrollIntoView({ block: "center" });
|
||||
})()`);
|
||||
shots.push(await page.screenshot(`${out}/78-run-438-implementer-visit-changes.png`));
|
||||
await page.click(".stage-pane-back");
|
||||
await eventually(() => page.evaluate(`!document.querySelector(".stage-pane")`), {
|
||||
timeout: 5000,
|
||||
what: "the implementer visit pane to close",
|
||||
});
|
||||
|
||||
// A binary capture: the honest message in place of a diff, and Raw disabled.
|
||||
step("opening a binary capture (run 442): the honest message and a disabled Raw patch");
|
||||
await page.click('.list.runs .run-row-meta[data-run-id="442"]');
|
||||
await page.waitForText("run 442 ·", { timeout: 25000 });
|
||||
await page.waitForSelector("#detailTitle", { timeout: 25000 });
|
||||
// Run 449 succeeded and recorded binary captures; choose its binary row (its
|
||||
// first row is a text file).
|
||||
step("opening a binary capture (run 449): the honest message and a disabled Raw patch");
|
||||
await openRunDetail(449);
|
||||
await expandChanges();
|
||||
await page.click(".run-detail .changes-list .change-row");
|
||||
const openedBinary = await page.evaluate(`(() => {
|
||||
const row = [...document.querySelectorAll(".run-detail .changes-list .change-row")]
|
||||
.find((n) => (n.querySelector(".change-meta")?.textContent ?? "").includes("binary"));
|
||||
if (!row) return false;
|
||||
row.click();
|
||||
return true;
|
||||
})()`);
|
||||
if (!openedBinary) throw new Error("run 449's Changes list showed no binary row");
|
||||
await page.waitForSelector(".change-viewer .change-honest", { timeout: 15000 });
|
||||
const binary = await page.evaluate(`(() => ({
|
||||
message: document.querySelector(".change-viewer .change-honest")?.textContent ?? "",
|
||||
@@ -3284,7 +3361,7 @@ try {
|
||||
if (binary.rawDisabled !== true) throw new Error("Raw patch should be disabled for a binary file");
|
||||
if (binary.hunks !== 0) throw new Error("a binary file must not render a fabricated diff");
|
||||
console.log(` binary: ${binary.message}`);
|
||||
shots.push(await page.screenshot(`${out}/32-run-442-changes-binary.png`));
|
||||
shots.push(await page.screenshot(`${out}/32-run-449-changes-binary.png`));
|
||||
await closeChangeViewer("close");
|
||||
|
||||
// A truncated capture: the truncation reason, still no fabricated diff.
|
||||
@@ -3315,38 +3392,118 @@ try {
|
||||
shots.push(await page.screenshot(`${out}/33-run-450-changes-truncated.png`));
|
||||
await closeChangeViewer("close");
|
||||
|
||||
// A still-running run: its Changes header must be one of the two valid shapes
|
||||
// for an in-flight capture (the empty `Changes · …` variant, or a file-count
|
||||
// header), never a fabricated complete diff. Its live state decides which, so
|
||||
// the probe accepts either rather than pinning one.
|
||||
step("opening a running run's Changes header");
|
||||
const pendingRunId = await page.evaluate(`(() => {
|
||||
// Part 3: a failed run has no settled final state, so its Summary carries no
|
||||
// aggregate Changes section at all. The visit pane still carries that visit's
|
||||
// own capture.
|
||||
step("opening failed run 440: no Summary Changes section");
|
||||
await openRunDetail(440);
|
||||
const failedSummaryTitles = await page.evaluate(
|
||||
`[...document.querySelectorAll(".run-detail .collapsible .section-title")].map((n) => n.textContent ?? "")`,
|
||||
);
|
||||
const leakedAggregate = failedSummaryTitles.find(
|
||||
(title) => /^Changes · /.test(title) || /^\d+ files? changed/.test(title),
|
||||
);
|
||||
if (leakedAggregate) {
|
||||
throw new Error(`failed run 440 still shows an aggregate Changes section: ${leakedAggregate}`);
|
||||
}
|
||||
console.log(` run 440 summary sections: ${failedSummaryTitles.join(" | ")}`);
|
||||
shots.push(await page.screenshot(`${out}/79-run-440-no-summary-changes.png`));
|
||||
|
||||
step("run 440's visit pane keeps that visit's own File changes");
|
||||
await page.clickText(".detail .detail-tabs .detail-tab", "Timeline");
|
||||
await page.waitForSelector(".detail .timeline-row", { timeout: 15000 });
|
||||
await page.click(".detail .timeline-row");
|
||||
await page.waitForSelector(".stage-pane", { timeout: 15000 });
|
||||
await page.clickText(".stage-pane .section-toggle", "This run");
|
||||
await page.waitForSelector(".stage-pane .kv-row", { timeout: 15000 });
|
||||
const failedVisit = await page.evaluate(`(() => {
|
||||
const row = [...document.querySelectorAll(".stage-pane .kv-row")]
|
||||
.find((n) => n.querySelector(".kv-key")?.textContent === "File changes");
|
||||
const block = [...document.querySelectorAll(".stage-pane .codeblock")]
|
||||
.find((n) => n.querySelector(".codeblock-label")?.textContent === "Changed files");
|
||||
return {
|
||||
summary: row?.querySelector(".kv-val")?.textContent ?? "",
|
||||
files: block?.querySelector(".codeblock-body")?.textContent ?? "",
|
||||
};
|
||||
})()`);
|
||||
// This visit's capture recorded no file rows (0 files, 2 skipped), so the
|
||||
// honest summary is shown and Changed files is correctly absent.
|
||||
if (!failedVisit.summary.startsWith("partial, 2 skipped · Excluded protected")) {
|
||||
throw new Error(`run 440's visit File changes is wrong: ${failedVisit.summary}`);
|
||||
}
|
||||
if (failedVisit.files !== "") {
|
||||
throw new Error(`run 440's visit invented Changed files with no recorded rows: ${failedVisit.files}`);
|
||||
}
|
||||
console.log(` run 440 visit: ${failedVisit.summary} (no recorded file rows)`);
|
||||
await page.evaluate(`(() => {
|
||||
const row = [...document.querySelectorAll(".stage-pane .kv-row")]
|
||||
.find((n) => n.querySelector(".kv-key")?.textContent === "File changes");
|
||||
row?.scrollIntoView({ block: "center" });
|
||||
})()`);
|
||||
shots.push(await page.screenshot(`${out}/80-run-440-visit-changes.png`));
|
||||
await page.click(".stage-pane-back");
|
||||
await eventually(() => page.evaluate(`!document.querySelector(".stage-pane")`), {
|
||||
timeout: 5000,
|
||||
what: "the run 440 visit pane to close",
|
||||
});
|
||||
|
||||
// A failed run that did record file rows: run 442's implementer visit keeps
|
||||
// its own Changed files even though the Summary aggregate is suppressed.
|
||||
step("run 442's failed implementer visit keeps its Changed files");
|
||||
await openRunDetail(442);
|
||||
await page.clickText(".detail .detail-tabs .detail-tab", "Timeline");
|
||||
await page.waitForSelector(".detail .timeline-row", { timeout: 15000 });
|
||||
await page.click('.detail .timeline-row[data-stage-key="implementer"][data-visit-index="0"]');
|
||||
await page.waitForSelector(".stage-pane", { timeout: 15000 });
|
||||
await page.clickText(".stage-pane .section-toggle", "This run");
|
||||
await page.waitForSelector(".stage-pane .codeblock", { timeout: 15000 });
|
||||
const failedFiles = await page.evaluate(`(() => {
|
||||
const block = [...document.querySelectorAll(".stage-pane .codeblock")]
|
||||
.find((n) => n.querySelector(".codeblock-label")?.textContent === "Changed files");
|
||||
return block?.querySelector(".codeblock-body")?.textContent ?? "";
|
||||
})()`);
|
||||
if (!failedFiles.includes("web/src/")) {
|
||||
throw new Error(`run 442's implementer visit lost its Changed files: ${failedFiles}`);
|
||||
}
|
||||
console.log(` run 442 implementer visit changed files: ${failedFiles.split("\n").length} rows`);
|
||||
await page.evaluate(`(() => {
|
||||
const block = [...document.querySelectorAll(".stage-pane .codeblock")]
|
||||
.find((n) => n.querySelector(".codeblock-label")?.textContent === "Changed files");
|
||||
block?.scrollIntoView({ block: "center" });
|
||||
})()`);
|
||||
shots.push(await page.screenshot(`${out}/81-run-442-failed-visit-changes.png`));
|
||||
await page.click(".stage-pane-back");
|
||||
await eventually(() => page.evaluate(`!document.querySelector(".stage-pane")`), {
|
||||
timeout: 5000,
|
||||
what: "the run 442 visit pane to close",
|
||||
});
|
||||
|
||||
// A running run has no settled final state either: invert the old pending-
|
||||
// header probe and assert the aggregate is absent while it executes.
|
||||
step("a running run's Summary has no Changes section");
|
||||
await page.clickText("nav.tabs button.tab", "Runs");
|
||||
await page.waitForSelector(".list.runs .run-row", { timeout: 25000 });
|
||||
const runningRunId = await page.evaluate(`(() => {
|
||||
const row = [...document.querySelectorAll(".list.runs .run-row")]
|
||||
.find((n) => n.querySelector(".chip-running"));
|
||||
const meta = row?.querySelector(".run-row-meta[data-run-id]");
|
||||
return meta ? Number(meta.getAttribute("data-run-id")) : null;
|
||||
})()`);
|
||||
if (pendingRunId == null) {
|
||||
console.log(" -- no running run available; skipped the pending Changes header");
|
||||
if (runningRunId == null) {
|
||||
console.log(" -- no running run available; skipped the no-aggregate check");
|
||||
} else {
|
||||
await page.click(`.list.runs .run-row-meta[data-run-id="${pendingRunId}"]`);
|
||||
await page.waitForSelector("#detailTitle", { timeout: 25000 });
|
||||
const pendingToggle = await page.evaluate(`(() => {
|
||||
// A running run's Changes header has one of two valid shapes: the
|
||||
// empty-capture form (Changes · capture pending / partial capture /
|
||||
// capture incomplete) before any step has recorded files, or the
|
||||
// file-count form ({N} file(s) changed · ±stat · …) once one has. Which
|
||||
// one appears depends on how far the live capture has progressed, so the
|
||||
// probe accepts either rather than assuming the empty variant.
|
||||
return [...document.querySelectorAll(".run-detail .collapsible .section-toggle .section-title")]
|
||||
.map((n) => n.textContent ?? "")
|
||||
.find((t) => /^Changes · /.test(t) || /^\\d+ files? changed/.test(t)) ?? "";
|
||||
})()`);
|
||||
if (!/^Changes · /.test(pendingToggle) && !/^\d+ files? changed/.test(pendingToggle)) {
|
||||
throw new Error(`a running run's Changes header is wrong: ${pendingToggle}`);
|
||||
await openRunDetail(runningRunId);
|
||||
const runningTitles = await page.evaluate(
|
||||
`[...document.querySelectorAll(".run-detail .collapsible .section-title")].map((n) => n.textContent ?? "")`,
|
||||
);
|
||||
const runningAggregate = runningTitles.find(
|
||||
(title) => /^Changes · /.test(title) || /^\d+ files? changed/.test(title),
|
||||
);
|
||||
if (runningAggregate) {
|
||||
throw new Error(`running run ${runningRunId} shows an aggregate Changes section: ${runningAggregate}`);
|
||||
}
|
||||
console.log(` running run ${pendingRunId} changes header: ${pendingToggle}`);
|
||||
shots.push(await page.screenshot(`${out}/34-run-${pendingRunId}-changes-pending.png`));
|
||||
console.log(` running run ${runningRunId}: no Summary Changes section`);
|
||||
shots.push(await page.screenshot(`${out}/82-run-${runningRunId}-no-summary-changes.png`));
|
||||
}
|
||||
|
||||
// S1/S2: omni-search over the real server. The panel is opened from the top
|
||||
@@ -3913,7 +4070,9 @@ try {
|
||||
if (!operatorRow.chips.includes("Operator")) {
|
||||
throw new Error(`chat kind chip: ${operatorRow.chips.join(", ")}`);
|
||||
}
|
||||
if (!operatorRow.menu || operatorRow.menuLabel !== "Chat actions") {
|
||||
// M6 names the control for its row: `Chat actions for {title}`, with the
|
||||
// session id only when titles repeat. Assert the shared prefix and title.
|
||||
if (!operatorRow.menu || !operatorRow.menuLabel.startsWith("Chat actions for ")) {
|
||||
throw new Error(`the open chat row's Chat actions menu: ${JSON.stringify(operatorRow)}`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user