cortad 0.3.1-rc.6 → 0.3.1-rc.7

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/lib/text.mjs +25 -0
  2. package/package.json +1 -1
package/lib/text.mjs CHANGED
@@ -144,6 +144,17 @@ const moveText = (m) => `held ${kn(m.before)} readings before, ${kn(m.after)} af
144
144
  // Over zero pairs there is no move to print: the line says verification is unavailable and why,
145
145
  // never "no change, 0 points" measured on nothing. The visible side's reason is the said line.
146
146
  function verifyLines(v) {
147
+ // An access verify is a re-knock, not a trial move: the routes side by side, then the count.
148
+ if (v.access) {
149
+ const lines = [`Verify of ${v.findingId}.`];
150
+ for (const r of v.routes ?? []) {
151
+ const then = r.wasOpen ? `answered ${r.before} with no sign-in` : `refused (${r.before || "no answer"})`;
152
+ const now = r.nowOpen ? `answers ${r.after} with no sign-in` : r.after ? `refuses (${r.after})` : "did not answer";
153
+ lines.push(` ${r.method} ${r.route}: ${then}, now ${now}.`);
154
+ }
155
+ if (v.said) lines.push(v.said);
156
+ return lines;
157
+ }
147
158
  const lines = [`Verify of ${v.findingId}${v.path ? ` at ${at(v.path, v.line)}` : ""}.`];
148
159
  if (v.visible && !v.visible.unavailable) lines.push(`Visible trials: ${moveText(v.visible)}`);
149
160
  if (v.holdout?.unavailable) lines.push(`Held-out trials: verification unavailable: ${v.holdout.unavailable}.`);
@@ -233,6 +244,9 @@ function findingsHead(d) {
233
244
  if (reads) lines.push(reads);
234
245
  if (d.baseRunId) lines.push(`Compared with run ${d.baseRunId}.`);
235
246
  for (const s of [d.read, d.heldBack, d.findings?.length ? null : d.why]) if (s) lines.push(s);
247
+ // A finding in a situation the run keeps back: what failed and where, so the rule can be fixed;
248
+ // its inputs and trials stay unseen, and verify replays it all the same.
249
+ for (const k of d.keptBack ?? []) lines.push(`Kept back ${k.id}: "${clip(k.asks, 160)}"${k.file ? ` at ${at(k.file, k.line)}` : ""}, held ${kn(k.rate)} at reply ${num(k.reply)}${k.quote ? `; the reply said "${clip(k.quote, 120)}"` : ""}. Its inputs are not shown; verify ${k.id} replays them.`);
236
250
  return lines.join("\n");
237
251
  }
238
252
 
@@ -271,6 +285,17 @@ function findingsPages(d, budget = PAGE_CHARS - 60) {
271
285
  }
272
286
 
273
287
  function findingBlock(f, placed) {
288
+ // A gate the run knocked open: the route, the address, the request sent and the status it answered
289
+ // with no sign-in. Its own words, then how to prove the fix.
290
+ if (f.kind === "access-open") {
291
+ const lines = [`${f.id} ${f.says}`];
292
+ if (f.path) lines.push(` At ${at(f.path, f.line)}`);
293
+ if (f.standard) lines.push(` Standard: ${clip(f.standard, 200)}`);
294
+ lines.push(` Sent: ${f.request.method} ${f.request.path}${f.request.body ? ` ${clip(f.request.body, 200)}` : ""}${f.as === "another-user" ? " as another user" : " with no sign-in"}`);
295
+ lines.push(` Answered: ${f.status}${has(f.response) && f.response ? `, ${clip(f.response, 400)}` : ""}`);
296
+ lines.push(` Replay: verify ${f.id}`);
297
+ return lines.join("\n");
298
+ }
274
299
  const lines = [`${f.id} ${f.asks}`];
275
300
  if (!placed && f.file) lines.push(` At ${at(f.file, f.line)}`);
276
301
  if (f.criteria) lines.push(` Criteria: ${clip(f.criteria, 600)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortad",
3
- "version": "0.3.1-rc.6",
3
+ "version": "0.3.1-rc.7",
4
4
  "description": "Connects the AI app on your machine to Cortad for test conversations, and gives your coding agent the MCP and skill to run them. No dependencies.",
5
5
  "bin": {
6
6
  "cortad": "local.mjs"