@niscorp/signal 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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @niscorp/signal
2
2
 
3
+ ## 0.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 6776f2d: A reply missing only its closing brace comes back whole, not as a piece of itself.
8
+
9
+ The repair ladder tried `extract` before `close-truncated`. On `{"reasoning":"…","data":{"rows":[…]}` — complete but for the last `}` — `extract` found the `rows` array inside it, and any acceptance schema that admits arrays (Cortex's does) took that array as the answer. Cortex then rejected it as not an envelope, and the model was asked again, up to its output-retry limit. The ladder now closes a cut-off reply before it looks for JSON inside it, so the whole object arrives at `wire.rung: 'close-truncated'`.
10
+
11
+ Only a reply that opens with `{` or `[` and is left unclosed takes a different path. A complete reply, a fenced or prose-wrapped one, and tool-call arguments go through the ladder as before.
12
+
13
+ **What to change:** nothing.
14
+
3
15
  ## 0.1.5
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1176,6 +1176,11 @@ function* ladder(text, strategies) {
1176
1176
  if (trimmed.length === 0) return;
1177
1177
  const direct = tryParse2(trimmed);
1178
1178
  if (direct.ok) yield { value: direct.value, rung: "parse" };
1179
+ const closed = closeTruncated(trimmed);
1180
+ if (closed !== void 0) {
1181
+ const parsed = tryParse2(closed);
1182
+ if (parsed.ok) yield { value: parsed.value, rung: "close-truncated" };
1183
+ }
1179
1184
  const extracted = extractJson(trimmed);
1180
1185
  if (extracted.ok) yield { value: extracted.value, rung: "extract" };
1181
1186
  for (const repaired of repairEscapeDamage(trimmed)) {
@@ -1188,11 +1193,6 @@ function* ladder(text, strategies) {
1188
1193
  if (parsed.ok) yield { value: parsed.value, rung: strategy.id };
1189
1194
  }
1190
1195
  }
1191
- const closed = closeTruncated(trimmed);
1192
- if (closed !== void 0) {
1193
- const parsed = tryParse2(closed);
1194
- if (parsed.ok) yield { value: parsed.value, rung: "close-truncated" };
1195
- }
1196
1196
  }
1197
1197
  var firstAccepted = (candidates, accept) => {
1198
1198
  let nearMiss;