Remove repo reports and add recurrence guard

This commit is contained in:
Code Queue Review
2026-05-24 02:23:27 +00:00
parent 0c53c94714
commit 4e302faee9
83 changed files with 1042 additions and 27077 deletions
+7 -7
View File
@@ -11,9 +11,10 @@ import { fileURLToPath, pathToFileURL } from "node:url";
import { activeReportLifecycle } from "../internal/dev-report-lifecycle.mjs";
import { DEV_ENDPOINT, DEV_FRONTEND_ENDPOINT, ENVIRONMENT_DEV } from "../internal/protocol/index.mjs";
import { ensureNotRepoReportsPath, tempReportPath } from "./src/report-paths.mjs";
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
const defaultReportPath = "reports/dev-gate/dev-m3-hardware-loop.json";
const defaultReportPath = tempReportPath("dev-m3-hardware-loop.json");
const namespace = "hwlab-dev";
const issue = "pikasTech/HWLAB#38";
const deployWorkloadsPath = "deploy/k8s/base/workloads.yaml";
@@ -203,9 +204,7 @@ function relativePath(absolutePath) {
}
function resolveReportPath(value) {
const candidate = path.resolve(repoRoot, value ?? defaultReportPath);
assert.ok(candidate.startsWith(`${repoRoot}${path.sep}`), "report path must stay inside repository");
return candidate;
return ensureNotRepoReportsPath(repoRoot, value ?? defaultReportPath, "report path");
}
function currentCommit() {
@@ -1404,7 +1403,7 @@ async function runLiveM3Targets(targets) {
function baseReport({ commitId, observedAt }) {
return {
$schema: "https://hwlab.pikastech.local/schemas/dev-m3-hardware-loop-report.schema.json",
$id: "https://hwlab.pikastech.local/reports/dev-gate/dev-m3-hardware-loop.json",
$id: "https://hwlab.pikastech.local/dev-gate/dev-m3-hardware-loop.json",
reportVersion: "v1",
issue,
taskId: "dev-m3-hardware-loop",
@@ -1618,8 +1617,9 @@ async function ensureContractFiles() {
}
async function writeReport(report, reportPath) {
await mkdir(path.dirname(reportPath), { recursive: true });
await writeFile(reportPath, `${JSON.stringify(report, null, 2)}\n`, "utf8");
const absoluteReportPath = ensureNotRepoReportsPath(repoRoot, reportPath, "report path");
await mkdir(path.dirname(absoluteReportPath), { recursive: true });
await writeFile(absoluteReportPath, `${JSON.stringify(report, null, 2)}\n`, "utf8");
}
async function main() {