@agentsfleet/orly 0.12.0 → 0.13.0
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/README.md +24 -16
- package/audits/deinit-pairs.sh +1 -1
- package/audits/design-tokens.sh +1 -1
- package/audits/error-codes.sh +1 -1
- package/audits/logging.sh +1 -1
- package/audits/rust-error.sh +1 -1
- package/audits/scope.sh +9 -1
- package/audits/sql-mod.sh +1 -1
- package/audits/ufs.sh +1 -1
- package/dispatch/lib.sh +1 -1
- package/docs/CHANGELOG.md +21 -1
- package/docs/JUDGMENTS.md +4 -3
- package/docs/ORLY_ARCHITECTURE.md +7 -0
- package/docs/REST_API_DESIGN_GUIDELINES.md +12 -3
- package/llms.txt +13 -5
- package/package.json +1 -1
- package/skills/orly-babysit-prs/SKILL.md +19 -4
- package/src/judgment_comparison.test.ts +138 -0
- package/src/judgment_comparison_controls.test.ts +81 -0
- package/src/judgment_comparison_jev.integration.test.ts +134 -0
- package/src/judgment_comparison_jev_consumer.test.ts +144 -0
- package/src/judgment_comparison_jev_report.test.ts +167 -0
- package/src/judgment_labels.test.ts +119 -0
- package/src/judgment_score.test.ts +166 -0
- package/src/judgment_tasks.test.ts +164 -0
- package/src/judgment_tasks_findings.test.ts +76 -0
- package/src/judgment_tasks_recovery.test.ts +119 -0
- package/src/judgments/transport.ts +2 -2
- package/src/judgments/types.ts +1 -0
- package/src/judgments/wire.ts +2 -2
- package/src/review_poll.test.ts +28 -4
- package/src/scanner_snapshot.test.ts +82 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { afterEach, expect, test } from "bun:test";
|
|
2
|
+
import { mkdirSync, readdirSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
|
|
5
|
+
import { cleanupTemporaryDirectories, git, newRepository, ROOT, temporaryDirectory } from "./gates_test_support";
|
|
6
|
+
import { UNSCOPED_ENVIRONMENT } from "./git_env";
|
|
7
|
+
|
|
8
|
+
const SCOPED_AUDITS = ["ufs.sh", "logging.sh", "rust-error.sh", "deinit-pairs.sh", "sql-mod.sh", "design-tokens.sh"];
|
|
9
|
+
const SOURCE = "lib/odd 'quoted.ts";
|
|
10
|
+
const CLEAN = "export const MESSAGE = 'staged';\n";
|
|
11
|
+
const BAD = 'export function first() { return "duplicate value"; }\nexport function second() { return "duplicate value"; }\n';
|
|
12
|
+
const CHECKOUT = "checkout-index";
|
|
13
|
+
const TIMEOUT_MS = 30_000;
|
|
14
|
+
const TOOL_MODE = 0o755;
|
|
15
|
+
|
|
16
|
+
afterEach(cleanupTemporaryDirectories);
|
|
17
|
+
|
|
18
|
+
async function runScan(project: string, leaf: string, failPreflight = false) {
|
|
19
|
+
const tools = temporaryDirectory();
|
|
20
|
+
const scratch = temporaryDirectory();
|
|
21
|
+
const calls = join(tools, "calls.jsonl");
|
|
22
|
+
const realGit = Bun.which("git")!;
|
|
23
|
+
mkdirSync(join(tools, "bin"));
|
|
24
|
+
writeFileSync(join(tools, "bin/git"), `#!${process.execPath}
|
|
25
|
+
const args = Bun.argv.slice(2);
|
|
26
|
+
const file = Bun.file(process.env.SNAPSHOT_CALLS);
|
|
27
|
+
await Bun.write(file, (await file.exists() ? await file.text() : "") + JSON.stringify(args) + "\\n");
|
|
28
|
+
if (process.env.FAIL_PREFLIGHT === "1" && args.includes("--quiet")) process.exit(2);
|
|
29
|
+
const result = Bun.spawnSync([process.env.REAL_GIT, ...args], { stdin: "inherit", stdout: "inherit", stderr: "inherit" });
|
|
30
|
+
process.exit(result.exitCode);
|
|
31
|
+
`, { mode: TOOL_MODE });
|
|
32
|
+
const result = Bun.spawnSync(["/bin/bash", join(ROOT, "audits", leaf), "--staged"], {
|
|
33
|
+
cwd: project, env: { ...UNSCOPED_ENVIRONMENT, PATH: `${join(tools, "bin")}:${process.env.PATH}`, TMPDIR: scratch,
|
|
34
|
+
SNAPSHOT_CALLS: calls, REAL_GIT: realGit, FAIL_PREFLIGHT: failPreflight ? "1" : "0" },
|
|
35
|
+
stdout: "pipe", stderr: "pipe", timeout: TIMEOUT_MS,
|
|
36
|
+
});
|
|
37
|
+
const commands: string[][] = (await Bun.file(calls).text()).trim().split("\n").map((line) => JSON.parse(line));
|
|
38
|
+
return { code: result.exitCode, output: result.stdout.toString() + result.stderr.toString(),
|
|
39
|
+
checkouts: commands.filter((args) => args[0] === CHECKOUT).length, leftovers: readdirSync(scratch) };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
test.each(SCOPED_AUDITS)("%s skips repository checkout for a documentation-only index", async (leaf) => {
|
|
43
|
+
const project = newRepository();
|
|
44
|
+
await Bun.write(join(project, "README.md"), "Changed documentation.\n");
|
|
45
|
+
git(project, "add", "README.md");
|
|
46
|
+
const result = await runScan(project, leaf);
|
|
47
|
+
expect(result.code, result.output).toBe(0);
|
|
48
|
+
expect(result.checkouts).toBe(0);
|
|
49
|
+
expect(result.leftovers).toEqual([]);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test.each([true, false])("relevant source snapshot checks staged bytes with violation %s", async (badIndex) => {
|
|
53
|
+
const project = newRepository();
|
|
54
|
+
await Bun.write(join(project, SOURCE), badIndex ? BAD : CLEAN);
|
|
55
|
+
git(project, "add", SOURCE);
|
|
56
|
+
await Bun.write(join(project, SOURCE), badIndex ? CLEAN : BAD);
|
|
57
|
+
const result = await runScan(project, "ufs.sh");
|
|
58
|
+
expect(result.code, result.output).toBe(badIndex ? 1 : 0);
|
|
59
|
+
expect(result.checkouts).toBe(1);
|
|
60
|
+
expect(result.leftovers).toEqual([]);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test("a failed staged filename query refuses instead of reporting an empty scope", async () => {
|
|
64
|
+
const project = newRepository();
|
|
65
|
+
const result = await runScan(project, "ufs.sh", true);
|
|
66
|
+
expect(result.code).toBe(2);
|
|
67
|
+
expect(result.output).toContain("cannot select staged audit files");
|
|
68
|
+
expect(result.checkouts).toBe(0);
|
|
69
|
+
expect(result.leftovers).toEqual([]);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
test("a deleted source path needs no repository checkout", async () => {
|
|
73
|
+
const project = newRepository();
|
|
74
|
+
await Bun.write(join(project, SOURCE), CLEAN);
|
|
75
|
+
git(project, "add", SOURCE);
|
|
76
|
+
git(project, "commit", "-qm", "test: seed source");
|
|
77
|
+
git(project, "rm", SOURCE);
|
|
78
|
+
const result = await runScan(project, "ufs.sh");
|
|
79
|
+
expect(result.code, result.output).toBe(0);
|
|
80
|
+
expect(result.checkouts).toBe(0);
|
|
81
|
+
expect(result.leftovers).toEqual([]);
|
|
82
|
+
});
|