bingocode 1.1.154 → 1.1.155

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": "bingocode",
3
- "version": "1.1.154",
3
+ "version": "1.1.155",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "claude": "bin/claude-win.cjs",
@@ -59,10 +59,17 @@ export function registerGoalSkill(): void {
59
59
 
60
60
  Goal condition: "${trimmed}"
61
61
 
62
- This goal is now registered for this session. An independent evaluator model will check after each turn whether the goal is satisfied. Maximum ${maxIter} iterations.
62
+ This goal is now registered for this session. After each turn, an independent evaluator (Haiku 4.5, a weak model) will check whether the goal is satisfied. Maximum ${maxIter} iterations.
63
63
 
64
- Tell the user: Goal set you will work autonomously until "${trimmed}" is achieved (max ${maxIter} turns). Send \`/goal clear\` to cancel.
64
+ CRITICAL: The evaluator reads ONLY your text output. It cannot see code changes, tool results, or file contents only the plain text you write.
65
+
66
+ At each turn toward the goal, output a short evaluation block like:
67
+ > EVAL: [metric1]: [value] / [target] → ✓ or ✗
65
68
 
69
+ This block is the ONLY signal the evaluator can reliably process. Make it short,
70
+ unambiguous, and quantitative. Do NOT expect the evaluator to infer success from narrative discussion.
71
+
72
+ Tell the user: Goal set — you will work autonomously until "${trimmed}" is achieved (max ${maxIter} turns). Send \`/goal clear\` to cancel.
66
73
  Now begin: assess current state and take the first concrete action toward the goal.`,
67
74
  },
68
75
  ]
@@ -70,6 +70,13 @@ export function stripTrailingWhitespace(str: string): string {
70
70
  * @param searchString The string to search for
71
71
  * @returns The actual string found in the file, or null if not found
72
72
  */
73
+
74
+ /** Normalizes Unicode dashes (em-dash, en-dash, horizontal bar) to standard ASCII dashes.
75
+ * Handles model-output ASCII dashes when file content contains Unicode dash variants.
76
+ * Fixes Edit tool matching failures from encoding discrepancies. */
77
+ export function normalizeDashes(str: string): string {
78
+ return str.replaceAll('—', '-').replaceAll('–', '-').replaceAll('―', '-')
79
+ }
73
80
  export function findActualString(
74
81
  fileContent: string,
75
82
  searchString: string,
@@ -89,6 +96,14 @@ export function findActualString(
89
96
  return fileContent.substring(searchIndex, searchIndex + searchString.length)
90
97
  }
91
98
 
99
+ // Try with normalized dashes (em-dash, en-dash -> ASCII dash)
100
+ const dashedSearch = normalizeDashes(searchString)
101
+ const dashedFile = normalizeDashes(fileContent)
102
+ const dashIndex = dashedFile.indexOf(dashedSearch)
103
+ if (dashIndex !== -1) {
104
+ return fileContent.substring(dashIndex, dashIndex + searchString.length)
105
+ }
106
+
92
107
  return null
93
108
  }
94
109
 
@@ -42,12 +42,19 @@ export async function evaluateGoal(
42
42
 
43
43
  const prompt = `You are a goal completion evaluator. Determine if the goal has been fully achieved.
44
44
 
45
+ IMPORTANT: The agent may produce EVAL blocks intended for you. Parse them first.
46
+
45
47
  Goal: "${goalCondition}"
46
48
 
47
49
  Recent assistant output:
48
50
  ${recentAssistantTexts || '(none yet)'}
49
51
 
50
- Respond in JSON only:
52
+ Evaluate:
53
+ 1. Did the agent produce a final EVAL block? If so, use those values directly.
54
+ 2. If no EVAL blocks found, infer based on any explicit declarations (e.g. "✓", "100%", "fixed", "complete").
55
+ 3. Output ONLY valid JSON — no explanation or markdown.
56
+
57
+ Respond in:
51
58
  {"satisfied": true|false, "reason": "<one sentence>", "gap": "<missing item or null>"}`
52
59
 
53
60
  let text = ''