Files
stack/agents/sage/work/vikunja-setup/probe.mjs
T
jason.woltjeandClaude Opus 5.5 a6382f7bdf docs(slice1): tasks.mosaicstack.dev on Vikunja 2.7.0, runbook sections 2-3 by Sage (row 35, #1517, lead decision 75)
Jason asked for tasks.mosaicstack.dev operational with agents configured in it.
Sage backed it up, tested the restore, pinned 2.7.0 (infra PR #325) and ran
sections 2 and 3 through the API: owner id 4, svc-mosaic-stack id 5, project 32,
bots 6-10, scoped tokens to 2027-01-07. Probes pass. Scope is Mosaic Stack only
(Mos relaying Jason, his Q9 open). OIDC has been broken since a 2026-04-27
NetworkPolicy; infra PR #326 is with ops-01. BUILD-LOG also records the cert
renewal fix and the last-applied annotation slip.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 17:49:40 -05:00

22 lines
1.2 KiB
JavaScript

// Sage, 2026-10-09: isolation probe for the mosaic-stack bots on tasks.mosaicstack.dev (decisions 66 and 68).
// Reads each token file in-process and prints statuses and ids only.
// Usage: node probe.mjs SECRETS_DIR PROJECT_ID OTHER_PROJECT_ID
import { readFileSync } from "node:fs";
const [S, P, OTHER] = process.argv.slice(2);
const BASE = "https://tasks.mosaicstack.dev/api/v2";
async function get(path, tok) {
const r = await fetch(BASE + path, { headers: { Authorization: `Bearer ${tok}` } });
let j = null; try { j = await r.json(); } catch {}
return { s: r.status, j };
}
const ids = (j) => (j?.items ?? (Array.isArray(j) ? j : [])).map((x) => x.id);
for (const r of ["pm", "cto", "coder", "reviewer", "sync"]) {
const tok = readFileSync(`${S}/${r}-vikunja.token`, "utf8").trim();
const own = await get(`/projects/${P}`, tok);
const other = await get(`/projects/${OTHER}`, tok);
const list = await get(`/projects`, tok);
const labels = await get(`/labels`, tok);
const tasks = await get(`/projects/${OTHER}/views`, tok);
console.log(r, `own=${own.s}`, `other=${other.s}`, `projects=${list.s}:${JSON.stringify(ids(list.j))}`, `labels=${labels.s}:${JSON.stringify(ids(labels.j))}`, `otherViews=${tasks.s}`);
}