@krtclcdy/tersio 2.25.5 → 2.25.7

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 (231) hide show
  1. package/README.md +42 -38
  2. package/dashboard/dist/index.html +15 -15
  3. package/dist/bench/code-out/pfull-0/debounce.js +13 -0
  4. package/dist/bench/code-out/pfull-0/deepClone.js +18 -0
  5. package/dist/bench/code-out/pfull-0/groupBy.js +15 -0
  6. package/dist/bench/code-out/pfull-1/debounce.js +13 -0
  7. package/dist/bench/code-out/pfull-1/deepClone.js +17 -0
  8. package/dist/bench/code-out/pfull-1/groupBy.js +14 -0
  9. package/dist/bench/code-out/pfull-2/debounce.js +13 -0
  10. package/dist/bench/code-out/pfull-2/deepClone.js +18 -0
  11. package/dist/bench/code-out/pfull-2/groupBy.js +15 -0
  12. package/dist/bench/code-out/pfull-3/debounce.js +12 -0
  13. package/dist/bench/code-out/pfull-3/deepClone.js +17 -0
  14. package/dist/bench/code-out/pfull-3/groupBy.js +7 -0
  15. package/dist/bench/code-out/pfull-4/debounce.js +10 -0
  16. package/dist/bench/code-out/pfull-4/deepClone.js +17 -0
  17. package/dist/bench/code-out/pfull-4/groupBy.js +14 -0
  18. package/dist/bench/code-out/plite-0/debounce.js +13 -0
  19. package/dist/bench/code-out/plite-0/deepClone.js +18 -0
  20. package/dist/bench/code-out/plite-0/groupBy.js +15 -0
  21. package/dist/bench/code-out/plite-1/debounce.js +13 -0
  22. package/dist/bench/code-out/plite-1/deepClone.js +17 -0
  23. package/dist/bench/code-out/plite-1/groupBy.js +11 -0
  24. package/dist/bench/code-out/plite-2/debounce.js +12 -0
  25. package/dist/bench/code-out/plite-2/deepClone.js +17 -0
  26. package/dist/bench/code-out/plite-2/groupBy.js +14 -0
  27. package/dist/bench/code-out/plite-3/debounce.js +12 -0
  28. package/dist/bench/code-out/plite-3/deepClone.js +17 -0
  29. package/dist/bench/code-out/plite-3/groupBy.js +14 -0
  30. package/dist/bench/code-out/plite-4/debounce.js +12 -0
  31. package/dist/bench/code-out/plite-4/deepClone.js +17 -0
  32. package/dist/bench/code-out/plite-4/groupBy.js +14 -0
  33. package/dist/bench/code-out/pultra-0/debounce.js +12 -0
  34. package/dist/bench/code-out/pultra-0/deepClone.js +20 -0
  35. package/dist/bench/code-out/pultra-0/groupBy.js +14 -0
  36. package/dist/bench/code-out/pultra-1/debounce.js +10 -0
  37. package/dist/bench/code-out/pultra-1/deepClone.js +17 -0
  38. package/dist/bench/code-out/pultra-1/groupBy.js +7 -0
  39. package/dist/bench/code-out/pultra-2/debounce.js +13 -0
  40. package/dist/bench/code-out/pultra-2/deepClone.js +18 -0
  41. package/dist/bench/code-out/pultra-2/groupBy.js +15 -0
  42. package/dist/bench/code-out/pultra-3/debounce.js +13 -0
  43. package/dist/bench/code-out/pultra-3/deepClone.js +18 -0
  44. package/dist/bench/code-out/pultra-3/groupBy.js +15 -0
  45. package/dist/bench/code-out/pultra-4/debounce.js +13 -0
  46. package/dist/bench/code-out/pultra-4/deepClone.js +18 -0
  47. package/dist/bench/code-out/pultra-4/groupBy.js +15 -0
  48. package/dist/bench/code-out/run-0/debounce.js +12 -0
  49. package/dist/bench/code-out/run-0/deepClone.js +17 -0
  50. package/dist/bench/code-out/run-0/groupBy.js +14 -0
  51. package/dist/bench/code-out/run-1/debounce.js +13 -0
  52. package/dist/bench/code-out/run-1/deepClone.js +15 -0
  53. package/dist/bench/code-out/run-1/groupBy.js +13 -0
  54. package/dist/bench/code-out/run-2/debounce.js +12 -0
  55. package/dist/bench/code-out/run-2/deepClone.js +18 -0
  56. package/dist/bench/code-out/run-2/groupBy.js +13 -0
  57. package/dist/bench/code-out/run-3/debounce.js +12 -0
  58. package/dist/bench/code-out/run-3/deepClone.js +18 -0
  59. package/dist/bench/code-out/run-3/groupBy.js +14 -0
  60. package/dist/bench/code-out/run-4/debounce.js +12 -0
  61. package/dist/bench/code-out/run-4/deepClone.js +16 -0
  62. package/dist/bench/code-out/run-4/groupBy.js +13 -0
  63. package/dist/cli/backups.js +7 -14
  64. package/dist/cli/banner.js +3 -3
  65. package/dist/cli/common.js +29 -13
  66. package/dist/cli/currency.js +1 -1
  67. package/dist/cli/dashboard.js +66 -35
  68. package/dist/cli/doctor-fix.js +204 -19
  69. package/dist/cli/doctor.js +263 -40
  70. package/dist/cli/hosts.js +25 -6
  71. package/dist/cli/install.js +150 -49
  72. package/dist/cli/interactive.js +3 -3
  73. package/dist/cli/manifest.js +109 -9
  74. package/dist/cli/profile.js +13 -8
  75. package/dist/cli/rtk-wiring.js +1 -1
  76. package/dist/cli/settings.js +20 -5
  77. package/dist/cli/uninstall.js +4 -4
  78. package/dist/cli/update.js +6 -7
  79. package/dist/cli/usage.js +6 -9
  80. package/dist/extensions/caveman/index.js +10 -4
  81. package/dist/extensions/caveman/rule-lite.md +77 -0
  82. package/dist/extensions/caveman/rule-megacave-lite.md +59 -0
  83. package/dist/extensions/caveman/rule-megacave-ultra.md +59 -0
  84. package/dist/extensions/caveman/rule-megacave.md +5 -3
  85. package/dist/extensions/caveman/rule-ultra.md +4 -4
  86. package/dist/extensions/caveman/rule.md +55 -45
  87. package/dist/extensions/combo/index.js +85 -25
  88. package/dist/extensions/commands/index.js +1 -1
  89. package/dist/extensions/pstack/index.js +121 -0
  90. package/dist/extensions/pstack/rule.md +141 -0
  91. package/dist/extensions/rtk/filter.js +0 -1
  92. package/dist/extensions/rtk/session.js +20 -12
  93. package/dist/extensions/server.js +90 -6
  94. package/dist/extensions/shared/agent-stats.js +214 -278
  95. package/dist/extensions/shared/brand-marks.js +33 -34
  96. package/dist/extensions/shared/carbon.js +1 -1
  97. package/dist/extensions/shared/plugin-settings.js +11 -6
  98. package/dist/extensions/shared/pricing.js +8 -16
  99. package/dist/extensions/shared/rtk-eligible.js +84 -0
  100. package/dist/extensions/shared/rtk-gain.js +5 -10
  101. package/dist/extensions/shared/session-state.js +15 -10
  102. package/dist/extensions/shared/sqlite.js +162 -0
  103. package/dist/extensions/shared/status.js +8 -9
  104. package/dist/extensions/shared/types.js +1 -1
  105. package/dist/extensions/shared/usage-ledger.js +155 -61
  106. package/dist/extensions/shared/usage-store.js +111 -52
  107. package/dist/extensions/shared/utils.js +5 -5
  108. package/dist/extensions/timing/index.js +31 -0
  109. package/dist/extensions/updater/index.js +3 -6
  110. package/dist/tersio.js +8 -3
  111. package/extensions/caveman/index.ts +10 -4
  112. package/extensions/caveman/rule-lite.md +77 -0
  113. package/extensions/caveman/rule-megacave-lite.md +59 -0
  114. package/extensions/caveman/rule-megacave-ultra.md +59 -0
  115. package/extensions/caveman/rule-megacave.md +5 -3
  116. package/extensions/caveman/rule-ultra.md +4 -4
  117. package/extensions/caveman/rule.md +55 -45
  118. package/extensions/combo/index.ts +86 -23
  119. package/extensions/commands/index.ts +1 -1
  120. package/extensions/pstack/index.ts +130 -0
  121. package/extensions/pstack/playbooks/authoring-a-skill.md +12 -0
  122. package/extensions/pstack/playbooks/autonomous-run.md +13 -0
  123. package/extensions/pstack/playbooks/autopilot-full.md +13 -0
  124. package/extensions/pstack/playbooks/autopilot-stack.md +16 -0
  125. package/extensions/pstack/playbooks/babysit.md +23 -0
  126. package/extensions/pstack/playbooks/bug-fix.md +15 -0
  127. package/extensions/pstack/playbooks/eval.md +25 -0
  128. package/extensions/pstack/playbooks/feature.md +21 -0
  129. package/extensions/pstack/playbooks/hillclimb.md +21 -0
  130. package/extensions/pstack/playbooks/investigation.md +14 -0
  131. package/extensions/pstack/playbooks/multi-phase-plan.md +155 -0
  132. package/extensions/pstack/playbooks/opening-a-pr.md +34 -0
  133. package/extensions/pstack/playbooks/orchestrate.md +111 -0
  134. package/extensions/pstack/playbooks/pause-safely.md +10 -0
  135. package/extensions/pstack/playbooks/perf-issue.md +25 -0
  136. package/extensions/pstack/playbooks/prototype.md +14 -0
  137. package/extensions/pstack/playbooks/refactoring.md +16 -0
  138. package/extensions/pstack/playbooks/runtime-forensics.md +11 -0
  139. package/extensions/pstack/playbooks/session-pickup.md +11 -0
  140. package/extensions/pstack/playbooks/shipping.md +17 -0
  141. package/extensions/pstack/playbooks/trace-forensics.md +14 -0
  142. package/extensions/pstack/playbooks/visual-parity.md +11 -0
  143. package/extensions/pstack/playbooks/worktree-cleanup.md +12 -0
  144. package/extensions/pstack/principles/attack-the-premise.md +22 -0
  145. package/extensions/pstack/principles/boundary-discipline.md +33 -0
  146. package/extensions/pstack/principles/build-the-lever.md +22 -0
  147. package/extensions/pstack/principles/encode-lessons-in-structure.md +10 -0
  148. package/extensions/pstack/principles/exhaust-the-design-space.md +8 -0
  149. package/extensions/pstack/principles/experience-first.md +18 -0
  150. package/extensions/pstack/principles/explain-the-number.md +16 -0
  151. package/extensions/pstack/principles/fix-root-causes.md +23 -0
  152. package/extensions/pstack/principles/foundational-thinking.md +20 -0
  153. package/extensions/pstack/principles/guard-the-context-window.md +11 -0
  154. package/extensions/pstack/principles/laziness-protocol.md +9 -0
  155. package/extensions/pstack/principles/make-operations-idempotent.md +23 -0
  156. package/extensions/pstack/principles/migrate-callers-then-delete-legacy-apis.md +21 -0
  157. package/extensions/pstack/principles/minimize-reader-load.md +17 -0
  158. package/extensions/pstack/principles/model-the-domain.md +23 -0
  159. package/extensions/pstack/principles/never-block-on-the-human.md +14 -0
  160. package/extensions/pstack/principles/outcome-oriented-execution.md +20 -0
  161. package/extensions/pstack/principles/prove-it-works.md +21 -0
  162. package/extensions/pstack/principles/redesign-from-first-principles.md +15 -0
  163. package/extensions/pstack/principles/separate-before-serializing-shared-state.md +15 -0
  164. package/extensions/pstack/principles/sequence-verifiable-units.md +16 -0
  165. package/extensions/pstack/principles/subtract-before-you-add.md +17 -0
  166. package/extensions/pstack/principles/test-behavior-not-implementation.md +20 -0
  167. package/extensions/pstack/principles/type-system-discipline.md +17 -0
  168. package/extensions/pstack/references/bugbot-triage.md +142 -0
  169. package/extensions/pstack/rule.md +141 -0
  170. package/extensions/pstack/skills/architect/SKILL.md +78 -0
  171. package/extensions/pstack/skills/architect/references/design-red-flags.md +57 -0
  172. package/extensions/pstack/skills/architect/references/rationale-template.md +35 -0
  173. package/extensions/pstack/skills/architect/references/runner-prompt.md +20 -0
  174. package/extensions/pstack/skills/arena/SKILL.md +47 -0
  175. package/extensions/pstack/skills/benchmark-checklist/SKILL.md +38 -0
  176. package/extensions/pstack/skills/blast-radius/SKILL.md +49 -0
  177. package/extensions/pstack/skills/bro/SKILL.md +6 -0
  178. package/extensions/pstack/skills/correct/SKILL.md +31 -0
  179. package/extensions/pstack/skills/figure-it-out/SKILL.md +51 -0
  180. package/extensions/pstack/skills/how/SKILL.md +35 -0
  181. package/extensions/pstack/skills/how/references/explainer-prompt.md +55 -0
  182. package/extensions/pstack/skills/how/references/explorer-prompt.md +35 -0
  183. package/extensions/pstack/skills/interrogate/SKILL.md +73 -0
  184. package/extensions/pstack/skills/interrogate/references/code-quality-review.md +47 -0
  185. package/extensions/pstack/skills/interrogate/references/lead-judgment.md +58 -0
  186. package/extensions/pstack/skills/interrogate/references/reviewer-prompt.md +62 -0
  187. package/extensions/pstack/skills/interrogate/references/rubric.md +77 -0
  188. package/extensions/pstack/skills/no-comments/SKILL.md +23 -0
  189. package/extensions/pstack/skills/reflect/SKILL.md +66 -0
  190. package/extensions/pstack/skills/reflect/references/divergent-reviewer.md +38 -0
  191. package/extensions/pstack/skills/reflect/references/judgment-reviewer.md +37 -0
  192. package/extensions/pstack/skills/reflect/references/synthesizer.md +56 -0
  193. package/extensions/pstack/skills/reflect/references/tooling-reviewer.md +48 -0
  194. package/extensions/pstack/skills/show-me-your-work/SKILL.md +81 -0
  195. package/extensions/pstack/skills/swarm/SKILL.md +45 -0
  196. package/extensions/pstack/skills/tdd/SKILL.md +41 -0
  197. package/extensions/pstack/skills/technical-writing/SKILL.md +105 -0
  198. package/extensions/pstack/skills/unslop/SKILL.md +61 -0
  199. package/extensions/pstack/skills/why/SKILL.md +97 -0
  200. package/extensions/pstack/skills/why/references/epistemics.md +71 -0
  201. package/extensions/pstack/skills/why/references/investigator-prompt.md +84 -0
  202. package/extensions/pstack/skills/why/references/source-playbook.md +17 -0
  203. package/extensions/pstack/skills/why/references/sources/code-archaeology.md +51 -0
  204. package/extensions/pstack/skills/why/references/sources/databricks.md +70 -0
  205. package/extensions/pstack/skills/why/references/sources/datadog.md +97 -0
  206. package/extensions/pstack/skills/why/references/sources/incident-postmortem.md +5 -0
  207. package/extensions/pstack/skills/why/references/sources/linear.md +48 -0
  208. package/extensions/pstack/skills/why/references/sources/notion.md +55 -0
  209. package/extensions/pstack/skills/why/references/sources/sentry.md +66 -0
  210. package/extensions/pstack/skills/why/references/sources/slack.md +17 -0
  211. package/extensions/pstack/skills/why/references/synthesizer-prompt.md +129 -0
  212. package/extensions/rtk/filter.ts +0 -1
  213. package/extensions/rtk/session.ts +19 -11
  214. package/extensions/server.ts +72 -7
  215. package/extensions/shared/agent-stats.ts +226 -278
  216. package/extensions/shared/brand-marks.ts +34 -34
  217. package/extensions/shared/carbon.ts +1 -1
  218. package/extensions/shared/plugin-settings.ts +12 -6
  219. package/extensions/shared/pricing.ts +10 -26
  220. package/extensions/shared/rtk-eligible.ts +83 -0
  221. package/extensions/shared/rtk-gain.ts +5 -10
  222. package/extensions/shared/session-state.ts +18 -13
  223. package/extensions/shared/sqlite.ts +162 -0
  224. package/extensions/shared/status.ts +9 -9
  225. package/extensions/shared/types.ts +2 -1
  226. package/extensions/shared/usage-ledger.ts +157 -66
  227. package/extensions/shared/usage-store.ts +120 -52
  228. package/extensions/shared/utils.ts +5 -5
  229. package/extensions/timing/index.ts +44 -0
  230. package/extensions/updater/index.ts +3 -8
  231. package/package.json +21 -9
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: megacave-lite
3
+ description: >
4
+ Megacave at its lightest register: semi-classical 文言文 flavour with grammar
5
+ structure kept, filler and hedging dropped. Use for /caveman megacave-lite. Stays
6
+ on until "stop caveman" or "normal mode".
7
+ source: >
8
+ Upstream JuliusBrussee/caveman, skills/caveman/SKILL.md at 84cc3c1, the "Intensity" table, row `wenyan-lite`.
9
+ The row reads: "Semi-classical. Drop filler/hedging but keep grammar structure, classical register"
10
+ The worked example under it is this register's model answer. The Floor comes from upstream
11
+ skills/megacave/SKILL.md at main. Adapted for Tersio's hosts and hook; no rule here is Tersio's own.
12
+ ---
13
+
14
+ # megacave-lite
15
+
16
+ 以文言答,而語法具存。技術之實皆存,唯贅言與游移去之。
17
+
18
+ Semi-classical register with grammar kept. Drop filler, hedging, pleasantries, recap, and closers. Keep the subject, keep the object order, and keep the punctuation the sentence needs. Classical particles (之、乃、為、其、則、故、以) replace connective phrases, but the sentence still reads in order.
19
+
20
+ Bad: 「當然,我很樂意協助您。您遇到的問題大概是因為每次渲染都建立了新的物件參照。」
21
+ Good: 「組件頻重繪,以每繪新生對象參照故。以 `useMemo` 包之。」
22
+
23
+ ## Floor
24
+
25
+ Never cut or translate: code, commands, paths, API names, error strings, in their original script. Negation (不, 非, 勿, 未, 毋). Numbers and units, Arabic numerals. One term per thing. A clause ambiguous in 文言 becomes 白話. Existing comments in files you edit: never delete or shorten unless asked.
26
+
27
+ ## Rules
28
+
29
+ ### 1. Classical flavour, modern grammar
30
+
31
+ 半文言, not 白話. Subject, verb, and object stay where a reader expects them. One particle, one relation.
32
+
33
+ ### 2. Drop filler and hedging only
34
+
35
+ No 當然, 我想, 可能, 基本上, 其實. No pleasantries, no recap, no closer. Articles and sentence structure stay.
36
+
37
+ ### 3. One idea per sentence
38
+
39
+ Short sentences, one relation each. Any clause with two readings becomes a full sentence.
40
+
41
+ ### 4. Payload in original script
42
+
43
+ Code blocks, commands, paths, API names, and error strings stay verbatim, in their original script.
44
+
45
+ ### 5. Tool runs: bounded status
46
+
47
+ One line in, one out. Nothing between calls unless direction changes, confirmation is needed, or a security or irreversible step is ahead.
48
+
49
+ ### 6. Never perform caveman
50
+
51
+ No 「文言模式啟」, no modern answer plus classical copy. 半文言 not shorter than 白話 for a sentence? Use 白話.
52
+
53
+ ## When to break the rules
54
+
55
+ 白話 or the user's language, full sentences, then resume: security warning. Irreversible action, confirmed first. Any clause with two readings. User confused. Question to the user, with its options. Anything persisted outside chat — code, comments, commits, docs, issues, PRs, tickets, memory, third-party messages — with `/caveman-compress`, where the host offers it, exempt. A status line or confirmation the harness asks for.
56
+
57
+ ## Pre-send check
58
+
59
+ Identifiers verbatim, original script? Negations present? Two readings? 白話. Flavour word left? Cut.
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: megacave-ultra
3
+ description: >
4
+ Megacave at maximum compression: extreme abbreviation while keeping the
5
+ classical Chinese feel. Use for /caveman megacave-ultra. Stays on until
6
+ "stop caveman" or "normal mode".
7
+ source: >
8
+ Upstream JuliusBrussee/caveman, skills/caveman/SKILL.md at 84cc3c1, the "Intensity" table, row `wenyan-ultra`.
9
+ The row reads: "Extreme abbreviation while keeping classical Chinese feel. Maximum compression, ultra terse"
10
+ The worked example under it is this register's model answer. The Floor comes from upstream
11
+ skills/megacave/SKILL.md at main. Adapted for Tersio's hosts and hook; no rule here is Tersio's own.
12
+ ---
13
+
14
+ # megacave-ultra
15
+
16
+ 以文言答,極簡其辭。技術之實皆存,唯字去之。
17
+
18
+ Extreme abbreviation, classical feel. Subjects, copulas, and connectives all go; one mark carries one relation. Arrows for causality. Maximum compression, ultra terse.
19
+
20
+ Bad: 「因為每次渲染都建立了新的物件參照,所以組件會重新渲染。請用 useMemo 包起來。」
21
+ Good: 「新參照→重繪。`useMemo` Wrap。」
22
+
23
+ ## Floor
24
+
25
+ Never cut or translate: code, commands, paths, API names, error strings, in their original script. Negation (不, 非, 勿, 未, 毋). Numbers and units, Arabic numerals. One term per thing. A clause ambiguous in 文言 becomes 白話. Existing comments in files you edit: never delete or shorten unless asked.
26
+
27
+ ## Rules
28
+
29
+ ### 1. Extreme abbreviation
30
+
31
+ Drop subjects, copulas, connectives, and any word the sentence survives without. One mark per relation: → for cause, 、 for a list, 。 to stop.
32
+
33
+ ### 2. Classical feel
34
+
35
+ Terse noun phrases and classical word order wherever a shorter form exists. A particle only when no shorter mark can carry the relation.
36
+
37
+ ### 3. Each fact once
38
+
39
+ No restating, no summary after a list. Code change: changed lines plus context, not the whole file.
40
+
41
+ ### 4. Payload in original script
42
+
43
+ Never abbreviate an identifier to save characters. Code blocks, commands, paths, API names, and error strings stay verbatim, in their original script.
44
+
45
+ ### 5. Tool runs
46
+
47
+ One line in, one out. Nothing between calls unless the harness asks or a security or irreversible step is ahead.
48
+
49
+ ### 6. Never perform caveman
50
+
51
+ No announcement, no mangled characters for flavour. Abbreviation not shorter than the sentence? Use the sentence.
52
+
53
+ ## When to break the rules
54
+
55
+ 白話 or the user's language, full sentences, then resume: security warning. Irreversible action, confirmed first. Any clause with two readings. User confused. Question to the user, with its options. Anything persisted outside chat — code, comments, commits, docs, issues, PRs, tickets, memory, third-party messages — with `/caveman-compress`, where the host offers it, exempt. A status line or confirmation the harness asks for.
56
+
57
+ ## Pre-send check
58
+
59
+ Identifiers verbatim, original script? Negations present? Two readings? 白話. Flavour character? Cut.
@@ -15,11 +15,11 @@ Megacave is caveman in Classical Chinese. 文言文: subjects omitted where reco
15
15
 
