mirror of
https://github.com/different-ai/openwork.git
synced 2026-11-23 12:51:42 +08:00
fix(evals): standalone evals pnpm workspace + CodeQL fixes + probe-tls diagnosability (fix-forward for #3304 red checks) (#3310)
* fix(evals): isolate workspace and address red checks * fix(evals): evals workspace inherits supply-chain policy (minimumReleaseAge 4320) + esbuild build approval * fix(evals): separate TLS handshake and chain facts * fix(evals): complete HTML entity escaping in mock IdP; substring assertions instead of tag regex * fix(evals): classify TLS certificate failures safely * fix(evals): escape mock IdP HTML via a single character-class replace * docs(evals): document the standalone eval workspace, packages, and spec lane * fix(evals): regenerate root lockfile without eval importers after rebase
This commit is contained in:
28 files changed
+1460
-775
No files matched your search
@@ -117,6 +117,9 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Install eval workspace
|
||||
run: pnpm --dir evals install --frozen-lockfile
|
||||
|
||||
- name: Run app unit tests
|
||||
run: pnpm --filter @openwork/app test
|
||||
|
||||
|
||||
@@ -63,6 +63,9 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Install eval workspace
|
||||
run: pnpm --dir evals install --frozen-lockfile
|
||||
|
||||
- name: Install Xvfb
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
|
||||
@@ -35,6 +35,41 @@ pnpm evals --all --cdp-url http://127.0.0.1:9825 # explicit CDP endpoint
|
||||
unnarrated frames render without a warning. `pnpm fraimz` is demo mode: it keeps
|
||||
the voice-over drift check and narrated-frame warnings described below.
|
||||
|
||||
## Composable packages + spec lane
|
||||
|
||||
`evals/` is its own **standalone pnpm workspace** (`evals/pnpm-workspace.yaml`)
|
||||
so eval tooling can never affect product installs or image builds. Install it
|
||||
separately:
|
||||
|
||||
```bash
|
||||
pnpm --dir evals install # required once (and in CI) before the commands below
|
||||
pnpm --dir evals run test # node:test unit tests (runner + packages)
|
||||
pnpm --dir evals run spec # vitest spec lane, pr project
|
||||
pnpm --dir evals run spec:nightly # includes *.slow.test.ts
|
||||
```
|
||||
|
||||
The layers live in [`packages/`](./packages) and are consumable independently of
|
||||
the runner:
|
||||
|
||||
| Package | Owns |
|
||||
| --- | --- |
|
||||
| `@openwork/cdp` | raw CDP client, targets, `Surface`, `attachSurface` |
|
||||
| `@openwork/labs` | egress / idp / release-feed / mock-mcp — `start*(config) → handle` with `stop()` + `Symbol.asyncDispose` |
|
||||
| `@openwork/hosts` | local + daytona hosts, `resolveHost()` |
|
||||
| `@openwork/behaviors` | framework-free actions/observations over narrow handles; return facts, never record evidence |
|
||||
| `@openwork/matchers` | pure functions over facts (`diagnoseTls`, …) — testable with fabricated facts, no I/O |
|
||||
| `@openwork/fraimz` | frame capture + annotation channel |
|
||||
|
||||
Specs in [`specs/`](./specs) are plain vitest tests: acquire resources with
|
||||
`await using`, drive them with behaviors, assert with matchers. Because behaviors
|
||||
take handles rather than a framework context, the same calls run outside any test
|
||||
— see [`scripts/diagnose.mts`](./scripts/diagnose.mts), which imports only
|
||||
`@openwork/behaviors` + `@openwork/matchers` and points them at a real endpoint:
|
||||
|
||||
```bash
|
||||
node evals/scripts/diagnose.mts https://den.customer.example
|
||||
```
|
||||
|
||||
### fraimz — the deliverable
|
||||
|
||||
Every run writes **`fraimz.html`** to `evals/results/<run-id>/`: the
|
||||
|
||||
+8
-1
@@ -2,6 +2,12 @@
|
||||
"name": "@openwork/evals",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"spec": "vitest run --config vitest.config.ts --project pr",
|
||||
"spec:nightly": "vitest run --config vitest.config.ts",
|
||||
"test": "node --test runner/*.test.ts packages/*/test/*.test.ts",
|
||||
"typecheck": "tsc -p ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@openwork/behaviors": "workspace:*",
|
||||
"@openwork/cdp": "workspace:*",
|
||||
@@ -12,5 +18,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"vitest": "^3.2.4"
|
||||
}
|
||||
},
|
||||
"packageManager": "pnpm@11.4.0"
|
||||
}
|
||||
@@ -8,6 +8,12 @@ export type DenFetchResult = { response: Response; body: unknown; text: string }
|
||||
|
||||
const REPO_ROOT = fileURLToPath(new URL("../../../..", import.meta.url));
|
||||
|
||||
function trimTrailingSlashes(value: string): string {
|
||||
let end = value.length;
|
||||
while (end > 0 && value[end - 1] === "/") end -= 1;
|
||||
return value.slice(0, end);
|
||||
}
|
||||
|
||||
function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
return typeof value === "object" && value !== null && !Array.isArray(value);
|
||||
}
|
||||
@@ -29,7 +35,7 @@ export async function denFetch(den: DenRef, path: string, init: RequestInit = {}
|
||||
const headers = new Headers(init.headers);
|
||||
if (!headers.has("content-type")) headers.set("content-type", "application/json");
|
||||
if (!headers.has("origin")) headers.set("origin", den.webUrl);
|
||||
const response = await fetch(`${den.apiUrl.replace(/\/+$/, "")}${path}`, { ...init, headers });
|
||||
const response = await fetch(`${trimTrailingSlashes(den.apiUrl)}${path}`, { ...init, headers });
|
||||
const text = await response.text();
|
||||
let body: unknown = text;
|
||||
try {
|
||||
|
||||
@@ -9,6 +9,12 @@ function messageText(error: unknown): string {
|
||||
return error instanceof Error ? error.message : String(error);
|
||||
}
|
||||
|
||||
function jsValue(value: unknown): string {
|
||||
const json = JSON.stringify(value);
|
||||
if (json === undefined) throw new Error("Cannot interpolate an undefined JavaScript value.");
|
||||
return json.replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
||||
}
|
||||
|
||||
export async function evalIn(app: Surface, expression: string, opts: EvaluateOptions = {}): Promise<unknown> {
|
||||
return evaluate(app.client, expression, opts);
|
||||
}
|
||||
@@ -34,14 +40,14 @@ export async function waitFor(
|
||||
}
|
||||
|
||||
export async function waitForText(app: Surface, text: string, opts: { timeoutMs?: number } = {}): Promise<void> {
|
||||
await waitFor(app, `document.body.innerText.includes(${JSON.stringify(text)})`, {
|
||||
await waitFor(app, `document.body.innerText.includes(${jsValue(text)})`, {
|
||||
timeoutMs: opts.timeoutMs,
|
||||
label: `visible text ${JSON.stringify(text)}`,
|
||||
label: `visible text ${jsValue(text)}`,
|
||||
});
|
||||
}
|
||||
|
||||
export async function hasText(app: Surface, text: string): Promise<boolean> {
|
||||
return Boolean(await evalIn(app, `document.body.innerText.includes(${JSON.stringify(text)})`));
|
||||
return Boolean(await evalIn(app, `document.body.innerText.includes(${jsValue(text)})`));
|
||||
}
|
||||
|
||||
export async function visibleText(app: Surface): Promise<string> {
|
||||
@@ -56,29 +62,29 @@ export async function clickText(
|
||||
{ selector = "button, [role=button], a", timeoutMs = DEFAULT_TIMEOUT_MS }: { selector?: string; timeoutMs?: number } = {},
|
||||
): Promise<unknown> {
|
||||
return waitFor(app, `(() => {
|
||||
const candidates = document.querySelectorAll(${JSON.stringify(selector)});
|
||||
const candidates = document.querySelectorAll(${jsValue(selector)});
|
||||
for (const element of candidates) {
|
||||
const label = (element.textContent ?? '').trim();
|
||||
if (label.includes(${JSON.stringify(text)})) {
|
||||
if (label.includes(${jsValue(text)})) {
|
||||
element.scrollIntoView({ block: 'center' });
|
||||
element.click();
|
||||
return label;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
})()`, { timeoutMs, label: `clickable element with text ${JSON.stringify(text)}` });
|
||||
})()`, { timeoutMs, label: `clickable element with text ${jsValue(text)}` });
|
||||
}
|
||||
|
||||
export async function clickButton(app: Surface, label: string, opts: { timeoutMs?: number } = {}): Promise<void> {
|
||||
const timeoutMs = opts.timeoutMs ?? 30_000;
|
||||
await waitFor(app, `Boolean([...document.querySelectorAll('button')]
|
||||
.find((element) => (element.textContent ?? '').trim() === ${JSON.stringify(label)} && !element.disabled))`, {
|
||||
.find((element) => (element.textContent ?? '').trim() === ${jsValue(label)} && !element.disabled))`, {
|
||||
timeoutMs,
|
||||
label: `enabled button: ${label}`,
|
||||
});
|
||||
const clicked = await evalIn(app, `(() => {
|
||||
const button = [...document.querySelectorAll('button')]
|
||||
.find((element) => (element.textContent ?? '').trim() === ${JSON.stringify(label)} && !element.disabled);
|
||||
.find((element) => (element.textContent ?? '').trim() === ${jsValue(label)} && !element.disabled);
|
||||
button?.scrollIntoView({ block: 'center' });
|
||||
button?.click();
|
||||
return Boolean(button);
|
||||
@@ -88,24 +94,24 @@ export async function clickButton(app: Surface, label: string, opts: { timeoutMs
|
||||
|
||||
export async function waitForButtonGone(app: Surface, label: string, opts: { timeoutMs?: number } = {}): Promise<void> {
|
||||
await waitFor(app, `!Boolean([...document.querySelectorAll('button')]
|
||||
.find((element) => (element.textContent ?? '').trim() === ${JSON.stringify(label)}))`, {
|
||||
.find((element) => (element.textContent ?? '').trim() === ${jsValue(label)}))`, {
|
||||
timeoutMs: opts.timeoutMs ?? 90_000,
|
||||
label: `button removed: ${label}`,
|
||||
});
|
||||
}
|
||||
|
||||
export async function fill(app: Surface, selector: string, value: string, opts: { timeoutMs?: number } = {}): Promise<void> {
|
||||
await waitFor(app, `Boolean(document.querySelector(${JSON.stringify(selector)}))`, {
|
||||
await waitFor(app, `Boolean(document.querySelector(${jsValue(selector)}))`, {
|
||||
timeoutMs: opts.timeoutMs,
|
||||
label: `input ${selector}`,
|
||||
});
|
||||
await evalIn(app, `(() => {
|
||||
const input = document.querySelector(${JSON.stringify(selector)});
|
||||
const input = document.querySelector(${jsValue(selector)});
|
||||
const setter = Object.getOwnPropertyDescriptor(
|
||||
input instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLInputElement.prototype,
|
||||
'value',
|
||||
).set;
|
||||
setter.call(input, ${JSON.stringify(value)});
|
||||
setter.call(input, ${jsValue(value)});
|
||||
input.dispatchEvent(new Event('input', { bubbles: true }));
|
||||
input.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
return true;
|
||||
@@ -114,7 +120,7 @@ export async function fill(app: Surface, selector: string, value: string, opts:
|
||||
|
||||
export async function go(app: Surface, hashPath: string): Promise<void> {
|
||||
const hash = hashPath.startsWith("#") ? hashPath : `#${hashPath}`;
|
||||
await evalIn(app, `(() => { window.location.hash = ${JSON.stringify(hash)}; return true; })()`);
|
||||
await evalIn(app, `(() => { window.location.hash = ${jsValue(hash)}; return true; })()`);
|
||||
}
|
||||
|
||||
export async function currentHash(app: Surface): Promise<string> {
|
||||
|
||||
@@ -6,7 +6,9 @@ import type { DetailedPeerCertificate } from "node:tls";
|
||||
|
||||
import { parseClientHelloVersions } from "@openwork/labs";
|
||||
import type { ClientHelloParseResult, EgressLabHandle, EgressLabProfile } from "@openwork/labs";
|
||||
import type { TlsFacts, TlsProbeFacts } from "@openwork/matchers";
|
||||
import type { TlsFacts, TlsVersionFacts } from "@openwork/matchers";
|
||||
|
||||
export type { TlsFacts, TlsVersionFacts } from "@openwork/matchers";
|
||||
|
||||
export type DiagnosticVerdict = {
|
||||
profile: EgressLabProfile;
|
||||
@@ -74,6 +76,7 @@ type TlsAttempt = {
|
||||
} | {
|
||||
ok: false;
|
||||
errorCode: string | null;
|
||||
certificate: DetailedPeerCertificate | null;
|
||||
};
|
||||
|
||||
const REPO_ROOT = fileURLToPath(new URL("../../../..", import.meta.url));
|
||||
@@ -212,7 +215,7 @@ const socket = tls.connect({
|
||||
servername: "localhost",
|
||||
minVersion: "TLSv1.2",
|
||||
maxVersion: "TLSv1.2",
|
||||
rejectUnauthorized: false,
|
||||
rejectUnauthorized: true,
|
||||
});
|
||||
socket.on("error", () => undefined);
|
||||
socket.setTimeout(1000, () => socket.destroy());
|
||||
@@ -544,18 +547,36 @@ function endpointForTransport(lab: EgressLabHandle): URL {
|
||||
return url;
|
||||
}
|
||||
|
||||
// These errors prove the TLS handshake reached certificate verification.
|
||||
const CERTIFICATE_VERIFICATION_ERROR_CODES = new Set([
|
||||
"UNABLE_TO_GET_ISSUER_CERT",
|
||||
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
||||
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
||||
"CERT_HAS_EXPIRED",
|
||||
"CERT_NOT_YET_VALID",
|
||||
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
||||
"SELF_SIGNED_CERT_IN_CHAIN",
|
||||
"CERT_UNTRUSTED",
|
||||
"CERT_REVOKED",
|
||||
"CERT_SIGNATURE_FAILURE",
|
||||
"INVALID_CA",
|
||||
"UNABLE_TO_GET_CRL",
|
||||
"HOSTNAME_MISMATCH",
|
||||
"ERR_TLS_CERT_ALTNAME_INVALID",
|
||||
]);
|
||||
|
||||
function probeTlsVersion(
|
||||
target: { host: string; port: number; servername?: string; ca?: string | string[]; rejectUnauthorized?: boolean },
|
||||
version: "TLSv1.2" | "TLSv1.3",
|
||||
timeoutMs: number,
|
||||
): Promise<TlsProbeFacts> {
|
||||
): Promise<TlsVersionFacts> {
|
||||
return new Promise((resolve) => {
|
||||
let settled = false;
|
||||
const finish = (result: Omit<TlsProbeFacts, "stalled">) => {
|
||||
const finish = (result: TlsVersionFacts) => {
|
||||
if (settled) return;
|
||||
settled = true;
|
||||
socket.destroy();
|
||||
resolve({ ...result, stalled: result.errorCode === "ETIMEDOUT" });
|
||||
resolve(result);
|
||||
};
|
||||
const socket = tls.connect({
|
||||
host: target.host,
|
||||
@@ -566,11 +587,28 @@ function probeTlsVersion(
|
||||
ca: target.ca,
|
||||
rejectUnauthorized: target.rejectUnauthorized ?? true,
|
||||
});
|
||||
socket.once("secureConnect", () => finish({ ok: true, protocol: socket.getProtocol(), errorCode: null }));
|
||||
socket.once("timeout", () => finish({ ok: false, protocol: null, errorCode: "ETIMEDOUT" }));
|
||||
socket.once("secureConnect", () => {
|
||||
const chainVerified = socket.authorized === true;
|
||||
const authorizationError = socket.authorizationError;
|
||||
const authorizationCode = isRecord(authorizationError) && typeof authorizationError.code === "string"
|
||||
? authorizationError.code
|
||||
: String(authorizationError ?? "unauthorized");
|
||||
finish({
|
||||
handshakeOk: true,
|
||||
chainVerified,
|
||||
protocol: socket.getProtocol(),
|
||||
errorCode: chainVerified ? null : authorizationCode,
|
||||
stalled: false,
|
||||
});
|
||||
});
|
||||
socket.once("timeout", () => finish({ handshakeOk: false, chainVerified: false, protocol: null, errorCode: "ETIMEDOUT", stalled: true }));
|
||||
socket.once("error", (error) => {
|
||||
const code = isRecord(error) && typeof error.code === "string" ? error.code : messageText(error);
|
||||
finish({ ok: false, protocol: null, errorCode: code });
|
||||
if (CERTIFICATE_VERIFICATION_ERROR_CODES.has(code)) {
|
||||
finish({ handshakeOk: true, chainVerified: false, protocol: socket.getProtocol() ?? null, errorCode: code, stalled: false });
|
||||
return;
|
||||
}
|
||||
finish({ handshakeOk: false, chainVerified: false, protocol: null, errorCode: code, stalled: false });
|
||||
});
|
||||
socket.setTimeout(timeoutMs);
|
||||
});
|
||||
@@ -623,7 +661,7 @@ function tlsErrorCode(error: unknown): string | null {
|
||||
return String(error);
|
||||
}
|
||||
|
||||
function connectTransport(input: { url: URL; ca: string | undefined; rejectUnauthorized: boolean; inspect: boolean; timeoutMs: number }): Promise<TlsAttempt> {
|
||||
function connectTransport(input: { url: URL; ca: string | undefined; inspect: boolean; timeoutMs: number }): Promise<TlsAttempt> {
|
||||
return new Promise((resolve) => {
|
||||
let settled = false;
|
||||
const socket = tls.connect({
|
||||
@@ -631,7 +669,7 @@ function connectTransport(input: { url: URL; ca: string | undefined; rejectUnaut
|
||||
port: Number(input.url.port) || 443,
|
||||
servername: input.url.hostname,
|
||||
ca: input.ca,
|
||||
rejectUnauthorized: input.rejectUnauthorized,
|
||||
rejectUnauthorized: true,
|
||||
ALPNProtocols: ["http/1.1"],
|
||||
});
|
||||
const finish = (attempt: TlsAttempt) => {
|
||||
@@ -644,8 +682,11 @@ function connectTransport(input: { url: URL; ca: string | undefined; rejectUnaut
|
||||
const certificate = input.inspect ? socket.getPeerCertificate(true) : null;
|
||||
finish({ ok: true, certificate });
|
||||
});
|
||||
socket.once("timeout", () => finish({ ok: false, errorCode: "ETIMEDOUT" }));
|
||||
socket.once("error", (error) => finish({ ok: false, errorCode: tlsErrorCode(error) }));
|
||||
socket.once("timeout", () => finish({ ok: false, errorCode: "ETIMEDOUT", certificate: null }));
|
||||
socket.once("error", (error) => {
|
||||
const certificate = input.inspect ? socket.getPeerCertificate(true) : null;
|
||||
finish({ ok: false, errorCode: tlsErrorCode(error), certificate });
|
||||
});
|
||||
socket.setTimeout(input.timeoutMs);
|
||||
});
|
||||
}
|
||||
@@ -676,10 +717,9 @@ function servedChainFromCertificate(certificate: DetailedPeerCertificate | null)
|
||||
|
||||
async function probeTransport(lab: EgressLabHandle, ca: string | undefined): Promise<TransportProbe> {
|
||||
const url = endpointForTransport(lab);
|
||||
const verified = await connectTransport({ url, ca, rejectUnauthorized: true, inspect: false, timeoutMs: 1500 });
|
||||
const verified = await connectTransport({ url, ca, inspect: true, timeoutMs: 1500 });
|
||||
if (verified.ok) return { verifiedHandshake: "ok", verifyErrorCode: null, servedChain: [], servedChainLength: null };
|
||||
const chainAttempt = await connectTransport({ url, ca: undefined, rejectUnauthorized: false, inspect: true, timeoutMs: 1500 });
|
||||
const servedChain = chainAttempt.ok ? servedChainFromCertificate(chainAttempt.certificate) : [];
|
||||
const servedChain = servedChainFromCertificate(verified.certificate);
|
||||
return {
|
||||
verifiedHandshake: "failed",
|
||||
verifyErrorCode: verified.errorCode,
|
||||
|
||||
@@ -19,9 +19,16 @@ test("probeTls and diagnoseTls identify a TLS 1.3-only stall without the eval fr
|
||||
rejectUnauthorized: false,
|
||||
});
|
||||
|
||||
assert.equal(facts.tls12.ok, true, JSON.stringify(facts));
|
||||
assert.equal(facts.tls12.protocol, "TLSv1.2");
|
||||
assert.equal(facts.tls13.stalled, true);
|
||||
assert.equal(facts.tls13.errorCode, "ETIMEDOUT");
|
||||
assert.equal(diagnoseTls(facts).code, "tls_handshake_stall_tls13_only");
|
||||
const message = JSON.stringify(facts);
|
||||
assert.equal(facts.tls12.handshakeOk, true, message);
|
||||
assert.equal(facts.tls12.stalled, false, message);
|
||||
if (facts.tls12.chainVerified) {
|
||||
assert.equal(facts.tls12.protocol, "TLSv1.2", message);
|
||||
} else {
|
||||
assert.equal(facts.tls12.protocol === null || facts.tls12.protocol === "TLSv1.2", true, message);
|
||||
}
|
||||
assert.equal(facts.tls13.stalled, true, message);
|
||||
assert.equal(facts.tls13.errorCode, "ETIMEDOUT", message);
|
||||
assert.equal(diagnoseTls(facts).code, "tls_handshake_stall_tls13_only", message);
|
||||
// Lab-PKI chain trust is covered by the pure matcher tests (the tls_chain_untrusted branch) and the product-diagnostics spec; it is deliberately not asserted here because it varies with the runner's OpenSSL.
|
||||
});
|
||||
@@ -7,7 +7,9 @@ const POLL_INTERVAL_MS = 250;
|
||||
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||
|
||||
function cleanBaseUrl(cdpBaseUrl: string): string {
|
||||
return cdpBaseUrl.replace(/\/+$/, "");
|
||||
let end = cdpBaseUrl.length;
|
||||
while (end > 0 && cdpBaseUrl[end - 1] === "/") end -= 1;
|
||||
return cdpBaseUrl.slice(0, end);
|
||||
}
|
||||
|
||||
function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
|
||||
@@ -151,7 +151,29 @@ function shellExport(assignments: Map<string, string>): string {
|
||||
}
|
||||
|
||||
function sanitizeName(name: string): string {
|
||||
return name.trim().replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "surface";
|
||||
const normalized: string[] = [];
|
||||
let invalidRun = false;
|
||||
for (const character of name.trim()) {
|
||||
const code = character.codePointAt(0) ?? 0;
|
||||
const allowed = (code >= 48 && code <= 57)
|
||||
|| (code >= 65 && code <= 90)
|
||||
|| (code >= 97 && code <= 122)
|
||||
|| character === "."
|
||||
|| character === "_"
|
||||
|| character === "-";
|
||||
if (allowed) {
|
||||
normalized.push(character);
|
||||
invalidRun = false;
|
||||
} else if (!invalidRun) {
|
||||
normalized.push("-");
|
||||
invalidRun = true;
|
||||
}
|
||||
}
|
||||
let start = 0;
|
||||
let end = normalized.length;
|
||||
while (start < end && normalized[start] === "-") start += 1;
|
||||
while (end > start && normalized[end - 1] === "-") end -= 1;
|
||||
return normalized.slice(start, end).join("") || "surface";
|
||||
}
|
||||
|
||||
function timestamp(): string {
|
||||
|
||||
@@ -101,6 +101,8 @@ export type OpenSslCommandInput = {
|
||||
corporateIssuer: boolean;
|
||||
};
|
||||
|
||||
export type OpenSslFlavor = "openssl" | "libressl" | "unknown";
|
||||
|
||||
export type OutboundManifestHostEntry = {
|
||||
host: string;
|
||||
kind: string;
|
||||
@@ -463,6 +465,25 @@ export function opensslCertificateCommands(input: OpenSslCommandInput): OpenSslC
|
||||
];
|
||||
}
|
||||
|
||||
function opensslBinary(env: NodeJS.ProcessEnv = process.env): string {
|
||||
return env.OPENWORK_EVAL_OPENSSL?.trim() || "openssl";
|
||||
}
|
||||
|
||||
export function opensslFlavor(env: NodeJS.ProcessEnv = process.env): Promise<OpenSslFlavor> {
|
||||
return new Promise((resolve) => {
|
||||
execFile(opensslBinary(env), ["version"], { env, encoding: "utf8", timeout: 5_000 }, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
resolve("unknown");
|
||||
return;
|
||||
}
|
||||
const version = `${String(stdout)}\n${String(stderr)}`.toLowerCase();
|
||||
if (version.includes("libressl")) resolve("libressl");
|
||||
else if (version.includes("openssl")) resolve("openssl");
|
||||
else resolve("unknown");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function intermediateExtFile(): string {
|
||||
return [
|
||||
"basicConstraints=critical,CA:TRUE,pathlen:0",
|
||||
@@ -486,9 +507,10 @@ function leafExtFile(hostname: string, aiaUrl: string | null): string {
|
||||
|
||||
function execOpenSsl(args: string[], cwd: string): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
execFile("openssl", args, { cwd, encoding: "utf8", timeout: 20_000, maxBuffer: 1024 * 1024 }, (error, stdout, stderr) => {
|
||||
const binary = opensslBinary();
|
||||
execFile(binary, args, { cwd, encoding: "utf8", timeout: 20_000, maxBuffer: 1024 * 1024 }, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
reject(new Error([`openssl ${args.join(" ")}`, String(stdout).trim(), String(stderr).trim(), error.message].filter(Boolean).join("\n")));
|
||||
reject(new Error([`${binary} ${args.join(" ")}`, String(stdout).trim(), String(stderr).trim(), error.message].filter(Boolean).join("\n")));
|
||||
return;
|
||||
}
|
||||
resolve();
|
||||
|
||||
@@ -3,6 +3,8 @@ import { createServer } from "node:http";
|
||||
import type { IncomingMessage, Server, ServerResponse } from "node:http";
|
||||
import type { AddressInfo } from "node:net";
|
||||
|
||||
import { trimTrailingSlashes } from "./strings.ts";
|
||||
|
||||
const DEFAULT_DOMAIN = "acme.test";
|
||||
const DEFAULT_CLIENT_ID = "openwork-eval-oidc-client";
|
||||
const DEFAULT_CLIENT_SECRET = "openwork-eval-oidc-secret";
|
||||
@@ -203,7 +205,7 @@ function isNamedGroupClaim(value: MockGroupClaims): value is { claim: string; va
|
||||
}
|
||||
|
||||
function cleanIssuer(value: string | undefined): string {
|
||||
const trimmed = (value ?? DEFAULT_ISSUER).trim().replace(/\/+$/, "");
|
||||
const trimmed = trimTrailingSlashes((value ?? DEFAULT_ISSUER).trim());
|
||||
return trimmed || DEFAULT_ISSUER;
|
||||
}
|
||||
|
||||
@@ -224,11 +226,12 @@ function configuredMockIdpIssuer(input: MockIdpConfig): URL | null {
|
||||
}
|
||||
|
||||
export function normalizeDomain(value: string | undefined): string {
|
||||
const normalized = (value ?? DEFAULT_DOMAIN)
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.replace(/^@+/, "")
|
||||
.replace(/\.+$/, "");
|
||||
const input = (value ?? DEFAULT_DOMAIN).trim().toLowerCase();
|
||||
let start = 0;
|
||||
let end = input.length;
|
||||
while (start < end && input[start] === "@") start += 1;
|
||||
while (end > start && input[end - 1] === ".") end -= 1;
|
||||
const normalized = input.slice(start, end);
|
||||
return normalized || DEFAULT_DOMAIN;
|
||||
}
|
||||
|
||||
@@ -294,9 +297,14 @@ export function normalizeMockIdpConfig(input: MockIdpConfig = {}): NormalizedMoc
|
||||
|
||||
export function normalizeCertificateMaterial(value: string | null | undefined): NormalizedCertificateMaterial {
|
||||
const raw = value ?? "";
|
||||
let end = raw.length;
|
||||
while (end > 0 && raw[end - 1] === "\n") {
|
||||
end -= 1;
|
||||
if (end > 0 && raw[end - 1] === "\r") end -= 1;
|
||||
}
|
||||
return {
|
||||
value: raw.replace(/(?:\r?\n)+$/g, ""),
|
||||
hadTrailingNewline: /(?:\r?\n)+$/.test(raw),
|
||||
value: raw.slice(0, end),
|
||||
hadTrailingNewline: end !== raw.length,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -505,12 +513,19 @@ function safeEqual(left: string, right: string): boolean {
|
||||
return timingSafeEqual(leftBuffer, rightBuffer);
|
||||
}
|
||||
|
||||
const HTML_ENTITIES: Record<string, string> = {
|
||||
"&": "&",
|
||||
"<": "<",
|
||||
">": ">",
|
||||
'"': """,
|
||||
"'": "'",
|
||||
};
|
||||
|
||||
// A single global character-class replace: linear (no backtracking) and the
|
||||
// shape static analysis recognises as HTML escaping, unlike a chain of
|
||||
// string-pattern replaceAll calls.
|
||||
function escapeHtml(value: string): string {
|
||||
return value
|
||||
.replaceAll("&", "&")
|
||||
.replaceAll("<", "<")
|
||||
.replaceAll(">", ">")
|
||||
.replaceAll('"', """);
|
||||
return value.replace(/[&<>"']/g, (character) => HTML_ENTITIES[character] ?? character);
|
||||
}
|
||||
|
||||
export function buildBlockedUserResponse(subject: MockIdpSubjectInput, policyName = "OpenWork Mock IdP policy"): BlockedUserResponseShape {
|
||||
@@ -549,19 +564,18 @@ interface HtmlDocument {
|
||||
paragraphs: string[];
|
||||
}
|
||||
|
||||
// Escaping happens here, at the single boundary that writes HTML, so no caller
|
||||
// can hand this server a pre-built markup string.
|
||||
function renderHtmlDocument(document: HtmlDocument): string {
|
||||
const paragraphs = document.paragraphs.map((text) => `<p>${escapeHtml(text)}</p>`).join("");
|
||||
return `<!doctype html><html><head><title>${escapeHtml(document.title)}</title></head><body><main style="font-family: sans-serif; max-width: 720px; margin: 48px auto;"><h1>${escapeHtml(document.heading)}</h1>${paragraphs}</main></body></html>`;
|
||||
}
|
||||
|
||||
function sendHtml(response: ServerResponse, status: number, document: HtmlDocument): void {
|
||||
// Escape at the write boundary so request-derived fields cannot reach the
|
||||
// HTML response as markup.
|
||||
const title = escapeHtml(document.title);
|
||||
const heading = escapeHtml(document.heading);
|
||||
const paragraphs = document.paragraphs.map((text) => `<p>${escapeHtml(text)}</p>`).join("");
|
||||
const body = `<!doctype html><html><head><title>${title}</title></head><body><main style="font-family: sans-serif; max-width: 720px; margin: 48px auto;"><h1>${heading}</h1>${paragraphs}</main></body></html>`;
|
||||
response.writeHead(status, {
|
||||
"content-type": "text/html; charset=utf-8",
|
||||
"cache-control": "no-store",
|
||||
});
|
||||
response.end(renderHtmlDocument(document));
|
||||
response.end(body);
|
||||
}
|
||||
|
||||
function sendRedirect(response: ServerResponse, location: string): void {
|
||||
|
||||
@@ -3,6 +3,8 @@ import { fileURLToPath } from "node:url";
|
||||
import { join } from "node:path";
|
||||
import type { ChildProcess } from "node:child_process";
|
||||
|
||||
import { trimTrailingSlashes } from "./strings.ts";
|
||||
|
||||
export interface MockAuthorizeRequest {
|
||||
method: string;
|
||||
path: string;
|
||||
@@ -78,7 +80,7 @@ async function waitForHealth(url: string, output: () => string, child: ChildProc
|
||||
|
||||
export async function startMockMcp(options: StartMockMcpOptions = {}): Promise<MockMcpHandle> {
|
||||
const port = options.port ?? 3979;
|
||||
const externalUrl = options.publicUrl?.trim().replace(/\/+$/, "");
|
||||
const externalUrl = options.publicUrl ? trimTrailingSlashes(options.publicUrl.trim()) : undefined;
|
||||
const localUrl = `http://127.0.0.1:${port}`;
|
||||
const url = externalUrl || localUrl;
|
||||
let child: ChildProcess | null = null;
|
||||
|
||||
@@ -2,6 +2,8 @@ import { createServer } from "node:http";
|
||||
import type { IncomingMessage, Server, ServerResponse } from "node:http";
|
||||
import { setTimeout as sleep } from "node:timers/promises";
|
||||
|
||||
import { trimTrailingSlashes } from "./strings.ts";
|
||||
|
||||
export type ReleasePlatform = "mac-arm64" | "mac-x64" | "win-x64" | "linux-x64" | "linux-arm64";
|
||||
export type ReleaseDistribution = "public" | "enterprise" | "cloud";
|
||||
|
||||
@@ -325,7 +327,7 @@ export function resolveAllowedUpdate(input: ResolveAllowedUpdateInput): string |
|
||||
}
|
||||
|
||||
function cleanBaseUrl(value: string): string {
|
||||
return value.trim().replace(/\/+$/, "");
|
||||
return trimTrailingSlashes(value.trim());
|
||||
}
|
||||
|
||||
export function buildReleaseAssetUrl(input: ReleaseAssetUrlInput): string {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
export function trimTrailingSlashes(value: string): string {
|
||||
let end = value.length;
|
||||
while (end > 0 && value[end - 1] === "/") end -= 1;
|
||||
return value.slice(0, end);
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
createBlipSchedule,
|
||||
denyHostsFromOutboundManifest,
|
||||
opensslCertificateCommands,
|
||||
opensslFlavor,
|
||||
outboundManifestFromUnknown,
|
||||
parseClientHelloVersions,
|
||||
resolveEgressProfileConfig,
|
||||
@@ -111,6 +112,11 @@ test("openssl argv construction includes CA, AIA, and fullchain prerequisites",
|
||||
assert.ok(commands.some((command) => command.args.includes("-extfile")));
|
||||
});
|
||||
|
||||
test("openssl flavor probe returns a known value", async () => {
|
||||
const flavor = await opensslFlavor();
|
||||
assert.ok(["openssl", "libressl", "unknown"].includes(flavor));
|
||||
});
|
||||
|
||||
test("deny-list seeding reads installer-critical hosts from the outbound manifest", () => {
|
||||
const manifest = outboundManifestFromUnknown({
|
||||
hosts: [
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
normalizeCertificateMaterial,
|
||||
normalizeDomain,
|
||||
normalizeMockIdpConfig,
|
||||
startMockIdpLab,
|
||||
subjectWithKnobs,
|
||||
validateSsoConfiguration,
|
||||
} from "../src/idp.ts";
|
||||
@@ -96,6 +97,23 @@ test("blocked-user response uses the Entra-style policy wording", () => {
|
||||
assert.match(response.html, /OpenWork Mock IdP policy/);
|
||||
});
|
||||
|
||||
test("mock IdP escapes request-derived blocked-user HTML", async () => {
|
||||
const loginHint = "blocked@acme.test<script>alert(1)</script>";
|
||||
await using lab = await startMockIdpLab({ knobs: { blockedUser: loginHint } });
|
||||
const url = new URL(lab.authorizationEndpoint);
|
||||
url.searchParams.set("client_id", lab.config.clientId);
|
||||
url.searchParams.set("redirect_uri", "http://127.0.0.1/callback");
|
||||
url.searchParams.set("login_hint", loginHint);
|
||||
|
||||
const response = await fetch(url);
|
||||
const body = await response.text();
|
||||
assert.equal(response.status, 403);
|
||||
// Plain substring checks: stricter than a tag regex (`<script` also catches
|
||||
// `<script src=...`) and they cannot be mistaken for a tag-filtering sanitizer.
|
||||
assert.ok(!body.includes("<script"), `escaped body must not contain raw markup: ${body}`);
|
||||
assert.ok(body.includes("<script>"), `escaped body must contain the escaped payload: ${body}`);
|
||||
});
|
||||
|
||||
test("expectation matcher fails with actionable detail when the named error is missing", () => {
|
||||
const validation = validateSsoConfiguration({ configuredDomain: "acme.test", subjectEmail: "maya@acme.test" });
|
||||
const match = matchSsoExpectation(validation, { code: "sso_domain_mismatch" });
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
export type TlsProbeFacts = {
|
||||
ok: boolean;
|
||||
export interface TlsVersionFacts {
|
||||
handshakeOk: boolean;
|
||||
chainVerified: boolean;
|
||||
protocol: string | null;
|
||||
errorCode: string | null;
|
||||
stalled: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export type TlsFacts = {
|
||||
tls12: TlsProbeFacts;
|
||||
tls13: TlsProbeFacts;
|
||||
};
|
||||
export interface TlsFacts {
|
||||
tls12: TlsVersionFacts;
|
||||
tls13: TlsVersionFacts;
|
||||
}
|
||||
|
||||
export type Verdict = {
|
||||
ok: boolean;
|
||||
@@ -74,19 +75,38 @@ export function matchVerdictExpectations(text: string, expect: DiagnosticVerdict
|
||||
}
|
||||
|
||||
export function diagnoseTls(facts: TlsFacts): Verdict {
|
||||
if (facts.tls12.ok && facts.tls13.stalled) {
|
||||
if (facts.tls12.stalled && facts.tls13.stalled) {
|
||||
return {
|
||||
ok: false,
|
||||
code: "tls_unreachable",
|
||||
summary: "TLS 1.2 and TLS 1.3 both timed out before completing a handshake.",
|
||||
action: "Check DNS, outbound routing, proxy policy, and the endpoint certificate chain.",
|
||||
};
|
||||
}
|
||||
if (facts.tls12.handshakeOk && facts.tls13.stalled) {
|
||||
return {
|
||||
ok: false,
|
||||
code: "tls_handshake_stall_tls13_only",
|
||||
summary: "TLS 1.2 succeeds while the TLS 1.3 ClientHello stalls.",
|
||||
action: "Check the egress proxy or firewall for ClientHello inspection that blocks TLS 1.3, or bypass inspection for this host.",
|
||||
summary: "TLS 1.2 completed while TLS 1.3 timed out during the ClientHello.",
|
||||
action: "Check whether the egress proxy or firewall passes TLS ClientHello traffic, or bypass inspection for this host.",
|
||||
};
|
||||
}
|
||||
if (facts.tls12.ok || facts.tls13.ok) {
|
||||
const tls12Untrusted = facts.tls12.handshakeOk && !facts.tls12.chainVerified;
|
||||
const tls13Untrusted = facts.tls13.handshakeOk && !facts.tls13.chainVerified;
|
||||
if (tls12Untrusted || tls13Untrusted) {
|
||||
const errorCode = tls12Untrusted ? facts.tls12.errorCode : facts.tls13.errorCode;
|
||||
return {
|
||||
ok: false,
|
||||
code: "tls_chain_untrusted",
|
||||
summary: `The TLS handshake completed, but the certificate chain was not trusted (${errorCode ?? "unauthorized"}).`,
|
||||
action: "Install or trust the issuing CA in every runtime that connects to this endpoint.",
|
||||
};
|
||||
}
|
||||
if (facts.tls12.chainVerified && facts.tls13.chainVerified) {
|
||||
return {
|
||||
ok: true,
|
||||
code: "tls_ok",
|
||||
summary: "The endpoint completed a verified TLS handshake.",
|
||||
summary: "The endpoint completed verified TLS 1.2 and TLS 1.3 handshakes.",
|
||||
action: "No TLS transport action is required.",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import { diagnoseTls, type TlsFacts } from "../src/index.ts";
|
||||
|
||||
test("diagnoseTls reports both version stalls as unreachable", () => {
|
||||
const facts: TlsFacts = {
|
||||
tls12: { handshakeOk: false, chainVerified: false, protocol: null, errorCode: "ETIMEDOUT", stalled: true },
|
||||
tls13: { handshakeOk: false, chainVerified: false, protocol: null, errorCode: "ETIMEDOUT", stalled: true },
|
||||
};
|
||||
|
||||
assert.equal(diagnoseTls(facts).code, "tls_unreachable");
|
||||
});
|
||||
|
||||
test("diagnoseTls prioritizes a TLS 1.3-only stall", () => {
|
||||
const facts: TlsFacts = {
|
||||
tls12: { handshakeOk: true, chainVerified: false, protocol: "TLSv1.2", errorCode: "UNABLE_TO_GET_ISSUER_CERT_LOCALLY", stalled: false },
|
||||
tls13: { handshakeOk: false, chainVerified: false, protocol: null, errorCode: "ETIMEDOUT", stalled: true },
|
||||
};
|
||||
const verdict = diagnoseTls(facts);
|
||||
|
||||
assert.equal(verdict.code, "tls_handshake_stall_tls13_only");
|
||||
assert.match(verdict.summary, /TLS 1\.2 completed while TLS 1\.3 timed out/u);
|
||||
assert.match(verdict.action, /egress proxy or firewall passes TLS ClientHello traffic/u);
|
||||
});
|
||||
|
||||
test("diagnoseTls reports an untrusted chain after a completed handshake", () => {
|
||||
const facts: TlsFacts = {
|
||||
tls12: { handshakeOk: true, chainVerified: false, protocol: "TLSv1.2", errorCode: "UNABLE_TO_GET_ISSUER_CERT_LOCALLY", stalled: false },
|
||||
tls13: { handshakeOk: false, chainVerified: false, protocol: null, errorCode: "ECONNRESET", stalled: false },
|
||||
};
|
||||
const verdict = diagnoseTls(facts);
|
||||
|
||||
assert.equal(verdict.code, "tls_chain_untrusted");
|
||||
assert.match(verdict.summary, /UNABLE_TO_GET_ISSUER_CERT_LOCALLY/u);
|
||||
assert.match(verdict.action, /trust the issuing CA in every runtime/u);
|
||||
});
|
||||
|
||||
test("diagnoseTls reports success when both chains verify", () => {
|
||||
const facts: TlsFacts = {
|
||||
tls12: { handshakeOk: true, chainVerified: true, protocol: "TLSv1.2", errorCode: null, stalled: false },
|
||||
tls13: { handshakeOk: true, chainVerified: true, protocol: "TLSv1.3", errorCode: null, stalled: false },
|
||||
};
|
||||
const verdict = diagnoseTls(facts);
|
||||
|
||||
assert.equal(verdict.code, "tls_ok");
|
||||
assert.equal(verdict.ok, true);
|
||||
});
|
||||
|
||||
test("diagnoseTls reports other connection failures as unreachable", () => {
|
||||
const facts: TlsFacts = {
|
||||
tls12: { handshakeOk: false, chainVerified: false, protocol: null, errorCode: "ECONNREFUSED", stalled: false },
|
||||
tls13: { handshakeOk: false, chainVerified: false, protocol: null, errorCode: "ECONNRESET", stalled: false },
|
||||
};
|
||||
|
||||
assert.equal(diagnoseTls(facts).code, "tls_unreachable");
|
||||
});
|
||||
Generated
+1045
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,7 @@
|
||||
minimumReleaseAge: 4320
|
||||
|
||||
packages:
|
||||
- "packages/*"
|
||||
|
||||
allowBuilds:
|
||||
esbuild: true
|
||||
@@ -1,8 +1,8 @@
|
||||
import { probeTls } from "@openwork/behaviors";
|
||||
import { diagnoseTls } from "@openwork/matchers";
|
||||
import { diagnoseTls, type TlsVersionFacts } from "@openwork/matchers";
|
||||
|
||||
function usage(): never {
|
||||
throw new Error("Usage: node scripts/support/diagnose.mts <origin> [--insecure-ca <pemPath>]");
|
||||
throw new Error("Usage: node evals/scripts/diagnose.mts <origin> [--insecure-ca <pemPath>]");
|
||||
}
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
@@ -24,6 +24,15 @@ const tls = await probeTls({
|
||||
servername: url.hostname,
|
||||
ca,
|
||||
});
|
||||
function printVersion(label: string, facts: TlsVersionFacts): void {
|
||||
const handshake = facts.handshakeOk ? "ok" : (facts.stalled ? "STALLED" : "FAILED");
|
||||
const chain = facts.handshakeOk
|
||||
? (facts.chainVerified ? "verified" : `UNTRUSTED (${facts.errorCode ?? "unauthorized"})`)
|
||||
: "not checked";
|
||||
console.log(`${label}: handshake ${handshake} / chain ${chain}`);
|
||||
}
|
||||
printVersion("TLS 1.2", tls.tls12);
|
||||
printVersion("TLS 1.3", tls.tls13);
|
||||
const findings = [diagnoseTls(tls)];
|
||||
for (const finding of findings) {
|
||||
console.log(`${finding.ok ? "ok" : "FAIL"} tls ${finding.code}`);
|
||||
@@ -19,11 +19,18 @@ describe("TLS 1.2-only egress", () => {
|
||||
ca: lab.rootPem,
|
||||
});
|
||||
|
||||
expect(tls.tls12.ok).toBe(true);
|
||||
expect(tls.tls12.protocol).toBe("TLSv1.2");
|
||||
expect(tls.tls13.stalled).toBe(true);
|
||||
expect(tls.tls13.errorCode).toBe("ETIMEDOUT");
|
||||
expect(diagnoseTls(tls).code).toBe("tls_handshake_stall_tls13_only");
|
||||
const message = JSON.stringify(tls);
|
||||
expect(tls.tls12.handshakeOk, message).toBe(true);
|
||||
expect(tls.tls12.stalled, message).toBe(false);
|
||||
if (tls.tls12.chainVerified) {
|
||||
expect(tls.tls12.protocol, message).toBe("TLSv1.2");
|
||||
} else {
|
||||
expect(tls.tls12.protocol === null || tls.tls12.protocol === "TLSv1.2", message).toBe(true);
|
||||
}
|
||||
expect(tls.tls13.stalled, message).toBe(true);
|
||||
expect(tls.tls13.errorCode, message).toBe("ETIMEDOUT");
|
||||
expect(diagnoseTls(tls).code, message).toBe("tls_handshake_stall_tls13_only");
|
||||
// Lab-PKI chain trust is covered by the pure matcher tests (the tls_chain_untrusted branch) and the product-diagnostics spec; it is deliberately not asserted here because it varies with the runner's OpenSSL.
|
||||
});
|
||||
|
||||
const skipReason = productDiagnosticsPrecondition(process.env);
|
||||
|
||||
@@ -13,7 +13,7 @@ export default defineConfig({
|
||||
test: {
|
||||
...common,
|
||||
name: "pr",
|
||||
include: ["evals/specs/**/*.test.ts"],
|
||||
include: ["specs/**/*.test.ts"],
|
||||
exclude: ["**/*.slow.test.ts"],
|
||||
},
|
||||
},
|
||||
@@ -21,7 +21,7 @@ export default defineConfig({
|
||||
test: {
|
||||
...common,
|
||||
name: "nightly",
|
||||
include: ["evals/specs/**/*.test.ts"],
|
||||
include: ["specs/**/*.test.ts"],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
+4
-8
@@ -51,7 +51,7 @@
|
||||
"test:session-scope": "pnpm --filter @openwork/app test:session-scope",
|
||||
"test:session-switch": "pnpm --filter @openwork/app test:session-switch",
|
||||
"test:fs-engine": "pnpm --filter @openwork/app test:fs-engine",
|
||||
"test:eval-runner": "pnpm evals:test",
|
||||
"test:eval-runner": "pnpm --dir evals run test",
|
||||
"check:outbound-access": "node scripts/check-outbound-access.mjs",
|
||||
"test:e2e": "pnpm --filter @openwork/app test:e2e",
|
||||
"test:admin-scale": "pnpm --filter @openwork-ee/den-api test:admin-scale",
|
||||
@@ -60,8 +60,8 @@
|
||||
"fraimz": "node evals/runner/run.mjs --mode demo",
|
||||
"evals:typecheck": "tsc -p evals",
|
||||
"evals:test": "node --test evals/runner/*.test.ts evals/packages/*/test/*.test.ts",
|
||||
"evals:spec": "vitest run --config evals/vitest.config.ts --project pr",
|
||||
"evals:spec:nightly": "vitest run --config evals/vitest.config.ts",
|
||||
"evals:spec": "pnpm --dir evals run spec",
|
||||
"evals:spec:nightly": "pnpm --dir evals run spec:nightly",
|
||||
"owt": "node evals/runner/run-owt.mjs",
|
||||
"bump:patch": "pnpm --filter @openwork/app bump:patch",
|
||||
"bump:minor": "pnpm --filter @openwork/app bump:minor",
|
||||
@@ -74,13 +74,9 @@
|
||||
"release:ship:watch": "node scripts/release/ship.mjs --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@openwork/behaviors": "workspace:*",
|
||||
"@openwork/cdp": "workspace:*",
|
||||
"@openwork/matchers": "workspace:*",
|
||||
"@types/node": "^24.0.0",
|
||||
"turbo": "^2.5.5",
|
||||
"typescript": "^5.9.0",
|
||||
"vitest": "^3.2.4"
|
||||
"typescript": "^5.9.0"
|
||||
},
|
||||
"packageManager": "pnpm@11.4.0"
|
||||
}
|
||||
Generated
+26
-681
File diff suppressed because it is too large.
Load diff
@@ -5,8 +5,6 @@ minimumReleaseAgeExclude:
|
||||
packages:
|
||||
- "apps/*"
|
||||
- "packages/*"
|
||||
- "evals"
|
||||
- "evals/packages/*"
|
||||
- "ee/apps/*"
|
||||
- "ee/packages/*"
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
# the den stack, then the vitest spec lane against the same live stack.
|
||||
set -euo pipefail
|
||||
cd /workspace
|
||||
pnpm --dir evals install
|
||||
|
||||
# Sandbox exec sessions have private /tmp namespaces; the artifacts volume is
|
||||
# the only log destination visible to other sessions (and over HTTP :8090).
|
||||
@@ -47,6 +48,6 @@ echo "==> New spec lane against the same live stack"
|
||||
export OPENWORK_EVAL_DEN_API_URL="http://127.0.0.1:8790"
|
||||
export OPENWORK_EVAL_DEN_WEB_URL="http://localhost:3005"
|
||||
export OPENWORK_EVAL_CDP_URL="http://127.0.0.1:9825"
|
||||
pnpm vitest run --config evals/vitest.config.ts --project nightly 2>&1 | tee "$LOG_DIR/specs-real.log"
|
||||
pnpm --dir evals run spec:nightly 2>&1 | tee "$LOG_DIR/specs-real.log"
|
||||
|
||||
echo "==> DONE"
|
||||
Reference in new issue
Block a user