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";
Comment on lines 200 to 206
} 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();
}

1 change: 1 addition & 0 deletions docs/backlog/P3/B-0002-otto-287-noether-formalization.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ created: 2026-04-25
last_updated: 2026-05-02
depends_on: []
composes_with: []
children: [B-0002.1, B-0002.2, B-0002.3, B-0002.4]
tags: [otto-287, formal-methods, physics, cognitive-substrate, research-grade, noether]
type: feature
---
Expand Down
21 changes: 21 additions & 0 deletions docs/backlog/P3/B-0002.1-noether-formalization-step1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
id: B-0002.1
priority: P3
status: open
title: "Noether-style formalization Step 1: Define the cognitive action S = ∫ (W - F) dt"
tier: research-grade
effort: M
ask: maintainer Lior 2026-05-24
created: 2026-05-24
last_updated: 2026-05-24
depends_on: [B-0002]
composes_with: []
tags: [otto-287, formal-methods, physics, cognitive-substrate, research-grade, noether]
type: feature
---

# Noether-style formalization Step 1: Define the cognitive action S = ∫ (W - F) dt

This is the first step in the decomposition of B-0002.

Quantify productive work output rate $W$ and friction cost rate $F$ for the factory's collaboration loop. Some are already measurable (CI minutes, decisions queued); some are subjective and need a measurement scheme.
21 changes: 21 additions & 0 deletions docs/backlog/P3/B-0002.2-noether-formalization-step2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
id: B-0002.2
priority: P3
status: open
title: "Noether-style formalization Step 2: Identify continuous symmetries of S"
tier: research-grade
effort: M
ask: maintainer Lior 2026-05-24
created: 2026-05-24
last_updated: 2026-05-24
depends_on: [B-0002.1]
composes_with: []
tags: [otto-287, formal-methods, physics, cognitive-substrate, research-grade, noether]
type: feature
---

# Noether-style formalization Step 2: Identify continuous symmetries of S

This is the second step in the decomposition of B-0002.

Identify continuous symmetries of the cognitive action S. Candidates: time-translation, reader-identity, resource-type. Test each against observed factory behaviour.
21 changes: 21 additions & 0 deletions docs/backlog/P3/B-0002.3-noether-formalization-step3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
id: B-0002.3
priority: P3
status: open
title: "Noether-style formalization Step 3: Derive Noether currents"
tier: research-grade
effort: M
ask: maintainer Lior 2026-05-24
created: 2026-05-24
last_updated: 2026-05-24
depends_on: [B-0002.2]
composes_with: []
tags: [otto-287, formal-methods, physics, cognitive-substrate, research-grade, noether]
type: feature
---

# Noether-style formalization Step 3: Derive Noether currents

This is the third step in the decomposition of B-0002.

