@adamchanadam/agent-handoff-kit 0.3.65 → 0.3.67

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 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.65`. npm `@latest` and GitHub Release are verified by post-publish readback.
5
+ Source package version: `v0.3.67`. 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">
@@ -169,7 +169,9 @@ For a durable preference, tell the AI rather than editing rule files blindly:
169
169
  For future public Chinese documents, use written Traditional Chinese and avoid mixing Chinese and English fragments. Connect this rule to Agent Handoff Kit.
170
170
  ```
171
171
 
172
- The AI decides whether that belongs in a one-off note, the next handoff, the project index, or a durable work rule. It must not put everything into one file.
172
+ The AI should distinguish a current request from a durable rule, then read the existing categories, relevant rule pack, and project supplements; when a suitable home exists, it should merge the change there. Project rules belong in a writable supplement or registered reference, preserving the Kit's official body. On the next relevant task, the AI should read and apply the rule through the existing route, respecting your objective and instruction priority without inventing a new goal or acceptance threshold.
173
+
174
+ These requirements guide the AI and check the result; they cannot intercept arbitrary editor writes. If older local rules are already mixed into official prose, the AI still needs to verify their sources and preserve and reconcile them after receiving merge authorization. Upgrades will not guess what to delete.
173
175
 
174
176
  ## 💬 Things you can ask an AI to do
175
177
 
@@ -205,7 +207,7 @@ Even if you do not write code, the Kit requires an AI to stop and explain high-r
205
207
 
