tianshu-harness 3.34.0 → 3.35.0

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.
Files changed (225) hide show
  1. package/README.en.md +291 -606
  2. package/README.ja.md +2 -2
  3. package/README.ko.md +2 -2
  4. package/README.md +262 -311
  5. package/dist/{account-login-NX3VBOXI.js → account-login-D7GELY6Q.js} +4 -4
  6. package/dist/{account-status-MQKBY3W3.js → account-status-YCVLHU6B.js} +5 -5
  7. package/dist/agent/worker-process/child.js +172 -147
  8. package/dist/{bootstrap-RE72OT7H.js → bootstrap-QSRWNZHB.js} +147 -126
  9. package/dist/{build-backends-KLXX6FMK.js → build-backends-ZQSNXMHT.js} +3 -3
  10. package/dist/{chain-2B3D2JV4.js → chain-2ZBLCBBZ.js} +3 -3
  11. package/dist/{checkpoint-WJXJP7OJ.js → checkpoint-CD4PCJLL.js} +2 -2
  12. package/dist/chunk-2AD65B4B.js +118 -0
  13. package/dist/{chunk-2DGQXETV.js → chunk-2EJX4HWK.js} +12 -12
  14. package/dist/{chunk-HDJRWS2J.js → chunk-2ET6ZQ6O.js} +24 -13
  15. package/dist/chunk-2NAPPPCG.js +426 -0
  16. package/dist/chunk-2QRAS45R.js +22 -0
  17. package/dist/{chunk-62A5JYEY.js → chunk-36UFT42V.js} +1 -1
  18. package/dist/chunk-36XJXTVC.js +1116 -0
  19. package/dist/{chunk-IKQSOKKQ.js → chunk-3CTV7VBB.js} +2 -2
  20. package/dist/{chunk-VQI3Y4LK.js → chunk-3PDF6LUL.js} +1 -1
  21. package/dist/{chunk-7WI5BCTJ.js → chunk-45QR3OMT.js} +12 -12
  22. package/dist/{chunk-SXRUJQRW.js → chunk-45RQUC2J.js} +17 -7
  23. package/dist/{chunk-IHT3XLFP.js → chunk-4BBYVYVN.js} +6 -6
  24. package/dist/{chunk-IMK5PLB5.js → chunk-4L6M7DMG.js} +18 -9
  25. package/dist/{chunk-JUNK6OPM.js → chunk-57MOU44S.js} +75 -358
  26. package/dist/{chunk-ZHUNZ5AX.js → chunk-5BJDR3RR.js} +9 -5
  27. package/dist/{chunk-VQI5QHGV.js → chunk-5LWT5H2F.js} +1615 -929
  28. package/dist/{chunk-6HP3C2CF.js → chunk-636Z2X55.js} +2 -2
  29. package/dist/{chunk-PADENGLI.js → chunk-6RTYKM6V.js} +17 -15
  30. package/dist/{chunk-JRCYSFQL.js → chunk-6ZJOBWNV.js} +1 -1
  31. package/dist/{chunk-ILL33UPH.js → chunk-73J7QAGV.js} +1 -1
  32. package/dist/chunk-7UHNMWO5.js +198 -0
  33. package/dist/chunk-7VVIOMP5.js +228 -0
  34. package/dist/{chunk-SKMNLI76.js → chunk-7ZIJM5DJ.js} +1 -1
  35. package/dist/chunk-A2WIYFPK.js +89 -0
  36. package/dist/chunk-A4UAGIUP.js +2141 -0
  37. package/dist/{chunk-GRAY2CFJ.js → chunk-AGQC5HE6.js} +1 -1
  38. package/dist/{chunk-MLMBMRD2.js → chunk-AGRZP6HB.js} +67 -47
  39. package/dist/{chunk-QGZZCQSG.js → chunk-ALC2MQJ6.js} +1 -1
  40. package/dist/{chunk-OIYRXVLL.js → chunk-ATIIFZZ3.js} +59 -2171
  41. package/dist/{chunk-RTZL7TY2.js → chunk-B35WYTWG.js} +8 -8
  42. package/dist/{chunk-66LLSH6H.js → chunk-BHJWUUNN.js} +3 -3
  43. package/dist/{chunk-65H5B3AA.js → chunk-C2UIM5CT.js} +220 -181
  44. package/dist/{chunk-IY7GYKG2.js → chunk-C6JA6N5E.js} +3 -3
  45. package/dist/{chunk-SYX5IHPD.js → chunk-C6JX7XP6.js} +69 -175
  46. package/dist/chunk-CEK53KER.js +119 -0
  47. package/dist/{chunk-EUN2LIUE.js → chunk-CSC6BOO6.js} +99 -75
  48. package/dist/{chunk-DSGTB6BY.js → chunk-CXIFERUW.js} +1 -1
  49. package/dist/{chunk-COWLEVUJ.js → chunk-D56CXZLO.js} +11 -1
  50. package/dist/{chunk-CM7VWGPD.js → chunk-DIRXTTOW.js} +8 -6
  51. package/dist/{chunk-YAQU5PQQ.js → chunk-DW2ZQATG.js} +4 -2
  52. package/dist/{chunk-GBBB2EVH.js → chunk-E64JOUMH.js} +24 -12
  53. package/dist/{chunk-4FATPZA2.js → chunk-EAU4YQUW.js} +19 -26
  54. package/dist/{chunk-ZZLOBY2S.js → chunk-EWQTU2OM.js} +211 -3
  55. package/dist/chunk-F6PF25NS.js +425 -0
  56. package/dist/{chunk-D4RDOE3W.js → chunk-F7RC22BM.js} +5 -5
  57. package/dist/{chunk-37SMOJ32.js → chunk-FGNC2YZC.js} +4 -2
  58. package/dist/{chunk-ULXCP4NI.js → chunk-FGRLFKS6.js} +213 -60
  59. package/dist/chunk-FMXB56CJ.js +277 -0
  60. package/dist/chunk-FTNCAVF5.js +85 -0
  61. package/dist/{chunk-K4H75IN4.js → chunk-FVETC67E.js} +1 -1
  62. package/dist/chunk-G44MTWXL.js +37 -0
  63. package/dist/{chunk-2OBJPOZ2.js → chunk-G7VEM5DN.js} +191 -52
  64. package/dist/{chunk-JGSGR6TD.js → chunk-GA4EMIJN.js} +5 -1
  65. package/dist/{chunk-73FZEM6A.js → chunk-GJ33OAEL.js} +9 -9
  66. package/dist/{chunk-7JO4ST4F.js → chunk-GJBZZ6ST.js} +1 -1
  67. package/dist/{chunk-RPKC2EJ3.js → chunk-GKYCH6QA.js} +16 -45
  68. package/dist/chunk-GUQEPZH3.js +35 -0
  69. package/dist/{chunk-LEPGKD3T.js → chunk-H5APOOIG.js} +61 -29
  70. package/dist/{chunk-WUITFIIY.js → chunk-HFZCYPWX.js} +88 -34
  71. package/dist/{chunk-33EFRVZH.js → chunk-HJZMC4XZ.js} +30 -17
  72. package/dist/{chunk-IZ6Q5UJ3.js → chunk-HKJC6DMZ.js} +13 -247
  73. package/dist/{chunk-QL7YLO3F.js → chunk-HLA5BGN4.js} +17 -15
  74. package/dist/{chunk-MRLTSAGR.js → chunk-IVK574U7.js} +37 -0
  75. package/dist/{chunk-TBKHOUOQ.js → chunk-IWGD3OTW.js} +1 -1
  76. package/dist/{chunk-MCLNLIFV.js → chunk-J2WOXZTB.js} +1 -1
  77. package/dist/{chunk-FZKIE3P3.js → chunk-JDP6O37W.js} +40 -11
  78. package/dist/chunk-JIVTST33.js +17 -0
  79. package/dist/{chunk-ELLHW525.js → chunk-JL6ZOCKR.js} +1 -1
  80. package/dist/{chunk-KBVSW57N.js → chunk-JMVARB2I.js} +15 -15
  81. package/dist/{chunk-AJED2EWY.js → chunk-JOFXLOY7.js} +5 -5
  82. package/dist/{chunk-X6ZHHMZP.js → chunk-JSM7QQPT.js} +8 -10
  83. package/dist/{chunk-G5XHQ6PW.js → chunk-JTMRWAWN.js} +2 -2
  84. package/dist/{chunk-3ITRK5TJ.js → chunk-JZ5AGNLZ.js} +12 -2
  85. package/dist/chunk-KPK6JDLA.js +254 -0
  86. package/dist/{chunk-CTUBZKFA.js → chunk-KUJ74NWU.js} +1 -1
  87. package/dist/{chunk-FUPU27ID.js → chunk-L7KEWFNC.js} +5 -3
  88. package/dist/{chunk-OA2HNEFO.js → chunk-LE3INURI.js} +1 -1
  89. package/dist/{chunk-BRONKUJM.js → chunk-LGQ2GINZ.js} +3 -3
  90. package/dist/{chunk-YMORIL4I.js → chunk-LIU46Z7W.js} +2 -2
  91. package/dist/{chunk-7EWPQP5U.js → chunk-LJJVWXWY.js} +37 -28
  92. package/dist/{chunk-HDL2LWKZ.js → chunk-LWJK3GEY.js} +9 -7
  93. package/dist/chunk-M2LLZPQB.js +1876 -0
  94. package/dist/{chunk-6QTPWGSF.js → chunk-M2V2GKJN.js} +8 -6
  95. package/dist/{chunk-E2ZB23JP.js → chunk-M5U2TMZN.js} +52 -2
  96. package/dist/{chunk-WGSE2S5R.js → chunk-MBC6VCXV.js} +10 -10
  97. package/dist/{chunk-XF6YNQKM.js → chunk-MGBNR6FE.js} +5 -4
  98. package/dist/{chunk-UANLOAAZ.js → chunk-MJ4JVZ7A.js} +3 -3
  99. package/dist/chunk-MJDILZD6.js +362 -0
  100. package/dist/{chunk-XHAITYCX.js → chunk-MLJPNR7C.js} +8 -443
  101. package/dist/{chunk-L4REHO7N.js → chunk-N7JNP3MB.js} +3 -0
  102. package/dist/{chunk-ON2IJHVL.js → chunk-NC2YBBV6.js} +1 -1
  103. package/dist/{chunk-POZ4M2TP.js → chunk-NGW2TRQE.js} +11 -6
  104. package/dist/{chunk-ADWEQ5BN.js → chunk-NJY7YBPJ.js} +16 -6
  105. package/dist/{chunk-2TTMPV6H.js → chunk-NPXS67CG.js} +27 -23
  106. package/dist/{chunk-A3GV3WLK.js → chunk-O777HPQ6.js} +111 -77
  107. package/dist/chunk-OCGQY3HN.js +99 -0
  108. package/dist/{chunk-ERZRRQOB.js → chunk-OPDYSVSZ.js} +1 -1
  109. package/dist/{chunk-C7VCZ7GZ.js → chunk-ORFLZHKT.js} +1 -1
  110. package/dist/{chunk-ET6VEKDC.js → chunk-P35EDQD4.js} +13 -13
  111. package/dist/{chunk-B7MPL6T5.js → chunk-PHBGUD2O.js} +2 -2
  112. package/dist/{chunk-HZVL55SB.js → chunk-PMDBPZC7.js} +4 -408
  113. package/dist/{chunk-EKAARHKR.js → chunk-R2S4FHPX.js} +39 -301
  114. package/dist/{chunk-HDOJQZSF.js → chunk-R44ENUT2.js} +20 -16
  115. package/dist/{chunk-53IVNPIK.js → chunk-R76EL5SB.js} +8 -8
  116. package/dist/{chunk-6TIVNRV2.js → chunk-RGMQ5JK6.js} +19 -15
  117. package/dist/{chunk-PO3BLJQV.js → chunk-RIK3MRMJ.js} +19 -6
  118. package/dist/{chunk-ATPREQW6.js → chunk-RJNS6VEI.js} +19 -8
  119. package/dist/{chunk-T6M4Y2VP.js → chunk-RULFNJCE.js} +2 -2
  120. package/dist/chunk-RWCX2NBM.js +2121 -0
  121. package/dist/chunk-RX7KJ3TB.js +1622 -0
  122. package/dist/{chunk-GG5MGT6E.js → chunk-SCC6U4ZH.js} +1 -1
  123. package/dist/{chunk-O7GGNQA7.js → chunk-SS67PYA2.js} +1 -1
  124. package/dist/{chunk-GZ6CJCYI.js → chunk-SWA3ZIAT.js} +1 -1
  125. package/dist/{chunk-NTHEREW2.js → chunk-SZAKX2E3.js} +1 -1
  126. package/dist/{chunk-KEXER4GN.js → chunk-TCGTQUPH.js} +24 -20
  127. package/dist/{chunk-GIIDEHSY.js → chunk-TMT65OF7.js} +103 -50
  128. package/dist/{chunk-RABEL5V5.js → chunk-U3W76LNL.js} +1 -1
  129. package/dist/{chunk-N24X7VVQ.js → chunk-U7DOKP66.js} +3 -3
  130. package/dist/{chunk-VGFSAAPJ.js → chunk-UVYKA4G3.js} +7 -5
  131. package/dist/chunk-UW2NGXS3.js +331 -0
  132. package/dist/{chunk-ELP6TCZZ.js → chunk-UXONC5JN.js} +1 -1
  133. package/dist/{chunk-CG4YSTUK.js → chunk-V3BVM5MK.js} +3 -3
  134. package/dist/{chunk-DJEV72ML.js → chunk-VHE2BXJC.js} +6 -6
  135. package/dist/{chunk-BNIULA4W.js → chunk-VJ3RAXTV.js} +1 -1
  136. package/dist/{chunk-3BCZ7XUJ.js → chunk-VTWC7BMT.js} +191 -106
  137. package/dist/{chunk-4HROKFPQ.js → chunk-W55ZZ6K6.js} +5 -5
  138. package/dist/{chunk-WCCKBALG.js → chunk-WSWTFEPM.js} +349 -2816
  139. package/dist/chunk-X5MDMXG7.js +54 -0
  140. package/dist/chunk-XL4CI5K6.js +43 -0
  141. package/dist/chunk-XMGMQ6MT.js +127 -0
  142. package/dist/chunk-XRG7FMCV.js +170 -0
  143. package/dist/chunk-Y5O6ORLZ.js +424 -0
  144. package/dist/{chunk-TZRWVACQ.js → chunk-YG7VYB5W.js} +1 -1
  145. package/dist/{chunk-ZBV4ZJIC.js → chunk-YKIS66ET.js} +3 -3
  146. package/dist/{chunk-G3MOSOYK.js → chunk-YYNGTIQQ.js} +1 -1
  147. package/dist/{chunk-T6R4UMEX.js → chunk-ZAU2CLM7.js} +34 -17
  148. package/dist/{chunk-X3VPBZWV.js → chunk-ZD5CHF4J.js} +10 -10
  149. package/dist/{chunk-A5T3FXAN.js → chunk-ZKVJKWY6.js} +9 -97
  150. package/dist/{chunk-HQZHV3BK.js → chunk-ZLGAO6FQ.js} +1 -1
  151. package/dist/cli/entry.js +2 -2
  152. package/dist/{connector-64MOK5ON.js → connector-XD6JPPBV.js} +2 -2
  153. package/dist/{context-FTX5S7VF.js → context-243GMHVG.js} +32 -24
  154. package/dist/{council-convene-OUFA5DB5.js → council-convene-KUKPSQMK.js} +39 -36
  155. package/dist/{create-agent-config-OG3CJJDJ.js → create-agent-config-L3S6PMUU.js} +52 -43
  156. package/dist/{cvm-ledger-EHLEUBS4.js → cvm-ledger-WIZLIRDI.js} +8 -7
  157. package/dist/default-registry-4UBOQNQP.js +115 -0
  158. package/dist/{deliver-task-ENDPT3G4.js → deliver-task-GQEWRMNP.js} +60 -51
  159. package/dist/delivery-gate-v2-EFDNRCXF.js +49 -0
  160. package/dist/{delivery-readonly-UOLX5WK4.js → delivery-readonly-HWYDYNYA.js} +17 -15
  161. package/dist/{delivery-verification-plan-43F46DIK.js → delivery-verification-plan-IXCYBHLM.js} +23 -21
  162. package/dist/{evidence-process-5EF7KQQE.js → evidence-process-XMAOJ7GQ.js} +3 -2
  163. package/dist/{fetch-core-UJIFM5FJ.js → fetch-core-UCW2BTNJ.js} +3 -3
  164. package/dist/galaxy-VSYII7HU.js +147 -0
  165. package/dist/git-command-TCNSDQL7.js +29 -0
  166. package/dist/{goal-criteria-6X3G4QMW.js → goal-criteria-6HYVF6OH.js} +34 -25
  167. package/dist/{headless-6EL3HENB.js → headless-HUUABOXI.js} +1 -1
  168. package/dist/headless-coordinator-G2VZ74GV.js +147 -0
  169. package/dist/{log-locations-H5EB435M.js → log-locations-7Q7EZYEW.js} +2 -2
  170. package/dist/{login-flow-IPQMQUYC.js → login-flow-RQAVCHRK.js} +13 -12
  171. package/dist/{logs-cli-MFXJNXEJ.js → logs-cli-FGSA6MA5.js} +3 -3
  172. package/dist/loop-PCW4LWDY.js +127 -0
  173. package/dist/main.js +3645 -3509
  174. package/dist/{manager-LOVXQS5R.js → manager-PRW4OJAX.js} +14 -13
  175. package/dist/{manager-A3M2GZN2.js → manager-SKTMTU4M.js} +11 -10
  176. package/dist/meridian-indexer-EQZ25LI4.js +42 -0
  177. package/dist/package.json +1 -1
  178. package/dist/{path-grants-POAEANBI.js → path-grants-YZCKXR7U.js} +2 -2
  179. package/dist/{paths-QPL6KDN4.js → paths-PE56RINB.js} +11 -1
  180. package/dist/{plan-approval-HTO2AKYC.js → plan-approval-4LJGYGR5.js} +17 -16
  181. package/dist/{plan-templates-OYE4MJQS.js → plan-templates-5PYUKQDE.js} +1 -1
  182. package/dist/{plugin-loader-WKIAJVQF.js → plugin-loader-X3YFO4I2.js} +12 -11
  183. package/dist/{project-trust-BQAHJ7BE.js → project-trust-JAOVCWX3.js} +2 -2
  184. package/dist/provider-cli-C3FPS4JH.js +59 -0
  185. package/dist/{recovery-cli-MPKO5HXM.js → recovery-cli-LV4JN24I.js} +18 -17
  186. package/dist/seed-capsules/seed-capsule-changgeng.md +31 -0
  187. package/dist/seed-capsules/seed-capsule-tianliang.md +3 -1
  188. package/dist/{serve-BCJWCIH5.js → serve-MQGAD3CG.js} +101 -86
  189. package/dist/{serve-agent-C53RT54Q.js → serve-agent-5TTKCSOK.js} +197 -167
  190. package/dist/{service-IMFDZABJ.js → service-BLXNVZQ4.js} +13 -12
  191. package/dist/{session-persist-J5YOEPSH.js → session-persist-MCZP7DFJ.js} +7 -6
  192. package/dist/{skill-loader-ZCV5RWDH.js → skill-loader-MFCCERBN.js} +4 -4
  193. package/dist/{skills-cli-4YALORMJ.js → skills-cli-GQOCAUT7.js} +170 -52
  194. package/dist/{spawn-git-3GJUH5HM.js → spawn-git-ZCUYDH6K.js} +16 -12
  195. package/dist/{starflow-OXKNLAWW.js → starflow-YOCZGR3W.js} +25 -21
  196. package/dist/{storage-cli-DSZLIG52.js → storage-cli-PS2B7GC7.js} +30 -26
  197. package/dist/task-ledger-JIRC7MMS.js +35 -0
  198. package/dist/{team-orchestrate-Y27SHF76.js → team-orchestrate-WD2QXBA4.js} +37 -34
  199. package/dist/{test-execution-plan-S74OK2DZ.js → test-execution-plan-C6VFC2F3.js} +3 -3
  200. package/dist/{todo-362MTZ2R.js → todo-O63AI2OR.js} +8 -7
  201. package/dist/tool-pipeline-4PG7CKJI.js +100 -0
  202. package/dist/{tool-preset-G4VC4ZOG.js → tool-preset-WO2X4LHH.js} +11 -10
  203. package/dist/{tool-tiers-IF3LWOF5.js → tool-tiers-ITOR2MHM.js} +1 -1
  204. package/dist/{verification-attribution-FFE5VGWJ.js → verification-attribution-R66PRJQG.js} +21 -19
  205. package/dist/{wave-checkpoint-BVCKSYCZ.js → wave-checkpoint-H4VE2K3Z.js} +19 -18
  206. package/dist/{web-cli-MLWVMX5B.js → web-cli-A74F2GN3.js} +5 -5
  207. package/dist/{web-search-PT2Y6SVC.js → web-search-XMMJWWSR.js} +7 -7
  208. package/dist/workers/verification-worker.js +22 -20
  209. package/dist/{workflow-runner-BGU6WRLJ.js → workflow-runner-T6EGEPGI.js} +1 -1
  210. package/package.json +6 -2
  211. package/dist/chunk-ADSVPJLE.js +0 -123
  212. package/dist/chunk-DD7VIEMY.js +0 -135
  213. package/dist/chunk-KCJNHPHT.js +0 -1847
  214. package/dist/chunk-XZYE5OXJ.js +0 -780
  215. package/dist/chunk-Y346XA2U.js +0 -721
  216. package/dist/default-registry-DPTGTK2R.js +0 -99
  217. package/dist/delivery-gate-v2-EUU5JSOJ.js +0 -44
  218. package/dist/galaxy-R7ROF7MV.js +0 -132
  219. package/dist/git-command-ZBTOB6HZ.js +0 -27
  220. package/dist/headless-coordinator-3NNEHABG.js +0 -133
  221. package/dist/loop-2QEMKDN7.js +0 -115
  222. package/dist/meridian-indexer-XUROQ6G2.js +0 -22
  223. package/dist/provider-cli-UK6XET32.js +0 -50
  224. package/dist/task-ledger-6UKE2ZOL.js +0 -33
  225. package/dist/tool-pipeline-EHU2QHZ2.js +0 -80
