@adamchanadam/agent-handoff-kit 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/bin/migration-baselines/official-origin-catalog.json +235 -1
- package/package.json +1 -1
- package/packs/closeout.md +3 -3
- package/packs/coding.md +2 -0
- package/packs/integrations.md +1 -14
- package/packs/safety.md +1 -1
- package/runtime-core/AGENTS.core.md +5 -7
package/README.en.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**Your session relay baton.** Help the next AI conversation pick up your work: keep progress, key decisions, file locations and unfinished tasks.
|
|
6
6
|
|
|
7
|
-
Code version covered: `v0.4.
|
|
7
|
+
Code version covered: `v0.4.5`. This guide includes updates that have not been released yet. Features available to download depend on the published version.
|
|
8
8
|
|
|
9
9
|
[](https://youtu.be/RopbfBiSw1I)
|
|
10
10
|
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**Session 接力棒**。讓下一次 AI 對話接得上:保留進度、重要決定、文件位置和未完事項。
|
|
6
6
|
|
|
7
|
-
文件對應程式版本:`v0.4.
|
|
7
|
+
文件對應程式版本:`v0.4.5`。這份說明包含尚未發布的更新;正式下載可用的功能,以已發布版本為準。
|
|
8
8
|
|
|
9
9
|
[](https://youtu.be/RopbfBiSw1I)
|
|
10
10
|
|
|
@@ -14651,6 +14651,181 @@
|
|
|
14651
14651
|
"canonicalSha256": "994ef946877e868418c02221f1a5d24d501da590694656921b9e1ae962d05a50"
|
|
14652
14652
|
}
|
|
14653
14653
|
}
|
|
14654
|
+
},
|
|
14655
|
+
"0.4.4": {
|
|
14656
|
+
"source": {
|
|
14657
|
+
"npm": {
|
|
14658
|
+
"spec": "@adamchanadam/agent-handoff-kit@0.4.4",
|
|
14659
|
+
"shasum": "bfda53fd8d0229b27e67e2190753fa32a2ae1851",
|
|
14660
|
+
"integrity": "sha512-1H6ib7StICVApD+EaieTEMwzo0LAhOQnChKHXJFaAH0QXJ/9FrxgiklnBzyoqOTbVbMGkYoQ5KHJz5hloS59EA==",
|
|
14661
|
+
"entryCount": 52,
|
|
14662
|
+
"gitHead": null
|
|
14663
|
+
},
|
|
14664
|
+
"git": {
|
|
14665
|
+
"tag": "v0.4.4",
|
|
14666
|
+
"directObject": "e34995b151da1e54f4641362d99b29ef138717da",
|
|
14667
|
+
"peeledCommit": "8dbe0e09d910d705f33498ee7089fa711d3064b6",
|
|
14668
|
+
"commit": "8dbe0e09d910d705f33498ee7089fa711d3064b6"
|
|
14669
|
+
},
|
|
14670
|
+
"githubRelease": {
|
|
14671
|
+
"tag": "v0.4.4",
|
|
14672
|
+
"publishedAt": "2026-10-18T11:08:42Z"
|
|
14673
|
+
},
|
|
14674
|
+
"sourceDivergence": {
|
|
14675
|
+
"status": "npm-gitHead-unavailable",
|
|
14676
|
+
"npmGitHead": null,
|
|
14677
|
+
"remoteTagCommit": "8dbe0e09d910d705f33498ee7089fa711d3064b6"
|
|
14678
|
+
}
|
|
14679
|
+
},
|
|
14680
|
+
"manifest": {
|
|
14681
|
+
"AGENTS.md": {
|
|
14682
|
+
"state": "present",
|
|
14683
|
+
"contentId": "2b4b4fbb486d8a6c92ec644d989c8db7b75ef5dc3994fd33ff98e4542c28349d",
|
|
14684
|
+
"rawSha256": "eb29e00387722ff591c523e7be3e76b889ae809f2245cb51cc26c7aac1459b8d",
|
|
14685
|
+
"normalizedSha256": "0509ff24d7f353b3a277c6753ca9b04dda676ba6ce127e667fd9342cef950e09",
|
|
14686
|
+
"canonicalSha256": "0509ff24d7f353b3a277c6753ca9b04dda676ba6ce127e667fd9342cef950e09"
|
|
14687
|
+
},
|
|
14688
|
+
"CLAUDE.md": {
|
|
14689
|
+
"state": "present",
|
|
14690
|
+
"contentId": "7a2cf08a1171762ebcb53f43036a2170655379416945258b9c85d4b189ecaecf",
|
|
14691
|
+
"rawSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad",
|
|
14692
|
+
"normalizedSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad",
|
|
14693
|
+
"canonicalSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad"
|
|
14694
|
+
},
|
|
14695
|
+
"GEMINI.md": {
|
|
14696
|
+
"state": "present",
|
|
14697
|
+
"contentId": "36da47034bb2ce6c760ddbbbbd49dccc1d17665dbb18bec56ffa3b26bac1c135",
|
|
14698
|
+
"rawSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986",
|
|
14699
|
+
"normalizedSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986",
|
|
14700
|
+
"canonicalSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986"
|
|
14701
|
+
},
|
|
14702
|
+
"START_NEXT_SESSION_PROMPT.txt": {
|
|
14703
|
+
"state": "present",
|
|
14704
|
+
"contentId": "9902b70a395688d6602b34f9e8085b32b5538e72c9009e28b4258e1fd30b77cc",
|
|
14705
|
+
"rawSha256": "6b9ea678c8dce2bbec9011867c173c4044eb934f831a430533d325ae30d5e308",
|
|
14706
|
+
"normalizedSha256": "6b9ea678c8dce2bbec9011867c173c4044eb934f831a430533d325ae30d5e308",
|
|
14707
|
+
"canonicalSha256": "9896feb18fe71a4f3500e2d89cea6991ca1788aebc6c6ead9848f5551750a1c0"
|
|
14708
|
+
},
|
|
14709
|
+
"dev/SESSION_HANDOFF.md": {
|
|
14710
|
+
"state": "present",
|
|
14711
|
+
"contentId": "73afc36c2bcfc236bc694af6ed5183637cef1e1089c80a0dc2c1a1a7214ca5c2",
|
|
14712
|
+
"rawSha256": "a82a845af778038a7908db2065290bb32c9f1c5f32fbf0b1c5d0772d23d66455",
|
|
14713
|
+
"normalizedSha256": "a82a845af778038a7908db2065290bb32c9f1c5f32fbf0b1c5d0772d23d66455",
|
|
14714
|
+
"canonicalSha256": "882588e529835a84071fbbdddab70324392c9bcbb206d9dc2c804ac01108197f"
|
|
14715
|
+
},
|
|
14716
|
+
"dev/SESSION_LOG.md": {
|
|
14717
|
+
"state": "present",
|
|
14718
|
+
"contentId": "fa77d46a61f58e2fabc537b5c6ff31c33eb4413088797e87bf1b442ddec291c5",
|
|
14719
|
+
"rawSha256": "8da41cb8b8e766f40e8ab4365c32e9b6be6cc9265dc22d18bbbe75e8ad771cbd",
|
|
14720
|
+
"normalizedSha256": "8da41cb8b8e766f40e8ab4365c32e9b6be6cc9265dc22d18bbbe75e8ad771cbd",
|
|
14721
|
+
"canonicalSha256": "8da41cb8b8e766f40e8ab4365c32e9b6be6cc9265dc22d18bbbe75e8ad771cbd"
|
|
14722
|
+
},
|
|
14723
|
+
"dev/PROJECT_INDEX.md": {
|
|
14724
|
+
"state": "present",
|
|
14725
|
+
"contentId": "c4c0db7c6e7a19796cd7ca1ed2a666461aa49a0b0d087a99deca43853ffdb468",
|
|
14726
|
+
"rawSha256": "c5f3331e1133ad178a4b420fb49c9d28fc5a5022275ba9ef4d667f88c1fb2234",
|
|
14727
|
+
"normalizedSha256": "4e540ca4c392e326ad9e7ca2cbcb8897135c8be9b5a2004f224124999348f517",
|
|
14728
|
+
"canonicalSha256": "d13af58d29f15710e54469e929847a611a066f286198feeebada13192404141c"
|
|
14729
|
+
},
|
|
14730
|
+
"dev/DOC_SYNC_REGISTRY.md": {
|
|
14731
|
+
"state": "present",
|
|
14732
|
+
"contentId": "4c9f768eda712b65a04372059ea937864da01083346d007808cd935cc4825829",
|
|
14733
|
+
"rawSha256": "d32534a19c1247705c05431a30d1d294222faf372c0b777cfc087a7a52fb98ac",
|
|
14734
|
+
"normalizedSha256": "d32534a19c1247705c05431a30d1d294222faf372c0b777cfc087a7a52fb98ac",
|
|
14735
|
+
"canonicalSha256": "d32534a19c1247705c05431a30d1d294222faf372c0b777cfc087a7a52fb98ac"
|
|
14736
|
+
},
|
|
14737
|
+
"dev/RULE_PACKS.md": {
|
|
14738
|
+
"state": "present",
|
|
14739
|
+
"contentId": "1b91985b9c6460b7bf4293cc6119097df9b426c3a46199a0a4f1de1712d02faa",
|
|
14740
|
+
"rawSha256": "383842f3d2f995a6f0917bb4a7bc6bfa5fd6e3c33ec8aa2cd073ce1695812df4",
|
|
14741
|
+
"normalizedSha256": "383842f3d2f995a6f0917bb4a7bc6bfa5fd6e3c33ec8aa2cd073ce1695812df4",
|
|
14742
|
+
"canonicalSha256": "383842f3d2f995a6f0917bb4a7bc6bfa5fd6e3c33ec8aa2cd073ce1695812df4"
|
|
14743
|
+
},
|
|
14744
|
+
"dev/PROJECT_DECISIONS.md": {
|
|
14745
|
+
"state": "present",
|
|
14746
|
+
"contentId": "23daf5c72689add04511e62f8d7c354706b7c302a0188c7d0cf2e8cbcfc301d3",
|
|
14747
|
+
"rawSha256": "6d41cfe8799cad57587d75458b086434abb842ac91b72274b432454c710546b5",
|
|
14748
|
+
"normalizedSha256": "6d41cfe8799cad57587d75458b086434abb842ac91b72274b432454c710546b5",
|
|
14749
|
+
"canonicalSha256": "6d41cfe8799cad57587d75458b086434abb842ac91b72274b432454c710546b5"
|
|
14750
|
+
},
|
|
14751
|
+
"dev/rules/safety.md": {
|
|
14752
|
+
"state": "present",
|
|
14753
|
+
"contentId": "4f85c8af8a8abd02abf6d1a6f957c2979262cd82edda3dff89e17571b9489a51",
|
|
14754
|
+
"rawSha256": "a76f8206ce9c1208f90ed84504b4866666380131b0392d4bbd48c733368b51c8",
|
|
14755
|
+
"normalizedSha256": "a76f8206ce9c1208f90ed84504b4866666380131b0392d4bbd48c733368b51c8",
|
|
14756
|
+
"canonicalSha256": "a76f8206ce9c1208f90ed84504b4866666380131b0392d4bbd48c733368b51c8"
|
|
14757
|
+
},
|
|
14758
|
+
"dev/rules/coding.md": {
|
|
14759
|
+
"state": "present",
|
|
14760
|
+
"contentId": "1c6deb9a5a281c13e97b0ac96079e9e1beccbd1ff106186e7a6ac78c0eeb75c2",
|
|
14761
|
+
"rawSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4",
|
|
14762
|
+
"normalizedSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4",
|
|
14763
|
+
"canonicalSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4"
|
|
14764
|
+
},
|
|
14765
|
+
"dev/rules/writing.md": {
|
|
14766
|
+
"state": "present",
|
|
14767
|
+
"contentId": "ceee5412520ba860e6b40de46bb164e2ce3919d2197d5fadb926198eb7dddd3b",
|
|
14768
|
+
"rawSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593",
|
|
14769
|
+
"normalizedSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593",
|
|
14770
|
+
"canonicalSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593"
|
|
14771
|
+
},
|
|
14772
|
+
"dev/rules/research.md": {
|
|
14773
|
+
"state": "present",
|
|
14774
|
+
"contentId": "4414f9c82c6d04ad49d7446f4b0740055242f425ef5b00391d9c8c78c96c0f66",
|
|
14775
|
+
"rawSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104",
|
|
14776
|
+
"normalizedSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104",
|
|
14777
|
+
"canonicalSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104"
|
|
14778
|
+
},
|
|
14779
|
+
"dev/rules/agent-governance.md": {
|
|
14780
|
+
"state": "present",
|
|
14781
|
+
"contentId": "c0d63d30bd1be62f11ceb5146c4716a8b8eb61dd5d9aa34518196de528333cea",
|
|
14782
|
+
"rawSha256": "882780d38aae36d1693f65ba24ecfe6a3c7ee000d2875e2abb2508a13f4f7679",
|
|
14783
|
+
"normalizedSha256": "882780d38aae36d1693f65ba24ecfe6a3c7ee000d2875e2abb2508a13f4f7679",
|
|
14784
|
+
"canonicalSha256": "882780d38aae36d1693f65ba24ecfe6a3c7ee000d2875e2abb2508a13f4f7679"
|
|
14785
|
+
},
|
|
14786
|
+
"dev/rules/release.md": {
|
|
14787
|
+
"state": "present",
|
|
14788
|
+
"contentId": "b0a0c9dea88016185f4093f9be4ce3c0e29904222e21dd1fa1735fcc1bb7e744",
|
|
14789
|
+
"rawSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7",
|
|
14790
|
+
"normalizedSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7",
|
|
14791
|
+
"canonicalSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7"
|
|
14792
|
+
},
|
|
14793
|
+
"dev/rules/knowledge.md": {
|
|
14794
|
+
"state": "present",
|
|
14795
|
+
"contentId": "44d90de2a8a9230ee761934ff02a9ba91eb5dff4e649031cf1eb2d6e99d907af",
|
|
14796
|
+
"rawSha256": "401027a04c28e05d816005c63bfd0114ad470ac3f831182c1352fc833a3ad30f",
|
|
14797
|
+
"normalizedSha256": "401027a04c28e05d816005c63bfd0114ad470ac3f831182c1352fc833a3ad30f",
|
|
14798
|
+
"canonicalSha256": "401027a04c28e05d816005c63bfd0114ad470ac3f831182c1352fc833a3ad30f"
|
|
14799
|
+
},
|
|
14800
|
+
"dev/rules/communication.md": {
|
|
14801
|
+
"state": "present",
|
|
14802
|
+
"contentId": "34fd0034cbc75dad43f789b86a414763f01916dda4d59876db9c4d8d92ae6a87",
|
|
14803
|
+
"rawSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591",
|
|
14804
|
+
"normalizedSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591",
|
|
14805
|
+
"canonicalSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591"
|
|
14806
|
+
},
|
|
14807
|
+
"dev/rules/closeout.md": {
|
|
14808
|
+
"state": "present",
|
|
14809
|
+
"contentId": "ef9b8179cf351edf8abc77754ec8df630097d9770f6c7e7fe16e1b26a94a2337",
|
|
14810
|
+
"rawSha256": "cf9095ac53bf6216ed7106c3abe694b5a4beeee7128cd5eff87c26629524636a",
|
|
14811
|
+
"normalizedSha256": "cf9095ac53bf6216ed7106c3abe694b5a4beeee7128cd5eff87c26629524636a",
|
|
14812
|
+
"canonicalSha256": "cf9095ac53bf6216ed7106c3abe694b5a4beeee7128cd5eff87c26629524636a"
|
|
14813
|
+
},
|
|
14814
|
+
"dev/rules/onboarding.md": {
|
|
14815
|
+
"state": "present",
|
|
14816
|
+
"contentId": "ce2b623d5f0d79ed1a471abd788da11c043f15bb823a9a40c7e1e79079db649d",
|
|
14817
|
+
"rawSha256": "8c5f81d3a15a79310a82c63ed62ae4a4113db2ce7d70e4e247bfa784fa6f6927",
|
|
14818
|
+
"normalizedSha256": "8c5f81d3a15a79310a82c63ed62ae4a4113db2ce7d70e4e247bfa784fa6f6927",
|
|
14819
|
+
"canonicalSha256": "8c5f81d3a15a79310a82c63ed62ae4a4113db2ce7d70e4e247bfa784fa6f6927"
|
|
14820
|
+
},
|
|
14821
|
+
"dev/rules/integrations.md": {
|
|
14822
|
+
"state": "present",
|
|
14823
|
+
"contentId": "704880052d258dd6e95f7404cefe30695ecf9b153477d21ab4de703afa134fe7",
|
|
14824
|
+
"rawSha256": "994ef946877e868418c02221f1a5d24d501da590694656921b9e1ae962d05a50",
|
|
14825
|
+
"normalizedSha256": "994ef946877e868418c02221f1a5d24d501da590694656921b9e1ae962d05a50",
|
|
14826
|
+
"canonicalSha256": "994ef946877e868418c02221f1a5d24d501da590694656921b9e1ae962d05a50"
|
|
14827
|
+
}
|
|
14828
|
+
}
|
|
14654
14829
|
}
|
|
14655
14830
|
},
|
|
14656
14831
|
"contents": {
|
|
@@ -15728,6 +15903,11 @@
|
|
|
15728
15903
|
"targetRel": "dev/rules/closeout.md",
|
|
15729
15904
|
"canonicalSha256": "cf9095ac53bf6216ed7106c3abe694b5a4beeee7128cd5eff87c26629524636a",
|
|
15730
15905
|
"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\nReceive the current `dev/SESSION_HANDOFF.md` in full; in the same session, reuse only evidence already fully received from the unchanged file, and supplement every unread, truncated, or changed range. Read the current-session-relevant `dev/SESSION_LOG.md` entry, carry-forward risks, and any actual maintenance need. Read the affected complete command, route, rule, source, workspace mapping, and any required supplement in `dev/PROJECT_INDEX.md`; do not replace that reading with keyword hits. Classify every applicable `dev/DOC_SYNC_REGISTRY.md` obligation. 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- When saving meaningful work changes, maintain the handoff's concise `Work Items` table using its declared fields, and keep project-wide name/goal in `PROJECT_INDEX` `Project`. Add the table/section to older projects only at an authorized state save when useful. Reconcile changed statuses against the evidence; do not duplicate full reports, rewrite old history, or create per-terminal-step records for the dashboard. Read-only dashboard viewing never triggers these writes.\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. A same-session fully received unchanged source may be reused; incomplete, truncated, or changed sources require supplementary reading before relying on them. 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. Stable anchors and decision-changing current facts stay in the packet. Do not rewrite, reword, reorder, or refresh cold zones for ceremony or style. When older detailed narrative no longer changes the next action, preserve it byte-for-byte in existing trace/archive storage and verify that copy before removing it from the current packet. Do not rewrite or archive unchanged material at every closeout, impose an arbitrary size cap, or weaken the required full reception of the current packet.\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. `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`.\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 only for current work, risk, actual maintenance, or another durable fact that a later agent needs. Record evidence disposition and the prompt-mirror verification result when an entry is needed; omit the full opening message by design. A no-op closeout must not create a false work record.\n6. Update the project index only when affected complete mappings, rules, or supplements changed. Classify every applicable sync-registry 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 assessment below. Record only actual maintenance work or a current risk; do not create a log entry solely to report a size advisory.\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. 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. Also recover decision-changing user corrections, reasons for accepted/rejected approaches, reusable artifacts with their evidence limits, every remaining consequential obligation and its downstream use, and permission/stop boundaries. 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\nCheck whether a reader could repeat a rejected attempt, redo accepted work, omit an obligation, act on obsolete instructions, or choose a plausible but wrong next action while still agreeing with the packet's headline. If so, preserve the missing decision-changing fact in its existing owning section, not merely in a linked historical log. Keep the packet sufficient and proportionate; do not paste the whole chat or silently discard important facts to fit an output limit. Transport truncation is handled by the core reception checkpoint, not by weakening the task.\n\nCloseout verifies this session's saved packet. It cannot certify that a future reader received or understood it. Do not describe `closeout-status: complete` as successful future-session reception; the next agent must pass the core Handoff reception and recovery checkpoint independently.\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 assessment. It reports potential maintenance, but a pure `SESSION_LOG` size advisory is not a `closeout-status` blocker.\n\n- SESSION_LOG: at 11 or more entries, more than 1500 lines, or a due 10-closeout backstop, report the shared maintenance advisory. Do full maintenance only when the current work establishes an actual preservation or continuation need, or a project-specific contract requires it. Keep recent safety-buffer entries; collapse only content already absorbed by an authoritative home. Before shortening an active source, verify the preserved copy. Archive older raw entries to `dev/SESSION_LOG_archive/archive_<batch>_<low_date>_to_<high_date>.md` and maintain `INDEX.md` only when archive work is actually performed. Unknown count alone does not force a historical sweep.\n- PROJECT_DECISIONS: at 30 or more decisions-like handoff entries, assess whether actual long-term maintenance is needed; retain the newest 8–22 in the hot tier and move older decisions into the decisions archive only when that work is required. Write substantive task evolution, a multi-option architectural choice with rationale, or a cross-session learning when observed.\n- Backstop: a known due 10-closeout count is an advisory to assess long-term maintenance. Do not infer a historical sweep from an unknown count; project-specific stricter requirements still apply.\n\nIf no actual maintenance applies, leave historical trace content unchanged. 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. When it returns a card, copy the full card verbatim in a fenced `text` block before any explanation for both `status: complete` and `status: blocked`; never reduce it to selected status or blocker lines, print the literal placeholder `v<version>`, hand-compose a substitute success/blocked card, or use `handoff saved` unless the command reports `status: complete`. Only when no CLI card exists because the CLI could not be launched or returned no card may the final response show a fenced `closeout unavailable` card with no version and no `saved`/`complete` claim, followed by the actual missing condition. That presentation does not complete closeout and never replaces a returned complete or blocked CLI card.\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. The narrow `closeout unavailable` presentation above is allowed only when there is no CLI card; do not use it to replace a returned blocked card or hand-compose a third stateful prompt.\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"
|
|
15906
|
+
},
|
|
15907
|
+
"2b4b4fbb486d8a6c92ec644d989c8db7b75ef5dc3994fd33ff98e4542c28349d": {
|
|
15908
|
+
"targetRel": "AGENTS.md",
|
|
15909
|
+
"canonicalSha256": "0509ff24d7f353b3a277c6753ca9b04dda676ba6ce127e667fd9342cef950e09",
|
|
15910
|
+
"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\n### Upgrade lock guard\n\nBefore any handoff, user-rule router, pack, or other project-state read, use the verified project root to probe `dev/governance_migrations/.upgrade.lock`. A present lock, or inability to establish its absence, stops ordinary work and all further project-state reads and searches. Do not search for recovery instructions or edit or delete the lock. Before that explanation, render this fenced brand card:\n\n```text\n /\\_/\\ Agent Handoff Kit\n ( x.x ) continuity unavailable\n > ^ <\n```\n\nIt must not claim loaded, healthy, saved, or version-verified state. Explain that continuity is unavailable and give the supported recovery command `agent-handoff-kit upgrade --yes --root <verified-project-root>`. Bare startup never runs this command automatically. If the existence probe is unreadable, report continuity unavailable without claiming a lock is present and do not auto-recover. When the visible user request explicitly authorizes update, upgrade or recovery, only the official CLI performs transaction recovery; resume ordinary state loading only after that CLI succeeds and a new probe establishes lock absence.\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, recover the parent outcome, current step, resume point, remaining acceptance and source coverage from the fully received handoff under the checkpoint below. Preserve decision-changing user corrections, rejected approaches and their reasons, reusable work and permission boundaries. 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, 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.\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\n### Handoff reception and recovery checkpoint\n\nBefore claiming `loaded`, `resumed` or `continuity ready`, complete both gates below. A successful closeout, read command, exit code, digest, section list or summary does not establish reception or understanding.\n\n1. **Receive the whole packet.** Read all of `dev/SESSION_HANDOFF.md`, including its middle and end, from one unchanged file version. A full-file command is only a request: inspect the actual tool result. If output is truncated, omitted, paginated or uncertain, use smaller bounded reads and track contiguous ranges from the start through EOF, with no gaps or mixed versions. Check the entire returned body, not just its header/footer; a tool can retain both ends while omitting the middle. Reread any uncertain range. If the file changes during reading, restart coverage for the new version. Native file tools are valid; compare file identity before/after the read sequence. When an already-available local Kit CLI supports it, `handoff-read --root <root>` offers bounded Unicode ranges; continue with its `nextOffset` as `--offset` and the same `--sha256`, reducing `--max-chars` on truncation. Verify its canonical `root` matches the intended workspace; a root alias is not permission to read an unexpected location. Links below that root are rejected. This helper serves content only. Do not download, install, probe integrations or write a receipt for bare startup. Missing/unreadable content stays incomplete.\n2. **Recover the work.** From that packet, reconcile the user's outcome and consumer, current task's relation to it, completed work and reusable evidence, decision reasons and rejected approaches, remaining obligations/acceptance, exact bounded next action, required fresh sources, and authorization/stop boundaries. Preserve corrections and distinguish historical state from current truth. Use existing section locations as internal evidence; do not create another summary file or dump the packet into the reply. Missing or contradictory facts that prevent safe recovery make the checkpoint incomplete; identify their effect and the smallest clarification/read. A packet that honestly describes blocked work can still be sufficient: show its dependency blocker without inventing completion or requiring every linked source at startup. Eligible first-use TBD state still routes to onboarding; it is not a failed task handoff.\n\nUntil both gates pass, replace the card's `continuity ready` with `continuity incomplete`, use `incomplete` for its handoff status, and name the unread/conflicting scope. Do not begin dependent task work. Complete safe same-file supplementary reads before giving up; elapsed time or a green CLI is not acceptance. Full reception does not prove every historical fact or linked source; follow the normal required-reading gate before an authorized action. Bare startup still ends after its card. With explicit continuation, check the recovered input, output, downstream use and acceptance against the current request, read the necessary sources, and continue within the authorized scope, including multiple steps when completion or the next blocker was explicitly requested; neither the packet nor this checkpoint grants new permissions. These gates also apply after interrupted reads or context compaction when coverage cannot be recovered from actual evidence.\n\n### Current-thread naming checkpoint\n\nDuring 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.\n\nUse `<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.\n\nUse 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.\n\nBefore 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.\n\nThe 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.\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 / incomplete>\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- For failures spanning steps or recurring, trace relevant inputs, processing, saved state and actual consumers until evidence explains the cause and direct impact. Then stop expanding the investigation and repair the affected locations with that cause within the authorized scope; do not turn a simple local fix into a whole-system audit.\n- When repeated attempts produce no improved result, unblocked dependency or new evidence, reassess the cause and method before retrying; preserve useful results. Necessary waits and experiments that yield new evidence are not stagnation. Existing safety and retry limits still apply.\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 perform full closeout. Apply the bounded opening/mirror consistency rule below only when this checkpoint changes actionable state repeated there.\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. Without the opening-consistency condition below, do not regenerate `START_NEXT_SESSION_PROMPT.txt`.\n\nCheckpoint opening consistency: when an authorized checkpoint changes actionable facts repeated in the `Next Session Opening Message`, reconcile only those affected current facts in that same checkpoint. Derive `START_NEXT_SESSION_PROMPT.txt` from the sole marked opening block only if normalized content differs, then verify the block/mirror and the changed objective, next action and completion boundary agree. Do not merely label an authoritative opening historical while leaving instructions to redo completed work. Preserve unrelated opening text and cold evidence; this condition does not authorize full closeout, new task work, extra source scans or persistence after an ordinary document edit.\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. A real permission or lock refusal stops the affected operation; it is not permission to elevate, switch provider or mode, or use a riskier command. Normal platform approval and another already-authorized safe method remain available only after their actual scope and safety are verified.\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=5cc4d84824f52133c0f6aed1ec916d34651c5f123db9de5f60135cd94f6dfc3b -->\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\nThe core `Upgrade lock guard` applies first when it stops ordinary work.\n"
|
|
15731
15911
|
}
|
|
15732
15912
|
},
|
|
15733
15913
|
"generatedShortcuts": {
|
|
@@ -15927,7 +16107,61 @@
|
|
|
15927
16107
|
"dev/handoff-kit/project-version.mjs": "8814c81f7053147e6b6816dc356790330257fddae53404d88a5d2b7c01a6ebcb",
|
|
15928
16108
|
"dev/handoff-kit/assets.mjs": "1b249b49ddb624b0efe34ff029afec4c8cd4706fdf8323ad7aa3897c7cd61dea"
|
|
15929
16109
|
}
|
|
16110
|
+
},
|
|
16111
|
+
"0.4.4": {
|
|
16112
|
+
"npm": {
|
|
16113
|
+
"spec": "@adamchanadam/agent-handoff-kit@0.4.4",
|
|
16114
|
+
"shasum": "bfda53fd8d0229b27e67e2190753fa32a2ae1851",
|
|
16115
|
+
"integrity": "sha512-1H6ib7StICVApD+EaieTEMwzo0LAhOQnChKHXJFaAH0QXJ/9FrxgiklnBzyoqOTbVbMGkYoQ5KHJz5hloS59EA==",
|
|
16116
|
+
"tarballSha256": "4cdb10d8b61a72c9141e1b821e4489081ed8163a332c21a4432b04ffbc4b7305"
|
|
16117
|
+
},
|
|
16118
|
+
"generatorSha256": "34432388f0e6de9120a40e38d29ef5ee1483795cae64e4d47bbde68413a9d5d3",
|
|
16119
|
+
"files": {
|
|
16120
|
+
".claude/skills/handoff-kit-start/SKILL.md": "9e0e4312fe9bc8e6801c5e0ea32026144a10ba364118b61058470aef2cf12cdf",
|
|
16121
|
+
".agents/skills/handoff-kit-start/SKILL.md": "9e0e4312fe9bc8e6801c5e0ea32026144a10ba364118b61058470aef2cf12cdf",
|
|
16122
|
+
".agents/skills/handoff-kit-start/agents/openai.yaml": "a294dd1815bef68434d4fbf93261d5192abdc6f3570e6b6030d19f2bf657a984",
|
|
16123
|
+
".gemini/commands/handoff-kit-start.toml": "23c0da1953e98d18a1d9a1f725af5174a4e16a2b41fb69f7fd650af1efaf24ce",
|
|
16124
|
+
".claude/skills/handoff-kit-close/SKILL.md": "46d999d993a282092ad93bb69d2848749d0b448eb71fe7a3394a3caa7e68e8ab",
|
|
16125
|
+
".agents/skills/handoff-kit-close/SKILL.md": "46d999d993a282092ad93bb69d2848749d0b448eb71fe7a3394a3caa7e68e8ab",
|
|
16126
|
+
".agents/skills/handoff-kit-close/agents/openai.yaml": "7ff3064232dfa62d9b0a75c5cc743afb77a1c6986e8c423618cc37cf0031501d",
|
|
16127
|
+
".gemini/commands/handoff-kit-close.toml": "98898d53857b14d46ba2a19bf06397c2ee221f68e5ff877cf3a4f2ee2cf8142d",
|
|
16128
|
+
".claude/skills/handoff-kit-progress/SKILL.md": "ee2a16a983cfb612099271adc5ff4ad628003cfc56963c71e4e853288d03f0b4",
|
|
16129
|
+
".agents/skills/handoff-kit-progress/SKILL.md": "ee2a16a983cfb612099271adc5ff4ad628003cfc56963c71e4e853288d03f0b4",
|
|
16130
|
+
".agents/skills/handoff-kit-progress/agents/openai.yaml": "cbb31a137fe249e7ec563ea70759c7bd7792d0b72dd912d38ef25226667902c4",
|
|
16131
|
+
".gemini/commands/handoff-kit-progress.toml": "b0ec3e0f3773d6de8df241ca79f143b0781f7fc1034ec4a0fc9464966c752918",
|
|
16132
|
+
".claude/skills/handoff-kit-align/SKILL.md": "7a8e1d22043e36dc1c74b8ec262f292e574cdb1f3dce0264370e5134fe52ebba",
|
|
16133
|
+
".agents/skills/handoff-kit-align/SKILL.md": "7a8e1d22043e36dc1c74b8ec262f292e574cdb1f3dce0264370e5134fe52ebba",
|
|
16134
|
+
".agents/skills/handoff-kit-align/agents/openai.yaml": "4001a19fc73b01be44de48b44db2d5c361e38c637a1b4ffa1b215dd5615bca5d",
|
|
16135
|
+
".gemini/commands/handoff-kit-align.toml": "5077dad5129d5219ceb7cb3c87c09f169c53c062d51edf7b415ca8aba50f7bb0",
|
|
16136
|
+
".claude/skills/handoff-kit-onboard/SKILL.md": "161f6fc817e0c03ec8093c574d066bf1d5e7716ae47870a9cb8683311f4dd7b7",
|
|
16137
|
+
".agents/skills/handoff-kit-onboard/SKILL.md": "161f6fc817e0c03ec8093c574d066bf1d5e7716ae47870a9cb8683311f4dd7b7",
|
|
16138
|
+
".agents/skills/handoff-kit-onboard/agents/openai.yaml": "5ef6ac65e96d20a71287c5f44abad14dc4f7b91d4fefd5b4ec7f672273917265",
|
|
16139
|
+
".gemini/commands/handoff-kit-onboard.toml": "915c92a522a9995f201e85521d9f40f6cf499f52988dfac04cf22585f72dfbe7",
|
|
16140
|
+
".claude/skills/handoff-kit-remember/SKILL.md": "14b6f9906ab816bfe1d02ec5fdb822ad3c3981346040bcf3bcad7ae85fb52ce8",
|
|
16141
|
+
".agents/skills/handoff-kit-remember/SKILL.md": "14b6f9906ab816bfe1d02ec5fdb822ad3c3981346040bcf3bcad7ae85fb52ce8",
|
|
16142
|
+
".agents/skills/handoff-kit-remember/agents/openai.yaml": "9bed15e27ee9725e2a31b57d10687349a5754dcfcae55aca167c763f6f1e0e80",
|
|
16143
|
+
".gemini/commands/handoff-kit-remember.toml": "c577c8af5430dbc0e1a5b4a2d1f74a19ef279f695572ca8b5de3b4aeb35e7892",
|
|
16144
|
+
".claude/skills/handoff-kit-check/SKILL.md": "6948d45ff7d95f5dd66930d02dba6b99aadbc51d6e220a32b9a1ffdbe99d7bae",
|
|
16145
|
+
".agents/skills/handoff-kit-check/SKILL.md": "6948d45ff7d95f5dd66930d02dba6b99aadbc51d6e220a32b9a1ffdbe99d7bae",
|
|
16146
|
+
".agents/skills/handoff-kit-check/agents/openai.yaml": "666d4b602e019e06a7dd70742fc459cd2afab2a442bce038c87dfce09d429bb2",
|
|
16147
|
+
".gemini/commands/handoff-kit-check.toml": "f8985c17fe064f2902e941369b5a761fe27a4ba897a0e88e9cc67d7170ad9136",
|
|
16148
|
+
".claude/skills/handoff-kit-update/SKILL.md": "b8cf133ae63068257e1a8b570ce2cba8ef29d5438465ca5caaaca093095416a7",
|
|
16149
|
+
".agents/skills/handoff-kit-update/SKILL.md": "b8cf133ae63068257e1a8b570ce2cba8ef29d5438465ca5caaaca093095416a7",
|
|
16150
|
+
".agents/skills/handoff-kit-update/agents/openai.yaml": "12177a56d5a3573cb079506de78375f83ccb06f8fa7e1828a3d7c237de82e7bf",
|
|
16151
|
+
".gemini/commands/handoff-kit-update.toml": "baad57bb779e91f4be1b6b9b7570bb36e5238c23e5e750d9bbc3ef6c7e98bd9b",
|
|
16152
|
+
".claude/skills/handoff-kit-help/SKILL.md": "d3b0d4fe6505b28284d7bc93b6124b5bd84898356b57ff0c217a74e63d00100d",
|
|
16153
|
+
".agents/skills/handoff-kit-help/SKILL.md": "d3b0d4fe6505b28284d7bc93b6124b5bd84898356b57ff0c217a74e63d00100d",
|
|
16154
|
+
".agents/skills/handoff-kit-help/agents/openai.yaml": "a87a82d80551abfe32588d6b66b44b21c45aa636ef0392cc886dfb5cc65a609a",
|
|
16155
|
+
".gemini/commands/handoff-kit-help.toml": "880e88bd61747f82bf54fe274ab00d368374904a102ee34ffe5341c03c513f56",
|
|
16156
|
+
"dev/handoff-kit/launch.mjs": "d0bcbf596f08f722c9af84c7779e1b3ef77b49234e840e97d78bf2296b9dca2c",
|
|
16157
|
+
"dev/handoff-kit/open.mjs": "7725ff1ee0da9b1753d5d8648c73272b6b0948b9ca567c1e89734e2b1275f28d",
|
|
16158
|
+
"dev/handoff-kit/server.mjs": "52fb563cac05d08a934c759f6157035767eabf3de977085a7b811bde78177cbf",
|
|
16159
|
+
"dev/handoff-kit/projection.mjs": "06429ecdffab697acd88f3327c00e17d92cfa1d3629edf35afea6a51d1288ce7",
|
|
16160
|
+
"dev/handoff-kit/dashboard.mjs": "73a50e69886d00d706677ef925ac74bed6d7d7ba299642d7880c25d05885ca61",
|
|
16161
|
+
"dev/handoff-kit/project-version.mjs": "8814c81f7053147e6b6816dc356790330257fddae53404d88a5d2b7c01a6ebcb",
|
|
16162
|
+
"dev/handoff-kit/assets.mjs": "1020b4cce66fb30634e3b0cd8247c11cd36fb4b4e9b30b3d303968bc777fdbb5"
|
|
16163
|
+
}
|
|
15930
16164
|
}
|
|
15931
16165
|
},
|
|
15932
|
-
"catalogDigestSha256": "
|
|
16166
|
+
"catalogDigestSha256": "ee1d176e1d2d6c3c2bff1209c630f00dc1edc161a1949ac609584c856b14da31"
|
|
15933
16167
|
}
|
package/package.json
CHANGED
package/packs/closeout.md
CHANGED
|
@@ -29,7 +29,7 @@ Full closeout is differential and write-minimal. Update only fields whose curren
|
|
|
29
29
|
|
|
30
30
|
Handoff cold zones are historical / evidence sections, old validation records, completed-work narratives, and unchanged durable anchors. Stable anchors and decision-changing current facts stay in the packet. Do not rewrite, reword, reorder, or refresh cold zones for ceremony or style. When older detailed narrative no longer changes the next action, preserve it byte-for-byte in existing trace/archive storage and verify that copy before removing it from the current packet. Do not rewrite or archive unchanged material at every closeout, impose an arbitrary size cap, or weaken the required full reception of the current packet.
|
|
31
31
|
|
|
32
|
-
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
|
|
32
|
+
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.
|
|
33
33
|
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.
|
|
34
34
|
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`.
|
|
35
35
|
3. Make `Next Priorities` name one recommended next action and a short reason unless blocked or a real user decision is required.
|
|
@@ -41,7 +41,7 @@ Handoff cold zones are historical / evidence sections, old validation records, c
|
|
|
41
41
|
9. Run the short maintenance assessment below. Record only actual maintenance work or a current risk; do not create a log entry solely to report a size advisory.
|
|
42
42
|
10. 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`.
|
|
43
43
|
11. 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.
|
|
44
|
-
12. Run available project-specific closeout checks. Do not run a separate bundled `doctor
|
|
44
|
+
12. Run available project-specific closeout checks. Do not run a separate bundled `doctor`; step 13 performs it. Do not treat an external update-check failure as local closeout failure. Fix state or mirror failures before claiming handoff ready.
|
|
45
45
|
13. 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. A nonzero result means the closeout is blocked; do not replace it with a success summary.
|
|
46
46
|
|
|
47
47
|
## Packet-Only Reconstruction Check
|
|
@@ -84,7 +84,7 @@ status: complete
|
|
|
84
84
|
⚠️ Boundary: <important boundary or none>
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
For `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.
|
|
87
|
+
For `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.
|
|
88
88
|
|
|
89
89
|
## Stop Conditions
|
|
90
90
|
|
package/packs/coding.md
CHANGED
|
@@ -16,6 +16,8 @@ Use for code changes, tests, builds, package managers, SDKs, CLIs, APIs, or deve
|
|
|
16
16
|
3. Prefer project-local patterns and helpers over new abstractions.
|
|
17
17
|
4. Do not guess current SDK, CLI, package, API, or deployment behavior when docs or project files can verify it.
|
|
18
18
|
5. Preserve unrelated user changes.
|
|
19
|
+
6. Before first running new or changed code, including your own tests and helper scripts, read its usage text or header comment as a separate step before composing the command, noting how it uses arguments, environment variables, deletion and overwrite. If it can delete or overwrite anything outside a temporary location it created, first confirm the work is already recoverable (committed, backed up, or run against an isolated copy). This rule does not authorize a commit or backup; if the work is not recoverable, ask the user.
|
|
20
|
+
7. Tests, fixtures and helper scripts you write that delete or clear must verify the target is a temporary location they created (resolved path, expected name prefix, not the project or working directory or any ancestor of them); otherwise they must stop and report failure, never pass. Product features that delete by design follow `dev/rules/safety.md`.
|
|
19
21
|
|
|
20
22
|
## Checks
|
|
21
23
|
|
package/packs/integrations.md
CHANGED
|
@@ -198,7 +198,7 @@ Integration declarations are project-level; they do not guarantee every AI runti
|
|
|
198
198
|
10. **Plugin / Skill subordination**: plugin and skill instructions coexist with rule packs; safety, governance, and closeout rules take precedence on conflict.
|
|
199
199
|
11. **External tool resource lifecycle**: after external-tool use, classify resources by ownership. Task-owned / agent-managed resources may be closed or cleaned automatically; shared, user-owned, system-level, other-agent-owned, or unknown resources require evidence reporting and user confirmation before remediation.
|
|
200
200
|
12. **Local HTML / app validation fallback**: if `file://` browser access is blocked, do not bypass the policy and do not stop on that single surface failure. Use a registered operation reference or a short-lived loopback localhost service for actual browser / DevTools / Playwright validation, then close the task-owned service and record the evidence.
|
|
201
|
-
13. **Terminal-state contract**: a tool operation succeeds only when the runtime returns an explicit successful terminal state and any required read-back passes. Stopped, aborted, timeout, spawn / transport error, signal, missing final result, or partial stdout before termination makes the affected operation indeterminate or failed, not successful. It does not make unrelated already-verified task evidence permanently invalid. For read-only operations, verify the state and rerun only the affected operation when still needed. For any operation that may have written externally or to disk, read back the actual target state before retrying, recovery, or success claims.
|
|
201
|
+
13. **Terminal-state contract**: a tool operation succeeds only when the runtime returns an explicit successful terminal state and any required read-back passes. Stopped, aborted, timeout, spawn / transport error, signal, missing final result, or partial stdout before termination makes the affected operation indeterminate or failed, not successful. A wrapper exit code or an outer command's success is not a terminal success without the expected final state and read-back. It does not make unrelated already-verified task evidence permanently invalid. For read-only operations, verify the state and rerun only the affected operation when still needed. For any operation that may have written externally or to disk, read back the actual target state before retrying, recovery, or success claims.
|
|
202
202
|
|
|
203
203
|
## Checks
|
|
204
204
|
|
|
@@ -212,7 +212,6 @@ Integration declarations are project-level; they do not guarantee every AI runti
|
|
|
212
212
|
- Self-check credential leakage before writing `PROJECT_INDEX`, `SESSION_HANDOFF`, or `SESSION_LOG`.
|
|
213
213
|
- Verify that `PROJECT_INDEX` External Sources `via` references match declared Installed Integrations entries.
|
|
214
214
|
- For local HTML / app validation, verify that a rejected `file://` attempt is followed by a registered operation reference or short-lived localhost fallback before declaring `blocked`.
|
|
215
|
-
- Treat stopped, aborted, timeout, spawn / transport error, signal, and missing final result as operation-level indeterminate / failed states. Never count partial stdout, a wrapper exit code, or an outer command's success as terminal success without the expected final state and read-back.
|
|
216
215
|
|
|
217
216
|
## Closeout
|
|
218
217
|
|
|
@@ -228,20 +227,8 @@ Integration declarations are project-level; they do not guarantee every AI runti
|
|
|
228
227
|
| Anti-pattern | Why it is wrong | Correct approach |
|
|
229
228
|
|---|---|---|
|
|
230
229
|
| Assuming no Connector or MCP exists whenever the user mentions Notion, Google Drive, or another external source | Mature connector ecosystems make paste-only fallback an unreliable default. | Read `PROJECT_INDEX` Installed Integrations, then inspect the active runtime for an authorized capable tool/schema; ask only for missing user-held access or source information. |
|
|
231
|
-
| Guessing tool names, endpoints, CLI flags, URI parameters, or plugin APIs from memory | Stale examples cause unknown tool, invalid args, 400 / 404, permission, or auth loops. | Verify active runtime schema, official docs, official types/samples, or versioned local runbooks. |
|
|
232
|
-
| Treating browser validation as ordinary coding and guessing Chrome, Playwright, or DevTools commands | Browser and tool-control surfaces differ across runtimes, profiles, plugins, and installed packages. | Verify the active runtime schema, official docs, or a registered tool operation reference; use the classified fallback only for the affected surface when unavailable. |
|
|
233
|
-
| Treating a Connector marketing page or old example as executable schema | Marketing pages do not prove the active runtime's current tool name or input schema. | Use active runtime tool list/schema as the invocation source. |
|
|
234
230
|
| Retrying unknown tool / invalid args by changing names or parameters repeatedly | Trial-and-error hides the real schema or docs gap. | Stop same-pattern retries and return to the External Tool Usage Verification Gate. |
|
|
235
|
-
| Writing credential values into `PROJECT_INDEX`, `SESSION_HANDOFF`, or `SESSION_LOG` | Project files and git history are persistent; leaked credentials remain exposed. | Record credential references only, never values. |
|
|
236
|
-
| Using a credential value pasted in chat and then recording it | Chat history and logs may persist the secret. | Redact, warn, and ask the user to rotate if needed. |
|
|
237
|
-
| Auto-fixing auth or re-auth flows | Auth belongs to the user and the runtime/tool boundary. | Surface the failure and point to the runtime or tool settings. |
|
|
238
|
-
| Claiming an external write succeeded without read-back | External writes may fail silently or partially. | Read back and compare before claiming success. |
|
|
239
|
-
| Crossing source-of-truth layers | It can corrupt truth, mirrors, or working drafts. | Follow the declared layer role and write direction in `PROJECT_INDEX`. |
|
|
240
|
-
| Skipping current availability verification because an old handoff said the tool worked | Tokens expire, runtimes change, and tools can be removed. | Probe availability in the current runtime before using the integration. |
|
|
241
|
-
| Treating stopped, aborted, timeout, spawn / transport error, signal, missing final result, or partial PASS output as success | Tool output can be partial, wrappers can hide inner failure, and external writes may be unknown. | Mark the affected operation indeterminate or failed; read back any possible write target before retrying or claiming success. |
|
|
242
|
-
| Leaving task-owned MCP / browser / helper processes running after the task | Turns one-off tool use into a long-lived resource leak and can slow the host. | Use graceful close or task-owned process cleanup automatically; switch to user confirmation only when ownership is unclear. |
|
|
243
231
|
| Broadly killing by process name such as `node.exe`, `python`, or `chrome` | A generic process name does not prove ownership and may terminate user work, another project, or another AI agent's active tools. | Classify by tool family, process ID, start time, parent chain, and task-created path; treat unknown ownership as shared. |
|
|
244
|
-
| Automatically cleaning global caches, marketplace caches, OS temp roots, or browser profiles | May remove shared state, login state, or data other tools still need. | Automatically clean only task-owned / agent-managed bounded paths; report evidence and wait for confirmation otherwise. |
|
|
245
232
|
|
|
246
233
|
## Cross-reference
|
|
247
234
|
|
package/packs/safety.md
CHANGED
|
@@ -22,7 +22,7 @@ Use for file operations, shell commands, Git changes, package managers, installe
|
|
|
22
22
|
8. Branch deletion, tag deletion, force push, and history rewrite require separate explicit authorization and affected-ref verification. The absolute prohibitions in Rule 5 remain prohibited even when such authorization exists.
|
|
23
23
|
9. Before staging or committing, inspect current status and avoid staging unrelated parent-repo, sibling-directory, generated, credential, or user-owned changes.
|
|
24
24
|
10. Before using external APIs, SDKs, CLIs, package managers, deploy tools, cloud tools, release tools, browser automation, DevTools, Playwright, crawlers, notebooks, desktop app automation, or local helper services, verify current official documentation or project-local runbooks. For external tools, first apply the External Tool Usage Verification Gate in `dev/rules/integrations.md`: inspect current runtime tool schema for Connector / MCP calls, and use current official docs, official type definitions, official samples, or registered tool operation references for raw API / SDK / CLI / URI / plugin API work. Differentiate three layers of external access:
|
|
25
|
-
(a) Anthropic-vetted Connectors
|
|
25
|
+
(a) Anthropic-vetted Connectors: trust the vetted MCP server boundary only after inspecting the active runtime tool name, description, and input schema; still verify destructive write parameters before invocation.
|
|
26
26
|
(b) Community / custom MCP servers (user-installed via manual config): treat with extra caution — destructive writes require dry-run + user confirmation; verify server behavior against current tool schema and project-local runbook if available.
|
|
27
27
|
(c) Raw external APIs / SDKs / CLIs (no MCP layer): full Rule 10 verification of official docs required; mark unverified if blocked.
|
|
28
28
|
11. Do not print, copy, log, commit, upload, or generate files containing secret values. Use redacted placeholders or line references.
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# Agent Handoff Kit Core Runtime
|
|
2
2
|
|
|
3
|
-
This is the small always-read contract. Detailed task and closeout procedures live in routed packs.
|
|
4
|
-
|
|
5
3
|
## 1. Intent And Startup
|
|
6
4
|
|
|
7
5
|
### Upgrade lock guard
|
|
@@ -44,9 +42,9 @@ Until both gates pass, replace the card's `continuity ready` with `continuity in
|
|
|
44
42
|
|
|
45
43
|
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.
|
|
46
44
|
|
|
47
|
-
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
|
|
45
|
+
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. 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.
|
|
48
46
|
|
|
49
|
-
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
|
|
47
|
+
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. 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.
|
|
50
48
|
|
|
51
49
|
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.
|
|
52
50
|
|
|
@@ -60,7 +58,7 @@ Before a non-trivial task, identify and read the required local and external tru
|
|
|
60
58
|
|
|
61
59
|
Probe 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.
|
|
62
60
|
|
|
63
|
-
Show 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.
|
|
61
|
+
Show 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. 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.
|
|
64
62
|
|
|
65
63
|
For 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.
|
|
66
64
|
|
|
@@ -101,7 +99,7 @@ Choose exactly one tier after a task:
|
|
|
101
99
|
2. 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 perform full closeout. Apply the bounded opening/mirror consistency rule below only when this checkpoint changes actionable state repeated there.
|
|
102
100
|
3. 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.
|
|
103
101
|
|
|
104
|
-
Pre-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
|
|
102
|
+
Pre-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, or because a target-authority document changed. 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. Without the opening-consistency condition below, do not regenerate `START_NEXT_SESSION_PROMPT.txt`.
|
|
105
103
|
|
|
106
104
|
Checkpoint opening consistency: when an authorized checkpoint changes actionable facts repeated in the `Next Session Opening Message`, reconcile only those affected current facts in that same checkpoint. Derive `START_NEXT_SESSION_PROMPT.txt` from the sole marked opening block only if normalized content differs, then verify the block/mirror and the changed objective, next action and completion boundary agree. Do not merely label an authoritative opening historical while leaving instructions to redo completed work. Preserve unrelated opening text and cold evidence; this condition does not authorize full closeout, new task work, extra source scans or persistence after an ordinary document edit.
|
|
107
105
|
|
|
@@ -152,7 +150,7 @@ The always-enforced closeout invariants are:
|
|
|
152
150
|
|
|
153
151
|
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.
|
|
154
152
|
|
|
155
|
-
Load `dev/rules/integrations.md` when the current task actually uses an external tool, not merely because a registry or placeholder table exists.
|
|
153
|
+
Load `dev/rules/integrations.md` when the current task actually uses an external tool, not merely because a registry or placeholder table exists. If two packs conflict, use the safer and more verifiable path and record the unresolved conflict at closeout.
|
|
156
154
|
|
|
157
155
|
After 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.
|
|
158
156
|
|