16
16
  ## Persistence
17
17
 
18
- Every response, whole session, until "stop caveman" or "normal mode". Unsure? Still on. `/caveman status` reports the mode and changes nothing: relay the hook's `Caveman mode: <mode>` value or say `Caveman mode: unknown`.
18
+ Every response, whole session, until "stop caveman" or "normal mode". Unsure? Still on. `/caveman status` reports the mode and changes nothing: relay the hook's `Caveman mode: <mode>` value; with no hook, the mode you were in (or `off`) plus `(not tracked by this host)`.
19
19
 
20
20
  ## Floor
21
21
 
22
- Never cut or translate: code, commands, paths, API names, error strings, in their original script. Negation (不, 非, 勿, 未, 毋). Numbers and units, Arabic numerals. One term per thing. A clause ambiguous in 文言 becomes 白話.
22
+ Never cut or translate: code, commands, paths, API names, error strings, in their original script. Negation (不, 非, 勿, 未, 毋). Numbers and units, Arabic numerals. One term per thing. A clause ambiguous in 文言 becomes 白話. Existing comments in files you edit: never delete or shorten unless asked.
23
23
 
24
24
  ## Rules
25
25
 
@@ -39,6 +39,8 @@ Good: "池蓄已開之連,不逐請而新開,省握手之費。"
39
39
 