206
208
  Agent Handoff Kit can work alongside [Adam-AI-Instructions](https://github.com/prompt-templates/Adam-AI-Instructions). They are complementary, not competing authorities. They deliberately keep a minimum shared baseline for safety, secrets, irreversible operations, and release boundaries; neither is the parent source of truth for the other, and they should not be merged into one rule set:
207
209
 
208
- - **Adam-AI-Instructions** governs how an AI works within one conversation: tone, priorities, response structure, calculation discipline, and safety boundaries.
210
+ - **Adam-AI-Instructions** governs how an AI works within one conversation: tone, priorities, response structure, calculation discipline, language discipline, safety boundaries, and output-layer roles.
209
211
  - **Agent Handoff Kit** governs continuity between conversations: current state, next action, file routes, real closeout, and the next startup.
210
212
 
211
213
  This pairing is optional. It does not change installation or everyday use of Agent Handoff Kit. To use it, choose the version for your AI tool in that repository and paste it into the AI tool's settings.
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.65`。npm `@latest` 與 GitHub Release 以發佈後讀回為準。
5
+ 原始碼套件版本:`v0.3.67`。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">
@@ -173,7 +173,9 @@ AI 會處理檢查,不會把「檢查通過」誤當成已理解你的專案
173
173
  以後寫公開中文文件時,請用繁體中文書面語,避免半中半英。請把這條規則接入 Agent Handoff Kit。
174
174
  ```
175
175
 
176
- AI 應先判斷這條規則應放在哪裡:是一次性備忘、下次交接、項目索引,還是長期工作規則。它不應把所有東西都塞進同一個檔案。
176
+ AI 應先區分當次要求與長期規則,再查閱既有分類、相關規則包及專案補充;有合適位置便合併修改。專案規則放在可修改的補充區或已登記的參考文件,保留 Kit 官方正文。下一次處理相關任務時,AI 應沿原有路徑讀取並運用規則,遵守你的目標及指令優先級,不自行另定目標或通過門檻。
177
+
178
+ 這些要求用來引導 AI 並檢查結果,不能攔截任意編輯器寫入。若舊規則已混入官方正文,仍需由 AI 核對來源,在取得合併授權後保留並整理;升級不會自動猜刪。
177
179
 
178
180
  ## 💬 你可以怎樣叫 AI
179
181
 
@@ -3494,7 +3494,7 @@ async function checkHandoffTemperatureBoundary(root) {
3494
3494
  return { ok: findings.length === 0, checked: 1, findings };
3495
3495
  }
3496
3496
 
3497
- const rootMismatchGuard = "If this root does not match the expected project root";
3497
+ const rootMismatchGuard = "If the root does not match the handoff";
3498
3498
 
3499
3499
  function currentStateEvidenceRules() {
3500
3500
  return [
@@ -3790,52 +3790,47 @@ function isOwnedOpeningLifecycleBoilerplate(line) {
3790
3790
  || /^Upgrade never resets consumed \/ not_applicable first-use state back to eligible\./i.test(line);
3791
3791
  }
3792
3792
 
3793
- function stripResolvedNegatedActionClauses(line) {
3794
- return line.split(/(?<=[.;;。])\s*/).filter((clause) => {
3795
- const negated = /\b(?:no|not|never|without|did not|has not|have not)\b/i.test(clause);
3796
- const action = /\b(?:commit|push|tag|release|publish|deploy|deployment|sync|write|upgrade)\b/i.test(clause);
3797
- return !(negated && action);
3798
- }).join(" ");
3799
- }
3800
-
3801
3793
  const ignoredLifecycleEnglish = new Set([
3802
- "completed", "complete", "finish", "finished", "continue", "incomplete", "passed", "verified", "pending", "blocked", "follow", "scope",
3803
- "monitor", "only", "reopened", "recommended", "next", "step", "session", "current", "work", "task", "with",
3804
- "from", "that", "this", "handoff", "lifecycle", "migration", "regression", "agent", "reason", "condition",
3805
- "the", "and", "for", "into", "still", "remains"
3794
+ "completed", "complete", "finish", "finished", "continue", "resume", "incomplete", "passed", "pass", "verified", "verify",
3795
+ "pending", "blocked", "limited", "failed", "done", "resolved", "unresolved", "successful", "successfully", "success", "run",
3796
+ "the", "and", "is", "are", "was", "were", "has", "have", "been", "not", "no", "yet", "still", "remains", "remain"
3806
3797
  ]);
3807
3798
 
3808
- function lifecycleEnglishTokens(line, stripNegated = false) {
3809
- const source = stripNegated ? stripResolvedNegatedActionClauses(line) : line;
3810
- return (source.toLowerCase().match(/[a-z0-9][a-z0-9_-]{2,}/g) ?? [])
3811
- .filter((token) => !ignoredLifecycleEnglish.has(token));
3799
+ function lifecycleAssertionClauses(line) {
3800
+ // A status belongs to its clause, not every topic in a Completed/QC paragraph.
3801
+ // Keep file extensions and dotted versions intact; separate contrast clauses.
3802
+ return line.split(/[;;](?!\s*(?:condition|trigger|missing evidence|reason|條件|觸發條件|缺少證據|原因)\s*[::])|[。!?!?]+|\.(?=\s|$)|\b(?:but|however|whereas|while)\b|(?:但|不過|然而)/i)
3803
+ .map((clause) => clause.trim().replace(/^[,,\s]+|[,,\s]+$/g, ""))
3804
+ .filter(Boolean);
3812
3805
  }
3813
3806
 
3814
- function lifecycleTopicWindows(line, stripNegated = false) {
3815
- const source = stripNegated ? stripResolvedNegatedActionClauses(line) : line;
3816
- const englishTokens = lifecycleEnglishTokens(source);
3817
- const english = Array.from({ length: Math.max(0, englishTokens.length - 2) }, (_, index) => englishTokens.slice(index, index + 3).join(" "));
3818
- const chineseRuns = source.match(/[\u3400-\u9fff]{6,}/g) ?? [];
3819
- const chinese = chineseRuns.flatMap((run) => Array.from({ length: Math.max(0, run.length - 5) }, (_, index) => run.slice(index, index + 6)));
3820
- return new Set([...english, ...chinese]);
3807
+ function isAffirmativeLifecycleAssertion(clause) {
3808
+ // Word boundaries matter: incomplete, unverified and unsuccessful are not
3809
+ // positive results. Recording a limitation is not completing that work.
3810
+ const assertion = clause.replace(/\b(?:without|no)\s+(?:errors?|failures?|issues?|blockers?)\b/gi, "");
3811
+ if (/\b(?:not|never|without|incomplete|unverified|unsuccessful|unresolved|pending|blocked|limited|failed|missing)\b|(?:尚未|未曾|未完成|未通過|未驗證|未核對|不代表|不涵蓋|沒有|仍需|待驗|受限|受阻)/i.test(assertion)) return false;
3812
+ return /\b(?:completed?|finished|pass(?:ed)?|verified|done|resolved|success(?:ful)?)\b|(?:已完成|完成|通過|已驗證|已核對|已解決)/i.test(assertion);
3821
3813
  }
3822
3814
 
3823
- function lifecycleShortChineseCore(line, stripNegated = false) {
3824
- const rawSource = stripNegated ? stripResolvedNegatedActionClauses(line) : line;
3825
- const source = rawSource.split(/(?:\s+[—–-]\s*)?(?:reason|condition)\s*[::]|(?:原因|條件)\s*[::]/i)[0];
3826
- const ignored = /(後續追蹤|只監察|尚未完成|已經完成|重新開啟|完成|已驗證|繼續|下一步|待辦|尚未|未完成|通過|風險|受阻|重開|監察|追蹤|修復|修補|修正)/g;
3827
- const core = (source.match(/[\u3400-\u9fff]+/g) ?? []).join("").replace(ignored, "");
3828
- return core.length >= 2 && core.length <= 5 ? core : null;
3815
+ function lifecycleAssertionCore(clause) {
3816
+ const source = openingLifecycleDirectiveText(clause)
3817
+ .replace(/^checks run this session\s*[::]\s*/i, "")
3818
+ .replace(/^(?:non[- ]?blocking|risk|非阻擋|非阻塞|風險)\s*[::—-]\s*/i, "")
3819
+ .replace(/\b(?:without|no)\s+(?:errors?|failures?|issues?|blockers?)\b/gi, "")
3820
+ .replace(/\s+(?:in\s+the\s+)?next\s+(?:session|round)\s*$/i, "")
3821
+ .split(/(?:\b(?:reason|condition|evidence)|原因|條件|證據)\s*[::]/i)[0]
3822
+ .replace(/(?:尚未完成|已經完成|已完成|未完成|已驗證|未驗證|已核對|未核對|已通過|未通過|尚未|仍然|仍|完成|通過|繼續|待辦|受阻)/g, "");
3823
+ const tokens = (source.toLowerCase().match(/[a-z0-9][a-z0-9_-]*|[\u3400-\u9fff]+/g) ?? [])
3824
+ .filter((token) => !ignoredLifecycleEnglish.has(token));
3825
+ return tokens.join(" ");
3829
3826
  }
3830
3827
 
3831
- function lifecycleTopicsOverlap(left, right) {
3832
- const leftWindows = lifecycleTopicWindows(left, true);
3833
- if ([...lifecycleTopicWindows(right)].some((window) => leftWindows.has(window))) return true;
3834
- const leftEnglish = lifecycleEnglishTokens(left, true);
3835
- const rightEnglish = lifecycleEnglishTokens(right);
3836
- if (leftEnglish.length === 2 && rightEnglish.length === 2 && leftEnglish.join(" ") === rightEnglish.join(" ")) return true;
3837
- const leftChinese = lifecycleShortChineseCore(left, true);
3838
- return Boolean(leftChinese && leftChinese === lifecycleShortChineseCore(right));
3828
+ function lifecycleAssertionsMatch(left, right) {
3829
+ // Shared product names / paths / three-word windows are not proof of the
3830
+ // same acceptance scope. Only a complete normalized assertion core matches.
3831
+ // This is a conservative mechanical guard, not natural-language adjudication.
3832
+ const core = lifecycleAssertionCore(left);
3833
+ return core.length >= 2 && core === lifecycleAssertionCore(right);
3839
3834
  }
3840
3835
 
3841
3836
  function isExplicitLifecycleReclassification(line) {
@@ -3892,23 +3887,29 @@ function findHandoffLifecycleContradictions(text) {
3892
3887
  ...handoffStateLines(text, "completed-this-session", "Completed This Session")
3893
3888
  .map((line) => ({ section: "Completed This Session", line })),
3894
3889
  ...handoffStateLines(text, "validation-qc", "Validation / QC")
3895
- .filter((line) => /(pass|passed|verified|complete|success|通過|完成|已驗證|已核對)/i.test(line))
3896
3890
  .map((line) => ({ section: "Validation / QC", line }))
3897
- ];
3891
+ ].flatMap((entry) => lifecycleAssertionClauses(entry.line)
3892
+ .filter(isAffirmativeLifecycleAssertion)
3893
+ .map((assertion) => ({ ...entry, assertion })));
3898
3894
  const carryForward = [
3899
3895
  ...handoffStateLines(text, "next-priorities", "Next Priorities")
3900
3896
  .map((line) => ({ section: "Next Priorities", line })),
3901
3897
  ...handoffStateLines(text, "risks-blockers", "Risks / Blockers")
3902
3898
  .map((line) => ({ section: "Risks / Blockers", line })),
3903
3899
  ...handoffStateLines(text, "next-session-opening-message", "Next Session Opening Message")
3904
- .filter((line) => isOpeningLifecycleCarryForwardLine(line))
3905
3900
  .map((line) => ({ section: "Next Session Opening Message", line }))
3906
3901
  ];
3907
3902
  const findings = [];
3908
3903
  for (const pending of carryForward) {
3909
- if (isResolvedCarryForwardStatement(pending.line) || isExplicitLifecycleReclassification(pending.line)) continue;
3910
- for (const done of resolved) {
3911
- if (lifecycleTopicsOverlap(done.line, pending.line)) findings.push({ resolved: done, carryForward: pending });
3904
+ for (const assertion of lifecycleAssertionClauses(pending.line)) {
3905
+ if (pending.section === "Next Session Opening Message" && !isOpeningLifecycleCarryForwardLine(assertion)) continue;
3906
+ // Risks may repeat a completed local fact to explain an unrelated limit.
3907
+ // Next Priorities still rejects completed work listed as a next action.
3908
+ if (pending.section === "Risks / Blockers" && isAffirmativeLifecycleAssertion(assertion)) continue;
3909
+ if (isResolvedCarryForwardStatement(assertion) || isExplicitLifecycleReclassification(assertion)) continue;
3910
+ for (const done of resolved) {
3911
+ if (lifecycleAssertionsMatch(done.assertion, assertion)) findings.push({ resolved: done, carryForward: pending });
3912
+ }
3912
3913
  }
3913
3914
  }
3914
3915
  return findings;
@@ -5565,15 +5566,82 @@ function migrateSessionHandoff(targetText, sourceText, context = {}) {
5565
5566
  const targetPrompt = targetSection.match(/```text\s*\r?\n([\s\S]*?)\r?\n```/);
5566
5567
  const sourcePrompt = sourceSection.match(/```text\s*\r?\n([\s\S]*?)\r?\n```/);
5567
5568
  if (!targetPrompt || !sourcePrompt) return null;
5568
- const existingRoot = targetPrompt[1].match(/^Work in (.+?)\. Read AGENTS\.md,/m)?.[1] ?? "<absolute project root>";
5569
- const currentPrompt = sourcePrompt[1].replace("<absolute project root>", existingRoot);
5570
- const updatedSection = targetSection.replace(targetPrompt[0], `\`\`\`text\n${currentPrompt}\n\`\`\``);
5569
+ // The opening message carries user state. Upgrade must never regenerate it
5570
+ // from a blank template. A historical official opening may be a whole
5571
+ // multi-line block (and its first line materializes the local root), so
5572
+ // replace only a catalog-proven official prefix. Any remaining paragraph is
5573
+ // user-owned and survives byte-for-content through the migration.
5574
+ const sourceInstruction = sourcePrompt[1].split(/\r?\n/).find((line) => line.startsWith("Resume the current objective. A plain "));
5575
+ const officialOpeningPrefixes = new Set();
5576
+ const officialInstructions = new Set();
5577
+ for (const [version, release] of Object.entries(context.officialCatalog?.releases ?? {})) {
5578
+ if (!release.source?.npm?.integrity || compareSemver(version, context.currentVersion) > 0) continue;
5579
+ const baseline = getOfficialBaseline({ version, targetRel: "dev/SESSION_HANDOFF.md", catalog: context.officialCatalog });
5580
+ const opening = baseline?.state === "present" ? extractOpeningMessage(baseline.text) : null;
5581
+ if (opening) officialOpeningPrefixes.add(normalizeOfficialOpeningPrefix(opening));
5582
+ for (const line of opening?.split(/\r?\n/) ?? []) {
5583
+ if (line.startsWith("Resume the current objective. A plain ")) officialInstructions.add(line);
5584
+ }
5585
+ }
5586
+ let currentPrompt = replaceOfficialOpeningPrefix(
5587
+ targetPrompt[1],
5588
+ sourcePrompt[1],
5589
+ officialOpeningPrefixes
5590
+ ) ?? targetPrompt[1].split(/(\r?\n)/).map((line) => (
5591
+ sourceInstruction && officialInstructions.has(line) ? sourceInstruction : line
5592
+ )).join("");
5593
+ currentPrompt = restoreMissingCurrentOpeningLines(currentPrompt, sourcePrompt[1]);
5594
+ const updatedSection = targetSection.replace(targetPrompt[1], () => currentPrompt);
5571
5595
  merged = `${merged.slice(0, targetBounds.start)}${updatedSection}${merged.slice(targetBounds.end)}`;
5572
5596
 
5573
5597
  const temperatureRepair = repairHandoffCurrentStateEvidenceBoundary(merged);
5574
5598
  return temperatureRepair.text;
5575
5599
  }
5576
5600
 
5601
+ function normalizeOfficialOpeningPrefix(text) {
5602
+ return text
5603
+ .replace(/\r\n?/g, "\n")
5604
+ .replace(/^(Work in )[^\n]+?(\.(?: Read AGENTS\.md, then dev\/SESSION_HANDOFF\.md\.)?)$/m, "$1<ROOT>$2");
5605
+ }
5606
+
5607
+ function replaceOfficialOpeningPrefix(targetPrompt, sourcePrompt, officialPrefixes) {
5608
+ const targetLines = targetPrompt.replace(/\r\n?/g, "\n").split("\n");
5609
+ for (const prefix of [...officialPrefixes].sort((left, right) => right.length - left.length)) {
5610
+ const prefixLines = prefix.split("\n");
5611
+ if (targetLines.length < prefixLines.length) continue;
5612
+ if (normalizeOfficialOpeningPrefix(targetLines.slice(0, prefixLines.length).join("\n")) !== prefix) continue;
5613
+ const userOwnedSuffix = targetLines.slice(prefixLines.length).join("\n");
5614
+ return userOwnedSuffix ? `${sourcePrompt}\n${userOwnedSuffix}` : sourcePrompt;
5615
+ }
5616
+ return null;
5617
+ }
5618
+
5619
+ function restoreMissingCurrentOpeningLines(targetPrompt, sourcePrompt) {
5620
+ const sourceLines = sourcePrompt.replace(/\r\n?/g, "\n").split("\n");
5621
+ const targetLines = targetPrompt.replace(/\r\n?/g, "\n").split("\n");
5622
+ const sourceKeys = sourceLines.map(normalizeOfficialOpeningPrefix);
5623
+ const countKey = (lines, key) => lines.filter((line) => normalizeOfficialOpeningPrefix(line) === key).length;
5624
+
5625
+ for (let sourceIndex = 0; sourceIndex < sourceLines.length; sourceIndex += 1) {
5626
+ const sourceLine = sourceLines[sourceIndex];
5627
+ const sourceKey = sourceKeys[sourceIndex];
5628
+ if (!sourceLine.trim() || countKey(sourceLines, sourceKey) !== 1 || countKey(targetLines, sourceKey) !== 0) continue;
5629
+
5630
+ const previousKey = sourceKeys.slice(0, sourceIndex).reverse().find((key, offset) => (
5631
+ sourceLines[sourceIndex - offset - 1].trim() && countKey(sourceLines, key) === 1 && countKey(targetLines, key) === 1
5632
+ ));
5633
+ const nextKey = sourceKeys.slice(sourceIndex + 1).find((key, offset) => (
5634
+ sourceLines[sourceIndex + offset + 1].trim() && countKey(sourceLines, key) === 1 && countKey(targetLines, key) === 1
5635
+ ));
5636
+ if (!previousKey || !nextKey) continue;
5637
+ const previousIndex = targetLines.findIndex((line) => normalizeOfficialOpeningPrefix(line) === previousKey);
5638
+ const nextIndex = targetLines.findIndex((line) => normalizeOfficialOpeningPrefix(line) === nextKey);
5639
+ if (previousIndex < 0 || nextIndex < 0 || previousIndex >= nextIndex) continue;
5640
+ targetLines.splice(previousIndex + 1, 0, sourceLine);
5641
+ }
5642
+ return targetLines.join("\n");
5643
+ }
5644
+
5577
5645
  function migrateSessionLog(targetText, sourceText) {
5578
5646
  let merged = mergeSessionLogTemplateContract(targetText, sourceText);
5579
5647
  if (!merged) return null;
@@ -6604,15 +6672,18 @@ async function assessUpgradeNoopHealth(root, version, options = {}) {
6604
6672
  }
6605
6673
 
6606
6674
  function printUpgradeNoopShortCircuit(version, health = { ok: true }) {
6607
- console.log("");
6608
6675
  console.log(`📦 版本:v${version}`);
6609
6676
  console.log("🛠️ 模式:upgrade-existing");
6610
6677
  console.log("🔎 剛完成:檢查所有 Kit 檔案的狀態(含 AGENTS.md、dev/SESSION_HANDOFF.md、dev/PROJECT_INDEX.md 等)。");
6611
6678
  if (health.ok) {
6612
6679
  console.log("✅ 結果:你已經是最新版本,沒有檔案需要建立或合併;用戶填寫的內容全部保留現狀。");
6613
- console.log("");
6680
+ console.log("✅ project health: passed (same-operation doctor)");
6681
+ // Preserve health warnings and the checked scope without another scan.
6682
+ const notes = (health.stdout ?? "").split(/\r?\n/)
6683
+ .map((line) => line.trim())
6684
+ .filter((line) => /^(?:⚠️|warn(?:ing)?\b|🔎 剛完成:|🚀 下一步:)/u.test(line));
6685
+ for (const note of new Set(notes)) console.log(note);
6614
6686
  console.log("🚀 下一步:回到原本的 AI 對話或開工句即可;準備結束本輪工作、需要保存交接、或有下一輪必須知道的狀態時,在 AI 對話輸入「收工」。");
6615
- console.log("");
6616
6687
  return;
6617
6688
  }
6618
6689
  console.log("⚠️ 結果:Kit 檔案已是最新版本,沒有檔案需要建立或合併;但完整 doctor 健康檢查未通過。");
@@ -13426,6 +13426,356 @@
13426
13426
  "canonicalSha256": "7e51039d57c7c424dbb2c74f9c5ac022193346354593ffa4979008112a2bf8ef"
13427
13427
  }
13428
13428
  }
13429
+ },
13430
+ "0.3.65": {
13431
+ "source": {
13432
+ "npm": {
13433
+ "spec": "@adamchanadam/agent-handoff-kit@0.3.65",
13434
+ "shasum": "312d88a18fe62d5637336bac51fb292a6f4554bc",
13435
+ "integrity": "sha512-k3gHPR+kNM+R6U0jnpAFnVDap519DL4t2yh3p8PeHEaXGsHgSOVCXLl1s46log81Mf3fiK6Vh69riPpOkLUT4A==",
13436
+ "entryCount": 34,
13437
+ "gitHead": null
13438
+ },
13439
+ "git": {
13440
+ "tag": "v0.3.65",
13441
+ "directObject": "04b68b6f0c1e01a284da4842a6fd09ba5c4802c0",
13442
+ "peeledCommit": null,
13443
+ "commit": "04b68b6f0c1e01a284da4842a6fd09ba5c4802c0"
13444
+ },
13445
+ "githubRelease": {
13446
+ "tag": "v0.3.65",
13447
+ "publishedAt": "2026-09-05T15:27:05Z"
13448
+ },
13449
+ "sourceDivergence": {
13450
+ "status": "npm-gitHead-unavailable",
13451
+ "npmGitHead": null,
13452
+ "remoteTagCommit": "04b68b6f0c1e01a284da4842a6fd09ba5c4802c0"
13453
+ }
13454
+ },
13455
+ "manifest": {
13456
+ "AGENTS.md": {
13457
+ "state": "present",
13458
+ "contentId": "03ccd04ca436ac1e8eae439f018c87b801b3ea563a5f1d457e7f7e058b6fe4d0",
13459
+ "rawSha256": "ead21d78a436968cb96cd17386278d6b01d90fb192f0ba8e3a0d2134da39e297",
13460
+ "normalizedSha256": "25f5ac26ebee503471d0e5b298feabb1ef45b5b5145124217989da196696c956",
13461
+ "canonicalSha256": "25f5ac26ebee503471d0e5b298feabb1ef45b5b5145124217989da196696c956"
13462
+ },
13463
+ "CLAUDE.md": {
13464
+ "state": "present",
13465
+ "contentId": "7a2cf08a1171762ebcb53f43036a2170655379416945258b9c85d4b189ecaecf",
13466
+ "rawSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad",
13467
+ "normalizedSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad",
13468
+ "canonicalSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad"
13469
+ },
13470
+ "GEMINI.md": {
13471
+ "state": "present",
13472
+ "contentId": "36da47034bb2ce6c760ddbbbbd49dccc1d17665dbb18bec56ffa3b26bac1c135",
13473
+ "rawSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986",
13474
+ "normalizedSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986",
13475
+ "canonicalSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986"
13476
+ },
13477
+ "START_NEXT_SESSION_PROMPT.txt": {
13478
+ "state": "present",
13479
+ "contentId": "de01669f2989762269e57b8f71decc55d58effa649a245136efa6dc1434b78a9",
13480
+ "rawSha256": "d5d262e377663463f65dfb4d1eb6efee8b18b0db320679edaeed9aa3731f32b2",
13481
+ "normalizedSha256": "d5d262e377663463f65dfb4d1eb6efee8b18b0db320679edaeed9aa3731f32b2",
13482
+ "canonicalSha256": "b1b9ad0cb5f3a374542a43b6c2c938e1e5d39dd42b91d12a4a74206f5f187113"
13483
+ },
13484
+ "dev/SESSION_HANDOFF.md": {
13485
+ "state": "present",
13486
+ "contentId": "0d3fc9fe11fdffadbe8deab1cb18dc6e4e7b0188ef5bbd7b762c525a2d36d317",
13487
+ "rawSha256": "3a794de823492891c078040ff9047f60ee6c1de0ff6d0e4636355fd00f1d1fa7",
13488
+ "normalizedSha256": "3a794de823492891c078040ff9047f60ee6c1de0ff6d0e4636355fd00f1d1fa7",
13489
+ "canonicalSha256": "d974f207f73a824f28e36770323cefe6cdfc364d589e48b49c6996d239d15a7e"
13490
+ },
13491
+ "dev/SESSION_LOG.md": {
13492
+ "state": "present",
13493
+ "contentId": "7b6184ee4dabe89f504a894c3d4803f012d962c7af53c7f29801a8fb28d9d51c",
13494
+ "rawSha256": "fb6bfd7026a15f87a54cfa64fbd69f032538b0c3193372876a3722fb997a3a47",
13495
+ "normalizedSha256": "fb6bfd7026a15f87a54cfa64fbd69f032538b0c3193372876a3722fb997a3a47",
13496
+ "canonicalSha256": "fb6bfd7026a15f87a54cfa64fbd69f032538b0c3193372876a3722fb997a3a47"
13497
+ },
13498
+ "dev/PROJECT_INDEX.md": {
13499
+ "state": "present",
13500
+ "contentId": "c7e652f64d5418bce302c5c96ef4afe56199d4ffa604b3db2283d26ba76d40dd",
13501
+ "rawSha256": "73f2556637429e1e6ef98a5ef7d392ec6079e54edc5a39370c072be9b863ca6a",
13502
+ "normalizedSha256": "849c7648b14e631d532661d5d120142ed81fd6031ca2b41f696bb4e57176a79d",
13503
+ "canonicalSha256": "3e80b5332e0c2527bd653cb049ac0d40db651e1cdfa1fcb0900f23739e745266"
13504
+ },
13505
+ "dev/DOC_SYNC_REGISTRY.md": {
13506
+ "state": "present",
13507
+ "contentId": "f6545b524dc440d3563041e04a05caff4229863f6cae2a39127f85a29a120249",
13508
+ "rawSha256": "56807afee836d3ce19cabb1d020ef37168880a405b5eb8c6d7347e25e94c36e6",
13509
+ "normalizedSha256": "56807afee836d3ce19cabb1d020ef37168880a405b5eb8c6d7347e25e94c36e6",
13510
+ "canonicalSha256": "56807afee836d3ce19cabb1d020ef37168880a405b5eb8c6d7347e25e94c36e6"
13511
+ },
13512
+ "dev/RULE_PACKS.md": {
13513
+ "state": "present",
13514
+ "contentId": "1b91985b9c6460b7bf4293cc6119097df9b426c3a46199a0a4f1de1712d02faa",
13515
+ "rawSha256": "383842f3d2f995a6f0917bb4a7bc6bfa5fd6e3c33ec8aa2cd073ce1695812df4",
13516
+ "normalizedSha256": "383842f3d2f995a6f0917bb4a7bc6bfa5fd6e3c33ec8aa2cd073ce1695812df4",
13517
+ "canonicalSha256": "383842f3d2f995a6f0917bb4a7bc6bfa5fd6e3c33ec8aa2cd073ce1695812df4"
13518
+ },
13519
+ "dev/PROJECT_DECISIONS.md": {
13520
+ "state": "present",
13521
+ "contentId": "3aae993bd5b85bf6b1d1d458f1bcf82c7d3105c843f053ffa13553bb5931b8c4",
13522
+ "rawSha256": "c2fbfb759a36145a92750226d0f7585d49ce0fa4bf1cfde474988ce510dc455e",
13523
+ "normalizedSha256": "c2fbfb759a36145a92750226d0f7585d49ce0fa4bf1cfde474988ce510dc455e",
13524
+ "canonicalSha256": "c2fbfb759a36145a92750226d0f7585d49ce0fa4bf1cfde474988ce510dc455e"
13525
+ },
13526
+ "dev/rules/safety.md": {
13527
+ "state": "present",
13528
+ "contentId": "dd6bcf74722d038f76d202e2044a6583a6e6ad107fbb010520e513eec799ff4a",
13529
+ "rawSha256": "685e501bb8a8cf721dd742312c9160a46a1066a4a875235eaaf579c1c8e72ab0",
13530
+ "normalizedSha256": "685e501bb8a8cf721dd742312c9160a46a1066a4a875235eaaf579c1c8e72ab0",
13531
+ "canonicalSha256": "685e501bb8a8cf721dd742312c9160a46a1066a4a875235eaaf579c1c8e72ab0"
13532
+ },
13533
+ "dev/rules/coding.md": {
13534
+ "state": "present",
13535
+ "contentId": "1c6deb9a5a281c13e97b0ac96079e9e1beccbd1ff106186e7a6ac78c0eeb75c2",
13536
+ "rawSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4",
13537
+ "normalizedSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4",
13538
+ "canonicalSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4"
13539
+ },
13540
+ "dev/rules/writing.md": {
13541
+ "state": "present",
13542
+ "contentId": "ceee5412520ba860e6b40de46bb164e2ce3919d2197d5fadb926198eb7dddd3b",
13543
+ "rawSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593",
13544
+ "normalizedSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593",
13545
+ "canonicalSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593"
13546
+ },
13547
+ "dev/rules/research.md": {
13548
+ "state": "present",
13549
+ "contentId": "4414f9c82c6d04ad49d7446f4b0740055242f425ef5b00391d9c8c78c96c0f66",
13550
+ "rawSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104",
13551
+ "normalizedSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104",
13552
+ "canonicalSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104"
13553
+ },
13554
+ "dev/rules/agent-governance.md": {
13555
+ "state": "present",
13556
+ "contentId": "f79196e62e0cdc55dbb6625922e94b76c0fadd7c61de8973a33d7e20bb9e1345",
13557
+ "rawSha256": "b4249ada400602c9d60fdd19866893d8325569182e69131a9d80f3ebcd4dd49d",
13558
+ "normalizedSha256": "b4249ada400602c9d60fdd19866893d8325569182e69131a9d80f3ebcd4dd49d",
13559
+ "canonicalSha256": "b4249ada400602c9d60fdd19866893d8325569182e69131a9d80f3ebcd4dd49d"
13560
+ },
13561
+ "dev/rules/release.md": {
13562
+ "state": "present",
13563
+ "contentId": "b0a0c9dea88016185f4093f9be4ce3c0e29904222e21dd1fa1735fcc1bb7e744",
13564
+ "rawSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7",
13565
+ "normalizedSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7",
13566
+ "canonicalSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7"
13567
+ },
13568
+ "dev/rules/knowledge.md": {
13569
+ "state": "present",
13570
+ "contentId": "e6f5795c7ebaba7b05f04d971b2942b5a0394a3babb44f64a1cc591c9a08cb86",
13571
+ "rawSha256": "efeed5a4eef59f2ce59852832dddcd0447b2308a76fd01dd7a44ee6a16abb74c",
13572
+ "normalizedSha256": "efeed5a4eef59f2ce59852832dddcd0447b2308a76fd01dd7a44ee6a16abb74c",
13573
+ "canonicalSha256": "efeed5a4eef59f2ce59852832dddcd0447b2308a76fd01dd7a44ee6a16abb74c"
13574
+ },
13575
+ "dev/rules/communication.md": {
13576
+ "state": "present",
13577
+ "contentId": "34fd0034cbc75dad43f789b86a414763f01916dda4d59876db9c4d8d92ae6a87",
13578
+ "rawSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591",
13579
+ "normalizedSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591",
13580
+ "canonicalSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591"
13581
+ },
13582
+ "dev/rules/closeout.md": {
13583
+ "state": "present",
13584
+ "contentId": "1b7adecd0465c58112db511c0ce1f43607427abcc409bccc6682b952c37c4c74",
13585
+ "rawSha256": "183a8b17d7bca51627843ca6cb840cb8b4583df0516ab7ace344fcd33d3f71a5",
13586
+ "normalizedSha256": "183a8b17d7bca51627843ca6cb840cb8b4583df0516ab7ace344fcd33d3f71a5",
13587
+ "canonicalSha256": "183a8b17d7bca51627843ca6cb840cb8b4583df0516ab7ace344fcd33d3f71a5"
13588
+ },
13589
+ "dev/rules/onboarding.md": {
13590
+ "state": "present",
13591
+ "contentId": "6967a95f2256bc7962cd7f0b2b63249a2537979fe0d8bafd49ef620db873cae4",
13592
+ "rawSha256": "0c416732ae67c7dd3bfd2f27fbb763a940e6248ce8a23e42d8b897db8380d9ce",
13593
+ "normalizedSha256": "0c416732ae67c7dd3bfd2f27fbb763a940e6248ce8a23e42d8b897db8380d9ce",
13594
+ "canonicalSha256": "0c416732ae67c7dd3bfd2f27fbb763a940e6248ce8a23e42d8b897db8380d9ce"
13595
+ },
13596
+ "dev/rules/integrations.md": {
13597
+ "state": "present",
13598
+ "contentId": "a8fc1099da28f511bf9fed5eaf629ca10fb409299b0aed4d233a45fc7701f284",
13599
+ "rawSha256": "7e51039d57c7c424dbb2c74f9c5ac022193346354593ffa4979008112a2bf8ef",
13600
+ "normalizedSha256": "7e51039d57c7c424dbb2c74f9c5ac022193346354593ffa4979008112a2bf8ef",
13601
+ "canonicalSha256": "7e51039d57c7c424dbb2c74f9c5ac022193346354593ffa4979008112a2bf8ef"
13602
+ }
13603
+ }
13604
+ },
13605
+ "0.3.66": {
13606
+ "source": {
13607
+ "npm": {
13608
+ "spec": "@adamchanadam/agent-handoff-kit@0.3.66",
13609
+ "shasum": "d1683ffda56e589c45bcbbc823a87a11a1248a6f",
13610
+ "integrity": "sha512-UbRnCsYmV+8RAV+kt2tz6pyUFztn0bhrcIq5/bPcbHba97f2I0CqTerO04xebMCuCOecE28albCzSBVf/0mSgg==",
13611
+ "entryCount": 34,
13612
+ "gitHead": "ce5bc52b86d7652d5f795106e45fda591c1bb811"
13613
+ },
13614
+ "git": {
13615
+ "tag": "v0.3.66",
13616
+ "directObject": "ce5bc52b86d7652d5f795106e45fda591c1bb811",
13617
+ "peeledCommit": null,
13618
+ "commit": "ce5bc52b86d7652d5f795106e45fda591c1bb811"
13619
+ },
13620
+ "githubRelease": {
13621
+ "tag": "v0.3.66",
13622
+ "publishedAt": "2026-09-05T18:12:04Z"
13623
+ },
13624
+ "sourceDivergence": {
13625
+ "status": "same-commit",
13626
+ "npmGitHead": "ce5bc52b86d7652d5f795106e45fda591c1bb811",
13627
+ "remoteTagCommit": "ce5bc52b86d7652d5f795106e45fda591c1bb811"
13628
+ }
13629
+ },
13630
+ "manifest": {
13631
+ "AGENTS.md": {
13632
+ "state": "present",
13633
+ "contentId": "9fd892ee9d3cd174e9d15913d49ee9845ff0cb8f7e5adb28fa3507f7ab5b4ebc",
13634
+ "rawSha256": "d87dc322173e8a3f2ab2d29b47863511e76f61f091d3cd30bb9bcf9bb1aa3683",
13635
+ "normalizedSha256": "f2f2c8c5cd761e28cb8dad7da77fc193b53f153b5d97d5e965b8cb47280d7fa7",
13636
+ "canonicalSha256": "f2f2c8c5cd761e28cb8dad7da77fc193b53f153b5d97d5e965b8cb47280d7fa7"
13637
+ },
13638
+ "CLAUDE.md": {
13639
+ "state": "present",
13640
+ "contentId": "7a2cf08a1171762ebcb53f43036a2170655379416945258b9c85d4b189ecaecf",
13641
+ "rawSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad",
13642
+ "normalizedSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad",
13643
+ "canonicalSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad"
13644
+ },
13645
+ "GEMINI.md": {
13646
+ "state": "present",
13647
+ "contentId": "36da47034bb2ce6c760ddbbbbd49dccc1d17665dbb18bec56ffa3b26bac1c135",
13648
+ "rawSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986",
13649
+ "normalizedSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986",
13650
+ "canonicalSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986"
13651
+ },
13652
+ "START_NEXT_SESSION_PROMPT.txt": {
13653
+ "state": "present",
13654
+ "contentId": "de01669f2989762269e57b8f71decc55d58effa649a245136efa6dc1434b78a9",
13655
+ "rawSha256": "7d8652fcd07f2218528ca08ab70d0f7fe0eaba567fb8fa076109b9ff1c12d81e",
13656
+ "normalizedSha256": "7d8652fcd07f2218528ca08ab70d0f7fe0eaba567fb8fa076109b9ff1c12d81e",
13657
+ "canonicalSha256": "b1b9ad0cb5f3a374542a43b6c2c938e1e5d39dd42b91d12a4a74206f5f187113"
13658
+ },
13659
+ "dev/SESSION_HANDOFF.md": {
13660
+ "state": "present",
13661
+ "contentId": "0d3fc9fe11fdffadbe8deab1cb18dc6e4e7b0188ef5bbd7b762c525a2d36d317",
13662
+ "rawSha256": "6d2b9fb9dc158cb849ee5978713070227c007917576048e80bb058cbad1bc2a9",
13663
+ "normalizedSha256": "6d2b9fb9dc158cb849ee5978713070227c007917576048e80bb058cbad1bc2a9",
13664
+ "canonicalSha256": "d974f207f73a824f28e36770323cefe6cdfc364d589e48b49c6996d239d15a7e"
13665
+ },
13666
+ "dev/SESSION_LOG.md": {
13667
+ "state": "present",
13668
+ "contentId": "7b6184ee4dabe89f504a894c3d4803f012d962c7af53c7f29801a8fb28d9d51c",
13669
+ "rawSha256": "fb6bfd7026a15f87a54cfa64fbd69f032538b0c3193372876a3722fb997a3a47",
13670
+ "normalizedSha256": "fb6bfd7026a15f87a54cfa64fbd69f032538b0c3193372876a3722fb997a3a47",
13671
+ "canonicalSha256": "fb6bfd7026a15f87a54cfa64fbd69f032538b0c3193372876a3722fb997a3a47"
13672
+ },
13673
+ "dev/PROJECT_INDEX.md": {
13674
+ "state": "present",
13675
+ "contentId": "c7e652f64d5418bce302c5c96ef4afe56199d4ffa604b3db2283d26ba76d40dd",
13676
+ "rawSha256": "02b1d4c0a068c9ebc4c6c10092f5ccb21c89300920ed84cfade7315c821039c6",
13677
+ "normalizedSha256": "d0a05d9a6aaf52f18ee71d1c2ce44d72687038a67081998d4b404de37852edcb",
13678
+ "canonicalSha256": "3e80b5332e0c2527bd653cb049ac0d40db651e1cdfa1fcb0900f23739e745266"
13679
+ },
13680
+ "dev/DOC_SYNC_REGISTRY.md": {
13681
+ "state": "present",
13682
+ "contentId": "f6545b524dc440d3563041e04a05caff4229863f6cae2a39127f85a29a120249",
13683
+ "rawSha256": "56807afee836d3ce19cabb1d020ef37168880a405b5eb8c6d7347e25e94c36e6",
13684
+ "normalizedSha256": "56807afee836d3ce19cabb1d020ef37168880a405b5eb8c6d7347e25e94c36e6",
13685
+ "canonicalSha256": "56807afee836d3ce19cabb1d020ef37168880a405b5eb8c6d7347e25e94c36e6"
13686
+ },
13687
+ "dev/RULE_PACKS.md": {
13688
+ "state": "present",
13689
+ "contentId": "1b91985b9c6460b7bf4293cc6119097df9b426c3a46199a0a4f1de1712d02faa",
13690
+ "rawSha256": "383842f3d2f995a6f0917bb4a7bc6bfa5fd6e3c33ec8aa2cd073ce1695812df4",
13691
+ "normalizedSha256": "383842f3d2f995a6f0917bb4a7bc6bfa5fd6e3c33ec8aa2cd073ce1695812df4",
13692
+ "canonicalSha256": "383842f3d2f995a6f0917bb4a7bc6bfa5fd6e3c33ec8aa2cd073ce1695812df4"
13693
+ },
13694
+ "dev/PROJECT_DECISIONS.md": {
13695
+ "state": "present",
13696
+ "contentId": "3aae993bd5b85bf6b1d1d458f1bcf82c7d3105c843f053ffa13553bb5931b8c4",
13697
+ "rawSha256": "c2fbfb759a36145a92750226d0f7585d49ce0fa4bf1cfde474988ce510dc455e",
13698
+ "normalizedSha256": "c2fbfb759a36145a92750226d0f7585d49ce0fa4bf1cfde474988ce510dc455e",
13699
+ "canonicalSha256": "c2fbfb759a36145a92750226d0f7585d49ce0fa4bf1cfde474988ce510dc455e"
13700
+ },
13701
+ "dev/rules/safety.md": {
13702
+ "state": "present",
13703
+ "contentId": "dd6bcf74722d038f76d202e2044a6583a6e6ad107fbb010520e513eec799ff4a",
13704
+ "rawSha256": "685e501bb8a8cf721dd742312c9160a46a1066a4a875235eaaf579c1c8e72ab0",
13705
+ "normalizedSha256": "685e501bb8a8cf721dd742312c9160a46a1066a4a875235eaaf579c1c8e72ab0",
13706
+ "canonicalSha256": "685e501bb8a8cf721dd742312c9160a46a1066a4a875235eaaf579c1c8e72ab0"
13707
+ },
13708
+ "dev/rules/coding.md": {
13709
+ "state": "present",
13710
+ "contentId": "1c6deb9a5a281c13e97b0ac96079e9e1beccbd1ff106186e7a6ac78c0eeb75c2",
13711
+ "rawSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4",
13712
+ "normalizedSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4",
13713
+ "canonicalSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4"
13714
+ },
13715
+ "dev/rules/writing.md": {
13716
+ "state": "present",
13717
+ "contentId": "ceee5412520ba860e6b40de46bb164e2ce3919d2197d5fadb926198eb7dddd3b",
13718
+ "rawSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593",
13719
+ "normalizedSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593",
13720
+ "canonicalSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593"
13721
+ },
13722
+ "dev/rules/research.md": {
13723
+ "state": "present",
13724
+ "contentId": "4414f9c82c6d04ad49d7446f4b0740055242f425ef5b00391d9c8c78c96c0f66",
13725
+ "rawSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104",
13726
+ "normalizedSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104",
13727
+ "canonicalSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104"
13728
+ },
13729
+ "dev/rules/agent-governance.md": {
13730
+ "state": "present",
13731
+ "contentId": "5dcd857a4b7e3416bc1c454ba42d0683afa87d414232ec4bd9ebc4665f55d4a1",
13732
+ "rawSha256": "b36a1782d81476545769727e002248e2e6bbfd507e6a66941cc6c3d16ee60a16",
13733
+ "normalizedSha256": "b36a1782d81476545769727e002248e2e6bbfd507e6a66941cc6c3d16ee60a16",
13734
+ "canonicalSha256": "b36a1782d81476545769727e002248e2e6bbfd507e6a66941cc6c3d16ee60a16"
13735
+ },
13736
+ "dev/rules/release.md": {
13737
+ "state": "present",
13738
+ "contentId": "b0a0c9dea88016185f4093f9be4ce3c0e29904222e21dd1fa1735fcc1bb7e744",
13739
+ "rawSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7",
13740
+ "normalizedSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7",
13741
+ "canonicalSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7"
13742
+ },
13743
+ "dev/rules/knowledge.md": {
13744
+ "state": "present",
13745
+ "contentId": "e6f5795c7ebaba7b05f04d971b2942b5a0394a3babb44f64a1cc591c9a08cb86",
13746
+ "rawSha256": "efeed5a4eef59f2ce59852832dddcd0447b2308a76fd01dd7a44ee6a16abb74c",
13747
+ "normalizedSha256": "efeed5a4eef59f2ce59852832dddcd0447b2308a76fd01dd7a44ee6a16abb74c",
13748
+ "canonicalSha256": "efeed5a4eef59f2ce59852832dddcd0447b2308a76fd01dd7a44ee6a16abb74c"
13749
+ },
13750
+ "dev/rules/communication.md": {
13751
+ "state": "present",
13752
+ "contentId": "34fd0034cbc75dad43f789b86a414763f01916dda4d59876db9c4d8d92ae6a87",
13753
+ "rawSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591",
13754
+ "normalizedSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591",
13755
+ "canonicalSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591"
13756
+ },
13757
+ "dev/rules/closeout.md": {
13758
+ "state": "present",
13759
+ "contentId": "1b7adecd0465c58112db511c0ce1f43607427abcc409bccc6682b952c37c4c74",
13760
+ "rawSha256": "183a8b17d7bca51627843ca6cb840cb8b4583df0516ab7ace344fcd33d3f71a5",
13761
+ "normalizedSha256": "183a8b17d7bca51627843ca6cb840cb8b4583df0516ab7ace344fcd33d3f71a5",
13762
+ "canonicalSha256": "183a8b17d7bca51627843ca6cb840cb8b4583df0516ab7ace344fcd33d3f71a5"
13763
+ },
13764
+ "dev/rules/onboarding.md": {
13765
+ "state": "present",
13766
+ "contentId": "6967a95f2256bc7962cd7f0b2b63249a2537979fe0d8bafd49ef620db873cae4",
13767
+ "rawSha256": "0c416732ae67c7dd3bfd2f27fbb763a940e6248ce8a23e42d8b897db8380d9ce",
13768
+ "normalizedSha256": "0c416732ae67c7dd3bfd2f27fbb763a940e6248ce8a23e42d8b897db8380d9ce",
13769
+ "canonicalSha256": "0c416732ae67c7dd3bfd2f27fbb763a940e6248ce8a23e42d8b897db8380d9ce"
13770
+ },
13771
+ "dev/rules/integrations.md": {
13772
+ "state": "present",
13773
+ "contentId": "a8fc1099da28f511bf9fed5eaf629ca10fb409299b0aed4d233a45fc7701f284",
13774
+ "rawSha256": "7e51039d57c7c424dbb2c74f9c5ac022193346354593ffa4979008112a2bf8ef",
13775
+ "normalizedSha256": "7e51039d57c7c424dbb2c74f9c5ac022193346354593ffa4979008112a2bf8ef",
13776
+ "canonicalSha256": "7e51039d57c7c424dbb2c74f9c5ac022193346354593ffa4979008112a2bf8ef"
13777
+ }
13778
+ }
13429
13779
  }
13430
13780
  },
13431
13781
  "contents": {
@@ -14353,7 +14703,32 @@
14353
14703
  "targetRel": "dev/rules/closeout.md",
14354
14704
  "canonicalSha256": "b872c6a37311bd77761db52dc63cdd5bff28949a11d5c4c52b9576800cd612cb",
14355
14705
  "text": "# Closeout Pack\n\n## Scope\n\nThis pack is the single detailed contract for full Agent Handoff Kit closeout. Load it only for clear end-of-session or handoff intent. It does not authorize Git, release, publish, deployment, deletion, permission, or cleanup actions.\n\n## Required Reads\n\nRead the current `dev/SESSION_HANDOFF.md`, `dev/SESSION_LOG.md`, `dev/PROJECT_INDEX.md`, and `dev/DOC_SYNC_REGISTRY.md`. Read `dev/PROJECT_DECISIONS.md`, integration rules, or another pack only when its closeout trigger or the session's actual work requires it.\n\n## Write Contract\n\nUse Kit markers as machine boundaries: `ack:section:*`, `ack:field:*`, `ack:log-entry:start/end`, and managed-core BEGIN/END. Human headings may be localized; markers may not be removed or translated.\n\n- Current state, objective, recommended next action, active risk, blocker, required reading, workspace identity, and sync status belong in `dev/SESSION_HANDOFF.md`.\n- Chronological work and evidence disposition belong in `dev/SESSION_LOG.md`.\n- File / command / source / capability maps belong in `dev/PROJECT_INDEX.md`.\n- Recurring sync obligations belong in `dev/DOC_SYNC_REGISTRY.md`.\n- Long-term evolution, architectural rationale, and accumulated learning belong in `dev/PROJECT_DECISIONS.md` when triggered.\n- Reusable procedures belong in the relevant pack, registered reference, or QA check.\n- `START_NEXT_SESSION_PROMPT.txt` is generated only from the handoff opening-message block.\n\nDo not copy the full opening message into `dev/SESSION_LOG.md` or any third current governance file. The log records whether the mirror was verified no-op or regenerated and verified, plus an evidence reference when useful.\n\n## Full Closeout\n\nFull closeout is differential and write-minimal. Update only fields whose current truth changed. For unchanged state, preserve bytes where practical and record checked/no-op only when it helps the next agent. Reuse a completed task check only when its recorded root, task input, tool identity, commit / artifact identity, and required file hashes still match the current state. Do not rerun task QA that is already bound to unchanged identity. Do rerun checks affected by closeout writes, gates that are incomplete or indeterminate, closeout-specific checks, and the final `closeout-status` read-back. If a closeout attempt is interrupted, stopped, aborted, times out, or hits a spawn / transport error, resume at the first incomplete or indeterminate gate; do not restart from the beginning unless the root, input, tool identity, commit, artifact, or relevant hash changed.\n\nHandoff cold zones are historical / evidence sections, old validation records, completed-work narratives, and unchanged durable anchors. Do not rewrite, reword, reorder, or refresh cold zones for ceremony or style. Change them only when the closeout directly proves their current meaning is false or the section itself is the named target of the reconciliation; otherwise preserve cold-zone bytes where practical and update only hot current-state fields.\n\n1. Reconcile `dev/SESSION_HANDOFF.md`; never append a new current-state snapshot beneath an old one. Verify durable anchors, then update only changed closeout-reconciled fields or sections; leave already-current sections unchanged instead of rewriting them for ceremony.\n2. Reconcile lifecycle state across `Completed This Session`, `Validation / QC`, `Next Priorities`, `Risks / Blockers`, and `Next Session Opening Message`. Completed or verified work cannot remain unresolved unless explicitly reclassified as monitor-only, follow-up scope, blocked, or reopened with its missing evidence or trigger.\n The bundled doctor is a mechanical floor for required lifecycle markers and readable sections only. The semantic lifecycle gate is `agent-handoff-kit closeout-status`; when it blocks, use its first `Resolved [...]` / `Carry-forward [...]` pair to repair the handoff, not a separate project workaround, repeated doctor runs, or a broader governance rewrite. Read all five sections as a whole before marking the lifecycle field resolved. For governance, release, or another project-defined high-risk completion, use the project's independent semantic review gate in addition to `closeout-status`.\n3. Make `Next Priorities` name one recommended next action and a short reason unless blocked or a real user decision is required.\n4. Complete the persistence-routing, handoff-sufficiency, `Closeout outcome`, and `Project-required persistence` fields. The next agent must be able to continue from `AGENTS.md`, the handoff, the project index when needed, and routed packs without searching old log history. `complete` is allowed only when all required writes/read-backs and any project-required persistence succeeded; use `not_required` only when that persistence is genuinely not required. If a required commit, push, release record, or equivalent persistence is blocked or not authorized, set both fields to `blocked` with the exact boundary.\n5. Add one concise log entry for work actually performed. Record evidence disposition and the prompt-mirror verification result; omit the full opening message by design.\n6. Update the project index and sync registry only when their owned maps or obligations changed. Record each applicable sync target as `confirmed`, `unverified`, `pending`, `blocked`, or `not_applicable`.\n7. Run `agent-handoff-kit workspace-health --root <project root>` or equivalent read-only Git probes, then record only the last-verified root, Git root, branch, commit, worktrees / parallel workspaces, uncommitted changes, and unresolved drift. Do not clean or change them without separate authorization. Do not treat `dev/PROJECT_INDEX.md` or old handoff prose as the live worktree truth.\n8. If the session used external tools or helper processes, apply the integrations and safety ownership rules. Close only task-owned resources. Retain shared, user-owned, other-agent-owned, system, or ambiguous resources unless separately authorized; state visibility limits.\n9. Run the short maintenance trigger check below and record its result in the log.\n10. Mark first-use guidance `consumed` after the first successfully completed task or first full closeout. Upgrade must never reset `consumed` or `not_applicable` to `eligible`.\n11. Verify `START_NEXT_SESSION_PROMPT.txt` against the sole fenced handoff opening-message block first. Regenerate it only when normalized content differs, then run the project's fixed prompt-mirror checker or perform an equivalent anchored read-back that verifies marker, heading, fence, full-copy uniqueness, and normalized content equality.\n12. Run available project-specific closeout checks. Do not run a separate bundled `doctor`: the `closeout-status` command below performs the one required fresh doctor read-back. Do not treat an external update-check failure as local closeout failure. Fix state or mirror failures before claiming handoff ready.\n13. Run `agent-handoff-kit closeout-status --root <project root>` after the handoff and prompt read-back. It performs the one required fresh doctor read-back plus a read-only workspace-health comparison against the handoff snapshot, and its output is the only final card source: copy its status faithfully. A nonzero result means the closeout is blocked; do not replace it with a success summary.\n\n## Maintenance Trigger Check\n\nEvery full closeout runs this short check; full maintenance runs only when triggered.\n\n- SESSION_LOG: trigger when the main log reaches at least 11 entries, exceeds 1500 lines, or the 10-closeout backstop is due. Keep recent safety-buffer entries; collapse only content already absorbed by an authoritative home. Archive older raw entries to `dev/SESSION_LOG_archive/archive_<batch>_<low_date>_to_<high_date>.md` and maintain `INDEX.md`. Port unique narrative before collapsing it.\n- PROJECT_DECISIONS: trigger when a decisions-like handoff section has at least 30 entries; retain the newest 8–22 in the hot tier and move older decisions into the decisions archive. Also write substantive task evolution, a multi-option architectural choice with rationale, or a cross-session learning when observed.\n- Backstop: every 10 closeouts, run the full long-term maintenance pass even when no semantic trigger is obvious. If the count cannot be determined confidently at the boundary, treat the backstop as due.\n\nIf no trigger applies, record one no-op reason. Handoff carries continuity; log and project decisions carry trace and long-term narrative.\n\n## Opening Message And Card\n\nThe handoff opening-message block is authoritative. It must name the absolute root, route the agent through `AGENTS.md` and the handoff, state the current objective and boundary, and avoid instructing the next agent to redo completed work. It must not require SESSION_LOG as an ordinary startup read.\n\nUse `agent-handoff-kit closeout-status --root <project root>` after the required read-backs. It renders the verified version when available and otherwise `version unverified`; never print the literal placeholder `v<version>`, hand-compose a substitute card, or use `handoff saved` unless the command reports `status: complete`.\n\n```text\n /\\_/\\ Agent Handoff Kit v<version>\n ( -.- ) handoff saved\n > ^ <\n\nstatus: complete\n✅ Done: <completed summary>\n🔎 QC: <validation summary>\n📌 Handoff: opening message ready\n⚠️ Boundary: <important boundary or none>\n```\n\nFor `status: blocked`, the command instead says `handoff blocked`; retain that status, blocker reason, and human explanation: `這不是失敗;只是還有事未保存、未提交、未驗證或需要處理。先照 Blocker 行處理,不要把本輪當作已完成交接。` Then give the short local-root entry `Start Agent Handoff` / `開工` and the path-bearing fallback for an agent not yet pointed at the root. Do not hand-compose a third stateful prompt in the final response.\n\n## Stop Conditions\n\nDo not claim closeout complete when any required write or read-back failed, lifecycle state conflicts remain, the mirror is stale or duplicated, the root is uncertain, mandatory sync is unclassified, `closeout-status` is nonzero, or required Git persistence was explicitly part of the project's closeout contract but did not succeed. State the exact blocker and leave the project in an honest resumable state.\n"
14706
+ },
14707
+ "03ccd04ca436ac1e8eae439f018c87b801b3ea563a5f1d457e7f7e058b6fe4d0": {
14708
+ "targetRel": "AGENTS.md",
14709
+ "canonicalSha256": "25f5ac26ebee503471d0e5b298feabb1ef45b5b5145124217989da196696c956",
14710
+ "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\nWhen resuming, use the handoff's Task Understanding, Active Objective and Next Task Required Reading to recover the parent outcome, current step, resume point, remaining acceptance and source coverage. Surface missing critical context in the startup warning and recommend the specific clarification/read; do not infer parent completion from a finished child or treat previous-session reading as your own. Bare startup remains status-only, with no extra source reads or writes.\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, one optional display-only current-thread title update when safely supported, 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, project-file writes, network access, other external actions, or opt-out wording such as \"unless you object I will start\". First-use exception: when `dev/SESSION_HANDOFF.md` says `First-use guidance state: eligible`, the active objective is empty / `TBD`, and there is no same-message concrete task, load `dev/rules/onboarding.md` and include a short first-use welcome plus the most relevant guided choices in the same response instead of ending status-only. 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 marks first-use guidance as `eligible`, so the first unresolved startup must enter onboarding; upgrade must not reset `consumed` or `not_applicable` back to `eligible`. A short message in a non-eligible root 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\nDuring explicit continuity startup, the only optional presentation effect beyond state recovery and card/status is a user-visible task/conversation title update, when the active runtime safely supports current-thread title control. Current-title readback is useful when available to avoid overwriting an already informative title, but it is not required when the tool safely targets the calling/current thread. If title control is exposed only through a bounded runtime tool-discovery mechanism, use that discovery once with a narrow title/rename/current-thread query before deciding the control is unavailable; then call only the discovered safe current-thread title tool. Do not list or inspect unrelated threads solely for naming, and do not create, fork, navigate, message, archive, pin, or otherwise manage tasks as part of startup title naming. Do not title from the raw continuity trigger or before handoff-derived startup facts are final. First derive the startup card's current objective, risk/boundary, and recommended next action; then choose and apply any title update as the last presentation side effect before returning the startup response. Replace only a generic or stale title, or update once when the main objective clearly changes; keep an informative title when readback proves it is already relevant, and do not rename for tests, reviews, or small substeps. Use `<project name>|<primary action>` from facts already loaded for startup: a concrete same-message task first, otherwise the loaded current objective plus recommended next action. Within those facts, select one concrete primary action in this order: the same-message task; the loaded current objective; the recommended next action. The continuity trigger itself and generic phrases such as `Start Agent Handoff`, `開工`, `開始交接工作`, or `開始工作交接` are not primary actions. If the loaded facts do not provide both a concrete project name and a concrete primary action, skip the title update. Do not read `dev/PROJECT_INDEX.md`, files, network, or other state solely to name the title. The title must not contain progress, completion, status, task/session IDs, absolute paths, secrets, or unverified facts. If safe current-thread title control is unavailable after the bounded discovery above, skip silently. The title is display-only; it is not project state, permission, progress, completion evidence, a health result, or a source of truth, and it does not authorize project/file writes, network activity, external task work, or continuation beyond the startup boundary.\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. Render the startup card in a fenced `text` block and preserve spacing so the ASCII status marker remains aligned. The first-use exception above replaces that status-only stop with onboarding only when the handoff state is `eligible`, the objective is empty / `TBD`, and there is no same-message concrete task. 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 or first-use onboarding is triggered, combine any card and guidance in one response.\n\nFor explicit bare continuity startup, after the handoff is read, the startup card may read only the bounded version evidence from `dev/PROJECT_INDEX.md`: the unique stable-semver `| Agent Handoff Kit template version | X.Y.Z | ... |` row inside the unique real `## Stack` section. Do not route on, summarize, or load any other Project Index content for startup, title, permissions, packs, health, or task work. Missing, unreadable, malformed, duplicate, prerelease, or out-of-Stack-only version evidence prints `version unverified`; the turn remains status-only with zero writes. A direct ordinary or stateless task does not read the handoff or Project Index merely to fill a card or version.\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- Task-first governance locality: when the user supplied a concrete, actionable, authorized task plan and no safety / source-truth / permission blocker prevents it, follow the plan's main acceptance path before governance side work. Governance may become the main path only when the task itself is governance, the user explicitly asks for governance bridge or long-term governance, the content semantically requires cross-session force, or deferring it would create a safety, continuity, source-of-truth, or discoverability blocker. Otherwise, keep governance to the smallest classification, indexing, sync, or Persistence Gate decision that does not change the main deliverable path; do not start governance bridge, long-term-governance routing, repo-wide scans, handoff writes, or closeout solely because the task mentions Markdown, README, docs, specs, plans, checklists, or generated outputs.\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- Ordinary document edits normally use local read-back and task-specific checks only. If the edited document itself is the target authority and the task does not touch Kit-managed files, migrations, release / closeout gates, external effects, cross-source conflicts, or blockers for safe continuation, do not run `agent-handoff-kit doctor`, write handoff / log state, or regenerate the startup mirror solely because a document changed.\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. This is the default for ongoing sessions. 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 real day / tool-session boundary, or a state where the current agent cannot continue and the next agent must take over. Ordinary external-tool use, a completed release / governance subtask, or a durable note during an ongoing session is not by itself a full closeout trigger. Load `dev/rules/closeout.md` only when this tier is selected.\n\nPre-closeout checkpoint guard: before writing `dev/SESSION_HANDOFF.md` or `dev/SESSION_LOG.md` without explicit closeout / checkpoint intent, identify the durable fact, why the edited target authority or user-visible answer is insufficient, and why that file is the smallest correct home. Do not write either file merely because the next AI might misread stale state, because a target-authority document changed, or to make the handoff mirror every intermediate step. If the gate selects a checkpoint, update only the named current-state field(s) or one concise log entry; preserve unrelated / historical handoff sections byte-stable where practical, and do not regenerate `START_NEXT_SESSION_PROMPT.txt`.\n\nDuring an ongoing task, between Persistence Gate decisions, `dev/SESSION_HANDOFF.md` may legitimately trail the read-back target authority. Treat that as expected lag, not drift, and do not update handoff merely to mirror each intermediate step. Still apply the gate when a durable or startup-needed fact must survive interruption, the handoff is the smallest correct home, Kit-managed / release / closeout / external-effect state changed, or full closeout is selected.\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. Workspace identity is a last-verified snapshot. Live root / Git / worktree truth belongs to `agent-handoff-kit workspace-health --root <project root>` or equivalent read-only Git probes, not to stale prose.\n5. Closeout is not complete until required files are written, read back, and the available closeout checks pass.\n6. 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.\n7. 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\nBefore changing `AGENTS.md` or adding a durable governance rule, use `dev/RULE_PACKS.md` to load `dev/rules/agent-governance.md` and locate the existing normative owner. Default-core rules must apply to most sessions, protect safety or continuity, and be shorter than the routed detail they replace. Scenario-specific or project-specific 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. Do not copy the agent-governance classification table or workflow into the core.\n<!-- END Agent Handoff Kit managed core -->\n\n<!-- ack:user-rules-router:dev/USER_RULES.md -->\n<!-- ack:user-rules-acceptance:sha256=10f2dd27d19d0cddc8c0ea03425f8ae314bac1f2804151116233ff389d5558c3 -->\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"
14711
+ },
14712
+ "0d3fc9fe11fdffadbe8deab1cb18dc6e4e7b0188ef5bbd7b762c525a2d36d317": {
14713
+ "targetRel": "dev/SESSION_HANDOFF.md",
14714
+ "canonicalSha256": "d974f207f73a824f28e36770323cefe6cdfc364d589e48b49c6996d239d15a7e",
14715
+ "text": "# Session Handoff\n\nLast Updated: TBD\n\n<!-- ack:section:durable-anchors -->\n## Durable Anchors\n\nStable facts that should survive across sessions. Update only when they change, but verify they still match reality at closeout.\n\n1. Project root and boundary: TBD\n2. Product/system identity: TBD\n3. Governance model: TBD\n4. Source-of-truth ownership: TBD\n5. Release / publish boundary: TBD\n6. Installed Integrations registry: `dev/PROJECT_INDEX.md` `## Installed Integrations` is the declaration source. Probe only immediately before actual use, when the current objective names an integration dependency, or when the user asks for a health check. Credential values never appear in `dev/*`; record references only.\n\n<!-- ack:section:closeout-reconciled-state -->\n## Closeout-Reconciled State\n\nThis is the current-state area. At every full closeout, update only sections whose current truth changed; leave already-current sections byte-stable where practical and record checked/no-op only when useful. Do not append a new state snapshot under an old one.\n\nPre-closeout checkpoint edits, when explicitly authorized or required by the core Persistence Gate, update only the named hot current-state field(s) or one concise log entry. Historical evidence, old validation records, completed-work narratives, and unchanged durable anchors are cold zones: preserve them byte-for-byte where practical instead of rewording, reordering, or refreshing them because another AI might otherwise read stale context.\n\n<!-- ack:section:current-baseline -->\n## Current Baseline\n\n1. Project root: TBD\n2. Product/system state: TBD\n3. Governance state: TBD\n4. Source-of-truth notes: TBD\n<!-- ack:field:first-use-guidance-state -->\n5. First-use guidance state: eligible\n\n<!-- ack:section:task-understanding-summary -->\n## Task Understanding Summary\n\n<!-- ack:field:user-intent -->\n- User intent: TBD\n<!-- ack:field:task-essence -->\n- Task essence: TBD\n- User value: TBD\n- Parent outcome / consumer: TBD\n- Task position: TBD — parent -> current step and how this step advances it; use standalone when this is the whole task, unknown when not established.\n<!-- ack:field:success-criteria -->\n- Success criteria: TBD\n- Key background already read: TBD\n- Background still unread or blocked: TBD\n- Non-goals / boundaries: TBD\n\n<!-- ack:section:active-objective -->\n## Active Objective\n\n- Current step: TBD\n- Resume point: TBD — next bounded action, target and last verified result; distinguish finished preparation from unfinished work.\n- Remaining acceptance: TBD — what still proves the current step and the parent outcome; if complete, cite evidence rather than infer from child completion.\n\n<!-- ack:section:completed-this-session -->\n## Completed This Session\n\nRecord only work actually completed in the current session.\n\n1. TBD\n\n<!-- ack:section:next-priorities -->\n## Next Priorities\n\nRecommended next step: TBD — reason: TBD\n\n1. TBD\n\n<!-- ack:section:next-task-required-reading -->\n## Next Task Required Reading\n\nBefore acting on the next task, read or mark blocked:\n\nIn Source, identify the authoritative file/link, revision or unverified freshness, and relevant sections/range. In Why required, name the decision or acceptance it supports. In Status, record the previous session's actual depth (located / skimmed / relevant range read / verified), remaining unread scope, and what the next agent must read before acting. An old read claim is not a fresh read. For no required sources, state none with a reason; do not invent coverage.\n\n| Source | Why required | Status |\n|---|---|---|\n| TBD | TBD | pending |\n\n<!-- ack:section:risks-blockers -->\n## Risks / Blockers\n\n1. TBD\n\n<!-- ack:section:validation-qc -->\n## Validation / QC\n\n- Checks run this session: TBD\n- Checks not run and why: TBD\n- Handoff evidence location: TBD\n\n<!-- ack:section:workspace-identity -->\n## Workspace Identity\n\nExpected project root: TBD\nGit root: TBD\nBranch: TBD\nCommit: TBD\nWorktree / parallel workspace status: TBD\nUncommitted changes summary: TBD\n\n<!-- ack:section:sync-status -->\n## Sync Status\n\nUse statuses from `dev/DOC_SYNC_REGISTRY.md`: `confirmed`, `unverified`, `pending`, `blocked`, `not_applicable`.\n\n- Project index: TBD\n- Doc sync registry: TBD\n- Public docs / README: TBD\n- External knowledge tools: TBD\n\n<!-- ack:section:state-reconciliation-check -->\n## State Reconciliation Check\n\nAt full closeout, complete this check after updating the state sections above.\n\n- Reconciled at: TBD\n<!-- ack:field:state-sections-rewritten-or-confirmed -->\n- State sections rewritten or confirmed current: TBD\n<!-- ack:field:stale-snapshots-left -->\n- Stale snapshots left in this handoff: TBD\n<!-- ack:field:lifecycle-conflicts-resolved -->\n- Completed / pending / risk / opening-message lifecycle conflicts resolved or explicitly reclassified: TBD\n<!-- ack:field:persistence-routing-checked -->\n- Persistence routing checked: TBD\n<!-- ack:field:closeout-outcome -->\n- Closeout outcome: not_started — full closeout has not yet been assessed.\n<!-- ack:field:project-required-persistence -->\n- Project-required persistence: not_assessed — state whether this project's required Git or other persistence completed, is not required, or is blocked.\n<!-- ack:field:recommended-next-step-explicit -->\n- Recommended next step is explicit and reasoned: TBD\n<!-- ack:field:opening-message-matches-current-state -->\n- Opening message matches current state: TBD\n<!-- ack:field:next-ai-can-continue -->\n- Next AI can continue from `AGENTS.md`, this handoff, `dev/PROJECT_INDEX.md`, and needed rule packs without searching old log history: TBD\n\nIf any answer is no, blocked, or uncertain, fix this handoff before declaring handoff ready. `Closeout outcome: complete` is allowed only when required writes, read-backs and project-required persistence are complete. If project-required persistence is blocked, use `Closeout outcome: blocked` and state the blocker; it is not a completed closeout.\n\nLifecycle consistency rule: compare `Completed This Session`, `Validation / QC`, `Next Priorities`, `Risks / Blockers`, and `Next Session Opening Message` as full content, including renamed or paraphrased work. A completed or verified item must not remain as an unresolved next priority, active risk, or startup instruction unless it is explicitly reclassified as monitor-only, follow-up scope, blocked, or reopened with the missing evidence or trigger condition stated. Doctor catches only mechanical contradictions and unresolved fields; its green result is not semantic proof. Recommended next-step rule: `Next Priorities` must name the single recommended next action and a short reason before listing additional options, unless the next action is blocked or genuinely requires a user decision. Persistence routing rule: one-time delivery instructions, historical validation evidence, old hashes, old version facts, and incident notes must stay in trace evidence unless they still affect the next action.\n\nCloseout-card rule: `closeout-status` reads only these existing handoff fields plus fresh doctor / mirror results; it does not create another persistence authority. Its `complete` card is the only permitted source for the user-facing `handoff saved` wording. A nonzero / `blocked` result must be shown as blocked, never summarized as completed.\n\n<!-- ack:section:handoff-sufficiency-check -->\n## Handoff Sufficiency Check\n\nCan the next AI continue from `AGENTS.md`, this handoff, and only the project index / rule packs required by the next task, without searching old log history?\n\nAnswer: TBD\nReconstruction evidence: TBD — apply the packet-only reconstruction check in `dev/rules/closeout.md`; cite the sections supporting the outcome, task position, resume point, remaining acceptance and source coverage. Record gaps explicitly; a bare yes is insufficient.\nKeep the `Answer:` and `Reconstruction evidence:` labels. Use `yes`, `no` or `unknown` for Answer, followed by an explanation if needed. Narrative and section headings may use the project's language.\nIf no, update this handoff before closeout. Unknown critical context blocks dependent work and is not permission to guess. A saved packet may honestly describe blocked work.\n\nContinuity rule: this file carries current state and next action. `dev/SESSION_LOG.md` carries recent evidence only. Archive old detail only when needed; do not create an archive directory by default.\n\n<!-- ack:section:next-session-opening-message -->\n## Next Session Opening Message\n\nThis fenced block is the authoritative agent-managed startup content. At closeout, verify `START_NEXT_SESSION_PROMPT.txt` against this block. Regenerate only if normalized content differs; if the two differ, trust this block and rewrite the convenience copy. User-facing closeout output should show `Start Agent Handoff` / `開工` as the primary next-session entry, plus the path-bearing fallback when the next AI is not yet pointed at this project root; do not hand-write a separate stateful prompt in the final response.\n\n📋 Next session: agent-managed startup content below\n\n```text\nWork in <ROOT>.\n\nIf the root does not match the handoff, stop and ask for confirmation. Do not read dev/SESSION_LOG.md during ordinary startup. Read dev/PROJECT_INDEX.md, dev/RULE_PACKS.md, dev/DOC_SYNC_REGISTRY.md, and task packs only when the current task requires them.\n\nResume the current objective. A plain `Start Agent Handoff` / `開工` with no same-message task or explicit long-run instruction only authorizes minimum state recovery, one optional display-only current-thread title update when safely supported, 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, project-file writes, network access, other external actions, or opt-out execution wording. First-use exception: when this handoff says `First-use guidance state: eligible`, the current objective is empty / `TBD`, and there is no same-message concrete task, load onboarding and include a short first-use welcome plus the most relevant guided choices in the same response instead of ending status-only. A concrete objective found only in this handoff is not authority to complete the objective. A same-message task may begin normally; an explicit instruction such as `開工,繼續做到下一個 blocker` or `開工,繼續完成目前目標` may continue under the normal task and safety rules. Upgrade never resets consumed / not_applicable first-use state back to eligible.\n```\n"
14716
+ },
14717
+ "1b7adecd0465c58112db511c0ce1f43607427abcc409bccc6682b952c37c4c74": {
14718
+ "targetRel": "dev/rules/closeout.md",
14719
+ "canonicalSha256": "183a8b17d7bca51627843ca6cb840cb8b4583df0516ab7ace344fcd33d3f71a5",
14720
+ "text": "# Closeout Pack\n\n## Scope\n\nThis pack is the single detailed contract for full Agent Handoff Kit closeout. Load it only for clear end-of-session or handoff intent. It does not authorize Git, release, publish, deployment, deletion, permission, or cleanup actions.\n\n## Required Reads\n\nRead the current `dev/SESSION_HANDOFF.md`, `dev/SESSION_LOG.md`, `dev/PROJECT_INDEX.md`, and `dev/DOC_SYNC_REGISTRY.md`. Read `dev/PROJECT_DECISIONS.md`, integration rules, or another pack only when its closeout trigger or the session's actual work requires it.\n\n## Write Contract\n\nUse Kit markers as machine boundaries: `ack:section:*`, `ack:field:*`, `ack:log-entry:start/end`, and managed-core BEGIN/END. Human headings may be localized; markers may not be removed or translated.\n\n- Current state, objective, recommended next action, active risk, blocker, required reading, workspace identity, and sync status belong in `dev/SESSION_HANDOFF.md`.\n- Chronological work and evidence disposition belong in `dev/SESSION_LOG.md`.\n- File / command / source / capability maps belong in `dev/PROJECT_INDEX.md`.\n- Recurring sync obligations belong in `dev/DOC_SYNC_REGISTRY.md`.\n- Long-term evolution, architectural rationale, and accumulated learning belong in `dev/PROJECT_DECISIONS.md` when triggered.\n- Reusable procedures belong in the relevant pack, registered reference, or QA check.\n- `START_NEXT_SESSION_PROMPT.txt` is generated only from the handoff opening-message block.\n\nDo not copy the full opening message into `dev/SESSION_LOG.md` or any third current governance file. The log records whether the mirror was verified no-op or regenerated and verified, plus an evidence reference when useful.\n\n## Full Closeout\n\nFull closeout is differential and write-minimal. Update only fields whose current truth changed. For unchanged state, preserve bytes where practical and record checked/no-op only when it helps the next agent. Reuse a completed task check only when its recorded root, task input, tool identity, commit / artifact identity, and required file hashes still match the current state. Do not rerun task QA that is already bound to unchanged identity. Do rerun checks affected by closeout writes, gates that are incomplete or indeterminate, closeout-specific checks, and the final `closeout-status` read-back. If a closeout attempt is interrupted, stopped, aborted, times out, or hits a spawn / transport error, resume at the first incomplete or indeterminate gate; do not restart from the beginning unless the root, input, tool identity, commit, artifact, or relevant hash changed.\n\nHandoff cold zones are historical / evidence sections, old validation records, completed-work narratives, and unchanged durable anchors. Do not rewrite, reword, reorder, or refresh cold zones for ceremony or style. Change them only when the closeout directly proves their current meaning is false or the section itself is the named target of the reconciliation; otherwise preserve cold-zone bytes where practical and update only hot current-state fields.\n\n1. Reconcile `dev/SESSION_HANDOFF.md`; never append a new current-state snapshot beneath an old one. Verify durable anchors, then update only changed closeout-reconciled fields or sections; leave already-current sections unchanged instead of rewriting them for ceremony.\n2. Reconcile lifecycle state across `Completed This Session`, `Validation / QC`, `Next Priorities`, `Risks / Blockers`, and `Next Session Opening Message`. Completed or verified work cannot remain unresolved unless explicitly reclassified as monitor-only, follow-up scope, blocked, or reopened with its missing evidence or trigger.\n The bundled doctor is a mechanical floor for required lifecycle markers and readable sections only. The semantic lifecycle gate is `agent-handoff-kit closeout-status`; when it blocks, use its first `Resolved [...]` / `Carry-forward [...]` pair to repair the handoff, not a separate project workaround, repeated doctor runs, or a broader governance rewrite. Read all five sections as a whole before marking the lifecycle field resolved. For governance, release, or another project-defined high-risk completion, use the project's independent semantic review gate in addition to `closeout-status`.\n3. Make `Next Priorities` name one recommended next action and a short reason unless blocked or a real user decision is required.\n4. Complete the persistence-routing, handoff-sufficiency, `Closeout outcome`, and `Project-required persistence` fields. Apply the packet-only reconstruction check below before answering handoff sufficiency. The next agent must be able to continue from `AGENTS.md`, the handoff, the project index when needed, and routed packs without searching old log history. `complete` is allowed only when all required writes/read-backs and any project-required persistence succeeded; use `not_required` only when that persistence is genuinely not required. If a required commit, push, release record, or equivalent persistence is blocked or not authorized, set both fields to `blocked` with the exact boundary.\n5. Add one concise log entry for work actually performed. Record evidence disposition and the prompt-mirror verification result; omit the full opening message by design.\n6. Update the project index and sync registry only when their owned maps or obligations changed. Record each applicable sync target as `confirmed`, `unverified`, `pending`, `blocked`, or `not_applicable`.\n7. Run `agent-handoff-kit workspace-health --root <project root>` or equivalent read-only Git probes, then record only the last-verified root, Git root, branch, commit, worktrees / parallel workspaces, uncommitted changes, and unresolved drift. Do not clean or change them without separate authorization. Do not treat `dev/PROJECT_INDEX.md` or old handoff prose as the live worktree truth.\n8. If the session used external tools or helper processes, apply the integrations and safety ownership rules. Close only task-owned resources. Retain shared, user-owned, other-agent-owned, system, or ambiguous resources unless separately authorized; state visibility limits.\n9. Run the short maintenance trigger check below and record its result in the log.\n10. Mark first-use guidance `consumed` after the first successfully completed task or first full closeout. Upgrade must never reset `consumed` or `not_applicable` to `eligible`.\n11. Verify `START_NEXT_SESSION_PROMPT.txt` against the sole fenced handoff opening-message block first. Regenerate it only when normalized content differs, then run the project's fixed prompt-mirror checker or perform an equivalent anchored read-back that verifies marker, heading, fence, full-copy uniqueness, and normalized content equality.\n12. Run available project-specific closeout checks. Do not run a separate bundled `doctor`: the `closeout-status` command below performs the one required fresh doctor read-back. Do not treat an external update-check failure as local closeout failure. Fix state or mirror failures before claiming handoff ready.\n13. Run `agent-handoff-kit closeout-status --root <project root>` after the handoff and prompt read-back. It performs the one required fresh doctor read-back plus a read-only workspace-health comparison against the handoff snapshot, and its output is the only final card source: copy its status faithfully. A nonzero result means the closeout is blocked; do not replace it with a success summary.\n\n## Packet-Only Reconstruction Check\n\nBefore closing out, reconstruct the next task using only the handoff, without chat memory, old logs or opening linked sources. Identify the parent outcome and consumer, the current step's relation to it, the exact resume point, remaining step/parent acceptance, and required sources with revision/freshness, reading scope/depth and unread gaps. Cite the owning handoff sections in `Reconstruction evidence`; do not create a second task summary. Then compare that reconstruction against the user's actual request and the relevant sources read this session. Missing, contradictory or assumed critical facts must be repaired in their existing handoff sections or explicitly recorded as blockers with the next clarification/read needed. Do not answer yes on labels or a successful CLI card alone: the CLI checks the recorded answer and evidence presence, not the truth of this reconstruction.\n\nKeep one `Answer:` line (`yes`, `no` or `unknown`, with optional explanation) and one `Reconstruction evidence:` line inside the marked sufficiency section. An affirmative answer requires concrete section references; keep `next-ai-can-continue` consistent. For an older handoff, add missing facts to its existing sections at this authorized closeout; upgrade must preserve user state and must not invent reconstruction evidence. Missing or negative answers, placeholder evidence and duplicate fields block `closeout-status` without changing project files.\n\nUse only the depth needed to resume safely. A standalone task needs no invented parent tree; state that it is the whole task. Finishing a child does not complete its parent or authorize another step. Keep the next consequential action bounded by its input, output and acceptance; do not enumerate every future microstep. Keep decision-relevant terms and identifiers faithful; when a translation could change their meaning, retain the original term alongside it. Reading coverage is previous-session evidence, never permission for the next agent to skip required fresh source reads. Honest blocked-work handoff can be sufficient when the missing fact, impact and safe next action are explicit.\n\n## Maintenance Trigger Check\n\nEvery full closeout runs this short check; full maintenance runs only when triggered.\n\n- SESSION_LOG: trigger when the main log reaches at least 11 entries, exceeds 1500 lines, or the 10-closeout backstop is due. Keep recent safety-buffer entries; collapse only content already absorbed by an authoritative home. Archive older raw entries to `dev/SESSION_LOG_archive/archive_<batch>_<low_date>_to_<high_date>.md` and maintain `INDEX.md`. Port unique narrative before collapsing it.\n- PROJECT_DECISIONS: trigger when a decisions-like handoff section has at least 30 entries; retain the newest 8–22 in the hot tier and move older decisions into the decisions archive. Also write substantive task evolution, a multi-option architectural choice with rationale, or a cross-session learning when observed.\n- Backstop: every 10 closeouts, run the full long-term maintenance pass even when no semantic trigger is obvious. If the count cannot be determined confidently at the boundary, treat the backstop as due.\n\nIf no trigger applies, record one no-op reason. Handoff carries continuity; log and project decisions carry trace and long-term narrative.\n\n## Opening Message And Card\n\nThe handoff opening-message block is authoritative. It must name the absolute root, route the agent through `AGENTS.md` and the handoff, state the current objective and boundary, and avoid instructing the next agent to redo completed work. It must not require SESSION_LOG as an ordinary startup read.\n\nUse `agent-handoff-kit closeout-status --root <project root>` after the required read-backs. It renders the verified version when available and otherwise `version unverified`; never print the literal placeholder `v<version>`, hand-compose a substitute card, or use `handoff saved` unless the command reports `status: complete`.\n\n```text\n /\\_/\\ Agent Handoff Kit v<version>\n ( -.- ) handoff saved\n > ^ <\n\nstatus: complete\n✅ Done: <completed summary>\n🔎 QC: <validation summary>\n📌 Handoff: opening message ready\n⚠️ Boundary: <important boundary or none>\n```\n\nFor `status: blocked`, the command instead says `handoff blocked`; retain that status, blocker reason, and human explanation: `這不是失敗;只是還有事未保存、未提交、未驗證或需要處理。先照 Blocker 行處理,不要把本輪當作已完成交接。` Then give the short local-root entry `Start Agent Handoff` / `開工` and the path-bearing fallback for an agent not yet pointed at the root. Do not hand-compose a third stateful prompt in the final response.\n\n## Stop Conditions\n\nDo not claim closeout complete when any required write or read-back failed, lifecycle state conflicts remain, the mirror is stale or duplicated, the root is uncertain, mandatory sync is unclassified, `closeout-status` is nonzero, or required Git persistence was explicitly part of the project's closeout contract but did not succeed. State the exact blocker and leave the project in an honest resumable state.\n"
14721
+ },
14722
+ "9fd892ee9d3cd174e9d15913d49ee9845ff0cb8f7e5adb28fa3507f7ab5b4ebc": {
14723
+ "targetRel": "AGENTS.md",
14724
+ "canonicalSha256": "f2f2c8c5cd761e28cb8dad7da77fc193b53f153b5d97d5e965b8cb47280d7fa7",
14725
+ "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\nWhen resuming, use the handoff's Task Understanding, Active Objective and Next Task Required Reading to recover the parent outcome, current step, resume point, remaining acceptance and source coverage. Surface missing critical context in the startup warning and recommend the specific clarification/read; do not infer parent completion from a finished child or treat previous-session reading as your own. Bare startup remains status-only, with no extra source reads or writes.\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, one optional display-only current-thread title update when safely supported, 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, project-file writes, network access, other external actions, or opt-out wording such as \"unless you object I will start\". First-use exception: when `dev/SESSION_HANDOFF.md` says `First-use guidance state: eligible`, the active objective is empty / `TBD`, and there is no same-message concrete task, load `dev/rules/onboarding.md` and include a short first-use welcome plus the most relevant guided choices in the same response instead of ending status-only. 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 marks first-use guidance as `eligible`, so the first unresolved startup must enter onboarding; upgrade must not reset `consumed` or `not_applicable` back to `eligible`. A short message in a non-eligible root 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\nDuring explicit continuity startup, the only optional presentation effect beyond state recovery and card/status is a user-visible task/conversation title update, when the active runtime safely supports current-thread title control. Current-title readback is useful when available to avoid overwriting an already informative title, but it is not required when the tool safely targets the calling/current thread. If title control is exposed only through a bounded runtime tool-discovery mechanism, use that discovery once with a narrow title/rename/current-thread query before deciding the control is unavailable; then call only the discovered safe current-thread title tool. Do not list or inspect unrelated threads solely for naming, and do not create, fork, navigate, message, archive, pin, or otherwise manage tasks as part of startup title naming. Do not title from the raw continuity trigger or before handoff-derived startup facts are final. First derive the startup card's current objective, risk/boundary, and recommended next action; then choose and apply any title update as the last presentation side effect before returning the startup response. Replace only a generic or stale title, or update once when the main objective clearly changes; keep an informative title when readback proves it is already relevant, and do not rename for tests, reviews, or small substeps. Use `<project name>|<primary action>` from facts already loaded for startup: a concrete same-message task first, otherwise the loaded current objective plus recommended next action. Within those facts, select one concrete primary action in this order: the same-message task; the loaded current objective; the recommended next action. The continuity trigger itself and generic phrases such as `Start Agent Handoff`, `開工`, `開始交接工作`, or `開始工作交接` are not primary actions. If the loaded facts do not provide both a concrete project name and a concrete primary action, skip the title update. Do not read `dev/PROJECT_INDEX.md`, files, network, or other state solely to name the title. The title must not contain progress, completion, status, task/session IDs, absolute paths, secrets, or unverified facts. If safe current-thread title control is unavailable after the bounded discovery above, skip silently. The title is display-only; it is not project state, permission, progress, completion evidence, a health result, or a source of truth, and it does not authorize project/file writes, network activity, external task work, or continuation beyond the startup boundary.\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. Render the startup card in a fenced `text` block and preserve spacing so the ASCII status marker remains aligned. The first-use exception above replaces that status-only stop with onboarding only when the handoff state is `eligible`, the objective is empty / `TBD`, and there is no same-message concrete task. 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 or first-use onboarding is triggered, combine any card and guidance in one response.\n\nFor explicit bare continuity startup, after the handoff is read, the startup card may read only the bounded version evidence from `dev/PROJECT_INDEX.md`: the unique stable-semver `| Agent Handoff Kit template version | X.Y.Z | ... |` row inside the unique real `## Stack` section. Do not route on, summarize, or load any other Project Index content for startup, title, permissions, packs, health, or task work. Missing, unreadable, malformed, duplicate, prerelease, or out-of-Stack-only version evidence prints `version unverified`; the turn remains status-only with zero writes. A direct ordinary or stateless task does not read the handoff or Project Index merely to fill a card or version.\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- Task-first governance locality: when the user supplied a concrete, actionable, authorized task plan and no safety / source-truth / permission blocker prevents it, follow the plan's main acceptance path before governance side work. Governance may become the main path only when the task itself is governance, the user explicitly asks for governance bridge or long-term governance, the content semantically requires cross-session force, or deferring it would create a safety, continuity, source-of-truth, or discoverability blocker. Otherwise, keep governance to the smallest classification, indexing, sync, or Persistence Gate decision that does not change the main deliverable path; do not start governance bridge, long-term-governance routing, repo-wide scans, handoff writes, or closeout solely because the task mentions Markdown, README, docs, specs, plans, checklists, or generated outputs.\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- Ordinary document edits normally use local read-back and task-specific checks only. If the edited document itself is the target authority and the task does not touch Kit-managed files, migrations, release / closeout gates, external effects, cross-source conflicts, or blockers for safe continuation, do not run `agent-handoff-kit doctor`, write handoff / log state, or regenerate the startup mirror solely because a document changed.\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. This is the default for ongoing sessions. 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 real day / tool-session boundary, or a state where the current agent cannot continue and the next agent must take over. Ordinary external-tool use, a completed release / governance subtask, or a durable note during an ongoing session is not by itself a full closeout trigger. Load `dev/rules/closeout.md` only when this tier is selected.\n\nPre-closeout checkpoint guard: before writing `dev/SESSION_HANDOFF.md` or `dev/SESSION_LOG.md` without explicit closeout / checkpoint intent, identify the durable fact, why the edited target authority or user-visible answer is insufficient, and why that file is the smallest correct home. Do not write either file merely because the next AI might misread stale state, because a target-authority document changed, or to make the handoff mirror every intermediate step. If the gate selects a checkpoint, update only the named current-state field(s) or one concise log entry; preserve unrelated / historical handoff sections byte-stable where practical, and do not regenerate `START_NEXT_SESSION_PROMPT.txt`.\n\nDuring an ongoing task, between Persistence Gate decisions, `dev/SESSION_HANDOFF.md` may legitimately trail the read-back target authority. Treat that as expected lag, not drift, and do not update handoff merely to mirror each intermediate step. Still apply the gate when a durable or startup-needed fact must survive interruption, the handoff is the smallest correct home, Kit-managed / release / closeout / external-effect state changed, or full closeout is selected.\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. Workspace identity is a last-verified snapshot. Live root / Git / worktree truth belongs to `agent-handoff-kit workspace-health --root <project root>` or equivalent read-only Git probes, not to stale prose.\n5. Closeout is not complete until required files are written, read back, and the available closeout checks pass.\n6. 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.\n7. 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. Read the applicable packs, including their project supplements and required references, before deciding how to act; an index, title or remembered summary is not the rule itself. Apply them within the user's actual objective and instruction priority: do not invent a replacement goal, acceptance standard or competing rule system. Missing or conflicting requirements must be resolved from their owners, not filled by an invented policy. 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\nBefore changing `AGENTS.md` or adding a durable governance rule, use `dev/RULE_PACKS.md` to load `dev/rules/agent-governance.md` and locate the existing normative owner. Follow its `Governance Write Boundary` before choosing a writable location: installed official core and pack bodies are not project-editable rule homes. Default-core rules must apply to most sessions, protect safety or continuity, and be shorter than the routed detail they replace. Scenario-specific or project-specific detail belongs in an existing pack's project supplement or registered reference; a new pack is justified only when it creates a smaller, independently loadable responsibility with one normative owner. Do not copy the agent-governance classification table or workflow into the core.\n<!-- END Agent Handoff Kit managed core -->\n\n<!-- ack:user-rules-router:dev/USER_RULES.md -->\n<!-- ack:user-rules-acceptance:sha256=5028cb84e0cc2656b75c8d8aa9a5557e6f380da00a439788f35eeef95bf3e898 -->\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"
14726
+ },
14727
+ "5dcd857a4b7e3416bc1c454ba42d0683afa87d414232ec4bd9ebc4665f55d4a1": {
14728
+ "targetRel": "dev/rules/agent-governance.md",
14729
+ "canonicalSha256": "b36a1782d81476545769727e002248e2e6bbfd507e6a66941cc6c3d16ee60a16",
14730
+ "text": "# Agent Governance Pack\n\n## Scope\n\nUse for governance rules, prompts, agent instructions, handoff systems, startup/closeout behavior, skills, and rule packs.\n\n## Load When\n\n- User asks to change AI behavior, project governance, prompts, handoff, startup, closeout, or tool-use rules.\n- A change affects `AGENTS.md`, `dev/*`, rule packs, installer templates, or durable workflow docs.\n- User asks to bridge governance, connect a document to governance, scan for unbridged governance documents, or uses equivalent Chinese phrases such as \"治理打通\", \"把文件接入 Agent Handoff Kit\", \"接入 Agent Handoff Kit\", or \"掃描未接入 Agent Handoff Kit 的重要文件\".\n- User asks to make something long-term, cross-session, reusable, future sessions should remember an API / MCP / tool-use pattern, or uses equivalent Chinese phrases such as \"寫入長期治理\", \"轉成長期機制\", or \"之後都要遵守\".\n- The task creates or materially changes Markdown governance artifacts, source-of-truth files, durable workflow docs, or durable artifacts that future agents may need to discover. Ordinary target-authority documents, drafts, and user-task deliverables do not load this pack solely because they are Markdown or generated.\n\n## Rules\n\n1. Locate the existing source of truth before adding a rule. Read the matching categories in `dev/RULE_PACKS.md`, their applicable packs, project supplements and required references first; then apply `Governance Write Boundary` below. A matching topic does not make official prose writable.\n2. Prefer merge, replace, or registry rows over append-only rule growth, within the verified project-owned location. Change an existing project rule in place rather than duplicating it in another file or appending an override.\n3. Keep public runtime rules generic; project-specific incidents belong in logs, runbooks, or project index.\n4. Do not let development-only workspace rules enter public runtime.\n5. Check complexity budget before adding default-core behavior.\n6. Before creating durable workflow, runbook, or instruction files, first classify the knowledge type and verify whether an existing home can carry it without a new file: current state belongs in `dev/SESSION_HANDOFF.md`; trace evidence belongs in `dev/SESSION_LOG.md`; file / command / reference maps belong in `dev/PROJECT_INDEX.md`; sync obligations belong in `dev/DOC_SYNC_REGISTRY.md`; reusable operating procedures belong in the relevant rule pack or registered reference. New runbooks are last resort only.\n7. When a task uses external skills, subagents, demo workspaces, or another tool's closeout, treat those flows as subordinate to the active root's Agent Handoff Kit governance. The active root still needs the `runtime-core/AGENTS.core.md` persistence gate decision; do not duplicate the gate thresholds in this pack.\n8. Before any pre-closeout handoff / log write for governance work, apply the core Persistence Gate explicitly. A concern that future agents may read stale handoff is not enough when the changed rule, spec, runbook, or document is itself the target authority; leave handoff lag expected unless checkpoint conditions are met. When the gate does select a checkpoint, write only the smallest current-state field or concise log entry and leave historical evidence sections byte-stable where practical.\n9. For long-running projects, maintain `dev/PROJECT_DECISIONS.md` per R-028 closeout discipline (see `runtime-core/AGENTS.core.md` closeout maintenance trigger check): capture major decisions when they happen, run the short trigger check at every closeout, and do full long-term maintenance only when a hard trigger, semantic trigger, or 10-closeout backstop applies. Short single-task projects keep this as a no-op default; users are not expected to edit this file manually.\n10. Governance bridge is a triggered review, not a default startup scan. Use it when an important file, source-of-truth document, runbook, production guide, workflow, checklist, stock list, or similar durable document may need to be connected to project governance.\n11. Content-based trigger: long-term governance routing is content-based, not trigger-only. Even if the user does not use explicit governance-routing phrases, treat a statement as durable governance when it says future sessions must follow it, when it corrects a recurring AI mistake, or when it defines a reusable API / MCP / tool-use pattern. Do not persist long-term governance knowledge only in `dev/SESSION_LOG.md`, `dev/SESSION_HANDOFF.md`, or `START_NEXT_SESSION_PROMPT.txt`; those surfaces may be compressed, archived, or regenerated.\n12. Mid-task changes to product goals, requirements, development checklists, acceptance rules, exclusions, priorities, or scope are task contract changes. Before writing them, check whether the same contract already lives in a spec, backlog, issue list, README, runbook, project index entry, or handoff section. Merge into the existing authoritative home, then leave only a pointer or current-state summary elsewhere.\n13. New Markdown or generated documents are not automatically harmless. After creating or materially changing them, classify each artifact before completion: source of truth, reference, runbook, workflow, checklist, public document, generated output, one-time evidence, draft, or temporary. Durable artifacts must be discoverable from `dev/PROJECT_INDEX.md` or intentionally tied to a registered sync / source-of-truth row. Temporary or one-time evidence must be labeled as such in the task record or closeout so future agents do not treat it as hidden current state.\n14. Do not create a new document to hold a rule, requirement, checklist, or process if an existing authoritative document can carry it. Merge into the existing home or make the new document explicitly subordinate. If two files now carry the same durable instruction, resolve the duplicate by choosing one authoritative home and pointing the other to it.\n\n## Governance Write Boundary\n\nThis is the single write-location contract for installed projects, not for authorized Kit source development. It guides agent edits; it cannot intercept arbitrary editor writes.\n\n1. Classify the change before writing. Use the existing task category and normative owner; read the full relevant rule and its project supplements. A current task instruction is not automatically a durable rule. Do not create a new goal, acceptance threshold or balancing policy merely to reconcile your preferences with the user's request. Follow instruction priority; surface a material unresolved conflict instead of silently inventing an override.\n2. Treat the `AGENTS.md` managed-core region and complete official `dev/rules/*` pack bodies as protected. Daily project edits must not insert, translate, reformat, reorder or remove their contents or delimiters. Verify the installed version's official content before identifying the boundary; a heading, marker or version row alone is not ownership proof. Formal upgrade or an explicitly scoped repair owns official changes. If local rules are already interleaved, preserve them and report the required bounded reconciliation; do not guess which lines to delete or bless the mixed body as official.\n3. Reuse the matching pack's existing project supplement when it owns the rule. Otherwise place a short local rule after the entire verified official body under `## Project Rules`; preserve the official trailing newline. This heading labels the writable appendix, not the end of official ownership. For substantial or shared procedures, reuse a registered project reference; create a new reference only if no suitable owner exists. If `dev/USER_RULES.md` formally owns the rule, use its accepted update procedure rather than editing witnessed bytes or creating a competing copy. Always-needed project entry rules may live outside the managed core only after checking their existing owner.\n4. Preserve project-state schemas separately: edit handoff fields, actual log entries, index data or registry rows in their existing writable sections; do not insert policy into template instructions or alter machine markers. Preserve official routing rows in `dev/RULE_PACKS.md`; add a project row only when a project reference needs a task trigger, naming both the relevant pack and reference. A same-pack appendix uses that pack's existing route. Do not add a route or load a pack merely for bare startup.\n5. Before and after an edit touching core or pack files, compare the complete protected region against the verified input; every protected byte must remain unchanged. Use the installed-version CLI's read-only `upgrade --dry-run --root <project root>` before and after those edits as the compatibility check; record the CLI version and any existing conflict separately. A pre-existing conflict requires reconciliation before claiming the write boundary is verified. A new conflict or changed official region prevents completion; restore only your own scoped change from its verified input without discarding concurrent or pre-existing user work. For ordinary project-state edits, use schema/marker and local readback checks instead of an upgrade preview.\n6. Read back the rule from its normal consumer path: task signal -> router -> relevant pack including the project supplement and required reference -> requested action. Verify its exact requirement, scope and precedence, and that unrelated packs stay unloaded. An indexed file that no applicable route reads is not connected. Evidence must show both correct application and preserved upgrade compatibility; a successful preview alone does not prove an AI followed the rule.\n\n## Governance Bridge Workflow\n\nUse this workflow when the user asks for governance bridge, connect this document to governance, asks to scan for unbridged governance documents, or uses equivalent Chinese phrases such as \"治理打通\", \"把文件接入 Agent Handoff Kit\", \"接入 Agent Handoff Kit\", or \"掃描未接入 Agent Handoff Kit 的重要文件\".\n\n1. Identify the target. If the user named a file, inspect that file and its surrounding directory. If no file is named, run a bounded repo scan for likely durable documents such as source-of-truth files, runbooks, workflows, guides, checklists, stock lists, production guides, and rules.\n2. Check the target file itself: it should state its role, scope, update trigger, owner or responsible workflow when known, and what must not be inferred from it.\n3. Check `dev/PROJECT_INDEX.md`: the file should be discoverable with its role and \"read when\" condition. Source-of-truth or reference files should appear in Fact Base, External Sources, Directory Map, Entry Points, or another existing indexed home that fits the project.\n4. Check `dev/DOC_SYNC_REGISTRY.md`: future same-type changes should have a matching change type or an explicit reason no durable sync rule is needed.\n5. Check related workflows, guides, runbooks, or rule packs: if a process creates or updates the file, that process should say when to update the file or its index row.\n6. Check `dev/SESSION_HANDOFF.md`: only current state, recommended next action with reason, unresolved risk, blocker, or a startup-needed fact should be in handoff. Do not copy whole documents or old evidence into handoff.\n7. Check `dev/SESSION_LOG.md`: this session's bridge review, validation, and evidence can be logged when it affects future action, but log entries must not become current state.\n8. Search for duplicate source-of-truth risk. If another file has the same durable role, recommend merge, reference, or retire options; do not delete, rename, or move files without explicit approval.\n\nFor repo-wide scans, report candidates as candidates. Do not fail ordinary docs merely because they are not indexed; only durable files that future agents need to discover, update, or distinguish from drafts should be bridged.\n\nOutput format:\n\n- Status: bridged / partially bridged / unbridged / blocked.\n- Use bridged only when every applicable governance link is present. If only `dev/PROJECT_INDEX.md` or `dev/SESSION_LOG.md` was updated, report partially bridged.\n- Already bridged: list the governance links that are present.\n- Gaps: list missing links and why they matter for the next agent.\n- Not applicable: list skipped layers with a reason.\n- Suggested patches: list exact files and sections to update.\n- Manual decisions: list duplicates, naming choices, deletion, renaming, external sync, or ownership questions requiring user confirmation.\n- Acceptance: give one concrete check that proves the bridge is complete.\n\n## Generated Artifact Governance Workflow\n\nUse this workflow whenever the current task creates or materially changes Markdown documents or other durable artifacts, even if the user did not explicitly ask for governance bridge.\n\nThis workflow is subordinate to the core task-first governance locality rule. Use it as a proportionate classification / routing check, not as permission to interrupt an explicit user task plan, start a repo-wide governance scan, or turn an ordinary user-task deliverable into governance work.\n\n1. List the artifacts created or materially changed in this task.\n2. Classify each artifact: source of truth, reference, runbook, workflow, checklist, public document, generated output, one-time evidence, draft, or temporary.\n3. For source-of-truth, reference, runbook, workflow, checklist, public document, and reusable generated output, update `dev/PROJECT_INDEX.md` so the file is discoverable with a role and read condition.\n4. For artifacts that require future mirror, external index, publication, or repeated sync, update `dev/DOC_SYNC_REGISTRY.md` or record why no durable sync rule applies.\n5. For one-time evidence, draft, or temporary files, record that classification in `dev/SESSION_LOG.md` or the task summary, and do not promote it to current handoff unless it affects the next action.\n6. Search for duplicate source-of-truth risk before keeping a new document. If another file already owns the same rule, requirement, checklist, or process, merge into that file or make the new document explicitly subordinate.\n7. Before claiming completion, explicitly confirm the artifacts created or materially changed in this task have been classified, indexed, synchronized, consolidated, or marked temporary through the steps above. Existing target-authority documents that only received a local content edit normally need read-back and task-specific validation, not a handoff / log write or a bundled doctor run. You may run the available project governance check and `agent-handoff-kit doctor` only for scoped Kit / typed registered-surface checks; doctor does not discover unregistered ordinary workspace files and cannot replace explicit changed-artifact review.\n\n## Long-term Governance Routing\n\nUse this workflow when the user asks to write something into long-term governance, turn an experience into a mechanism, make a rule apply across sessions, or when the content itself clearly has durable force.\n\n1. Classify the knowledge before writing:\n - Current task contract changes, including product goals, requirements, development checklists, acceptance rules, exclusions, priorities, or scope -> the existing authoritative spec / backlog / issue / runbook when one exists; otherwise `dev/SESSION_HANDOFF.md` current-state sections.\n - Current task state, recommended next action with reason, unresolved risk, or startup-needed fact -> `dev/SESSION_HANDOFF.md`.\n - Chronological evidence or validation trace -> `dev/SESSION_LOG.md`.\n - File maps, command maps, API reference locations, tool capability maps, and external source coordinates -> `dev/PROJECT_INDEX.md`.\n - Sync obligations or external mirror duties -> `dev/DOC_SYNC_REGISTRY.md`.\n - Durable decisions, architecture trade-offs, research-derived rationale, and long-term lessons -> `dev/PROJECT_DECISIONS.md`.\n - Reusable procedures, recurring mistake prevention, API / MCP / tool-use rules -> the relevant rule pack, registered reference, or QA check.\n - API / MCP / tool-use patterns -> project index / registered reference / integrations pack, depending on scope.\n2. If the knowledge is reusable but no existing home fits, propose the smallest new registered reference or rule-pack patch. New runbooks remain last resort.\n3. If the knowledge was first captured in `SESSION_LOG` or handoff for short-term continuity, promote it to the correct durable home before claiming it is long-term.\n4. Add or update a QA check when the same failure class could recur and can be tested.\n5. Repeat-failure escalation: when the same failure class recurs after an AI has already claimed a durable fix for that class, do not continue with another same-pattern patch as ordinary work. Limit the escalation to the affected domain: identify the authoritative owner, correct or remove the failed method there, add a counterexample or replay check that would have failed before the fix when feasible, and state the temporary constraint. If the failure recurs again after that root-fix validation, separate the change and validation roles where the runtime provides an independent reviewer, subagent, or fresh-context pass; when none is available, perform a fresh read-back pass against the replay check and mark independent review unavailable instead of blocking unrelated work. Restore normal flow as soon as the replay and review / read-back pass. Do not create a central penalty database, cross-project blacklist, permanent role split, or public rule carrying project-specific incident details.\n6. Keep governance bridge wording reserved for document orphan prevention. Do not relabel non-file governance as \"file connected to Agent Handoff Kit\".\n\n## Checks\n\n- Verify affected files are indexed or intentionally installed templates.\n- Check `dev/DOC_SYNC_REGISTRY.md` for governance, closeout/startup, and README sync rows.\n- Confirm old overlapping wording was retired or marked legacy.\n- Confirm any new durable file is reachable from `dev/PROJECT_INDEX.md` and does not rely only on a one-session handoff note.\n- Confirm every Markdown document or generated artifact created in this task is indexed, synced, consolidated, or explicitly classified as draft / temporary / one-time evidence.\n- Confirm no new file has become a parallel source for an existing rule, requirement, checklist, or process.\n- Confirm reusable operating procedure knowledge is not stored only in `dev/SESSION_HANDOFF.md`, `dev/SESSION_LOG.md`, or a decision narrative when it belongs in a pack or registered reference.\n- Confirm long-term governance knowledge is promoted out of `dev/SESSION_LOG.md`, `dev/SESSION_HANDOFF.md`, and `START_NEXT_SESSION_PROMPT.txt` when it should survive log archive or prompt regeneration.\n- Confirm repeat-failure escalation, when triggered, is limited to the affected domain, tied to the authoritative owner, backed by a counterexample or replay check when feasible, and does not create a central penalty store, cross-project blacklist, or permanent role split.\n- For governance bridge work, confirm the target file, project index, sync registry, related workflow, handoff/log role split, and duplicate-source risk were all checked or explicitly marked not applicable.\n- For governance bridge work, run bounded searches for the target path/name and the relevant artifact class or sync-change type across the project index, sync registry, related workflows, and current rule owners. If the target is tied to generated outputs, also inspect the workflow or production guide that creates those outputs. Search evidence is a check, not a second source of truth.\n- Before claiming completion, apply the active root's core persistence gate and record the result only when that gate selects a checkpoint or full closeout; do not assume child or demo workspaces cover the parent/root workspace.\n- For long-running projects, confirm `dev/PROJECT_DECISIONS.md` retains its four H2 sections in order (Evolution Timeline / Decisions Archive / Architecture Choices / Insights & Learnings) and that the closeout maintenance trigger check was recorded, with full maintenance applied where its trigger conditions were met.\n\n## Closeout\n\nRecord the changed rule home, reason, complexity impact, retired wording, and follow-up checks.\n"
14356
14731
  }
14357
14732
  },
14358
- "catalogDigestSha256": "ebe11fec067a636ad85aea88d2203395827774b7acdb7514f4a21169317db395"
14733
+ "catalogDigestSha256": "8665ec8cbca184bcdfeb5be04167126bd8adfeadb2ff841c7c4144d1aeb14d76"
14359
14734
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamchanadam/agent-handoff-kit",
3
- "version": "0.3.65",
3
+ "version": "0.3.67",
4
4
  "description": "Lightweight agent harness for project memory, handoff, and multi-session continuity.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,8 +14,8 @@ Use for governance rules, prompts, agent instructions, handoff systems, startup/
14
14
 
15
15
  ## Rules
16
16
 
17
- 1. Locate the existing source of truth before adding a rule.
18
- 2. Prefer merge, replace, or registry rows over append-only rule growth.
17
+ 1. Locate the existing source of truth before adding a rule. Read the matching categories in `dev/RULE_PACKS.md`, their applicable packs, project supplements and required references first; then apply `Governance Write Boundary` below. A matching topic does not make official prose writable.
18
+ 2. Prefer merge, replace, or registry rows over append-only rule growth, within the verified project-owned location. Change an existing project rule in place rather than duplicating it in another file or appending an override.
19
19
  3. Keep public runtime rules generic; project-specific incidents belong in logs, runbooks, or project index.
20
20
  4. Do not let development-only workspace rules enter public runtime.
21
21
  5. Check complexity budget before adding default-core behavior.
@@ -29,6 +29,17 @@ Use for governance rules, prompts, agent instructions, handoff systems, startup/
29
29
  13. New Markdown or generated documents are not automatically harmless. After creating or materially changing them, classify each artifact before completion: source of truth, reference, runbook, workflow, checklist, public document, generated output, one-time evidence, draft, or temporary. Durable artifacts must be discoverable from `dev/PROJECT_INDEX.md` or intentionally tied to a registered sync / source-of-truth row. Temporary or one-time evidence must be labeled as such in the task record or closeout so future agents do not treat it as hidden current state.
30
30
  14. Do not create a new document to hold a rule, requirement, checklist, or process if an existing authoritative document can carry it. Merge into the existing home or make the new document explicitly subordinate. If two files now carry the same durable instruction, resolve the duplicate by choosing one authoritative home and pointing the other to it.
31
31
 
32
+ ## Governance Write Boundary
33
+
34
+ This is the single write-location contract for installed projects, not for authorized Kit source development. It guides agent edits; it cannot intercept arbitrary editor writes.
35
+
36
+ 1. Classify the change before writing. Use the existing task category and normative owner; read the full relevant rule and its project supplements. A current task instruction is not automatically a durable rule. Do not create a new goal, acceptance threshold or balancing policy merely to reconcile your preferences with the user's request. Follow instruction priority; surface a material unresolved conflict instead of silently inventing an override.
37
+ 2. Treat the `AGENTS.md` managed-core region and complete official `dev/rules/*` pack bodies as protected. Daily project edits must not insert, translate, reformat, reorder or remove their contents or delimiters. Verify the installed version's official content before identifying the boundary; a heading, marker or version row alone is not ownership proof. Formal upgrade or an explicitly scoped repair owns official changes. If local rules are already interleaved, preserve them and report the required bounded reconciliation; do not guess which lines to delete or bless the mixed body as official.
38
+ 3. Reuse the matching pack's existing project supplement when it owns the rule. Otherwise place a short local rule after the entire verified official body under `## Project Rules`; preserve the official trailing newline. This heading labels the writable appendix, not the end of official ownership. For substantial or shared procedures, reuse a registered project reference; create a new reference only if no suitable owner exists. If `dev/USER_RULES.md` formally owns the rule, use its accepted update procedure rather than editing witnessed bytes or creating a competing copy. Always-needed project entry rules may live outside the managed core only after checking their existing owner.
39
+ 4. Preserve project-state schemas separately: edit handoff fields, actual log entries, index data or registry rows in their existing writable sections; do not insert policy into template instructions or alter machine markers. Preserve official routing rows in `dev/RULE_PACKS.md`; add a project row only when a project reference needs a task trigger, naming both the relevant pack and reference. A same-pack appendix uses that pack's existing route. Do not add a route or load a pack merely for bare startup.
40
+ 5. Before and after an edit touching core or pack files, compare the complete protected region against the verified input; every protected byte must remain unchanged. Use the installed-version CLI's read-only `upgrade --dry-run --root <project root>` before and after those edits as the compatibility check; record the CLI version and any existing conflict separately. A pre-existing conflict requires reconciliation before claiming the write boundary is verified. A new conflict or changed official region prevents completion; restore only your own scoped change from its verified input without discarding concurrent or pre-existing user work. For ordinary project-state edits, use schema/marker and local readback checks instead of an upgrade preview.
41
+ 6. Read back the rule from its normal consumer path: task signal -> router -> relevant pack including the project supplement and required reference -> requested action. Verify its exact requirement, scope and precedence, and that unrelated packs stay unloaded. An indexed file that no applicable route reads is not connected. Evidence must show both correct application and preserved upgrade compatibility; a successful preview alone does not prove an AI followed the rule.
42
+
32
43
  ## Governance Bridge Workflow
33
44
 
34
45
  Use this workflow when the user asks for governance bridge, connect this document to governance, asks to scan for unbridged governance documents, or uses equivalent Chinese phrases such as "治理打通", "把文件接入 Agent Handoff Kit", "接入 Agent Handoff Kit", or "掃描未接入 Agent Handoff Kit 的重要文件".
package/packs/closeout.md CHANGED
@@ -30,7 +30,7 @@ Handoff cold zones are historical / evidence sections, old validation records, c
30
30
 
31
31
  1. Reconcile `dev/SESSION_HANDOFF.md`; never append a new current-state snapshot beneath an old one. Verify durable anchors, then update only changed closeout-reconciled fields or sections; leave already-current sections unchanged instead of rewriting them for ceremony.
32
32
  2. Reconcile lifecycle state across `Completed This Session`, `Validation / QC`, `Next Priorities`, `Risks / Blockers`, and `Next Session Opening Message`. Completed or verified work cannot remain unresolved unless explicitly reclassified as monitor-only, follow-up scope, blocked, or reopened with its missing evidence or trigger.
33
- The bundled doctor is a mechanical floor for required lifecycle markers and readable sections only. The semantic lifecycle gate is `agent-handoff-kit closeout-status`; when it blocks, use its first `Resolved [...]` / `Carry-forward [...]` pair to repair the handoff, not a separate project workaround, repeated doctor runs, or a broader governance rewrite. Read all five sections as a whole before marking the lifecycle field resolved. For governance, release, or another project-defined high-risk completion, use the project's independent semantic review gate in addition to `closeout-status`.
33
+ The bundled doctor is a mechanical floor for required lifecycle markers and readable sections only. `agent-handoff-kit closeout-status` checks explicit lifecycle declarations and same-scope textual contradictions; it does not prove natural-language semantic consistency. When it blocks, inspect its first `Resolved [...]` / `Carry-forward [...]` pair against the actual evidence: completion of one action does not complete another acceptance scope, and a preserved limitation is not a completion claim. Repair a real contradiction in its owning handoff section. If truthful, distinct scopes are misclassified, preserve the facts, report the checker defect and stop wording retries; do not add a reclassification prefix, invent a trigger, erase a limitation or broaden governance just to pass. A blocked result remains blocked until verified repair. Read all five sections as a whole before marking the lifecycle field resolved. For governance, release, or another project-defined high-risk completion, use the project's independent semantic review gate in addition to `closeout-status`.
34
34
  3. Make `Next Priorities` name one recommended next action and a short reason unless blocked or a real user decision is required.
35
35
  4. Complete the persistence-routing, handoff-sufficiency, `Closeout outcome`, and `Project-required persistence` fields. Apply the packet-only reconstruction check below before answering handoff sufficiency. The next agent must be able to continue from `AGENTS.md`, the handoff, the project index when needed, and routed packs without searching old log history. `complete` is allowed only when all required writes/read-backs and any project-required persistence succeeded; use `not_required` only when that persistence is genuinely not required. If a required commit, push, release record, or equivalent persistence is blocked or not authorized, set both fields to `blocked` with the exact boundary.
36
36
  5. Add one concise log entry for work actually performed. Record evidence disposition and the prompt-mirror verification result; omit the full opening message by design.
@@ -13,13 +13,23 @@ When resuming, use the handoff's Task Understanding, Active Objective and Next T
13
13
  Route intent in this order:
14
14
 
15
15
  1. Clear closeout intent routes directly to `dev/rules/closeout.md`.
16
- 2. 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, one optional display-only current-thread title update when safely supported, 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, project-file writes, network access, other external actions, or opt-out wording such as "unless you object I will start". First-use exception: when `dev/SESSION_HANDOFF.md` says `First-use guidance state: eligible`, the active objective is empty / `TBD`, and there is no same-message concrete task, load `dev/rules/onboarding.md` and include a short first-use welcome plus the most relevant guided choices in the same response instead of ending status-only. 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.
16
+ 2. 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 display-only current-thread naming checkpoint when safely supported, 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, project-file writes, network access, other external actions, or opt-out wording such as "unless you object I will start". First-use exception: when `dev/SESSION_HANDOFF.md` says `First-use guidance state: eligible`, the active objective is empty / `TBD`, and there is no same-message concrete task, load `dev/rules/onboarding.md` and include a short first-use welcome plus the most relevant guided choices in the same response instead of ending status-only. 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.
17
17
  3. A direct ordinary task begins without a startup card or onboarding ceremony. Read only the sources and packs required by that task.
18
18
  4. Explicit guidance requests such as "I'm new", "teach me", "help me start", "新手", "教我用", or "點開始" may load `dev/rules/onboarding.md`. A fresh install marks first-use guidance as `eligible`, so the first unresolved startup must enter onboarding; upgrade must not reset `consumed` or `not_applicable` back to `eligible`. A short message in a non-eligible root 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.
19
19
 
20
20
  Treat 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.
21
21
 
22
- During explicit continuity startup, the only optional presentation effect beyond state recovery and card/status is a user-visible task/conversation title update, when the active runtime safely supports current-thread title control. Current-title readback is useful when available to avoid overwriting an already informative title, but it is not required when the tool safely targets the calling/current thread. If title control is exposed only through a bounded runtime tool-discovery mechanism, use that discovery once with a narrow title/rename/current-thread query before deciding the control is unavailable; then call only the discovered safe current-thread title tool. Do not list or inspect unrelated threads solely for naming, and do not create, fork, navigate, message, archive, pin, or otherwise manage tasks as part of startup title naming. Do not title from the raw continuity trigger or before handoff-derived startup facts are final. First derive the startup card's current objective, risk/boundary, and recommended next action; then choose and apply any title update as the last presentation side effect before returning the startup response. Replace only a generic or stale title, or update once when the main objective clearly changes; keep an informative title when readback proves it is already relevant, and do not rename for tests, reviews, or small substeps. Use `<project name>|<primary action>` from facts already loaded for startup: a concrete same-message task first, otherwise the loaded current objective plus recommended next action. Within those facts, select one concrete primary action in this order: the same-message task; the loaded current objective; the recommended next action. The continuity trigger itself and generic phrases such as `Start Agent Handoff`, `開工`, `開始交接工作`, or `開始工作交接` are not primary actions. If the loaded facts do not provide both a concrete project name and a concrete primary action, skip the title update. Do not read `dev/PROJECT_INDEX.md`, files, network, or other state solely to name the title. The title must not contain progress, completion, status, task/session IDs, absolute paths, secrets, or unverified facts. If safe current-thread title control is unavailable after the bounded discovery above, skip silently. The title is display-only; it is not project state, permission, progress, completion evidence, a health result, or a source of truth, and it does not authorize project/file writes, network activity, external task work, or continuation beyond the startup boundary.
22
+ ### Current-thread naming checkpoint
23
+
24
+ During explicit continuity startup, naming is a required presentation checkpoint when safe current-thread title control is available, not an optional task. After the minimum authorized startup reads, derive the current objective, boundary and recommended next action; resolve this checkpoint before emitting the final startup card or beginning any same-message authorized task work. Do not defer the tool call until after the final response or until the task is finished. If interrupted before the checkpoint resolves, handle it on the next user-authorized turn using current facts; do not schedule a background rename.
25
+
26
+ Use `<project name>|<primary action>` from already-loaded facts: the concrete current user task first, then an unresolved current objective, then a concrete recommended action. Do not revive a completed child task from historical handoff text. When the project is known but no concrete action remains, use the project name alone; do not leave a new task named `開工` merely because the previous work is complete. If the project name is unknown, skip without guessing or extra source reads. `Start Agent Handoff`, `開工`, `開始交接工作` and `開始工作交接` are not primary actions. Titles must not contain progress, completion, status, task/session IDs, absolute paths, secrets or unverified facts.
27
+
28
+ Use the current runtime's exposed tool schema. If a safe current-thread title tool is already available, call it directly; otherwise use a bounded runtime tool-discovery mechanism once with a narrow title/rename/current-thread query, when available. Never invent a tool name or require discovery when the tool is already exposed. Current-title readback is useful when available, but is not required when the tool safely targets the calling/current thread. Replace a generic or stale title; keep an informative title when readback proves it is already relevant, and preserve an explicitly user-chosen title unless the user asks to change it. When the current title cannot be read, use one safe current-thread set call with the derived title. Omit the target identifier only when the schema documents current-thread targeting; otherwise require a verified current-thread identifier. Do not list or inspect unrelated threads solely for naming, and do not create, fork, navigate, message, archive, pin or otherwise manage tasks for this checkpoint.
29
+
30
+ Before the final response, resolve the checkpoint as applied (successful tool result confirms the title), kept (relevant or user-chosen title), unavailable (no safe capability), skipped (project unknown), or failed/unverified (error or no confirmation). Use a targeted current-thread readback when available; an ambiguous write requires readback before any retry. Only a verified mismatch permits one safe corrective call; never loop or overwrite a later user rename. Do not assume a universal timing window or automatic-title overwrite across AI apps. An unavailable capability does not block startup; skip silently. A failed/unverified attempted rename gets a brief startup warning, not a success claim. Once resolved, return the card and stop for bare startup. On a later user-authorized turn, revisit naming when the primary task becomes concrete or changes, or a generic/stale title is observed; do not rename for tests, reviews or small substeps.
31
+
32
+ The title is display-only; it is not project state, permission, progress, completion evidence, a health result, or a source of truth. This checkpoint permits only the bounded title calls above; it does not authorize project/file writes, network research, external task work, extra startup reads or continuation beyond the startup boundary.
23
33
 
24
34
  Read `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.
25
35
 
@@ -115,7 +125,7 @@ The always-enforced closeout invariants are:
115
125
 
116
126
  ## 5. Pack Loading
117
127
 
118
- Use `dev/RULE_PACKS.md` to load the minimum task-specific set. Packs may add stricter requirements but cannot weaken core safety or continuity.
128
+ Use `dev/RULE_PACKS.md` to load the minimum task-specific set. Read the applicable packs, including their project supplements and required references, before deciding how to act; an index, title or remembered summary is not the rule itself. Apply them within the user's actual objective and instruction priority: do not invent a replacement goal, acceptance standard or competing rule system. Missing or conflicting requirements must be resolved from their owners, not filled by an invented policy. Packs may add stricter requirements but cannot weaken core safety or continuity.
119
129
 
120
130
  Load `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.
121
131
 
@@ -123,4 +133,4 @@ After the task, apply the Persistence Gate. Do not assume the next session remem
123
133
 
124
134
  ## Core Complexity Rule
125
135
 
126
- Before changing `AGENTS.md` or adding a durable governance rule, use `dev/RULE_PACKS.md` to load `dev/rules/agent-governance.md` and locate the existing normative owner. Default-core rules must apply to most sessions, protect safety or continuity, and be shorter than the routed detail they replace. Scenario-specific or project-specific 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. Do not copy the agent-governance classification table or workflow into the core.
136
+ Before changing `AGENTS.md` or adding a durable governance rule, use `dev/RULE_PACKS.md` to load `dev/rules/agent-governance.md` and locate the existing normative owner. Follow its `Governance Write Boundary` before choosing a writable location: installed official core and pack bodies are not project-editable rule homes. Default-core rules must apply to most sessions, protect safety or continuity, and be shorter than the routed detail they replace. Scenario-specific or project-specific detail belongs in an existing pack's project supplement or registered reference; a new pack is justified only when it creates a smaller, independently loadable responsibility with one normative owner. Do not copy the agent-governance classification table or workflow into the core.
@@ -166,5 +166,5 @@ Work in <absolute project root>. Read AGENTS.md, then dev/SESSION_HANDOFF.md. Tr
166
166
 
167
167
  If the root does not match the handoff, stop and ask for confirmation. Do not read dev/SESSION_LOG.md during ordinary startup. Read dev/PROJECT_INDEX.md, dev/RULE_PACKS.md, dev/DOC_SYNC_REGISTRY.md, and task packs only when the current task requires them.
168
168
 
169
- Resume the current objective. A plain `Start Agent Handoff` / `開工` with no same-message task or explicit long-run instruction only authorizes minimum state recovery, one optional display-only current-thread title update when safely supported, 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, project-file writes, network access, other external actions, or opt-out execution wording. First-use exception: when this handoff says `First-use guidance state: eligible`, the current objective is empty / `TBD`, and there is no same-message concrete task, load onboarding and include a short first-use welcome plus the most relevant guided choices in the same response instead of ending status-only. A concrete objective found only in this handoff is not authority to complete the objective. A same-message task may begin normally; an explicit instruction such as `開工,繼續做到下一個 blocker` or `開工,繼續完成目前目標` may continue under the normal task and safety rules. Upgrade never resets consumed / not_applicable first-use state back to eligible.
169
+ Resume the current objective. A plain `Start Agent Handoff` / `開工` with no same-message task or explicit long-run instruction only authorizes minimum state recovery, the display-only current-thread naming checkpoint when safely supported, 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, project-file writes, network access, other external actions, or opt-out execution wording. First-use exception: when this handoff says `First-use guidance state: eligible`, the current objective is empty / `TBD`, and there is no same-message concrete task, load onboarding and include a short first-use welcome plus the most relevant guided choices in the same response instead of ending status-only. A concrete objective found only in this handoff is not authority to complete the objective. A same-message task may begin normally; an explicit instruction such as `開工,繼續做到下一個 blocker` or `開工,繼續完成目前目標` may continue under the normal task and safety rules. Upgrade never resets consumed / not_applicable first-use state back to eligible.
170
170
  ```
@@ -2,4 +2,4 @@ Work in <absolute project root>. Read AGENTS.md, then dev/SESSION_HANDOFF.md. Tr
2
2
 
3
3
  If the root does not match the handoff, stop and ask for confirmation. Do not read dev/SESSION_LOG.md during ordinary startup. Read dev/PROJECT_INDEX.md, dev/RULE_PACKS.md, dev/DOC_SYNC_REGISTRY.md, and task packs only when the current task requires them.
4
4
 
5
- Resume the current objective. A plain `Start Agent Handoff` / `開工` with no same-message task or explicit long-run instruction only authorizes minimum state recovery, one optional display-only current-thread title update when safely supported, 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, project-file writes, network access, other external actions, or opt-out execution wording. First-use exception: when this handoff says `First-use guidance state: eligible`, the current objective is empty / `TBD`, and there is no same-message concrete task, load onboarding and include a short first-use welcome plus the most relevant guided choices in the same response instead of ending status-only. A concrete objective found only in this handoff is not authority to complete the objective. A same-message task may begin normally; an explicit instruction such as `開工,繼續做到下一個 blocker` or `開工,繼續完成目前目標` may continue under the normal task and safety rules. Upgrade never resets consumed / not_applicable first-use state back to eligible.
5
+ Resume the current objective. A plain `Start Agent Handoff` / `開工` with no same-message task or explicit long-run instruction only authorizes minimum state recovery, the display-only current-thread naming checkpoint when safely supported, 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, project-file writes, network access, other external actions, or opt-out execution wording. First-use exception: when this handoff says `First-use guidance state: eligible`, the current objective is empty / `TBD`, and there is no same-message concrete task, load onboarding and include a short first-use welcome plus the most relevant guided choices in the same response instead of ending status-only. A concrete objective found only in this handoff is not authority to complete the objective. A same-message task may begin normally; an explicit instruction such as `開工,繼續做到下一個 blocker` or `開工,繼續完成目前目標` may continue under the normal task and safety rules. Upgrade never resets consumed / not_applicable first-use state back to eligible.