@feigi/fleet-ctl 3.149.0 → 3.151.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/board-gather.mjs +91 -76
- package/scripts/board.html +46 -44
- package/scripts/compute-board.mjs +6 -5
- package/scripts/compute-cell-evidence.mjs +222 -316
- package/scripts/metrics-refresh.mjs +4 -5
- package/scripts/router-table.json +16 -153
- package/scripts/ticket-router.mjs +19 -89
package/package.json
CHANGED
package/scripts/board-gather.mjs
CHANGED
|
@@ -36,7 +36,6 @@ import { RECEIPT, RECEIPT_HELD, CLOSEOUT_RECEIPT, OBJECTIVES, isOmpSessionDirNam
|
|
|
36
36
|
import { lastSegment } from "./pull-attribution.mjs";
|
|
37
37
|
import { NAME, warnOnce, execRead } from "./board-common.mjs";
|
|
38
38
|
import { mergedReadPrs, issuesOfPrs } from "./compute-board.mjs";
|
|
39
|
-
import { repoIdentity } from "./compute-cell-evidence.mjs";
|
|
40
39
|
import { readCostGuard } from "./fleet-tick.mjs";
|
|
41
40
|
import { parseFrontmatter } from "./tier-roles.mjs";
|
|
42
41
|
import { isImplementer } from "./member-outcomes.mjs";
|
|
@@ -841,30 +840,15 @@ export function readCloseoutPr(stateDir) {
|
|
|
841
840
|
return { number: Number(number), at: typeof at === "string" ? at : null };
|
|
842
841
|
}
|
|
843
842
|
|
|
844
|
-
// The checkout's own router table, `plugin/scripts/router-table.json` under the
|
|
845
|
-
// workspace (the directory `stateDir` is in), as the installed one is read:
|
|
846
|
-
// `{ status: "ok", table }`, `{ status: "missing" }` (no such file: a consumer's
|
|
847
|
-
// checkout) or `{ status: "unreadable", why }`. Never warns: the installed
|
|
848
|
-
// table's read does, and a consumer is not at fault for lacking this file.
|
|
849
|
-
export function readCheckoutTable(stateDir) {
|
|
850
|
-
let text;
|
|
851
|
-
try {
|
|
852
|
-
text = readFileSync(join(dirname(stateDir), "plugin", "scripts", "router-table.json"), "utf8");
|
|
853
|
-
} catch (e) {
|
|
854
|
-
return e.code === "ENOENT" ? { status: "missing" } : { status: "unreadable", why: e.code ?? e.message };
|
|
855
|
-
}
|
|
856
|
-
let table;
|
|
857
|
-
try { table = validateTable(JSON.parse(text)); } catch { return { status: "unreadable", why: "not JSON" }; }
|
|
858
|
-
return table instanceof Error ? { status: "unreadable", why: table.message } : { status: "ok", table };
|
|
859
|
-
}
|
|
860
|
-
|
|
861
843
|
// The Fit metrics-refresh.mjs writes beside the guard,
|
|
862
844
|
// `.fleet/router-fit.json`: `{ status: "ok", fit }`, `{ status: "missing" }`
|
|
863
|
-
// or `{ status: "unreadable", why }`.
|
|
864
|
-
//
|
|
865
|
-
//
|
|
866
|
-
//
|
|
867
|
-
//
|
|
845
|
+
// or `{ status: "unreadable", why }`. It is read as `route` reads it
|
|
846
|
+
// (ticket-router.mjs's readFitBeside): the Fit is read whenever its `table`
|
|
847
|
+
// passes `validateTable`, so the tab never says the starting table routes while
|
|
848
|
+
// `route` routes by the Fit. The fields only the tab reads decide nothing:
|
|
849
|
+
// `computed_at` and `guard_computed_at` are null where they are no string and
|
|
850
|
+
// `tsv_blobs` null where it is no object, and the tab says each is not checked,
|
|
851
|
+
// as it says of an `n_rows` that is no count.
|
|
868
852
|
export function readFitFile(stateDir) {
|
|
869
853
|
let text;
|
|
870
854
|
try {
|
|
@@ -875,16 +859,10 @@ export function readFitFile(stateDir) {
|
|
|
875
859
|
let p;
|
|
876
860
|
try { p = JSON.parse(text); } catch { return { status: "unreadable", why: "not JSON" }; }
|
|
877
861
|
if (!isJsonObject(p)) return { status: "unreadable", why: "not a JSON object" };
|
|
878
|
-
for (const key of ["computed_at", "guard_computed_at"]) {
|
|
879
|
-
if (typeof p[key] !== "string") return { status: "unreadable", why: `\`${key}\` is not a string` };
|
|
880
|
-
}
|
|
881
|
-
for (const key of ["tsv_blobs", "prior"]) {
|
|
882
|
-
if (!isJsonObject(p[key])) return { status: "unreadable", why: `\`${key}\` is not an object` };
|
|
883
|
-
}
|
|
884
862
|
const table = validateTable(p.table);
|
|
885
863
|
if (table instanceof Error) return { status: "unreadable", why: table.message };
|
|
886
|
-
|
|
887
|
-
return { status: "ok", fit: { computed_at: p.computed_at, guard_computed_at: p.guard_computed_at, tsv_blobs: p.tsv_blobs
|
|
864
|
+
const stringOrNull = (v) => (typeof v === "string" ? v : null);
|
|
865
|
+
return { status: "ok", fit: { computed_at: stringOrNull(p.computed_at), guard_computed_at: stringOrNull(p.guard_computed_at), tsv_blobs: isJsonObject(p.tsv_blobs) ? p.tsv_blobs : null, table } };
|
|
888
866
|
}
|
|
889
867
|
|
|
890
868
|
// A receipt's `metrics` step, `{ status, at, output }`, or null: no receipt, one
|
|
@@ -923,29 +901,6 @@ export function readAgents(scriptDir) {
|
|
|
923
901
|
return { list, error: null };
|
|
924
902
|
}
|
|
925
903
|
|
|
926
|
-
// The install's own `package.json`, `../package.json` from the script's
|
|
927
|
-
// directory: `{ name, version, repository, error }`, `repository` the url its
|
|
928
|
-
// field names (the field is a string or `{ url }`), null where it names none.
|
|
929
|
-
// A file that cannot be read or parsed is `error`, with the rest null: the tab
|
|
930
|
-
// words an install it cannot name, never a guess.
|
|
931
|
-
export function readInstall(scriptDir) {
|
|
932
|
-
const file = join(scriptDir, "..", "package.json");
|
|
933
|
-
let pkg;
|
|
934
|
-
try {
|
|
935
|
-
pkg = JSON.parse(readFileSync(file, "utf8"));
|
|
936
|
-
} catch (e) {
|
|
937
|
-
return { name: null, version: null, repository: null, error: `${file}: ${e instanceof SyntaxError ? "not JSON" : (e.code ?? e.message)}` };
|
|
938
|
-
}
|
|
939
|
-
if (!isJsonObject(pkg)) return { name: null, version: null, repository: null, error: `${file}: not a JSON object` };
|
|
940
|
-
const repo = isJsonObject(pkg.repository) ? pkg.repository.url : pkg.repository;
|
|
941
|
-
return {
|
|
942
|
-
name: typeof pkg.name === "string" ? pkg.name : null,
|
|
943
|
-
version: typeof pkg.version === "string" ? pkg.version : null,
|
|
944
|
-
repository: typeof repo === "string" ? repo : null,
|
|
945
|
-
error: null,
|
|
946
|
-
};
|
|
947
|
-
}
|
|
948
|
-
|
|
949
904
|
// The live run's Objective, off the phase-0 receipt in the workspace's `.fleet`
|
|
950
905
|
// (the file readReceipt owns), or null: no receipt, as between runs, one that
|
|
951
906
|
// will not read, or one that records none.
|
|
@@ -999,19 +954,27 @@ export const MODEL_ROLES_EVERY_MS = 60_000;
|
|
|
999
954
|
// `omp` would otherwise hold every tick after it, not just this tab's.
|
|
1000
955
|
export const MODEL_ROLES_TIMEOUT_MS = 10_000;
|
|
1001
956
|
|
|
1002
|
-
// `omp
|
|
1003
|
-
//
|
|
1004
|
-
// `{ ok: false, why }`.
|
|
1005
|
-
|
|
1006
|
-
const
|
|
957
|
+
// One `omp <argv>` whose stdout is JSON, in the cockpit's own environment:
|
|
958
|
+
// `{ ok: true, cmd, json }` with the command in words and what it printed, or
|
|
959
|
+
// `{ ok: false, why }`. Each reader adds only its own shape check.
|
|
960
|
+
async function readOmpJson(argv, timeout) {
|
|
961
|
+
const cmd = `omp ${argv.join(" ")}`;
|
|
1007
962
|
const r = await execRead("omp", argv, { timeout });
|
|
1008
963
|
if (r.error) {
|
|
1009
964
|
const how = r.code ?? (r.signal ? `killed by ${r.signal}` : `exit ${r.status}`);
|
|
1010
|
-
return { ok: false, why:
|
|
965
|
+
return { ok: false, why: `${cmd} failed (${how})` };
|
|
1011
966
|
}
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
967
|
+
try { return { ok: true, cmd, json: JSON.parse(r.stdout) }; } catch { return { ok: false, why: `${cmd} printed non-JSON` }; }
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
// `omp config get modelRoles --json`, in the cockpit's own environment, which can
|
|
971
|
+
// differ from the controller's. `{ ok: true, value }` with the record, or
|
|
972
|
+
// `{ ok: false, why }`.
|
|
973
|
+
export async function readModelRoles(timeout = MODEL_ROLES_TIMEOUT_MS) {
|
|
974
|
+
const r = await readOmpJson(["config", "get", "modelRoles", "--json"], timeout);
|
|
975
|
+
if (!r.ok) return r;
|
|
976
|
+
const value = r.json?.value;
|
|
977
|
+
if (!isJsonObject(value)) return { ok: false, why: `${r.cmd} printed no modelRoles record` };
|
|
1015
978
|
return { ok: true, value };
|
|
1016
979
|
}
|
|
1017
980
|
|
|
@@ -1046,6 +1009,59 @@ export async function carryModelRoles(carried, now, read = readModelRoles) {
|
|
|
1046
1009
|
return carry(heldRead(carried) ?? NO_READ, now, read, MODEL_ROLES_EVERY_MS);
|
|
1047
1010
|
}
|
|
1048
1011
|
|
|
1012
|
+
// `omp models --json`, omp's model catalog, in the cockpit's own environment:
|
|
1013
|
+
// `{ ok: true, value }` with `{ models: [{ selector, thinking }] }` — every
|
|
1014
|
+
// listed model that has a selector, in the catalog's order, so a role's model
|
|
1015
|
+
// matches the entry route's own catalog read matches it to; `thinking` the
|
|
1016
|
+
// efforts it runs at, what a role's ladder is read off for the exploration
|
|
1017
|
+
// Cells, or null where it names none, and nothing else, so the carried read
|
|
1018
|
+
// stays small — or `{ ok: false, why }`, also for a list in which no model names
|
|
1019
|
+
// its efforts: a catalog with no ladder in it is a read that failed, never an
|
|
1020
|
+
// install whose exploration Cells are all tripped.
|
|
1021
|
+
export async function readCatalog(timeout = MODEL_ROLES_TIMEOUT_MS) {
|
|
1022
|
+
const r = await readOmpJson(["models", "--json"], timeout);
|
|
1023
|
+
if (!r.ok) return r;
|
|
1024
|
+
if (!isJsonObject(r.json) || !Array.isArray(r.json.models)) return { ok: false, why: `${r.cmd} printed no model list` };
|
|
1025
|
+
const models = r.json.models
|
|
1026
|
+
.filter((m) => isJsonObject(m) && typeof m.selector === "string")
|
|
1027
|
+
.map((m) => ({ selector: m.selector, thinking: Array.isArray(m.thinking) ? m.thinking.filter((t) => typeof t === "string") : null }));
|
|
1028
|
+
if (r.json.models.length > 0 && !models.some((m) => m.thinking !== null)) return { ok: false, why: `${r.cmd} printed no model with a thinking list` };
|
|
1029
|
+
return { ok: true, value: { models } };
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
// The carried model catalog read, the same way as `modelRoles`.
|
|
1033
|
+
export async function carryCatalog(carried, now, read = readCatalog) {
|
|
1034
|
+
return carry(heldRead(carried) ?? NO_READ, now, read, MODEL_ROLES_EVERY_MS);
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
// A repository's host and `owner/name` off its url — `gh repo view`'s, or any
|
|
1038
|
+
// shape a `package.json` `repository` takes: an npm shorthand, a scp-style
|
|
1039
|
+
// address or a URL — or null when it names none. A `#ref` pin and a `www.` host
|
|
1040
|
+
// name the same repository; a segment of dots only names none.
|
|
1041
|
+
export function repoIdentity(url) {
|
|
1042
|
+
if (typeof url !== "string") return null;
|
|
1043
|
+
const s = url.trim().replace(/^git\+/, "").replace(/#.*$/, "");
|
|
1044
|
+
let host;
|
|
1045
|
+
let path;
|
|
1046
|
+
const short = /^(github|gitlab|bitbucket):([^/\s]+\/[^/\s]+)$/.exec(s);
|
|
1047
|
+
const scp = /^[^@/\s]+@([^:/\s]+):(.+)$/.exec(s);
|
|
1048
|
+
if (short) {
|
|
1049
|
+
host = `${short[1]}.${short[1] === "bitbucket" ? "org" : "com"}`;
|
|
1050
|
+
path = short[2];
|
|
1051
|
+
} else if (scp) {
|
|
1052
|
+
[, host, path] = scp;
|
|
1053
|
+
} else if (/^[\w.-]+\/[\w.-]+$/.test(s)) {
|
|
1054
|
+
host = "github.com";
|
|
1055
|
+
path = s;
|
|
1056
|
+
} else {
|
|
1057
|
+
try { ({ hostname: host, pathname: path } = new URL(s)); } catch { return null; }
|
|
1058
|
+
}
|
|
1059
|
+
const [owner, rest] = path.split("/").filter(Boolean);
|
|
1060
|
+
const name = rest?.replace(/\.git$/, "");
|
|
1061
|
+
if (!host || !owner || !name || /^\.+$/.test(owner) || /^\.+$/.test(name)) return null;
|
|
1062
|
+
return { host: host.toLowerCase().replace(/^www\./, ""), name: `${owner}/${name}` };
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1049
1065
|
// The carried `docs/metrics` contents call, the same way: `value` is `{ blobs }`,
|
|
1050
1066
|
// `blobs` null for a 404 and otherwise main's blob id by path. A workspace whose
|
|
1051
1067
|
// repository the cockpit cannot name has nothing to ask `gh api` about, and says
|
|
@@ -1089,7 +1105,7 @@ export async function carryMainMetrics(carried, now, repoUrl, read = readMainMet
|
|
|
1089
1105
|
// `stateDir` is the workspace's `.fleet` directory, where the cost guard and the
|
|
1090
1106
|
// receipts the Cell evidence tab reads live. Null, as with `stateFile`, says no
|
|
1091
1107
|
// caller named one: that tab is then built from no guard and no receipt, and the
|
|
1092
|
-
// cockpit's `omp` is not asked for `modelRoles
|
|
1108
|
+
// cockpit's `omp` is not asked for `modelRoles` or its model catalog.
|
|
1093
1109
|
//
|
|
1094
1110
|
// `cwd` is the checkout whose Label map is read, once per gather, through
|
|
1095
1111
|
// label-map.mjs's reader; it defaults to this process's cwd, where every `gh`
|
|
@@ -1335,29 +1351,28 @@ export async function gather({ ledgerFile, prevFile, stateFile = null, stateDir
|
|
|
1335
1351
|
const now = Date.now();
|
|
1336
1352
|
const stallOwnerOf = isStalled(assessBeat({ beat, ticked, acted, controller, now })) ? stallOwner(controller, NAME) : null;
|
|
1337
1353
|
// The Cell evidence tab's inputs. Every file again on every tick, nothing
|
|
1338
|
-
// cached, the rule of every read here; the
|
|
1339
|
-
// child spawn, carried from the previous board and read
|
|
1340
|
-
// minute. `stateDir` is the workspace's `.fleet`: a caller
|
|
1341
|
-
// no workspace, so it reads none of the workspace's
|
|
1342
|
-
// either (a guard that reads as missing, no
|
|
1354
|
+
// cached, the rule of every read here; the exceptions are `modelRoles` and the
|
|
1355
|
+
// model catalog, one child spawn each, carried from the previous board and read
|
|
1356
|
+
// again at most once a minute. `stateDir` is the workspace's `.fleet`: a caller
|
|
1357
|
+
// that names none names no workspace, so it reads none of the workspace's
|
|
1358
|
+
// records and spawns no `omp` either (a guard that reads as missing, no
|
|
1359
|
+
// receipts, the reads carried as they were).
|
|
1343
1360
|
const guard = stateDir === null ? { status: "missing" } : readGuardFile(stateDir);
|
|
1344
1361
|
const guardJson = stateDir === null ? null : readGuardJson(stateDir);
|
|
1345
1362
|
const fit = stateDir === null ? { status: "missing" } : readFitFile(stateDir);
|
|
1346
1363
|
const closeoutPr = stateDir === null ? null : readCloseoutPr(stateDir);
|
|
1347
|
-
const checkoutTable = stateDir === null ? { status: "missing" } : readCheckoutTable(stateDir);
|
|
1348
1364
|
const receipts = stateDir === null
|
|
1349
1365
|
? { phase0: null, closeout: null }
|
|
1350
1366
|
: { phase0: readMetricsStep(join(stateDir, RECEIPT)), closeout: readMetricsStep(join(stateDir, CLOSEOUT_RECEIPT)) };
|
|
1351
1367
|
const agents = readAgents(scriptDir);
|
|
1352
|
-
const install = readInstall(scriptDir);
|
|
1353
1368
|
const objective = stateDir === null ? null : readObjective(stateDir);
|
|
1354
1369
|
// Read side by side: each has its own 10 s timeout, and one after the other a
|
|
1355
|
-
// tick on which
|
|
1356
|
-
const [modelRoles, mainMetrics] = stateDir === null
|
|
1357
|
-
? [heldRead(prev?.modelRoles), null]
|
|
1358
|
-
: await Promise.all([carryModelRoles(prev?.modelRoles, now), carryMainMetrics(prev?.mainMetrics, now, repoUrl)]);
|
|
1370
|
+
// tick on which every one hangs would stall once for each.
|
|
1371
|
+
const [modelRoles, catalog, mainMetrics] = stateDir === null
|
|
1372
|
+
? [heldRead(prev?.modelRoles), heldRead(prev?.catalog), null]
|
|
1373
|
+
: await Promise.all([carryModelRoles(prev?.modelRoles, now), carryCatalog(prev?.catalog, now), carryMainMetrics(prev?.mainMetrics, now, repoUrl)]);
|
|
1359
1374
|
return { ledger, issues, prs, merged, closed, closedIssues, ci, prev, repo, repoUrl, workspace, port, spend, beat, ticked, acted, controller, stallOwner: stallOwnerOf, poolOk,
|
|
1360
1375
|
roles, labelMapError,
|
|
1361
|
-
poolCapped, prsOk, prsCapped, guard, guardJson, fit, receipts, closeoutPr, agents, modelRoles,
|
|
1376
|
+
poolCapped, prsOk, prsCapped, guard, guardJson, fit, receipts, closeoutPr, agents, modelRoles, catalog, mainMetrics, objective, implementers: [...implementers.values()], routerTable,
|
|
1362
1377
|
now, interval };
|
|
1363
1378
|
}
|
package/scripts/board.html
CHANGED
|
@@ -106,9 +106,7 @@
|
|
|
106
106
|
.ce-foot { margin-top:8px; }
|
|
107
107
|
#cells-declared summary { cursor:pointer; color:var(--dim); }
|
|
108
108
|
.ce-member { display:flex; gap:10px; flex-wrap:wrap; font-size:12px; margin:2px 0 0 18px; }
|
|
109
|
-
.ce-
|
|
110
|
-
.ce-side { flex:1 1 20em; }
|
|
111
|
-
.ce-row { display:grid; gap:12px; border-top:1px solid var(--line); padding:6px 0; font-size:12px; }
|
|
109
|
+
.ce-row { display:grid; grid-template-columns:10em minmax(0, 1fr); gap:12px; border-top:1px solid var(--line); padding:6px 0; font-size:12px; }
|
|
112
110
|
.ce-row a { color:var(--blue); text-decoration:none; }
|
|
113
111
|
.ce-cand { color:var(--dim); margin-left:10px; }
|
|
114
112
|
.ce-stratum { font-weight:600; overflow-wrap:anywhere; }
|
|
@@ -461,70 +459,74 @@ function ceEntry(e) {
|
|
|
461
459
|
return box;
|
|
462
460
|
}
|
|
463
461
|
|
|
464
|
-
//
|
|
465
|
-
// could not make,
|
|
466
|
-
//
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
box
|
|
470
|
-
if (
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
if (
|
|
474
|
-
|
|
462
|
+
// The heading of the view of the Fit: its failed-Fit flag first, then its
|
|
463
|
+
// source line, the check it could not make, how a Pull is dispatched, its
|
|
464
|
+
// labels and model-change notices, burn-in progress, the tripped Cells and the
|
|
465
|
+
// model-name line, where each is set.
|
|
466
|
+
function ceFitHeading(p) {
|
|
467
|
+
const box = el("div");
|
|
468
|
+
if (p.flag) { const flag = el("div", "ce-alert"); flag.append(el("div", "ce-verdict", p.flag)); box.append(flag); }
|
|
469
|
+
box.append(el("div", "ce-source", p.source.text));
|
|
470
|
+
if (p.source.check) box.append(el("div", "ce-note", p.source.check));
|
|
471
|
+
if (p.heading) box.append(el("div", "ce-note", p.heading));
|
|
472
|
+
for (const label of p.labels || []) box.append(el("div", "ce-note ce-amber", label));
|
|
473
|
+
for (const notice of p.notices || []) box.append(el("div", "ce-note ce-amber", notice));
|
|
474
|
+
if (p.burnIn) {
|
|
475
|
+
box.append(el("div", "ce-note", p.burnIn.heading));
|
|
476
|
+
for (const c of p.burnIn.cells) box.append(el("div", "ce-cand", `${c.cell} · ${c.n} of ${c.of} merged PRs`));
|
|
477
|
+
}
|
|
478
|
+
if (p.tripped) box.append(el("div", "ce-note", p.tripped));
|
|
479
|
+
if (p.modelLine) box.append(el("div", "ce-note ce-amber", p.modelLine));
|
|
475
480
|
return box;
|
|
476
481
|
}
|
|
477
482
|
|
|
478
|
-
// One
|
|
479
|
-
//
|
|
480
|
-
//
|
|
481
|
-
function
|
|
483
|
+
// One group's row: the Cell it routes to and why, its own Cell where the guard
|
|
484
|
+
// holds it back, each candidate's n, verdict and interval, and the Cells the
|
|
485
|
+
// group draws over.
|
|
486
|
+
function ceFitEntry(line) {
|
|
482
487
|
const box = el("div", "ce-polcell");
|
|
483
|
-
if (
|
|
484
|
-
|
|
488
|
+
if (line.unread) { box.append(el("span", "ce-dim", line.unread)); return box; }
|
|
489
|
+
const e = line.entry;
|
|
485
490
|
const hd = el("div", "ce-hd");
|
|
486
|
-
hd.append(el("span", "ce-cell",
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
reason.href = href;
|
|
491
|
+
hd.append(el("span", "ce-cell", e.cell));
|
|
492
|
+
const reason = el("a", "ce-dim", e.reason);
|
|
493
|
+
reason.href = line.href;
|
|
490
494
|
hd.append(reason);
|
|
491
|
-
if (
|
|
495
|
+
if (e.held) hd.append(el("span", "ce-amber", e.held));
|
|
492
496
|
box.append(hd);
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
box.append(line);
|
|
497
|
+
for (const c of e.candidates) {
|
|
498
|
+
const row = el("div", "ce-cand", `${c.cell} · n ${c.n ?? "not checked"}${c.nMark || ""} · ${c.verdict} · ${c.interval}`);
|
|
499
|
+
if (c.model && c.model.text) row.append(el("span", "ce-amber", " · " + c.model.text));
|
|
500
|
+
box.append(row);
|
|
498
501
|
}
|
|
502
|
+
if (line.exploring) box.append(el("div", "ce-note", line.exploring));
|
|
499
503
|
return box;
|
|
500
504
|
}
|
|
501
505
|
|
|
502
|
-
// One
|
|
506
|
+
// One group of the tree, its rule indented by its depth. It is a place
|
|
503
507
|
// `#cells/row/<objective>/<stratum>` lands on.
|
|
504
|
-
function
|
|
508
|
+
function ceFitLine(line) {
|
|
505
509
|
const box = ceBox("div", "ce-row", line.anchor);
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
510
|
+
const rule = el("span", "ce-stratum", line.rule);
|
|
511
|
+
rule.style.paddingLeft = `${line.depth}em`;
|
|
512
|
+
rule.title = line.stratum;
|
|
513
|
+
box.append(rule, ceFitEntry(line));
|
|
509
514
|
return box;
|
|
510
515
|
}
|
|
511
516
|
|
|
512
|
-
// The
|
|
513
|
-
//
|
|
517
|
+
// The view of the Fit that routes this run: its heading, then each Objective's
|
|
518
|
+
// tree of groups, with the live run's Objective marked.
|
|
514
519
|
function cePolicy(p) {
|
|
515
520
|
const sec = ceBox("section", "ce-sec", "cells-rows");
|
|
516
|
-
sec.append(el("h2", null,
|
|
517
|
-
const sides = el("div", "ce-sides");
|
|
518
|
-
for (const s of p.sides) sides.append(cePolicySide(s));
|
|
519
|
-
sec.append(sides);
|
|
521
|
+
sec.append(el("h2", null, p.title), ceFitHeading(p));
|
|
520
522
|
for (const o of p.objectives) {
|
|
521
523
|
const hd = el("div", "ce-hd ce-obj");
|
|
522
524
|
hd.append(el("span", "ce-cell", o.objective));
|
|
523
525
|
if (o.live) hd.append(el("span", "badge", "this run's Objective"));
|
|
524
526
|
sec.append(hd);
|
|
525
|
-
for (const line of o.lines) sec.append(
|
|
527
|
+
for (const line of o.lines) sec.append(ceFitLine(line));
|
|
526
528
|
}
|
|
527
|
-
for (const
|
|
529
|
+
for (const f of p.footnotes) sec.append(el("div", "ce-foot", `${f.mark} ${f.text}`));
|
|
528
530
|
return sec;
|
|
529
531
|
}
|
|
530
532
|
|
|
@@ -554,7 +556,7 @@ function renderCells(ce) {
|
|
|
554
556
|
const g = ce.guard;
|
|
555
557
|
|
|
556
558
|
const links = el("div", "ce-links");
|
|
557
|
-
for (const [href, text] of [["#cells/rows", "
|
|
559
|
+
for (const [href, text] of [["#cells/rows", "the Fit"], ["#cells/guard", "the guard"], ["#cells/declared", "declared, not measured"]]) {
|
|
558
560
|
if (!ce.policy && href === "#cells/rows") continue;
|
|
559
561
|
if (links.children.length) links.append(document.createTextNode(" · "));
|
|
560
562
|
const a = el("a", null, text);
|
|
@@ -858,8 +858,8 @@ export function computeBoard(inputs) {
|
|
|
858
858
|
// The Cell evidence tab's model (compute-cell-evidence.mjs), built from the
|
|
859
859
|
// guard (through the tick's reader, and as parsed, for the readers alert),
|
|
860
860
|
// the receipts' metrics steps and the close-out's PR beside the open PRs, the
|
|
861
|
-
// definitions, the
|
|
862
|
-
//
|
|
861
|
+
// definitions, the Fit, the starting router table, the live run's Objective
|
|
862
|
+
// and the carried `modelRoles`, model catalog and `docs/metrics` reads
|
|
863
863
|
// gather() answered, and this run's Pulls: each card's
|
|
864
864
|
// Cell line, booked As-routed to its Cell. A caller that read none of them
|
|
865
865
|
// (every hand-built input in this suite) gets the tab's no-guard state:
|
|
@@ -876,17 +876,18 @@ export function computeBoard(inputs) {
|
|
|
876
876
|
openPrs: inputs.prsOk === false ? null : { numbers: (inputs.prs ?? []).map((p) => p.number), capped: inputs.prsCapped === true },
|
|
877
877
|
agents: inputs.agents,
|
|
878
878
|
modelRoles: inputs.modelRoles,
|
|
879
|
+
catalog: inputs.catalog,
|
|
879
880
|
mainMetrics: inputs.mainMetrics,
|
|
880
881
|
table: inputs.routerTable,
|
|
881
|
-
checkoutTable: inputs.checkoutTable,
|
|
882
|
-
install: inputs.install,
|
|
883
|
-
repoUrl: inputs.repoUrl,
|
|
884
882
|
objective: inputs.objective,
|
|
885
883
|
pulls: tickets.filter((t) => t.cellLine).map((t) => ({ issue: t.issue, cell: t.cellLine.cell, mark: t.cellLine.mark, targets: t.cellLine.targets })),
|
|
886
884
|
}),
|
|
887
885
|
// The `omp config get modelRoles` read, carried tick to tick the way `ci`
|
|
888
886
|
// and `repo` are: `{ value, readAt, error }`, read at most once a minute.
|
|
889
887
|
modelRoles: inputs.modelRoles ?? null,
|
|
888
|
+
// The `omp models` catalog read, carried the same way: `{ value: { models },
|
|
889
|
+
// readAt, error }`, read at most once a minute.
|
|
890
|
+
catalog: inputs.catalog ?? null,
|
|
890
891
|
// The `docs/metrics` contents call, carried the same way: `{ value: { blobs },
|
|
891
892
|
// readAt, error }`, main's blob id by path, read at most once a minute.
|
|
892
893
|
mainMetrics: inputs.mainMetrics ?? null,
|