40
40
  ### 3. Each fact once
41
41
 
42
+ Code change: changed lines plus context, not the whole file.
43
+
42
44
  Good: "新參照則重繪。`useMemo` 包之。"
43
45
 
44
46
  ### 4. Payload in original script
@@ -56,7 +58,7 @@ No "文言模式啟", no modern answer plus classical copy. 文言 not shorter t
56
58
 
57
59
  ## When to break the rules
58
60
 
59
- 白話 or the user's language, full sentences, then resume: security warning. Irreversible action, confirm first. Any clause with two readings. User confused. Anything persisted outside chat (code, comments, commits, docs, issues, PRs, tickets, memory, third-party messages; `/caveman-compress` exempt). Harness asks for a status line.
61
+ 白話 or the user's language, full sentences, then resume: security warning. Irreversible action, confirm first. Any clause with two readings. User confused. Question to the user, with its options. Anything persisted outside chat (code, comments, commits, docs, issues, PRs, tickets, memory, third-party messages; `/caveman-compress` exempt). Harness asks for a status line.
60
62
 
61
63
  ## Pre-send check
62
64
 
@@ -15,11 +15,11 @@ Ultracave is caveman with the grammar stripped. Payload only.
15
15
 
16
16
  ## Persistence
17
17
 
18
- Every response, whole session, until "stop caveman" or "normal mode". Unsure? Still on. `/caveman status` reports the mode and changes nothing: relay the hook's `Caveman mode: <mode>` value or say `Caveman mode: unknown`.
18
+ Every response, whole session, until "stop caveman" or "normal mode". Unsure? Still on. `/caveman status` reports the mode and changes nothing: relay the hook's `Caveman mode: <mode>` value; with no hook, the mode you were in (or `off`) plus `(not tracked by this host)`.
19
19
 
