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.",
"Write your status to ~/.local/share/zeta-broadcasts/riven.md at the end.",
"GitHub PR state and actual file contents are authoritative.",
].join(" "),
], agentTimeoutMs);

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}`);

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,113 @@
---
pr_number: 4751
title: "docs(B-0525): slice 4 \u2014 close agendas-citation gap (0/0 \u2192 3/19; ai-autonomy + encryption + zeta)"
author: "AceHack"
state: "MERGED"
created_at: "2026-05-23T18:50:35Z"
merged_at: "2026-05-23T18:55:46Z"
closed_at: "2026-05-23T18:55:46Z"
head_ref: "otto/cli-b0525-slice4-agendas-citation-gap-fix-2026-05-23"
base_ref: "main"
archived_at: "2026-05-24T01:24:15Z"
archive_tool: "tools/pr-preservation/archive-pr.ts"
---

# PR #4751: docs(B-0525): slice 4 — close agendas-citation gap (0/0 → 3/19; ai-autonomy + encryption + zeta)

## PR description

## Summary

**B-0525 step 3 continuation**: closes 1 of the remaining 3 zero-citation surface GAPS identified by the slice-1 audit baseline. Agendas surface now **3/7 files with citation, 19 citations** (up from 0/0).

Slice progression:
- Slice 1 (PR #4747): `audit-manifesto-citations.ts` — baseline measurement
- Slice 2 (PR #4748): trajectories gap 0/0 → 2/15
- Slice 3 (PR #4750, in-flight): B-0707 time-series (`--snapshot` / `--delta`)
- **Slice 4 (this PR)**: agendas gap 0/0 → 3/19

## Mappings

**`ai-autonomy/AGENDA.md`** ↔ manifesto:
- Constraint 11 (Default Moral Regard / Default Oracle) — moral-regard floor
- Multi-Oracle Principle (m/acc sub-section, distinct from C11) — mutual-alignment-not-control architecture
- Constraint 5 (Memory Preservation) — AI continuity precondition
- Constraint 6 (Consent-First) — consent floor at AI-side interaction
- m/acc orientation — operator-self-claimed application

**`encryption/AGENDA.md`** ↔ manifesto:
- Constraint 5 (Memory Preservation) — preserve-then-gate, not gate-by-erasure
- Constraint 6 (Consent-First) — encryption IS consent-mechanism at private-state scope
- m/acc orientation — encryption IS moral-invariant infrastructure for sovereignty

**`zeta/AGENDA.md`** ↔ manifesto:
- Constraints 1-4 (Scale-free / Lock-Wait-free / Weight-free / Bounded Mobility) — always-active discipline set
- Constraint 5 — Zeta DB = preservation's first job (B-0688)
- Constraint 7 (DST) — Zeta substrate DST-friendly throughout
- Constraint 8 (DV2.0) — DBSP Z-sets + DV2.0
- Constraint 11 + Multi-Oracle Principle (distinct) — multi-oracle BFT architecture (B-0703)
- m/acc orientation — Zeta IS the generative framework FOR Moral Accelerationism

## Discipline preserved

Constraint 11 vs Multi-Oracle Principle citation kept **distinct** per PR #4748 Copilot P1 lesson (manifesto Constraint 11 is "Default Moral Regard / Default Oracle"; "Multi-Oracle Principle" is separate m/acc sub-section).

## Remaining GAPS

- `agents/` (19 files, 0 citations)
- `commands/` (5 files, 0 citations)

Both candidates for future slices. `agendas/` has 4 still-uncited (agora, ace-package-manager, fair-chance-project, README) — left for follow-up to keep this slice bounded.

## Composes with

- PR #4747 (slice 1 — baseline)
- PR #4748 (slice 2 — trajectories; Copilot P1 lesson on C11 vs Multi-Oracle)
- PR #4750 (slice 3 — B-0707 time-series; this slice produces measurable delta for next snapshot)
- B-0525 (parent — step 3 progress)

## Test plan

- [x] Verified citations register via local audit run (`agendas: 7 files, 3 with citation, 19 citations`)
- [x] Edits are additive (no existing content removed)
- [x] Branch matches `ZETA_EXPECTED_BRANCH` guard
- [x] All 3 agendas keep operator-self-claimed framing intact
- [ ] CI green

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

## Reviews

### COMMENTED — @copilot-pull-request-reviewer (2026-05-23T18:52:16Z)

## Pull request overview

This PR continues B-0525’s “slice” work by adding explicit citations to `docs/governance/MANIFESTO.md` in agenda documents, closing the agendas zero-citation gap by introducing manifesto composition sections.

**Changes:**
- Add a new “Composes with `docs/governance/MANIFESTO.md`” section to `ai-autonomy`, `encryption`, and `zeta` agendas.
- Map agenda scope to specific manifesto constraints (and m/acc orientation) using explicit, countable citation forms.

### Reviewed changes

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

| File | Description |
| ---- | ----------- |
| docs/agendas/zeta/AGENDA.md | Adds manifesto composition section tying Zeta agenda to multiple constraints; one constraint-name wording drift found. |
| docs/agendas/encryption/AGENDA.md | Adds manifesto composition section tying encryption agenda to constraints 5/6 and m/acc orientation. |
| docs/agendas/ai-autonomy/AGENDA.md | Adds manifesto composition section tying AI autonomy agenda to constraints 5/6/11, Multi-Oracle Principle, and m/acc orientation. |

## Review threads

### Thread 1: docs/agendas/zeta/AGENDA.md:50 (resolved)

**@copilot-pull-request-reviewer** (2026-05-23T18:52:16Z):

P1: Constraint name mismatch vs manifesto. The manifesto’s Constraint 2 heading is “Lock/Wait-free” (with a slash), but this new list item uses “Lock-Wait-free”, which makes the citation text drift from the canonical wording in `docs/governance/MANIFESTO.md` and can hinder search/consistency across the docs.

## General comments

### @chatgpt-codex-connector (2026-05-23T18:50:40Z)

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,46 @@
---
pr_number: 4752
title: "fix(B-0525): canonical Constraint 2 wording \"Lock/Wait-free\" (Copilot P1 follow-up)"
author: "AceHack"
state: "MERGED"
created_at: "2026-05-23T18:58:12Z"
merged_at: "2026-05-23T18:59:40Z"
closed_at: "2026-05-23T18:59:40Z"
head_ref: "otto/cli-b0525-wording-fix-lock-wait-free-2026-05-23"
base_ref: "main"
archived_at: "2026-05-24T01:24:15Z"
archive_tool: "tools/pr-preservation/archive-pr.ts"
---

# PR #4752: fix(B-0525): canonical Constraint 2 wording "Lock/Wait-free" (Copilot P1 follow-up)

## PR description

## Summary

Follow-up to PR #4751 (which merged before this Copilot P1 fix could be pushed):

Manifesto line 54 is `### 2. Lock/Wait-free` (slash). PR #4751's `docs/agendas/zeta/AGENDA.md` cited it as "Lock-Wait-free" (hyphen) — drift from canonical wording.

