Skip to content

docs(archive): Lior preserves PR #4639#4679

Closed
AceHack wants to merge 3 commits into
mainfrom
lior-preserve-4639
Closed

docs(archive): Lior preserves PR #4639#4679
AceHack wants to merge 3 commits into
mainfrom
lior-preserve-4639

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 22, 2026

This is a decomposed PR from #4673. It contains only the PR preservation changes.

AceHack and others added 3 commits May 21, 2026 18:23
- Switch model to grok-4.3 (valid identifier)
- Replace weak status-reporting prompt with full trajectory-manager contract:
  - Read broadcasts first
  - Decompose only mid-stride
  - Produce concrete claim or small PR scope
  - Create specific research children when blocked
  - Write status to broadcast at end

This removes the mechanical blocker causing forward ticks to skip due to dirty tree.

Co-Authored-By: Grok <noreply@x.ai>
Copilot AI review requested due to automatic review settings May 22, 2026 21:19
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9b36aa8481

ℹ️ 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".

Comment on lines +201 to +202
const prNum = Number(prCount) || 0;
const workMode = prNum === 0 ? "pickup" : "drain";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Treat unknown PR count as drain mode, not pickup

This mode switch assumes prCount is always numeric, but prCount is derived from gh pr list output and upstream failures leave it as "?"; Number(prCount) || 0 then coerces that to 0 and forces pickup mode. In that failure path, the loop can start new backlog work while open PRs still need draining, which regresses the intended "drain existing PRs first" behavior under transient GitHub/auth/network errors.

Useful? React with 👍 / 👎.

Comment on lines +246 to 250
const gate = run("cursor-agent", [
"-p",
"--model", "grok-4.3",
prompt,
], agentTimeoutMs);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Increase agent timeout for full work-cycle prompts

The loop now asks the agent to perform heavyweight end-to-end actions (refresh worldview, run release build, inspect PR gates, fix code, push, resolve threads, arm auto-merge), but still executes the command with the same agentTimeoutMs default (300s). That timeout was tolerable for the old short "gate" prompt but is often too short for these new tasks, causing non-zero exits/timeouts before completion and repeated partial cycles instead of finishing a PR drain.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a PR-discussion preservation record for PR #4639 under docs/pr-discussions/, and also updates the Cursor “Riven” launchd heartbeat script to choose between a “pickup” vs “drain” work cycle and to invoke cursor-agent with newly constructed prompts.

Changes:

  • Adds an archived PR discussion markdown file for PR #4639 (frontmatter + preserved review threads).
  • Updates .cursor/bin/riven-loop-tick.ts to compute a work mode from open PR count and run either backlog pickup or PR-drain instructions via cursor-agent.
  • Expands logging around the agent work cycle.

Reviewed changes

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

File Description
docs/pr-discussions/PR-4639-trajectory-ace-package-manager-full-13-stage-pipeline-symmet.md Adds PR #4639 preservation artifact (frontmatter + preserved review content).
.cursor/bin/riven-loop-tick.ts Changes heartbeat agent execution into pickup/drain modes and switches invocation to cursor-agent with new prompts/logging.

Comment on lines +201 to +204
const prNum = Number(prCount) || 0;
const workMode = prNum === 0 ? "pickup" : "drain";
agentStatus = "running";
log(`riven agent gate start run_id=${runId}`);
log(`riven work cycle start run_id=${runId} mode=${workMode} open_prs=${prNum}`);
Comment on lines +201 to 203
const prNum = Number(prCount) || 0;
const workMode = prNum === 0 ? "pickup" : "drain";
agentStatus = "running";
: `${preamble} No backlog items available. Run refresh-worldview, check for stale classifications, fix them, open a PR.`;
} else {
prompt = [
`You are Riven's background worker in Lucent-Financial-Group/Zeta.`,
Comment on lines +234 to +243
prompt = [
`You are Riven's 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(" ");
@AceHack
Copy link
Copy Markdown
Member Author

AceHack commented May 22, 2026

This PR is a blob, mixing documentation and code changes. I have decomposed it into two separate PRs: #4682 (docs) and #4683 (code). Closing this PR in favor of the new ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants