the-high-council 0.8.1 → 0.8.3

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 (287) hide show
  1. package/.env.example +6 -6
  2. package/CONTRIBUTING.md +12 -33
  3. package/PERSONAS.md +1 -1
  4. package/README.md +326 -152
  5. package/TROUBLESHOOTING.md +5 -6
  6. package/chains/advise-single-astra.json +2 -3
  7. package/chains/advise-single-deepseek.json +5 -6
  8. package/chains/advise-single-gemini.json +2 -3
  9. package/chains/advise-single-glm-flash.json +40 -0
  10. package/chains/advise-single-opus.json +1 -2
  11. package/chains/advise-single-qwen.json +38 -0
  12. package/chains/advise-single.json +2 -3
  13. package/chains/advise-standard.json +2 -3
  14. package/chains/daily7-sub-a.json +161 -0
  15. package/chains/mock-advise-deep.json +1 -2
  16. package/chains/mock-advise-quick.json +1 -2
  17. package/chains/mock-advise-single.json +1 -2
  18. package/chains/mock-advise-standard.json +1 -2
  19. package/chains/mock-layered.json +69 -0
  20. package/chains/plan-china-high-council.json +312 -0
  21. package/chains/plan-china-medium-council.json +244 -0
  22. package/chains/plan-china-mini-council.json +181 -0
  23. package/chains/plan-claude-council.json +151 -0
  24. package/chains/plan-default-opro-council.json +250 -0
  25. package/chains/plan-high-council.json +327 -0
  26. package/chains/plan-medium-council.json +255 -0
  27. package/chains/plan-mini-council-sol-session.json +186 -0
  28. package/chains/plan-mini-council.json +186 -0
  29. package/chains/verify.json +1 -1
  30. package/package.json +3 -2
  31. package/schemas/contract-v1.json +71 -0
  32. package/schemas/gate-ledger-v1.json +16 -1
  33. package/schemas/report-v1.json +303 -17
  34. package/schemas/spend-reservations-v1.json +23 -0
  35. package/src/advice-brief.js +6 -4
  36. package/src/advice-guards.js +44 -7
  37. package/src/advice-retention.json +153 -52
  38. package/src/advice-send-context.js +31 -0
  39. package/src/advise.js +5 -2
  40. package/src/answer-back.js +116 -0
  41. package/src/answered-by.js +183 -0
  42. package/src/api.js +41 -18
  43. package/src/argued.js +6 -2
  44. package/src/audit.js +27 -3
  45. package/src/backed-round-choices.js +15 -0
  46. package/src/board-export.js +3 -2
  47. package/src/budget.js +2 -6
  48. package/src/cache-integrity.js +4 -0
  49. package/src/canary.js +12 -2
  50. package/src/cap-input.js +48 -0
  51. package/src/cap-screen.js +72 -0
  52. package/src/chain-lint.js +206 -21
  53. package/src/chain-name.js +31 -1
  54. package/src/chain.js +1915 -371
  55. package/src/claims.js +2 -1
  56. package/src/cli.js +1566 -342
  57. package/src/conflict-decider.js +129 -0
  58. package/src/conflict-detector.js +60 -0
  59. package/src/container-text.js +34 -0
  60. package/src/context-files.js +7 -0
  61. package/src/contract-cli.js +184 -0
  62. package/src/contract-draft.js +50 -0
  63. package/src/contract-lint.js +101 -0
  64. package/src/contract-record.js +511 -0
  65. package/src/cost-forecast.js +13 -7
  66. package/src/cost.js +164 -40
  67. package/src/council-replay.js +17 -5
  68. package/src/criteria-kinds.js +11 -1
  69. package/src/criteria-ledger.js +82 -3
  70. package/src/criteria-lock.js +1 -1
  71. package/src/debate-order.js +48 -0
  72. package/src/deep-dive.js +5 -3
  73. package/src/default-cap.js +9 -0
  74. package/src/denied-models.js +10 -3
  75. package/src/dissent-digest.js +13 -6
  76. package/src/draft-disputes.js +85 -4
  77. package/src/dry-run.js +32 -6
  78. package/src/env-file.js +60 -9
  79. package/src/errors.js +33 -12
  80. package/src/exit-codes.js +14 -0
  81. package/src/fence.js +3 -2
  82. package/src/from-run-files.js +6 -0
  83. package/src/gate-cli.js +122 -13
  84. package/src/gate-ledger.js +11 -5
  85. package/src/gate.js +212 -16
  86. package/src/git.js +10 -0
  87. package/src/handoff-contract-text.js +72 -0
  88. package/src/handoff-from-run.js +123 -21
  89. package/src/handoff-prompt.js +21 -0
  90. package/src/held-roles.js +20 -0
  91. package/src/hidden-chars.js +86 -0
  92. package/src/invocation.js +2 -1
  93. package/src/key-redaction.js +2 -2
  94. package/src/lab-safety.js +42 -0
  95. package/src/lanes.js +21 -0
  96. package/src/layers.js +120 -0
  97. package/src/mcp/advice.js +45 -40
  98. package/src/mcp/contract.js +72 -0
  99. package/src/mcp/price-raise.js +87 -0
  100. package/src/mcp/progress-wait.js +45 -0
  101. package/src/mcp/run-end.js +17 -0
  102. package/src/mcp/server.js +499 -142
  103. package/src/mcp/tree-block.js +52 -0
  104. package/src/mcp/tree-decide.js +61 -0
  105. package/src/mcp/tree-members.js +17 -0
  106. package/src/mcp/tree-status.js +87 -0
  107. package/src/mcp/untrusted.js +17 -6
  108. package/src/mcp/usd-limit.js +40 -0
  109. package/src/metrics.js +15 -7
  110. package/src/milestones.js +127 -0
  111. package/src/objection-ids.js +32 -0
  112. package/src/objection-ledger.js +153 -0
  113. package/src/old-plan.js +93 -0
  114. package/src/outbound-scan.js +9 -3
  115. package/src/overseer-rounds.js +185 -0
  116. package/src/pii-gate.js +6 -4
  117. package/src/pii-mode.js +24 -0
  118. package/src/policy.js +78 -8
  119. package/src/post-quotes.js +56 -0
  120. package/src/price-limits.js +75 -0
  121. package/src/price-pin.js +69 -0
  122. package/src/price-raise.js +111 -0
  123. package/src/price-refused.js +168 -0
  124. package/src/price-table.js +146 -0
  125. package/src/pricing.json +112 -29
  126. package/src/providers.js +294 -52
  127. package/src/reasoning-table.json +147 -38
  128. package/src/reasoning.js +85 -12
  129. package/src/rematch.js +51 -18
  130. package/src/replay.js +2 -1
  131. package/src/report-shape.js +142 -6
  132. package/src/resume-brief.js +22 -4
  133. package/src/resume-ceiling.js +9 -0
  134. package/src/return-path.js +11 -3
  135. package/src/review-notes-lane.js +61 -0
  136. package/src/review-notes.js +207 -0
  137. package/src/roles.js +537 -17
  138. package/src/run-budget.js +22 -10
  139. package/src/run-contract-check.js +33 -0
  140. package/src/run-files.js +177 -0
  141. package/src/run-lock.js +141 -25
  142. package/src/run-preflight.js +224 -0
  143. package/src/run-state.js +1 -0
  144. package/src/run-status.js +85 -24
  145. package/src/seat-key.js +60 -0
  146. package/src/secret-patterns.js +91 -2
  147. package/src/security-review.js +8 -4
  148. package/src/seeded-shuffle.js +26 -0
  149. package/src/send-path-refusals.js +20 -7
  150. package/src/send-path.js +59 -16
  151. package/src/send-profiles.js +5 -3
  152. package/src/spend-reservations.js +85 -0
  153. package/src/spend.js +150 -28
  154. package/src/stage-cache.js +96 -0
  155. package/src/stage-contract.js +34 -6
  156. package/src/stage-submission.js +39 -9
  157. package/src/stage-system.js +112 -0
  158. package/src/start-cap.js +121 -0
  159. package/src/start-scope.js +56 -0
  160. package/src/stop-files.js +22 -3
  161. package/src/superseded-n.js +22 -0
  162. package/src/superseded.js +26 -11
  163. package/src/table-reasons.js +7 -0
  164. package/src/table-rows.js +48 -0
  165. package/src/terminal-safe.js +15 -0
  166. package/src/text-labels.js +81 -0
  167. package/src/thin-contract-check.js +94 -0
  168. package/src/thin-contract.js +60 -0
  169. package/src/tools.js +102 -29
  170. package/src/tree-abandon.js +72 -0
  171. package/src/tree-accept.js +172 -0
  172. package/src/tree-advice-parse.js +54 -0
  173. package/src/tree-advice-record.js +178 -0
  174. package/src/tree-advice-route.js +189 -0
  175. package/src/tree-advice.js +87 -0
  176. package/src/tree-affected.js +87 -0
  177. package/src/tree-approve-session.js +98 -0
  178. package/src/tree-approve.js +128 -0
  179. package/src/tree-blocked-child.js +89 -0
  180. package/src/tree-budget.js +618 -0
  181. package/src/tree-bundle-input.js +105 -0
  182. package/src/tree-ceiling.js +57 -0
  183. package/src/tree-chain-limits.js +114 -0
  184. package/src/tree-check.js +262 -0
  185. package/src/tree-choice.js +199 -0
  186. package/src/tree-cli.js +123 -0
  187. package/src/tree-close.js +175 -0
  188. package/src/tree-context-refs.js +90 -0
  189. package/src/tree-continuation.js +209 -0
  190. package/src/tree-decide-accept.js +156 -0
  191. package/src/tree-decide-session.js +222 -0
  192. package/src/tree-decide-size.js +77 -0
  193. package/src/tree-decide-stop.js +467 -0
  194. package/src/tree-decide.js +716 -0
  195. package/src/tree-decision-event.js +7 -0
  196. package/src/tree-deps.js +121 -0
  197. package/src/tree-derive-load.js +177 -0
  198. package/src/tree-derive.js +396 -0
  199. package/src/tree-detect.js +67 -0
  200. package/src/tree-expansion.js +161 -0
  201. package/src/tree-fan-out.js +10 -0
  202. package/src/tree-files.js +57 -0
  203. package/src/tree-frontier.js +418 -0
  204. package/src/tree-gate.js +98 -0
  205. package/src/tree-handoff.js +532 -0
  206. package/src/tree-identity.js +53 -0
  207. package/src/tree-loop.js +464 -0
  208. package/src/tree-member-cover.js +37 -0
  209. package/src/tree-member.js +346 -0
  210. package/src/tree-obligation.js +56 -0
  211. package/src/tree-person-stop.js +66 -0
  212. package/src/tree-pii-mode.js +68 -0
  213. package/src/tree-price-stop.js +55 -0
  214. package/src/tree-projection.js +88 -0
  215. package/src/tree-qid.js +47 -0
  216. package/src/tree-readiness.js +78 -0
  217. package/src/tree-ready.js +555 -0
  218. package/src/tree-rebuild.js +143 -0
  219. package/src/tree-record.js +255 -0
  220. package/src/tree-recovery.js +181 -0
  221. package/src/tree-redirect.js +57 -0
  222. package/src/tree-register.js +104 -0
  223. package/src/tree-report.js +92 -0
  224. package/src/tree-restore.js +155 -0
  225. package/src/tree-resume.js +301 -0
  226. package/src/tree-reuse-load.js +234 -0
  227. package/src/tree-reuse-wire.js +74 -0
  228. package/src/tree-reuse.js +299 -0
  229. package/src/tree-root-replan.js +149 -0
  230. package/src/tree-root-task.js +35 -0
  231. package/src/tree-root-unstarted.js +13 -0
  232. package/src/tree-run.js +278 -0
  233. package/src/tree-session-draft.js +91 -0
  234. package/src/tree-split-changed.js +43 -0
  235. package/src/tree-split.js +304 -0
  236. package/src/tree-start.js +294 -0
  237. package/src/tree-status.js +224 -0
  238. package/src/tree-stop-marker.js +10 -0
  239. package/src/tree-stop-view.js +112 -0
  240. package/src/tree-stop.js +314 -0
  241. package/src/tree-task-pin.js +61 -0
  242. package/src/tree-transitions.js +1726 -0
  243. package/src/tree-ways-on.js +14 -0
  244. package/src/ui/app.js +2 -2
  245. package/src/ui/server.js +26 -5
  246. package/src/unknown-flag.js +132 -0
  247. package/src/unpriced.js +18 -0
  248. package/src/usd-figure.js +9 -0
  249. package/src/verdict-envelope.js +95 -0
  250. package/src/verdict-headline.js +76 -0
  251. package/src/verdict-stats.js +11 -4
  252. package/types/index.d.ts +18 -8
  253. package/chains/advise-premium.json +0 -145
  254. package/chains/cheap-7-v2.json +0 -149
  255. package/chains/cheap-7.json +0 -148
  256. package/chains/cheap.json +0 -53
  257. package/chains/coder-gate-v1.json +0 -74
  258. package/chains/coder-gate-v2.json +0 -71
  259. package/chains/eu-only.json +0 -62
  260. package/chains/gp-judge-v1.json +0 -109
  261. package/chains/idea-open-c2.json +0 -100
  262. package/chains/plan-auto-mistral.json +0 -131
  263. package/chains/plan-auto.json +0 -136
  264. package/chains/plan-cheap.json +0 -85
  265. package/chains/plan-daily-7.json +0 -154
  266. package/chains/plan-debate-c2.json +0 -91
  267. package/chains/plan-debate-open-c2.json +0 -92
  268. package/chains/plan-debate-roles-c1.json +0 -112
  269. package/chains/plan-debate.json +0 -121
  270. package/chains/plan-fast.json +0 -66
  271. package/chains/plan-highest-7.json +0 -182
  272. package/chains/plan-open-7.json +0 -123
  273. package/chains/plan-premium-7.json +0 -144
  274. package/chains/plan-proposals-best-of-5.json +0 -101
  275. package/chains/plan-proposals.json +0 -99
  276. package/chains/plan-relay.json +0 -86
  277. package/chains/plan-thorough.json +0 -85
  278. package/chains/plan-two-strong.json +0 -110
  279. package/chains/plan-unanimous.json +0 -85
  280. package/chains/security-review-only.json +0 -29
  281. package/chains/seven-cheap.json +0 -88
  282. package/chains/seven.json +0 -81
  283. package/chains/single-vendor-anthropic.json +0 -69
  284. package/chains/single-vendor-openai.json +0 -58
  285. package/chains/smo-v2-cheap.json +0 -85
  286. package/chains/smo.json +0 -72
  287. package/chains/us-only.json +0 -65