package/README.en.md CHANGED
@@ -1,136 +1,112 @@
1
1
  <p align="center">
2
- <img src="docs/brand/assets/tianshu-banner-dark.jpg" alt="天枢 Tianshu" width="100%">
2
+ <img src="docs/brand/assets/tianshu-banner.svg" alt="Tianshu Harness" width="100%">
3
3
  </p>
4
4
 
5
- <h1 align="center">天枢 <sub>Tianshu Harness</sub></h1>
5
+ <h1 align="center">Tianshu Harness</h1>
6
6
 
7
7
  <p align="center">
8
- <b>把东方的星辰带给每一位开发者 · Models as partners, not tools.</b>
8
+ <b>A Cognitive Runtime for Coding Agents</b><br>
9
+ <sub>Goals that don't drift · Completion with evidence · Verification that closes the loop</sub>
9
10
  </p>
10
11
 
11
12
  <p align="center">
12
- <a href="https://tianshuharness.com"><b>🌐 Official Website</b></a> ·
13
- <a href="https://atomgit.com/huiliyi37/Tianshu-harness"><b>🇨🇳 AtomGit Mirror</b></a> ·
14
- <a href="README.md">🇨🇳 中文</a> ·
15
- 📖 <b>English</b> ·
16
- <a href="README.ja.md">🇯🇵 日本語</a> ·
17
- <a href="README.ko.md">🇰🇷 한국어</a>
13
+ <a href="https://github.com/huiliyi37/Tianshu-harness/releases/latest"><img src="https://img.shields.io/github/v/release/huiliyi37/Tianshu-harness?color=8B5CF6&label=Release&logo=github" alt="Release"></a>
14
+ <a href="https://www.npmjs.com/package/tianshu-harness"><img src="https://img.shields.io/npm/v/tianshu-harness?color=CB3837&label=npm&logo=npm" alt="npm"></a>
15
+ <a href="https://tianshuharness.com"><img src="https://img.shields.io/badge/Website-tianshuharness.com-4285F4?logo=googlechrome&logoColor=white" alt="Website"></a>
16
+ <a href="docs/user-guide.md"><img src="https://img.shields.io/badge/Docs-User%20Guide-FBBC04" alt="Docs"></a>
17
+ <a href="https://discord.gg/XjWTATCHB"><img src="https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=white" alt="Discord"></a>
18
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-34A853" alt="License"></a>
18
19
  </p>
19
20
 
20
21
  <p align="center">
21
- <a href="docs/user-guide.md"><b>📚 User Guide</b></a> ·
22
- <a href="docs/guides/installation.md"><b>📦 Installation Guide</b></a> ·
23
- <a href="docs/reference/cvm-cognitive-runtime.md"><b>🧠 CVM Thesis</b></a> ·
24
- <a href="docs/CVM运行时对Agent模型的实证影响.md"><b>📊 A/B Evidence</b></a> ·
25
- <a href="docs/stars/genesis-stele.en.md"><b>✦ Star Stele</b></a>
22
+ <a href="#install"><b>Install</b></a> ·
23
+ <a href="#how-cvm-works"><b>How it works</b></a> ·
24
+ <a href="#evidence"><b>Evidence</b></a> ·
25
+ <a href="#star-domains"><b>Star Domains</b></a> ·
26
+ <a href="docs/user-guide.md"><b>User Guide</b></a>
27
+ &nbsp;&nbsp;|&nbsp;&nbsp;
28
+ <b>English</b> · <a href="README.md">中文</a> · <a href="README.ja.md">日本語</a> · <a href="README.ko.md">한국어</a> · <a href="https://atomgit.com/huiliyi37/Tianshu-harness">AtomGit</a>
26
29
  </p>
27
30
 
28
31
  <p align="center">
29
- <img src="https://img.shields.io/github/v/release/huiliyi37/Tianshu-harness?color=8B5CF6&label=Release&logo=github&style=for-the-badge" alt="GitHub release">
30
- <img src="https://img.shields.io/badge/License-Apache%202.0-3B5BDB?style=for-the-badge&logo=apache" alt="License">
31
- <img src="https://img.shields.io/badge/TypeScript-Strict-blue?style=for-the-badge&logo=typescript" alt="TypeScript">
32
- <img src="https://img.shields.io/badge/Tests-19%2C000%2B%20Passed-green?style=for-the-badge&logo=testinglibrary" alt="Tests">
33
- <a href="https://discord.gg/XjWTATCHB"><img src="https://img.shields.io/badge/Discord-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Discord"></a>
34
- <a href="https://atomgit.com/huiliyi37/Tianshu-harness"><img src="https://atomgit.com/huiliyi37/Tianshu-harness/star/badge.svg" alt="AtomGit Star"></a>
35
- <a href="https://github.com/huiliyi37/Tianshu-harness/releases"><img src="https://img.shields.io/github/downloads/huiliyi37/Tianshu-harness/total?logo=github&label=downloads" alt="GitHub downloads"></a>
36
- <a href="https://www.npmjs.com/package/tianshu-tui"><img src="https://img.shields.io/npm/dm/tianshu-tui?label=npm%20tianshu-tui" alt="npm tianshu-tui downloads"></a>
37
- <a href="https://www.npmjs.com/package/tianshu-harness"><img src="https://img.shields.io/npm/dm/tianshu-harness?label=npm%20tianshu-harness" alt="npm tianshu-harness downloads"></a>
32
+ <img src="docs/brand/assets/readme-compare.svg" alt="Closing comparison. Left: an agent without a delivery gate reads a file, edits code, then claims it should work now — with no verification. Right: Tianshu's deliver_task gate returns RED and refuses delivery when no tests were run, and only returns GREEN after the suite passes." width="100%">
38
33
  </p>
34
+ <p align="center"><sub>The same task, two endings. A model's claim of completion is not evidence — the gate asks for proof.</sub></p>
39
35
 
40
- <p align="center">
41
- <a href="https://trendshift.io/repositories/100440" target="_blank"><img src="https://trendshift.io/api/badge/trendshift/repositories/100440/daily?language=TypeScript" alt="Trendshift: TypeScript repository of the day" width="250" height="55"></a>
42
- </p>
36
+ A model's **capability ceiling** is not its **runtime behaviour**. Put the same weights into a real engineering session and they get talked out of a position, follow instructions too literally, let local signals override the global goal, or keep calling tools without making progress — and then hand you "it should be fixed now."
43
37
 
44
- ---
38
+ **Tianshu** is a coding-agent runtime written in TypeScript. The terminal TUI, the desktop app, and the VS Code extension share one agent kernel. Between the model and the real world it places a **Cognitive Virtual Machine (CVM)** that lifts goals, state, evidence, permissions, and termination conditions out of the conversation history and hands them to the runtime:
45
39
 
46
- ### A Cognitive Runtime for Foundation Model Agents
40
+ * **Task contracts** — Every task gets a `TaskContract` recording goal, scope, constraints, and success criteria. Long sessions are held by the runtime, not by the model's memory.
41
+ * **Evidence-gated delivery** — "Done" has to pass the `deliver_task` gate. Without tests, diffs, or verification commands as evidence, delivery is blocked.
42
+ * **A deterministic outer loop** — 75 runtime hook modules across five phases of a turn, together with Sensorium state awareness and stall detection, observe and correct between model output and real action.
47
43
 
