fix: 区分 MDTODO source 与 target freshness

This commit is contained in:
Codex
2026-07-13 11:00:30 +02:00
parent cfcade4ec4
commit 7dcc1395ac
2 changed files with 11 additions and 1 deletions
@@ -22,9 +22,11 @@ describe("MDTODO safe title stdin adoption", () => {
const temporary = mkdtempSync("/tmp/unidesk-mdtodo-safe-input-");
try {
const source = join(temporary, "source");
const staleSource = join(temporary, "stale-source");
const staleTarget = join(temporary, "stale-target");
const readyTarget = join(temporary, "ready-target");
writeFixture(source, true);
writeFixture(staleSource, false);
writeFixture(staleTarget, false);
writeFixture(readyTarget, true);
@@ -41,6 +43,14 @@ describe("MDTODO safe title stdin adoption", () => {
freshness: "ready",
warning: null,
});
expect(collectMdtodoSafeTitleStdinCapability(staleSource, readyTarget)).toMatchObject({
nonBlocking: true,
ready: true,
freshness: "source-stale",
source: { ready: false },
target: { ready: true },
warning: expect.stringContaining("approved source"),
});
} finally {
rmSync(temporary, { recursive: true, force: true });
}