@miraland-labs/conduit-bridge 0.16.148 → 0.16.149
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/dist/ensure-test-evidence.js +35 -5
- package/package.json +1 -1
|
@@ -232,18 +232,49 @@ const TAIL_HEAD_CHARS = 200;
|
|
|
232
232
|
*
|
|
233
233
|
* Returns the input unchanged when it already fits, so nothing short is ever decorated.
|
|
234
234
|
*/
|
|
235
|
-
export function boundedDetailLines(lines, maxLines) {
|
|
235
|
+
export function boundedDetailLines(lines, maxLines, identifiers = []) {
|
|
236
236
|
if (lines.length <= maxLines)
|
|
237
237
|
return lines;
|
|
238
238
|
const head = Math.min(3, Math.max(0, maxLines - 2));
|
|
239
239
|
const tail = maxLines - head - 1;
|
|
240
|
-
const
|
|
240
|
+
const middle = lines.slice(head, lines.length - tail);
|
|
241
|
+
// A criterion such as "its output shows privileged_wallet_holds_the_plan_without_payment as ok"
|
|
242
|
+
// is proved by one line in the middle of a long suite, and a reviewer must not infer it from the
|
|
243
|
+
// summary. So the lines that name an identifier the criteria name are kept too, in run order. The
|
|
244
|
+
// cap keeps a broad identifier that matches every line from storing the whole run.
|
|
245
|
+
const named = identifiers.length === 0
|
|
246
|
+
? []
|
|
247
|
+
: [...new Set(middle.filter((line) => identifiers.some((id) => line.includes(id))))]
|
|
248
|
+
.slice(0, NAMED_DETAIL_LINES_MAX)
|
|
249
|
+
.map((line) => (line.length > 500 ? `${line.slice(0, 500)}…` : line));
|
|
250
|
+
const dropped = middle.length - named.length;
|
|
241
251
|
return [
|
|
242
252
|
...lines.slice(0, head),
|
|
243
253
|
`… ${dropped} line${dropped === 1 ? "" : "s"} omitted …`,
|
|
254
|
+
...named,
|
|
244
255
|
...lines.slice(lines.length - tail),
|
|
245
256
|
];
|
|
246
257
|
}
|
|
258
|
+
const NAMED_DETAIL_LINES_MAX = 40;
|
|
259
|
+
/**
|
|
260
|
+
* The test and symbol names the acceptance criteria name: every backticked string, and every
|
|
261
|
+
* snake_case, camelCase, dotted or `::` token of at least 8 characters. An ordinary English word has
|
|
262
|
+
* none of `_`, `::`, `.` or an inner capital, so it never counts.
|
|
263
|
+
*/
|
|
264
|
+
function criterionIdentifiers(acceptance) {
|
|
265
|
+
const found = new Set();
|
|
266
|
+
for (const criterion of acceptance) {
|
|
267
|
+
for (const match of criterion.matchAll(/`([^`]+)`/g)) {
|
|
268
|
+
if (match[1].trim())
|
|
269
|
+
found.add(match[1].trim());
|
|
270
|
+
}
|
|
271
|
+
for (const [token] of criterion.matchAll(/[A-Za-z_][A-Za-z0-9_]*(?:(?:::|\.)[A-Za-z_][A-Za-z0-9_]*)*/g)) {
|
|
272
|
+
if (token.length >= 8 && /_|::|\.|[a-z0-9][A-Z]/.test(token))
|
|
273
|
+
found.add(token);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return [...found];
|
|
277
|
+
}
|
|
247
278
|
/**
|
|
248
279
|
* Shorten a raw diagnostic message while keeping the end.
|
|
249
280
|
*
|
|
@@ -593,11 +624,10 @@ export async function ensureTestEvidence(input) {
|
|
|
593
624
|
}
|
|
594
625
|
const rawDetails = [
|
|
595
626
|
`$ ${command}`,
|
|
596
|
-
...
|
|
597
|
-
...stderrLines,
|
|
627
|
+
...outputLines(result),
|
|
598
628
|
`exit ${result.code}`,
|
|
599
629
|
].map((line) => line.slice(0, 4_000));
|
|
600
|
-
const details = boundedDetailLines(rawDetails, 100);
|
|
630
|
+
const details = boundedDetailLines(rawDetails, 100, criterionIdentifiers(acceptance));
|
|
601
631
|
if (details.join("\n").trim().length < TEST_EVIDENCE_DETAILS_MIN) {
|
|
602
632
|
throw new Error(`Agent report: Verification produced insufficient output for test evidence (${command})`);
|
|
603
633
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miraland-labs/conduit-bridge",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.149",
|
|
4
4
|
"description": "Conduit Bridge CLI \u2014 join, connect, disconnect, multi-driver lanes, and run Claude Code / Codex / Cursor / OpenCode / Pi / Kiro / Antigravity / Grok Build agents for a Conduit organization",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|