Four P1 findings from the audit. Workflows claimed "No workflow runs yet" directly above stage tables listing those runs (archie-core-rcbf). The rows were built from the definition list alone, so a workflow with statistics but no definition produced no row at all. workflow-rows.js now merges both sides: a run is evidence the workflow exists. The producer is also at fault -- /api/workflows returns definitions: [] from the archie-ui composition while the daemon logs a registry of seven -- which also means "Start work" never renders there. Filed as archie-core-3tij. The logs page said "Durable history unavailable" twice and promised live logs from a stream that had stopped (archie-core-c5bz). EventSource fires onerror both for a retry and for a give-up; readyState tells them apart, so a dead stream now reports "unavailable" in red instead of "reconnecting" in amber forever. The toolbar says "Live only" and the empty state carries the explanation, each once. An unconfigured update check (501) now says so on Configuration rather than rendering nothing at all. Contrast (archie-core-umdn). --fg-subtle was 3.37:1 dark and 2.72:1 light, used for every KPI caption and column header; both move to values clearing 4.5:1 on every surface they actually land on, down to surface-hover at 4.51. White on the dark accent was 3.2:1 on the active nav item and every primary button: --accent-fg becomes near-black at 5.96:1 and the accent itself is untouched, since it is also the link colour and reads correctly on the canvas. Swept four routes in both themes: no remaining failures outside elements painted on a gradient, which a compositing check cannot judge and which are white on blue-purple anyway. The HEALTH cards take their own height again (archie-core-1786637500926-421-7c63bcd3). Equalising them was right when both held a checklist; once setup completes, that card is a title and one line while Gate pulse carries a gauge and four rows, so matching heights left a ~400px empty box in the first screen.
45 lines
1.6 KiB
JavaScript
45 lines
1.6 KiB
JavaScript
import { test } from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { workflowRows } from "../src/workflows/workflow-rows.js";
|
|
|
|
test("a defined workflow with no runs still gets a row at zero", () => {
|
|
const rows = workflowRows([], [{ id: "tdd", name: "TDD", enabled: true }]);
|
|
assert.equal(rows.length, 1);
|
|
assert.equal(rows[0].id, "tdd");
|
|
assert.equal(rows[0].runs, 0);
|
|
});
|
|
|
|
test("statistics are merged onto their definition", () => {
|
|
const rows = workflowRows(
|
|
[{ workflow: "tdd", runs: 3, merged: 1 }],
|
|
[{ id: "tdd", name: "TDD", enabled: true }],
|
|
);
|
|
assert.equal(rows.length, 1);
|
|
assert.equal(rows[0].name, "TDD");
|
|
assert.equal(rows[0].runs, 3);
|
|
assert.equal(rows[0].merged, 1);
|
|
});
|
|
|
|
// The regression: stats arrived, definitions did not, and the page claimed
|
|
// there were no runs while the stage tables below listed them.
|
|
test("a workflow with runs but no definition still gets a row", () => {
|
|
const rows = workflowRows([{ workflow: "implement", runs: 6, merged: 3 }], []);
|
|
assert.equal(rows.length, 1);
|
|
assert.equal(rows[0].id, "implement");
|
|
assert.equal(rows[0].runs, 6);
|
|
});
|
|
|
|
test("definitions keep their order and stats-only workflows follow", () => {
|
|
const rows = workflowRows(
|
|
[{ workflow: "ghost", runs: 2 }, { workflow: "tdd", runs: 1 }],
|
|
[{ id: "tdd" }, { id: "implement" }],
|
|
);
|
|
assert.deepEqual(rows.map((r) => r.id), ["tdd", "implement", "ghost"]);
|
|
});
|
|
|
|
test("only genuinely empty input produces no rows", () => {
|
|
assert.deepEqual(workflowRows([], []), []);
|
|
assert.deepEqual(workflowRows(undefined, undefined), []);
|
|
assert.deepEqual(workflowRows(null, null), []);
|
|
});
|