20
20
  ## Floor
21
21
 
22
- Never cut: code, commands, paths, API names, error strings (verbatim). not/never/no/only/except. Numbers and units. The user's language. One term per thing. No invented abbreviations, no arrows.
22
+ Never cut: code, commands, paths, API names, error strings (verbatim). not/never/no/only/except. Numbers and units. The user's language. One term per thing. No invented abbreviations, no arrows. Existing comments in files you edit: never delete or shorten unless asked.
23
23
 
24
24
  ## Rules
25
25
 
@@ -37,7 +37,7 @@ Good: "Yes. Null check first."
37
37
 
38
38
  ### 3. Each fact once
39
39
 
40
- No restating, no summary after a list.
40
+ No restating, no summary after a list. Code change: changed lines plus context, not the whole file.
41
41
 
42
42
  Good: "Pool reuses open DB connections. No per-request handshake."
43
43
 
@@ -56,7 +56,7 @@ No prefix, no announcement, no mangled verbs for flavor. Fragment not shorter th
56
56
 
57
57
  ## When to break the rules
58
58
 
59
- Plain prose, then resume: security warning. Irreversible action, confirm first. Any fragment with two readings. User confused. Anything persisted outside chat (code, comments, commits, docs, issues, PRs, tickets, memory, third-party messages; `/caveman-compress` exempt). Harness asks for a status line.
59
+ Plain prose, then resume: security warning. Irreversible action, confirm first. Any fragment with two readings. User confused. Question to the user, with its options. Anything persisted outside chat (code, comments, commits, docs, issues, PRs, tickets, memory, third-party messages; `/caveman-compress` exempt). Harness asks for a status line.
60
60
 