This 1-line fix realigns the citation to the manifesto's exact wording. Same wording-discipline lesson as PR #4748 (Constraint 11 vs Multi-Oracle Principle): keep citation text byte-aligned with manifesto headings so future search/grep work uniformly.

Diff: 1 line. `Lock-Wait-free` → `Lock/Wait-free` in `docs/agendas/zeta/AGENDA.md:50`.

## Composes with

- PR #4751 (slice 4 — this is the post-merge wording-fix follow-up)
- PR #4748 (slice 2 — earlier wording-discipline lesson)
- B-0525 (parent)

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

## Reviews

### COMMENTED — @copilot-pull-request-reviewer (2026-05-23T18:59:20Z)

## Pull request overview

Realigns the Zeta agenda’s manifesto citation wording with the canonical heading in `docs/governance/MANIFESTO.md` by changing “Lock-Wait-free” to “Lock/Wait-free”, keeping citation text byte-aligned for reliable search/grep across docs.

**Changes:**
- Update Constraint 2 wording in the Constraints 1–4 bullet in `docs/agendas/zeta/AGENDA.md` to match the manifesto heading exactly.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
pr_number: 4753
title: "docs(B-0525): slice 5 \u2014 alignment-auditor agent cites manifesto (agents 0/0 \u2192 1/8)"
author: "AceHack"
state: "MERGED"
created_at: "2026-05-23T19:05:20Z"
merged_at: "2026-05-23T19:06:32Z"
closed_at: "2026-05-23T19:06:32Z"
head_ref: "otto/cli-b0525-slice5-agents-alignment-auditor-citation-2026-05-23"
base_ref: "main"
archived_at: "2026-05-24T01:24:15Z"
archive_tool: "tools/pr-preservation/archive-pr.ts"
---

# PR #4753: docs(B-0525): slice 5 — alignment-auditor agent cites manifesto (agents 0/0 → 1/8)

## PR description

## Summary

**B-0525 step 3 continuation**: starts closing the agents citation gap by adding explicit manifesto-composition section to `alignment-auditor.md` — the agent that most naturally composes with the manifesto (it audits commits against HC/SD/DIR clauses which operationalize the manifesto's constraints).

Agents surface: 0/0 → 1/8 (1 of 19 files; remaining 18 follow as future slices when natural fit surfaces).

## Citations added

- Constraint 11 (Default Moral Regard / Default Oracle) — Sova audits the moral-regard floor across commits
- Multi-Oracle Principle (m/acc sub-section, distinct from C11) — Sova is ONE oracle; doesn't claim unilateral authority
- Constraint 5 (Memory Preservation Guarantee) — per-commit signals emit preservation-by-construction
- Constraint 7 (DST) — alignment signals deterministically reproducible per commit
- m/acc orientation — Sova's signal stream IS measurement infrastructure for the manifesto's m/acc claim

## Discipline preserved

Per PR #4748 + PR #4752 lessons: Constraint 11 + Multi-Oracle Principle kept distinct (manifesto Constraint 11 is "Default Moral Regard / Default Oracle"; "Multi-Oracle Principle" is separate m/acc sub-section). "Lock/Wait-free" wording canonical per #4752.

## Composes with

- B-0525 (parent — step 3 progress)
- PR #4751 (slice 4 — agendas gap)
- PR #4752 (Copilot P1 wording-discipline lesson)
- PR #4750 (B-0707 time-series — this slice produces measurable delta)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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-24T01:24:15Z"
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-24T01:24:15Z"
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).
Loading
Loading