fix: project analyzer generated time

This commit is contained in:
AgentRun Codex
2026-07-12 22:24:00 +00:00
parent 5fd3a1f07d
commit 771a3596f1
8 changed files with 61 additions and 14 deletions
@@ -30,7 +30,7 @@ test("artifact recovery helper projects report time without filesystem mtime", (
assert.equal(recovered?.reportUpdatedAt, "2026-07-12T00:00:00.000Z");
assert.match(recoveryScript, /const reportJson = objectOrNull\(readJson\(reportJsonPath\)\) \|\| \{\};/u);
assert.equal((recoveryScript.match(/const reportJson =/gu) ?? []).length, 1);
assert.match(recoveryScript, /source\.reportUpdatedAt \?\? source\.updatedAt \?\? source\.analyzedAt \?\? reportJson\.reportUpdatedAt \?\? reportJson\.updatedAt \?\? reportJson\.analyzedAt/u);
assert.match(recoveryScript, /source\.reportUpdatedAt \?\? source\.updatedAt \?\? source\.analyzedAt \?\? reportJson\.reportUpdatedAt \?\? reportJson\.updatedAt \?\? reportJson\.analyzedAt \?\? source\.generatedAt \?\? reportJson\.generatedAt/u);
assert.doesNotMatch(recoveryScript, /mtime/u);
const marker = "UNIDESK_WEB_OBSERVE_RECOVER_ANALYZE_ARTIFACT";
const start = recoveryScript.indexOf(`<<'${marker}'\n`) + marker.length + 5;
@@ -41,6 +41,11 @@ test("artifact recovery helper projects report time without filesystem mtime", (
writeFileSync(programPath, recoveryScript.slice(start, end));
const syntax = spawnSync(process.execPath, ["--check", programPath], { encoding: "utf8" });
assert.equal(syntax.status, 0, syntax.stderr);
const reportJsonPath = join(directory, "report.json");
writeFileSync(reportJsonPath, JSON.stringify({ generatedAt: "2026-07-12T00:00:00.000Z" }));
const executed = spawnSync(process.execPath, [programPath, directory, join(directory, "stdout.json"), join(directory, "stderr.log"), reportJsonPath, join(directory, "report.md"), "124", "true"], { encoding: "utf8" });
assert.equal(executed.status, 0, executed.stderr);
assert.equal(JSON.parse(executed.stdout).reportUpdatedAt, "2026-07-12T00:00:00.000Z");
} finally {
rmSync(directory, { recursive: true, force: true });
}