feat: complete REA remediation program

This commit is contained in:
N0zoM1z0
2026-07-22 22:09:12 +09:00
committed by N0zoM1z0
parent 737940c90c
commit d25e98c3f9
460 changed files with 13985 additions and 1877 deletions
+2
View File
@@ -0,0 +1,2 @@
process.stderr.write("fixture MCP startup exit\n");
process.exitCode = 23;
+5
View File
@@ -0,0 +1,5 @@
import { writeFile } from "node:fs/promises";
if (process.env.REA_MCP_DOCTOR_PID_PATH !== undefined)
await writeFile(process.env.REA_MCP_DOCTOR_PID_PATH, String(process.pid));
setInterval(() => undefined, 1_000);
+33
View File
@@ -0,0 +1,33 @@
import { mkdtemp, realpath, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { onTestFinished } from "vitest";
const TEMPORARY_PREFIX = /^[A-Za-z0-9][A-Za-z0-9._-]*-$/u;
/** Creates a canonical temporary directory owned by the current Vitest case. */
export const createTestTempDirectory = async (
prefix: string,
): Promise<string> => {
if (!TEMPORARY_PREFIX.test(prefix) || prefix.length > 80) {
throw new TypeError(
"Test temporary directory prefixes must be safe basenames ending in '-'",
);
}
const canonicalTemporaryRoot = await realpath(tmpdir());
const created = await mkdtemp(join(canonicalTemporaryRoot, prefix));
const canonicalDirectory = await realpath(created);
onTestFinished(async () => {
await rm(canonicalDirectory, {
recursive: true,
force: true,
maxRetries: 3,
retryDelay: 25,
});
});
return canonicalDirectory;
};
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env python3
import subprocess
import sys
import time
from pathlib import Path
fixture = str(Path(__file__).resolve())
subprocess.Popen(
[sys.executable, "-c", "import time; time.sleep(60)", fixture],
)
while True:
time.sleep(60)