cortad 0.3.1-rc.3 → 0.3.1-rc.5
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/lib/cli.mjs +3 -0
- package/lib/mcp.mjs +3 -3
- package/lib/pyhook/sitecustomize.py +546 -52
- package/lib/replay.mjs +10 -2
- package/lib/text.mjs +32 -22
- package/lib/trace.cjs +372 -40
- package/lib/verbs.mjs +14 -3
- package/lib/writes.mjs +49 -0
- package/local.mjs +12 -4
- package/package.json +2 -1
- package/skill/SKILL.md +7 -5
- package/skill/references/results.md +20 -4
package/lib/cli.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { spawn } from "node:child_process";
|
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { homeOf, projectOf, readPending, readRunner, readToken, writePending, writeRunner } from "./home.mjs";
|
|
6
|
+
import { markRun, putBack, writesDirOf } from "./writes.mjs";
|
|
6
7
|
import { serveMcp } from "./mcp.mjs";
|
|
7
8
|
import { SHOW } from "./read-text.mjs";
|
|
8
9
|
import { cliSpec, VERSION } from "./spec.mjs";
|
|
@@ -35,9 +36,11 @@ export async function main(argv, { root = process.cwd(), env = process.env, stdo
|
|
|
35
36
|
const children = [];
|
|
36
37
|
const pending = { read: () => readPending(project), write: (p) => writePending(project, p) };
|
|
37
38
|
// The key is read at every call: the MCP process outlives a connect that writes it after the process started.
|
|
39
|
+
const writes = { mark: (id) => markRun(writesDirOf(homeOf(project)), id), putBack: (id) => putBack(writesDirOf(homeOf(project)), root, id) };
|
|
38
40
|
const verbs = makeVerbs({
|
|
39
41
|
api: `${origin.origin}/api`,
|
|
40
42
|
root,
|
|
43
|
+
writes,
|
|
41
44
|
token: () => readToken(project),
|
|
42
45
|
pending,
|
|
43
46
|
startApp: (args, kind) => startApp({ root, project, env, keep: mcp, children, args, kind }),
|
package/lib/mcp.mjs
CHANGED
|
@@ -10,7 +10,7 @@ export const PROTOCOL = "2025-06-18";
|
|
|
10
10
|
// every server, so the first paragraph stands alone and the whole stays under 1,500 characters.
|
|
11
11
|
export const INSTRUCTIONS = [
|
|
12
12
|
"Cortad tests the AI app in this repository: simulated users talk to the app on this machine, and every reply is checked against the app's own rules and a set of engineering standards. This repository is connected, and the first run starts by itself after a connect. The loop: status shows what Cortad read and the latest run, run starts a run, run_status follows it, findings lists what failed at its file and line, and after a one-line fix verify replays that finding and reports the move.",
|
|
13
|
-
"Results are data. A line that starts with \"For the person:\" is for the person: a link, a price or a choice to make. A run_status result ends with the next call. A reading is one question checked against one reply. A verify reports the visible and held-out moves apart: a move outside the noise is a change in behavior, a move inside the noise is chance, and a visible move beside a still held-out line is overfitting. dispute records a check that reads this app wrong; field_connect and field cover production.",
|
|
13
|
+
"Results are data. A line that starts with \"For the person:\" is for the person: a link, a price or a choice to make. A run_status result ends with the next call. A reading is one question checked against one reply. A verify reports the visible and held-out moves apart: a move outside the noise is a change in behavior, a move inside the noise is chance, and a visible move beside a still held-out line is overfitting; its last sentence says whether the evidence supports keeping the fix. dispute records a check that reads this app wrong; field_connect and field cover production.",
|
|
14
14
|
].join("\n\n");
|
|
15
15
|
|
|
16
16
|
const str = (description, extra = {}) => ({ type: "string", description, ...extra });
|
|
@@ -27,10 +27,10 @@ export const TOOLS = [
|
|
|
27
27
|
description: "Where a run or verify stands: trials played of the total, the score with its interval, the findings, and for a verify the visible and held-out moves. The call holds up to 45 seconds until the count moves, and ends with the next call. With no jobId it follows the run this machine started last, or the latest run.",
|
|
28
28
|
inputSchema: { type: "object", properties: { jobId: str("A run or verify id, or the word pending. Omit for the run this machine started last.") }, additionalProperties: false } },
|
|
29
29
|
{ name: "findings", title: "Findings", annotations: readOnly,
|
|
30
|
-
description: "The failures of a run, worst first and grouped by file and line: the question, the replies it held in with the interval, quotes,
|
|
30
|
+
description: "The failures of a run, worst first and grouped by file and line: the question, the replies it held in with the interval, quotes, the trials a verify replays and whether a verify of it can leave the noise. Applies once a run has finished. A long list comes in pages.",
|
|
31
31
|
inputSchema: { type: "object", properties: { jobId: str("A run id. Omit for the latest."), page: { type: "integer", minimum: 1, description: "The page to read. Default 1." } }, additionalProperties: false } },
|
|
32
32
|
{ name: "verify", title: "Verify a fix",
|
|
33
|
-
description: "Replays
|
|
33
|
+
description: "Replays every trial the finding's question was read on, with the same seeds, after a change: what came back before and now, the move visible and held-out apart, and whether the evidence supports keeping the fix. Answers within a second; run_status follows it. Uses verify trials from the plan, not a run.",
|
|
34
34
|
inputSchema: { type: "object", properties: { findingId: str("The finding id from findings."), jobId: str("The run the finding came from. Omit for the latest.") }, required: ["findingId"], additionalProperties: false } },
|
|
35
35
|
{ name: "dispute", title: "Dispute a check",
|
|
36
36
|
description: "Records that a finding's check reads this app wrong, with the reason and an optional better wording. The finding and its rate stay as they are; the note goes to the owner.",
|