chore: minor cleanups — docs index, test-project fixture, empty catches, triage timestamp guard
- Add diagnostics.md and FN-4886/FN-5048 entries to docs/README.md index - Fix test-project.test.ts spy target (updateSettings → init) to match fixture flow - Remove unused DEFAULT_PROJECT_SETTINGS import and skip empty settings patch - Add explanatory comments to empty catch blocks in secrets-env-writer - Refine near-duplicate timestamp guard in triage for cleaner NaN handling
This commit is contained in:
@@ -111,7 +111,7 @@ export async function writeSecretsEnvFile(opts: WriteSecretsEnvFileOptions): Pro
|
||||
await opts.audit?.filesystem({ type: "secret:env-write-skipped", target: opts.taskId, metadata: { filename, reason: "invalid-filename", overwritePolicy, symlink: true } });
|
||||
return { outcome: "skipped", filename, reason: "invalid-filename" };
|
||||
}
|
||||
} catch {}
|
||||
} catch { /* file may not exist */ }
|
||||
|
||||
if (cfg?.requireGitignored !== false) {
|
||||
const check = await checkIgnored(opts.execFileImpl ?? execFile, opts.worktreePath, filename);
|
||||
@@ -148,13 +148,13 @@ export async function writeSecretsEnvFile(opts: WriteSecretsEnvFileOptions): Pro
|
||||
await fs.access(envPath);
|
||||
await opts.audit?.filesystem({ type: "secret:env-write-skipped", target: opts.taskId, metadata: { filename, reason: "skip-existing", overwritePolicy } });
|
||||
return { outcome: "skipped", filename, reason: "skip-existing" };
|
||||
} catch {}
|
||||
} catch { /* file does not exist — proceed to write */ }
|
||||
} else if (overwritePolicy === "merge") {
|
||||
try {
|
||||
const existing = await fs.readFile(envPath, "utf8");
|
||||
const preserved = removeManagedBlock(existing);
|
||||
nextBody = `${preserved.replace(/\n*$/u, "")}${preserved.length > 0 ? "\n" : ""}${nextBody}`;
|
||||
} catch {}
|
||||
} catch { /* file does not exist — write fresh */ }
|
||||
}
|
||||
|
||||
const tmpPath = `${envPath}.fusion-tmp`;
|
||||
|
||||
@@ -2368,8 +2368,9 @@ export class TriageProcessor {
|
||||
const taskCreatedAt = Date.parse(task.createdAt);
|
||||
const candidatesById = new Map(candidates.map((candidate) => [candidate.id, candidate]));
|
||||
const isStrictlyOlderOrTieCanonical = (candidate: NearDuplicateCandidate): boolean => {
|
||||
const candidateCreatedAt = candidate.createdAt;
|
||||
if (typeof candidateCreatedAt !== "number" || Number.isNaN(candidateCreatedAt)) {
|
||||
const candidateCreatedAt =
|
||||
typeof candidate.createdAt === "number" ? candidate.createdAt : Number.NaN;
|
||||
if (Number.isNaN(candidateCreatedAt)) {
|
||||
return false;
|
||||
}
|
||||
if (candidateCreatedAt < taskCreatedAt) return true;
|
||||
|
||||
Reference in New Issue
Block a user