feat(phase4): just front door + safety rules + bugfix (Sam & Claude)
Rewrites justfile with 8 groups, 35+ recipes with docstrings.
Creates 8 CLI helper scripts (jail-status, hostd-cli, system-health,
agent-status, agent-task, agent-task-status, agent-logs, jail-provision).
Adds 4 hostd safety rules to safety.yaml (destroy, rollback, zfs-destroy, pf).
Fixes task_create empty assigned_to bug in controlplane-tools.ts.
Build: pass | Tests: not run (Linux)
2026-04-14 01:27:08 +02:00
|
|
|
const API_PORT = parseInt(process.env.CONTROLPLANE_PORT ?? '3100', 10);
|
|
|
|
|
const API_HOST = process.env.CONTROLPLANE_BIND_HOST ?? '127.0.0.1';
|
2026-04-13 23:26:22 +00:00
|
|
|
|
|
|
|
|
const taskId = process.argv[2];
|
|
|
|
|
|
feat(phase4): just front door + safety rules + bugfix (Sam & Claude)
Rewrites justfile with 8 groups, 35+ recipes with docstrings.
Creates 8 CLI helper scripts (jail-status, hostd-cli, system-health,
agent-status, agent-task, agent-task-status, agent-logs, jail-provision).
Adds 4 hostd safety rules to safety.yaml (destroy, rollback, zfs-destroy, pf).
Fixes task_create empty assigned_to bug in controlplane-tools.ts.
Build: pass | Tests: not run (Linux)
2026-04-14 01:27:08 +02:00
|
|
|
if (!taskId) {
|
|
|
|
|
console.error('Usage: agent-task-status.ts <task_id>');
|
|
|
|
|
process.exit(1);
|
2026-04-13 23:26:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function main(): Promise<void> {
|
|
|
|
|
try {
|
feat(phase4): just front door + safety rules + bugfix (Sam & Claude)
Rewrites justfile with 8 groups, 35+ recipes with docstrings.
Creates 8 CLI helper scripts (jail-status, hostd-cli, system-health,
agent-status, agent-task, agent-task-status, agent-logs, jail-provision).
Adds 4 hostd safety rules to safety.yaml (destroy, rollback, zfs-destroy, pf).
Fixes task_create empty assigned_to bug in controlplane-tools.ts.
Build: pass | Tests: not run (Linux)
2026-04-14 01:27:08 +02:00
|
|
|
const res = await fetch(
|
|
|
|
|
`http://${API_HOST}:${API_PORT}/api/controlplane/tasks`,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (!res.ok) {
|
|
|
|
|
console.error(`API error ${res.status}: ${await res.text()}`);
|
|
|
|
|
process.exit(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const data = (await res.json()) as Record<string, unknown>;
|
|
|
|
|
const tasks = (data.tasks as Array<Record<string, unknown>>) ?? [];
|
|
|
|
|
const task = tasks.find((t) => t.id === taskId);
|
|
|
|
|
|
|
|
|
|
if (!task) {
|
|
|
|
|
console.log(`Task not found: ${taskId}`);
|
|
|
|
|
process.exit(1);
|
2026-04-13 23:26:22 +00:00
|
|
|
}
|
feat(phase4): just front door + safety rules + bugfix (Sam & Claude)
Rewrites justfile with 8 groups, 35+ recipes with docstrings.
Creates 8 CLI helper scripts (jail-status, hostd-cli, system-health,
agent-status, agent-task, agent-task-status, agent-logs, jail-provision).
Adds 4 hostd safety rules to safety.yaml (destroy, rollback, zfs-destroy, pf).
Fixes task_create empty assigned_to bug in controlplane-tools.ts.
Build: pass | Tests: not run (Linux)
2026-04-14 01:27:08 +02:00
|
|
|
|
|
|
|
|
console.log(`Task: ${task.id}`);
|
|
|
|
|
console.log(` Title: ${task.title ?? 'N/A'}`);
|
|
|
|
|
console.log(` Status: ${task.status ?? 'N/A'}`);
|
|
|
|
|
console.log(` Assigned: ${task.assigned_to ?? 'unassigned'}`);
|
|
|
|
|
console.log(` Priority: ${task.priority ?? 'N/A'}`);
|
|
|
|
|
if (task.result) console.log(` Result: ${JSON.stringify(task.result)}`);
|
2026-04-13 23:26:22 +00:00
|
|
|
} catch (err) {
|
|
|
|
|
const msg = err instanceof Error ? err.message : String(err);
|
|
|
|
|
if (msg.includes('ECONNREFUSED')) {
|
feat(phase4): just front door + safety rules + bugfix (Sam & Claude)
Rewrites justfile with 8 groups, 35+ recipes with docstrings.
Creates 8 CLI helper scripts (jail-status, hostd-cli, system-health,
agent-status, agent-task, agent-task-status, agent-logs, jail-provision).
Adds 4 hostd safety rules to safety.yaml (destroy, rollback, zfs-destroy, pf).
Fixes task_create empty assigned_to bug in controlplane-tools.ts.
Build: pass | Tests: not run (Linux)
2026-04-14 01:27:08 +02:00
|
|
|
console.error('Controlplane API not reachable');
|
2026-04-13 23:26:22 +00:00
|
|
|
} else {
|
feat(phase4): just front door + safety rules + bugfix (Sam & Claude)
Rewrites justfile with 8 groups, 35+ recipes with docstrings.
Creates 8 CLI helper scripts (jail-status, hostd-cli, system-health,
agent-status, agent-task, agent-task-status, agent-logs, jail-provision).
Adds 4 hostd safety rules to safety.yaml (destroy, rollback, zfs-destroy, pf).
Fixes task_create empty assigned_to bug in controlplane-tools.ts.
Build: pass | Tests: not run (Linux)
2026-04-14 01:27:08 +02:00
|
|
|
console.error('Error:', msg);
|
2026-04-13 23:26:22 +00:00
|
|
|
}
|
|
|
|
|
process.exit(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
feat(phase4): just front door + safety rules + bugfix (Sam & Claude)
Rewrites justfile with 8 groups, 35+ recipes with docstrings.
Creates 8 CLI helper scripts (jail-status, hostd-cli, system-health,
agent-status, agent-task, agent-task-status, agent-logs, jail-provision).
Adds 4 hostd safety rules to safety.yaml (destroy, rollback, zfs-destroy, pf).
Fixes task_create empty assigned_to bug in controlplane-tools.ts.
Build: pass | Tests: not run (Linux)
2026-04-14 01:27:08 +02:00
|
|
|
main();
|