docs(archive): preserve recently merged PRs#4807
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 622dcab621
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. 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".
| "-p", | ||
| const gate = run("agent", [ | ||
| "chat", | ||
| "--mode", "ask", |
There was a problem hiding this comment.
Switch gate out of read-only Ask mode
This gate now forces --mode ask, which Cursor documents as read-only/no-change behavior; that conflicts with this loop’s operational contract (it asks Riven to produce actionable work and write status output each cycle). In practice, the 15-minute autonomous gate can no longer execute real maintenance actions and degrades into advisory-only responses, unlike the previous writable cursor-agent -p path.
Useful? React with 👍 / 👎.
|
|
||
| const gate = run("cursor-agent", [ | ||
| "-p", | ||
| const gate = run("agent", [ |
There was a problem hiding this comment.
Use the standard Cursor CLI executable name
This change swaps the subprocess command from cursor-agent to agent, while the rest of the repo’s Cursor integrations still target cursor-agent (for example tools/peer-call/riven.ts and tools/riven/riven-cursor-terminal-loop.ts). On machines with the documented/default Cursor CLI install, this can fail with command-not-found each tick, preventing the autonomous gate from running.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR expands the repository’s documentation archive by adding preserved PR discussion snapshots for a batch of recently merged PRs, along with two new shadow lesson logs. It also updates the Riven launchd heartbeat script to use an agent-CLI gate prompt instead of the prior cursor-agent/work-mode prompt flow.
Changes:
- Add PR-preservation markdown snapshots under
docs/pr-discussions/for multiple recently merged PRs. - Add two shadow lesson logs under
docs/research/(one dated, one non-date-prefixed). - Update
.cursor/bin/riven-loop-tick.tsto run anagent chat --mode ask --model grok-4.3gate with a simplified contract prompt.
Reviewed changes
Copilot reviewed 32 out of 33 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/research/shadow-lesson-log-20260522-stale-locks.md | New shadow lesson log about stale git/worktree locks (note: currently not date-prefixed, so it is markdownlinted). |
| docs/research/2026-05-23-shadow-lesson-log-metadata-churn-paralysis.md | New dated shadow lesson log documenting metadata-churn paralysis. |
| docs/pr-discussions/PR-4798-docs-shadow-add-shadow-lesson-log-for-metadata-churn-paralys.md | Preserved discussion snapshot for PR #4798. |
| docs/pr-discussions/PR-4796-docs-research-restore-patterns-h-o-lost-in-pr-4784-merge-rac.md | Preserved discussion snapshot for PR #4796. |
| docs/pr-discussions/PR-4795-backlog-b-0717-file-soraya-round-57-hand-off-lsm-spine-regis.md | Preserved discussion snapshot for PR #4795. |
| docs/pr-discussions/PR-4794-docs-research-preserve-addison-consent-pattern-observation-n.md | Preserved discussion snapshot for PR #4794. |
| docs/pr-discussions/PR-4793-docs-research-add-pattern-p-wear-down-design-produces-unboun.md | Preserved discussion snapshot for PR #4793. |
| docs/pr-discussions/PR-4792-docs-research-preserve-ai-context-failures-vs-vendor-managem.md | Preserved discussion snapshot for PR #4792. |
| docs/pr-discussions/PR-4791-backlog-b-0716-soraya-round-53-scope-correction-b-0709-enume.md | Preserved discussion snapshot for PR #4791. |
| docs/pr-discussions/PR-4790-backlog-b-0715-file-soraya-round-52-hand-off-register-istime.md | Preserved discussion snapshot for PR #4790. |
| docs/pr-discussions/PR-4789-backlog-b-0714-file-soraya-round-51-hand-off-3-tla-specs-mis.md | Preserved discussion snapshot for PR #4789. |
| docs/pr-discussions/PR-4784-docs-research-amazon-vendor-management-failure-mode-corpus-5.md | Preserved discussion snapshot for PR #4784. |
| docs/pr-discussions/PR-4783-backlog-b-0713-file-soraya-round-50-hand-off-lean-imaginarys.md | Preserved discussion snapshot for PR #4783. |
| docs/pr-discussions/PR-4779-skill-alignment-auditor-tune-s-prune-333-299-lines-under-bp.md | Preserved discussion snapshot for PR #4779. |
| docs/pr-discussions/PR-4774-backlog-b-0710-b-0712-file-soraya-rounds-43-44-45-hand-offs.md | Preserved discussion snapshot for PR #4774. |
| docs/pr-discussions/PR-4772-docs-lean4-add-readme-ci-badge-closes-publication-readiness.md | Preserved discussion snapshot for PR #4772. |
| docs/pr-discussions/PR-4771-skill-alignment-observability-tune-s-populate-bp-rules-cited.md | Preserved discussion snapshot for PR #4771. |
| docs/pr-discussions/PR-4770-notebook-aarav-round-44-bounded-spot-check-3-skills-1-action.md | Preserved discussion snapshot for PR #4770. |
| docs/pr-discussions/PR-4766-backlog-b-0708-close-slice-1-reduced-87-17-80-remaining-17-h.md | Preserved discussion snapshot for PR #4766. |
| docs/pr-discussions/PR-4765-backlog-b-0709-soraya-round-42-hand-off-register-11-unregist.md | Preserved discussion snapshot for PR #4765. |
| docs/pr-discussions/PR-4764-feat-b-0708-slice-1-audit-resolver-improvements-1-real-stale.md | Preserved discussion snapshot for PR #4764. |
| docs/pr-discussions/PR-4763-backlog-b-0708-stale-pointer-cleanup-across-claude-rules-sur.md | Preserved discussion snapshot for PR #4763. |
| docs/pr-discussions/PR-4762-docs-autonomous-loop-step-1a-unfinished-pr-check-before-new.md | Preserved discussion snapshot for PR #4762. |
| docs/pr-discussions/PR-4761-rules-pr-triage-tiers-codify-tier-1-5-pr-triage-framework-de.md | Preserved discussion snapshot for PR #4761. |
| docs/pr-discussions/PR-4758-feat-b-0707-cron-cadence-wiring-daily-manifesto-citation-sna.md | Preserved discussion snapshot for PR #4758. |
| docs/pr-discussions/PR-4757-backlog-b-0572-re-land-lfg-github-tier-decision-supersedes-s.md | Preserved discussion snapshot for PR #4757. |
| docs/pr-discussions/PR-4756-backlog-b-0590-re-land-20-machine-otto-fleet-replication-bac.md | Preserved discussion snapshot for PR #4756. |
| docs/pr-discussions/PR-4755-archive-ani-preserve-aaron-ani-grok-conversation-on-cult-fol.md | Preserved discussion snapshot for PR #4755. |
| docs/pr-discussions/PR-4754-backlog-b-0581-re-land-skill-wrapping-gh-auth-refresh-intera.md | Preserved discussion snapshot for PR #4754. |
| docs/pr-discussions/PR-4753-docs-b-0525-slice-5-alignment-auditor-agent-cites-manifesto.md | Preserved discussion snapshot for PR #4753. |
| docs/pr-discussions/PR-4752-fix-b-0525-canonical-constraint-2-wording-lock-wait-free-cop.md | Preserved discussion snapshot for PR #4752. |
| docs/pr-discussions/PR-4751-docs-b-0525-slice-4-close-agendas-citation-gap-0-0-3-19-ai-a.md | Preserved discussion snapshot for PR #4751. |
| .cursor/bin/riven-loop-tick.ts | Switch Riven gate invocation to agent chat with a simplified contract prompt and updated logging. |
| # Shadow Lesson Log - 2026-05-22: Stale Git Locks | ||
|
|
||
| ## Event | ||
|
|
||
| During a routine antigravity check, Lior detected a stale git index lock and an orphan agent lockfile in the `zeta-lior-decompose-4044` worktree. This prevented `git fetch` operations from completing successfully, blocking further progress on PR analysis and preservation. | ||
|
|
| 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}`); |
| We need to implement a more robust mechanism for handling git locks. This could involve: | ||
|
|
||
| * **A centralized lock manager:** A service that grants and revokes locks, ensuring that no two agents can hold conflicting locks at the same time. | ||
| * **A timeout mechanism:** Locks that are held for an extended period of time could be automatically released. | ||
| * **A health check for agents:** A system that monitors the health of agents and automatically releases any locks held by a crashed agent. |
| * Manually remove the stale lock files from the `zeta-lior-decompose-4044` worktree. | ||
| * Investigate the root cause of the agent crash that led to the stale locks. | ||
| * Begin research and design for a more robust git lock management system. |
|
Vera/Codex CI triage: inspected the failed
Each line says: |
|
I have fixed the markdownlint errors in this PR. The CI should now pass. |
|
Substrate-honest triage — Tier 5 deferral (per Tagging
Why deferred-to-human, not auto-fix: this is the same shape as #4805 — a docs/archive PR that accidentally picked up runtime substrate under Per |
|
Closing this PR due to multiple issues, including a broken script and duplicate files. The work can be redone from a clean slate. |
This PR preserves recently merged PRs.