Skip to content

Commit 1af798d

Browse files
author
Adam Chan
committed
Release v0.3.40 upgrade compatibility fixes
1 parent 45fd182 commit 1af798d

3 files changed

Lines changed: 7 additions & 13 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Agent Handoff Kit
22

3-
目前公開版本`v0.3.39`。本 source 為未發布的 `v0.3.40` 修正候選
3+
目前版本`v0.3.40`
44

55
<p align="center">
66
<img src="https://raw.githubusercontent.com/Adamchanadam/agent-handoff-kit/main/images/agent-handoff-kit-promo-30s.gif" alt="Agent Handoff Kit 功能簡介動畫" width="720">

bin/agent-handoff-kit.mjs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1975,8 +1975,9 @@ function lifecycleTopicWindows(line, stripNegated = false) {
19751975
}
19761976

19771977
function lifecycleShortChineseCore(line, stripNegated = false) {
1978-
const source = stripNegated ? stripResolvedNegatedActionClauses(line) : line;
1979-
const ignored = /(|||||||||||||||||||)/g;
1978+
const rawSource = stripNegated ? stripResolvedNegatedActionClauses(line) : line;
1979+
const source = rawSource.split(/(?:\s+[-]\s*)?(?:reason|condition)\s*[:]|(?:|)\s*[:]/i)[0];
1980+
const ignored = /(||||||||||||||||||||)/g;
19801981
const core = (source.match(/[\u3400-\u9fff]+/g) ?? []).join("").replace(ignored, "");
19811982
return core.length >= 2 && core.length <= 5 ? core : null;
19821983
}
@@ -2362,7 +2363,7 @@ function classifyExistingFile(command, sourceRel, targetRel, sourceAbs, targetAb
23622363
return { ...base, action: "conflict", reason: "SESSION_LOG.md lacks a unique trusted entry-template boundary; migration stopped without replacing trace history" };
23632364
}
23642365
if (migratedLog !== targetText) {
2365-
return { ...base, action: "merge", reason: "update only the log preamble/template and remove Kit-shaped full prompt copies while preserving trace entries", mergedText: migratedLog };
2366+
return { ...base, action: "merge", reason: "update only the trusted current log preamble/template while preserving every historical trace entry", mergedText: migratedLog };
23662367
}
23672368
return { ...base, action: "skip", reason: "SESSION_LOG.md trace/template boundary current" };
23682369
}
@@ -3586,13 +3587,6 @@ function migrateSessionLog(targetText, sourceText) {
35863587
const sourceContract = sessionLogEntryTemplateContract(sourceText);
35873588
if (!targetContract || !sourceContract) return null;
35883589
merged = `${merged.slice(0, targetContract.entryStart)}${sourceText.slice(sourceContract.entryStart, sourceContract.entryEnd)}${merged.slice(targetContract.entryEnd)}`;
3589-
3590-
merged = merged.replace(/```(?:text)?\s*\r?\n([\s\S]*?)\r?\n```/g, (block, content) => {
3591-
const signatures = ["Work in ", "Read AGENTS.md", "SESSION_HANDOFF.md", "PROJECT_INDEX.md"];
3592-
return signatures.every((signature) => content.includes(signature))
3593-
? "Opening-message mirror: migrated; full text omitted by design."
3594-
: block;
3595-
});
35963590
return merged;
35973591
}
35983592

docs/whatsnew/v0.3.40.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# v0.3.40
22

3-
狀態:未發布候選
3+
狀態:正式發佈版本
44

55
## 本版新加了甚麼
66

@@ -14,4 +14,4 @@
1414

1515
## 建議下一步
1616

17-
目前仍未發布。發布後,v0.3.38 或 v0.3.39 專案可使用正常 `upgrade` 路徑;毋須手動合併日誌標記或大幅改寫交接內容。
17+
v0.3.38 或 v0.3.39 專案可使用正常 `upgrade` 路徑;毋須手動合併日誌標記或大幅改寫交接內容。升級器不能安全判斷自訂內容時仍會停手,不會強制覆寫

0 commit comments

Comments
 (0)