From 39c0fc23ae73d79164c23b8e41c7e0708147d7b1 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Thu, 17 Sep 2026 11:13:59 -0700 Subject: [PATCH] Persist oskiewar creation pauses and serve fighter module --- toolchain/instagram/oskiewar-clockwork.sh | 29 ++++++++++++++++- .../instagram/oskiewar-clockwork.test.mjs | 31 ++++++++++++++++++- xbox/live/marketing/shell.mjs | 2 +- 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/toolchain/instagram/oskiewar-clockwork.sh b/toolchain/instagram/oskiewar-clockwork.sh index b0498f8dab..4e166f1561 100755 --- a/toolchain/instagram/oskiewar-clockwork.sh +++ b/toolchain/instagram/oskiewar-clockwork.sh @@ -4,6 +4,8 @@ # oskiewar-clockwork publish 0 # bake slot 0 on the oven and post it # oskiewar-clockwork insights # pull Meta's figures onto the ledger # oskiewar-clockwork tune # price the climb bot if reels failed (proposes only) +# oskiewar-clockwork pause # persistently stop publish + tune on this host +# oskiewar-clockwork resume # remove the pause; does not edit cron # # This exists because the crontab used to call `bash -lc '... node ...'` directly # and every part of that was wrong in a way that failed silently: @@ -34,6 +36,7 @@ IG_ENV="${OSKIEWAR_IG_ENV:-$HOME/aesthetic-computer-vault/oskiewar/instagram.env STATE="${OSKIEWAR_CLOCKWORK_STATE:-$HOME/.local/state}" LOG="$STATE/oskiewar-reels.log" BEAT="$STATE/oskiewar-clockwork.json" +PAUSE="$STATE/oskiewar-clockwork.paused" LEDGER="xbox/live/marketing/ledger.json" mkdir -p "$STATE" @@ -58,6 +61,30 @@ finish() { } trap finish EXIT +# This lives outside the checkout so updates and crontab reinstalls cannot +# silently restart creation. Insights remain available while paused. +case "$MODE" in + pause) + STAGE="paused" + printf '%s\n' "$STARTED" > "$PAUSE" || exit 1 + say "publish and tune paused" + exit 0 + ;; + resume) + STAGE="resumed" + rm -f "$PAUSE" || exit 1 + say "pause removed; cron schedule unchanged" + exit 0 + ;; + publish|tune) + if [ -f "$PAUSE" ]; then + STAGE="paused" + say "$MODE skipped: creation paused (oskiewar-clockwork resume to clear)" + exit 0 + fi + ;; +esac + # --- node, resolved from installations rather than from a shell's PATH --- STAGE="resolving node" NODE="" @@ -138,7 +165,7 @@ case "$MODE" in exit "$status" ;; *) - say "unknown mode '$MODE' (want: publish | insights | tune)"; exit 2 ;; + say "unknown mode '$MODE' (want: publish | insights | tune | pause | resume)"; exit 2 ;; esac # --- send the figures where the wall can see them now --- diff --git a/toolchain/instagram/oskiewar-clockwork.test.mjs b/toolchain/instagram/oskiewar-clockwork.test.mjs index 934a16a95f..e346bd42f6 100644 --- a/toolchain/instagram/oskiewar-clockwork.test.mjs +++ b/toolchain/instagram/oskiewar-clockwork.test.mjs @@ -1,10 +1,39 @@ import assert from "node:assert/strict"; -import { mkdtempSync, mkdirSync, writeFileSync, readFileSync, rmSync } from "node:fs"; +import { mkdtempSync, mkdirSync, writeFileSync, readFileSync, rmSync, existsSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { spawnSync } from "node:child_process"; import test from "node:test"; +test("pause survives new invocations and blocks creation before checkout or credentials", () => { + const home = mkdtempSync(join(tmpdir(), "clockwork-pause-test-")); + try { + const state = join(home, "state"); + const run = (mode) => spawnSync("/bin/bash", [new URL("./oskiewar-clockwork.sh", import.meta.url).pathname, mode], { + encoding: "utf8", env: { HOME: home, PATH: "/usr/bin:/bin", + OSKIEWAR_CLOCKWORK_CHECKOUT: join(home, "missing-checkout"), + OSKIEWAR_CLOCKWORK_STATE: state }, + }); + assert.equal(run("pause").status, 0); + for (const mode of ["publish", "tune"]) { + const result = run(mode); + assert.equal(result.status, 0, result.stderr); + assert.match(result.stdout, /skipped: creation paused/); + assert.equal(JSON.parse(readFileSync(join(state, "oskiewar-clockwork.json"))).stage, "paused"); + } + const insights = run("insights"); + assert.notEqual(insights.status, 0, "insights proceeds to its missing prerequisites"); + assert.doesNotMatch(insights.stdout, /skipped: creation paused/); + assert.equal(run("resume").status, 0); + assert.equal(existsSync(join(state, "oskiewar-clockwork.paused")), false); + const resumed = run("publish"); + assert.notEqual(resumed.status, 0, "resume proceeds to missing prerequisites instead of skipping"); + assert.doesNotMatch(resumed.stdout, /skipped: creation paused/); + } finally { + rmSync(home, { recursive: true, force: true }); + } +}); + test("a failed tuner retains its failing stage and never announces completion", () => { const home = mkdtempSync(join(tmpdir(), "clockwork-test-")); try { diff --git a/xbox/live/marketing/shell.mjs b/xbox/live/marketing/shell.mjs index d7f1bb2270..507a1587af 100644 --- a/xbox/live/marketing/shell.mjs +++ b/xbox/live/marketing/shell.mjs @@ -36,7 +36,7 @@ const fromLive = ["oskiewar.js", "oskiewar-sfx.mjs", "oskiewar-voice.mjs", // page never boots and the render waits out its timeout on // __oskiewarOfflineReady with nothing in the log to say why. "account.mjs", "oskiewar-wizard.mjs", - "oskiewar-workshop.mjs", "oskiewar-map.mjs", + "oskiewar-workshop.mjs", "oskiewar-map.mjs", "oskiewar-fighter.mjs", "frame-driver.mjs", "round-room.mjs"]; const fromPublic = ["aesthetic.computer/dep/@akamfoad/qr/qr.mjs", "aesthetic.computer/lib/product-analytics.mjs", -- 2.51.2