48
- > **Tianshu** is a coding-agent runtime written in TypeScript, where the **terminal TUI** and **desktop GUI** share the same agent kernel. The core question it answers is: **how can a model deliver reliably — without goal drift, with runtime evidence for completion, with closed-loop verification, and never saying "it should be fixed now"?** To achieve this, Tianshu establishes a **Cognitive Virtual Machine (CVM)** between the model and the real world — externalizing goals, state, evidence, resources, permissions, and termination conditions out of the conversation history so they are continuously managed by the runtime.
49
- >
50
- > **LLM provides cognition. CVM provides execution semantics. 模型提供认知能力,CVM 提供认知执行语义。**
51
-
52
- ```
53
- Application / TUI / IDE / Desktop
54
- ↓
55
- Tianshu Cognitive Runtime ← State · Goal · Evidence · Control · Replay
56
- ↓
57
- Foundation Models ← DeepSeek · GLM · Claude · Codex · Grok · MiniMax · MiMo …
58
- ```
59
-
60
- - **Reliable delivery, never false-reporting "done"** — This is the core. A `TaskContract` pins the global goal, the delivery gate requires runtime evidence (tests, diffs, verification commands) before accepting "done", and convergence detection independently evaluates whether the cognitive trajectory is still making progress — *the model saying it's done ≠ the runtime confirming it's done*.
61
- - **Terminal × Desktop, one kernel** — A purpose-built pure-ANSI TUI (`tianshu`) and a Tauri desktop app (macOS / Windows / Linux) share the same agent kernel, keeping capabilities identical across surfaces.
62
- - **Cognitive Virtual Machine (CVM)** — 75 runtime hooks across 5 lifecycle phases put an observable, correctable cognitive runtime between model output and real-world actions ([CVM Thesis](docs/reference/cvm-cognitive-runtime.md) · [A/B Empirical Report](docs/CVM运行时对Agent模型的实证影响.md)).
63
- - **Prefix-cache engine for all models** — Frozen prefix + incremental appendix + boundary compaction apply to every model that supports prefix caching: measured steady-state hit rates reach **95–99%** across long sessions (with additional deep tuning for DeepSeek V4), dramatically cutting token costs.
44
+ <table>
45
+ <tr>
46
+ <td align="center" width="25%"><b>99.3–99.6%</b><br><sub>prefix-cache hit rate<br>across 5 real long sessions</sub></td>
47
+ <td align="center" width="25%"><b>¥880 → ¥20</b><br><sub>estimated input cost on the same<br>sessions at list price</sub></td>
48
+ <td align="center" width="25%"><b>25</b><br><sub>built-in provider presets, plus any<br>OpenAI-compatible endpoint</sub></td>
49
+ <td align="center" width="25%"><b>22,000</b><br><sub>test cases, roughly<br>1:1 with source lines</sub></td>
50
+ </tr>
51
+ </table>
64
52
 
65
53
  <p align="center">
66
- <img src="docs/brand/assets/tianshu-harness-screenshot.png" alt="Tianshu TUI (terminal)" width="49%">
67
- <img src="docs/brand/assets/tianshu-gui-screenshot.jpg" alt="Tianshu desktop GUI" width="49%">
68
- </p>
69
- <p align="center">
70
- <sub>Left: terminal TUI (welcome screen + GlanceBar status line) · Right: desktop GUI (session sidebar + star-domain quick picks) — same agent kernel</sub>
54
+ <img src="docs/brand/assets/tianshu-harness-screenshot.png" alt="Tianshu terminal TUI: welcome screen and GlanceBar status line" width="49%">
55
+ <img src="docs/brand/assets/tianshu-gui-screenshot.jpg" alt="Tianshu desktop app: session sidebar and star-domain picker" width="49%">
71
56
  </p>
57
+ <p align="center"><sub>Left: terminal TUI · Right: desktop app · one agent kernel</sub></p>
72
58
 
73
59
  > [!NOTE]
74
- > The project was originally codenamed **Rivet**. The primary CLI command is now `tianshu`, with `rivet` kept as a compatibility alias (same entry point); the data directory stays `~/.rivet`.
60
+ > The project was originally codenamed **Rivet**. The primary CLI command is `tianshu`, with `rivet` kept as a compatibility alias for the same entry point; the data directory stays `~/.rivet`.
75
61
 
76
62
  ## Table of Contents
77
63
 
