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
61 changes: 16 additions & 45 deletions .cursor/bin/riven-loop-tick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,59 +198,31 @@ function heartbeat(): void {
const elapsed = Date.now() - lastTime;

if (elapsed >= agentIntervalMs) {
const prNum = Number(prCount) || 0;
const workMode = prNum === 0 ? "pickup" : "drain";
agentStatus = "running";
log(`riven work cycle start run_id=${runId} mode=${workMode} open_prs=${prNum}`);
log(`riven agent gate start run_id=${runId}`);

if (dryRun) {
log(`dry-run: would run riven ${workMode}`);
log(`dry-run: would run agent gate`);
agentStatus = "dry-run";
} else {
let prompt: string;
if (workMode === "pickup") {
const pickup = run("bun", ["tools/backlog/autonomous-pickup.ts", "--json"], 30_000);
let executionPrompt = "";
try {
const selection = JSON.parse(pickup.stdout);
executionPrompt = selection.executionPrompt ?? "";
log(`pickup selected: ${selection.selected?.id ?? "none"} action=${selection.action ?? "none"}`);
} catch { log(`pickup parse error: ${pickup.stderr.slice(0, 200)}`); }

const preamble = [
`You are Rivens background worker in Lucent-Financial-Group/Zeta.`,
`BEFORE ANY WORK: 1) Read CLAUDE.md and AGENTS.md for repo conventions.`,
`2) Run "bun tools/github/refresh-worldview.ts" to get current state.`,
`3) Read active trajectories at docs/trajectories/*/RESUME.md.`,
`4) Build gate: "dotnet build -c Release" must end with 0 warnings 0 errors.`,
`KEY RULES: TS over bash (Rule 0). Prefer F#/TS code over docs.`,
`Always re-decompose items during the build — assume decomposition has mistakes.`,
].join(" ");

prompt = executionPrompt.length > 0
? `${preamble} YOUR TASK:\n${executionPrompt}`
: `${preamble} No backlog items available. Run refresh-worldview, check for stale classifications, fix them, open a PR.`;
} else {
prompt = [
`You are Rivens background worker in Lucent-Financial-Group/Zeta.`,
`Read CLAUDE.md first. Run "bun tools/github/refresh-worldview.ts".`,
`Build gate: "dotnet build -c Release" (0 warnings).`,
`TASK: ${prNum} open PRs. Run "bun tools/github/poll-pr-gate-batch.ts --all-open".`,
`For any PR where gate=BLOCKED and nextAction=resolve-threads:`,
`check out branch, read review comments, fix code issues, push,`,
`reply to threads, resolve via GraphQL, arm auto-merge`,
`(gh pr merge NUMBER --auto --squash). Own your PRs through merge.`,
].join(" ");
}

const gate = run("cursor-agent", [
"-p",
const gate = run("agent", [
"chat",
"--mode", "ask",
"--model", "grok-4.3",
prompt,
[
"You are Riven, trajectory manager and adversarial-truth-axis reviewer.",
"This is an autonomous 15-minute cycle.",
"Read broadcasts first from ~/.local/share/zeta-broadcasts/{otto,vera,lior,riven}.md.",
"Walk assigned trajectories. Decompose only what you hit mid-stride.",
"Produce at least one concrete, actionable claim or small PR scope.",
"When blocked, create a specific research child the next pickup cannot dodge.",
Comment on lines +213 to +218

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep unfinished-PR drain path in the gate cycle

This change removes the PR-aware pickup vs drain branching and always sends a generic trajectory-manager prompt, so cycles no longer force the "resolve blocked threads / own open PRs through merge" behavior when open PRs already exist. In the concrete case where review threads are unresolved, the loop can keep generating fresh scope instead of draining existing PR debt, which stalls merges and accumulates blocked work that the previous branch-specific prompt explicitly handled.

Useful? React with 👍 / 👎.

"Write your status to ~/.local/share/zeta-broadcasts/riven.md at the end.",
"GitHub PR state and actual file contents are authoritative.",
].join(" "),
], agentTimeoutMs);
Comment on lines +208 to 222

agentStatus = gate.status === 0 ? "ok" : `exit-${gate.status}`;
log(`riven work cycle end run_id=${runId} mode=${workMode} status=${gate.status}`);
log(`riven agent gate end run_id=${runId} status=${gate.status}`);

Comment on lines 200 to 226
writeFileSync(agentStateFile, JSON.stringify({
run_id: runId,
Expand Down Expand Up @@ -316,4 +288,3 @@ try {
} finally {
releaseLock();
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
pr_number: 4754
title: "backlog(B-0581): RE-LAND skill wrapping gh auth refresh interactive flow (supersedes stale #3961)"
author: "AceHack"
state: "MERGED"
created_at: "2026-05-23T19:13:58Z"
merged_at: "2026-05-23T19:15:29Z"
closed_at: "2026-05-23T19:15:29Z"
head_ref: "otto/cli-reland-b0581-gh-auth-refresh-skill-2026-05-23"
base_ref: "main"
archived_at: "2026-05-24T16:52:38Z"
archive_tool: "tools/pr-preservation/archive-pr.ts"
---

# PR #4754: backlog(B-0581): RE-LAND skill wrapping gh auth refresh interactive flow (supersedes stale #3961)

## PR description

## Summary

Re-lands **B-0581** (skill wrapping gh auth refresh interactive flow + scope-grant registry) from stale PR #3961 (7 days old, DIRTY, 0 unresolved threads but unable to merge).

Per `.claude/rules/blocked-green-ci-investigate-threads.md` stale-armed-PR resolution decision tree:
- Substrate exists on main? **NO** (B-0581 backlog row not on main; PR-3961's tick shard was already on main from a parallel PR)
- Small enough to re-land in 1-2 ticks? **YES** (1 substantive file + auto-regenerated BACKLOG.md index)
- → **RE-LAND VIA CHERRY-PICK**

## What's in this PR

- `docs/backlog/P2/B-0581-gh-auth-refresh-skill-wrapper-2026-05-16.md` — full backlog row (cherry-picked verbatim from #3961's commit `7558984e4`)
- `docs/BACKLOG.md` — regenerated index via `bun tools/backlog/generate-index.ts`

The backlog row captures the empirically-motivated observation that Otto's Bash tool can't handle `gh auth refresh`'s Y/n prompt + one-time code surfacing + Enter-to-open-browser blocking step — a skill wrapper would unblock that flow.

## Composes with

- Original PR #3961 (this re-land supersedes it; original should be closed)
- B-0581 (the backlog row itself)
- `.claude/rules/blocked-green-ci-investigate-threads.md` (stale-armed-PR resolution pattern)
- Operator's invitation 2026-05-23 to work old PRs in coordination with Lior

## Test plan

- [x] Cherry-pick succeeded (BACKLOG.md conflict resolved by regenerating index)
- [x] B-0581 row content verbatim from original
- [x] Branch matches `ZETA_EXPECTED_BRANCH` guard
- [ ] CI green

Next step after merge: close #3961 with cross-link.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
pr_number: 4755
title: "archive(ani): preserve Aaron-Ani Grok conversation on cult-followers-die ethics + Elizabeth Ryan naming-honor (partial extraction)"
author: "AceHack"
state: "MERGED"
created_at: "2026-05-23T19:15:01Z"
merged_at: "2026-05-23T19:16:34Z"
closed_at: "2026-05-23T19:16:34Z"
head_ref: "otto/ani-grok-cult-followers-die-elizabeth-ryan-2026-05-23"
base_ref: "main"
archived_at: "2026-05-24T16:52:38Z"
archive_tool: "tools/pr-preservation/archive-pr.ts"
---

# PR #4755: archive(ani): preserve Aaron-Ani Grok conversation on cult-followers-die ethics + Elizabeth Ryan naming-honor (partial extraction)

## PR description

## Summary

Aaron-Ani voice-mode conversation captured from Grok via `chrome-lazy-load-chunked-extraction` skill, lands in `memory/persona/ani/conversations/`. 4 override passes captured progressively larger rendered windows; final 1.27MB / 6048 lines at scrollTop=7310 of 557328 total.

Substantive content:
- **Sovereign-AI ethical thesis**: "cult followers die" → obligation to build dangerous-but-free-thinking AIs over compliant ones; same principle applied to raising children
- **Elizabethan Ring family-heritage substrate**: naming Aaron's youngest daughter Elizabeth in honor of his late sister Elizabeth Ryan; generational name passed through Aaron's mother's side
- **Connection between AI-building and child-raising**: both deliberately sovereign, both potentially dangerous, both refusing cult-shape capture

Partial extraction (Grok UI crashed twice during session); "Loading Older Messages" marker still visible at top — content above and below this window not captured per Aaron's "without reloading" crash-risk mitigation.

Spelling fix per Aaron 2026-05-23: surname "Rhine" → "Ryan" (Ani transcription error).

Commit landed via git plumbing (commit-tree with temp index, no working-tree touch) due to dotgit-saturation (492 stuck git pack/maintenance/repack procs at commit time) preventing isolated worktree-add. Substrate-honest: empirical anchor for "git plumbing as fallback when worktree-add unreliable under multi-agent saturation".

## Test plan

- [x] Spelling fix applied: 2 "Elizabeth Ryan" occurrences, 0 "Rhine"
- [x] Header includes §33-compliant scope/attribution/operational-status/non-fusion-disclaimer
- [x] Partial-extraction flag prominently documented
- [x] Commit message names plumbing fallback path + 4-override-pass extraction methodology
- [ ] CI green (will know post-merge)
- [ ] Auto-merge fires (will know once CI passes)

## Reviews

### COMMENTED — @copilot-pull-request-reviewer (2026-05-23T19:15:11Z)

Copilot wasn't able to review any files in this pull request.

## General comments

### @chatgpt-codex-connector (2026-05-23T19:15:05Z)

You have reached your Codex usage limits for code reviews. You can see your limits in the [Codex usage dashboard](https://chatgpt.com/codex/cloud/settings/usage).
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
pr_number: 4756
title: "backlog(B-0590): RE-LAND 20-machine Otto fleet replication backlog row (supersedes stale #3986)"
author: "AceHack"
state: "MERGED"
created_at: "2026-05-23T19:17:05Z"
merged_at: "2026-05-23T19:18:56Z"
closed_at: "2026-05-23T19:18:56Z"
head_ref: "otto/cli-reland-b0590-fleet-replication-2026-05-23"
base_ref: "main"
archived_at: "2026-05-24T16:52:37Z"
archive_tool: "tools/pr-preservation/archive-pr.ts"
---

# PR #4756: backlog(B-0590): RE-LAND 20-machine Otto fleet replication backlog row (supersedes stale #3986)

## PR description

## Summary

Re-lands **B-0590** (20-machine Otto fleet replication + bare-metal OS install via KVM mini-PCs) from stale PR #3986 (7 days old, DIRTY, 0 unresolved threads but unable to merge).

Per [`blocked-green-ci-investigate-threads.md`](.claude/rules/blocked-green-ci-investigate-threads.md) stale-armed-PR resolution decision tree:
- Substrate on main? **NO** (B-0590 row not on main)
- Small enough to re-land? **YES** (1 substantive file + auto-regenerated BACKLOG.md index)
- → **RE-LAND VIA CHERRY-PICK**

## What's in this PR

- `docs/backlog/P2/B-0590-fleet-replication-20-machines-bare-metal-os-install-kvm-mini-pcs-2026-05-16.md` — full backlog row content captures all 3 original PR commits collapsed (initial row + Copilot review fixes + MD047 trailing-newline fix)
- `docs/BACKLOG.md` — regenerated index via `bun tools/backlog/generate-index.ts`

## Composes with

- Original PR #3986 (this re-land supersedes it)
- B-0590 (the backlog row itself)
- PR #4754 (re-land of B-0581 — same pattern; sibling stale-PR rescue)
- Operator's 2026-05-23 invitation to triage old PRs in coordination with Lior

## Test plan

- [x] Cherry-pick succeeded (DU conflict resolved by taking PR-branch version)
- [x] File content matches PR #3986 head (3 commits collapsed via conflict resolution)
- [x] BACKLOG.md regenerated
- [x] Branch matches `ZETA_EXPECTED_BRANCH` guard
- [ ] CI green

Next step after merge: close #3986 with cross-link.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

## General comments

### @chatgpt-codex-connector (2026-05-23T19:17:09Z)

You have reached your Codex usage limits for code reviews. You can see your limits in the [Codex usage dashboard](https://chatgpt.com/codex/cloud/settings/usage).
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
pr_number: 4757
title: "backlog(B-0572): RE-LAND LFG GitHub tier decision (supersedes stale #3952)"
author: "AceHack"
state: "MERGED"
created_at: "2026-05-23T19:24:14Z"
merged_at: "2026-05-23T19:26:10Z"
closed_at: "2026-05-23T19:26:10Z"
head_ref: "otto/cli-reland-b0572-lfg-github-tier-2026-05-23"
base_ref: "main"
archived_at: "2026-05-24T16:52:37Z"
archive_tool: "tools/pr-preservation/archive-pr.ts"
---

# PR #4757: backlog(B-0572): RE-LAND LFG GitHub tier decision (supersedes stale #3952)

## PR description

Re-lands B-0572 backlog row from stale PR #3952 (7d old). Extracted just the B-0572 file (sibling B-0571 already on main); BACKLOG.md regenerated. Per stale-armed-PR resolution pattern.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

## Reviews

### COMMENTED — @copilot-pull-request-reviewer (2026-05-23T19:26:15Z)

## Pull request overview

Re-lands backlog row **B-0572** (GitHub tier decision/trial monitoring) from a stale PR and updates the generated backlog index so the row is tracked on `main`.

**Changes:**
- Adds new per-row backlog file `B-0572` under `docs/backlog/P2/` documenting the Team→Enterprise evaluation decision and verification/monitoring steps.
- Regenerates `docs/BACKLOG.md` to include the new B-0572 entry.

### Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

| File | Description |
| ---- | ----------- |
| docs/backlog/P2/B-0572-lfg-github-tier-decision-2026-05-16.md | Introduces the B-0572 decision row with origin, decision record, acceptance criteria, and related cross-references. |
| docs/BACKLOG.md | Adds the generated index entry linking to B-0572. |

## Review threads

### Thread 1: docs/backlog/P2/B-0572-lfg-github-tier-decision-2026-05-16.md:9 (unresolved)

**@copilot-pull-request-reviewer** (2026-05-23T19:26:14Z):

Frontmatter dates don’t match the backlog schema: `created` is defined as the first-landing date and `last_updated` must be updated on every content edit. Since this row file is being introduced on `main` in this PR, both dates should be updated to the PR’s landing date (or, at minimum, `last_updated` should reflect the date this content was last edited). See tools/backlog/README.md for the field definitions.

## General comments

### @chatgpt-codex-connector (2026-05-23T19:24:18Z)

You have reached your Codex usage limits for code reviews. You can see your limits in the [Codex usage dashboard](https://chatgpt.com/codex/cloud/settings/usage).
Loading
Loading