feat(orchestrator): hub page for requirements 085 to 099
085 calm Match deck: no header hourglass, centred bare empty state, the release card as a deck card (Cancel, Skip, Release), fixed card height. 086 motion: vanish() fade everywhere with a lint test, view transitions, a lub-dub heartbeat for working objects, confetti that lands and fades. 087 time readout under the pivot of every analog clock. 088 prune dialog grouped by prefix with tri-state boxes, search, stepper and sticky footer. 089 one-row task toolbar with Filter and Actions menus and a filter chip. 090 card border by state colour with a soft glow and owner avatars. 091 draggable limit lines with staged changes and one Save, a Limits menu with the matrix, View toggles, the GPU cause in its tooltip. 093 request chips Open, Expired, Stale, Failed, All and a signed Delete. 094 closed cards leave the deck within 5 s; open in Claude stamps. 095 compact agent message box with Post/Call, attach, mic and Send in the field. 096 Reject on an expired card drops it silently as Drop (expired). 097 Show filter in Match's right-click menu. 098 docked speech bubbles carry the speaker's avatar and a skip button. 099 Match card headlines cut to 120 characters with the full title in the tooltip; the code box keeps the whole command. tests/test_hub_path_links.py: a unicode fixture without German. Full make test green through the queue (2605 tests, ruff, shellcheck, markdownlint). Gate missed on the operator's word: break 7 %, the E2E specs (13 new, 15 updated) run next. 🎯 Fix: 92 % 💥 Break: 7 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 86 🚦 Gate: ⛔ break 7 % > 5 Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8ee52644c8
commit
6323f087bc
95 files changed
+5807
-704
No files matched your search
@@ -6,7 +6,16 @@ const Limits = (() => {
|
||||
const NAMES = {cpu: "CPU", ram: "RAM", swap: "Swap", disk: "Disk", psi: "PSI"};
|
||||
const LEVEL_NAMES = {lower: "lower", upper: "upper", stop: "STOP", mayday: "MAYDAY"};
|
||||
const ORDER = "lower < upper < STOP < MAYDAY";
|
||||
const percent = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 100;
|
||||
const SHOWN = [...LEVELS, "target"];
|
||||
const SHOWN_NAMES = {...LEVEL_NAMES, target: "target"};
|
||||
const MEANINGS = {
|
||||
lower: "the floor of the band: while CPU and RAM sit below it the queue starts the next job, and the live target climbs 2 points per poll while memory pressure stays calm",
|
||||
upper: "the queue starts no job whose footprint would lift the load above it; for RAM, swap, PSI and disk the watch warns above it, and a load above it drops the live target",
|
||||
stop: "above it the live guard holds every new job and the watch calls stop; for disk it is the floor below which the queue starts nothing",
|
||||
mayday: "the last alarm: above it the watch raises MAYDAY, for disk the critical alarm",
|
||||
target: "the live AIMD target between lower and upper, read only: the queue admits a job only while the load plus its footprint stays within it; it climbs 2 points per calm poll and drops to the middle of lower and itself on overload, rising PSI or swap-out",
|
||||
};
|
||||
const percent =(value) => typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 100;
|
||||
const plain = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
||||
const exactly = (value, keys) => plain(value) && Object.keys(value).length === keys.length && keys.every((key) => Object.hasOwn(value, key));
|
||||
|
||||
@@ -79,7 +88,92 @@ const Limits = (() => {
|
||||
return `${NAMES[change.metric]} ${LEVEL_NAMES[change.level]} ${change.from === null ? "unset" : change.from} → ${change.to} %`;
|
||||
}
|
||||
|
||||
return {METRICS, LEVELS, TARGETED, NAMES, LEVEL_NAMES, ORDER, problem, loosened, withValue, profileOf, said};
|
||||
/**
|
||||
* @param level - one of SHOWN.
|
||||
* @returns what the level means and does, led by its name, for the tooltips of its lines, its menu entry and its
|
||||
* matrix column.
|
||||
*/
|
||||
function meaning(level) {
|
||||
return `${SHOWN_NAMES[level]}: ${MEANINGS[level]}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param y - a y in the chart's coordinates.
|
||||
* @param top - the y of 100 %.
|
||||
* @param bottom - the y of 0 %.
|
||||
* @returns the whole percent from 0 to 100 at y, the inverse of pixelOf(); a y beyond either edge gives that edge.
|
||||
*/
|
||||
function valueAt(y, top, bottom) {
|
||||
return Math.min(100, Math.max(0, Math.round((1 - (y - top) / (bottom - top)) * 100)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param value - a percent.
|
||||
* @param top - the y of 100 %.
|
||||
* @param bottom - the y of 0 %.
|
||||
* @returns the y of value on the chart.
|
||||
*/
|
||||
function pixelOf(value, top, bottom) {
|
||||
return top + (1 - value / 100) * (bottom - top);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param base - valid limits the staged values apply to.
|
||||
* @param staged - {"<metric>.<level>": value} of the moved lines.
|
||||
* @returns a copy of base with every staged value in place.
|
||||
*/
|
||||
function applied(base, staged) {
|
||||
return Object.entries(staged).reduce((limits, [key, value]) => {
|
||||
const [metric, level] = key.split(".");
|
||||
return withValue(limits, metric, level, value);
|
||||
}, base);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param next - limits with the staged values in place.
|
||||
* @param staged - {"<metric>.<level>": value} of the moved lines.
|
||||
* @returns the first order break of next as {metric, level, words}, level the staged line of the broken pair (its
|
||||
* upper one when neither or both are staged) and words naming it; a staged value that is no percent breaks first;
|
||||
* null without a break.
|
||||
*/
|
||||
function orderBreak(next, staged) {
|
||||
for (const metric of METRICS) {
|
||||
const bad = LEVELS.find((level) => Object.hasOwn(staged, `${metric}.${level}`) && !percent(next[metric][level]));
|
||||
if (bad) {
|
||||
return {metric, level: bad, words: `${NAMES[metric]} ${LEVEL_NAMES[bad]} is no percent from 0 to 100`};
|
||||
}
|
||||
}
|
||||
for (const metric of METRICS) {
|
||||
const values = LEVELS.map((level) => next[metric][level]);
|
||||
const index = values.findIndex((value, at) => at > 0 && !(values[at - 1] < value));
|
||||
if (index > 0) {
|
||||
const [low, high] = [LEVELS[index - 1], LEVELS[index]];
|
||||
const level = !Object.hasOwn(staged, `${metric}.${high}`) && Object.hasOwn(staged, `${metric}.${low}`) ? low : high;
|
||||
const words = level === low ? `must stay below ${LEVEL_NAMES[high]} ${values[index]} %` : `must stay above ${LEVEL_NAMES[low]} ${values[index - 1]} %`;
|
||||
return {metric, level, words: `${NAMES[metric]} ${LEVEL_NAMES[level]} ${next[metric][level]} % breaks ${ORDER}: it ${words}`};
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param base - valid limits the lines show: those in force, or a profile while none is.
|
||||
* @param held - the limits in force, null while the queue config applies.
|
||||
* @param staged - {"<metric>.<level>": value} of the moved lines.
|
||||
* @returns {next, changes, loose, broken}: next the limits Save would send; changes every staged value apart from
|
||||
* base as {metric, level, from, to, kind}, kind tighter for a lower value and looser for a higher one; loose
|
||||
* loosened() of next against held, so one passkey signature covers the whole batch once it is not empty; broken
|
||||
* orderBreak(), which blocks Save.
|
||||
*/
|
||||
function review(base, held, staged) {
|
||||
const next = applied(base, staged);
|
||||
const changes = METRICS.flatMap((metric) => LEVELS.filter((level) => Object.hasOwn(staged, `${metric}.${level}`) && staged[`${metric}.${level}`] !== base[metric][level])
|
||||
.map((level) => ({metric, level, from: base[metric][level], to: next[metric][level], kind: next[metric][level] < base[metric][level] ? "tighter" : "looser"})));
|
||||
const broken = orderBreak(next, staged);
|
||||
return {next, changes, loose: broken ? [] : loosened(next, held), broken};
|
||||
}
|
||||
|
||||
return {METRICS, LEVELS, TARGETED, NAMES, LEVEL_NAMES, ORDER, SHOWN, SHOWN_NAMES, problem, loosened, withValue, profileOf, said, meaning, valueAt, pixelOf, applied, review};
|
||||
})();
|
||||
if (typeof module === "object" && module.exports) {
|
||||
module.exports = Limits;
|
||||
|
||||
Reference in new issue
Block a user