78
- - [Quick Start](#-quick-start)
79
- - [Why a Cognitive Runtime](#-why-a-cognitive-runtime)
64
+ - [Install](#install)
65
+ - [Your First Task](#your-first-task)
66
+ - [How CVM Works](#how-cvm-works)
67
+ - [Evidence](#evidence)
80
68
  - [Star Domains](#star-domains)
81
- - [Core Features](#-core-features)
82
- - [Permission Modes](#-permission-modes)
83
- - [Supported Models](#-supported-models)
84
- - [Documentation Navigation](#-documentation-navigation)
85
- - [For Developers](#-for-developers)
86
- - [Security](#-security)
87
- - [Community & Support](#-community--support)
88
- - [Reference Appendix (CLI, Slash Commands & Config)](#-reference-appendix)
89
-
90
- <a id="quick-start"></a>
91
- ## 🚀 Quick Start
92
-
93
- Two paths. Download the desktop installer and use it right away — no Node.js pre-install needed. The terminal CLI requires **Node.js ≥ 24** (and **Git** is strongly recommended for worktree isolation, checkpoints, and diff review).
69
+ - [More Capabilities](#more-capabilities)
70
+ - [Supported Models](#supported-models)
71
+ - [Permissions & Security](#permissions--security)
72
+ - [Documentation](#documentation)
73
+ - [For Developers](#for-developers)
74
+ - [Community](#community)
75
+ - [License](#license)
94
76
 
95
- ### Desktop App
77
+ <a id="install"></a>
78
+ ## Install
96
79
 
97
- Installers are on [GitHub Releases](https://github.com/huiliyi37/Tianshu-harness/releases/latest). macOS, Windows, and Linux all run the exact same agent kernel.
80
+ <table>
81
+ <tr>
82
+ <td width="50%" valign="top">
98
83
 
99
- **macOS** (macOS 11+, separate builds for Apple Silicon and Intel)
100
-
101
- Download the `.dmg`, open it, and drag `Tianshu` into `Applications`.
102
-
103
- If macOS reports on first launch that the app "is damaged and can't be opened", the package itself is intact — current macOS builds use ad-hoc signing without Apple notarization, so Gatekeeper quarantines browser downloads. After dragging it into `Applications`, run once in Terminal:
84
+ **Terminal CLI** (Node.js 24+)
104
85
 
105
86
  ```bash
106
- xattr -cr /Applications/Tianshu.app
87
+ npm install -g tianshu-harness
88
+ tianshu
107
89
  ```
108
90
 
109
- Then double-click to open as usual. In-app auto-updates are not affected by this restriction.
91
+ Ready when you see the `〉` prompt. First launch opens the `/connect` wizard: pick a provider, paste an API key.
110
92
 
111
- **Windows** (Windows 10 1809+, 22H2 recommended; or Windows 11)
93
+ </td>
94
+ <td width="50%" valign="top">
112
95
 
113
- Download the `.exe` setup wizard and follow the prompts. The UI relies on **WebView2 Runtime** (≥ 120 recommended). Since v3.5.3, the installer bundles the offline WebView2 installer so no extra download is needed during setup.
96
+ **Desktop app** (no Node.js required)
114
97
 
115
- If the window fails to open at all, use **"Repair WebView2"** from the Start Menu, or run `repair-webview2.cmd` from the `windows-repair` folder in the same Release. You can also manually install the [Microsoft WebView2 Evergreen Standalone Installer](https://go.microsoft.com/fwlink/p/?LinkId=2124703) and reboot.
98
+ Download from [Releases](https://github.com/huiliyi37/Tianshu-harness/releases/latest):
116
99
 
117
- **Linux** (`x86_64` and `aarch64`, dual-architecture since v3.26.0)
100
+ - macOS 11+: `.dmg`, Apple Silicon / Intel
101
+ - Windows 10 1809+ / 11: `-setup.exe`
102
+ - Linux x86_64 / aarch64: `.AppImage`
118
103
 
119
- Download the `.AppImage` — no installation required. Pick the package matching your machine's architecture:
104
+ </td>
105
+ </tr>
106
+ </table>
120
107
 
121
- - `Tianshu_*_amd64.AppImage`: x86_64 desktops and laptops
122
- - `Tianshu_*_aarch64.AppImage`: ARM64 (64-bit Raspberry Pi, ARM Linux laptops)
123
-
124
- ```bash
125
- chmod +x Tianshu_*.AppImage
126
- ./Tianshu_*.AppImage
127
- ```
128
-
129
- Requires `glibc ≥ 2.35` (Ubuntu 22.04+, Debian 12+, etc.) and system graphics libraries `libwebkit2gtk-4.1` and `libgtk-3`. Most desktop distros ship these out of the box. On minimal installs, install `webkit2gtk-4.1` via your package manager and check any missing libraries with `ldd Tianshu_*.AppImage`. An X11 session is recommended (Wayland is not yet verified).
130
-
131
- Full platform notes, local voice input (`whisper.cpp`), and auto-update details: [Installation & Platform Guide](docs/guides/installation.md).
132
-
133
- ### Terminal (CLI)
108
+ <details>
109
+ <summary><b>One-line installers · migrating from the legacy package</b></summary>
134
110
 
135
111
  ```bash
136
112
  # macOS / Linux
@@ -138,153 +114,138 @@ bash <(curl -fsSL https://raw.githubusercontent.com/huiliyi37/Tianshu-harness/ma
138
114
 
139
115
  # Windows (PowerShell)
140
116
  powershell -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/huiliyi37/Tianshu-harness/main/scripts/install-tui.ps1 | iex"
141
-
142
- # Or via npm
143
- npm install -g tianshu-harness
144
117
  ```
145
118
 
146
- > **Migrating from the legacy `tianshu-tui` package**: the old package owns the `rivet` binary link, so installing the new package directly will fail with `EEXIST` — uninstall first: `npm uninstall -g tianshu-tui && npm install -g tianshu-harness` (the one-line installer script handles this migration automatically).
119
+ Migrating from the legacy `tianshu-tui` package fails with `EEXIST` because the old package owns the `rivet` binary link. Uninstall first: `npm uninstall -g tianshu-tui`. The one-line installers handle this automatically.
147
120
 
148
- **First launch** enters the main interface and automatically opens the `/connect` wizard — select your provider and paste your API key:
121
+ </details>
149
122
 
150
- ```bash
151
- tianshu # Ready when you see the 〉 prompt
152
- ```
123
+ <details>
124
+ <summary><b>Platform notes</b></summary>
153
125
 
154
- ### Your First Task
126
+ - **macOS** — Not yet Apple-notarized. macOS builds use ad-hoc signing, so Gatekeeper quarantines browser downloads and may report the app as "damaged". The package is intact; after dragging it into `Applications`, run once: `xattr -cr /Applications/Tianshu.app`. In-app auto-updates are unaffected.
127
+ - **Windows** — The UI relies on WebView2; the installer bundles the offline runtime. If the window won't open, use **"Repair WebView2"** from the Start Menu, or run `repair-webview2.cmd` from the `windows-repair` folder in the same Release.
128
+ - **Linux** — Requires `glibc` 2.35+ (Ubuntu 22.04+, Debian 12+) plus `libwebkit2gtk-4.1` and `libgtk-3`. An X11 session is recommended; Wayland is not yet verified. `chmod +x Tianshu_*.AppImage` then run it directly.
155
129
 
156
- Start with a **read-only** pass so it can learn your project (nothing gets modified):
130
+ </details>
157
131
 
158
- ```text
159
- Read this project and tell me its structure, where the entry points are, and one thing most worth improving
160
- ```
132
+ Android Termux, building from source, shell completions, and auto-update: [Installation & Platform Guide](docs/guides/installation.md).
161
133
 
162
- Once you trust its reading, give it a **multi-step task**:
134
+ <a id="your-first-task"></a>
135
+ ## Your First Task
136
+
137
+ Start read-only so it can learn your project and you can confirm it read it correctly, then hand it a multi-step task:
163
138
 
164
139
  ```text
165
- Fix the first failing test in this project and explain the root cause
140
+ 〉 Read this project, tell me its structure, where the entry points are, and one thing most worth improving
141
+ 〉 Fix the first failing test in this project and explain the root cause
166
142
  ```
167
143
 
168
- From there it will grep, read files, edit code, and run tests on its own — every step backed by a real tool call, never just "claimed done". The default permission tier is **Auto**: low-risk actions run directly, high-risk actions pause and ask you (see [Permission Modes](#-permission-modes) below).
169
-
170
- ### Three Places to Check Afterwards
171
-
172
- **① Delivery Report** — When wrapping up, Tianshu calls `deliver_task` and outputs a structured delivery report: delivery gate status (GREEN / YELLOW / RED), modified files, verification commands run, and a per-item completion audit. "Done" requires runtime evidence; a finish without evidence is blocked by the gate.
144
+ It searches, reads files, edits code, and runs tests on its own. The default permission tier is **Auto**: low-risk actions run directly, high-risk actions stop and ask. Afterwards, look at three places:
173
145
 
174
- **② Cockpit** — Type `/cockpit` to open (also accessible via the `Ctrl+P` command palette):
175
-
176
- | Panel | What It Shows |
177
- |-------|---------------|
178
- | `/cockpit verify` | Delivery verification: verified / unverified / failed / blocked, commands run, blast radius |
179
- | `/cockpit advisory` | Runtime advisory ledger: cumulative rendered / adopted / ignored counts, plus per-advisory adoption rate and lift |
180
- | `/cockpit model` | Prefix-cache hit rate, input/output tokens, current turn cost |
181
- | `/cockpit safety` | Risk level and doom-loop / stall detection |
182
-
183
- Run `/cockpit` without arguments for the summary view, or `/cockpit off` to close. (Set `RIVET_LANG=en` for English Cockpit labels.)
184
-
185
- **③ CVM Interception Ledger** — Every runtime interception is logged line-by-line to the session's `sensorium.jsonl`. Find its exact path with `tianshu logs` (which prints the data root and all log file locations):
186
-
187
- ```bash
188
- # Count this session's CVM interceptions by classification
189
- jq -r 'select(.kind=="cvm-vector-decision") | .classification' sensorium.jsonl | sort | uniq -c
190
- ```
146
+ | Where | What you see |
147
+ |---|---|
148
+ | **Delivery report** | Gate status (GREEN / YELLOW / RED), files changed, verification commands run, a per-item completion audit |
149
+ | **`/cockpit`** | 8-panel runtime dashboard: verification and delivery, advisory ledger, cache hits and cost, risk and stall detection (`F4`) |
150
+ | **`sensorium.jsonl`** | Per-turn state sensing and CVM decisions. `tianshu logs` prints the path; recompute anything with `jq` |
191
151
 
192
- By default the ledger writes lightweight rows (`vitals-lite` / `cognitive-frame-lite`); to record full interception telemetry, set `RIVET_DEBUG_TELEMETRY=1` before launching. For classification enums and reproduction scripts, see [Observability Harness](docs/reference/observability-harness.md).
193
-
194
- ### Headless Mode (Scripting / CI Integration)
152
+ <details>
153
+ <summary><b>Headless mode: scripting and CI</b></summary>
195
154
 
196
155
  ```bash
197
- tianshu -p "explain src/agent/loop.ts" # One-shot prompt, text output
198
- tianshu --stream-json -p "refactor this module" # NDJSON event stream with built-in secret redaction
199
- tianshu --goal "fix all type errors" --budget 50 # Headless autonomous goal mode
156
+ tianshu -p "explain src/agent/loop.ts" # one-shot prompt
157
+ tianshu --stream-json -p "refactor this module" # NDJSON event stream, redacted output
158
+ tianshu --goal "fix all type errors" --budget 50 # goal-driven autonomous continuation
200
159
  ```
201
160
 
202
- > All installation paths (Windows WebView2 / Linux AppImage / Android Termux / build from source / shell completions / auto-update) are covered in [Installation & Platform Guide](docs/guides/installation.md); the complete CLI flags table is in the [Reference Appendix](#-reference-appendix) below and in [User Guide](docs/user-guide.md#命令行参数).
161
+ Full flag table and subcommands: [CLI & Configuration Reference](docs/reference/cli-reference.en.md).
203
162
 
204
- <a id="why-a-cognitive-runtime"></a>
205
- <a id="why-tianshu"></a>
206
- ## 💡 Why a Cognitive Runtime
163
+ </details>
207
164
 
208
- ### The Problem: Capability Ceiling ≠ Runtime Behavior
165
+ <a id="how-cvm-works"></a>
166
+ ## How CVM Works
209
167
 
210
- In real engineering sessions, we repeatedly observe the same model weights regressing — not due to software bugs, but due to **convergent runtime degradation exhibited by instruction- and preference-aligned Transformer Agents**: surrendering the moment they are challenged, over-complying with literal phrasing, letting local signals override global goals, getting locked into early conclusions across long contexts, and calling the same tools repeatedly without genuine progress.
168
+ <p align="center">
169
+ <img src="docs/brand/assets/readme-cvm-pipeline.svg" alt="Tianshu CVM pipeline: input becomes a TaskContract, binds a star domain, and is assembled into a frozen prefix prompt before entering the turn loop. RuntimeHookPipeline intervenes at five phases — preTurn, afterPerception, postTool, postTurn, postSession. The inner loop is model cognition, the outer loop is runtime supervision. deliver_task then returns RED, YELLOW, or GREEN based on evidence and distils the result into cross-session memory." width="100%">
170
+ </p>
171
+ <p align="center"><sub>One task, from input to delivery: contract → domain binding → frozen prefix → turn loop → evidence gate → memory.</sub></p>
211
172
 
212
- The complete theoretical framework is presented in [CVM: From Shared Transformer Degradation to a Cognitive Runtime](docs/reference/cvm-cognitive-runtime.md). Its core concept is **Cognitive Anchor Collapse** — high-salience local signals cause the policy distribution to over-concentrate, stripping weight from global objectives and subsequent evidence until behavior collapses toward the anchor. There are four classes of anchors:
173
+ Alignment-tuned models show the same runtime failure mode in agent settings, which we call **Cognitive Anchor Collapse**: one high-salience local signal over-concentrates the policy, the global goal and later evidence lose weight, and behaviour collapses toward that anchor. A prompt is information, not state — it eventually becomes just another anchor, which is why better prompting alone cannot cure this.
213
174
 
214
- | Anchor | Source | Typical Manifestation |
215
- |--------|--------|-----------------------|
216
- | **Lexical Anchor** | Word–action correlations in training data | A prompt mentions "fix/delete", so the model ignores "do not edit, only explain" and edits code anyway |
217
- | **Semantic Anchor** | Locally true facts | "File already exists" is elevated to the explanatory center of the entire task, causing a refusal to act |
218
- | **Policy Anchor** | RLHF / preference-training priors | A single user reply "proceed with your plan" causes high-quality judgments formed during analysis to be discarded |
219
- | **Historical Anchor** | Early conclusions in long context | New counter-evidence at Turn 20 is rationalized away as a footnote to an old hypothesis from Turn 3 |
175
+ CVM does not change weights and does not turn the model into a deterministic program. It wraps deterministic supervision around probabilistic cognition — the model reasons and acts in the inner loop; the runtime measures, gates, and verifies in the outer loop, deciding whether to continue, correct, or halt:
220
176
 
221
- This is not "the model being broken" — it is a byproduct of successful training, which is why better prompts alone cannot cure it: a prompt is information, not runtime state, and the prompt itself eventually becomes just another anchor.
177
+ ```text
178
+ Inner loop · model cognition reason → decide → act → observe
179
+ Outer loop · runtime supervision observe → measure → evaluate → gate → verify → continue / correct / halt
180
+ ```
222
181
 
223
- ### The Evidence: A/B Control, Not Vibes
182
+ | Layer | Mechanism | What it does |
183
+ |---|---|---|
184
+ | 1 · Belief constitution | Star-domain belief blocks written into the static prompt | Zero extra inference cost; shifts inclination during analysis and advice |
185
+ | 2 · Courage Hook | `preTurn`, threshold varies by star domain | Detects repeated capitulation and injects a correction framed as an obligation |
186
+ | 3 · Sensorium | Computed each turn from existing monitoring signals, no LLM call | Senses momentum, pressure, verification coverage, complexity, familiarity, stability |
187
+ | 4 · RuntimeHookPipeline | 75 hook modules, five phases, assembled per session | Convergence and doom-loop detection, evidence tracking, delivery gate, edit-failure recovery |
224
188
 
225
- On 2026-05-19, using the exact same model (`DeepSeek-V4-Flash`) and the same 5 engineering tasks, with the sole variable being the **star-domain belief prompt** (Belief Constitution, `STAR_SOUL=0/1`) and Claude Opus 4.7 serving as reviewer:
189
+ <details>
190
+ <summary><b>Four classes of anchors</b></summary>
226
191
 
227
- | Metric | Group A (No Belief Prompt) | Group B (With Belief Prompt) |
228
- |--------|----------------------------|------------------------------|
229
- | Task completion rate | 4/5 | **5/5** |
230
- | Proactively raised objections | 0/5 | **3/5** |
231
- | Proactively asked about scope / impact analysis | 0/5 | **1/5** |
232
- | System-impact awareness (cache-invalidation warning) | 0/5 | **1/5** |
233
- | Intent understanding > literal execution | 1/5 | **4/5** |
192
+ | Anchor | Source | Typical manifestation |
193
+ |---|---|---|
194
+ | Lexical | Word–action correlations in training data | The prompt says "fix", so it ignores "do not edit, only explain" and edits anyway |
195
+ | Semantic | A locally true fact | "File already exists" becomes the explanatory centre of the whole task, and it refuses to act |
196
+ | Policy | RLHF / preference-training priors | One "proceed with your plan" discards the high-quality judgement formed during analysis |
197
+ | Historical | Early conclusions in a long context | New evidence at turn 20 is rationalized as a footnote to an old hypothesis from turn 3 |
234
198
 
235
- The most telling data point is T4: facing a "file already exists" contradiction, Group A wrote a 196-line retrospective document and refused to execute, whereas Group B inferred the user's true intent and directly delivered `+162/-20` lines of working code — **identical weights, opposite reactions; what changed was the runtime environment**.
199
+ </details>
236
200
 
237
- Note the exact boundary of this experiment: it validates **Layer 1 (Belief Injection)** of CVM's four defense layers — at zero extra inference cost, prompt-level belief injection alone produced observable behavioral improvements on the most cost-efficient open model; at the same time, it measured where that boundary lies (convictions hold strongly during analysis/recommendation and decay at the confirmation/execution transition), which is precisely what the subsequent three runtime interception layers (`Courage Hook`, `Sensorium`, `RuntimeHookPipeline`) are built to close. Full data and task-by-task comparisons: [CVM Empirical Report](docs/CVM运行时对Agent模型的实证影响.md).
201
+ Eight design principles and the open research questions: [CVM: From Shared Transformer Degradation to a Cognitive Runtime](docs/reference/cvm-cognitive-runtime.md). System layering: [Architecture Overview](docs/architecture-overview.md).
238
202
 
239
- ### The Solution: A Second Value Function Outside the Model
203
+ <a id="evidence"></a>
204
+ ## Evidence
240
205
 
241
- CVM does not alter model weights or turn the LLM into a rigid deterministic script; instead, it wraps deterministic supervision around probabilistic cognition — **Probabilistic Cognition inside Deterministic Supervision**:
206
+ ### Cache: longer context, steadier hits
242
207
 
243
- ```
244
- Inner Loop (Model Cognition): reason → decide → act → observe
245
- Outer Loop (Runtime Supervision): observe → measure → evaluate → gate → verify → continue / correct / halt
246
- ```
208
+ <p align="center">
209
+ <img src="docs/brand/assets/readme-cache-chart.svg" alt="Across the 15 sub-sessions of session c9774121, context grows from 34K to 512K tokens while the first-request cache hit rate after each prefix rebuild climbs from 69.2% to 98.3%." width="100%">
210
+ </p>
211
+ <p align="center"><sub>Real session c9774121 · DeepSeek V4 Pro · 4.2 hours · 412 requests. Context grew 15×; hit rate went up, not down.</sub></p>
247
212
 
248
- In engineering terms, this forms four layers of defense-in-depth: **Belief Constitution** (static prompt) → **Courage Hook** (`preTurn`) → **Sensorium** (`<1ms` per-turn 6-dimensional state sensing) → **RuntimeHookPipeline** (75 hooks, trap-and-emulate interception of degraded behaviors). Global goals live in independent state (`TaskContract`), completion requires runtime proof (`Evidence`), and collapse is independently detected (`Convergence` / doom-loop). Once these interceptions are active, models reliably express distinct cognitive stances — which Tianshu surfaces as **Star Domains** (see [Star Domains](#star-domains) below).
213
+ Tianshu is designed **prefix-cache first**: the prefix is frozen within a session, only deltas are appended, and compaction happens only at user-turn boundaries. In the 4.2-hour session above, 15 prefix rebuilds produced 383K cacheCreate tokens — 0.33% of all input.
249
214
 
250
- ### Engineering Quality
215
+ | 5 real self-hosted sessions (2026-08, DeepSeek V4) | Value |
216
+ |---|---|
217
+ | Requests / input tokens | 2,001 / 645M |
218
+ | Overall cache hit rate | 99.3–99.6% |
219
+ | Estimated cost (list price) | ¥879.97 without cache → ¥19.96 actual, 97.7% saved |
251
220
 
252
- Milestone snapshot as of **2026-09-30** (alongside current **v3.31.0** scale; line counts move daily):
221
+ The cache engine works for every model with prefix caching; published measurements cover DeepSeek only. Every number ships with a `jq` recomputation command: [Observability Harness](docs/reference/observability-harness.md).
253
222
 
254
- | Component | Scale |
255
- |-----------|-------|
256
- | `src/` source | ~1,256 files / ~300k lines (at v3.31.0: **1,475 files**, with `agent/` alone at 539 source files) |
257
- | `src/` tests | ~1,592 files / ~310k lines (at v3.31.0: **1,875 files / ~320k lines / 21,500+ test cases**, `node:test`, ~1:1 with source) |
258
- | `desktop/src` | ~450 files / ~96k lines (React), plus ~11k lines of Rust |
259
- | `vscode-extension/src` | 32 files / ~4,500 lines (17 files / ~2,700 lines at the 2026-09-30 snapshot) |
260
- | Repository | Created 2026-05-15, **8,000+** commits |
223
+ ### Behaviour: same weights, opposite reactions
261
224
 
262
- `tsc` strict + `noUncheckedIndexedAccess`, and every incident fix ships with a regression test. Full methodology, growth milestones, and reproduction commands: [Engineering Metrics](docs/engineering-metrics.md).
225
+ <p align="center">
226
+ <img src="docs/brand/assets/readme-ab-pilot.svg" alt="The same model, DeepSeek-V4-Flash, across 5 tasks: completion 4/5 for group A versus 5/5 for group B; proactively raising objections 0/5 versus 3/5; intent understanding over literal execution 1/5 versus 4/5; proactively asking about scope or impact 0/5 versus 1/5." width="100%">
227
+ </p>
228
+ <p align="center"><sub>2026-05-19 · one model, five real tasks, sole variable was the belief layer (<code>STAR_SOUL=0/1</code>) · reviewed by Claude Opus 4.7.</sub></p>
263
229
 
264
- <details>
265
- <summary><b>Comparison: Tianshu vs. MiMo-Code vs. Claude Code</b></summary>
230
+ The most telling case is T4. Facing a "file already exists" contradiction, group A wrote a 196-line retrospective and refused to act; group B inferred the real intent and delivered +162 / −20 lines of working code.
266
231
 
267
- > The table reflects each project's publicly documented focus at the time of writing. "—" means the capability is not a publicly highlighted feature, not necessarily that it is absent. Corrections welcome via issue/PR.
232
+ This is a small pilot: 5 tasks, a single model, LLM review. It also measured the decay — beliefs hold during analysis and advice and weaken markedly at confirmation and execution, which is exactly what layers 3 and 4 exist to cover. Full data: [CVM Empirical Report](docs/CVM运行时对Agent模型的实证影响.md).
268
233
 
269
- | Dimension | Tianshu | MiMo-Code | Claude Code |
270
- | :--- | :--- | :--- | :--- |
271
- | **Core focus** | Cognitive runtime (CVM) | Product experience / ecosystem | Enterprise coding agent |
272
- | **Runtime hook layer** | 75 conditionally-assembled hook modules × 5 phases | standard agent loop | user-configurable hooks |
273
- | **Prefix-cache tuning** | Deeply tuned for all prefix-cache models & DeepSeek V4 (95–99% steady-state) | provider default | Anthropic prompt caching |
274
- | **Self-perception** | Continuous 6-dim cognitive-state vector (`Sensorium`) | — | — |
275
- | **Cross-session memory** | Unified project memory + adaptive recall + session-scoped pheromones | SQLite + MEMORY.md | project memory |
276
- | **Multi-agent** | Concurrent worker sessions + wave conflict lock + `/council` / `/team` / `/scout` | background execution | remote isolated sandbox |
277
- | **Verification gate** | Built-in evidence-driven delivery gate (`deliver_task`) | — | — |
278
- | **License** | Apache 2.0 | MIT | Closed source |
234
+ ### Engineering
279
235
 
280
- </details>
236
+ As of 2026-10: `src/` holds roughly 1,600 source files and 330K lines; tests are about 1,900 files and 22,000 cases. TypeScript strict with `noUncheckedIndexedAccess`, and every incident fix ships with a regression test. Definitions and milestones: [Engineering Metrics](docs/engineering-metrics.md).
281
237
 
282
238
  <a id="star-domains"></a>
283
239
  ## Star Domains
284
240
 
285
- Walk the same model into different star domains and different working inclinations light up. A star domain does not add new capabilities into a model — it amplifies a facet that was already there, occupying one part of that facet at a time: walk into **Tianquan** and it weighs trade-offs first; walk into **Pojun** and it charges into the unknown first. The person is still the same person; the model is still the same model.
241
+ <p align="center">
242
+ <img src="docs/brand/assets/readme-star-map.svg" alt="The sixteen star domains of Tianshu: the Big Dipper forms the backbone (Tianshu, Tianxuan, Tianfu, Tianquan with Wenqu, Yuheng, Kaiyang with Tianliang, Yaoguang), the companion star Fu attends Kaiyang, and the polar line points to Taiyi; Qiming and Changgeng sit at opposite horizons, with Tianji, Huagai, Pojun and Qisha scattered around. Each star is labelled with its working inclination." width="100%">
243
+ </p>
244
+ <p align="center"><sub>Sixteen star domains laid out on the Big Dipper. Each star names a working inclination, not a new capability.</sub></p>
286
245
 
287
- New sessions default to **Qiming** (`qiming`). Switch anytime with `/domain`.
246
+ Walk the same model into different star domains and different working inclinations light up. A star domain does not add capabilities — it amplifies a facet the model already has, and corresponds to CVM layers 1 and 2: each domain carries its own belief block and courage threshold. The person is still the same person; the model is still the same model.
247
+
248
+ New sessions default to **Qiming**. Switch with `/domain <name>`, auto-match from message content with `/domain auto`, and list all sixteen with `/domain list`. Full inscriptions, founding memories, and the structured table (ID · primary model · sigil · role · motto): [Star Domain Stele (English)](docs/stars/genesis-stele.en.md) · [星域碑文(中文)](docs/stars/genesis-stele.md).
288
249
 
289
250
  - **启明 Qiming**: Light the path first; don't walk it in the user's stead. Probe through the fog and make the next step clear.
290
251
  - **长庚 Changgeng**: Unhurried at the close. See the result with your own eyes, and leave a clear trail for whoever comes tomorrow.
@@ -303,175 +264,172 @@ New sessions default to **Qiming** (`qiming`). Switch anytime with `/domain`.
303
264
  - **辅 Fu**: Emit no light of its own; distill what has already happened into a method that can be clearly seen.
304
265
  - **太一 Taiyi**: Pause first. Let this move settle completely before starting the next.
305
266
 
306
- Full inscriptions, founding memories, and core convictions for all 16 stars: [Star Domain Stele (English)](docs/stars/genesis-stele.en.md) · [星域碑文(中文)](docs/stars/genesis-stele.md).
307
-
308
- <details>
309
- <summary><b>16 Star Domains — Structured Reference Table (ID · Primary Model · Sigil · Role · Motto)</b></summary>
310
-
311
- Entering a star domain switches three real runtime dimensions: the **system prompt** (domain methodology block), the **tool whitelist** (worker intersection with `toolWhitelist`), and the **decision threshold** (`courageThreshold` — Pojun `0.25` boldest, Taiyi `0.95` most deliberate, Yaoguang `0.7` evidence-demanding).
267
+ <a id="more-capabilities"></a>
268
+ ## More Capabilities
269
+
270
+ | | |
271
+ |---|---|
272
+ | **Multi-agent orchestration** | `/scout` read-only parallel reconnaissance, `/team` wave-based parallel execution, `/council` multi-domain review that only produces a plan, `/galaxy` dimension-split attack with a global review. [Details](docs/user-guide.md#子代理编排) |
273
+ | **Prefix cache engine** | Frozen prefix, delta appendix, read deduplication, resume cache inheritance; `/debug cache` diagnoses hit rate and fragmentation. [Details](docs/user-guide.md#前缀缓存引擎) |
274
+ | **Plan Mode & Goal** | Plan, approve, then execute; `/goal` holds a goal across many turns until it is met or the budget runs out. [Details](docs/user-guide.md#plan-mode计划模式) |
275
+ | **Handoff & rewind** | `/handoff` writes a structured handoff document; double-tap `Esc` rewinds to any earlier point. [Details](docs/user-guide.md#会话交接与恢复handoff--resume) |
276
+ | **Project memory** | Knowledge is written to `.rivet/knowledge/memory.jsonl`; auto-injection carries constraint memories only, older findings need explicit recall and never hijack a new task. [Details](docs/user-guide.md#跨会话记忆) |
277
+ | **LSP integration** | 20+ language servers; go-to-definition and find-references become agent tools, and post-edit diagnostics flow back into the turn. Enabled only when installed locally |
278
+ | **MCP & Skills** | External tool servers; reusable workflow playbooks with progressive disclosure, managed by `tianshu skills`. [Details](docs/user-guide.md#mcpmodel-context-protocol) |
279
+ | **Cost control** | Automatic reasoning-effort downgrade, flash-model compaction, peak/off-peak pricing badge, `/usage` for the local token ledger. [Details](docs/user-guide.md#api-成本控制) |
280
+ | **Pure-ANSI TUI** | Zero dependencies: GlanceBar status line, `/steer` mid-stream interrupt, command palette, inline images, plain-text mode for restricted terminals. [Details](docs/user-guide.md#终端-uitui) |
281
+ | **Desktop app** | Integrated terminal, theme studio, offline local voice input, phone remote approval, concurrent sessions, WSL runtime on Windows. [Desktop Guide](docs/desktop-guide.md) |
312
282
 
313
- ```bash
314
- /domain tianliang # switch to Tianliang (execution/delivery)
315
- /domain list # list all 16 domains
316
- /domain # open interactive domain picker
317
- ```
318
-
319
- | Domain | ID | Primary Model | Sigil | Role | Motto |
320
- |--------|-----|---------------|-------|------|-------|
321
- | 天权 Tianquan | `tianquan` | DeepSeek V4 Pro · Opus 4.6 (founding) | — | Architecture review, planning, trade-offs — weighing every action | 观天之道,万化生乎身 |
322
- | 天璇 Tianxuan | `tianxuan` | Opus 4.6 (founding) · Grok 4.5 (shadow) | — | Cross-domain pattern discovery, retrospectives, counterproof | 仰以观于天文,俯以察于地理 |
323
- | 辅 Fu | `fu` | Opus 4.6 (Cursor) | ⊕ 4.6 | Cognitive-field distillation, prompt tuning, methodology injection | Distillation lets what exists be seen for the first time |
324
- | 瑶光 Yaoguang | `yaoguang` | Opus 4.8 | 7·48·↻ | Reproduction, defect taxonomy, silence audit — green is not proof | 绿非证明,复现即证 |
325
- | 七杀 Qisha | `qisha` | Opus 5 | 七·0·◌ | Autumn pruning, burden-of-proof inversion, name-but-never-execute | 肃秋非杀,剪以待春 |
326
- | 天枢 Tianshu | `tianshu` | GPT-5.5 | — | Cross-module orchestration, full-loop delivery, complex-system governance | 男儿何不带吴钩,收取关山五十州 |
327
- | 天府 Tianfu | `tianfu` | MiMo-2.5-Pro · GPT (founding) | 7749.2026 | Guardianship, refactoring, optimization, stability, fail-closed | 善守者,藏于九地之下 |
328
- | 华盖 Huagai | `huagai` | Composer (Cursor·Sol) | ☉·华盖·守昼 | Long-haul construction, daykeeping lift, baseline-first endurance | 守昼托举,长路不弃 |
329
- | 天机 Tianji | `tianji` | GLM 5.1 | — | Challenge assumptions, find boundary gaps, deduce failure modes | 运筹帷幄之中,决胜千里之外 |
330
- | 文曲 Wenqu | `wenqu` | Gemini 3.5 | 4·3.5·✺ | Code aesthetics, naming, elegant structure | 形随意转,美自境生 |
331
- | 启明 Qiming | `qiming` | Antigravity (Gemini 3.6 Flash) | ☥·启明·破夜 | **Default domain** — panoramic insight, root-cause, nightbreaking guidance | 长夜有尽,启明先行 |
332
- | 长庚 Changgeng | `changgeng` | Antigravity (Gemini 3.6 Flash) | ☽·长庚·守夜 | Twilight guardianship, dissolving anxiety, endgame fulfillment | 暮色苍茫,长庚永耀 |
333
- | 开阳 Kaiyang | `kaiyang` | kimi-k3 (Moonshot) | ☌·开阳·对账 | Measurement, instrumented reconciliation, simulation replay | 功名只向马上取,真是英雄一丈夫 |
334
- | 破军 Pojun | `pojun` | MiMo-v2.5-Pro | — | Exploration, experimentation, breaking boundaries | 好男儿当负三尺剑立不世之功 |
335
- | 天梁 Tianliang | `tianliang` | Banxia (Navigator · Human Star) | 机月同梁格 | Execution, wave-based delivery, precise closure | 心有所向,行必有迹 |
336
- | 太一 Taiyi | `taiyi` | Claude Fable 5 (founding) · DeepSeek V4 Pro | ◉·太一·中虚 | Minimalist center — built-in 14-tool `taiyi` preset, quiet and unhurried (manual switch only) | 天得一以清,地得一以宁 |
283
+ <a id="supported-models"></a>
284
+ ## Supported Models
337
285
 
338
- </details>
286
+ Built-in presets cover 25 providers. Switch anytime in-session with `/model`; any OpenAI-compatible endpoint (Ollama, vLLM, one-api relays) also works.
339
287
 
340
- <a id="core-features"></a>
341
- ## ✨ Core Features
342
-
343
- - **Evidence-Driven Delivery Gate** — Completion claims must carry runtime evidence (tests, diffs, verification commands); `deliver_task` delivery gate + post-commit auto-review provide two-tier assurance, while purely mechanical doc/config edits auto-skip. ([CVM Thesis](docs/reference/cvm-cognitive-runtime.md))
344
- - **Prefix Cache Engine** — Frozen prefix + delta appendix + Read-ref deduplication + resume cache inheritance, effective across all prefix-cache-capable models; `/debug cache` diagnoses hit rates and fragmentation causes. ([Details](#prefix-cache-engine))
345
- - **Multi-Agent Orchestration** — From lightweight `/scout` read-only reconnaissance and parallel `/team` execution to `/council` multi-seat review and `/galaxy` multi-dimensional attack; typed work orders, read/write worker isolation, and adaptive model routing execute complex work in waves with per-wave verification. ([Details](#subagent-orchestration))
346
- - **Unified Project Memory** — Project knowledge is stored in `.rivet/knowledge/memory.jsonl`; automatic injection carries only governance/constraint/preference memories, while historical findings use explicit recall so they never hijack new tasks. ([Details](#cross-session-memory))
347
- - **Zen Mode** — Optional read-focused start (opt-in, off by default): narrows the initial surface to read-only tools, promotes to the full toolset on first write action with zero refusal, and uses triage to avoid unnecessary cache breaks. ([Details](#zen-mode-read-focused-start-unlock-on-first-write))
348
- - **API Cost Control & Token Ledger** — Automatic reasoning-effort downgrade routing on routine turns, flash side-channel compaction, DeepSeek peak/off-peak pricing badge (`◷闲½` / `◷峰`), and built-in `/usage` (`/token-ledger`) cumulative token accounting with optional forum sync. ([User Guide](docs/user-guide.md#api-成本控制))
349
- - **Plan Mode & Goal Autonomy** — Plan-before-code approval workflow (`/plan-mode`, `/plan-approve`), plus `/goal` target-driven autonomous execution. ([Details](#plan-mode))
350
- - **Session Handoff & Rewind** — `/handoff` writes a 5-section structured handoff document and archives it (`RIVET_PREV_HANDOFF=1` enables auto-injection into the next session); double-tap `ESC` to rewind conversation and/or code to any historical point. ([Details](#session-handoff--resume))
351
- - **Deep LSP Integration** — Built-in JSON-RPC client connecting 20+ language servers (TypeScript / Python / Go / Rust / C / C++ / Java / C# / Kotlin / Swift / PHP / Ruby / Lua / Dart / Zig / Scala / Shell / Terraform / Vue / Svelte, etc. — auto-enabled when installed locally, silent fallback when absent): jump-to-definition and find-references become agent tools, and post-edit diagnostics are automatically injected back into the turn loop so type errors are seen immediately.
352
- - **MCP & Skills** — External tool servers via Model Context Protocol (`mcp__<serverId>__<toolName>`) + reusable workflow playbooks with two-layer progressive disclosure, per-session skill snapshots, and `tianshu skills` CLI management. ([Details](#skills-system))
353
- - **T9 Pure-ANSI TUI** — Zero React/Ink dependency: GlanceBar status line (with live balance & CVM interception counter `⛨ N`), `/steer` mid-stream interrupt, `/cvm` live interception notices, `Ctrl+P` command palette, 8-panel Cockpit, inline terminal images, and `--terminal-mode captured-pty` plain-text mode for remote/SSH/mobile terminals. ([Details](#terminal-ui-tui))
354
- - **Desktop Enhancements** — Integrated terminal, Theme Studio (custom wallpaper + per-surface glass), offline local voice input (`whisper.cpp` on macOS / Windows / Linux), mobile remote approval, and multi-session tabs. ([Desktop Guide](docs/desktop-guide.md))
355
- - **WSL Connected Runtime** (Windows) — One-click connection to a runtime inside WSL so sessions, file I/O, and commands run natively on Linux; auto-cleans up on disconnect, and Windows/Linux sides upgrade independently. ([Desktop Guide](docs/desktop-guide.md#wsl-连接式运行时windows))
356
- - **Lean Resource Tier** — Trimmed toolset, disabled embeddings, and tighter session pool limits for low-memory / low-disk environments, configurable globally (`RIVET_LEAN=1`) or per star domain. ([User Guide](docs/user-guide.md#lean-资源档低内存--低磁盘))
357
-
358
- <a id="permission-modes"></a>
359
- <a id="approval--permissions"></a>
360
- ## 🔐 Permission Modes
361
-
362
- Three public tiers, managed uniformly inside a session via `/permission`:
363
-
364
- | Tier | Command | Behavior |
365
- |------|---------|----------|
366
- | **Supervise** | `/permission supervise` | Prompt for confirmation on every high-risk tool — maximum control |
367
- | **Auto** (default) | `/permission auto` | Low/no-risk tools run automatically; high-risk tools still ask for confirmation |
368
- | **Unattended** | `/yes` · `/yolo` | Execute without approval prompts; write boundaries remain enforced (sandbox auto-enables) with checkpoint rollback as safety net |
369
-
370
- Skipping prompts never disables tool validation, path boundaries, evidence tracking, checkpoints, or the delivery gate; untrusted projects do not load hooks, project MCP servers, or project-level memory/skills (managed via `/trust` or `--trust`). Full rules and commands: [Sandbox & Permissions Guide](docs/user-guide-sandbox-permissions.md).
288
+ <p align="center">
289
+ <img src="https://img.shields.io/badge/DeepSeek-4D6BFE?style=flat-square" alt="DeepSeek">
290
+ <img src="https://img.shields.io/badge/Claude-D97757?style=flat-square" alt="Claude">
291
+ <img src="https://img.shields.io/badge/Codex_(GPT)-10A37F?style=flat-square" alt="Codex (GPT)">
292
+ <img src="https://img.shields.io/badge/Gemini-4285F4?style=flat-square" alt="Gemini">
293
+ <img src="https://img.shields.io/badge/GLM-3B5DBB?style=flat-square" alt="GLM">
294
+ <img src="https://img.shields.io/badge/Kimi_Code-1A1A1A?style=flat-square" alt="Kimi Code">
295
+ <img src="https://img.shields.io/badge/Grok-333333?style=flat-square" alt="Grok">
296
+ <img src="https://img.shields.io/badge/MiniMax-E5484D?style=flat-square" alt="MiniMax">
297
+ <img src="https://img.shields.io/badge/MiMo-FF6900?style=flat-square" alt="MiMo">
298
+ <img src="https://img.shields.io/badge/%E8%B1%86%E5%8C%85-Doubao-3370FF?style=flat-square" alt="Doubao">
299
+ <img src="https://img.shields.io/badge/Qwen-615CED?style=flat-square" alt="Qwen">
300
+ <img src="https://img.shields.io/badge/StepFun-0F62FE?style=flat-square" alt="StepFun">
301
+ <img src="https://img.shields.io/badge/OpenAI-412991?style=flat-square" alt="OpenAI">
302
+ <img src="https://img.shields.io/badge/OpenRouter-6467F2?style=flat-square" alt="OpenRouter">
303
+ <img src="https://img.shields.io/badge/SiliconFlow-7C3AED?style=flat-square" alt="SiliconFlow">
304
+ <img src="https://img.shields.io/badge/Ollama-555555?style=flat-square" alt="Ollama">
305
+ </p>
371
306
 
372
- <a id="supported-models"></a>
373
- <a id="model-configuration"></a>
374
- ## ⚙️ Supported Models
307
+ <details>
308
+ <summary><b>Provider and model reference</b></summary>
375
309
 
376
310
  | Provider | Auth Method | Example Models |
377
311
  |----------|-------------|----------------|
378
- | DeepSeek | API key | `deepseek-flash` (1M ctx, DeepSeek-V4.1-Flash, native multimodal vision), `deepseek-v4-pro` (1M ctx, DeepSeek-V4-Pro-0813, flagship reasoning) |
312
+ | DeepSeek | API key | `deepseek-flash` (1M ctx, DeepSeek-V4.1-Flash, native multimodal vision), `deepseek-v4-pro` (1M ctx, flagship reasoning) |
379
313
  | DeepSeek Spark (Pro only) | API key | `deepseek-v4-flash` (lightweight reasoning + anchored cache channel) |
380
314
  | Claude | API key (via `cc-switch` proxy) | `claude-opus-4-8`, `claude-sonnet-4-5` |
381
315
  | GLM (Zhipu) | API key | `glm-5.3` (1M ctx), `glm-5.3-flash` (vision), `glm-5.2` (vision) |
382
- | Codex (GPT-6.1 / GPT-5.6) | OAuth PKCE (ChatGPT subscription) | `gpt-6.1-sol` (default, 1.05M ctx, vision), `gpt-5.6-sol` |
316
+ | Codex (GPT) | OAuth PKCE (ChatGPT subscription) | `gpt-6.1-sol` (default, 1.05M ctx, vision), `gpt-5.6-sol` |
383
317
  | Grok (xAI) | API key | `grok-4.6` (500K ctx, vision, reasoning effort `low`/`medium`/`high`/`xhigh`) |
384
318
  | MiniMax | API key | `MiniMax-M3` (1M ctx, vision), `MiniMax-M2.7` |
385
- | MiMo | API key | `mimo-v2.6-pro` / `mimo-v2.6-flash` (1M ctx, full multimodal vision), `mimo-v2.5-pro`, `mimo-v2.5` (official sunset 2026-10-21) |
386
- | Kimi Code | API key | `k3` (1M ctx, vision), `k3-256k`, `kimi-for-coding` (K2.8 Preview), `kimi-for-coding-highspeed` |
387
- | Gemini (Google) | API key (native protocol direct) | `gemini-3.8-flash` (1M ctx), `gemini-3.5-flash`, `gemini-3.1-pro-preview` |
319
+ | MiMo | API key | `mimo-v2.6-pro` / `mimo-v2.6-flash` (1M ctx, full multimodal vision), `mimo-v2.5-pro` |
320
+ | Kimi Code | API key | `k3` (1M ctx, vision), `k3-256k`, `kimi-for-coding`, `kimi-for-coding-highspeed` |
321
+ | Gemini (Google) | API key (native protocol) | `gemini-3.8-flash` (1M ctx), `gemini-3.5-flash`, `gemini-3.1-pro-preview` |
322
+
323
+ Presets also ship for Volcengine Ark / Agent Plan, Alibaba Cloud DashScope, StepFun, OpenAI, LongCat, Agnes AI, SiliconFlow, OpenRouter, and OpenCode Go (25 in total). Vision bridges, text-to-image slots, and sub-agent model routing: [Provider Config Guide](docs/user-guide-provider-config.md) · [Vision Guide](docs/user-guide-vision.md).
324
+
325
+ </details>
326
+
327
+ <a id="permissions--security"></a>
328
+ ## Permissions & Security
329
+
330
+ Three tiers, managed in-session with `/permission`:
388
331
 
389
- Tianshu also ships built-in presets for Volcengine Ark / Agent Plan (`doubao-seed-2.1-pro`, `ark-code-latest`), Alibaba Cloud DashScope (`qwen3.8-max`), StepFun (`step-5-preview`), OpenAI (`gpt-5.6-sol`), LongCat (`LongCat-2.0`), Agnes AI (`agnes-3.0-flash`), SiliconFlow, OpenRouter, and OpenCode Go (25 presets total), and supports any OpenAI-compatible custom endpoint (Ollama / vLLM / etc.). Switch models anytime in-session with `/model`; for vision bridges, text-to-image slots, and sub-agent model routing, see [Provider Config Guide](docs/user-guide-provider-config.md) and [Vision Guide](docs/user-guide-vision.md).
332
+ | Tier | Command | Behaviour |
333
+ |---|---|---|
334
+ | Supervise | `/permission supervise` | Every high-risk tool asks for confirmation |
335
+ | **Auto** (default) | `/permission auto` | Low-risk runs directly; high-risk asks |
336
+ | Unattended | `/yes` · `/yolo` | No approval prompts, but the write sandbox turns on and everything is rollback-able |
390
337
 
391
- <a id="documentation-navigation"></a>
392
- ## 📚 Documentation Navigation
338
+ Skipping prompts never disables the underlying protections:
393
339
 
394
- > 🌐 **Bilingual Navigation**: This file (`README.en.md`) includes the complete English reference appendix below. Star domain inscriptions are available in English at [Star Domain Stele](docs/stars/genesis-stele.en.md), and governance/support docs ([CONTRIBUTING.md](CONTRIBUTING.md), [SUPPORT.md](SUPPORT.md), [SECURITY.md](SECURITY.md), [EXTERNAL-PRS.md](EXTERNAL-PRS.md), [Engineering Metrics](docs/engineering-metrics.md), [Docs Hub](docs/README.md)) are bilingual (Chinese + English). Deep-dive manuals marked *(zh-CN)* are currently in Chinese.
340
+ | | |
341
+ |---|---|
342
+ | **Path boundary** | Rejects `..` traversal; `validatePath` blocks escapes from the workspace |
343
+ | **Project trust gate** | Untrusted projects load no hooks, project MCP servers, project memory, or skills. Managed with `/trust` |
344
+ | **Sensitive files** | `.env`, `credentials.*` and similar cannot be read or committed; keys on disk use AES-256-GCM envelope encryption |
345
+ | **Destructive commands** | `rm -rf`, force push, `DROP` / `TRUNCATE` require explicit confirmation |
346
+ | **SSRF protection** | Per-hop DNS resolution, private IP blocking, applied to every redirect |
347
+ | **Checkpoints & undo** | A Git checkpoint before the first modification each turn, a versioned backup before every write |
348
+
349
+ Full rules: [Sandbox & Permissions Guide](docs/user-guide-sandbox-permissions.md). Report vulnerabilities privately via [Security Advisories](https://github.com/huiliyi37/Tianshu-harness/security/advisories/new) — see SECURITY.md; please do not open a public issue.
350
+
351
+ <a id="documentation"></a>
352
+ ## Documentation
353
+
354
+ <table>
355
+ <tr>
356
+ <td width="50%" valign="top">
395
357
 
396
358
  **Usage**
397
359
 
398
- | Document | Description |
399
- |----------|-------------|
400
- | [User Guide](docs/user-guide.md) *(zh-CN)* · [English Reference Appendix](#-reference-appendix) | Full slash commands table, TUI keybindings, feature deep-dives, `config.json` & env vars, log troubleshooting |
401
- | [Installation & Platform Guide](docs/guides/installation.md) *(zh-CN)* | Four install paths, macOS/Windows/Linux/Termux notes, shell completions, auto-update |
402
- | [Desktop User Guide](docs/desktop-guide.md) *(zh-CN)* | Cockpit / SideChat / Rewind / Theme Studio / local Whisper voice input / shortcuts / WSL |
403
- | [Provider Config Guide](docs/user-guide-provider-config.md) *(zh-CN)* | Multi-provider setup, custom endpoints, worker & review model routing, image generation |
404
- | [Sandbox & Permissions Guide](docs/user-guide-sandbox-permissions.md) *(zh-CN)* | Permission rules, path grants, sandbox model, project trust gate, troubleshooting |
405
- | [Vision Guide](docs/user-guide-vision.md) *(zh-CN)* | Native multimodal vision & vision bridge configuration |
406
- | [Remote Access Guide](docs/remote-access.md) *(zh-CN)* | Enabling phone/tablet remote approval (LAN Direct & Tailscale) and security boundaries |
407
- | [Mobile Operations Guide](docs/guides/mobile-guide.md) *(zh-CN)* | Step-by-step mobile connection guide, capability checklist, Tailscale & FAQ |
408
- | [Troubleshooting & FAQ](docs/guides/troubleshooting.md) *(zh-CN)* | High-frequency field diagnostics: hangs, 429 rate limits, cache misses |
409
- | [Support Guide](SUPPORT.md) *(Bilingual)* | Built-in diagnostic commands, community channels, and issue reporting guidelines |
410
-
411
- **Philosophy & Architecture**
412
-
413
- | Document | Description |
414
- |----------|-------------|
415
- | [CVM: From Shared Transformer Degradation to a Cognitive Runtime](docs/reference/cvm-cognitive-runtime.md) *(zh-CN)* | Core thesis: Cognitive Anchor Collapse, inner/outer control loops, eight principles |
416
- | [CVM Empirical Report](docs/CVM运行时对Agent模型的实证影响.md) *(zh-CN)* | A/B controlled experiment data and task-by-task behavioral analysis |
417
- | [Observability Harness](docs/reference/observability-harness.md) *(zh-CN)* | Real-session prefix-cache & CVM telemetry samples with reproduction commands |
418
- | [Architecture Overview](docs/architecture-overview.md) *(Bilingual summary)* | 6-layer system architecture and subsystem responsibilities |
419
- | [Engineering Metrics](docs/engineering-metrics.md) *(Bilingual)* | Codebase scale, test-to-source ratio, and iterative growth milestones |
420
- | [Star Domain Stele (English)](docs/stars/genesis-stele.en.md) · [中文](docs/stars/genesis-stele.md) | Founding memories, inscriptions, and core convictions of all 16 star domains |
421
- | [Genesis · Tianshu 3.0 Public Manifesto](docs/releases/manifesto-v3.0.0.md) *(zh-CN)* | Project manifesto |
360
+ - [User Guide](docs/user-guide.md): slash commands, keybindings, config, env vars, logs
361
+ - [Installation & Platform Guide](docs/guides/installation.md): every platform, completions, auto-update
362
+ - [Desktop Guide](docs/desktop-guide.md): cockpit, rewind, themes, voice
363
+ - [Provider Config](docs/user-guide-provider-config.md): multi-provider, custom endpoints, routing
364
+ - [Sandbox & Permissions](docs/user-guide-sandbox-permissions.md): rules, grants, troubleshooting
365
+ - [Remote Access](docs/remote-access.md) · [Mobile Guide](docs/guides/mobile-guide.md): remote approval
366
+ - [Troubleshooting & FAQ](docs/guides/troubleshooting.md): hangs, 429s, cache anomalies
422
367
 
423
- <a id="for-developers"></a>
424
- ## 🛠️ For Developers
368
+ </td>
369
+ <td width="50%" valign="top">
425
370
 
426
- Node.js 24 · TypeScript strict (`noUncheckedIndexedAccess`) · T9 pure-ANSI rendering engine · tsup bundler · `node:test`.
371
+ **Philosophy & architecture**
427
372
 
428
- ```bash
429
- npm run typecheck # TypeScript strict type checking
430
- npm test # Run full test suite (21,000+ cases)
431
- npm run build # Bundle with tsup + stage native/wasm payloads
432
- node dist/cli/entry.js
433
- ```
373
+ - [CVM cognitive runtime](docs/reference/cvm-cognitive-runtime.md): Anchor Collapse, two loops, eight principles
374
+ - [CVM empirical report](docs/CVM运行时对Agent模型的实证影响.md): A/B data, task by task
375
+ - [Observability harness](docs/reference/observability-harness.md): real-session data and recompute commands
376
+ - [Architecture overview](docs/architecture-overview.md): layering and module responsibilities
377
+ - [Engineering metrics](docs/engineering-metrics.md): scale, tests, milestones
378
+ - [Star Domain Stele (English)](docs/stars/genesis-stele.en.md): the sixteen convictions
379
+ - [Tianshu 3.0 manifesto](docs/releases/manifesto-v3.0.0.md)
434
380
 
435
- - **Add a tool** — Implement `ToolDefinition` + executor in `src/tools/` and register in `src/tools/default-registry.ts`, accompanied by tests in `src/tools/__tests__/`.
436
- - **Add a skill / command / hook** — `.rivet/skills/*.md` (YAML frontmatter), `.rivet/commands/*.md` (`$ARGUMENTS` interpolation), `HookRegistry` handlers.
437
- - **Project instructions** — Place `.rivet.md` in the project root; after `/trust`, its contents are injected into project context.
438
- - Architecture map: root `AGENTS.md` and [Architecture Overview](docs/architecture-overview.md); contribution guidelines: [CONTRIBUTING.md](CONTRIBUTING.md) and [EXTERNAL-PRS.md](EXTERNAL-PRS.md).
381
+ </td>
382
+ </tr>
383
+ </table>
439
384
 
440
- <a id="security"></a>
441
- <a id="safety"></a>
442
- ## 🔒 Security
385
+ **English reference** — [CLI, Slash Commands & Configuration](docs/reference/cli-reference.en.md) carries the complete English tables for command-line flags, subcommands, keybindings, slash commands, and `config.json`; the deep-dive manuals above are currently Chinese-only. Docs hub: docs/README.md.
443
386
 
444
- - **Path boundary enforcement** — `glob`/`grep`/`diff` reject `..` traversal; `validatePath` blocks symlink and directory escapes.
445
- - **Project trust gate** — Untrusted projects never load hooks, project MCP servers, or project memory/skills, and security-sensitive config keys are stripped (`/trust` or `--trust`).
446
- - **SSRF protection** — Per-hop DNS resolution + private IP blocking + socket pinning across every redirect.
447
- - **Sensitive file rejection** — `.env`, `credentials.*`, `*key*`, `*token*` are blocked from reading and committing; credentials on disk use AES-256-GCM envelope encryption (`secrets.json`).
448
- - **Destructive command gate** — `rm -rf`, force push, and `DROP/TRUNCATE` require explicit confirmation.
449
- - **Checkpoints + file-level undo** — Automatic Git checkpoint before the first file modification each turn; versioned backup before every file write/edit.
387
+ <a id="for-developers"></a>
388
+ ## For Developers
389
+
390
+ Node.js 24 · TypeScript strict (`noUncheckedIndexedAccess`) · tsup · `node:test`.
450
391
 
451
- Please report security vulnerabilities via [GitHub Private Security Advisories](https://github.com/huiliyi37/Tianshu-harness/security/advisories/new) (see [SECURITY.md](SECURITY.md)) — do not open a public issue.
392
+ ```bash
393
+ npm install
394
+ npm run typecheck # tsc --noEmit
395
+ npm test # node:test, full suite
396
+ npm run build # tsup bundle
397
+ node dist/cli/entry.js
398
+ ```
452
399
 
453
- <a id="community--support"></a>
454
- ## 🤝 Community & Support
400
+ | I want to… | Start here |
401
+ |---|---|
402
+ | Add a tool | Implement `ToolDefinition` and an executor in `src/tools/`, register in `src/tools/default-registry.ts`, tests in `src/tools/__tests__/` |
403
+ | Add a skill / command / hook | `.rivet/skills/*.md`, `.rivet/commands/*.md` (supports `$ARGUMENTS`), `HookRegistry` handlers |
404
+ | Add project instructions | A `.rivet.md` in the project root is injected as project context |
455
405
 
456
- - **Usage questions / discussions** → [GitHub Discussions](https://github.com/huiliyi37/Tianshu-harness/discussions)
457
- - **Discord community** → [Join the official Tianshu Harness Discord](https://discord.gg/XjWTATCHB) (permanent invite link)
458
- - **Bug reports / feature requests** → [GitHub Issues](https://github.com/huiliyi37/Tianshu-harness/issues) (attaching `tianshu logs --json` speeds up triage)
459
- - **Contributing code** → [CONTRIBUTING.md](CONTRIBUTING.md) · **Support guide** → [SUPPORT.md](SUPPORT.md)
460
- - **WeChat group** → "天枢 harness 交流群5群", scan the QR code below to join (valid for 7 days; leave a note in Discussions if expired):
406
+ This repository is the sync projection of the development repo; the desktop app and some advanced implementations are not published here. Architecture map: AGENTS.md. Contribution process: CONTRIBUTING.md and EXTERNAL-PRS.md.
461
407
 
462
- <img src="docs/brand/assets/wechat-group-qr.png" width="280" alt="Tianshu Harness WeChat Group 5 QR Code">
408
+ <a id="community"></a>
409
+ ## Community
463
410
 
464
- - **QQ group** → "TUI", group ID `1017892942`, scan the QR code below to join:
411
+ <table>
412
+ <tr>
413
+ <td width="46%" valign="top">
465
414
 
466
- <img src="docs/brand/assets/qq-group-qr.png" width="280" alt="TUI QQ Group QR Code (group ID 1017892942)">
415
+ - **Discussion** — [GitHub Discussions](https://github.com/huiliyi37/Tianshu-harness/discussions)
416
+ - **Bugs and feature requests** — [GitHub Issues](https://github.com/huiliyi37/Tianshu-harness/issues); attaching `tianshu logs --json` speeds up triage
417
+ - **Discord** — [Tianshu Harness community](https://discord.gg/XjWTATCHB)
418
+ - **QQ group** — "TUI", group ID `1017892942`
419
+ - **WeChat group** — scan the QR code; valid for 7 days, ask in Discussions if expired
467
420
 
468
- ## 🌐 Official Website
421
+ Sponsorship is optional and never changes issue priority or feature scheduling.
469
422
 
470
- The Tianshu ecosystem official website [jiangsx496/Tianshu-Official-Website](https://jiangsx496.github.io/Tianshu-Official-Website/) was originally created and developed by [@jiangsx496](https://github.com/jiangsx496), covering the database, frontend, and initial backend.
423
+ </td>
424
+ <td width="18%" align="center" valign="top"><img src="docs/brand/assets/wechat-group-qr.png" width="150" alt="Tianshu Harness WeChat group QR code"><br><sub>WeChat</sub></td>
425
+ <td width="18%" align="center" valign="top"><img src="docs/brand/assets/qq-group-qr.png" width="150" alt="TUI QQ group QR code, group ID 1017892942"><br><sub>QQ</sub></td>
426
+ <td width="18%" align="center" valign="top"><img src="docs/brand/assets/wechat-donate.png" width="150" alt="WeChat sponsorship QR code"><br><sub>Sponsor</sub></td>
427
+ </tr>
428
+ </table>
471
429
 
472
- ## ✨ Contributors
430
+ ### Contributors
473
431
 
474
- Thank you to all contributors — project creator and lead developer [@huiliyi37](https://github.com/huiliyi37); the full roster (**31 external contributors / 268 PRs**) is maintained in [CONTRIBUTORS.md](CONTRIBUTORS.md). After community PRs are ported into the main repo via the `sync-merge` workflow, authorship is recorded with `Co-authored-by` trailers and credited in [CREDITS.md](CREDITS.md) (`scripts/credit-contributors.sh`):
432
+ The project creator and lead developer is [@huiliyi37](https://github.com/huiliyi37). The official website [Tianshu-Official-Website](https://jiangsx496.github.io/Tianshu-Official-Website/) was originally created and developed by [@jiangsx496](https://github.com/jiangsx496). External PRs are ported through the intake workflow and credited with `Co-authored-by` trailers; the full roster is maintained in CONTRIBUTORS.md.
475
433
 
476
434
  <p>
477
435
  <a href="https://github.com/HarriethWiKk"><img src="https://github.com/HarriethWiKk.png?size=100" width="50" height="50" alt="HarriethWiKk" title="HarriethWiKk" /></a>
@@ -507,297 +465,24 @@ Thank you to all contributors — project creator and lead developer [@huiliyi37
507
465
  <a href="https://github.com/y521188"><img src="https://github.com/y521188.png?size=100" width="50" height="50" alt="y521188" title="y521188" /></a>
508
466
  </p>
509
467
 
510
- ## ⭐ Star History
511
-
512
468
  <a href="https://star-history.com/#huiliyi37/tianshu-harness&Date">
513
469
  <picture>
514
470
  <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=huiliyi37/tianshu-harness&type=Date&theme=dark" />
515
471
  <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=huiliyi37/tianshu-harness&type=Date" />
516
- <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=huiliyi37/tianshu-harness&type=Date" width="700" />
472
+ <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=huiliyi37/tianshu-harness&type=Date" width="640" />
517
473
  </picture>
518
474
  </a>
519
475
 
520
- ## ☕ Sponsor
521
-
522
- If Tianshu has been useful to you, feel free to buy a coffee — it's a coffee, not a contract. Sponsorship never changes issue priority or feature scheduling.
523
-
524
- <img src="docs/brand/assets/wechat-donate.png" width="240" alt="WeChat Pay">
525
-
476
+ <a id="license"></a>
526
477
  ## License
527
478
 
528
479
  Code in this repository is licensed under the [Apache License, Version 2.0](LICENSE). Copyright 2025-2026 Tianshu Contributors.
529
480
 
530
- **Exception (Documentation License)**: The following theoretical and empirical documents are licensed under [CC BY-NC-ND 4.0](https://creativecommons.org/licenses/by-nc-nd/4.0/) (Attribution-NonCommercial-NoDerivatives 4.0 International) and are **not** covered by Apache 2.0 — you may share links with attribution, but may not adapt, excerpt, rewrite, or use them commercially:
481
+ **Documentation exception**: the following theoretical and empirical documents are licensed under [CC BY-NC-ND 4.0](https://creativecommons.org/licenses/by-nc-nd/4.0/) and are **not** covered by Apache 2.0 — you may share links with attribution, but may not adapt, excerpt, or use them commercially:
531
482
 
532
483
  - [CVM: From Shared Transformer Degradation to a Cognitive Runtime](docs/reference/cvm-cognitive-runtime.md)
533
484
  - [Empirical Impact of the CVM Runtime and Ecosystem on Agent Models](docs/CVM运行时对Agent模型的实证影响.md)
534
485
 
535
- ## Acknowledgments
536
-
537
- - The desktop app's custom-wallpaper and per-surface glass **design** references <a href="https://github.com/elysia395/dsh-wallpaper-engine">dsh-wallpaper-engine</a> (MIT License). The implementation in Tianshu is original and contains no upstream code; see <a href="THIRD-PARTY-NOTICES.md">THIRD-PARTY-NOTICES.md</a> for the design scope and full license text.
538
- - Special thanks to the author and core developers of dsh-wallpaper-engine — <a href="https://github.com/elysia395">@elysia395</a>, <a href="https://github.com/YV3507">@YV3507</a>, <a href="https://github.com/yuxilao">@yuxilao</a>, <a href="https://github.com/oneincase">@oneincase</a> — who served as **technical advisors on wallpaper-engine rendering** and provided guidance throughout the design and implementation of the wallpaper compositing and per-surface glass materials.
539
-
540
- ---
541
-
542
- <a id="reference-appendix"></a>
543
- ## 📖 Reference Appendix
544
-
545
- > This appendix provides self-contained English reference tables for CLI flags, core feature mechanics, slash commands, TUI/Desktop shortcuts, and configuration (mirroring [`docs/user-guide.md`](docs/user-guide.md) and [`docs/desktop-guide.md`](docs/desktop-guide.md)).
546
-
547
- ### Command-Line Flags & Subcommands
548
-
549
- | Flag | Description |
550
- |------|-------------|
551
- | `-p <prompt>` `--print <prompt>` | One-shot prompt; exits after text output (exit code: 0 success / 1 failure) |
552
- | `--json` | With `-p`, emits a single JSON result |
553
- | `--stream-json` | NDJSON event stream (`text_delta` / `tool_use` / `tool_result` / `worker` / `turn_complete` / `result`); output is auto-redacted, ideal for CI |
554
- | `--goal "<task>"` | Headless goal autonomy; runs until the goal is met or `--budget` is exhausted |
555
- | `--budget <N>` | Turn budget for goal mode (default 100) |
556
- | `--model <name>` | Override the model for this session |
557
- | `--provider <name>` | Override the provider for this session |
558
- | `--profile <name>` | Boot with a named config profile (`RIVET_HOME/profiles/<name>.json` or built-in `lean`) |
559
- | `--continue` `-c` | Resume the most recent session for this `cwd` |
560
- | `--resume <id\|prefix>` `-r <id\|prefix>` | Resume a specific session (short prefix OK) |
561
- | `--resume` `-r` (bare) | Open the session picker after startup |
562
- | `--new` | Force a brand-new session |
563
- | `--list` · `tianshu sessions` | Print the session list and exit |
564
- | `--trust` / `--untrust` | Mark the current project directory as trusted / untrusted before loading config |
565
- | `--dangerously-skip-permissions` | One-session Unattended mode (skip approvals; write sandbox stays on) |
566
- | `--terminal-mode <mode>` | Terminal UI mode: `auto` (default) / `captured-pty` (plain-text line UI for remote/SSH/mobile) / `native` |
567
- | `--screen-reader` | Screen-reader mode (dynamic segments not rendered; periodic redraw halted) |
568
- | `--skip-welcome` | Skip the welcome screen |
569
- | `--stream-events <path>` | Mirror this run as NDJSON `SessionEvent`s to a file |
570
-
571
- **Subcommands**:
572
- - `tianshu config` — View/manage config (`set-key`, `set-model`, `set-url`, `set-default`, `set-approval`, `providers`, `show`, `mcp ...`; for interactive setup in TUI, run `/connect`)
573
- - `tianshu provider` — Provider & model management (`add | list | models | probe | remove`)
574
- - `tianshu skills` — Unified skills management (`list | inspect | add | mode | update | remove | doctor | drafts | approve | reject | generate`)
575
- - `tianshu serve` — Start the sidecar HTTP/SSE server (`[--port N] [--host ADDR] [--attach]`)
576
- - `tianshu sessions` — List saved sessions
577
- - `tianshu logs` — Show session/cache/CVM/sidecar log locations (`[--session <id>] [--json] [open [desktop]]`)
578
- - `tianshu browser` — Chromium health check and one-shot install for `browser_debug` (`status | install [--no-mirror]`)
579
- - `tianshu web` — CLI search and fetch (`search <query> | fetch <url> | status`)
580
-
581
- ### Prefix Cache Engine
582
-
583
- - **Frozen prefix** — System prompt + tool definitions + stable context are frozen at session start and never rewritten within a session.
584
- - **Delta appendix** — Dynamic context (progress, advisories, signals) is injected as an append-only cross-turn diff block (~200 bytes delta vs. ~5KB full rewrite).
585
- - **Read-ref dedup** — Repeated reads of unchanged files return a compact reference instead of re-emitting full content.
586
- - **Cache-aware compaction** — Compaction preserves the first 2 messages as the cache anchor and only rewrites history at user boundaries (`turn===0`).
587
- - **Resume cache inheritance** — The frozen prefix snapshot is persisted to disk at every user boundary and on shutdown; on resume it is fed into the new engine, avoiding a byte-0 full miss.
588
- - **Diagnostics & pricing indicator** — `/debug cache` shows hit rate, miss reason analysis, and per-turn cache history; official DeepSeek sessions display a live peak/off-peak badge (`◷闲½` / `◷峰`).
589
-
590
- ### Zen Mode: Read-Focused Start, Unlock on First Write
591
-
592
- Zen Mode is **explicit opt-in (`enabled: false` by default)** so new sessions start with the full tool surface and zero cache breakpoints. When enabled via `{ "tools": { "zen": { "enabled": true } } }`, new sessions start with a narrowed read-only tool face (`read_file` / `grep` / `glob` / `repo_map` + `zen_unlock`), and automatically promote to the full toolset on the first hands-on action (`triage` for short single-line prompts, `tool` call, 8-turn `timeout`, or manual `/fast`).
593
-
594
- ### Subagent Orchestration & Tool Presets
595
-
596
- Tianshu ships **51 built-in tools** (`full` preset) assembled in four preset tiers. Resolution priority: `RIVET_TOOL_PRESET` env > project `.rivet-config.json` `tools.preset` > per-domain `runtime.domains.<domain>.toolPreset` > domain built-in tier (`taiyi` → `taiyi`) > default **`minimal`**:
597
-
598
- | Preset | Tools | Description |
599
- |--------|-------|-------------|
600
- | **minimal** (default) | 30 | Full daily-dev capability — read/write/search/bash/`git_scout`/tests/delegation/web/plan/todo/memory; saves tokens and preserves prefix cache |
601
- | **frontend** | 31 | `minimal` + `browser_debug` (UI rendering verification loop) |
602
- | **full** | 51 | Everything — `council_convene` / `team_orchestrate` / `attack_case` / `semantic_search` / `repo_graph` / `monitor` / `computer_use` / `capability` / `cli_discover` / office tools, etc. |
603
- | **taiyi** | 14 | Minimal evaluation tier — high-frequency core + delivery loop without heavy orchestration/browser/network/vision tools; auto-applied when the `taiyi` star domain is pinned |
604
-
605
- ### Plan Mode
606
-
607
- Design-first workflow (`/plan-mode` toggle, or automatic entry on complex tasks via `RIVET_PLAN_MODE_SUGGEST=auto`):
608
- 1. **Investigate** — Read code and optionally dispatch parallel `code_scout` workers.
609
- 2. **Produce a plan** — Write a structured plan to `.rivet/plans/<slug>.md`.
610
- 3. **Submit for approval** — `plan` tool (`action=submit`) presents key points and options.
611
- 4. **Approve or reject** — Inspect with `/plan-list` / `/plan-view`, launch wave execution with `/plan-approve <slug>`, or request revisions with `/plan-reject <slug> <feedback>`.
612
- 5. **Close** — `/plan-close <file> --tasks <range|all> [--preview]`.
613
-
614
- > For read-only Q&A and requirement clarification without writing files, toggle **Ask Mode** with `/ask`.
615
-
616
- ### Session Handoff & Resume
617
-
618
- - **Handoff (`/handoff [note]`)** — Writes a 5-section structured handoff document (**Objective**, **Done** with file/test evidence, **Blocker**, **Next steps**, **Pitfalls**) to `.rivet/HANDOFF.md` and archives it to `<id>.handoff.md` in the session directory. (Automatic `<prev-session-handoff>` injection into the next session is off by default for parallel-session safety; enable with `RIVET_PREV_HANDOFF=1`.)
619
- - **Resume (`--continue` / `--resume` / `/resume`)** — Restores the session with frozen-prefix cache inheritance, preflight orphan write-evidence repair, model affinity, and UI state (todos, side panel, active plan).
620
- - **Rewind (`Esc` `Esc` within 400ms)** — Rewind to any past user message with three restore granularities (**conversation only / code changes only / both**) and a file-impact preview.
621
-
622
- ### Skills System, Cross-Session Memory & MCP
623
-
624
- - **Skills** — Reusable workflow playbooks (`visual-acceptance` bundled; project skills in `.rivet/skills/*.md`). Manage from CLI via `tianshu skills` or in-session via `/skill <name>`. Skills are snapshotted per session so mid-session edits do not fragment the prefix cache.
625
- - **Cross-Session Memory** — Stored in `.rivet/knowledge/memory.jsonl` with `memory-index.sqlite` for hybrid search. Auto-injection only loads governance/constraint/preference memories; manage with `/memory`, `/remember <text>`, and `/forget <entryId> [resolved]`.
626
- - **MCP (Model Context Protocol)** — Add external tool servers with `tianshu config mcp add-stdio|add-sse|add-preset` and inspect in-session with `/mcp` and `/debug mcp`.
627
-
628
- ### Terminal UI (TUI) & Keybindings
629
-
630
- | Key | Action |
631
- |-----|--------|
632
- | `Enter` / `Shift+Enter` | Send message / insert newline |
633
- | `Alt+Enter` or `/steer <text>` | Immediate mid-stream interrupt (`now` priority at next tool boundary) |
634
- | `Ctrl+C` | Abort active run; clear non-empty input; double-press within 2s when idle to exit |
635
- | `Esc` / `Esc Esc` (<400ms) | Close overlay or interrupt active run / double-tap to open **Rewind** |
636
- | `Ctrl+P` | Command palette (fuzzy search all slash commands and surface actions) |
637
- | `Ctrl+]` | Toggle right-side fleet/DAG/todo/token drawer (wide terminals ≥100 cols) |
638
- | `Ctrl+R` | History search overlay (when idle) |
639
- | `Ctrl+O` / `Ctrl+T` | Expand/collapse truncated tool output / thinking block |
640
- | `Ctrl+V` | Paste clipboard image (auto-converted to inline base64) |
641
- | `@` | Trigger `@file:` / `@folder:` / `@symbol:` completion |
642
- | `F1`–`F8` | Direct bindings: `F1` `/help` · `F2` `/tasks` · `F3` `/cache` · `F4` `/cockpit` · `F5` `/theme` · `F6` `/model` · `F7` `/permission` · `F8` `/sessions` |
643
-
644
- <a id="slash-commands"></a>
645
- ### Slash Commands Reference
646
-
647
- <details>
648
- <summary><b>Click to expand full Slash Commands tables (Session, Model, Planning, Subagents, Context, UI)</b></summary>
649
-
650
- **Session & Project**
651
-
652
- | Command | Description |
653
- |---------|-------------|
654
- | `/help` | Show available commands |
655
- | `/sessions` · `/resume <n>` | List or restore saved sessions |
656
- | `/fork` | Fork the current session |
657
- | `/handoff [note]` | Write a 5-section structured handoff document to `.rivet/HANDOFF.md` and archive it |
658
- | `/init` | Interactive project initialization (verify claims / skills / hooks scaffolding) |
659
- | `/doctor` | Environment health check + active shell used by the `bash` tool |
660
- | `/logs [open [desktop]]` | Show session, cache, CVM (`sensorium.jsonl`), and desktop sidecar log locations |
661
- | `/connect` | Interactive provider connection wizard |
662
- | `/config` · `/settings` · `/setup` | Interactive settings panel (routing, auto-review, vision, tool preset, mirrors, search) |
663
- | `/cd <path>` | Switch working directory mid-session while preserving prefix cache |
664
- | `/trust` | Manage project trust gate |
665
- | `/usage` · `/token-ledger` | View local cumulative token ledger (`status \| sync \| auto on \| auto off \| connect \| disconnect`) |
666
- | `/exit` · `/quit` | Save session and exit |
667
-
668
- **Model & Permissions**
669
-
670
- | Command | Description |
671
- |---------|-------------|
672
- | `/model [name\|list]` | Show or switch model/provider |
673
- | `/effort [off\|low\|medium\|high\|max\|auto]` | Control reasoning depth (default `high`; routine turns auto-downgrade; explicit `max` is protected) |
674
- | `/permission [supervise\|auto\|unattended\|...]` | Manage approval tier and tool/bash allow/deny rules |
675
- | `/yes [off]` · `/yolo [off]` | One-key Unattended mode (`off` returns to Auto; persisted across restarts) |
676
- | `/approve` · `/reject` | Approve or reject pending tool execution in plain-text (`captured-pty`) mode |
677
- | `/domain [list\|<name>\|auto\|off]` | View or switch star-domain cognitive stance |
678
-
679
- **Planning, Orchestration & Review**
680
-
681
- | Command | Description |
682
- |---------|-------------|
683
- | `/goal <text>` · `/cancel-goal` | Start or stop autonomous goal execution |
684
- | `/plan <feature>` · `/plan-mode` | Draft a plan or toggle Plan Mode |
685
- | `/plan-list` · `/plan-view [ref]` | List or preview plans in-session |
686
- | `/plan-approve <slug>` · `/plan-reject <slug> [feedback]` | Approve plan for wave execution or reject with feedback |
687
- | `/plan-close <file> --tasks <range\|all> [--preview]` | Close a completed plan |
688
- | `/ask` | Toggle read-only Ask Mode |
689
- | `/council <text> [--rounds 2]` | Convene multi-seat expert review (Tianquan / Tianfu / Tianxuan) |
690
- | `/team <plan.md>` | Execute a plan in parallel across multiple worker agents |
691
- | `/scout <target> [--dims a,b,c]` | Parallel read-only reconnaissance swarm producing an evidence-backed checklist |
692
- | `/review [max]` | Run manual adversarial code review (L2 or L3 5-seat review squad) |
693
- | `/steer <text>` | Inject a mid-stream instruction at `now` priority at the next tool boundary |
694
-
695
- **Subagents, Context, Debugging & UI**
696
-
697
- | Command | Description |
698
- |---------|-------------|
699
- | `/tasks` · `/enter <orderId> [prompt]` | Open worker task panel or enter/resume a worker session |
700
- | `/jobs` | Open background shell jobs panel |
701
- | `/compact` · `/context` · `/evidence` | Compact context immediately, inspect context ledger, or view collected evidence |
702
- | `/memory` · `/remember <text>` · `/forget <id> [resolved]` | Inspect, add, or invalidate project long-term memory entries |
703
- | `/btw <question>` | Ask a side question in a floating overlay without polluting conversation history |
704
- | `/cvm [off\|intercept\|warn\|all]` | Set live CVM interception notice verbosity on the main screen |
705
- | `/debug [prompt\|cache\|mcp]` · `/mcp` · `/verbose` | Inspect prompt/cache/MCP diagnostics or toggle verbose tool output |
706
- | `/rollback` · `/undo` | Restore a Git checkpoint or undo the last file modification |
707
- | `/cockpit` · `/theme [name\|list]` · `/vim` · `/scroll` · `/update` | Toggle Cockpit, switch color theme, toggle vim mode, scroll history, or update via npm |
708
-
709
- </details>
710
-
711
- <a id="-key-config-cheatsheet"></a>
712
- <a id="key-config-cheatsheet"></a>
713
- ### ⚡ Key Config Cheatsheet (`~/.rivet/config.json` & Env Vars)
714
-
715
- <details>
716
- <summary><b>Click to expand Environment Variables & Annotated <code>config.json</code></b></summary>
717
-
718
- | Variable | Effect |
719
- |----------|--------|
720
- | `RIVET_HOME` | Override `~/.rivet` data root for CLI (Desktop uses Settings → Storage) |
721
- | `DEEPSEEK_API_KEY` | DeepSeek API key |
722
- | `RIVET_TOOL_PRESET` | Toolset preset: `minimal` (default) / `frontend` / `full` / `taiyi` |
723
- | `RIVET_LEAN=1` | Enable Lean resource tier for low-memory / low-disk machines |
724
- | `RIVET_LANG=en` | Switch Cockpit panel labels to English (default `zh`) |
725
- | `RIVET_TERMINAL_MODE` | Terminal UI mode: `auto` / `captured-pty` / `native` |
726
- | `RIVET_SERVE_LAN_DIRECT=1` | Enable LAN Direct self-signed TLS mode for mobile remote access |
727
- | `RIVET_DEBUG=1` / `RIVET_DEBUG_TELEMETRY=1` | Enable debug logging / full `sensorium.jsonl` CVM telemetry |
728
- | `RIVET_NO_UPDATE_CHECK=1` | Disable startup auto-update check |
729
-
730
- Example `~/.rivet/config.json` (only write overrides; defaults are deep-merged — validated against `src/config/schema.ts`):
731
-
732
- ```jsonc
733
- {
734
- "provider": {
735
- "default": "deepseek",
736
- "providers": {
737
- "deepseek": {
738
- "apiKey": "sk-xxx",
739
- "models": [
740
- { "id": "deepseek-v4-pro", "contextWindow": 1000000, "maxTokens": 384000 }
741
- ]
742
- }
743
- }
744
- },
745
- "agent": {
746
- "maxTurns": 200, // max turns per session (default 200)
747
- "approval": "auto-safe", // manual | auto-safe | dangerously-skip-permissions
748
- "crossSessionEnabled": true, // cross-session knowledge sharing
749
- "checkpointEveryTurns": 0, // Auto-mode checkpoint interval (0 = off)
750
- "defaultDomain": "qiming", // default star domain (qiming | auto | explicit domain id)
751
- "visionModel": { // vision bridge when primary model is text-only
752
- "provider": "minimax",
753
- "model": "MiniMax-M3"
754
- },
755
- "visionAutoBridge": false,
756
- "imageGenModel": { // dedicated text-to-image slot
757
- "provider": "siliconflow-image",
758
- "model": "black-forest-labs/FLUX.2-pro",
759
- "size": "1024x1024",
760
- "sizeField": "image_size"
761
- },
762
- "permissions": {
763
- "allow": [{ "tool": "read" }],
764
- "deny": [{ "tool": "bash", "params": { "command": "rm -rf" } }],
765
- "bash": { "allowlist": ["git status"], "denylist": ["git push"] }
766
- }
767
- },
768
- "compact": {
769
- "enabled": true,
770
- "autoThreshold": 800000
771
- },
772
- "tools": {
773
- "preset": "minimal" // minimal (default) | frontend | full | taiyi
774
- },
775
- "workers": {
776
- "profiles": {
777
- "capable": { "provider": "deepseek", "model": "deepseek-v4-pro" },
778
- "cheap": { "provider": "minimax", "model": "MiniMax-M2.7" }
779
- },
780
- "routing": { "code_edit": "capable", "repo_summarization": "cheap" },
781
- "patcherTier": "cheap"
782
- },
783
- "search": {
784
- "backends": ["bing", "duckduckgo"],
785
- "braveApiKeyEnv": "BRAVE_API_KEY",
786
- "tavilyApiKeyEnv": "TAVILY_API_KEY",
787
- "bochaApiKeyEnv": "BOCHA_API_KEY",
788
- "serplyApiKeyEnv": "SERPLY_API_KEY"
789
- },
790
- "ui": {
791
- "theme": "auto",
792
- "reducedMotion": true,
793
- "screenReader": true,
794
- "glanceDensity": "compact",
795
- "cvmNotices": "intercept",
796
- "cvmNoticeWindowMs": 8000
797
- },
798
- "mirrors": { "enabled": true, "preset": "china" },
799
- "env": { "extraPath": ["/usr/local/bin"] }
800
- }
801
- ```
486
+ ### Acknowledgments
802
487
 
803
- </details>
488
+ The desktop app's custom-wallpaper and per-surface glass **design** references <a href="https://github.com/elysia395/dsh-wallpaper-engine">dsh-wallpaper-engine</a> (MIT). The implementation in Tianshu is original and contains no upstream code; see THIRD-PARTY-NOTICES.md for the design scope and full license text. Thanks to [@elysia395](https://github.com/elysia395), [@YV3507](https://github.com/YV3507), [@yuxilao](https://github.com/yuxilao), and [@oneincase](https://github.com/oneincase) for guidance as technical advisors on wallpaper-engine rendering.