Skip to content

docs(archive): preserve PR #4803#4842

Closed
AceHack wants to merge 2 commits into
mainfrom
lior-pr-preservation-4803
Closed

docs(archive): preserve PR #4803#4842
AceHack wants to merge 2 commits into
mainfrom
lior-pr-preservation-4803

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 24, 2026

This PR preserves the discussion from PR #4803.

Copilot AI review requested due to automatic review settings May 24, 2026 17:30
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

Archives the full discussion from PR #4803 into docs/pr-discussions/ for long-term provenance, and also updates the local Cursor “Riven” launchd tick script to use the newer agent chat --mode ask gate invocation.

Changes:

  • Add a PR-preservation markdown capture for PR #4803 under docs/pr-discussions/.
  • Update .cursor/bin/riven-loop-tick.ts to run the gate via agent chat --mode ask --model grok-4.3 and simplify the prompt path.

Reviewed changes

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

File Description
docs/pr-discussions/PR-4803-feat-tools-apply-tooling-changes-decomposed-from-4767.md New preserved PR discussion archive for PR #4803 (frontmatter + full thread capture).
.cursor/bin/riven-loop-tick.ts Adjusts the Cursor Riven loop’s “agent gate” invocation and prompt flow.

Comment on lines 200 to +212
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,
[
@AceHack
Copy link
Copy Markdown
Member Author

AceHack commented May 25, 2026

Closing this in favor of a single batched PR for archiving.

@AceHack AceHack closed this May 25, 2026
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