backpass 0.1.5 → 0.1.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backpass",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "packageManager": "pnpm@11.5.0",
5
5
  "description": "Gradient descent for your agent memory - analyzes past agent session transcripts and proposes evidence-backed edits to AGENTS.md / CLAUDE.md",
6
6
  "type": "module",
@@ -78,7 +78,12 @@ export function parseDecisions(text, editIds) {
78
78
  }
79
79
 
80
80
  export async function openApplySurface(file) {
81
- const result = await runLavish([file]);
81
+ // `backpass apply` is itself the human asking for the review surface, so a session the
82
+ // reviewer ended from the browser in an earlier run has to be reopened, not refused.
83
+ // lavish-axi keys sessions by file path and `ended_by: "user"` is sticky, so without
84
+ // `--reopen` it exits 0 and prints the dead session's URL - which apply would then hand
85
+ // the reviewer as if it were live. On a live or agent-ended session the flag is a no-op.
86
+ const result = await runLavish([file, "--reopen", "--no-open"]);
82
87
  if (result.spawnError && result.spawnError.code === "ENOENT") {
83
88
  throw new UserError(
84
89
  `${LAVISH_BIN} not found on PATH`,
@@ -133,7 +138,13 @@ export async function pollDecisions(file, editIds, { delayMs = POLL_RETRY_DELAY_
133
138
  const decisions = parseDecisions(text, editIds);
134
139
  if (decisions) return decisions;
135
140
 
136
- if (/session\s+(ended|closed)/i.test(text)) {
141
+ // lavish-axi reports an end through the session fields, never in prose: `status: ended`
142
+ // when nothing was queued, `session_ended: true` alongside the final `status: feedback`.
143
+ // Scope these fields to the leading session metadata block so field-like feedback or
144
+ // diagnostics cannot end the wait. parseDecisions has already run, so a `Send & End`
145
+ // carrying a vector still applies.
146
+ const session = /^session:\s*\r?\n((?:[ \t]+[^\r\n]*(?:\r?\n|$))*)/m.exec(text)?.[1] || "";
147
+ if (/^\s*status:\s*ended\b/m.test(session) || /^\s*session_ended:\s*true\b/m.test(session)) {
137
148
  warn("review session ended without a decision vector - nothing applied");
138
149
  return null;
139
150
  }