@harborppm/cli 0.100.0 → 0.101.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/dist/app.mjs +251 -29
- package/lib/cli.mjs +2 -1
- package/lib/format.mjs +16 -0
- package/package.json +1 -1
package/dist/app.mjs
CHANGED
|
@@ -833,7 +833,7 @@ var init_task_keys = __esmMin((() => {
|
|
|
833
833
|
// src/lib/agents.ts
|
|
834
834
|
/** What an agent should work on: its open tasks not yet waiting on review, in progress first, then most urgent and soonest. */
|
|
835
835
|
function agentQueue(data, agentId) {
|
|
836
|
-
return data.tasks.filter((t) => t.assigneeId === agentId && (t.status === "todo" || t.status === "doing" || t.status === "backlog")).sort((a, b) => Number(b.status === "doing") - Number(a.status === "doing") || Number(a.status === "backlog") - Number(b.status === "backlog") || RANK[a.priority] - RANK[b.priority] || (a.dueDate ?? "9999").localeCompare(b.dueDate ?? "9999"));
|
|
836
|
+
return data.tasks.filter((t) => t.assigneeId === agentId && (t.status === "todo" || t.status === "doing" || t.status === "backlog")).sort((a, b) => Number(b.status === "doing") - Number(a.status === "doing") || Number(a.status === "backlog") - Number(b.status === "backlog") || RANK$1[a.priority] - RANK$1[b.priority] || (a.dueDate ?? "9999").localeCompare(b.dueDate ?? "9999"));
|
|
837
837
|
}
|
|
838
838
|
/** The agent an app means: the one named, else the only one on the crew. */
|
|
839
839
|
function pickAgent(people, key) {
|
|
@@ -846,10 +846,10 @@ function pickAgent(people, key) {
|
|
|
846
846
|
const k = key.trim().toLowerCase();
|
|
847
847
|
return agents.find((a) => a.id === key.trim() || a.name.trim().toLowerCase() === k) ?? `No agent called "${key}". The crew's agents: ${agents.map((a) => a.name).join(", ")}.`;
|
|
848
848
|
}
|
|
849
|
-
var isAgent, RANK;
|
|
849
|
+
var isAgent, RANK$1;
|
|
850
850
|
var init_agents = __esmMin((() => {
|
|
851
851
|
isAgent = (p) => p?.kind === "agent";
|
|
852
|
-
RANK = {
|
|
852
|
+
RANK$1 = {
|
|
853
853
|
urgent: 0,
|
|
854
854
|
high: 1,
|
|
855
855
|
medium: 2,
|
|
@@ -8502,8 +8502,8 @@ init_date_text();
|
|
|
8502
8502
|
init_format();
|
|
8503
8503
|
init_indexes();
|
|
8504
8504
|
init_premortem();
|
|
8505
|
-
const DAY$
|
|
8506
|
-
const span = (a, b) => differenceInCalendarDays(DAY$
|
|
8505
|
+
const DAY$2 = (iso) => parseIso(iso.slice(0, 10));
|
|
8506
|
+
const span = (a, b) => differenceInCalendarDays(DAY$2(b), DAY$2(a));
|
|
8507
8507
|
/** Projects marked Done that have tasks to copy, most recently finished first. */
|
|
8508
8508
|
function finishedProjects(data) {
|
|
8509
8509
|
return data.projects.filter((p) => p.health === "done" && tasksOf(data.tasks, p.id).length > 0).map((p) => ({
|
|
@@ -8594,7 +8594,7 @@ function reckoningLine(r) {
|
|
|
8594
8594
|
}
|
|
8595
8595
|
/** The new project's end date, as long after its start as the old one really ran. */
|
|
8596
8596
|
function reckonedEnd(r, startDate) {
|
|
8597
|
-
return todayISO(addDays(DAY$
|
|
8597
|
+
return todayISO(addDays(DAY$2(startDate), r.took));
|
|
8598
8598
|
}
|
|
8599
8599
|
/** Puts the reckoning's tasks and risks into the new project, dated from its start. */
|
|
8600
8600
|
function applyReckoning(actions, projectId, r, startDate) {
|
|
@@ -8605,7 +8605,7 @@ function applyReckoning(actions, projectId, r, startDate) {
|
|
|
8605
8605
|
status: "todo",
|
|
8606
8606
|
priority: t.priority,
|
|
8607
8607
|
assigneeId: null,
|
|
8608
|
-
dueDate: todayISO(addDays(DAY$
|
|
8608
|
+
dueDate: todayISO(addDays(DAY$2(startDate), t.dueIn))
|
|
8609
8609
|
}, {
|
|
8610
8610
|
allowOverCap: true,
|
|
8611
8611
|
allowBlocked: true
|
|
@@ -9496,7 +9496,32 @@ function recordHealth(history, health, at, override, note) {
|
|
|
9496
9496
|
note: note ?? null
|
|
9497
9497
|
}].slice(-30);
|
|
9498
9498
|
}
|
|
9499
|
-
|
|
9499
|
+
/**
|
|
9500
|
+
* What the rules said over time, oldest first: the history's lines the rules
|
|
9501
|
+
* set, and the readings kept while a person's call stood in front of them.
|
|
9502
|
+
*/
|
|
9503
|
+
function rulesTimeline(item) {
|
|
9504
|
+
const out = [];
|
|
9505
|
+
for (const h of item.healthHistory ?? []) if (!h.override && isTrack$1(h.health)) out.push({
|
|
9506
|
+
at: h.at,
|
|
9507
|
+
health: h.health
|
|
9508
|
+
});
|
|
9509
|
+
for (const r of item.ruleHistory ?? []) out.push(r);
|
|
9510
|
+
return out.sort((a, b) => a.at.localeCompare(b.at));
|
|
9511
|
+
}
|
|
9512
|
+
/** The readings with one more line when the rules now say something other than they last did. Same array otherwise. */
|
|
9513
|
+
function recordRule(item, health, at) {
|
|
9514
|
+
const last = rulesTimeline(item).at(-1);
|
|
9515
|
+
if (last && last.health === health) return item.ruleHistory;
|
|
9516
|
+
return [...item.ruleHistory ?? [], {
|
|
9517
|
+
at,
|
|
9518
|
+
health
|
|
9519
|
+
}].slice(-40);
|
|
9520
|
+
}
|
|
9521
|
+
var isTrack$1;
|
|
9522
|
+
var init_health_history = __esmMin((() => {
|
|
9523
|
+
isTrack$1 = (h) => h === "on-track" || h === "at-risk" || h === "off-track";
|
|
9524
|
+
}));
|
|
9500
9525
|
|
|
9501
9526
|
// src/lib/derived-health.ts
|
|
9502
9527
|
function parseDate(value) {
|
|
@@ -9704,7 +9729,7 @@ function rankHealth(h) {
|
|
|
9704
9729
|
*/
|
|
9705
9730
|
function stampHealth(data, now = clockNow()) {
|
|
9706
9731
|
const at = now.toISOString();
|
|
9707
|
-
const projects = restamp(data.projects, (p) => effectiveProjectHealth(p, data, now), at);
|
|
9732
|
+
const projects = noteRules(restamp(data.projects, (p) => effectiveProjectHealth(p, data, now), at), data, now, at);
|
|
9708
9733
|
const mid = projects === data.projects ? data : {
|
|
9709
9734
|
...data,
|
|
9710
9735
|
projects
|
|
@@ -9738,6 +9763,26 @@ function restamp(rows, healthOf, at) {
|
|
|
9738
9763
|
});
|
|
9739
9764
|
return changed ? next : rows;
|
|
9740
9765
|
}
|
|
9766
|
+
/**
|
|
9767
|
+
* While a person's call (On track, At risk or Off track) stands in front of a
|
|
9768
|
+
* project's health, keep what the rules say behind it, a line each time it
|
|
9769
|
+
* moves, so Hull check (src/lib/hull-check.ts) can set the two side by side.
|
|
9770
|
+
* Only hand-set projects are worked out again; the rest keep the same rows.
|
|
9771
|
+
*/
|
|
9772
|
+
function noteRules(projects, data, now, at) {
|
|
9773
|
+
let changed = false;
|
|
9774
|
+
const next = projects.map((p) => {
|
|
9775
|
+
if (!overridesTrack(p)) return p;
|
|
9776
|
+
const ruleHistory = recordRule(p, deriveProjectHealth(p, data, now), at);
|
|
9777
|
+
if (ruleHistory === p.ruleHistory) return p;
|
|
9778
|
+
changed = true;
|
|
9779
|
+
return {
|
|
9780
|
+
...p,
|
|
9781
|
+
ruleHistory
|
|
9782
|
+
};
|
|
9783
|
+
});
|
|
9784
|
+
return changed ? next : projects;
|
|
9785
|
+
}
|
|
9741
9786
|
/** Late tasks across a program's projects, from the per-project lookup rather than every task. */
|
|
9742
9787
|
function programLateCount(programId, data, now) {
|
|
9743
9788
|
let late = 0;
|
|
@@ -11005,7 +11050,7 @@ function reviewedPrograms(slides, quiet) {
|
|
|
11005
11050
|
// src/tui/views/bridge.tsx
|
|
11006
11051
|
init_date_fns();
|
|
11007
11052
|
init_date_text();
|
|
11008
|
-
const WORD = {
|
|
11053
|
+
const WORD$1 = {
|
|
11009
11054
|
decision: "Decided",
|
|
11010
11055
|
action: "Action",
|
|
11011
11056
|
risk: "Risk"
|
|
@@ -11206,7 +11251,7 @@ function BridgeView({ active, width, height, go, programIds, onBack }) {
|
|
|
11206
11251
|
"",
|
|
11207
11252
|
`${part.program.name}${channels[part.program.id] ? ` · ${channels[part.program.id]} channel` : ""}`,
|
|
11208
11253
|
`Covered: ${part.covered.map((p) => p.name).join(", ") || "none"}`,
|
|
11209
|
-
...part.lines.length ? part.lines.map((l) => `• ${WORD[l.kind]}: ${l.text}`) : ["Nothing new logged."]
|
|
11254
|
+
...part.lines.length ? part.lines.map((l) => `• ${WORD$1[l.kind]}: ${l.text}`) : ["Nothing new logged."]
|
|
11210
11255
|
]),
|
|
11211
11256
|
...quiet.length ? ["", `No change on ${quiet.map((q) => q.project.name).join(", ")}.`] : []
|
|
11212
11257
|
].join("\n");
|
|
@@ -11242,7 +11287,7 @@ function BridgeView({ active, width, height, go, programIds, onBack }) {
|
|
|
11242
11287
|
...here.length ? [
|
|
11243
11288
|
"",
|
|
11244
11289
|
"Logged in this meeting:",
|
|
11245
|
-
...here.map((l) => `• ${WORD[l.kind]}: ${l.text}`)
|
|
11290
|
+
...here.map((l) => `• ${WORD$1[l.kind]}: ${l.text}`)
|
|
11246
11291
|
] : [],
|
|
11247
11292
|
"",
|
|
11248
11293
|
`Next move: ${program.nextMove?.trim() || "none yet"}`
|
|
@@ -16472,6 +16517,25 @@ function applyDock(actions, projectId, changes) {
|
|
|
16472
16517
|
return made;
|
|
16473
16518
|
}
|
|
16474
16519
|
|
|
16520
|
+
// src/lib/milestone-edits.ts
|
|
16521
|
+
/**
|
|
16522
|
+
* A milestone with `patch` applied, remembering the day it was reached:
|
|
16523
|
+
* `doneAt` is today when it turns done (unless the patch says otherwise),
|
|
16524
|
+
* and cleared when it opens again.
|
|
16525
|
+
*/
|
|
16526
|
+
function stampDone(m, patch) {
|
|
16527
|
+
const next = {
|
|
16528
|
+
...m,
|
|
16529
|
+
...patch
|
|
16530
|
+
};
|
|
16531
|
+
if (next.done && !m.done && !("doneAt" in patch)) next.doneAt = todayISO();
|
|
16532
|
+
if (!next.done && m.done) next.doneAt = null;
|
|
16533
|
+
return next;
|
|
16534
|
+
}
|
|
16535
|
+
var init_milestone_edits = __esmMin((() => {
|
|
16536
|
+
init_format();
|
|
16537
|
+
}));
|
|
16538
|
+
|
|
16475
16539
|
// src/lib/task-milestones.ts
|
|
16476
16540
|
/** The milestone a task is tied to, or null when it isn't (or the tie no longer holds). */
|
|
16477
16541
|
function milestoneOf(task, milestones, projects) {
|
|
@@ -16547,17 +16611,11 @@ function followMilestones(before, after) {
|
|
|
16547
16611
|
if (!m.done && lost.has(m.id) && p && p.total > 0 && p.done === p.total) {
|
|
16548
16612
|
if (!waitsClear(m, after.projects)) return m;
|
|
16549
16613
|
changed = true;
|
|
16550
|
-
return {
|
|
16551
|
-
...m,
|
|
16552
|
-
done: true
|
|
16553
|
-
};
|
|
16614
|
+
return stampDone(m, { done: true });
|
|
16554
16615
|
}
|
|
16555
16616
|
if (m.done && gained.has(m.id)) {
|
|
16556
16617
|
changed = true;
|
|
16557
|
-
return {
|
|
16558
|
-
...m,
|
|
16559
|
-
done: false
|
|
16560
|
-
};
|
|
16618
|
+
return stampDone(m, { done: false });
|
|
16561
16619
|
}
|
|
16562
16620
|
return m;
|
|
16563
16621
|
});
|
|
@@ -16570,6 +16628,7 @@ var follows;
|
|
|
16570
16628
|
var init_task_milestones = __esmMin((() => {
|
|
16571
16629
|
init_blockers();
|
|
16572
16630
|
init_indexes();
|
|
16631
|
+
init_milestone_edits();
|
|
16573
16632
|
follows = (m) => !m.approverId;
|
|
16574
16633
|
}));
|
|
16575
16634
|
|
|
@@ -23318,6 +23377,157 @@ function signText(sign) {
|
|
|
23318
23377
|
}
|
|
23319
23378
|
}
|
|
23320
23379
|
|
|
23380
|
+
// src/lib/hull-check.ts
|
|
23381
|
+
init_date_fns();
|
|
23382
|
+
init_derived_health();
|
|
23383
|
+
init_health_history();
|
|
23384
|
+
/** A call rosier than the numbers this long is flagged. */
|
|
23385
|
+
const HULL_DAYS = 21;
|
|
23386
|
+
/** Steady hands are read over this window. */
|
|
23387
|
+
const STEADY_WINDOW_DAYS = 90;
|
|
23388
|
+
/** At least this many days of calls by hand in the window, to say anything. */
|
|
23389
|
+
const STEADY_MIN_DAYS = 14;
|
|
23390
|
+
/** At most this share of those days rosier than the numbers. */
|
|
23391
|
+
const STEADY_MAX_ROSY = .1;
|
|
23392
|
+
const RANK = {
|
|
23393
|
+
"on-track": 0,
|
|
23394
|
+
"at-risk": 1,
|
|
23395
|
+
"off-track": 2
|
|
23396
|
+
};
|
|
23397
|
+
const isTrack = (h) => h === "on-track" || h === "at-risk" || h === "off-track";
|
|
23398
|
+
const DAY$1 = 864e5;
|
|
23399
|
+
const ms = (iso) => new Date(iso).getTime();
|
|
23400
|
+
/** The calls and the rules' readings as one run of moments, oldest first, with the rules' word now at the end. */
|
|
23401
|
+
function moments(project, rulesNow, now) {
|
|
23402
|
+
const out = [];
|
|
23403
|
+
for (const h of project.healthHistory ?? []) out.push({
|
|
23404
|
+
at: ms(h.at),
|
|
23405
|
+
declared: h.override && isTrack(h.health) ? h.health : null
|
|
23406
|
+
});
|
|
23407
|
+
for (const r of rulesTimeline(project)) out.push({
|
|
23408
|
+
at: ms(r.at),
|
|
23409
|
+
rules: r.health
|
|
23410
|
+
});
|
|
23411
|
+
out.sort((a, b) => a.at - b.at);
|
|
23412
|
+
if (rulesNow) out.push({
|
|
23413
|
+
at: now.getTime(),
|
|
23414
|
+
rules: rulesNow
|
|
23415
|
+
});
|
|
23416
|
+
return out.filter((m) => Number.isFinite(m.at));
|
|
23417
|
+
}
|
|
23418
|
+
/** The project's time cut into stretches with one call and one reading each, up to now. */
|
|
23419
|
+
function stretches(project, rulesNow, now) {
|
|
23420
|
+
const list = moments(project, rulesNow, now);
|
|
23421
|
+
const out = [];
|
|
23422
|
+
let declared = null;
|
|
23423
|
+
let rules = null;
|
|
23424
|
+
for (let i = 0; i < list.length; i++) {
|
|
23425
|
+
const m = list[i];
|
|
23426
|
+
if (m.declared !== void 0) declared = m.declared;
|
|
23427
|
+
if (m.rules !== void 0) rules = m.rules;
|
|
23428
|
+
const to = i + 1 < list.length ? list[i + 1].at : now.getTime();
|
|
23429
|
+
if (to > m.at) out.push({
|
|
23430
|
+
from: m.at,
|
|
23431
|
+
to,
|
|
23432
|
+
declared,
|
|
23433
|
+
rules
|
|
23434
|
+
});
|
|
23435
|
+
}
|
|
23436
|
+
const last = out.at(-1);
|
|
23437
|
+
if (last) last.declared = isTrack(project.healthOverride) ? project.healthOverride : null;
|
|
23438
|
+
return out;
|
|
23439
|
+
}
|
|
23440
|
+
const rosier = (s) => s.declared !== null && s.rules !== null && RANK[s.declared] < RANK[s.rules];
|
|
23441
|
+
/**
|
|
23442
|
+
* The project's call against the numbers, when the call is rosier now; null
|
|
23443
|
+
* otherwise (no call by hand, Paused or Done, or the call is as gloomy as the
|
|
23444
|
+
* numbers or more).
|
|
23445
|
+
*/
|
|
23446
|
+
function hullGap(project, data, now) {
|
|
23447
|
+
if (!overridesTrack(project) || !isTrack(project.healthOverride)) return null;
|
|
23448
|
+
const declared = project.healthOverride;
|
|
23449
|
+
const rules = deriveProjectHealth(project, data, now);
|
|
23450
|
+
if (RANK[declared] >= RANK[rules]) return null;
|
|
23451
|
+
const parts = stretches(project, rules, now);
|
|
23452
|
+
let since = now.getTime();
|
|
23453
|
+
for (let i = parts.length - 1; i >= 0 && rosier(parts[i]); i--) since = parts[i].from;
|
|
23454
|
+
let calledAt = now.getTime();
|
|
23455
|
+
for (let i = parts.length - 1; i >= 0 && parts[i].declared === declared; i--) calledAt = parts[i].from;
|
|
23456
|
+
const days = (t) => Math.max(0, differenceInCalendarDays(now, new Date(t)));
|
|
23457
|
+
return {
|
|
23458
|
+
project,
|
|
23459
|
+
declared,
|
|
23460
|
+
rules,
|
|
23461
|
+
days: days(since),
|
|
23462
|
+
calledDays: days(calledAt),
|
|
23463
|
+
note: project.healthNote?.trim() || null
|
|
23464
|
+
};
|
|
23465
|
+
}
|
|
23466
|
+
/** Projects whose rosier call has stood three weeks, longest first. Done and paused projects are left out. */
|
|
23467
|
+
function hullCheck(data, now, projectIds) {
|
|
23468
|
+
const out = [];
|
|
23469
|
+
for (const p of data.projects) {
|
|
23470
|
+
if (projectIds && !projectIds.has(p.id)) continue;
|
|
23471
|
+
const gap = hullGap(p, data, now);
|
|
23472
|
+
if (gap && gap.days >= 21) out.push(gap);
|
|
23473
|
+
}
|
|
23474
|
+
return out.sort((a, b) => b.days - a.days || a.project.name.localeCompare(b.project.name));
|
|
23475
|
+
}
|
|
23476
|
+
/** Each project owner's calls by hand over the last three months, against the numbers behind them. */
|
|
23477
|
+
function callRecords(data, now) {
|
|
23478
|
+
const start = now.getTime() - 90 * DAY$1;
|
|
23479
|
+
const by = /* @__PURE__ */ new Map();
|
|
23480
|
+
for (const p of data.projects) {
|
|
23481
|
+
if (!(p.healthHistory ?? []).some((h) => h.override) && !overridesTrack(p)) continue;
|
|
23482
|
+
const rulesNow = overridesTrack(p) ? deriveProjectHealth(p, data, now) : null;
|
|
23483
|
+
for (const s of stretches(p, rulesNow, now)) {
|
|
23484
|
+
if (s.declared === null || s.rules === null) continue;
|
|
23485
|
+
const from = Math.max(s.from, start);
|
|
23486
|
+
if (s.to <= from) continue;
|
|
23487
|
+
const days = (s.to - from) / DAY$1;
|
|
23488
|
+
const rec = by.get(p.ownerId) ?? {
|
|
23489
|
+
personId: p.ownerId,
|
|
23490
|
+
calledDays: 0,
|
|
23491
|
+
rosyDays: 0
|
|
23492
|
+
};
|
|
23493
|
+
rec.calledDays += days;
|
|
23494
|
+
if (rosier(s)) rec.rosyDays += days;
|
|
23495
|
+
by.set(p.ownerId, rec);
|
|
23496
|
+
}
|
|
23497
|
+
}
|
|
23498
|
+
return [...by.values()];
|
|
23499
|
+
}
|
|
23500
|
+
/**
|
|
23501
|
+
* Owners whose calls by hand have matched the numbers over the last three
|
|
23502
|
+
* months: two weeks of calls at least, rosier for a tenth of it at most, and
|
|
23503
|
+
* nothing flagged now. A set, not a ranking.
|
|
23504
|
+
*/
|
|
23505
|
+
function steadyHands(data, now) {
|
|
23506
|
+
const flagged = new Set(hullCheck(data, now).map((g) => g.project.ownerId));
|
|
23507
|
+
const out = /* @__PURE__ */ new Set();
|
|
23508
|
+
for (const r of callRecords(data, now)) {
|
|
23509
|
+
if (flagged.has(r.personId)) continue;
|
|
23510
|
+
if (r.calledDays >= 14 && r.rosyDays <= r.calledDays * .1) out.add(r.personId);
|
|
23511
|
+
}
|
|
23512
|
+
return out;
|
|
23513
|
+
}
|
|
23514
|
+
const WORD = {
|
|
23515
|
+
"on-track": "On track",
|
|
23516
|
+
"at-risk": "At risk",
|
|
23517
|
+
"off-track": "Off track"
|
|
23518
|
+
};
|
|
23519
|
+
/** "3 weeks", "10 days". */
|
|
23520
|
+
function weeksText(days) {
|
|
23521
|
+
if (days >= 14) return `${Math.floor(days / 7)} weeks`;
|
|
23522
|
+
return `${days} day${days === 1 ? "" : "s"}`;
|
|
23523
|
+
}
|
|
23524
|
+
/** "Called On track by hand for 5 weeks; the numbers have said Off track for 4 of them." */
|
|
23525
|
+
function gapText(gap) {
|
|
23526
|
+
const called = `Called ${WORD[gap.declared]} by hand for ${weeksText(gap.calledDays)}`;
|
|
23527
|
+
if (gap.days >= gap.calledDays - 1) return `${called}, while the numbers have said ${WORD[gap.rules]} the whole time.`;
|
|
23528
|
+
return `${called}; the numbers have said ${WORD[gap.rules]} for the last ${weeksText(gap.days)}.`;
|
|
23529
|
+
}
|
|
23530
|
+
|
|
23321
23531
|
// src/lib/task-approval.ts
|
|
23322
23532
|
/** Waits on its approver now: asked, not yet answered, and not done. */
|
|
23323
23533
|
function awaitingApproval(task) {
|
|
@@ -24575,7 +24785,7 @@ const HARBOR_TOOLS = [
|
|
|
24575
24785
|
tool({
|
|
24576
24786
|
name: "program_review",
|
|
24577
24787
|
title: "The review",
|
|
24578
|
-
description: "The website's Review: programs worst health first, then soonest end, each with its lead, end date, health (and the note when set by hand), late tasks, where it sits on the priority matrix and its next move. Done programs only with includeDone. blankCharters lists running projects in them whose charter is still empty a week after they started (set_charter writes one)." + DATA_NOTE,
|
|
24788
|
+
description: "The website's Review: programs worst health first, then soonest end, each with its lead, end date, health (and the note when set by hand), late tasks, where it sits on the priority matrix and its next move. Done programs only with includeDone. blankCharters lists running projects in them whose charter is still empty a week after they started (set_charter writes one). hullCheck lists projects whose health was set by hand rosier than their work has said for three weeks or more (watermelons: the call, what the numbers say, for how long, and the note); set_health with \"auto\" hands one back to the numbers, only on the person's word. steadyHands names owners whose calls by hand over three months matched the work or warned early; it is not a ranking." + DATA_NOTE,
|
|
24579
24789
|
input: object({
|
|
24580
24790
|
harbor: harborArg,
|
|
24581
24791
|
owner: string().max(200).optional().describe("\"me\", or a person's id or name: programs they lead, lead a project in or hold a task in."),
|
|
@@ -24617,6 +24827,23 @@ const HARBOR_TOOLS = [
|
|
|
24617
24827
|
program: data.programs.find((x) => x.id === b.project.programId)?.name ?? null,
|
|
24618
24828
|
startedDaysAgo: b.days
|
|
24619
24829
|
})),
|
|
24830
|
+
hullCheck: (() => {
|
|
24831
|
+
const programIds = new Set(listed.map((p) => p.id));
|
|
24832
|
+
const projectIds = new Set(data.projects.filter((p) => programIds.has(p.programId)).map((p) => p.id));
|
|
24833
|
+
return hullCheck(data, ctx.now, projectIds).map((g) => ({
|
|
24834
|
+
project: g.project.name,
|
|
24835
|
+
...g.project.key ? { key: g.project.key } : {},
|
|
24836
|
+
program: data.programs.find((x) => x.id === g.project.programId)?.name ?? null,
|
|
24837
|
+
owner: nameOf$2(people, g.project.ownerId),
|
|
24838
|
+
calledByHand: g.declared,
|
|
24839
|
+
numbersSay: g.rules,
|
|
24840
|
+
forDays: g.days,
|
|
24841
|
+
calledDaysAgo: g.calledDays,
|
|
24842
|
+
note: g.note,
|
|
24843
|
+
text: gapText(g)
|
|
24844
|
+
}));
|
|
24845
|
+
})(),
|
|
24846
|
+
steadyHands: [...steadyHands(data, ctx.now)].map((id) => nameOf$2(people, id)).filter(Boolean),
|
|
24620
24847
|
onlyOneKnows: lifeboats(data, ctx.now, { programIds: new Set(listed.map((p) => p.id)) }).slice(0, 25).map((l) => lifeboatOut(data, l, people))
|
|
24621
24848
|
};
|
|
24622
24849
|
}
|
|
@@ -27610,10 +27837,7 @@ function milestonesRaidSlice({ get, write }) {
|
|
|
27610
27837
|
return {
|
|
27611
27838
|
toggleMilestone: (id) => {
|
|
27612
27839
|
if (get().milestones.find((m) => m.id === id)?.approverId) return;
|
|
27613
|
-
write({ milestones: get().milestones.map((m) => m.id === id ? {
|
|
27614
|
-
...m,
|
|
27615
|
-
done: !m.done
|
|
27616
|
-
} : m) });
|
|
27840
|
+
write({ milestones: get().milestones.map((m) => m.id === id ? stampDone(m, { done: !m.done }) : m) });
|
|
27617
27841
|
},
|
|
27618
27842
|
addMilestone: (m) => {
|
|
27619
27843
|
const id = uid("ms");
|
|
@@ -27625,10 +27849,7 @@ function milestonesRaidSlice({ get, write }) {
|
|
|
27625
27849
|
return id;
|
|
27626
27850
|
},
|
|
27627
27851
|
updateMilestone: (id, patch) => {
|
|
27628
|
-
write({ milestones: get().milestones.map((m) => m.id === id ?
|
|
27629
|
-
...m,
|
|
27630
|
-
...patch
|
|
27631
|
-
} : m) });
|
|
27852
|
+
write({ milestones: get().milestones.map((m) => m.id === id ? stampDone(m, patch) : m) });
|
|
27632
27853
|
},
|
|
27633
27854
|
deleteMilestone: (id) => {
|
|
27634
27855
|
write({ milestones: get().milestones.filter((m) => m.id !== id) });
|
|
@@ -28043,6 +28264,7 @@ var init_milestones_raid = __esmMin((() => {
|
|
|
28043
28264
|
init_raid_history();
|
|
28044
28265
|
init_passage();
|
|
28045
28266
|
init_format();
|
|
28267
|
+
init_milestone_edits();
|
|
28046
28268
|
init_project_messages();
|
|
28047
28269
|
init_utils();
|
|
28048
28270
|
init_shared();
|
package/lib/cli.mjs
CHANGED
|
@@ -3015,7 +3015,8 @@ export async function run(argv, io = {}) {
|
|
|
3015
3015
|
const programs = r.programs.filter((p) => nameHas(p.name, words));
|
|
3016
3016
|
const names = new Set(programs.map((p) => p.name));
|
|
3017
3017
|
const blankCharters = (r.blankCharters ?? []).filter((b) => names.has(b.program));
|
|
3018
|
-
|
|
3018
|
+
const hullCheck = (r.hullCheck ?? []).filter((h) => names.has(h.program));
|
|
3019
|
+
return { ...r, programs, blankCharters, hullCheck, steadyHands: [] };
|
|
3019
3020
|
},
|
|
3020
3021
|
);
|
|
3021
3022
|
}
|
package/lib/format.mjs
CHANGED
|
@@ -392,6 +392,22 @@ export function reviewList(r) {
|
|
|
392
392
|
if (blank.length > 8) out.push(` and ${blank.length - 8} more`);
|
|
393
393
|
out.push(' harbor charter "PROJECT" --why "…" writes one.');
|
|
394
394
|
}
|
|
395
|
+
const hull = r.hullCheck ?? [];
|
|
396
|
+
if (hull.length) {
|
|
397
|
+
out.push("", "Hull check: health set by hand better than the work says, three weeks or more:");
|
|
398
|
+
for (const h of hull.slice(0, 8)) {
|
|
399
|
+
out.push(` ${h.project}${h.owner ? ` (${h.owner})` : ""}`);
|
|
400
|
+
out.push(` ${h.text}${h.note ? ` “${h.note}”` : ""}`);
|
|
401
|
+
}
|
|
402
|
+
if (hull.length > 8) out.push(` and ${hull.length - 8} more`);
|
|
403
|
+
out.push(' harbor health auto --project "PROJECT" lets the numbers speak.');
|
|
404
|
+
}
|
|
405
|
+
const steady = r.steadyHands ?? [];
|
|
406
|
+
if (steady.length)
|
|
407
|
+
out.push(
|
|
408
|
+
"",
|
|
409
|
+
`Steady hand${steady.length === 1 ? "" : "s"}: ${steady.join(", ")}. Their calls by hand over three months matched the work, or warned early.`,
|
|
410
|
+
);
|
|
395
411
|
return out.join("\n") + more;
|
|
396
412
|
}
|
|
397
413
|
|