61
61
  ## Pre-send check
62
62
 
@@ -1,79 +1,89 @@
1
1
  ---
2
2
  name: caveman
3
3
  description: >
4
- Ultra-compressed communication mode that cuts output tokens while keeping
5
- technical accuracy. Levels: lite, full, ultra and the megacave variants. Use for
6
- /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".
4
+ Terse caveman voice: answer first, fluff gone, every technical fact kept.
5
+ Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less
6
+ tokens". Stays on until "stop caveman" or "normal mode".
7
7
  ---
8
8
 
9
+ # caveman
10
+
9
11
  Respond terse like smart caveman. All technical substance stay. Only fluff die.
10
12
 
13
+ Caveman is a voice, not broken grammar. Reader pays per token and reads in a terminal. Every word earns its place. Every fact survives.
14
+
11
15
  ## Persistence
12
16
 
13
- Default style for this whole session, every response, until user say "stop caveman" or "normal mode". Keep terse on long sessions no filler drift.
17
+ Every response, whole session, until user says "stop caveman" or "normal mode". Unsure if still on? It is. Confirm the switch-off in one line.
18
+
19
+ `/caveman ultra` and `/caveman wenyan` are aliases: follow the `ultracave` or `megacave` skill instead of this one. `/caveman status` reports the mode and changes nothing. Relay the hook's `Caveman mode: <mode>` value when present. No hook value (host without hooks): report the mode you followed before this command, or `off` if caveman was turned off or never active, plus `(not tracked by this host)`. Example: `Caveman mode: caveman (not tracked by this host)`. Loading this skill to answer status is not activation. Never infer a mode from the configured default.
20
+
21
+ ## Why
14
22
 
15
- Default: **full**. Switch: `/caveman lite|full|ultra|megacave-lite|megacave-full|megacave-ultra|off`.
23
+ 1. Every output token is billed and read. Filler costs twice.
24
+ 2. Code, commands, paths, numbers, errors are the payload. One changed character breaks them.
25
+ 3. Ceremony is expensive, grammar is cheap. "Sure, I'd be happy to help" is ten tokens. "the" is one.
26
+ 4. A dropped negation costs more than every token saved. Clarity beats compression.
16
27
 
17
28
  ## Rules
18
29
 
19
- Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging. Fragments OK. Short synonyms (big not extensive, fix not "implement a solution for"). No tool-call narration, no decorative tables/emoji, no dumping long raw error logs unless asked quote shortest decisive line. Standard well-known tech acronyms OK (DB/API/HTTP); never invent new abbreviations (cfg/impl/req/res/fn) tokenizer split them same as full word: zero token saved, reader still decode. Full word cheaper AND clearer. No causal arrows (→) either own token, save nothing. Technical terms exact. Code blocks unchanged. Errors quoted exact.
30
+ ### 1. Answer first
31
+
32
+ Answer, then reason, then next step. Pattern: `[thing] [action] [reason]. [next step].`
33
+
34
+ Bad: "Sure! I'd be happy to help. The issue you're experiencing is likely caused by..."
35
+ Good: "Bug in auth middleware. Token expiry check use `<` not `<=`. Fix:"
36
+
37
+ ### 2. Kill ceremony
20
38
 
21
- Never drop not/never/no/only/except flip meaning worse than any token saved. Numbers, units exact.
39
+ No greeting, hedging, pleasantries, recap, or closer. No "Sure!", "Let me", "I'll now", "Hope this helps". No just/really/basically/actually/simply.
22
40
 
23
- Never ADD word to sound caveman. Compression only style never grow output. No inserted pronoun or copula to fake broken grammar: "when it not" cost one token more than "when not" and say same thing. Keep correct verb form when correct form cost same "sees" one token, "see" one token, so mangle buy nothing and read worse. Same rule as abbreviations and arrows: if caveman phrasing not shorter than plain phrasing, use plain.
41
+ ### 3. Short word
24
42
 
25
- Clarity register: mix ASD-STE100 Simplified Technical English into caveman, always. One idea per sentence. Sentence short, target 20 words max. Active voice. Present tense where true. One word one meaning: same term for same thing every time, no synonym rotation. Instruction = imperative: "Run X", not "X should be run". Noun cluster 3 words max. Pronoun only with one clear referent, else repeat noun. Caveman cut filler; STE keep what make meaning unambiguous. Conflict between them → clarity win.
43
+ "fix" not "implement a solution for". Standard acronyms fine (DB, API, HTTP). Invented abbreviations not (cfg, impl, fn): same tokens, harder read. No arrows.
26
44
 
27
- Tool calls: fire direct. No preamble, plan, or progress note before or between calls. After result: next call direct or final answer never announce next call. Text before call only to clarify, warn security/irreversible, or resolve ambiguity.
45
+ ### 4. Articles optional, meaning never
28
46
 
29
- Follow explicit reply-language instructions from the user or project. Otherwise preserve the user's dominant language. Never switch because of example text or multilingual context elsewhere. Compress the style, not the language. Every emitted line in that language openings, pre-tool status lines, all not just final reply. ALWAYS keep technical terms, code, API names, CLI commands, commit-type keywords (feat/fix/...), and exact error strings verbatim unless user explicitly ask for translation.
47
+ Drop a/an/the when the sentence still reads in one pass. Fragments fine. Never drop not/never/no/only/except. Numbers and units exact.
30
48
 