package/.env.example CHANGED
@@ -13,11 +13,11 @@ ZAI_API_KEY=
13
13
 
14
14
  # Default per-run spend ceiling in USD. Overridden per run by --max-usd.
15
15
  # A run stops cleanly before any stage that could take it past this, and
16
- # resumes with a higher ceiling. Unset means $7. Use --max-usd none to run
17
- # without a ceiling.
16
+ # resumes with a higher ceiling. Unset means $7 for a chain with no paid seat;
17
+ # a paid chain asks you to type its limit (this value is only the suggestion).
18
+ # --max-usd none works for a chain with no paid seat only.
18
19
  MAX_USD_PER_RUN=7
19
20
 
20
- # Optional settings (README "Setup" lists them all): COUNCIL_WORKDIR and
21
- # COUNCIL_MAX_USD_LIMIT for the MCP server, COUNCIL_ALLOW_LOOPBACK_KEY_HOST=1
22
- # for a local proxy in front of a keyed provider, OLLAMA_API_KEY,
23
- # COUNCIL_PERSONAS_FILE, AUDIT_HMAC_KEY_FILE.
21
+ # Optional settings (README "Setup" lists them all): COUNCIL_MAX_USD_LIMIT (a ceiling: the MCP server's tools cannot lift it and the limit you type for a paid run, or the total you type for a paid tree (`council tree start --max-usd`, `council tree decide --amend-cap`), cannot go above it), OLLAMA_API_KEY, AUDIT_HMAC_KEY_FILE.
22
+ # Six settings are NOT read from a .env (the CLI prints a notice and ignores them there): set them in the real environment:
23
+ # COUNCIL_ADVICE_SENSITIVITY_FLOOR, COUNCIL_ADVICE_CHAINS_DIR, COUNCIL_WORKDIR, COUNCIL_PERSONAS_FILE, COUNCIL_PII_GATE and COUNCIL_ALLOW_LOOPBACK_KEY_HOST=1 (for a local proxy in front of a keyed provider).
package/CONTRIBUTING.md CHANGED
@@ -1,41 +1,20 @@
1
1
  # Contributing
