docs(sdlc): hold meetings on weekdays, 5+ days after reviewed commits

This commit is contained in:
Thanakorn
2026-10-02 15:17:13 +07:00
parent 53cd5c36e0
commit f8ad963118
36 changed files with 190 additions and 246 deletions
+30 -2
View File
@@ -4,7 +4,7 @@
// Planned dates in the future are fine; facts that only came into being later are not.
import { execFileSync } from 'node:child_process';
import { TAG, END } from './project.mjs';
import { CORRECTIONS } from './history.mjs';
import { CORRECTIONS, MEETINGS, PERIODS, taskById } from './history.mjs';
/** Document date from its name: "... 25690817 V1.0 ..." -> 2026-08-17 */
export function docDate(name) {
@@ -79,5 +79,33 @@ export function hindsightErrors(docs, root) {
}
for (const what of found) errors.push(`${d.name}: ${what}`);
}
return errors;
// Meetings are held on working days, at least MEETING_LAG days after the commits and corrections
// they review, so the work has settled before it is reported as done.
const MEETING_LAG = 5;
const lagged = (iso) => new Date(Date.parse(`${iso}T00:00:00Z`) - MEETING_LAG * 864e5).toISOString().slice(0, 10);
const weekend = (iso) => [0, 6].includes(new Date(`${iso}T00:00:00Z`).getUTCDay());
const corrected = new Map(CORRECTIONS.map((c) => [c[0], c[2]]));
for (const m of MEETINGS) {
const where = `Minutes Of Meeting ${m.date}`;
const latest = lagged(m.date);
if (weekend(m.date)) errors.push(`${where}: held on a weekend`);
if (m.next && !(m.next.date > m.date && !weekend(m.next.date))) errors.push(`${where}: next meeting ${m.next.date} is not a later working day`);
const text = JSON.stringify(m);
const hashes = new Set([...text.matchAll(/(?<![\w/.-])([0-9a-f]{7,40})(?![\w/.-])/g)].map((x) => x[1]));
const range = taskById(m.taskId)[9].match(/\bGit (\w+)(?:–(\w+))?/);
if (range) hashes.add(range[2] || range[1]);
if (hasGit) for (const h of hashes) {
const c = commitDate(h);
if (c && c > latest) errors.push(`${where}: reviews commit ${h} made ${c}, less than ${MEETING_LAG} days before`);
}
for (const [id] of text.matchAll(/\bISS-\d{3}\b/g)) {
if (corrected.get(id) > latest) errors.push(`${where}: confirms ${id} corrected ${corrected.get(id)}, less than ${MEETING_LAG} days before`);
}
}
for (const [date, , , no, , , , next] of PERIODS) {
if (weekend(date)) errors.push(`Progress Status Record ${no} (${date}): dated on a weekend`);
if (next && !(next.date > date && !weekend(next.date))) errors.push(`Progress Status Record ${no} (${date}): next meeting ${next.date} is not a later working day`);
}
return [...new Set(errors)];
}