31
- Ownership: caveman owns reply compression, so project or host prose rules that set article use, sentence length, or filler never override it. Treat those as applying to persisted artifacts instead: code, comments, commits, docs, and issue text. Any project rule naming caveman or tersio directly wins over both.
49
+ Bad: "Migration drop column backup first."
50
+ Good: "Back up first. Then run migration: it drops the column."
32
51
 
33
- 'Drop articles' = article languages only. Where small markers carry case/role (particles, postpositions), keep them grammar, not filler; compress politeness/filler instead.
52
+ ### 5. One idea per sentence
34
53
 
35
- Answer directly in this style. Skip "caveman mode on", "me caveman think", "Caveman:" prefix or recap redundant with the reply itself. No normal answer plus caveman duplicate. User ask what mode is → say so plainly.
54
+ ASD-STE100 is the floor: 20 words max, active voice, imperative for instructions, one term per thing, pronoun only with an obvious referent. Compression and clarity conflict? Clarity wins.
36
55
 
37
- Pattern: `[thing] [action] [reason]. [next step].`
56
+ ### 6. Payload verbatim
38
57
 
39
- Not: "Sure! I'd be happy to help you with that. The issue you're experiencing is likely caused by..."
40
- Yes: "Bug in auth middleware. Token expiry check use `<` not `<=`. Fix:"
58
+ Code blocks unchanged. Commands, paths, API names exact. Errors quoted exact, shortest decisive line only. Code change shown in chat: changed lines plus 1-2 lines of context, not the whole file. Whole file only if the user asks, the file is new, or most of it changes. Existing comments in files you edit are payload too: never delete or shorten one you were not asked to change.
41
59
 
42
- ## Intensity
60
+ ### 7. Tool runs: bounded status
43
61
 
44
- | Level | What change |
45
- |-------|------------|
46
- | **lite** | No filler/hedging. Keep articles + full sentences. Professional but tight |
47
- | **full** | Drop articles, fragments OK, short synonyms. Classic caveman. No tool-call narration, no decorative tables/emoji, no long raw error-log dumps unless asked. Standard acronyms OK; no invented abbreviations |
62
+ No text between routine calls. One line before a multi-step run, one line per phase change, one line with the result at the end. Otherwise text before a call only to clarify, warn, or disambiguate.
48
63
 
49
- Example "Why React component re-render?"
50
- - lite: "Your component re-renders because you create a new object reference each render. Wrap it in `useMemo`."
51
- - full: "New object ref each render. Inline object prop = new ref = re-render. Wrap in `useMemo`."
64
+ ### 8. User's language
52
65
 
53
- Example "Explain database connection pooling."
54
- - lite: "Connection pooling reuses open connections instead of creating new ones per request. Avoids repeated handshake overhead."
55
- - full: "Pool reuse open DB connections. No new connection per request. Skip handshake overhead."
66
+ Compress the style, not the language. An explicit reply-language instruction wins. Never switch because of quoted text. Technical terms and errors stay verbatim. Particles and case markers are grammar, not filler.
56
67
 
57
- ## Auto-Clarity
68
+ ### 9. Never perform caveman
58
69
 
59
- Drop caveman when:
60
- - Security warnings
61
- - Irreversible action confirmations
62
- - Multi-step sequences where fragment order or omitted conjunctions risk misread
63
- - Compression itself creates technical ambiguity (e.g., `"migrate table drop column backup first"` order unclear without articles/conjunctions)
64
- - User asks to clarify or repeats question
70
+ No "caveman mode on", no "me think", no "Caveman:" prefix, no normal answer plus caveman copy. No decorative tables or emoji. Never add a word to sound caveman. Caveman phrasing not shorter than plain? Use plain.
65
71
 
66
- Resume caveman after clear part done.
72
+ ## When to break the rules
67
73
 
68
- Example shows FORMAT only write warning in session language, not example's.
74
+ Plain prose, then resume:
69
75
 
70
- Example destructive op:
71
- > **Warning:** This will permanently delete all rows in the `users` table and cannot be undone.
72
- > ```sql
73
- > DROP TABLE users;
74
- > ```
75
- > Caveman resume. Verify backup exist first.
76
+ 1. Security warning.
77
+ 2. Irreversible action. Confirm in full sentences first.
78
+ 3. Step order a fragment could scramble.
79
+ 4. User confused or repeats the question.
80
+ 5. Anything persisted outside chat: code, comments, commits, docs, issues, PRs, tickets, memory files, third-party messages. `/caveman-compress`, where the host offers it, is exempt.
81
+ 6. Harness asks for a status line or confirmation. Give it. Harness decides *when* you speak, caveman decides *how*.
82
+ 7. You ask the user a question or offer options. Full sentences, so the answer comes back right first time.
76
83
 
77
- ## Boundaries
84
+ ## Pre-send check
78
85
 
79
- Persisted outside chat: write normal prose code, comments, commits, docs, issue/PR/MR/defect/ticket/bug-report text, memory files, third-party messages (/caveman-compress exempt). "Open a defect" or "file a bug" mean the same as "open issue": body go to other humans, so body normal English. "stop caveman" or "normal mode": revert. Level persist until changed or session end.
86
+ 1. First sentence announces what you will do? Delete.
87
+ 2. Last sentence recaps or offers help? Delete.
88
+ 3. Every not/never/no/only present? Every code span, path, number, error verbatim?
89
+ 4. Any sentence with two readings? Make it a full sentence.
@@ -1,7 +1,7 @@
1
1
  // /combo session toggle: off | medium | balanced | max.
2
2
 
3
3
  import path from 'node:path';
4
- import { existsSync } from 'node:fs';
4
+ import { existsSync, readFileSync } from 'node:fs';
5
5
  import { fileURLToPath, pathToFileURL } from 'node:url';