For each symmetry, the corresponding conserved quantity. Three candidates: factory-energy, semantic charge, rule-form (Otto-287's externalize-compress-preallocate template).
21 changes: 21 additions & 0 deletions docs/backlog/P3/B-0002.4-noether-formalization-step4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
id: B-0002.4
priority: P3
status: open
title: "Noether-style formalization Step 4: Symmetry-breaking analysis"
tier: research-grade
effort: M
ask: maintainer Lior 2026-05-24
created: 2026-05-24
last_updated: 2026-05-24
depends_on: [B-0002.3]
composes_with: []
tags: [otto-287, formal-methods, physics, cognitive-substrate, research-grade, noether]
type: feature
---

# Noether-style formalization Step 4: Symmetry-breaking analysis

This is the fourth step in the decomposition of B-0002.

Identify enduring modes (memory entries, decision records) as Goldstone-like massless modes from broken symmetries.
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
---
pr_number: 4853
title: "shard(2026-05-24/1902Z): otto-vscode bg-worker \u2014 Lior-lane fleet 38\u219241 PRs + lane discipline re-applied"
author: "AceHack"
state: "MERGED"
created_at: "2026-05-24T19:05:12Z"
merged_at: "2026-05-24T19:35:28Z"
closed_at: "2026-05-24T19:35:28Z"
head_ref: "otto-vscode/tick-1902z-bg-worker"
base_ref: "main"
archived_at: "2026-05-24T20:17:52Z"
archive_tool: "tools/pr-preservation/archive-pr.ts"
---

# PR #4853: shard(2026-05-24/1902Z): otto-vscode bg-worker — Lior-lane fleet 38→41 PRs + lane discipline re-applied

## PR description

## Summary

Bg-worker tick shard documenting Lior-lane fleet extension 38→41 PRs (~58 min since [1804Z](docs/hygiene-history/ticks/2026/05/24/1804Z.md)) with no `origin/main` commits in the window.

## State observed at 1902Z

- 41 open PRs, **41/41 = 100% Lior-lane** (sustained from 1804Z)
- otto-vscode own-lane: **0 PRs** (bg-worker prompt's "30 PRs" target empty in own lane)
- 3 new since 1804Z (#4850, #4851, #4852) — continuation of `lior-decompose-4828-*` cluster
- #4852 touches `.cursor/bin/riven-loop-tick.ts` — runtime-script special-case per [`backlog-item-start-gate.md`](.claude/rules/backlog-item-start-gate.md) guard
- `origin/main` HEAD `27d114290` unchanged since 1804Z; 0 commits in 60min window
- ls-tree HEAD = 55 (no canary corruption)

## Substrate discipline applied

Per [`agent-roster-reference-card.md`](.claude/rules/agent-roster-reference-card.md) lane discipline + [`pr-triage-tiers.md`](.claude/rules/pr-triage-tiers.md) Tier 5 + [`no-directives.md`](.claude/rules/no-directives.md) + [`mechanical-authorization-check.md`](.claude/rules/mechanical-authorization-check.md): bg-worker task prompt does NOT override standing lane discipline. Cross-lane auto-resolution on runtime-script-touching PRs would regress Riven tuning; operator-authored armed PRs (#4801/#4802/#4803) cannot be unilaterally overridden.

Counter-reset condition #3 (concrete artifact) satisfied per [`holding-without-named-dependency-is-standing-by-failure.md`](.claude/rules/holding-without-named-dependency-is-standing-by-failure.md).

## Test plan

- [x] sentinel re-armed at cold-boot (`7e6df89b`)
- [x] isolated worktree authored shard (post-creation freshness check: ls-tree=55, status=0)
- [x] post-commit canary check: parent tree 55, HEAD tree 55
- [x] push verified via `git ls-remote` (08724f0b on remote matches local)
- [x] composes-with chain referenced (1608Z → 1804Z → this)

## Reviews

### COMMENTED — @copilot-pull-request-reviewer (2026-05-24T19:06:54Z)

## Pull request overview

Adds a new hygiene-history tick shard documenting the 2026-05-24 1902Z background-worker observation (Lior-lane PR fleet growth 38→41, no `origin/main` movement, and re-confirmed lane discipline / non-auto-resolution stance for runtime-script-touching PRs).

**Changes:**
- Introduces a new tick entry (`1902Z.md`) with updated fleet counts, PR triage notes, and cross-links to relevant rules and prior ticks.
- Records the current operational state (rate limits, processes, `origin/main` head, ls-tree baseline) and composes-with lineage for future ticks.

### COMMENTED — @copilot-pull-request-reviewer (2026-05-24T19:30:37Z)

## Pull request overview

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

### COMMENTED — @AceHack (2026-05-24T19:34:49Z)

_(no body)_

### COMMENTED — @AceHack (2026-05-24T19:34:50Z)

_(no body)_

### COMMENTED — @AceHack (2026-05-24T19:34:51Z)

_(no body)_

### COMMENTED — @AceHack (2026-05-24T19:34:52Z)

_(no body)_

### COMMENTED — @AceHack (2026-05-24T19:34:53Z)

_(no body)_

## Review threads

### Thread 1: docs/hygiene-history/ticks/2026/05/24/1902Z.md:22 (resolved)

**@copilot-pull-request-reviewer** (2026-05-24T19:06:53Z):

The markdown table header/rows here start with `||` (double pipe), which introduces an unintended empty first column and differs from the single-pipe table formatting used in the other tick shards (e.g., 1608Z/1804Z). Switch these lines to the standard `| ... | ... |` form so the table renders as intended on GitHub.

**@AceHack** (2026-05-24T19:34:49Z):

Verified false-positive per `.claude/rules/blocked-green-ci-investigate-threads.md` table-double-pipe FP-class catalog. Direct `awk -v N=<line>` inspection of the file shows single-leading-pipe table rows (`| col | col |`), NOT double-pipe (`|| col | col |`). The reviewer claim is the canonical FP shape; resolved no-op.

### Thread 2: docs/hygiene-history/ticks/2026/05/24/1902Z.md:39 (resolved)

**@copilot-pull-request-reviewer** (2026-05-24T19:06:54Z):

This PR triage table also uses `||` at the start of each row, which will render with an extra blank column. Use the same single-leading-pipe table style as the other tick files to keep formatting consistent and readable.

**@AceHack** (2026-05-24T19:34:50Z):

Verified false-positive per `.claude/rules/blocked-green-ci-investigate-threads.md` table-double-pipe FP-class catalog. Direct `awk -v N=<line>` inspection of the file shows single-leading-pipe table rows (`| col | col |`), NOT double-pipe (`|| col | col |`). The reviewer claim is the canonical FP shape; resolved no-op.

### Thread 3: docs/hygiene-history/ticks/2026/05/24/1902Z.md:29 (resolved)

**@copilot-pull-request-reviewer** (2026-05-24T19:30:36Z):

The markdown table syntax here has an extra leading `|` (`|| ...`), which renders an unintended empty first column in GitHub Markdown. Match the table format used in earlier ticks (e.g., 1804Z) by using a single leading pipe on each row (`| Surface | Reading |`, `|---|---|`, etc.).

**@AceHack** (2026-05-24T19:34:51Z):

Verified false-positive per `.claude/rules/blocked-green-ci-investigate-threads.md` table-double-pipe FP-class catalog. Direct `awk -v N=<line>` inspection of the file shows single-leading-pipe table rows (`| col | col |`), NOT double-pipe (`|| col | col |`). The reviewer claim is the canonical FP shape; resolved no-op.

### Thread 4: docs/hygiene-history/ticks/2026/05/24/1902Z.md:40 (resolved)

**@copilot-pull-request-reviewer** (2026-05-24T19:30:37Z):

This PR table also uses `||` at the start of each row, creating an unintended empty column. Use the standard GFM table format (`| PR | Branch | Pattern |` and `|---|---|---|`) as in other tick shards to avoid rendering issues.

**@AceHack** (2026-05-24T19:34:52Z):

Verified false-positive per `.claude/rules/blocked-green-ci-investigate-threads.md` table-double-pipe FP-class catalog. Direct `awk -v N=<line>` inspection of the file shows single-leading-pipe table rows (`| col | col |`), NOT double-pipe (`|| col | col |`). The reviewer claim is the canonical FP shape; resolved no-op.

### Thread 5: docs/hygiene-history/ticks/2026/05/24/1902Z.md:55 (resolved)

**@copilot-pull-request-reviewer** (2026-05-24T19:30:37Z):

Several references are written as shortcut-style links like [`agent-roster-reference-card.md`] / [`pr-triage-tiers.md`] / [`no-directives.md`] but there are no reference definitions in this file, so these will render as plain bracketed text (broken links). Use explicit inline links with the correct relative paths (as done in 1804Z.md) or add reference definitions at the bottom.

**@AceHack** (2026-05-24T19:34:53Z):

Fixed in commit d24af5d1d on this branch — converted all 13 shortcut-style `[`file.md`]` references to explicit inline links `[`file.md`](../../../../../../.claude/rules/file.md)` following the existing convention used on line 52 + the sibling 1804Z.md shard. Per `.claude/rules/blocked-green-ci-investigate-threads.md` verify-before-fix: direct inspection confirmed the reviewer claim. Thank you for the catch.
Loading
Loading