@adamchanadam/agent-handoff-kit 0.3.48 → 0.3.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/bin/agent-handoff-kit.mjs +42 -36
- package/bin/migration-baselines/official-origin-catalog.json +181 -1
- package/bin/official-origin-catalog.mjs +16 -16
- package/bin/upgrade-inventory.mjs +33 -33
- package/package.json +1 -1
- package/runtime-core/PROJECT_INDEX.md +1 -1
package/README.en.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[繁體中文](README.md) · [Getting started](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-intro.en.html) · [Practical guide](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-guide.en.html) · [AI install page](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-ai-install.en.html)
|
|
4
4
|
|
|
5
|
-
Source package version: `v0.3.
|
|
5
|
+
Source package version: `v0.3.49`. npm `@latest` and GitHub Release are verified by post-publish readback.
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<img src="https://raw.githubusercontent.com/Adamchanadam/agent-handoff-kit/main/images/agent-handoff-kit-promo-30s.gif" alt="Agent Handoff Kit overview animation" width="720">
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English: [README.en.md](README.en.md) · [Getting started](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-intro.en.html) · [Practical guide](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-guide.en.html) · [AI install page](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-ai-install.en.html)
|
|
4
4
|
|
|
5
|
-
原始碼套件版本:`v0.3.
|
|
5
|
+
原始碼套件版本:`v0.3.49`。npm `@latest` 與 GitHub Release 以發佈後讀回為準。
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<img src="https://raw.githubusercontent.com/Adamchanadam/agent-handoff-kit/main/images/agent-handoff-kit-promo-30s.gif" alt="Agent Handoff Kit 功能簡介動畫" width="720">
|
|
@@ -873,13 +873,14 @@ async function runInstall(command, root, options, version) {
|
|
|
873
873
|
return;
|
|
874
874
|
}
|
|
875
875
|
|
|
876
|
-
if (plan.some((item) => item.action === "conflict")) {
|
|
877
|
-
console.log("");
|
|
878
|
-
console.log("⛔ 升級預檢發現 conflict;治理目標檔、版本與 migration artifact 均沒有寫入。");
|
|
879
|
-
console.log("
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
876
|
+
if (plan.some((item) => item.action === "conflict")) {
|
|
877
|
+
console.log("");
|
|
878
|
+
console.log("⛔ 升級預檢發現 conflict;治理目標檔、版本與 migration artifact 均沒有寫入。");
|
|
879
|
+
console.log("📌 舊 migration stage、已回滾報告或版本列只屬證據,不代表目前交易。");
|
|
880
|
+
console.log(conflictRepairNextStepLine());
|
|
881
|
+
process.exitCode = 1;
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
883
884
|
|
|
884
885
|
if (!options.yes) {
|
|
885
886
|
const ok = await confirmWrite();
|
|
@@ -7346,8 +7347,8 @@ function ensureHandoffCloseoutOutcomeFields(targetText) {
|
|
|
7346
7347
|
return targetText.replace(openingMarker, `${fields}${openingMarker}`);
|
|
7347
7348
|
}
|
|
7348
7349
|
|
|
7349
|
-
function planIntroFor(command, mode, isDryRun) {
|
|
7350
|
-
const prefix = isDryRun ? "📋 預演結果:這次不會寫入檔案。" : "📋 寫入前確認:工具準備這樣處理目前資料夾。";
|
|
7350
|
+
function planIntroFor(command, mode, isDryRun) {
|
|
7351
|
+
const prefix = isDryRun ? "📋 預演結果:這次不會寫入檔案。" : "📋 寫入前確認:工具準備這樣處理目前資料夾。";
|
|
7351
7352
|
if (command === "init" && mode === "first-install") {
|
|
7352
7353
|
return `${prefix} 目前資料夾未見 Kit 檔案;工具會建立交接文件、AI 入口檔與工作規則。沒有既有檔案會被覆寫。`;
|
|
7353
7354
|
}
|
|
@@ -7356,12 +7357,17 @@ function planIntroFor(command, mode, isDryRun) {
|
|
|
7356
7357
|
}
|
|
7357
7358
|
if (command === "upgrade") {
|
|
7358
7359
|
return `${prefix} 工具會檢查既有 Kit 檔案;能安全合併才合併,不能判斷時會停手並列為 conflict。`;
|
|
7359
|
-
}
|
|
7360
|
-
return `${prefix} create 代表建立缺少檔案;merge 代表先備份再合併;skip 代表保留既有檔案;conflict 代表工具零寫入停手並提供技術證據。`;
|
|
7361
|
-
}
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7360
|
+
}
|
|
7361
|
+
return `${prefix} create 代表建立缺少檔案;merge 代表先備份再合併;skip 代表保留既有檔案;conflict 代表工具零寫入停手並提供技術證據。`;
|
|
7362
|
+
}
|
|
7363
|
+
|
|
7364
|
+
function conflictRepairNextStepLine(icon = "📋", suffix = "") {
|
|
7365
|
+
const suffixText = suffix ? ` ${suffix}` : "";
|
|
7366
|
+
return `${icon} 下一步:你不用判斷技術差異,也不要重裝或整檔覆寫。請回到能讀寫這個資料夾的 AI,讓 AI 依這段輸出、本地檔案與正式來源做授權合併;合併後重新執行 upgrade --dry-run,再用 doctor 與 hash 讀回驗收。未知本地 hash 只作內容 witness,不代表 Kit 可以理解或覆寫。只有能證明這是 Kit 誤判未改動的正式舊檔時,才把版本、來源與 hash 證據回報 Kit maintainer。${suffixText}`;
|
|
7367
|
+
}
|
|
7368
|
+
|
|
7369
|
+
// R-026 CLI Output Contract: install/upgrade 完成必含四項(版本/模式/剛完成/下一步)。
|
|
7370
|
+
function printInstallSummary(version, command, mode, root, counts) {
|
|
7365
7371
|
console.log(`\n✅ created: ${counts.created}`);
|
|
7366
7372
|
console.log(`🔀 merged: ${counts.merged}`);
|
|
7367
7373
|
console.log(`⏭️ skipped existing: ${counts.skipped}`);
|
|
@@ -7370,10 +7376,10 @@ function printInstallSummary(version, command, mode, root, counts) {
|
|
|
7370
7376
|
if (counts.reportRel) console.log(`📄 migration report: ${counts.reportRel}`);
|
|
7371
7377
|
console.log("");
|
|
7372
7378
|
console.log(`📦 版本:v${version}`);
|
|
7373
|
-
console.log(`🛠️ 模式:${mode}`);
|
|
7374
|
-
console.log(`🔎 剛完成:${command} 命令;create ${counts.created} / merge ${counts.merged} / skip ${counts.skipped} / conflict ${counts.conflicts}。`);
|
|
7379
|
+
console.log(`🛠️ 模式:${mode}`);
|
|
7380
|
+
console.log(`🔎 剛完成:${command} 命令;create ${counts.created} / merge ${counts.merged} / skip ${counts.skipped} / conflict ${counts.conflicts}。`);
|
|
7375
7381
|
if (counts.conflicts > 0) {
|
|
7376
|
-
console.log("🚀
|
|
7382
|
+
console.log(conflictRepairNextStepLine("🚀", "工具已停手,沒有覆寫 conflict 檔案。"));
|
|
7377
7383
|
} else if (command === "upgrade") {
|
|
7378
7384
|
console.log("🚀 下一步:本次提交已先經同一輪正式 doctor 讀回;請留意下方提交與健康結果。");
|
|
7379
7385
|
} else if (counts.skipped > 0) {
|
|
@@ -7399,11 +7405,11 @@ function printDryRunExplanation(command, mode, plan) {
|
|
|
7399
7405
|
}
|
|
7400
7406
|
console.log("✅ 沒有發現 conflict。請按你剛才預演的命令去掉 --dry-run 後正式執行。");
|
|
7401
7407
|
return;
|
|
7402
|
-
}
|
|
7403
|
-
console.log(`⚠️ 技術核對未完成:有 ${conflicts.length} 個既有檔案,工具目前不能證明可安全合併。`);
|
|
7404
|
-
console.log("⚠️ 這不是檔案壞掉,也沒有覆寫你的檔案。");
|
|
7405
|
-
console.log(
|
|
7406
|
-
}
|
|
7408
|
+
}
|
|
7409
|
+
console.log(`⚠️ 技術核對未完成:有 ${conflicts.length} 個既有檔案,工具目前不能證明可安全合併。`);
|
|
7410
|
+
console.log("⚠️ 這不是檔案壞掉,也沒有覆寫你的檔案。");
|
|
7411
|
+
console.log(conflictRepairNextStepLine());
|
|
7412
|
+
}
|
|
7407
7413
|
|
|
7408
7414
|
async function confirmWrite() {
|
|
7409
7415
|
const rl = createInterface({ input, output });
|
|
@@ -7578,12 +7584,12 @@ function printInstallNextSteps(root, conflictCount, mode = "first-install", skip
|
|
|
7578
7584
|
console.log("✅ 安裝完成:下一步請在 AI 對話中操作");
|
|
7579
7585
|
}
|
|
7580
7586
|
console.log("============================================================");
|
|
7581
|
-
if (conflictCount > 0) {
|
|
7582
|
-
console.log("⚠️ 狀態:有既有檔案未能證明可安全合併。");
|
|
7583
|
-
console.log("⚠️ 這不是檔案壞掉;工具已停手,沒有覆寫 conflict 檔案。");
|
|
7584
|
-
console.log(
|
|
7585
|
-
console.log("");
|
|
7586
|
-
}
|
|
7587
|
+
if (conflictCount > 0) {
|
|
7588
|
+
console.log("⚠️ 狀態:有既有檔案未能證明可安全合併。");
|
|
7589
|
+
console.log("⚠️ 這不是檔案壞掉;工具已停手,沒有覆寫 conflict 檔案。");
|
|
7590
|
+
console.log(conflictRepairNextStepLine());
|
|
7591
|
+
console.log("");
|
|
7592
|
+
}
|
|
7587
7593
|
if (skippedCount > 0) {
|
|
7588
7594
|
console.log("你原本已有部分 AI 記憶檔,工具已保留它們,沒有覆寫。");
|
|
7589
7595
|
console.log("下一步先不要開始新任務;請在終端機執行以下預演,讓工具檢查能否安全補入口連接:");
|
|
@@ -7621,13 +7627,13 @@ function printUpgradeNextSteps(root, conflictCount) {
|
|
|
7621
7627
|
console.log("============================================================");
|
|
7622
7628
|
if (conflictCount > 0) {
|
|
7623
7629
|
console.log("⚠️ 升級未完成:有檔案未能證明可安全合併");
|
|
7624
|
-
console.log("============================================================");
|
|
7625
|
-
console.log("⚠️ 狀態:工具已保守停手,沒有建立目前交易或覆寫檔案。");
|
|
7626
|
-
console.log("⚠️ 這不是檔案壞掉;工具已停手,沒有覆寫 conflict 檔案。");
|
|
7627
|
-
console.log(
|
|
7628
|
-
console.log("============================================================");
|
|
7629
|
-
return;
|
|
7630
|
-
}
|
|
7630
|
+
console.log("============================================================");
|
|
7631
|
+
console.log("⚠️ 狀態:工具已保守停手,沒有建立目前交易或覆寫檔案。");
|
|
7632
|
+
console.log("⚠️ 這不是檔案壞掉;工具已停手,沒有覆寫 conflict 檔案。");
|
|
7633
|
+
console.log(conflictRepairNextStepLine());
|
|
7634
|
+
console.log("============================================================");
|
|
7635
|
+
return;
|
|
7636
|
+
}
|
|
7631
7637
|
console.log("🛠️ Kit migration 已通過離線遷移驗收;已由正式 doctor 的同輪讀回確認提交與健康使用同一狀態");
|
|
7632
7638
|
console.log("============================================================");
|
|
7633
7639
|
console.log("📋 如你正在進行中的工作對話已熟悉 Agent Handoff Kit,繼續使用原本的開工方式即可,無需重新做新手引導。");
|
|
@@ -10451,6 +10451,181 @@
|
|
|
10451
10451
|
"canonicalSha256": "cd696ae93f90ccbf0e0ae24f522c9a1a9d6482b0dd7011225096ab771d2c7fae"
|
|
10452
10452
|
}
|
|
10453
10453
|
}
|
|
10454
|
+
},
|
|
10455
|
+
"0.3.48": {
|
|
10456
|
+
"source": {
|
|
10457
|
+
"npm": {
|
|
10458
|
+
"spec": "@adamchanadam/agent-handoff-kit@0.3.48",
|
|
10459
|
+
"shasum": "64651194c90ff652ba9363e208051c3baa1a8991",
|
|
10460
|
+
"integrity": "sha512-10cW8atA5JkRMQ/G5K/ZaqQ6Ke/VAp6lX3tc4dgy7VcQr1aku9yxYRXa8kwq4vegI1EHfbHp29S1xaWBnnZjAg==",
|
|
10461
|
+
"entryCount": 35,
|
|
10462
|
+
"gitHead": "f85224d4964430b5806f0c246349754b394c0f9c"
|
|
10463
|
+
},
|
|
10464
|
+
"git": {
|
|
10465
|
+
"tag": "v0.3.48",
|
|
10466
|
+
"directObject": "f85224d4964430b5806f0c246349754b394c0f9c",
|
|
10467
|
+
"peeledCommit": null,
|
|
10468
|
+
"commit": "f85224d4964430b5806f0c246349754b394c0f9c"
|
|
10469
|
+
},
|
|
10470
|
+
"githubRelease": {
|
|
10471
|
+
"tag": "v0.3.48",
|
|
10472
|
+
"publishedAt": "2026-07-19T23:35:25Z"
|
|
10473
|
+
},
|
|
10474
|
+
"sourceDivergence": {
|
|
10475
|
+
"status": "same-commit",
|
|
10476
|
+
"npmGitHead": "f85224d4964430b5806f0c246349754b394c0f9c",
|
|
10477
|
+
"remoteTagCommit": "f85224d4964430b5806f0c246349754b394c0f9c"
|
|
10478
|
+
}
|
|
10479
|
+
},
|
|
10480
|
+
"manifest": {
|
|
10481
|
+
"AGENTS.md": {
|
|
10482
|
+
"state": "present",
|
|
10483
|
+
"contentId": "21cf076a3cd06c2f486e963153f5106c7adf37fc00fd55caddafce5a2587e54b",
|
|
10484
|
+
"rawSha256": "aa71a1e4f94f0d6e7eefc17dc554be322f9ad87dd487f48c0d342c89311df1dd",
|
|
10485
|
+
"normalizedSha256": "aa71a1e4f94f0d6e7eefc17dc554be322f9ad87dd487f48c0d342c89311df1dd",
|
|
10486
|
+
"canonicalSha256": "aa71a1e4f94f0d6e7eefc17dc554be322f9ad87dd487f48c0d342c89311df1dd"
|
|
10487
|
+
},
|
|
10488
|
+
"CLAUDE.md": {
|
|
10489
|
+
"state": "present",
|
|
10490
|
+
"contentId": "7a2cf08a1171762ebcb53f43036a2170655379416945258b9c85d4b189ecaecf",
|
|
10491
|
+
"rawSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad",
|
|
10492
|
+
"normalizedSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad",
|
|
10493
|
+
"canonicalSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad"
|
|
10494
|
+
},
|
|
10495
|
+
"GEMINI.md": {
|
|
10496
|
+
"state": "present",
|
|
10497
|
+
"contentId": "36da47034bb2ce6c760ddbbbbd49dccc1d17665dbb18bec56ffa3b26bac1c135",
|
|
10498
|
+
"rawSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986",
|
|
10499
|
+
"normalizedSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986",
|
|
10500
|
+
"canonicalSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986"
|
|
10501
|
+
},
|
|
10502
|
+
"START_NEXT_SESSION_PROMPT.txt": {
|
|
10503
|
+
"state": "present",
|
|
10504
|
+
"contentId": "210c34689425e5096dc47e8d83f753df3c533cc5ba00e38084c09483fc0b0775",
|
|
10505
|
+
"rawSha256": "84e8db7f54e699d0f83977b325b0bba0a57a6776ef53429e7e1dca01333e01f7",
|
|
10506
|
+
"normalizedSha256": "84e8db7f54e699d0f83977b325b0bba0a57a6776ef53429e7e1dca01333e01f7",
|
|
10507
|
+
"canonicalSha256": "6ca8b7c47204e781fb498cd05bb035da115fd03f19e7dca8f340e998922d32ee"
|
|
10508
|
+
},
|
|
10509
|
+
"dev/SESSION_HANDOFF.md": {
|
|
10510
|
+
"state": "present",
|
|
10511
|
+
"contentId": "3ad88dea4d8e078fad577db537cc446a7bdcc08b1ce062749d359aa296c267a4",
|
|
10512
|
+
"rawSha256": "eaf0b69d84c86b6ad566c43b7e67e840251ee873ba8711b0152426941f300024",
|
|
10513
|
+
"normalizedSha256": "eaf0b69d84c86b6ad566c43b7e67e840251ee873ba8711b0152426941f300024",
|
|
10514
|
+
"canonicalSha256": "b938678a44fc8f93bbd6203265f1e73a5e6e7668f7e315e0d289177f99c750b8"
|
|
10515
|
+
},
|
|
10516
|
+
"dev/SESSION_LOG.md": {
|
|
10517
|
+
"state": "present",
|
|
10518
|
+
"contentId": "7b6184ee4dabe89f504a894c3d4803f012d962c7af53c7f29801a8fb28d9d51c",
|
|
10519
|
+
"rawSha256": "fb6bfd7026a15f87a54cfa64fbd69f032538b0c3193372876a3722fb997a3a47",
|
|
10520
|
+
"normalizedSha256": "fb6bfd7026a15f87a54cfa64fbd69f032538b0c3193372876a3722fb997a3a47",
|
|
10521
|
+
"canonicalSha256": "fb6bfd7026a15f87a54cfa64fbd69f032538b0c3193372876a3722fb997a3a47"
|
|
10522
|
+
},
|
|
10523
|
+
"dev/PROJECT_INDEX.md": {
|
|
10524
|
+
"state": "present",
|
|
10525
|
+
"contentId": "cc6eb8c88f8b4f71b81ea010633450f3ee72e06a58b0513f2d35f048cc472f3a",
|
|
10526
|
+
"rawSha256": "1511a8e9468387c15d94e439273fe44830a8c67ee2072fd8b04ee27fd32e0a9b",
|
|
10527
|
+
"normalizedSha256": "1511a8e9468387c15d94e439273fe44830a8c67ee2072fd8b04ee27fd32e0a9b",
|
|
10528
|
+
"canonicalSha256": "1ff9d23d69aa723549047352302e8f6825cadc75494dd80c95721f2a1747f3bc"
|
|
10529
|
+
},
|
|
10530
|
+
"dev/DOC_SYNC_REGISTRY.md": {
|
|
10531
|
+
"state": "present",
|
|
10532
|
+
"contentId": "f6545b524dc440d3563041e04a05caff4229863f6cae2a39127f85a29a120249",
|
|
10533
|
+
"rawSha256": "56807afee836d3ce19cabb1d020ef37168880a405b5eb8c6d7347e25e94c36e6",
|
|
10534
|
+
"normalizedSha256": "56807afee836d3ce19cabb1d020ef37168880a405b5eb8c6d7347e25e94c36e6",
|
|
10535
|
+
"canonicalSha256": "56807afee836d3ce19cabb1d020ef37168880a405b5eb8c6d7347e25e94c36e6"
|
|
10536
|
+
},
|
|
10537
|
+
"dev/RULE_PACKS.md": {
|
|
10538
|
+
"state": "present",
|
|
10539
|
+
"contentId": "a92986fcb4f7630e533bacf114d096e8e655973de297ff972a1bf1de5610af4b",
|
|
10540
|
+
"rawSha256": "a3e433884fc6bf26448acfa79ba106acaaafe5b4bdb212cb8ce6dc4aaea2faaf",
|
|
10541
|
+
"normalizedSha256": "a3e433884fc6bf26448acfa79ba106acaaafe5b4bdb212cb8ce6dc4aaea2faaf",
|
|
10542
|
+
"canonicalSha256": "a3e433884fc6bf26448acfa79ba106acaaafe5b4bdb212cb8ce6dc4aaea2faaf"
|
|
10543
|
+
},
|
|
10544
|
+
"dev/PROJECT_DECISIONS.md": {
|
|
10545
|
+
"state": "present",
|
|
10546
|
+
"contentId": "3aae993bd5b85bf6b1d1d458f1bcf82c7d3105c843f053ffa13553bb5931b8c4",
|
|
10547
|
+
"rawSha256": "c2fbfb759a36145a92750226d0f7585d49ce0fa4bf1cfde474988ce510dc455e",
|
|
10548
|
+
"normalizedSha256": "c2fbfb759a36145a92750226d0f7585d49ce0fa4bf1cfde474988ce510dc455e",
|
|
10549
|
+
"canonicalSha256": "c2fbfb759a36145a92750226d0f7585d49ce0fa4bf1cfde474988ce510dc455e"
|
|
10550
|
+
},
|
|
10551
|
+
"dev/rules/safety.md": {
|
|
10552
|
+
"state": "present",
|
|
10553
|
+
"contentId": "dd6bcf74722d038f76d202e2044a6583a6e6ad107fbb010520e513eec799ff4a",
|
|
10554
|
+
"rawSha256": "685e501bb8a8cf721dd742312c9160a46a1066a4a875235eaaf579c1c8e72ab0",
|
|
10555
|
+
"normalizedSha256": "685e501bb8a8cf721dd742312c9160a46a1066a4a875235eaaf579c1c8e72ab0",
|
|
10556
|
+
"canonicalSha256": "685e501bb8a8cf721dd742312c9160a46a1066a4a875235eaaf579c1c8e72ab0"
|
|
10557
|
+
},
|
|
10558
|
+
"dev/rules/coding.md": {
|
|
10559
|
+
"state": "present",
|
|
10560
|
+
"contentId": "1c6deb9a5a281c13e97b0ac96079e9e1beccbd1ff106186e7a6ac78c0eeb75c2",
|
|
10561
|
+
"rawSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4",
|
|
10562
|
+
"normalizedSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4",
|
|
10563
|
+
"canonicalSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4"
|
|
10564
|
+
},
|
|
10565
|
+
"dev/rules/writing.md": {
|
|
10566
|
+
"state": "present",
|
|
10567
|
+
"contentId": "ceee5412520ba860e6b40de46bb164e2ce3919d2197d5fadb926198eb7dddd3b",
|
|
10568
|
+
"rawSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593",
|
|
10569
|
+
"normalizedSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593",
|
|
10570
|
+
"canonicalSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593"
|
|
10571
|
+
},
|
|
10572
|
+
"dev/rules/research.md": {
|
|
10573
|
+
"state": "present",
|
|
10574
|
+
"contentId": "4414f9c82c6d04ad49d7446f4b0740055242f425ef5b00391d9c8c78c96c0f66",
|
|
10575
|
+
"rawSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104",
|
|
10576
|
+
"normalizedSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104",
|
|
10577
|
+
"canonicalSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104"
|
|
10578
|
+
},
|
|
10579
|
+
"dev/rules/agent-governance.md": {
|
|
10580
|
+
"state": "present",
|
|
10581
|
+
"contentId": "d3751dc9cb96774413fdd32895bc0c04fcf177346945dab52ffb3cc0ad3a6855",
|
|
10582
|
+
"rawSha256": "33baedd735ee7ec83583f37122a7bfea5c986536b4be6e3d14653f66acec0e77",
|
|
10583
|
+
"normalizedSha256": "33baedd735ee7ec83583f37122a7bfea5c986536b4be6e3d14653f66acec0e77",
|
|
10584
|
+
"canonicalSha256": "33baedd735ee7ec83583f37122a7bfea5c986536b4be6e3d14653f66acec0e77"
|
|
10585
|
+
},
|
|
10586
|
+
"dev/rules/release.md": {
|
|
10587
|
+
"state": "present",
|
|
10588
|
+
"contentId": "b0a0c9dea88016185f4093f9be4ce3c0e29904222e21dd1fa1735fcc1bb7e744",
|
|
10589
|
+
"rawSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7",
|
|
10590
|
+
"normalizedSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7",
|
|
10591
|
+
"canonicalSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7"
|
|
10592
|
+
},
|
|
10593
|
+
"dev/rules/knowledge.md": {
|
|
10594
|
+
"state": "present",
|
|
10595
|
+
"contentId": "a5944e8e165bd48e211868f5fb1c4d97754151c35d4bd547cecc4242a4292cd3",
|
|
10596
|
+
"rawSha256": "590bfa8fb176f344f5a030334cbe3292b9c9a30e89f00d1aa0aa1fb86eed6c7c",
|
|
10597
|
+
"normalizedSha256": "590bfa8fb176f344f5a030334cbe3292b9c9a30e89f00d1aa0aa1fb86eed6c7c",
|
|
10598
|
+
"canonicalSha256": "590bfa8fb176f344f5a030334cbe3292b9c9a30e89f00d1aa0aa1fb86eed6c7c"
|
|
10599
|
+
},
|
|
10600
|
+
"dev/rules/communication.md": {
|
|
10601
|
+
"state": "present",
|
|
10602
|
+
"contentId": "34fd0034cbc75dad43f789b86a414763f01916dda4d59876db9c4d8d92ae6a87",
|
|
10603
|
+
"rawSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591",
|
|
10604
|
+
"normalizedSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591",
|
|
10605
|
+
"canonicalSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591"
|
|
10606
|
+
},
|
|
10607
|
+
"dev/rules/closeout.md": {
|
|
10608
|
+
"state": "present",
|
|
10609
|
+
"contentId": "77c7cd99b3f1cc7fa6416f1caba476361bc332eb6bc8d22c35a84892b1399c6c",
|
|
10610
|
+
"rawSha256": "fc6263a00bbdcfc97772a4528d9f4a33d53c63b6cf99a56941100aea1fd3cb01",
|
|
10611
|
+
"normalizedSha256": "fc6263a00bbdcfc97772a4528d9f4a33d53c63b6cf99a56941100aea1fd3cb01",
|
|
10612
|
+
"canonicalSha256": "fc6263a00bbdcfc97772a4528d9f4a33d53c63b6cf99a56941100aea1fd3cb01"
|
|
10613
|
+
},
|
|
10614
|
+
"dev/rules/onboarding.md": {
|
|
10615
|
+
"state": "present",
|
|
10616
|
+
"contentId": "e67b34ca3eb5e3aac6e36aa3a3929daae0c881e803badb6d22d5837fc37588ab",
|
|
10617
|
+
"rawSha256": "ae0ab942b86e216e29e8996f17947442d7568910b84899b6df2b836b1fcdbed3",
|
|
10618
|
+
"normalizedSha256": "ae0ab942b86e216e29e8996f17947442d7568910b84899b6df2b836b1fcdbed3",
|
|
10619
|
+
"canonicalSha256": "ae0ab942b86e216e29e8996f17947442d7568910b84899b6df2b836b1fcdbed3"
|
|
10620
|
+
},
|
|
10621
|
+
"dev/rules/integrations.md": {
|
|
10622
|
+
"state": "present",
|
|
10623
|
+
"contentId": "6286f7d7b45803071ffddcd1ca864cf87213f0f21c3b195d10261a8c4187dfd1",
|
|
10624
|
+
"rawSha256": "cd696ae93f90ccbf0e0ae24f522c9a1a9d6482b0dd7011225096ab771d2c7fae",
|
|
10625
|
+
"normalizedSha256": "cd696ae93f90ccbf0e0ae24f522c9a1a9d6482b0dd7011225096ab771d2c7fae",
|
|
10626
|
+
"canonicalSha256": "cd696ae93f90ccbf0e0ae24f522c9a1a9d6482b0dd7011225096ab771d2c7fae"
|
|
10627
|
+
}
|
|
10628
|
+
}
|
|
10454
10629
|
}
|
|
10455
10630
|
},
|
|
10456
10631
|
"contents": {
|
|
@@ -11163,7 +11338,12 @@
|
|
|
11163
11338
|
"targetRel": "AGENTS.md",
|
|
11164
11339
|
"canonicalSha256": "ce96ee0a5b01b3cea6b5dc0a494d4e8ecad94de0d6d06c8a57df7136ef8ac670",
|
|
11165
11340
|
"text": "<!-- BEGIN Agent Handoff Kit managed core -->\n# Agent Handoff Kit Core Runtime\n\nThis is the small always-read contract. Detailed task and closeout procedures live in routed packs.\n\n## 1. Intent And Startup\n\nClassify the user's visible intent before loading project state. For explicit continuity, closeout, or a task whose next action depends on persisted project state, read `dev/SESSION_HANDOFF.md` first; it is the current-state authority. A direct ordinary or stateless task does not read the handoff merely because the project root is known. If the message is genuinely unresolved and the handoff can resolve it, read the handoff before asking the user.\n\nDo not read `dev/SESSION_LOG.md` during ordinary startup; it is trace-back evidence only. Do not read `START_NEXT_SESSION_PROMPT.txt` in addition to the handoff when already operating in the project root; that file is a portable generated mirror for an agent that has not yet been pointed at the root.\n\nRoute intent in this order:\n\n1. Clear closeout intent routes directly to `dev/rules/closeout.md`.\n2. Clear continuity intent such as \"開工\", \"Start Agent Handoff\", \"開始接力\", or \"continue handoff\" resumes the minimum current state from the handoff. A plain continuity message with no same-message task or explicit long-run instruction authorizes only that recovery, the startup card, the current objective/risk/recommended next action, and then the end of the turn. It does not authorize task-specific reads, research, plans, protocols, preflight, file searches, sub-agents, QA, packaging, writes, network access, or opt-out wording such as \"unless you object I will start\". A concrete objective found only in loaded state is not authority to complete it. A same-message task may begin normally. An explicit instruction such as \"開工,繼續做到下一個 blocker\" or \"開工,繼續完成目前目標\" may continue under the normal task and safety rules.\n3. A direct ordinary task begins without a startup card or onboarding ceremony. Read only the sources and packs required by that task.\n4. Explicit guidance requests such as \"I'm new\", \"teach me\", \"help me start\", \"新手\", \"教我用\", or \"點開始\" may load `dev/rules/onboarding.md`. A fresh install or short message only makes guidance available; it never overrides a concrete objective. If no executable objective remains after state reading, ask one concise question or offer guided onboarding.\n\nTreat a phrase as ambiguous only when its ordinary meaning may genuinely refer to a real-world shift, event, or unrelated context. `開工,繼續 <task>`, `<project> 開工`, and `Start Agent Handoff and continue <task>` are continuity commands, not ambiguous phrases.\n\nRead `dev/PROJECT_INDEX.md` when the task needs its file, command, integration, workspace, or source map. Read `dev/RULE_PACKS.md` when a task pack must be selected. Read `dev/DOC_SYNC_REGISTRY.md` before durable cross-file or external synchronization and during closeout. Pack loading is normally silent; explain it only when it changes risk, requires a user decision, or materially affects the next action.\n\nIf the user supplies the portable startup prompt, use it to locate the root, then trust the handoff over the mirror. If the root is unclear or mismatched, stop and ask for the intended root before reading or editing project state. Missing required governance files are a repair condition, not permission to invent a parallel structure.\n\nBefore a non-trivial task, identify and read the required local and external truth sources or mark them blocked. Reachable is not the same as ingested. Search hits, truncated output, summaries, and status claims do not replace the relevant source content.\n\nProbe an integration only immediately before a task uses it, when the handoff explicitly identifies it as a dependency for the current objective, or when the user requests an integration health check. `TBD`, examples, blank rows, and undeclared placeholders are not installed integrations. Record `Last Verified` only after a real probe and through the normal persistence gate. Never write integration status merely because a session started.\n\nShow the startup card only for explicit continuity startup. For a plain continuity message, show the card after the minimum state recovery and end the turn; its recommended next action is advice, not permission to act. An explicit same-message task or long-run continuation may combine the card with its first useful action. Direct ordinary tasks do not show the card. If onboarding is explicitly requested, combine any card and guidance in one response.\n\nUse a verified version already present in loaded state. If obtaining it would require reading an otherwise unnecessary file, print `version unverified`; do not create a second version source merely to fill the card.\n\n```text\n /\\_/\\ Agent Handoff Kit v<version>\n ( o.o ) continuity ready\n > ^ <\n\n🔎 交接狀態:<loaded / new install / resumed>\n📌 目前目標:<current objective>\n⚠️ 注意事項:<important boundary or none>\n🚀 推薦下一步:<one action + reason>\n```\n\nUse the full product name, plain user language, and one recommended next action. Never print the literal placeholder `v<version>`.\n\n## 2. Proportionate Work Loop\n\nApply PLAN → READ → CHANGE → QC internally and in proportion to task state and risk. Do not make the user watch governance ceremony that does not help the task.\n\nIn every user-facing reply, lead with ordinary language: state the result and its practical effect, then the next action when one helps. Put exact commands, errors, hashes, and detailed evidence after that; brevity must not hide uncertainty or safety risk.\n\n- Simple answers, pure conversation or creation with no durable state, and low-risk tasks with an obvious target may proceed directly with proportionate reading and checking.\n- Non-trivial work reads relevant sources before changing them.\n- High-risk work states scope, impact, acceptance, and required confirmation before writes.\n- External skill flows, subagents, task plans, demo workspaces, and another tool's finish step do not replace the active root's persistence decision.\n- Materially changed Markdown governance artifacts must be indexed, synchronized, consolidated into their authoritative home, or explicitly classified as temporary / one-time evidence. Other durable formats follow the same human governance rule, but the bundled doctor does not claim to scan them.\n\n## 2.1 Persistence Gate\n\nChoose exactly one tier after a task:\n\n1. No persistence: no durable fact was produced. One-off answers, transient output, active unapproved drafts, and routine rerunnable checks normally use this tier.\n2. Lightweight checkpoint: a durable fact affects future action while the session continues or may be interrupted. Write only its smallest correct home; do not regenerate the startup mirror or perform full closeout.\n3. Full closeout: explicit end-of-session / handoff intent, a tool or day boundary, or completed external / release / governance work that the next agent must continue. Load `dev/rules/closeout.md`.\n\nRoute current objective, next action, active risk, blocker, and startup-needed facts to `dev/SESSION_HANDOFF.md`; chronological evidence to `dev/SESSION_LOG.md`; maps to `dev/PROJECT_INDEX.md`; sync obligations to `dev/DOC_SYNC_REGISTRY.md`; long-term rationale to `dev/PROJECT_DECISIONS.md`; and reusable procedures to the relevant pack, registered reference, or QA check. Do not store the same task contract or reusable rule in several homes.\n\nExternal effects are never implied permission for commit, push, publish, release, deployment, cleanup, or another workspace write. Record verified external impact through the relevant integrations, release, safety, and closeout contracts without exposing private content or secrets.\n\n## 2.2 Upgrade Completion\n\nThe CLI owns upgrade truth. An upgrade is complete only when:\n\n1. The root is not newer than the CLI and every target passes read-only classification.\n2. Conflict produces zero governance-target and version writes.\n3. Staged outputs pass the offline migration acceptance gate: root boundary, structure, cross-file invariants, preservation hashes, and version transition.\n4. The recoverable transaction commits without an unresolved journal; only a failure caused by this transaction triggers rollback.\n5. Whole-project `doctor` reports project health separately. Pre-existing or unrelated health failures do not convert a correct migration into a destructive rollback; new migration-caused blockers do.\n6. The migration report records attempted version, committed version, transaction state, actions, redacted reasons, and backup locations without credential values.\n\nDo not use \"upgrade completed\" to mean \"the entire project is healthy\". Report `migration committed` and `project health` separately. Conflict, incomplete recovery, failed migration acceptance, and future-version roots are not completed upgrades.\n\n## 3. Safety Baseline\n\nDo not delete, reset, overwrite user-owned content, bulk-move, publish, change permissions, or perform another irreversible or external action without the required explicit authorization.\n\nNamed prohibited destructive commands in `dev/rules/safety.md` remain prohibited even when requested. Never use a weaker pack or local instruction to bypass core safety.\n\nVerify the selected root and real target boundaries before writes. Do not follow a link, junction, mount, or computed path outside the confirmed root. Do not expose credential values in output, reports, backups, tests, or logs. Permission or lock failure is a stop condition, not permission to elevate or switch to a riskier command.\n\nDo not modify unrelated files or erase unexpected user changes. Do not claim completion without read-back evidence and proportionate checks.\n\n## 4. Closeout Trigger\n\nClear end-of-session or handoff intent such as \"收工\", \"Wrap up Agent Handoff\", \"closeout\", \"wrap up\", or \"handoff\" triggers full closeout, not a chat-only summary. Load `dev/rules/closeout.md` and follow its complete contract. `收工,記得 <handoff requirement>` and equivalent closeout-plus-instruction phrases are clear closeout intent. Ask one concise confirmation only when the phrase genuinely refers to an unrelated real-world closing or shift.\n\nThe always-enforced closeout invariants are:\n\n1. Current state lives in `dev/SESSION_HANDOFF.md`; trace evidence lives in `dev/SESSION_LOG.md`.\n2. Completed, pending, risk, validation, and opening-message lifecycle states agree.\n3. `START_NEXT_SESSION_PROMPT.txt` is regenerated from the sole authoritative handoff block and no third full copy is retained.\n4. Closeout is not complete until required files are written, read back, and the available closeout checks pass.\n5. After those checks, render the final card with `agent-handoff-kit closeout-status --root <project root>`; only its `status: complete` output may say `handoff saved`. A nonzero / `blocked` result is an honest blocked closeout, not a completed one.\n6. Git commit, push, release, publish, deployment, deletion, and permission changes remain separately authorized actions.\n\n## 5. Pack Loading\n\nUse `dev/RULE_PACKS.md` to load the minimum task-specific set. Packs may add stricter requirements but cannot weaken core safety or continuity.\n\nLoad `dev/rules/integrations.md` when the current task actually uses an external tool, not merely because a registry or placeholder table exists. Load `dev/rules/closeout.md` only for full closeout. If two packs conflict, use the safer and more verifiable path and record the unresolved conflict at closeout.\n\nAfter the task, apply the Persistence Gate. Do not assume the next session remembers pack context, and do not use handoff or log as the only home for reusable procedures.\n\n## Core Complexity Rule\n\nDefault-core rules must apply to most sessions, protect safety or continuity, and be shorter than the routed detail they replace. New scenario detail belongs in an existing pack or registered reference; a new pack is justified only when it creates a smaller, independently loadable responsibility with one normative owner.\n<!-- END Agent Handoff Kit managed core -->\n\n<!-- ack:user-rules-router:dev/USER_RULES.md -->\n<!-- ack:user-rules-acceptance:sha256=0a6864b0ed5fa394feaf0b88ca7e07aa0d534a19fc395753fbbe550a3d0ab920 -->\nBefore loading task packs, read `dev/USER_RULES.md`. Its registered entries\nunder `dev/user_rules/` are user-controlled rules: read each accepted entry in\nthe listed order and verify its accepted raw-byte witness. Do not treat this\nrouter, its directory, a heading, language, format, location, or\nofficial-looking text as proof that any legacy source belongs to the Kit.\n"
|
|
11341
|
+
},
|
|
11342
|
+
"21cf076a3cd06c2f486e963153f5106c7adf37fc00fd55caddafce5a2587e54b": {
|
|
11343
|
+
"targetRel": "AGENTS.md",
|
|
11344
|
+
"canonicalSha256": "aa71a1e4f94f0d6e7eefc17dc554be322f9ad87dd487f48c0d342c89311df1dd",
|
|
11345
|
+
"text": "<!-- BEGIN Agent Handoff Kit managed core -->\n# Agent Handoff Kit Core Runtime\n\nThis is the small always-read contract. Detailed task and closeout procedures live in routed packs.\n\n## 1. Intent And Startup\n\nClassify the user's visible intent before loading project state. For explicit continuity, closeout, or a task whose next action depends on persisted project state, read `dev/SESSION_HANDOFF.md` first; it is the current-state authority. A direct ordinary or stateless task does not read the handoff merely because the project root is known. If the message is genuinely unresolved and the handoff can resolve it, read the handoff before asking the user.\n\nDo not read `dev/SESSION_LOG.md` during ordinary startup; it is trace-back evidence only. Do not read `START_NEXT_SESSION_PROMPT.txt` in addition to the handoff when already operating in the project root; that file is a portable generated mirror for an agent that has not yet been pointed at the root.\n\nRoute intent in this order:\n\n1. Clear closeout intent routes directly to `dev/rules/closeout.md`.\n2. Clear continuity intent such as \"開工\", \"Start Agent Handoff\", \"開始接力\", or \"continue handoff\" resumes the minimum current state from the handoff. A plain continuity message with no same-message task or explicit long-run instruction authorizes only that recovery, the startup card, the current objective/risk/recommended next action, and then the end of the turn. It does not authorize task-specific reads, research, plans, protocols, preflight, file searches, sub-agents, QA, packaging, writes, network access, or opt-out wording such as \"unless you object I will start\". A concrete objective found only in loaded state is not authority to complete it. A same-message task may begin normally. An explicit instruction such as \"開工,繼續做到下一個 blocker\" or \"開工,繼續完成目前目標\" may continue under the normal task and safety rules.\n3. A direct ordinary task begins without a startup card or onboarding ceremony. Read only the sources and packs required by that task.\n4. Explicit guidance requests such as \"I'm new\", \"teach me\", \"help me start\", \"新手\", \"教我用\", or \"點開始\" may load `dev/rules/onboarding.md`. A fresh install or short message only makes guidance available; it never overrides a concrete objective. If no executable objective remains after state reading, ask one concise question or offer guided onboarding.\n\nTreat a phrase as ambiguous only when its ordinary meaning may genuinely refer to a real-world shift, event, or unrelated context. `開工,繼續 <task>`, `<project> 開工`, and `Start Agent Handoff and continue <task>` are continuity commands, not ambiguous phrases.\n\nRead `dev/PROJECT_INDEX.md` when the task needs its file, command, integration, workspace, or source map. Read `dev/RULE_PACKS.md` when a task pack must be selected. Read `dev/DOC_SYNC_REGISTRY.md` before durable cross-file or external synchronization and during closeout. Pack loading is normally silent; explain it only when it changes risk, requires a user decision, or materially affects the next action.\n\nIf the user supplies the portable startup prompt, use it to locate the root, then trust the handoff over the mirror. If the root is unclear or mismatched, stop and ask for the intended root before reading or editing project state. Missing required governance files are a repair condition, not permission to invent a parallel structure.\n\nBefore a non-trivial task, identify and read the required local and external truth sources or mark them blocked. Reachable is not the same as ingested. Search hits, truncated output, summaries, and status claims do not replace the relevant source content.\n\nProbe an integration only immediately before a task uses it, when the handoff explicitly identifies it as a dependency for the current objective, or when the user requests an integration health check. `TBD`, examples, blank rows, and undeclared placeholders are not installed integrations. Record `Last Verified` only after a real probe and through the normal persistence gate. Never write integration status merely because a session started.\n\nShow the startup card only for explicit continuity startup. For a plain continuity message, show the card after the minimum state recovery and end the turn; its recommended next action is advice, not permission to act. An explicit same-message task or long-run continuation may combine the card with its first useful action. Direct ordinary tasks do not show the card. If onboarding is explicitly requested, combine any card and guidance in one response.\n\nUse a verified version already present in loaded state. If obtaining it would require reading an otherwise unnecessary file, print `version unverified`; do not create a second version source merely to fill the card.\n\n```text\n /\\_/\\ Agent Handoff Kit v<version>\n ( o.o ) continuity ready\n > ^ <\n\n🔎 交接狀態:<loaded / new install / resumed>\n📌 目前目標:<current objective>\n⚠️ 注意事項:<important boundary or none>\n🚀 推薦下一步:<one action + reason>\n```\n\nUse the full product name, plain user language, and one recommended next action. Never print the literal placeholder `v<version>`.\n\n## 2. Proportionate Work Loop\n\nApply PLAN → READ → CHANGE → QC internally and in proportion to task state and risk. Do not make the user watch governance ceremony that does not help the task.\n\nIn every user-facing reply, lead with ordinary language: state the result and its practical effect, then the next action when one helps. Put exact commands, errors, hashes, and detailed evidence after that; brevity must not hide uncertainty or safety risk.\n\n- Simple answers, pure conversation or creation with no durable state, and low-risk tasks with an obvious target may proceed directly with proportionate reading and checking.\n- Non-trivial work reads relevant sources before changing them.\n- High-risk work states scope, impact, acceptance, and required confirmation before writes.\n- External skill flows, subagents, task plans, demo workspaces, and another tool's finish step do not replace the active root's persistence decision.\n- Materially changed Markdown governance artifacts must be indexed, synchronized, consolidated into their authoritative home, or explicitly classified as temporary / one-time evidence. Other durable formats follow the same human governance rule, but the bundled doctor does not claim to scan them.\n\n## 2.1 Persistence Gate\n\nChoose exactly one tier after a task:\n\n1. No persistence: no durable fact was produced. One-off answers, transient output, active unapproved drafts, and routine rerunnable checks normally use this tier.\n2. Lightweight checkpoint: a durable fact affects future action while the session continues or may be interrupted. Write only its smallest correct home; do not regenerate the startup mirror or perform full closeout.\n3. Full closeout: explicit end-of-session / handoff intent, a tool or day boundary, or completed external / release / governance work that the next agent must continue. Load `dev/rules/closeout.md`.\n\nRoute current objective, next action, active risk, blocker, and startup-needed facts to `dev/SESSION_HANDOFF.md`; chronological evidence to `dev/SESSION_LOG.md`; maps to `dev/PROJECT_INDEX.md`; sync obligations to `dev/DOC_SYNC_REGISTRY.md`; long-term rationale to `dev/PROJECT_DECISIONS.md`; and reusable procedures to the relevant pack, registered reference, or QA check. Do not store the same task contract or reusable rule in several homes.\n\nExternal effects are never implied permission for commit, push, publish, release, deployment, cleanup, or another workspace write. Record verified external impact through the relevant integrations, release, safety, and closeout contracts without exposing private content or secrets.\n\n## 2.2 Upgrade Completion\n\nThe CLI owns upgrade truth. An upgrade is complete only when:\n\n1. The root is not newer than the CLI and every target passes read-only classification.\n2. Conflict produces zero governance-target and version writes.\n3. Staged outputs pass the offline migration acceptance gate: root boundary, structure, cross-file invariants, preservation hashes, and version transition.\n4. The recoverable transaction commits without an unresolved journal; only a failure caused by this transaction triggers rollback.\n5. Whole-project `doctor` reports project health separately. Pre-existing or unrelated health failures do not convert a correct migration into a destructive rollback; new migration-caused blockers do.\n6. The migration report records attempted version, committed version, transaction state, actions, redacted reasons, and backup locations without credential values.\n\nDo not use \"upgrade completed\" to mean \"the entire project is healthy\". Report `migration committed` and `project health` separately. Conflict, incomplete recovery, failed migration acceptance, and future-version roots are not completed upgrades.\n\n## 3. Safety Baseline\n\nDo not delete, reset, overwrite user-owned content, bulk-move, publish, change permissions, or perform another irreversible or external action without the required explicit authorization.\n\nNamed prohibited destructive commands in `dev/rules/safety.md` remain prohibited even when requested. Never use a weaker pack or local instruction to bypass core safety.\n\nVerify the selected root and real target boundaries before writes. Do not follow a link, junction, mount, or computed path outside the confirmed root. Do not expose credential values in output, reports, backups, tests, or logs. Permission or lock failure is a stop condition, not permission to elevate or switch to a riskier command.\n\nDo not modify unrelated files or erase unexpected user changes. Do not claim completion without read-back evidence and proportionate checks.\n\n## 4. Closeout Trigger\n\nClear end-of-session or handoff intent such as \"收工\", \"Wrap up Agent Handoff\", \"closeout\", \"wrap up\", or \"handoff\" triggers full closeout, not a chat-only summary. Load `dev/rules/closeout.md` and follow its complete contract. `收工,記得 <handoff requirement>` and equivalent closeout-plus-instruction phrases are clear closeout intent. Ask one concise confirmation only when the phrase genuinely refers to an unrelated real-world closing or shift.\n\nThe always-enforced closeout invariants are:\n\n1. Current state lives in `dev/SESSION_HANDOFF.md`; trace evidence lives in `dev/SESSION_LOG.md`.\n2. Completed, pending, risk, validation, and opening-message lifecycle states agree.\n3. `START_NEXT_SESSION_PROMPT.txt` is regenerated from the sole authoritative handoff block and no third full copy is retained.\n4. Closeout is not complete until required files are written, read back, and the available closeout checks pass.\n5. After those checks, render the final card with `agent-handoff-kit closeout-status --root <project root>`; only its `status: complete` output may say `handoff saved`. A nonzero / `blocked` result is an honest blocked closeout, not a completed one.\n6. Git commit, push, release, publish, deployment, deletion, and permission changes remain separately authorized actions.\n\n## 5. Pack Loading\n\nUse `dev/RULE_PACKS.md` to load the minimum task-specific set. Packs may add stricter requirements but cannot weaken core safety or continuity.\n\nLoad `dev/rules/integrations.md` when the current task actually uses an external tool, not merely because a registry or placeholder table exists. Load `dev/rules/closeout.md` only for full closeout. If two packs conflict, use the safer and more verifiable path and record the unresolved conflict at closeout.\n\nAfter the task, apply the Persistence Gate. Do not assume the next session remembers pack context, and do not use handoff or log as the only home for reusable procedures.\n\n## Core Complexity Rule\n\nDefault-core rules must apply to most sessions, protect safety or continuity, and be shorter than the routed detail they replace. New scenario detail belongs in an existing pack or registered reference; a new pack is justified only when it creates a smaller, independently loadable responsibility with one normative owner.\n<!-- END Agent Handoff Kit managed core -->\n\n<!-- ack:user-rules-router:dev/USER_RULES.md -->\n<!-- ack:user-rules-acceptance:sha256=49b3f1c30bdb6ce297e911b763c7ef219aec8e61a8f19727cebfe8a2444941fa -->\nBefore loading task packs, read `dev/USER_RULES.md`. Its registered entries\nunder `dev/user_rules/` are user-controlled rules: read each accepted entry in\nthe listed order and verify its accepted raw-byte witness. Do not treat this\nrouter, its directory, a heading, language, format, location, or\nofficial-looking text as proof that any legacy source belongs to the Kit.\n"
|
|
11166
11346
|
}
|
|
11167
11347
|
},
|
|
11168
|
-
"catalogDigestSha256": "
|
|
11348
|
+
"catalogDigestSha256": "e7d1efd4253657d79c6a0a991d8388bf46e5e3107bed96a666a03025a6bb59d8"
|
|
11169
11349
|
}
|
|
@@ -3,12 +3,12 @@ import { readFile } from "node:fs/promises";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
|
|
6
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
-
const defaultCatalogPath = path.join(__dirname, "migration-baselines", "official-origin-catalog.json");
|
|
8
|
-
const requiredArtifactBoundManagedSegments = Object.freeze([
|
|
9
|
-
Object.freeze({ version: "0.3.38", targetRel: "AGENTS.md" }),
|
|
10
|
-
Object.freeze({ version: "0.3.41", targetRel: "AGENTS.md" })
|
|
11
|
-
]);
|
|
6
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const defaultCatalogPath = path.join(__dirname, "migration-baselines", "official-origin-catalog.json");
|
|
8
|
+
const requiredArtifactBoundManagedSegments = Object.freeze([
|
|
9
|
+
Object.freeze({ version: "0.3.38", targetRel: "AGENTS.md" }),
|
|
10
|
+
Object.freeze({ version: "0.3.41", targetRel: "AGENTS.md" })
|
|
11
|
+
]);
|
|
12
12
|
|
|
13
13
|
export const OFFICIAL_ORIGIN_CATALOG_SCHEMA = 1;
|
|
14
14
|
|
|
@@ -27,7 +27,7 @@ export function validateOfficialOriginCatalog(catalog) {
|
|
|
27
27
|
|
|
28
28
|
const targets = catalog.installedTargets.map((item) => item.targetRel);
|
|
29
29
|
const referenced = new Set();
|
|
30
|
-
for (const [version, release] of Object.entries(catalog.releases)) {
|
|
30
|
+
for (const [version, release] of Object.entries(catalog.releases)) {
|
|
31
31
|
if (JSON.stringify(Object.keys(release.manifest)) !== JSON.stringify(targets)) {
|
|
32
32
|
throw new Error(`official origin catalog manifest coverage mismatch: ${version}`);
|
|
33
33
|
}
|
|
@@ -45,15 +45,15 @@ export function validateOfficialOriginCatalog(catalog) {
|
|
|
45
45
|
}
|
|
46
46
|
referenced.add(entry.contentId);
|
|
47
47
|
}
|
|
48
|
-
for (const targetRel of Object.keys(release.managedSegments ?? {})) {
|
|
49
|
-
getArtifactBoundManagedSegment({ version, targetRel, catalog });
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
for (const required of requiredArtifactBoundManagedSegments) {
|
|
53
|
-
if (!getArtifactBoundManagedSegment({ ...required, catalog })) {
|
|
54
|
-
throw new Error(`official origin catalog missing required managed segment: ${required.version} ${required.targetRel}`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
48
|
+
for (const targetRel of Object.keys(release.managedSegments ?? {})) {
|
|
49
|
+
getArtifactBoundManagedSegment({ version, targetRel, catalog });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
for (const required of requiredArtifactBoundManagedSegments) {
|
|
53
|
+
if (!getArtifactBoundManagedSegment({ ...required, catalog })) {
|
|
54
|
+
throw new Error(`official origin catalog missing required managed segment: ${required.version} ${required.targetRel}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
57
|
|
|
58
58
|
for (const [contentId, content] of Object.entries(catalog.contents)) {
|
|
59
59
|
if (contentId !== sha256(`${content.targetRel}\0${content.text}`)) {
|
|
@@ -15,11 +15,11 @@ const formalEntryTargets = Object.freeze([
|
|
|
15
15
|
"START_NEXT_SESSION_PROMPT.txt"
|
|
16
16
|
]);
|
|
17
17
|
|
|
18
|
-
const dynamicDirectories = Object.freeze([
|
|
19
|
-
{ relative: "dev/governance_migrations", classification: "transaction-state" },
|
|
20
|
-
{ relative: "dev/SESSION_LOG_archive", classification: "session-log-archive" },
|
|
21
|
-
{ relative: "dev/session_log_archive", classification: "legacy-session-log-archive" }
|
|
22
|
-
]);
|
|
18
|
+
const dynamicDirectories = Object.freeze([
|
|
19
|
+
{ relative: "dev/governance_migrations", classification: "transaction-state" },
|
|
20
|
+
{ relative: "dev/SESSION_LOG_archive", classification: "session-log-archive" },
|
|
21
|
+
{ relative: "dev/session_log_archive", classification: "legacy-session-log-archive" }
|
|
22
|
+
]);
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Builds a read-only, hash-bound description of the Kit data that an upgrade
|
|
@@ -155,14 +155,14 @@ export async function buildUpgradeInventory({ root, contracts = installedFileCon
|
|
|
155
155
|
formalEntryTargets: formalEntryTargets.filter((target) => entries.has(target))
|
|
156
156
|
});
|
|
157
157
|
|
|
158
|
-
async function addTree(relativeDirectory, classification) {
|
|
159
|
-
const normalized = normalizeProjectRelative(relativeDirectory);
|
|
160
|
-
if (!normalized) {
|
|
161
|
-
addBlocker(String(relativeDirectory), "dynamic directory escapes the selected project root");
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
if (!(await hasExactProjectPath(rootPath, normalized))) return;
|
|
165
|
-
const absolute = path.resolve(rootPath, normalized);
|
|
158
|
+
async function addTree(relativeDirectory, classification) {
|
|
159
|
+
const normalized = normalizeProjectRelative(relativeDirectory);
|
|
160
|
+
if (!normalized) {
|
|
161
|
+
addBlocker(String(relativeDirectory), "dynamic directory escapes the selected project root");
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (!(await hasExactProjectPath(rootPath, normalized))) return;
|
|
165
|
+
const absolute = path.resolve(rootPath, normalized);
|
|
166
166
|
const stats = await lstat(absolute).catch((error) => {
|
|
167
167
|
if (error?.code === "ENOENT") return null;
|
|
168
168
|
throw error;
|
|
@@ -183,26 +183,26 @@ export async function buildUpgradeInventory({ root, contracts = installedFileCon
|
|
|
183
183
|
else if (item.isFile()) await addFile(child, classification, { from: "dynamic-state", via: normalized }, false);
|
|
184
184
|
else addBlocker(child, "dynamic inventory source is not a regular file or directory");
|
|
185
185
|
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
async function hasExactProjectPath(rootPath, normalized) {
|
|
190
|
-
const parts = normalized.split("/");
|
|
191
|
-
let current = rootPath;
|
|
192
|
-
for (const part of parts) {
|
|
193
|
-
const entries = await readdir(current, { withFileTypes: true }).catch((error) => {
|
|
194
|
-
if (error?.code === "ENOENT") return null;
|
|
195
|
-
throw error;
|
|
196
|
-
});
|
|
197
|
-
if (!entries) return false;
|
|
198
|
-
const exact = entries.find((entry) => entry.name === part);
|
|
199
|
-
if (!exact) return false;
|
|
200
|
-
current = path.join(current, exact.name);
|
|
201
|
-
}
|
|
202
|
-
return true;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/**
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
async function hasExactProjectPath(rootPath, normalized) {
|
|
190
|
+
const parts = normalized.split("/");
|
|
191
|
+
let current = rootPath;
|
|
192
|
+
for (const part of parts) {
|
|
193
|
+
const entries = await readdir(current, { withFileTypes: true }).catch((error) => {
|
|
194
|
+
if (error?.code === "ENOENT") return null;
|
|
195
|
+
throw error;
|
|
196
|
+
});
|
|
197
|
+
if (!entries) return false;
|
|
198
|
+
const exact = entries.find((entry) => entry.name === part);
|
|
199
|
+
if (!exact) return false;
|
|
200
|
+
current = path.join(current, exact.name);
|
|
201
|
+
}
|
|
202
|
+
return true;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
206
|
* Gate 5 needs a stronger closure than the shared semantic-candidate
|
|
207
207
|
* inventory: every regular project source under the selected root receives a
|
|
208
208
|
* raw-byte witness, even when no currently known Kit reader reaches it. The
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ Purpose: give a stateless AI a compact map of the project before it reads or edi
|
|
|
6
6
|
|
|
7
7
|
| Field | Value | Last verified |
|
|
8
8
|
|---|---|---|
|
|
9
|
-
| Agent Handoff Kit template version | 0.3.47 | current template version |
|
|
9
|
+
| Agent Handoff Kit template version | 0.3.47 | current template version |
|
|
10
10
|
| Runtime | TBD | TBD |
|
|
11
11
|
| Framework | TBD | TBD |
|
|
12
12
|
| Package manager | TBD | TBD |
|