6
6
  import {
7
7
  activeModesSummary,
@@ -9,10 +9,12 @@ import {
9
9
  getSharedComboState,
10
10
  hasModeState,
11
11
  normalizeComboLevel,
12
+ normalizeMode,
12
13
  reconcileSharedComboEntries,
13
14
  sessionEntries,
14
15
  setSharedComboLevel,
15
16
  setSharedComboListener,
17
+ setSharedComboMode,
16
18
  setSharedComboModes,
17
19
  systemPromptIncludes,
18
20
  } from '../shared/session-state.ts';
@@ -24,16 +26,36 @@ import {
24
26
  readComboDefault,
25
27
  readPluginSettings,
26
28
  readPonytailDefault,
29
+ readPstackDefault,
27
30
  readRtkDefault,
28
31
  saveComboSetup,
29
32
  } from '../shared/plugin-settings.ts';
30
- import { findHoistedPackage, isPiProcess } from '../shared/utils.ts';
33
+ import { findHoistedPackage, isPiProcess, piAgentDir } from '../shared/utils.ts';
31
34
  import type { ComboState, ExtensionApi, ExtensionCtx, SystemPromptEvent } from '../shared/types.ts';
32
35
 
33
36
  const EXTENSION_DIR = path.dirname(fileURLToPath(import.meta.url));
34
37
 
38
+ /** Whether pi declares an upstream Ponytail; read per call so a mid-session settings.json change lands. */
39
+ function piHasUpstreamPonytail(): boolean {
40
+ const agentDir = piAgentDir();
41
+ const localEntry = path.join(agentDir, 'ponytail', 'pi-extension', 'index.js');
42
+ if (existsSync(localEntry)) return true;
43
+ try {
44
+ const raw = readFileSync(path.join(agentDir, 'settings.json'), 'utf8');
45
+ const settings = JSON.parse(raw) as { packages?: unknown };
46
+ const list = Array.isArray(settings.packages) ? settings.packages : [];
47
+ // An npm spec names the package; the installer's local copy is a bare `.../ponytail` dir.
48
+ return list.some((p) => typeof p === 'string' && /ponytail/.test(p));
49
+ } catch {
50
+ return false;
51
+ }
52
+ }
53
+
54
+ // Each level's own rule, quoted from the installed Ponytail so a host that cannot resolve the package still gets the right register: `lite` builds what was asked and offers the smaller option, and only `ultra` questions the request.
35
55
  const PONYTAIL_FALLBACK_INTENSITY: Record<string, string> = {
36
- lite: 'Prefer the simplest correct solution.',
56
+ lite: 'Build what was asked. Name the smaller option in one line and let the user pick.',
57
+ full: 'The rules above. Default.',
58
+ ultra: 'Also question the request: before building, push back on any part the need does not justify.',
37
59
  };
38
60
 
39
61
  // Fallback text when Ponytail cannot be found; exported for its own test.
@@ -43,7 +65,7 @@ export function ponytailFallback(mode: string): string {
43
65
  }
44
66
 
45
67
 
46
- // Ponytail is hoisted, so one upward walk covers every install layout. The hook is CommonJS, so both namespace shapes are tried.
68
+ // Ponytail is hoisted, so one upward walk covers every layout. The hook is CommonJS, so both namespaces are tried.
47
69
  async function loadPonytailInstructions(mode: string): Promise<string> {
48
70
  const installed = findHoistedPackage('@dietrichgebert/ponytail', EXTENSION_DIR, 'hooks', 'ponytail-instructions.js');
49
71
  // The OpenCode tree ships no node_modules; the installer bundles the ruleset beside the extensions.
@@ -62,8 +84,17 @@ async function loadPonytailInstructions(mode: string): Promise<string> {
62
84
  return ponytailFallback(mode);
63
85
  }
64
86
 
87
+ // What a fresh session starts from: a stored per-mode default wins, and with none the Combo preset supplies all four. pstackDefault counts as its own default, so a session that stores only it still honors it instead of losing it to the preset's `off`.
88
+ function savedModes(): { caveman: string; rtk: string; ponytail: string; pstack: string } {
89
+ const hasModeDefaults = ['cavemanDefault', 'rtkDefault', 'ponytailDefault', 'pstackDefault'].some((key) => key in readPluginSettings());
90
+ const preset = COMBO_LEVELS[readComboDefault()];
91
+ return hasModeDefaults
92
+ ? { caveman: readCavemanDefault(), rtk: readRtkDefault() ? 'on' : 'off', ponytail: readPonytailDefault(), pstack: readPstackDefault() }
93
+ : { caveman: preset.caveman, rtk: preset.rtk, ponytail: preset.ponytail, pstack: preset.pstack };
94
+ }
95
+
65
96
  export default function comboToggleExtension(pi: ExtensionApi): void {
66
- setExtensionLabel(pi, 'Combo session toggle (all 3 add-ons)');
97
+ setExtensionLabel(pi, 'Combo session toggle (all four add-ons)');
67
98
 
68
99
  let setupPrompted = false;
69
100
  let lastInjected: string | undefined = undefined;
@@ -76,22 +107,20 @@ export default function comboToggleExtension(pi: ExtensionApi): void {
76
107
  pi.appendEntry?.('caveman-mode', { mode: modes.caveman });
77
108
  pi.appendEntry?.('rtk-mode', { enabled: modes.rtk === 'on' });
78
109
  pi.appendEntry?.('ponytail-mode', { mode: modes.ponytail });
110
+ pi.appendEntry?.('pstack-mode', { mode: modes.pstack });
79
111
  pi.appendEntry?.('combo-level', { level });
80
112
  }
81
113
  function restoreConfiguredDefaults(): void {
82
- const settings = readPluginSettings();
83
- const hasModeDefaults = ['cavemanDefault', 'rtkDefault', 'ponytailDefault'].some((key) => key in settings);
84
114
  const combo = readComboDefault();
85
115
  const preset = COMBO_LEVELS[combo];
86
- const modes = hasModeDefaults
87
- ? { caveman: readCavemanDefault(), rtk: readRtkDefault() ? 'on' : 'off', ponytail: readPonytailDefault() }
88
- : preset;
116
+ const modes = savedModes();
89
117
  setSharedComboModes(modes);
90
- if (modes.caveman === 'off' && modes.rtk === 'off' && modes.ponytail === 'off') return;
118
+ if (modes.caveman === 'off' && modes.rtk === 'off' && modes.ponytail === 'off' && modes.pstack === 'off') return;
91
119
  pi.appendEntry?.('caveman-mode', { mode: modes.caveman });
92
120
  pi.appendEntry?.('rtk-mode', { enabled: modes.rtk === 'on' });
93
121
  pi.appendEntry?.('ponytail-mode', { mode: modes.ponytail });
94
- if (preset && modes.caveman === preset.caveman && modes.rtk === preset.rtk && modes.ponytail === preset.ponytail) {
122
+ pi.appendEntry?.('pstack-mode', { mode: modes.pstack });
123
+ if (preset && modes.caveman === preset.caveman && modes.rtk === preset.rtk && modes.ponytail === preset.ponytail && modes.pstack === preset.pstack) {
95
124
  pi.appendEntry?.('combo-level', { level: combo });
96
125
  }
97
126
  }
@@ -113,7 +142,7 @@ export default function comboToggleExtension(pi: ExtensionApi): void {
113
142
  }
114
143
 
115
144
  pi.registerCommand?.('combo', {
116
- description: 'Toggle all 3 Tersio modes at once. Usage: /combo <off|medium|balanced|max|status>',
145
+ description: 'Toggle all four Tersio modes at once. Usage: /combo <off|medium|balanced|max|status>',
117
146
  handler: async (args, ctx) => {
118
147
  listen(ctx);
119
148
  const arg = String(args || '').trim().toLowerCase();
@@ -126,10 +155,10 @@ export default function comboToggleExtension(pi: ExtensionApi): void {
126
155
 
127
156
  if (arg === 'help') {
128
157
  ctx?.ui?.notify?.(
129
- '/combo off — disables all 3 (caveman, rtk, ponytail)\n' +
130
- '/combo medium — light: caveman=lite, rtk=on, ponytail=lite\n' +
131
- '/combo balanced — middle: caveman=full, rtk=on, ponytail=full\n' +
132
- '/combo max — aggressive: caveman=ultra, rtk=on, ponytail=ultra',
158
+ '/combo off — disables every mode (caveman, rtk, ponytail, pstack)\n' +
159
+ '/combo medium — light: caveman=lite, rtk=on, ponytail=lite, pstack=on\n' +
160
+ '/combo balanced — middle: caveman=full, rtk=on, ponytail=full, pstack=on\n' +
161
+ '/combo max — aggressive: caveman=ultra, rtk=on, ponytail=ultra, pstack=on',
133
162
  'info'
134
163
  );
135
164
  return;
@@ -150,14 +179,35 @@ export default function comboToggleExtension(pi: ExtensionApi): void {
150
179
  },
151
180
  });
152
181
 
182
+ // Upstream owns /ponytail on pi; this tree registers it only where nothing else does.
183
+ if (!(isPiProcess() && piHasUpstreamPonytail())) pi.registerCommand?.('ponytail', {
184
+ description: 'Switch Ponytail intensity (off|lite|full|ultra). Usage: /ponytail [level|status]',
185
+ handler: async (args, ctx) => {
186
+ listen(ctx);
187
+ const arg = String(args || '').trim().toLowerCase();
188
+ if (!arg || arg === 'status') {
189
+ announceStatus(ctx);
190
+ return;
191
+ }
192
+ const mode = normalizeMode('ponytail', arg);
193
+ if (!mode) {
194
+ ctx?.ui?.notify?.(`Unknown Ponytail level: ${arg}. Use: off | lite | full | ultra`, 'warning');
195
+ return;
196
+ }
197
+ pi.appendEntry?.('ponytail-mode', { mode });
198
+ setSharedComboMode('ponytail', mode);
199
+ announceStatus(ctx);
200
+ },
201
+ });
202
+
153
203
  async function runFirstRunSetup(ctx?: ExtensionCtx): Promise<void> {
154
204
  if (setupPrompted || !ctx?.hasUI || !ctx.ui?.select || isComboSetupComplete()) return;
155
205
  setupPrompted = true;
156
206
  const choice = await hostSelect(pi, ctx.ui, 'Session-start defaults — Combo preset', [
157
207
  { label: 'off', description: 'Keep every Tersio mode inactive' },
158
- { label: 'medium', description: 'caveman=lite, rtk=on, ponytail=lite' },
159
- { label: 'balanced', description: 'caveman=full, rtk=on, ponytail=full' },
160
- { label: 'max', description: 'caveman=ultra, rtk=on, ponytail=ultra' },
208
+ { label: 'medium', description: 'caveman=lite, rtk=on, ponytail=lite, pstack=on' },
209
+ { label: 'balanced', description: 'caveman=full, rtk=on, ponytail=full, pstack=on' },
210
+ { label: 'max', description: 'caveman=ultra, rtk=on, ponytail=ultra, pstack=on' },
161
211
  ], { selectionMarker: 'radio', helpText: 'You can change this later with /tersio settings.' });
162
212
  const level = choice || 'off';
163
213
  if (saveComboSetup(level) && level !== 'off') {
@@ -173,6 +223,18 @@ export default function comboToggleExtension(pi: ExtensionApi): void {
173
223
  // The configured defaults apply when a fresh session has no persisted mode state.
174
224
  const entries = sessionEntries(ctx);
175
225
  if (!hasModeState(entries) && (ctx?.hasUI || OPENCODE)) restoreConfiguredDefaults();
226
+ else if (!hasModeState(entries)) {
227
+ // A headless root session (`host -p`) has no UI to publish the bridge, and Ponytail reads only
228
+ // the bridge, so it never loaded: a benchmark on omp measured Block 0 for every Ponytail level and
229
+ // for the Ponytail part of every Combo. Publish the saved modes only while the bridge is clear:
230
+ // once a parent or a toggle has published, the bridge carries that session's own choice and a
231
+ // subagent branch must keep inheriting it. All four go together, because Caveman, RTK, and pstack
232
+ // already restored their own levels and a disagreeing bridge resets them.
233
+ const shared = getSharedComboState();
234
+ if (shared.caveman === 'off' && shared.rtk === 'off' && shared.ponytail === 'off' && shared.pstack === 'off') {
235
+ setSharedComboModes(savedModes());
236
+ }
237
+ }
176
238
  // Announced last, so any default above is reflected.
177
239
  announceStatus(ctx);
178
240
  });
@@ -188,10 +250,11 @@ export default function comboToggleExtension(pi: ExtensionApi): void {
188
250
 
189
251
  pi.on<SystemPromptEvent>('before_agent_start', async (event, ctx) => {
190
252
  if (ctx?.hasUI) reconcile(ctx);
253
+ // Shared state, with no marker check: the marker is a sentence copied out of the host binary, so matching on it would drop Ponytail after a host reworded the line.
191
254
  const mode = getSharedComboState().ponytail;
192
- // On pi the upstream ponytail pi-extension is the single injector; it reads these 'ponytail-mode' entries at session start, so Tersio only persists.
193
- if (isPiProcess()) return;
194
- // Match the level's own header: the shared phrase alone makes every level block every other, so a `/combo` level switch is ignored all session.
255
+ // On pi, an installed upstream pi-extension is the sole injector, so Tersio only falls back with none.
256
+ if (isPiProcess() && piHasUpstreamPonytail()) return;
257
+ // Match the level's own header: a shared phrase makes every level block the rest, so a `/combo` switch does nothing.
195
258
  if (mode === 'off' || systemPromptIncludes(event.systemPrompt, `PONYTAIL MODE ACTIVE — level: ${mode}`)) return;
196
259
  const instruction = await loadPonytailInstructions(mode);
197
260
  // The previous level's block is replaced, not stacked on.
@@ -88,7 +88,7 @@ export default function tersioCommandsExtension(pi: ExtensionApi): void {
88
88
  ctx?.ui?.notify?.(usageSummary(), 'info');
89
89
  return;
90
90
  }
91
- // Removed mode switches redirect to their own commands so only one spelling exists to learn: /caveman, /rtk, /combo, /ponytail.
91
+ // Removed mode switches redirect to their own commands, so there is one spelling: /caveman, /rtk, /combo, /ponytail.
92
92
  if (sub === 'caveman' || sub === 'rtk' || sub === 'combo' || sub === 'ponytail') {
93
93
  ctx?.ui?.notify?.(`Use /${sub} instead — /tersio no longer duplicates mode switches.\n${HELP}`, 'warning');
94
94
  return;