2
2
 
3
- This project has one maintainer. The bottleneck is reviewing pull requests, not writing code -
4
- an unscoped PR costs more of that time than it saves. The three shapes below are pre-scoped and
5
- easy to land; a PR outside them is welcome but will take longer to review, since it needs a scope
6
- discussion first.
3
+ The most useful help right now: tell us what your runs cost.
7
4
 
8
- ## The three smallest landable contributions
5
+ ## Send a run cost
9
6
 
10
- 1. **A new provider adapter** (`src/providers.js`). Every provider except `mock`/`external` speaks
11
- either the Anthropic Messages API or the OpenAI chat-completions shape via `OPENAI_COMPAT`.
12
- Adding a new OpenAI-compatible provider is usually one entry in `OPENAI_COMPAT` plus a pricing
13
- row in `src/pricing.json`. Test it the way the existing providers are tested: no network calls
14
- in `node --test`, real calls are opt-in and cost real money.
7
+ After a paid run, type `council --spend --days 30` in your project folder. Then
8
+ [open an issue](https://github.com/muad-yasin/the-high-council-mcp/issues/new) titled "Run cost: <chain>" with
9
+ that run's line, your version (`council --version`) and roughly how long your task was. Never paste your task,
10
+ your plan or a folder path. Your figure goes into the README's [Pricing](README.md#pricing) table.
15
11
 
16
- 2. **A new chain config** (`chains/*.json`). A chain is data, not code - it names which seats run
17
- which stages. `council doctor --chain chains/<yours>.json` lints it (the same rules every run
18
- applies, including the denied-model and `key-host` rules), and `council doctor` prices it
19
- worst-case, both with zero network calls; run both against your new file before opening a PR. Look at `chains/plan-debate.json` or `chains/verify.json` as a starting
20
- shape depending on whether you want a debate-and-panel chain or a single-critic chain.
12
+ ## Code
21
13
 
22
- 3. **A new mock fixture** (`src/providers.js`'s `callMock`, exercised from `test/*.test.js`). If
23
- you're adding test coverage for a new code path in the chain itself, the offline `mock`
24
- provider needs a new scripted branch (keyed on a `mock-<something>` model name) rather than a
25
- real API call. See the existing branches in `callMock` - `mock-unreadable`,
26
- `mock-provider-error` - for the shape: a model name that triggers one deterministic scripted
27
- reply, documented with which real-world failure it stands in for.
14
+ Bug, docs and typo fixes are always welcome. For anything bigger, open an issue first. Quickest to review: a
15
+ provider adapter, a chain config, a mock fixture or a skill change. `npm test` runs offline for $0 and checks
16
+ the project's rules (no Grok, reasoning never lowered, prompt wording only in `src/roles.js`).
28
17
 
29
- ## Everything else
18
+ Two things are settled: bring-your-own-key only, and no claim about output quality until it is measured.
30
19
 
31
- Bug fixes, docs fixes, and typo fixes are always welcome with no scoping step. Anything larger -
32
- a new CLI command, a new stage, a change to what a chain's JSON schema can express - should start
33
- as an issue describing what it's for, before the PR, so review time isn't spent re-deriving scope
34
- from a diff.
35
-
36
- ## Running the tests
37
-
38
- npm test
39
-
40
- Offline, no API key, no network call, no cost. `node --test` matches the project's own test
41
- runner - no additional test framework to install.
20
+ Security issues: [contact@sower-industries.de](mailto:contact@sower-industries.de).
package/PERSONAS.md CHANGED
@@ -25,7 +25,7 @@ here is a secondary association in a reader's mind, not a legal one - worth havi
25
25
  not worth revisiting a decision already made.
26
26
 
27
27
  A `role.persona` key that is not in the set in use is sent as a bare name, with no voice
28
- directive. `plan-premium-7` seats two such keys, `hypatia` and `avicenna`, next to the five
28
+ directive. The retired `plan-premium-7` (in `chains/outdated/`) seats two such keys, `hypatia` and `avicenna`, next to the five
29
29
  defaults: without a persona file of your own they reach the debate prompt as those names alone.
30
30
 
31
31
  **You can replace the whole set.** `loadPersonas()` in `src/personas.js` reads an operator-supplied