@neriros/ralphy 2.9.3 → 2.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli/index.js +27 -21
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -56407,7 +56407,7 @@ function log(msg) {
56407
56407
  // package.json
56408
56408
  var package_default = {
56409
56409
  name: "@neriros/ralphy",
56410
- version: "2.9.3",
56410
+ version: "2.9.4",
56411
56411
  description: "An iterative AI task execution framework. Orchestrates multi-phase autonomous work using Claude or Codex engines.",
56412
56412
  keywords: [
56413
56413
  "agent",
@@ -70806,22 +70806,28 @@ function nextId() {
70806
70806
  return `${Date.now()}-${lineCounter}`;
70807
70807
  }
70808
70808
  var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
70809
- async function appendSteering(proposalPath, steering) {
70810
- const file = Bun.file(proposalPath);
70811
- const prev = await file.exists() ? await file.text() : "";
70812
- const stamped = `
70813
-
70814
- ### Steering feedback (${new Date().toISOString()})
70809
+ async function injectFixSteering(changeDir, heading, steering) {
70810
+ const steeringFile = Bun.file(join14(changeDir, "steering.md"));
70811
+ const existing = await steeringFile.exists() ? await steeringFile.text() : "";
70812
+ const stamped = `## ${heading} (${new Date().toISOString()})
70815
70813
 
70816
70814
  ${steering}
70817
70815
  `;
70818
- const next = prev.includes("## Steering") ? prev.replace(/## Steering\n+([\s\S]*?)$/, (_m, rest2) => `## Steering
70819
- ${stamped}
70820
- ${rest2}`) : prev + `
70821
- ## Steering
70822
- ${stamped}
70816
+ const nextSteering = existing ? `${stamped}
70817
+ ${existing.trimStart()}` : `${stamped}
70818
+ `;
70819
+ await Bun.write(join14(changeDir, "steering.md"), nextSteering);
70820
+ const tasksFile = Bun.file(join14(changeDir, "tasks.md"));
70821
+ const tasks = await tasksFile.exists() ? await tasksFile.text() : "";
70822
+ const taskSection = `
70823
+ ## ${heading} (${new Date().toISOString()})
70824
+
70825
+ ` + `- [ ] ${heading}. The error output is recorded in steering.md \u2014 read it first, ` + `then fix the underlying problem (do not just retry the failing command).
70823
70826
  `;
70824
- await Bun.write(proposalPath, next);
70827
+ const nextTasks = tasks.endsWith(`
70828
+ `) ? tasks + taskSection : tasks + `
70829
+ ` + taskSection;
70830
+ await Bun.write(join14(changeDir, "tasks.md"), nextTasks);
70825
70831
  }
70826
70832
  function fmtElapsed(ms) {
70827
70833
  const s = Math.floor(ms / 1000);
@@ -71005,13 +71011,13 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
71005
71011
  appendLog(`! createPr requested but no worktree branch is tracked for ${changeName} (use --worktree)`, "yellow");
71006
71012
  effectiveCode = PR_FAILED_EXIT;
71007
71013
  } else {
71008
- const proposalPath = join14(statesDirByChange.get(changeName) ?? statesDir, "..", "..", "openspec", "changes", changeName, "proposal.md");
71014
+ const changeDir = join14(statesDirByChange.get(changeName) ?? statesDir, "..", "..", "openspec", "changes", changeName);
71009
71015
  const maxHookFixAttempts = cfg.maxCiFixAttempts;
71010
- const runWorkerWithSteering = async (steering) => {
71016
+ const runWorkerWithFixSteering = async (heading, steering) => {
71011
71017
  try {
71012
- await appendSteering(proposalPath, steering);
71018
+ await injectFixSteering(changeDir, heading, steering);
71013
71019
  } catch (steerErr) {
71014
- appendLog(`! could not append steering: ${steerErr.message}`, "red");
71020
+ appendLog(`! could not inject steering: ${steerErr.message}`, "red");
71015
71021
  return 1;
71016
71022
  }
71017
71023
  const rp = Bun.spawn({
@@ -71058,7 +71064,7 @@ ${e.stderr ?? ""}`;
71058
71064
  commitFixAttempt += 1;
71059
71065
  appendLog(`! commit rejected for ${changeName} \u2014 feeding error back to worker (attempt ${commitFixAttempt}/${maxHookFixAttempts})`, "yellow");
71060
71066
  appendLog(` detail: ${detail}`, "yellow");
71061
- const retryCode = await runWorkerWithSteering(`Committing residual changes was rejected by the host repo's pre-commit hook. ` + `Fix the underlying problem reported below, then the commit will be retried.
71067
+ const retryCode = await runWorkerWithFixSteering("Fix host pre-commit hook rejection", `Committing residual changes was rejected by the host repo's pre-commit hook. ` + `Fix the underlying problem reported below, then the commit will be retried.
71062
71068
 
71063
71069
  ` + "```\n" + combined.trim() + "\n```");
71064
71070
  if (retryCode !== 0) {
@@ -71096,7 +71102,7 @@ ${e.stderr ?? ""}`;
71096
71102
  pushFixAttempt += 1;
71097
71103
  appendLog(`! push rejected for ${changeName} \u2014 feeding error back to worker (attempt ${pushFixAttempt}/${maxHookFixAttempts})`, "yellow");
71098
71104
  appendLog(` detail: ${detail}`, "yellow");
71099
- const retryCode = await runWorkerWithSteering(`Push to origin/${branch} was rejected by the host repo's pre-push hook. ` + `Fix the underlying problem reported below, then the push will be retried.
71105
+ const retryCode = await runWorkerWithFixSteering("Fix host pre-push hook rejection", `Push to origin/${branch} was rejected by the host repo's pre-push hook. ` + `Fix the underlying problem reported below, then the push will be retried.
71100
71106
 
71101
71107
  ` + "```\n" + combined.trim() + "\n```");
71102
71108
  if (retryCode !== 0) {
@@ -71119,11 +71125,11 @@ ${e.stderr ?? ""}`;
71119
71125
  getFailedLogs: (ids) => fetchFailedRunLogs(ids, bunCmdRunner, cwd2),
71120
71126
  runTaskWithSteering: async (steering) => {
71121
71127
  try {
71122
- await appendSteering(proposalPath, `CI feedback:
71128
+ await injectFixSteering(changeDir, "Fix failing CI checks", `CI feedback:
71123
71129
 
71124
71130
  ${steering}`);
71125
71131
  } catch (err) {
71126
- appendLog(`! could not append steering: ${err.message}`, "red");
71132
+ appendLog(`! could not inject steering: ${err.message}`, "red");
71127
71133
  }
71128
71134
  const p = Bun.spawn({
71129
71135
  cmd: buildTaskCmd(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neriros/ralphy",
3
- "version": "2.9.3",
3
+ "version": "2.9.4",
4
4
  "description": "An iterative AI task execution framework. Orchestrates multi-phase autonomous work using Claude or Codex engines.",
5
5
  "keywords": [
6
6
  "agent",