feat(orchestrator): S5.1 radio spot, compact menus, trend, ETA and Tasks 3D
🧪 Test / 🧪 Lock + lint (push) Canceled after 0s
🧪 Test / 🧪 Lock + lint (push) Canceled after 0s
Requirement 001 decisions 52 to 58 (operator 2026-11-09): - Radio spot: the Agents toolbar radio button expands inline with the one composer (every channel, post and call recipients, Record, Send), a gear with the radio settings (tones, squelch, read aloud, moved out of the general settings) and Cancel mayday, which leaves the toolbar; the Radio tab keeps speakers, stations and the log plus a jump to the spot. - Day/Night menu: the badge and Drain, Suspend and Resume only; each explanation is the button's tooltip. - Tasks toolbar: views, filter, estimation, sort and business value in one wrapping row with a Request choices dropdown; the status chips stay the second row. - Burndown and burnup: a trend selector (off, linear regression, velocity over N days) stored in the hub settings, the trend lines and the forecast date on the chart, and a tooltip per point with the work packages that started, ended or joined there. - ETA: every list row shows its ETA (end when done, else start or now plus the forecast length behind its predecessors), sharing one predecessor walk with the Gantt. - Tasks 3D: a sixth view on the 3D engine with the dependency edges in the Gantt colours, layouts Force and Time. - Steady 3D camera: the view fits once per graph build, refreshes keep the operator's camera. - e2e: Firefox runs with its profile as cwd, so its crashreporter no longer drops core dumps into the repository. - A forecast beyond the last second a Date can hold is no forecast, so a nearly flat regression no longer aborts the Tasks render. Evidence: make test Ran 717 OK, ruff clean, markdownlint 0 errors; e2e 30 of 30 OK in Chromium and Firefox at 1920, 1366 and 390 px; MEDUSA 0 findings after one skeptic-accepted lexical EXA006. 🎯 Fix: 93 % 💥 Break: 4 % 💸 Cost: 100 % ⏱️ Time: – 🛡️ Security: 100 % 🏆 Score: 89 🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 % Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e94f2800d5
commit
57ab29eb0d
25 files changed
+1390
-215
No files matched your search
+126
-25
@@ -2,10 +2,13 @@ const Plan = (() => {
|
||||
"use strict";
|
||||
const FORECASTS = [["always", "always"], ["points", "points only"], ["real", "real only"]];
|
||||
const ESTIMATIONS = [["none", "No estimate"], ["points", "Story points"]];
|
||||
const TRENDS = [["off", "off"], ["regression", "linear regression"], ["velocity", "velocity"]];
|
||||
const SORTS = [["prio", "Prio"], ["wsjf", "WSJF"], ["value", "Business value"], ["complexity", "Complexity"], ["status", "Status"], ["start", "Start"], ["end", "End"], ["agent", "Agent"], ["title", "Title"]];
|
||||
const STATUS_ORDER = ["queued", "awaiting", "claimed", "running", "blocked", "stale", "done", "stopped"];
|
||||
const SERIES = ["scope", "done", "remaining", "unestimated"];
|
||||
const TRENDED = ["scope", "done", "remaining"];
|
||||
const OUTSIDE = ["queue", "command"];
|
||||
const DAY = 86400;
|
||||
|
||||
function median(values) {
|
||||
const sorted = values.filter((value) => Number.isFinite(value)).sort((a, b) => a - b);
|
||||
@@ -45,16 +48,13 @@ const Plan = (() => {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rows - task rows in their shown order.
|
||||
* @param rows - task rows.
|
||||
* @param edges - {from, to, kind} edges; only those between the rows count.
|
||||
* @param options - {now, estimation, forecast}.
|
||||
* @returns one {task, start, end, forecast, dot} per drawn row: a started task from start to its end, an open one
|
||||
* to now; a task not yet started, unless forecast is "real", as a forecast behind the latest end of its
|
||||
* predecessors and now, forecastLength() long, a dot when 0. A task never started is left out under "real", an
|
||||
* ended one without start and end always.
|
||||
* @param settle - (row, ahead) => value or null, where ahead() lists the settled values of the row's
|
||||
* predecessors; a predecessor still being settled (a cycle) and a null value are left out.
|
||||
* @returns a Map from task to its settled value, each row settled once, in row order.
|
||||
*/
|
||||
function bars(rows, edges, options) {
|
||||
const known = medians(rows);
|
||||
function settled(rows, edges, settle) {
|
||||
const byTask = new Map(rows.map((row) => [row.task, row]));
|
||||
const before = new Map(rows.map((row) => [row.task, []]));
|
||||
for (const edge of edges) {
|
||||
@@ -72,23 +72,60 @@ const Plan = (() => {
|
||||
return null;
|
||||
}
|
||||
visiting.add(row.task);
|
||||
let bar = null;
|
||||
const value = settle(row, () => before.get(row.task).map((task) => place(byTask.get(task))).filter(Boolean));
|
||||
visiting.delete(row.task);
|
||||
placed.set(row.task, value);
|
||||
return value;
|
||||
};
|
||||
rows.forEach(place);
|
||||
return placed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rows - task rows in their shown order.
|
||||
* @param edges - {from, to, kind} edges; only those between the rows count.
|
||||
* @param options - {now, estimation, forecast}.
|
||||
* @returns one {task, start, end, forecast, dot} per drawn row: a started task from start to its end, an open one
|
||||
* to now; a task not yet started, unless forecast is "real", as a forecast behind the latest end of its
|
||||
* predecessors and now, forecastLength() long, a dot when 0. A task never started is left out under "real", an
|
||||
* ended one without start and end always.
|
||||
*/
|
||||
function bars(rows, edges, options) {
|
||||
const known = medians(rows);
|
||||
const placed = settled(rows, edges, (row, ahead) => {
|
||||
if (row.start !== null) {
|
||||
const end = row.end !== null ? row.end : row.ended ? row.start : Math.max(options.now, row.start);
|
||||
bar = {task: row.task, start: row.start, end, forecast: false, dot: end <= row.start};
|
||||
} else if (row.end !== null) {
|
||||
bar = {task: row.task, start: row.end, end: row.end, forecast: false, dot: true};
|
||||
} else if (!row.ended && options.forecast !== "real") {
|
||||
const ahead = before.get(row.task).map((task) => place(byTask.get(task))).filter(Boolean);
|
||||
const start = Math.max(options.now, ...ahead.map((found) => found.end));
|
||||
const length = forecastLength(row, options.estimation, options.forecast, known);
|
||||
bar = {task: row.task, start, end: start + length, forecast: true, dot: length <= 0};
|
||||
return {task: row.task, start: row.start, end, forecast: false, dot: end <= row.start};
|
||||
}
|
||||
visiting.delete(row.task);
|
||||
placed.set(row.task, bar);
|
||||
return bar;
|
||||
};
|
||||
return rows.map(place).filter(Boolean);
|
||||
if (row.end !== null) {
|
||||
return {task: row.task, start: row.end, end: row.end, forecast: false, dot: true};
|
||||
}
|
||||
if (row.ended || options.forecast === "real") {
|
||||
return null;
|
||||
}
|
||||
const start = Math.max(options.now, ...ahead().map((found) => found.end));
|
||||
const length = forecastLength(row, options.estimation, options.forecast, known);
|
||||
return {task: row.task, start, end: start + length, forecast: true, dot: length <= 0};
|
||||
});
|
||||
return rows.map((row) => placed.get(row.task)).filter(Boolean);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rows - task rows.
|
||||
* @param edges - {from, to, kind} edges; only those between the rows count.
|
||||
* @param options - {now, estimation}.
|
||||
* @returns a Map from task to {start, eta, forecast}: an ended task's end (null without one); else its start, or
|
||||
* for a task not yet started the latest of now and its predecessors' ETAs, plus forecastLength() under "always".
|
||||
*/
|
||||
function etas(rows, edges, options) {
|
||||
const known = medians(rows);
|
||||
return settled(rows, edges, (row, ahead) => {
|
||||
if (row.ended) {
|
||||
return {start: row.start, eta: row.end, forecast: false};
|
||||
}
|
||||
const start = row.start !== null ? row.start : Math.max(options.now, ...ahead().map((found) => found.eta).filter((eta) => eta !== null));
|
||||
return {start, eta: start + forecastLength(row, options.estimation, "always", known), forecast: true};
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -123,11 +160,10 @@ const Plan = (() => {
|
||||
function burn(rows, options) {
|
||||
const points = options.estimation === "points";
|
||||
const weigh = (row) => (points ? row.points || 0 : 1);
|
||||
const joined = (row) => (row.start !== null ? row.start : row.end !== null ? row.end : options.from);
|
||||
const moments = rows.flatMap((row) => [row.start, row.end]).filter((value) => value !== null && value > options.from && value < options.to);
|
||||
const times = [...new Set([options.from, ...moments, options.to])].sort((a, b) => a - b);
|
||||
const at = (t) => {
|
||||
const present = rows.filter((row) => joined(row) <= t && !(row.status === "stopped" && row.end !== null && row.end <= t));
|
||||
const present = rows.filter((row) => joinedAt(row, options.from) <= t && !(row.status === "stopped" && row.end !== null && row.end <= t));
|
||||
const burnt = present.filter((row) => row.status === "done" && row.end !== null && row.end <= t);
|
||||
const scope = present.reduce((sum, row) => sum + weigh(row), 0);
|
||||
const done = burnt.reduce((sum, row) => sum + weigh(row), 0);
|
||||
@@ -137,6 +173,71 @@ const Plan = (() => {
|
||||
return {points: times.map(at)};
|
||||
}
|
||||
|
||||
const joinedAt = (row, from) => (row.start !== null ? row.start : row.end !== null ? row.end : from);
|
||||
|
||||
/**
|
||||
* @param rows - the scope's task rows.
|
||||
* @param points - burn() points of the rows.
|
||||
* @param from - the range start burn() was given.
|
||||
* @returns per point {started, ended, joined}: the tasks whose start, end or, without a start, entry into the
|
||||
* scope falls after the previous point and up to this one; the first point takes everything up to it.
|
||||
*/
|
||||
function steps(rows, points, from) {
|
||||
return points.map((point, index) => {
|
||||
const after = index ? points[index - 1].t : -Infinity;
|
||||
const within = (t) => t !== null && t > after && t <= point.t;
|
||||
const tasks = (test) => rows.filter(test).map((row) => row.task);
|
||||
return {
|
||||
started: tasks((row) => within(row.start)),
|
||||
ended: tasks((row) => within(row.end)),
|
||||
joined: tasks((row) => row.start === null && within(joinedAt(row, from))),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
const LAST_SECOND = 8.64e12;
|
||||
|
||||
function leastSquares(pairs) {
|
||||
const mean = (values) => values.reduce((sum, value) => sum + value, 0) / values.length;
|
||||
const t0 = mean(pairs.map(([t]) => t));
|
||||
const y0 = mean(pairs.map(([, y]) => y));
|
||||
const spread = pairs.reduce((sum, [t]) => sum + (t - t0) ** 2, 0);
|
||||
return spread > 0 ? {t0, y0, slope: pairs.reduce((sum, [t, y]) => sum + (t - t0) * (y - y0), 0) / spread} : null;
|
||||
}
|
||||
|
||||
function velocity(points, name, start) {
|
||||
const last = points[points.length - 1];
|
||||
const before = points.filter((point) => point.t <= start).pop();
|
||||
return {t0: last.t, y0: last[name], slope: (last[name] - before[name]) / (last.t - start)};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param points - burn() points, in time order.
|
||||
* @param choice - {mode: "off", "regression" or "velocity", days: N for velocity}.
|
||||
* @returns null when off or with fewer than two distinct times, else {start, lines, forecast}: per series of
|
||||
* TRENDED a line {t0, y0, slope}, its value y0 + slope * (t - t0) with slope per second, fitted by least squares
|
||||
* over every point (regression, drawn from the first point) or through the last point and the value at
|
||||
* max(first point, last point - N days), the mean rate of those days (velocity, drawn from there). The forecast
|
||||
* is where the remaining line reaches 0, which by linearity is where done meets scope; null when it never falls
|
||||
* or falls only after LAST_SECOND, the last second a Date can hold.
|
||||
*/
|
||||
function trend(points, choice) {
|
||||
if (choice.mode === "off" || points.length < 2) {
|
||||
return null;
|
||||
}
|
||||
const last = points[points.length - 1];
|
||||
const start = choice.mode === "velocity" ? Math.max(points[0].t, last.t - choice.days * DAY) : points[0].t;
|
||||
const lines = Object.fromEntries(TRENDED.map((name) => [name, choice.mode === "velocity" ? (start < last.t ? velocity(points, name, start) : null) : leastSquares(points.map((point) => [point.t, point[name]]))]));
|
||||
if (TRENDED.some((name) => lines[name] === null)) {
|
||||
return null;
|
||||
}
|
||||
const rest = lines.remaining;
|
||||
const reached = rest.slope < 0 ? rest.t0 - rest.y0 / rest.slope : null;
|
||||
return {start, lines, forecast: reached !== null && Number.isFinite(reached) && Math.abs(reached) <= LAST_SECOND ? reached : null};
|
||||
}
|
||||
|
||||
const lineAt = (line, t) => line.y0 + line.slope * (t - line.t0);
|
||||
|
||||
const KEYS = {
|
||||
prio: () => null,
|
||||
wsjf: (row) => (row.wsjf ? row.wsjf.score : null),
|
||||
@@ -169,7 +270,7 @@ const Plan = (() => {
|
||||
return keyed.map((entry) => entry.row);
|
||||
}
|
||||
|
||||
return {FORECASTS, ESTIMATIONS, SORTS, SERIES, STATUS_ORDER, median, medians, forecastLength, bars, scoped, burn, sortRows};
|
||||
return {FORECASTS, ESTIMATIONS, TRENDS, SORTS, SERIES, TRENDED, STATUS_ORDER, median, medians, forecastLength, bars, etas, scoped, burn, steps, trend, lineAt, sortRows};
|
||||
})();
|
||||
if (typeof module === "object" && module.exports) {
|
||||
module.exports = Plan;
|
||||
|
||||
Reference in new issue
Block a user