@dibssoftware/dibs 0.0.0-stage → 0.0.179
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/CHANGELOG.md +594 -0
- package/LICENSE +670 -0
- package/README.md +85 -2
- package/bin/dibs-guard.mjs +7 -0
- package/bin/dibs.mjs +548 -0
- package/docs/benchmarks.md +193 -0
- package/docs/files.md +30 -0
- package/docs/guard.md +91 -0
- package/docs/later.md +43 -0
- package/docs/machines.md +147 -0
- package/docs/questions.md +78 -0
- package/docs/reference.md +157 -0
- package/docs/relay.md +196 -0
- package/docs/releasing.md +27 -0
- package/docs/scheduling.md +163 -0
- package/docs/simulators.md +17 -0
- package/package.json +45 -4
- package/skills/dibs/SKILL.md +183 -0
- package/src/acquire.mjs +700 -0
- package/src/admin.mjs +145 -0
- package/src/agents.mjs +145 -0
- package/src/alerts.mjs +499 -0
- package/src/answers.mjs +65 -0
- package/src/board.mjs +202 -0
- package/src/broker.mjs +369 -0
- package/src/commands.mjs +810 -0
- package/src/config.mjs +324 -0
- package/src/connect.mjs +106 -0
- package/src/cool.mjs +160 -0
- package/src/diskwarn.mjs +154 -0
- package/src/events.mjs +96 -0
- package/src/files.mjs +1123 -0
- package/src/guard.mjs +613 -0
- package/src/history.mjs +247 -0
- package/src/hogs.mjs +227 -0
- package/src/later.mjs +487 -0
- package/src/measure.mjs +262 -0
- package/src/news.mjs +101 -0
- package/src/nodecheck.mjs +17 -0
- package/src/notes.mjs +171 -0
- package/src/notices.mjs +160 -0
- package/src/ondemand.mjs +572 -0
- package/src/overlap.mjs +151 -0
- package/src/override.mjs +360 -0
- package/src/owner.mjs +30 -0
- package/src/plain.mjs +470 -0
- package/src/platform.mjs +357 -0
- package/src/preempt.mjs +438 -0
- package/src/primer.mjs +89 -0
- package/src/proc.mjs +99 -0
- package/src/progress.mjs +187 -0
- package/src/qr.mjs +204 -0
- package/src/questions.mjs +389 -0
- package/src/quota.mjs +81 -0
- package/src/reads.mjs +54 -0
- package/src/relay.mjs +779 -0
- package/src/remote.mjs +584 -0
- package/src/reset.mjs +127 -0
- package/src/schedule.mjs +1020 -0
- package/src/scratch.mjs +61 -0
- package/src/serve.mjs +742 -0
- package/src/service.mjs +221 -0
- package/src/shard.mjs +59 -0
- package/src/simctl.mjs +42 -0
- package/src/simpool.mjs +258 -0
- package/src/state.mjs +201 -0
- package/src/stats.mjs +328 -0
- package/src/style.mjs +44 -0
- package/src/talk.mjs +702 -0
- package/src/thin.sh +130 -0
- package/src/trust.mjs +152 -0
- package/src/util.mjs +184 -0
- package/src/version.mjs +2 -0
- package/src/web.mjs +1119 -0
- package/src/worker.mjs +318 -0
package/src/plain.mjs
ADDED
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
// The line in sentences, for people who have never seen dibs: what each
|
|
2
|
+
// resource is doing, where a waiter stands, when it starts and what it's
|
|
3
|
+
// waiting for. Plain `dibs`, `dibs why` and `dibs --json` (`lines`, and `plain`
|
|
4
|
+
// on each row) all read from here; `--detail` keeps the numbers dibs decides by.
|
|
5
|
+
//
|
|
6
|
+
// Times are said only as surely as dibs knows them: "about 4 min" when every
|
|
7
|
+
// job in the way has a run time from history or --est, "as soon as X finishes"
|
|
8
|
+
// when X has none, and "unknown" when the wait is on the machine (disk, memory,
|
|
9
|
+
// load), which no clock predicts.
|
|
10
|
+
import { IDLE_MEM_FREE, verdict, forecastDetail, expected, known, remaining, rankParts, byRank, recentUse, coveredNow, memUsed, memHolders, shownFree, NOT_PRIORITY, swapping, diskSqueeze, overLoad, STALL, QUICK_LINE } from './schedule.mjs';
|
|
11
|
+
import { quotaBlock, isQuota, QUOTA } from './quota.mjs';
|
|
12
|
+
import { isFiles, short, elsewhere } from './files.mjs';
|
|
13
|
+
import { machine, resCfg } from './config.mjs';
|
|
14
|
+
import { hogHint } from './hogs.mjs';
|
|
15
|
+
import { gb, clock, now, bytes, inClaudeCode, agentLabel } from './util.mjs';
|
|
16
|
+
|
|
17
|
+
const MIN = 6e4;
|
|
18
|
+
|
|
19
|
+
// The built-in resources in words. the: after "for" ("Next for the
|
|
20
|
+
// simulator"). a: what a job has going ("a deploy"). doing: a running job's
|
|
21
|
+
// headline. noun: one job on it ("web-app's deploy"). one, many: what its users are doing.
|
|
22
|
+
const NAMES = {
|
|
23
|
+
sim: { label: 'Simulator', the: 'the simulator', a: 'the simulator', doing: 'Using the simulator', noun: 'simulator run', one: 'is using it', many: 'are using it', queue: 'the simulator queue' },
|
|
24
|
+
'sim-own': { label: 'Private simulators', the: 'a private simulator', a: 'a private simulator', doing: 'Using a private simulator', noun: 'simulator run', one: 'is using one', many: 'are using one each', queue: 'the private simulator queue' },
|
|
25
|
+
'xcode-build': { label: 'Xcode builds', the: 'Xcode builds', a: 'an Xcode build', doing: 'Building with Xcode', noun: 'build', one: 'is building', many: 'are building', queue: 'the Xcode build queue' },
|
|
26
|
+
playwright: { label: 'Browser tests', the: 'browser tests', a: 'browser tests', doing: 'Running browser tests', noun: 'browser tests', one: 'is running browser tests', many: 'are running browser tests', queue: 'the browser test queue' },
|
|
27
|
+
test: { label: 'Test runs', the: 'test runs', a: 'a test run', doing: 'Running tests', noun: 'tests', one: 'is running tests', many: 'are running tests', queue: 'the test queue' },
|
|
28
|
+
deploy: { label: 'Deploys', the: 'deploys', a: 'a deploy', doing: 'Deploying', noun: 'deploy', one: 'is deploying', many: 'are deploying', queue: 'the deploy queue' },
|
|
29
|
+
heavy: { label: 'Heavy jobs', the: 'heavy jobs', a: 'a heavy job', doing: 'Running a heavy job', noun: 'heavy job', one: 'is running a heavy job', many: 'are running heavy jobs', queue: 'the heavy job queue' },
|
|
30
|
+
};
|
|
31
|
+
// Rate limits people are likely to share, by the name the README uses.
|
|
32
|
+
const QUOTA_NAMES = { asc: 'App Store Connect' };
|
|
33
|
+
|
|
34
|
+
// A resource's words. A `label` in its config wins, for resources dibs doesn't know.
|
|
35
|
+
export function named(cfg, r) {
|
|
36
|
+
const n = words(cfg, r);
|
|
37
|
+
return { a: n.the, one: 'is using it', many: 'are using it', queue: `the ${n.label} queue`, ...n };
|
|
38
|
+
}
|
|
39
|
+
function words(cfg, r) {
|
|
40
|
+
if (isFiles(r)) {
|
|
41
|
+
const p = short(r).slice('files:'.length).replace(/\/\*\*?$/, '');
|
|
42
|
+
const files = { one: 'has reserved them', many: 'have reserved them' };
|
|
43
|
+
if (!p) return { label: 'Files', the: 'files', doing: 'Editing files', noun: 'edit', queue: 'the files queue', ...files };
|
|
44
|
+
return { label: `Files in ${p}`, the: `files in ${p}`, doing: `Editing files in ${p}`, noun: `edit of ${p}`, queue: `the queue for files in ${p}`, ...files };
|
|
45
|
+
}
|
|
46
|
+
if (isQuota(r)) {
|
|
47
|
+
const n = r.slice(QUOTA.length);
|
|
48
|
+
const label = cfg.quotas?.[n]?.label || `${QUOTA_NAMES[n] || n} budget`;
|
|
49
|
+
return { label, the: `the ${label}`, doing: `Using the ${label}`, noun: 'job' };
|
|
50
|
+
}
|
|
51
|
+
const own = cfg.resources?.[r]?.label;
|
|
52
|
+
if (own) return { label: own, the: own, doing: `Using ${own}`, noun: 'job', queue: `the ${own} queue` };
|
|
53
|
+
return NAMES[r] || { label: r, the: r, doing: `Using ${r}`, noun: 'job', queue: `the ${r} queue` };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const ordinal = n => {
|
|
57
|
+
const tens = n % 100, ones = n % 10;
|
|
58
|
+
return `${n}${tens >= 11 && tens <= 13 ? 'th' : ones === 1 ? 'st' : ones === 2 ? 'nd' : ones === 3 ? 'rd' : 'th'}`;
|
|
59
|
+
};
|
|
60
|
+
export const andList = xs => (xs.length < 2 ? xs.join('') : `${xs.slice(0, -1).join(', ')} and ${xs[xs.length - 1]}`);
|
|
61
|
+
// A job held by the load ceiling starts on its own by v.by at the latest (schedule.mjs LOAD_STARVE).
|
|
62
|
+
export const heldByLoad = v => `held by load since ${clock(v.since)}, starts by ${clock(v.by)} at the latest`;
|
|
63
|
+
// High and urgent work passes the load ceiling, so here raising it is the fix, when it's really needed.
|
|
64
|
+
const LOAD_ADVICE = 'If a person is waiting on it now, run it with -p high -m "why". Or send it to another machine: --on <machine> (dibs machines lists them)';
|
|
65
|
+
export const minutes = t => {
|
|
66
|
+
const m = Math.max(1, Math.round(t / MIN));
|
|
67
|
+
return m < 60 ? `${m} min` : `${Math.floor(m / 60)} hr${m % 60 ? ` ${m % 60} min` : ''}`;
|
|
68
|
+
};
|
|
69
|
+
export const about = t => (t < MIN ? 'under a minute' : `about ${minutes(t)}`);
|
|
70
|
+
const GB = b => gb(b).replace(/G$/, ' GB');
|
|
71
|
+
export const lower = s => s[0].toLowerCase() + s.slice(1);
|
|
72
|
+
const upper = s => s[0].toUpperCase() + s.slice(1);
|
|
73
|
+
// A holder on the board: session/subagent when a subagent took it (agentLabel).
|
|
74
|
+
const holderName = x => (agentLabel(x) ? `${x.who}/${agentLabel(x)}` : x.who);
|
|
75
|
+
|
|
76
|
+
// Whose board plainBoard is writing, set by its `me`: in the caller's own
|
|
77
|
+
// sentences a job of its own reads "your own job #12" and a sibling
|
|
78
|
+
// subagent's "alex-3b/fix-guard", never the session name the caller
|
|
79
|
+
// shares with them, which reads like waiting for yourself.
|
|
80
|
+
let viewer = null;
|
|
81
|
+
const who = x => {
|
|
82
|
+
if (!viewer || !(viewer.spid ? x.spid === viewer.spid : !x.spid && x.who === viewer.who)) return x.who;
|
|
83
|
+
// A sibling goes by its name, its -m reason or its id (agentLabel), never its session's name alone.
|
|
84
|
+
if (viewer.agentId && x.agentId && x.agentId !== viewer.agentId)
|
|
85
|
+
return agentLabel(x) ? `${x.who}/${agentLabel(x)}` : `another job from your session (#${x.id})`;
|
|
86
|
+
// Unstamped (no guard hook), a job from the same session may be a sibling's.
|
|
87
|
+
return viewer.spid && !(viewer.agentId && x.agentId) ? `a job from your session (#${x.id})` : `your own job #${x.id}`;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// Moves under a minute change nobody's turn in a way worth a sentence.
|
|
91
|
+
const MOVE_SHOWN = MIN;
|
|
92
|
+
|
|
93
|
+
// When a running job ends. A hold's end is only its longest: it may be given back sooner.
|
|
94
|
+
export function ends(l, hist, t) {
|
|
95
|
+
if (l.kind === 'hold') { const left = Math.max(l.expires - t, 0); return { endsIn: left, endsText: `up to ${minutes(left)} left` }; }
|
|
96
|
+
const left = remaining(l, hist, t);
|
|
97
|
+
return left == null ? { endsIn: null, endsText: 'time left unknown' } : { endsIn: left, endsText: `${about(left)} left` };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Who has a line now. rows: { who, endsIn, endsText, hold }.
|
|
101
|
+
// "onboarding is using it, about 4 min left"; "web-app and ios-checkout are using it, time left unknown for both"
|
|
102
|
+
export function usingText(rows, n) {
|
|
103
|
+
if (rows.length === 1) {
|
|
104
|
+
const x = rows[0];
|
|
105
|
+
return `${x.who} ${x.hold && n.one !== 'has reserved them' ? 'has reserved it' : n.one}, ${x.endsText}`;
|
|
106
|
+
}
|
|
107
|
+
const soon = rows.filter(x => x.endsIn != null).sort((a, b) => a.endsIn - b.endsIn)[0];
|
|
108
|
+
const tail = !soon ? `time left unknown for ${rows.length === 2 ? 'both' : `all ${rows.length}`}`
|
|
109
|
+
: soon.hold ? `one is free within ${minutes(soon.endsIn)}` : `the first should be done in ${about(soon.endsIn)}`;
|
|
110
|
+
return `${andList(rows.map(who))} ${n.many}, ${tail}`;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// "Next: api-refactor, then onboarding and 2 others"
|
|
114
|
+
export function nextText(names) {
|
|
115
|
+
if (names.length < 3) return `Next: ${names.join(', then ')}`;
|
|
116
|
+
return `Next: ${names[0]}, then ${names[1]} and ${names.length - 2} other${names.length > 3 ? 's' : ''}`;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Why a job was paused, as a sentence, or null.
|
|
120
|
+
function pausedText(l, cfg) {
|
|
121
|
+
if (!l.pausedAt) return null;
|
|
122
|
+
const hand = l.pauses?.find(p => p.owner);
|
|
123
|
+
if (hand) return `Paused by ${hand.by || 'the person at this machine'}`;
|
|
124
|
+
const by = (l.pauses || []).filter(p => p.lease != null);
|
|
125
|
+
if (!by.length) return l.pauses?.some(p => p.disk) ? `Paused because free disk is low and ${l.pauses.some(p => p.swap) ? 'swap is still growing on it' : 'still falling'}` : 'Paused because the machine is short on memory';
|
|
126
|
+
return `Paused so ${andList([...new Set(by.map(p => `${p.who}'s ${p.prio && p.prio !== 'normal' ? `${p.prio} ` : ''}${named(cfg, p.res?.[0] || '').noun}`))])} could go first`;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// A job started on top of a full queue (src/overlap.mjs), as a sentence.
|
|
130
|
+
const alongsideText = a => (a.kind === 'squeeze' ? `Squeezed in next to ${andList(a.with)}, since it usually takes ${about(a.usually)}`
|
|
131
|
+
: `Running alongside ${andList(a.with)}, since the machine had room`);
|
|
132
|
+
|
|
133
|
+
// "onboarding's snapshot tests to finish, about 4 min left"
|
|
134
|
+
function finishing(l, r, cfg, hist, t) {
|
|
135
|
+
const e = ends(l, hist, t);
|
|
136
|
+
const what = l.kind === 'hold' ? `${who(l)} to give ${named(cfg, r).the} back` : `${who(l)}'s ${l.purpose || named(cfg, r).noun} to finish`;
|
|
137
|
+
const notes = [e.endsIn != null ? e.endsText : '', l.pausedAt ? "it's paused right now" : ''].filter(Boolean);
|
|
138
|
+
return `${what}${notes.length ? ` (${notes.join(', ')})` : ''}`;
|
|
139
|
+
}
|
|
140
|
+
// A run whose whole process tree has used no CPU this long while others wait
|
|
141
|
+
// is likely orphaned: a subagent's tool call died and left its test runner
|
|
142
|
+
// sitting on the slot (7 hours, once). A real job goes quiet for a simulator
|
|
143
|
+
// boot, a network call or a test timeout, a few minutes at most. 20 minutes is
|
|
144
|
+
// well past those, and short enough to matter to whoever is waiting.
|
|
145
|
+
export const STUCK_AFTER = 20 * MIN;
|
|
146
|
+
export const stuckFor = (l, t = now()) => (l.kind === 'run' && l.idleSince && t - l.idleSince >= STUCK_AFTER ? t - l.idleSince : 0);
|
|
147
|
+
export const stuckText = (l, t = now()) => { const d = stuckFor(l, t); return d ? `idle for ${minutes(d)}, may be stuck` : ''; };
|
|
148
|
+
|
|
149
|
+
// The memory picture a memory wait needs: what it needs, what's left of the
|
|
150
|
+
// budget and of the machine's real free memory, and who holds the most, so
|
|
151
|
+
// an agent can tell which of its own jobs to end.
|
|
152
|
+
export function memoryPicture(s, cfg, m, need, t = now()) {
|
|
153
|
+
const budget = bytes(cfg.budget), out = memUsed(s), free = shownFree(m);
|
|
154
|
+
const left = Math.max(0, budget - out);
|
|
155
|
+
const holders = memHolders(s).map(h => `${h.who} #${h.id}${h.purpose ? ` ("${h.purpose}")` : ''}: ${h.use != null ? `using ${GB(h.use)}` : 'not measured yet'}, asked ${GB(h.asked)}`
|
|
156
|
+
+ `${h.idleSince && t - h.idleSince >= STUCK_AFTER ? `, idle for ${minutes(t - h.idleSince)}` : ''}`);
|
|
157
|
+
return `it needs ${GB(need)}; ${GB(out)} of the ${GB(budget)} dibs shares out is taken, ${left ? `${GB(left)} left` : 'none left'}`
|
|
158
|
+
+ `${free != null ? `, and the machine has ${GB(free)} free or reclaimable` : ''}${m.vmPressure >= 1 ? ' with memory pressure high' : ''}`
|
|
159
|
+
+ `${holders.length ? `. Taking the most: ${holders.join('; ')}` : ''}`;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// What holds every new job back right now, as the end of "nothing new starts
|
|
163
|
+
// until ...", or ''. A line with free slots isn't free to use while this
|
|
164
|
+
// holds, so the board, who and the wait lines say it next to "free".
|
|
165
|
+
export function machineHold(s, cfg, m = machine()) {
|
|
166
|
+
const othersRun = s.leases.some(l => (l.mem || 0) > 0 || (l.cpu ?? 1) > 0);
|
|
167
|
+
if (m.diskFree != null && m.diskFree < bytes(cfg.minDisk)) return `more disk is free (${GB(m.diskFree)} free, under minDisk ${GB(bytes(cfg.minDisk))})`;
|
|
168
|
+
const hot = overLoad(s, cfg, m);
|
|
169
|
+
if (hot) return `the machine cools down (load ${(hot.load + hot.ahead).toFixed(1)}, over maxLoad ${cfg.maxLoad})`;
|
|
170
|
+
if (!othersRun) return '';
|
|
171
|
+
const sq = diskSqueeze(cfg, bytes(cfg.minDisk), m);
|
|
172
|
+
if (sq) return sq.rule === 'drain' ? `free disk stops falling (it fell ${GB(sq.fell)} in 5 min)` : `${GB(sq.need)} of disk is free for swap to grow into`;
|
|
173
|
+
const sw = swapping(cfg, m);
|
|
174
|
+
if (sw) return sw.rule === 'pressure' ? 'memory pressure eases' : `swap stops growing (it grew ${GB(sw.grew)} in 5 min)`;
|
|
175
|
+
const out = memUsed(s), budget = bytes(cfg.budget);
|
|
176
|
+
if (out >= budget) return `memory frees up (${GB(out)} of the ${GB(budget)} dibs shares out is taken; jobs running a few minutes count at what they use, not what they asked)`;
|
|
177
|
+
return '';
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// The kinds of wait, for telling a real change from two readings of the same
|
|
181
|
+
// crunch: pressure and an over-budget reading take turns while memory is short.
|
|
182
|
+
const FAMILY = { pressure: 'memory', swap: 'memory', memory: 'memory', ram: 'memory', disk: 'disk', swaproom: 'disk', drain: 'disk', slot: 'line', ahead: 'line', files: 'line', reset: 'line' };
|
|
183
|
+
export const family = rule => FAMILY[rule] || rule;
|
|
184
|
+
// Waits on the machine itself, which no clock predicts.
|
|
185
|
+
const MACHINE = new Set(['memory', 'disk', 'load', 'cpu', 'idle']);
|
|
186
|
+
|
|
187
|
+
// A file lease's paths as a person reads them: src/auth, not files:src/auth/**.
|
|
188
|
+
const pathOf = r => short(r).slice('files:'.length).replace(/\/\*\*?$/, '');
|
|
189
|
+
|
|
190
|
+
// What a waiter is waiting for, in one sentence, from the rule that stops it.
|
|
191
|
+
function waitingFor(s, q, v, cfg, hist, t, m, f) {
|
|
192
|
+
if (v.ok) return "nothing, it's about to start";
|
|
193
|
+
const name = r => named(cfg, r);
|
|
194
|
+
switch (v.rule) {
|
|
195
|
+
case 'slot': {
|
|
196
|
+
const end = l => ends(l, hist, t).endsIn ?? Infinity;
|
|
197
|
+
// The job whose end the start time hangs on, when it's running; else the one that ends first.
|
|
198
|
+
const l = (f?.after && s.leases.includes(f.after) && f.after.res.includes(v.on) ? f.after : null) || s.leases.filter(l => l.res.includes(v.on)).sort((a, b) => end(a) - end(b))[0];
|
|
199
|
+
return l ? finishing(l, v.on, cfg, hist, t) : `${name(v.on).the} to free up`;
|
|
200
|
+
}
|
|
201
|
+
case 'ahead':
|
|
202
|
+
if (v.starved) return `${who(v.ahead)} to go first (it's waited ${minutes(t - v.ahead.enq)} for room on the machine)`;
|
|
203
|
+
return `${who(v.ahead)} to go first (it's ahead in the queue)`;
|
|
204
|
+
case 'files': {
|
|
205
|
+
const l = s.leases.find(l => l.res.includes(v.on));
|
|
206
|
+
const include = q.res.includes(v.on) ? '' : `, which include ${andList(q.res.filter(isFiles).map(pathOf))}`;
|
|
207
|
+
return `${l ? `${who(l)}${elsewhere(l)}` : 'another agent'} to finish with the files in ${pathOf(v.on)}${include}${l ? ` (${ends(l, hist, t).endsText})` : ''}`;
|
|
208
|
+
}
|
|
209
|
+
case 'reset': {
|
|
210
|
+
const x = (s.resets || []).find(x => x.res === v.on);
|
|
211
|
+
return `${name(v.on).the} to be reset after ${x?.agent || x?.who || 'the last'}'s turn`;
|
|
212
|
+
}
|
|
213
|
+
case 'memory':
|
|
214
|
+
// Planned at all the memory dibs shares out because it usually uses more (src/measure.mjs sized).
|
|
215
|
+
if (q.usual != null) return `all the memory dibs shares out to be free (it usually uses ${GB(q.usual)}, more than the ${GB(v.of)} there is): ${memoryPicture(s, cfg, m, v.need, t)}`;
|
|
216
|
+
// The booked memory has room, but the machine doesn't show it free yet.
|
|
217
|
+
if (v.real) return `memory the machine really has: ${GB(v.free)} free or reclaimable${v.untouched ? `, ${GB(v.untouched)} of it booked by running jobs` : ''}, while apps and sessions outside dibs hold the rest; it needs ${GB(v.need)}`;
|
|
218
|
+
if (v.pressure) return `real free memory: running jobs ask for more than they use, but the machine has ${v.free == null ? 'an unknown amount' : GB(v.free)} free`
|
|
219
|
+
+ `${v.high ? ' with memory pressure high' : ''}${v.growing ? ' and swap growing' : ''}, and it needs ${GB(v.need)} plus ${GB(v.reserve)} to spare`;
|
|
220
|
+
return `room in memory: ${memoryPicture(s, cfg, m, v.need, t)}`;
|
|
221
|
+
case 'cpu': return `free processor cores (jobs running now are using ${v.used} of the ${v.of} cores dibs shares out, and it needs ${v.need})`;
|
|
222
|
+
case 'disk': return `more free disk (${GB(v.free)} free, it needs ${GB(v.need)})${hogHint()}`;
|
|
223
|
+
case 'pressure': return `memory pressure to ease (the OS says it's high, so dibs starts nothing new until it eases): ${memoryPicture(s, cfg, m, q.mem, t)}`;
|
|
224
|
+
case 'swaproom': return `more free disk for swap to grow into (${GB(v.free)} free; while this machine swaps, dibs starts nothing new until ${GB(v.need)} is free or nothing else is running)${hogHint()}`;
|
|
225
|
+
case 'drain': return `free disk to stop falling (it fell ${GB(v.fell)} in 5 min to ${GB(v.free)}; dibs starts nothing new while it falls this fast and anything else is running)${hogHint()}`;
|
|
226
|
+
case 'swap': return `this machine to stop swapping (swap grew ${GB(v.grew)} in 5 min, ${GB(v.used)} in use, so dibs starts nothing new until it stops growing): ${memoryPicture(s, cfg, m, q.mem, t)}`;
|
|
227
|
+
case 'ram':
|
|
228
|
+
return v.free != null ? `memory for another simulator (${GB(v.free)} free, it needs ${GB(v.need)})`
|
|
229
|
+
: `more free memory (${m.memFree}% free, big jobs need ${cfg.minFreeMem}%)`;
|
|
230
|
+
case 'load': return `${v.load != null ? `the machine to cool down (load ${v.load.toFixed(1)}; new work waits while it's over ${cfg.maxLoad})` : 'the machine to cool down'}`
|
|
231
|
+
+ `${v.since != null ? `. ${upper(heldByLoad(v))}, at background priority on the efficiency cores if the load is still high then` : ''}`;
|
|
232
|
+
case 'idle':
|
|
233
|
+
return v.ahead ? 'everyone else in the queue to go first (idle work goes last)' : `a quieter machine (idle work waits until ${IDLE_MEM_FREE}% of memory is free, now ${m.memFree}%)`;
|
|
234
|
+
case 'together': return `${who(v.ahead)} to finish: ${v.why}, so both finish sooner one after the other (it waits at most as long as it runs)`;
|
|
235
|
+
case 'quota': return `${name(v.on).the} to refill (${v.have} of ${v.limit} left, enough in ${about(v.in)})`;
|
|
236
|
+
default: return v.why;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Behind others in its line, a waiter waits for them too, not only for the job running now.
|
|
241
|
+
const NAMED_AHEAD = 2;
|
|
242
|
+
function inTurn(ahead, v, why) {
|
|
243
|
+
if (!ahead.length || v.ok || !['slot', 'files'].includes(v.rule)) return why;
|
|
244
|
+
const names = ahead.length > NAMED_AHEAD ? [...ahead.slice(0, NAMED_AHEAD - 1).map(who), `${ahead.length - NAMED_AHEAD + 1} others`] : ahead.map(who);
|
|
245
|
+
return `${andList(names)} to go first, and ${why}`;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Why a waiter moved from its arrival time, one plain sentence per rule.
|
|
249
|
+
export function moves(q, hist, t, cfg) {
|
|
250
|
+
const out = [];
|
|
251
|
+
for (const p of rankParts(q, hist, t).parts) {
|
|
252
|
+
if (Math.abs(p.shift) < MOVE_SHOWN) continue;
|
|
253
|
+
let reason, label;
|
|
254
|
+
if (p.label === q.prio) {
|
|
255
|
+
label = q.owner ? (q.owner.act === 'cap' ? 'capped by the person' : 'set by the person') : q.prio === 'urgent' || q.prio === 'idle' ? q.prio : `${q.prio} priority`;
|
|
256
|
+
const level = q.prio === 'urgent' ? 'urgent' : q.prio === 'idle' ? 'idle work' : `${q.prio} priority`;
|
|
257
|
+
// Low and idle keep falling as normal work arrives; saying so stops an agent rerunning at normal to "fix" it.
|
|
258
|
+
const sinks = q.prio === 'low' || q.prio === 'idle' ? ', so normal jobs that arrive later go ahead of it' : '';
|
|
259
|
+
const by = q.owner?.by || 'the person at this machine';
|
|
260
|
+
reason = q.owner ? `${by} ${q.owner.act === 'cap' ? `capped this agent at ${level}` : `set it to ${level}`}${q.owner.reason ? `: ${q.owner.reason}` : ''}${sinks}`
|
|
261
|
+
: `it's ${level}${q.purpose && (q.prio === 'urgent' || q.prio === 'high') ? `: ${q.purpose}` : ''}${sinks}`;
|
|
262
|
+
} else if (p.label.startsWith('holds ')) {
|
|
263
|
+
label = 'finishing a job';
|
|
264
|
+
reason = `it already has ${andList(q.holding.res.map(r => named(cfg, r).a))} going and needs this to finish`;
|
|
265
|
+
} else if (p.label === 'deadline') {
|
|
266
|
+
label = 'deadline';
|
|
267
|
+
reason = q.by > t ? `it's due by ${clock(q.by)}` : `it was due at ${clock(q.by)}`;
|
|
268
|
+
} else if (p.label === 'short job' || p.label === 'long job') {
|
|
269
|
+
label = p.label;
|
|
270
|
+
const e = known(q, hist) ? about(expected(q, hist)) : 'not seen before, so dibs tries it as a short one';
|
|
271
|
+
reason = p.label === 'short job' ? `it's a short job (${e})` : `it's a long job (${e}), so shorter work that arrives soon after goes first`;
|
|
272
|
+
} else if (p.label === 'recent use') {
|
|
273
|
+
label = 'taking turns';
|
|
274
|
+
reason = `this agent used ${andList(recentUse(hist, q.who, q.res, t).res.map(r => named(cfg, r).the))} a lot in the last hour`;
|
|
275
|
+
} else if (p.label === 'quick') {
|
|
276
|
+
label = 'quick';
|
|
277
|
+
reason = "it runs in seconds (the quick lane), so it goes before anyone who'd hold the slot for longer";
|
|
278
|
+
} else if (p.label === 'let ahead') {
|
|
279
|
+
label = 'let ahead';
|
|
280
|
+
reason = `${q.yieldBy || 'another agent'} let it go first`;
|
|
281
|
+
} else reason = label = p.label;
|
|
282
|
+
out.push({ dir: p.shift > 0 ? 'up' : 'down', amount: minutes(Math.abs(p.shift)), label, reason });
|
|
283
|
+
}
|
|
284
|
+
return out;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// When a waiter's start hangs on a job using another of the resources it
|
|
288
|
+
// needs, say which: "as soon as api finishes with Xcode builds".
|
|
289
|
+
function elsewhereOn(after, q, focus, s, cfg) {
|
|
290
|
+
if (!s.leases.includes(after) || after.res.includes(focus)) return '';
|
|
291
|
+
const r = q.res.find(x => after.res.includes(x));
|
|
292
|
+
return r ? ` with ${named(cfg, r).the}` : '';
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Who a waiter could ask to let it go first: the one just ahead of it in its
|
|
296
|
+
// line, else whoever is using what it waits for. With the command they'd run.
|
|
297
|
+
export function askFirst(s, p, q) {
|
|
298
|
+
const r = p.rules.get(q.id);
|
|
299
|
+
const w = p.waiting.get(q.id);
|
|
300
|
+
if (!w || w.place == null) return '';
|
|
301
|
+
const line = p.lines.find(l => l.waiting.includes(q.id) && (!r?.on || l.res === r.on)) || p.lines.find(l => l.waiting.includes(q.id));
|
|
302
|
+
const ahead = line && w.place > 1 ? s.queue.find(x => x.id === line.waiting[w.place - 2]) : null;
|
|
303
|
+
const holder = r?.on && s.leases.find(l => l.res.includes(r.on));
|
|
304
|
+
const x = ahead || holder;
|
|
305
|
+
const them = x?.agent;
|
|
306
|
+
if (!them || them === q.agent) return '';
|
|
307
|
+
// SendMessage is Claude Code's, and reaches only another Claude Code session.
|
|
308
|
+
if (inClaudeCode() && x.sessionId) return `To ask ${them} to let you go first: SendMessage ${them}. They run: dibs yield ${q.agent || q.who}`;
|
|
309
|
+
return `To go first, ask ${them} to run: dibs yield ${q.agent || q.who}`;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// Waits whose start dibs can forecast from the jobs in the way. The others
|
|
313
|
+
// wait on the machine itself, or on a refill whose time is plain arithmetic.
|
|
314
|
+
const QUEUED = new Set(['slot', 'ahead', 'files', 'reset']);
|
|
315
|
+
|
|
316
|
+
// Where dibs stands, in sentences: { lines, held: Map(id -> plain), waiting: Map(id -> plain) }.
|
|
317
|
+
export function plainBoard(s, cfg, hist, t = now(), m = machine(), me = null) {
|
|
318
|
+
viewer = me;
|
|
319
|
+
const fc = forecastDetail(s, cfg, hist, t);
|
|
320
|
+
const order = s.queue.filter(q => q.pid).sort(byRank(hist, t));
|
|
321
|
+
const verdicts = new Map(order.map(q => {
|
|
322
|
+
const v = verdict(s, q, cfg, hist, t);
|
|
323
|
+
return [q.id, v.ok ? quotaBlock(s, q, cfg, hist, t) || v : v];
|
|
324
|
+
}));
|
|
325
|
+
|
|
326
|
+
// Every configured resource, then anything else in use or wanted.
|
|
327
|
+
const res = [...new Set([...Object.keys(cfg.resources), ...s.leases.flatMap(l => l.res), ...order.flatMap(q => q.res)])];
|
|
328
|
+
const lines = res.map((r, i) => {
|
|
329
|
+
// A run its own hold covers is that hold's turn, so it isn't shown twice. Quota tokens aren't held.
|
|
330
|
+
const serving = isQuota(r) ? [] : s.leases.filter(l => l.res.includes(r) && !coveredNow(s, l, r)).sort((a, b) => a.start - b.start).map(l => ({
|
|
331
|
+
id: l.id, who: holderName(l), label: l.label || null, purpose: l.purpose || '', ...ends(l, hist, t) }));
|
|
332
|
+
const waiting = order.filter(q => q.res.includes(r)).map(q => q.id);
|
|
333
|
+
return { res: r, label: named(cfg, r).label, serving, waiting, clearsIn: null, summary: '', i };
|
|
334
|
+
}).filter(l => !(isQuota(l.res) || isFiles(l.res)) || l.serving.length || l.waiting.length || cfg.resources[l.res]);
|
|
335
|
+
|
|
336
|
+
const lineOf = new Map(lines.map(l => [l.res, l]));
|
|
337
|
+
const waiting = new Map();
|
|
338
|
+
const rules = new Map();
|
|
339
|
+
for (const q of order) {
|
|
340
|
+
const v = verdicts.get(q.id);
|
|
341
|
+
const f = fc.get(q.id);
|
|
342
|
+
const focus = q.res.includes(v.on) ? v.on : v.ahead ? q.res.find(r => v.ahead.res.includes(r)) || q.res[0] : q.res[0];
|
|
343
|
+
const line = lineOf.get(focus);
|
|
344
|
+
const place = line.waiting.indexOf(q.id) + 1;
|
|
345
|
+
// Behind a waiter that the machine holds back (memory, disk, load), this
|
|
346
|
+
// one waits on the machine too: no clock says when, whatever the forecast
|
|
347
|
+
// of slots alone says. Said once, here, so the wait line, why, when and
|
|
348
|
+
// the board all agree.
|
|
349
|
+
const av = v.rule === 'ahead' && v.ahead ? verdicts.get(v.ahead.id) : null;
|
|
350
|
+
const stuck = av && !av.ok && MACHINE.has(family(av.rule)) ? av : null;
|
|
351
|
+
const kind = v.ok ? 'go' : family(stuck ? stuck.rule : v.rule);
|
|
352
|
+
const start = v.ok ? { startsIn: 0, startsText: 'now' }
|
|
353
|
+
: v.rule === 'quota' ? { startsIn: v.in, startsText: about(v.in) }
|
|
354
|
+
: stuck || !QUEUED.has(v.rule) ? { startsIn: null, startsText: 'unknown' }
|
|
355
|
+
: f.sure ? { startsIn: f.at - t, startsText: about(f.at - t) }
|
|
356
|
+
: f.after ? { startsIn: null, startsText: `as soon as ${who(f.after)} finishes${elsewhereOn(f.after, q, focus, s, cfg)}` }
|
|
357
|
+
: { startsIn: null, startsText: 'unknown' };
|
|
358
|
+
const why = stuck ? `${who(v.ahead)} to go first, and it's waiting for ${waitingFor(s, v.ahead, stuck, cfg, hist, t, m, fc.get(v.ahead.id))}`
|
|
359
|
+
: inTurn(line.waiting.slice(0, place - 1).map(id => order.find(x => x.id === id)), v, waitingFor(s, q, v, cfg, hist, t, m, f));
|
|
360
|
+
// Said now, while there's time to free some, not at its turn.
|
|
361
|
+
const diskNext = v.diskNext ? `. After that it needs more free disk than there is: ${GB(v.diskNext.free)} free, it needs ${GB(v.diskNext.need)}, so free some now or it waits again then${hogHint()}` : '';
|
|
362
|
+
waiting.set(q.id, {
|
|
363
|
+
place, of: line.waiting.length, res: focus, family: kind,
|
|
364
|
+
ahead: line.waiting.slice(0, place - 1),
|
|
365
|
+
headline: `${place === 1 ? 'Next' : ordinal(place)} in ${named(cfg, focus).queue}`,
|
|
366
|
+
...start, waitingFor: why + diskNext, ...(v.diskNext && { diskNext: v.diskNext }),
|
|
367
|
+
...(kind === 'load' ? { advice: LOAD_ADVICE } : MACHINE.has(kind) && kind !== 'idle' ? { advice: NOT_PRIORITY } : {}),
|
|
368
|
+
moves: moves(q, hist, t, cfg),
|
|
369
|
+
});
|
|
370
|
+
if (!v.ok) rules.set(q.id, { rule: v.rule, on: v.on, alongside: v.alongside });
|
|
371
|
+
}
|
|
372
|
+
// A waiter whose dibs gave up keeps its place for a while, out of line.
|
|
373
|
+
for (const q of s.queue.filter(q => !q.pid))
|
|
374
|
+
waiting.set(q.id, { place: null, of: null, headline: `Place kept in ${named(cfg, q.res[0]).queue}`, startsIn: null, startsText: 'unknown',
|
|
375
|
+
waitingFor: 'its agent to ask again within 2 minutes', moves: [] });
|
|
376
|
+
|
|
377
|
+
for (const l of lines) {
|
|
378
|
+
const rows = l.waiting.map(id => ({ q: order.find(q => q.id === id), p: waiting.get(id) }));
|
|
379
|
+
// Clear when the last job in this line should be done, if every one of those times is known.
|
|
380
|
+
const sure = l.serving.every(x => x.endsIn != null && !s.leases.find(y => y.id === x.id && y.kind === 'hold'))
|
|
381
|
+
&& rows.every(({ q, p }) => p.startsIn != null && known(q, hist));
|
|
382
|
+
l.clearsIn = !l.serving.length && !l.waiting.length ? 0
|
|
383
|
+
: sure ? Math.max(0, ...l.serving.map(x => x.endsIn), ...rows.map(({ q, p }) => p.startsIn + expected(q, hist))) : null;
|
|
384
|
+
// One deploy per project (exclusiveBy repo): a deploy running is no reason for another project's to wait.
|
|
385
|
+
const perProject = resCfg(cfg, l.res).exclusiveBy === 'repo';
|
|
386
|
+
l.summary = !l.serving.length && !l.waiting.length ? 'Free'
|
|
387
|
+
: [l.serving.length ? (perProject ? `${l.serving.length} deploying (one per project, up to ${resCfg(cfg, l.res).across ?? resCfg(cfg, l.res).slots} at once)` : `${l.serving.length} in use`) : 'Free', l.waiting.length ? `${l.waiting.length} waiting` : '',
|
|
388
|
+
l.clearsIn ? `clear in ${about(l.clearsIn)}` : ''].filter(Boolean).join(', ');
|
|
389
|
+
}
|
|
390
|
+
lines.sort((a, b) => b.serving.length + b.waiting.length - a.serving.length - a.waiting.length || a.i - b.i);
|
|
391
|
+
for (const l of lines) delete l.i;
|
|
392
|
+
|
|
393
|
+
const someoneWaits = order.length > 0;
|
|
394
|
+
const held = new Map(s.leases.map(l => [l.id, {
|
|
395
|
+
headline: l.res.map((r, i) => (i ? lower(named(cfg, r).doing) : named(cfg, r).doing)).join(' and '),
|
|
396
|
+
endsText: ends(l, hist, t).endsText, paused: pausedText(l, cfg), ...(l.alongside ? { alongside: alongsideText(l.alongside) } : l.breaker ? { alongside: `Let in although the machine is short of disk or memory, since nothing had started for ${STALL / 6e4} min` } : l.quick ? { alongside: upper(QUICK_LINE) } : {}),
|
|
397
|
+
...(someoneWaits && stuckFor(l, t) ? { stuck: `${stuckText(l, t)} (#${l.id}${l.purpose ? `, "${l.purpose}"` : ''})` } : {}) }]));
|
|
398
|
+
return { lines, held, waiting, rules, names: new Map(s.queue.map(q => [q.id, holderName(q)])), holds: new Set(s.leases.filter(l => l.kind === 'hold').map(l => l.id)), cfg,
|
|
399
|
+
hold: machineHold(s, cfg, m) };
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// When a waiter starts, as a phrase: "in about 4 min", "as soon as onboarding finishes".
|
|
403
|
+
export const startPhrase = w => (w.startsText === 'unknown' ? 'start time unknown' : w.startsText === 'now' ? 'starting now'
|
|
404
|
+
: w.startsText.startsWith('as soon') ? w.startsText : `in ${w.startsText}`);
|
|
405
|
+
|
|
406
|
+
// Each busy line in two parts, what's happening now and who's next, plus the free ones.
|
|
407
|
+
export function lineParts(p) {
|
|
408
|
+
const busy = [];
|
|
409
|
+
const free = [];
|
|
410
|
+
for (const l of p.lines) {
|
|
411
|
+
if (!l.serving.length && !l.waiting.length) { free.push(l.label); continue; }
|
|
412
|
+
const rows = l.serving.map(x => ({ ...x, hold: p.holds.has(x.id) }));
|
|
413
|
+
const paused = l.serving.map(x => [x.who, p.held.get(x.id)?.paused || p.held.get(x.id)?.stuck]).filter(x => x[1]);
|
|
414
|
+
// Who is running on top of a full queue (src/overlap.mjs), after any pause.
|
|
415
|
+
const side = l.serving.map(x => [x.who, p.held.get(x.id)?.alongside]).filter(x => x[1]);
|
|
416
|
+
const notes = [...paused, ...side];
|
|
417
|
+
let now = rows.length ? usingText(rows, named(p.cfg, l.res)) : 'free';
|
|
418
|
+
if (notes.length) now += ` (${rows.length > 1 ? notes.map(([w, x]) => `${w} is ${lower(x)}`).join('; ') : lower(notes[0][1])})`;
|
|
419
|
+
let next = '';
|
|
420
|
+
const names = l.waiting.map(id => p.names.get(id));
|
|
421
|
+
if (names.length) {
|
|
422
|
+
// Say why the next one waits only when it isn't simply its turn here:
|
|
423
|
+
// stuck on the machine, or on another resource it needs too.
|
|
424
|
+
const r = p.rules.get(l.waiting[0]);
|
|
425
|
+
const elsewhere = r && r.on && r.on !== l.res;
|
|
426
|
+
const also = elsewhere && !(isFiles(r.on) && isFiles(l.res)) ? `also needs ${named(p.cfg, r.on).the} and ` : '';
|
|
427
|
+
const stuck = r && (!['slot', 'ahead', 'files'].includes(r.rule) || elsewhere) ? `${also}is waiting for ${p.waiting.get(l.waiting[0]).waitingFor}` : '';
|
|
428
|
+
const why = stuck && `${names[0]} ${stuck}`;
|
|
429
|
+
const after = names.length > 1 ? `After it: ${names.slice(1).join(', ')}` : '';
|
|
430
|
+
// A rate limit is never "free": its tokens refill with time.
|
|
431
|
+
if (isQuota(l.res) && why) { now = why; next = after; }
|
|
432
|
+
else if (!rows.length && why) { now += `, but ${why}`; next = after; }
|
|
433
|
+
else next = !why ? nextText(names) : names.length === 1 ? `${nextText(names)}, who ${stuck}` : `${nextText(names)}. ${why}`;
|
|
434
|
+
}
|
|
435
|
+
busy.push({ res: l.res, label: l.label, now, next });
|
|
436
|
+
}
|
|
437
|
+
return { busy, free };
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// The same, one sentence per line, for places without columns.
|
|
441
|
+
export function lineSentences(p) {
|
|
442
|
+
const { busy, free } = lineParts(p);
|
|
443
|
+
return [...busy.map(b => `${b.label}: ${b.now}${b.next ? `. ${b.next}` : ''}.`), ...(free.length ? [`Free: ${freeText(p, free)}.`] : [])];
|
|
444
|
+
}
|
|
445
|
+
// The free lines, and what holds them back when the machine does.
|
|
446
|
+
export const freeText = (p, free) => `${free.join(', ')}${p.hold ? `, but nothing new starts until ${p.hold}` : ''}`;
|
|
447
|
+
|
|
448
|
+
// The board's first line: the one thing that matters most.
|
|
449
|
+
export function headline(p) {
|
|
450
|
+
const running = p.held.size, waiting = [...p.waiting.values()].filter(w => w.place != null);
|
|
451
|
+
if (!running && !waiting.length) return "Nothing queued. Everything's free.";
|
|
452
|
+
const counts = `${running} running, ${waiting.length ? `${waiting.length} waiting` : 'nobody waiting'}.`;
|
|
453
|
+
const line = p.lines.find(l => l.waiting.length && p.waiting.get(l.waiting[0]).place === 1);
|
|
454
|
+
if (!line) return counts;
|
|
455
|
+
return `${counts} Next up: ${p.names.get(line.waiting[0])} for ${named(p.cfg, line.res).the}, ${startPhrase(p.waiting.get(line.waiting[0]))}.`;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// dibs why for one waiter: where it is, when it starts, what it waits for, and why it moved.
|
|
459
|
+
export function whyLines(p, q, cfg) {
|
|
460
|
+
const w = p.waiting.get(q.id);
|
|
461
|
+
const also = q.res.filter(r => !w.headline.endsWith(named(cfg, r).queue)).map(r => named(cfg, r).the);
|
|
462
|
+
const start = startPhrase(w);
|
|
463
|
+
return [`You're ${lower(w.headline)}${q.purpose ? ` ("${q.purpose}")` : ''}${also.length ? `, and you also need ${andList(also)}` : ''}.`
|
|
464
|
+
+ ` ${start.startsWith('start') ? 'Start time unknown' : `Starts ${start}`}.`,
|
|
465
|
+
` ${w.startsText === 'now' ? "It's about to start" : `Waiting for ${w.waitingFor}`}.${w.advice ? ` ${w.advice}.` : ''}`,
|
|
466
|
+
// Why it can't start next to the jobs filling its queue (src/overlap.mjs), when that was tried.
|
|
467
|
+
...(p.rules.get(q.id)?.alongside ? [` ${p.rules.get(q.id).alongside}`] : []),
|
|
468
|
+
// How far it moved is in --detail and moves[].amount; the cause is what a person needs.
|
|
469
|
+
...w.moves.map(m => ` Moved ${m.dir === 'up' ? 'ahead' : 'back'} because ${m.reason}.`)];
|
|
470
|
+
}
|