Source commit: 309831e1e021f962c118452336776fd9a94025f9 Public tree identity: sha256:6fa95c1745579bd6256dbeb3d476db0b07c2f24aa9213b0f7783ce1adfc8aca5
99 lines
4.8 KiB
JavaScript
99 lines
4.8 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
const assert = require("assert");
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
|
|
const repo = path.resolve(__dirname, "..");
|
|
|
|
function read(relativePath) {
|
|
return fs.readFileSync(path.join(repo, relativePath), "utf8");
|
|
}
|
|
|
|
function expect(source, name, pattern) {
|
|
assert.match(source, pattern, `missing public-story evidence: ${name}`);
|
|
}
|
|
|
|
const readme = read("README.md");
|
|
const publicAcceptance = read("scripts/acceptance-public.sh");
|
|
const publicSplit = read("scripts/verify-public-split.sh");
|
|
const cliLocalRunSmoke = read("scripts/cli-local-run-smoke.js");
|
|
const dapSmoke = read("scripts/dap-smoke.js");
|
|
const flagshipDemoSmoke = read("scripts/flagship-demo-smoke.js");
|
|
const artifactDownloadSmoke = read("scripts/artifact-download-smoke.js");
|
|
const artifactExportSmoke = read("scripts/artifact-export-smoke.js");
|
|
|
|
for (const [scriptName, script] of [
|
|
["public acceptance", publicAcceptance],
|
|
["public split", publicSplit],
|
|
]) {
|
|
assert(
|
|
script.includes("node scripts/public-story-contract-smoke.js"),
|
|
`${scriptName} must run public-story-contract-smoke.js`
|
|
);
|
|
}
|
|
|
|
for (const [name, pattern] of [
|
|
[
|
|
"README states public story",
|
|
/one virtual process, many virtual threads\/tasks, ordinary debugger controls, attached user nodes, and explicit artifact handling/,
|
|
],
|
|
[
|
|
"README states local-first bytes policy",
|
|
/local source checkouts and large outputs stay node-local unless user code or policy explicitly moves bytes/,
|
|
],
|
|
[
|
|
"README states normal debugger controls",
|
|
/ordinary debugger\s+controls for breakpoints, continue, pause, and restart/,
|
|
],
|
|
]) {
|
|
expect(readme, name, pattern);
|
|
}
|
|
|
|
for (const [name, pattern] of [
|
|
["CLI local run starts a node process", /cli_process_started_node_process/],
|
|
["CLI local run checks node is separate from CLI", /assert\.notStrictEqual\(report\.boundary\.spawned_node_process_id, cliPid\)/],
|
|
["CLI local run checks node is separate from coordinator", /assert\.notStrictEqual\(report\.boundary\.spawned_node_process_id, coordinator\.pid\)/],
|
|
["CLI local run records one node task event", /assert\.strictEqual\(events\.events\.length, 1\)/],
|
|
["CLI local run records artifact metadata", /assert\.strictEqual\(events\.events\[0\]\.artifact_path, "\/vfs\/artifacts\/cli-run-output\.txt"\)/],
|
|
["CLI local-only run starts coordinator", /cli_process_started_coordinator_process[\s\S]*true/],
|
|
["CLI local-only run hides coordinator address requirement", /\["run"[\s\S]*"--local"[\s\S]*"--project"[\s\S]*project/],
|
|
]) {
|
|
expect(cliLocalRunSmoke, name, pattern);
|
|
}
|
|
|
|
for (const [name, pattern] of [
|
|
["DAP smoke uses local-services runtime", /runtimeBackend: "local-services"/],
|
|
["DAP smoke exposes one target with four virtual threads", /threads\.map\(\(thread\) => thread\.id\)[\s\S]*\[1, 2, 3, 4\]/],
|
|
["DAP smoke binds main breakpoint", /assert\.match\(mainStack\[0\]\.name, \/build virtual process::run\/\)/],
|
|
["DAP smoke binds Linux task breakpoint", /assert\.match\(stack\[0\]\.name, \/compile linux::run\/\)/],
|
|
["DAP smoke all-stops on breakpoint", /assert\.strictEqual\(stopped\.body\.allThreadsStopped, true\)/],
|
|
["DAP smoke supports pause all-stop", /assert\.strictEqual\(paused\.body\.allThreadsStopped, true\)/],
|
|
["DAP smoke supports selected restart", /Restarted selected task/],
|
|
["DAP smoke supports failed task restart", /Restarted failed task/],
|
|
["DAP smoke avoids native child debugger claims", /doesNotMatch\(stack\[0\]\.name, \/podman\|cmd\\\.exe\|powershell\|pid\|native child\/i\)/],
|
|
["DAP smoke crosses coordinator-node boundary", /coordinator_task_events[\s\S]*value === 1/],
|
|
]) {
|
|
expect(dapSmoke, name, pattern);
|
|
}
|
|
|
|
for (const [name, pattern] of [
|
|
["flagship source does not need coordinator checkout", /coordinator_requires_checkout_access[\s\S]*false/],
|
|
["flagship source bytes remain node-local", /local_source_bytes_remain_node_local[\s\S]*true/],
|
|
["flagship avoids default source upload", /coordinator_receives_source_bytes_by_default[\s\S]*false/],
|
|
["flagship avoids default repo tarball", /default_full_repo_tarball[\s\S]*false/],
|
|
]) {
|
|
expect(flagshipDemoSmoke, name, pattern);
|
|
}
|
|
|
|
for (const [name, source, pattern] of [
|
|
["artifact download creates scoped link", artifactDownloadSmoke, /create_artifact_download_link/],
|
|
["artifact download records retained-node source", artifactDownloadSmoke, /assert\.deepStrictEqual\(link\.link\.source, \{ RetainedNode: "node-download" \}\)/],
|
|
["artifact download opens scoped stream", artifactDownloadSmoke, /open_artifact_download_stream/],
|
|
["artifact export targets attached receiver node", artifactExportSmoke, /export_artifact_to_node[\s\S]*node-export-receiver/],
|
|
["artifact export disables coordinator bulk relay", artifactExportSmoke, /coordinator_bulk_relay_allowed[\s\S]*false/],
|
|
]) {
|
|
expect(source, name, pattern);
|
|
}
|
|
|
|
console.log("Public story contract smoke passed");
|