From de7518657a1b670f5feea2f0e3ebb6a44d7fb9f5 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Sat, 8 Aug 2026 22:18:12 -0700 Subject: [PATCH] Judge each box against the commits it actually reads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Measured against knot's tip, every service went red the moment anyone committed anything — and a signal that is always red is one you stop reading, which is the failure this tool exists to escape. Its first real run called the whole fleet stale over two commits that touched a deploy script and an unrelated file. A box is behind when it is missing a commit that touched ITS paths. The path sets are not invented: session-server's is its own sparse-checkout list, which is the box declaring which files it needs to run. The verdict is reached here rather than taken from silo, because silo has no checkout — the most it can say is whether a sha equals knot's tip, and that is precisely the reading that cried wolf. Unrelated commits are still counted, just reported quietly. --- toolchain/ac-fleet | 54 +++++++++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/toolchain/ac-fleet b/toolchain/ac-fleet index c2af64ae6a..c36fb89639 100755 --- a/toolchain/ac-fleet +++ b/toolchain/ac-fleet @@ -21,11 +21,22 @@ const JSON_OUT = process.argv.includes("--json"); const REPO = join(import.meta.dirname, ".."); const SILO = "https://silo.aesthetic.computer/api/fleet/drift"; -const FALLBACK = [ - { service: "session-server", health: "https://session-server.aesthetic.computer/health" }, - { service: "silo", health: "https://silo.aesthetic.computer/health" }, - { service: "oven", health: "https://oven.aesthetic.computer/health" }, - { service: "lith", health: "https://aesthetic.computer/api/health" }, +// What each service actually reads. Not a guess: session-server's list is its +// own sparse-checkout set, which is the box declaring which files it needs. +// +// This is what makes the tool worth reading. Measured against knot's tip, every +// box goes red the moment anyone commits anything, and a signal that is always +// red is one you stop looking at — the exact failure this was built to escape. +// A box is behind when it is missing a commit that touched ITS paths. +const FLEET = [ + { service: "session-server", health: "https://session-server.aesthetic.computer/health", + paths: ["session-server/", "shared/", "system/public/aesthetic.computer/lib/"] }, + { service: "silo", health: "https://silo.aesthetic.computer/health", + paths: ["silo/"] }, + { service: "oven", health: "https://oven.aesthetic.computer/health", + paths: ["oven/"] }, + { service: "lith", health: "https://aesthetic.computer/api/health", + paths: ["lith/", "system/", "shared/"] }, ]; const git = (args) => new Promise((resolve) => { @@ -46,14 +57,13 @@ async function direct() { return line ? line.split(/\s+/)[0] : null; }; const [knot, mirror] = await Promise.all([tip("origin"), tip("github")]); - const services = await Promise.all(FALLBACK.map(async ({ service, health }) => { + const services = await Promise.all(FLEET.map(async ({ service, health }) => { try { const r = await fetch(health, { signal: AbortSignal.timeout(8000) }); if (!r.ok) return { service, sha: null, note: `HTTP ${r.status}` }; const body = await r.json(); const sha = typeof body?.sha === "string" ? body.sha : null; - return { service, sha, current: sha && knot ? sha === knot : null, - note: sha ? undefined : "no provenance yet" }; + return { service, sha, note: sha ? undefined : "no provenance yet" }; } catch (e) { return { service, sha: null, note: e.name === "TimeoutError" ? "timeout" : "unreachable" }; @@ -71,11 +81,21 @@ try { report = await direct(); } -// How many commits each box is behind, when this clone holds both ends. +// The verdict is reached HERE, never taken from silo: silo has no checkout, so +// the best it can say is whether a sha equals knot's tip, and that reads every +// unrelated commit as a fleet-wide outage. for (const s of report.services) { - if (!s.sha || !report.knot || s.current) continue; - const count = await git(["rev-list", "--count", `${s.sha}..${report.knot}`]); - if (count !== null) s.behind = Number(count); + if (!s.sha || !report.knot) continue; + const paths = FLEET.find((f) => f.service === s.service)?.paths ?? []; + const range = `${s.sha}..${report.knot}`; + const total = await git(["rev-list", "--count", range]); + const mine = paths.length + ? await git(["rev-list", "--count", range, "--", ...paths]) + : total; + if (mine === null) { s.current = null; s.note ??= "history unavailable"; continue; } + s.behind = Number(mine); + s.unrelated = Number(total ?? 0) - s.behind; + s.current = s.behind === 0; } if (JSON_OUT) { @@ -96,9 +116,13 @@ let stale = 0; for (const s of report.services) { const icon = s.current === true ? "✅" : s.sha ? "❌" : "⚠️ "; if (s.sha && s.current !== true) stale++; - const detail = s.current === true ? "current" - : s.behind !== undefined ? `${s.behind} commits behind` - : s.note || "drifted"; + // "current" means nothing it depends on has moved — unrelated commits are + // reported quietly so the count stays honest without turning the row red. + const detail = s.current === true + ? (s.unrelated ? `current (${s.unrelated} unrelated)` : "current") + : s.behind !== undefined + ? `${s.behind} commit${s.behind === 1 ? "" : "s"} behind on its own paths` + : s.note || "drifted"; console.log(` ${icon} ${s.service.padEnd(16)} ${short(s.sha).padEnd(11)} ${detail}`); } -- 2.51.2