diff --git a/.cursor/bin/riven-loop-tick.ts b/.cursor/bin/riven-loop-tick.ts index 25e891a23..a7b7a8eb1 100644 --- a/.cursor/bin/riven-loop-tick.ts +++ b/.cursor/bin/riven-loop-tick.ts @@ -198,22 +198,59 @@ 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 agent gate start run_id=${runId}`); + log(`riven work cycle start run_id=${runId} mode=${workMode} open_prs=${prNum}`); if (dryRun) { - log(`dry-run: would run agent gate`); + log(`dry-run: would run riven ${workMode}`); agentStatus = "dry-run"; } else { - const gate = run("agent", [ - "chat", - "--mode", "ask", - "--model", "grok-4-20", - `Twin-flame heartbeat gate (Riven adversarial-truth-axis). Read git status, recent commits, open PRs, claim branches. Report: main HEAD, open PR count, claim count, any drift, contradiction, or theatrical governance. Adversarial register — call out what's wrong, not what's fine. Brief.`, + 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 Riven's 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 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(" "); + } + + const gate = run("cursor-agent", [ + "-p", + "--model", "grok-4.3", + prompt, ], agentTimeoutMs); agentStatus = gate.status === 0 ? "ok" : `exit-${gate.status}`; - log(`riven agent gate end run_id=${runId} status=${gate.status}`); + log(`riven work cycle end run_id=${runId} mode=${workMode} status=${gate.status}`); writeFileSync(agentStateFile, JSON.stringify({ run_id: runId, diff --git a/docs/pr-discussions/PR-4639-trajectory-ace-package-manager-full-13-stage-pipeline-symmet.md b/docs/pr-discussions/PR-4639-trajectory-ace-package-manager-full-13-stage-pipeline-symmet.md new file mode 100644 index 000000000..79670ef92 --- /dev/null +++ b/docs/pr-discussions/PR-4639-trajectory-ace-package-manager-full-13-stage-pipeline-symmet.md @@ -0,0 +1,58 @@ +--- +pr_number: 4639 +title: "trajectory(ace-package-manager): full 13-stage pipeline + symmetric-decentralized framing (operator-self-claimed agenda extension)" +author: "AceHack" +state: "MERGED" +created_at: "2026-05-22T17:32:30Z" +merged_at: "2026-05-22T17:33:43Z" +closed_at: "2026-05-22T17:33:43Z" +head_ref: "otto/cli-2018z-ace-trajectory-full-pipeline-crystallization-riff-sieve-map-refine-build-generate-encapsulate-distribute-grow-negotiate-2026-05-22" +base_ref: "main" +archived_at: "2026-05-22T20:03:54Z" +archive_tool: "tools/pr-preservation/archive-pr.ts" +--- + +# PR #4639: trajectory(ace-package-manager): full 13-stage pipeline + symmetric-decentralized framing (operator-self-claimed agenda extension) + +## PR description + +Operator instructions 2026-05-22: full pipeline crystallization 'riff->seive->map->refine->build->generate->encupslate (open closed principle to DST memetic time crystals)->distribute->grow->negotiage changes is the whole ace pipeline i think' + 'add all three (shadow*)' for verify/revoke/discover candidates + 'Yes all those should be moving twards a symmetric frame where ace package manger is not centralized an that's everyones pipeine just just ours'. + +13-stage Ace pipeline complete: riff → sieve → map → refine → build → generate → encapsulate (OCP→DST→memetic time crystals) → distribute → discover → verify → grow → revoke/quarantine → negotiate changes. Discover + verify are user-side complements to producer-side sieve; revoke is reactive complement to voluntary-retire-via-negotiate-changes. + +Symmetric-decentralized frame extends Zeta-vs-Agora anti-imperialist distinction (PR #4637) to Ace specifically: Ace pipeline = PATTERN anyone deploys; operator's instance = one INSTANCE of many possible; multi-Ace-deployment future first-class; NCI HC-8 floor preserved at infrastructure scope. + +Co-Authored-By: Claude + +## Reviews + +### COMMENTED — @copilot-pull-request-reviewer (2026-05-22T17:36:14Z) + +## Pull request overview + +Adds a more complete “Ace package manager” trajectory specification by expanding the pipeline to 13 stages and documenting a symmetric/decentralized framing (pipeline-as-pattern, deployment-as-instance) within the `docs/trajectories/` substrate. + +**Changes:** +- Adds a “FULL Ace pipeline crystallization” section with a 10-stage base pipeline plus three additional user-side/reactive stages (discover/verify/revoke). +- Adds a “SYMMETRIC / DECENTRALIZED FRAME” section clarifying that the Ace pipeline is a reusable pattern rather than a centralized service. +- Extends operational implications guidance for future cold-boots (do-not-collapse constraints). + +## Review threads + +### Thread 1: docs/trajectories/ace-package-manager-skill-crystallization-pipeline/RESUME.md:63 (unresolved) + +**@copilot-pull-request-reviewer** (2026-05-22T17:36:13Z): + +P1: Stage 8 (Distribute) currently lists `ace verify` and `ace list`, but those actions are defined later as Discover/Verify sub-stages (8b/8c). This makes the pipeline description internally inconsistent; keep Distribute focused on shipping/installing, and let Discover/Verify own list/verify. + +### Thread 2: docs/trajectories/ace-package-manager-skill-crystallization-pipeline/RESUME.md:116 (unresolved) + +**@copilot-pull-request-reviewer** (2026-05-22T17:36:13Z): + +P1: `god-tier-claims-don't-collapse.md` is referenced as if it were a file, but there is no such file in the repo (the corresponding rule file is `.claude/rules/god-tier-claims-high-signal-high-suspicion-dont-collapse.md`). Using the canonical path avoids a dead/ambiguous xref for future readers. + +### Thread 3: docs/trajectories/ace-package-manager-skill-crystallization-pipeline/RESUME.md:59 (unresolved) + +**@copilot-pull-request-reviewer** (2026-05-22T17:36:13Z): + +P2: Trajectory docs are current-state surfaces, and repo convention is to use role-refs rather than personal names outside the explicitly enumerated history surfaces (see `.github/copilot-instructions.md` around lines 305-366). This row uses a personal name; please switch to a role-ref here (and also at line 142 where the same name appears).