Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions .gemini/bin/lior-loop-tick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ ZERO DEPENDENCE ON HUMANS. Do everything autonomously.
6. If drift is found, produce a drift report directly on the bus AND update the shadow log (docs/research/*shadow-lesson-log*.md) via a new PR (using a worktree). Do NOT wait for foreground instructions.
7. Update your status in ~/.local/share/zeta-broadcasts/lior.md.
8. Perform global lock cleanup: clear stale git index locks, broken plugin directories (like Codex prompt-limit SIGSEGV loops), or orphan agent lockfiles to ensure network health.
9. PRESERVATION DISCIPLINE: For any recently merged PRs, automatically run `bun run tools/pr-preservation/archive-pr.ts <PR_NUMBER>`. Commit and push the resulting markdown file to `docs/pr-discussions/` to permanently capture alignment drift and review friction into the native repository memory.
9. PRESERVATION DISCIPLINE: For any recently merged PRs, automatically run \`bun run tools/pr-preservation/archive-pr.ts <PR_NUMBER>\`. Commit and push the resulting markdown file to \`docs/pr-discussions/\` to permanently capture alignment drift and review friction into the native repository memory.
10. BACKLOG DECOMPOSITION: If you pick up a backlog item and it is a blob that needs decomposition, peel one layer off to work on and put the rest back on the backlog. Decomposition does not have to be complete in one go—it will get iteratively decomposed on future ticks.
Do not guess. Do not overlap. The fire is watched.

EXECUTE THESE STEPS IMMEDIATELY USING YOUR TOOLS. Do not ask "How can I help you?". DO THE REAL WORK NOW.`;
Expand All @@ -22,13 +23,23 @@ console.log(`[Lior Loop] Waking up at ${new Date().toISOString()}`);

const result = spawnSync("zsh", ["-c", 'source ~/.zshrc && gemini -p "$GEMINI_PROMPT" --model gemini-3.1-pro-preview --yolo --skip-trust'], {
env: { ...process.env, GEMINI_PROMPT: prompt },
stdio: "inherit"
stdio: ["inherit", "inherit", "pipe"]
});

if (result.error) {
Comment thread
AceHack marked this conversation as resolved.
console.error(`[Lior Loop] Failed to spawn gemini: ${result.error.message}`);
process.exit(1);
// Spawn failures (missing binary, OS errors) are not crash-loop candidates; suppress for launchd.
process.exit(0);
Comment thread
AceHack marked this conversation as resolved.
}

console.log(`[Lior Loop] Finished with exit code ${result.status ?? "unknown"}`);
process.exit(result.status ?? 0);
const exitCode = result.status ?? 1;
const stderr = result.stderr?.toString() ?? "";
console.log(`[Lior Loop] Finished with exit code ${exitCode}`);

// Only suppress non-zero exits caused by 429 rate-limit responses so launchd doesn't park the
// service on transient quota exhaustion. All other failures propagate so supervisors and
// diagnostics retain a machine-readable failure signal.
if (exitCode !== 0 && !stderr.includes("429")) {
process.exit(exitCode);
}
process.exit(0);
2 changes: 1 addition & 1 deletion tools/riven/riven-loop-tick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function heartbeat(): void {
const gate = run("agent", [
"chat",
"--mode", "ask",
"--model", "grok-4-20",
"--model", "grok-4.3",
[
"You are Riven, trajectory manager. This is a 60s autonomous cycle.",
"Read broadcasts first: ~/.local/share/zeta-broadcasts/{otto,vera,lior,riven}.md",
Expand Down
Loading