alphacouncil-agent 0.9.2 → 0.9.4

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 (79) hide show
  1. package/.claude/commands/alpha.md +22 -3
  2. package/.claude-plugin/marketplace.json +2 -2
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/.codex-plugin/plugin.json +1 -1
  5. package/.grok/commands/alpha.md +22 -3
  6. package/.opencode/command/alpha.md +22 -3
  7. package/AGENTS.md +27 -4
  8. package/CHANGELOG.md +67 -0
  9. package/CLAUDE.md +41 -7
  10. package/README.ja.md +21 -11
  11. package/README.md +35 -11
  12. package/README.zh-CN.md +31 -11
  13. package/commands/alpha.md +22 -3
  14. package/data/build-profile.v1.json +1 -1
  15. package/data/master-selector-method-locales.v1.mjs +286 -0
  16. package/docs/INSTALL.md +43 -6
  17. package/docs/releases/v0.9.3.md +86 -0
  18. package/docs/releases/v0.9.4.md +79 -0
  19. package/docs/report-contract.md +50 -1
  20. package/knowledge/ai-assisted-solo/experiments/runs/a.json +4 -4
  21. package/knowledge/ai-assisted-solo/experiments/runs/b.json +2 -2
  22. package/knowledge/ai-assisted-solo/experiments/runs/c.json +2 -2
  23. package/knowledge/ai-assisted-solo/experiments/runs/d13.json +16 -16
  24. package/knowledge/ai-assisted-solo/experiments/runs/d26.json +29 -29
  25. package/knowledge/ai-assisted-solo/experiments/runs/e-d13.json +19 -19
  26. package/knowledge/ai-assisted-solo/experiments/runs/e-d26.json +32 -32
  27. package/knowledge/ai-assisted-solo/experiments/runs/h_ai_reference.json +33 -33
  28. package/knowledge/ai-assisted-solo/experiments/simulation-input.json +79 -79
  29. package/knowledge/ai-assisted-solo/experiments/simulation-manifest.json +19 -19
  30. package/knowledge/solo-test/masters/master_ackman/manifest.json +14 -4
  31. package/knowledge/solo-test/masters/master_aschenbrenner/manifest.json +14 -4
  32. package/knowledge/solo-test/masters/master_asness/manifest.json +14 -4
  33. package/knowledge/solo-test/masters/master_buffett/manifest.json +14 -4
  34. package/knowledge/solo-test/masters/master_burry/manifest.json +14 -4
  35. package/knowledge/solo-test/masters/master_cathie_wood/manifest.json +14 -4
  36. package/knowledge/solo-test/masters/master_dalio/manifest.json +14 -4
  37. package/knowledge/solo-test/masters/master_damodaran/manifest.json +14 -4
  38. package/knowledge/solo-test/masters/master_druckenmiller/manifest.json +14 -4
  39. package/knowledge/solo-test/masters/master_duan_yongping/manifest.json +14 -4
  40. package/knowledge/solo-test/masters/master_fisher/manifest.json +14 -4
  41. package/knowledge/solo-test/masters/master_forensic_short/manifest.json +14 -4
  42. package/knowledge/solo-test/masters/master_graham/manifest.json +14 -4
  43. package/knowledge/solo-test/masters/master_jhunjhunwala/manifest.json +14 -4
  44. package/knowledge/solo-test/masters/master_klarman/manifest.json +14 -4
  45. package/knowledge/solo-test/masters/master_li_lu/manifest.json +14 -4
  46. package/knowledge/solo-test/masters/master_lynch/manifest.json +14 -4
  47. package/knowledge/solo-test/masters/master_marks/manifest.json +14 -4
  48. package/knowledge/solo-test/masters/master_munger/manifest.json +14 -4
  49. package/knowledge/solo-test/masters/master_natenberg/manifest.json +14 -4
  50. package/knowledge/solo-test/masters/master_pabrai/manifest.json +14 -4
  51. package/knowledge/solo-test/masters/master_simons/manifest.json +14 -4
  52. package/knowledge/solo-test/masters/master_sinclair/manifest.json +14 -4
  53. package/knowledge/solo-test/masters/master_soros/manifest.json +14 -4
  54. package/knowledge/solo-test/masters/master_taleb/manifest.json +14 -4
  55. package/knowledge/solo-test/masters/master_thorp/manifest.json +14 -4
  56. package/mcp/lib/codex.mjs +3 -3
  57. package/mcp/lib/constants.mjs +61 -25
  58. package/mcp/lib/council-options.mjs +95 -40
  59. package/mcp/lib/council-selection.mjs +95 -9
  60. package/mcp/lib/gates.mjs +78 -11
  61. package/mcp/lib/lang.mjs +109 -2
  62. package/mcp/lib/markdown.mjs +444 -135
  63. package/mcp/lib/master-catalog.mjs +28 -3
  64. package/mcp/lib/orchestrator.mjs +952 -265
  65. package/mcp/lib/packets.mjs +173 -20
  66. package/mcp/lib/personas/engine.mjs +30 -30
  67. package/mcp/lib/personas-v3/compiler.mjs +2 -0
  68. package/mcp/lib/personas-v3/loader.mjs +10 -7
  69. package/mcp/lib/personas-v3/source-acquisition.mjs +10 -3
  70. package/mcp/lib/prompts.mjs +33 -0
  71. package/mcp/lib/rpc.mjs +75 -33
  72. package/mcp/lib/run-store.mjs +23 -0
  73. package/package.json +2 -2
  74. package/schemas/persona-v3.schema.json +37 -2
  75. package/scripts/lib/packaged-host-parity.mjs +54 -5
  76. package/scripts/lib/persona-v3-solo-test-packs.mjs +31 -5
  77. package/scripts/package-smoke.mjs +31 -12
  78. package/scripts/run-tests.mjs +23 -2
  79. package/skills/alphacouncil-agent/SKILL.md +50 -7
@@ -20,10 +20,15 @@ after Stage 0.
20
20
  - **Full council (`full_v2`)**: run all 8 planned evidence roles (`market_data`,
21
21
  `earnings_deep_dive`, `forward_expectations`, `quant_factor`, `valuation_long_short`,
22
22
  `news_industry_management`, `insider_sec`, `ib_event_analysis`), then every selected
23
- master, then the three-round bull/bear cross-exam, then `portfolio_manager`. When a plan
23
+ master, then the three-round bull/bear cross-exam, then `portfolio_manager`. In the
24
+ plugin-managed headless path the eight roles start in one parallel wave; each selected v3
25
+ method freezes its deterministic stance before one isolated voice worker explains it; and
26
+ Bull/Bear run in parallel within each round with a barrier between rounds. When a plan
24
27
  explicitly adds optional analyst seats, every added seat is equally mandatory. A mandatory
25
28
  evidence failure is a fail-fast barrier: persist the failure and final diagnostic artifacts,
26
29
  skip masters/debate/PM model calls, and terminate `incomplete`; do not synthesize around it.
30
+ Headless full has a hard 1800000 ms queue-to-terminal-persistence ceiling. It fails closed
31
+ at expiry and does not promise all-seat success when external services deteriorate.
27
32
  - **Quick council (`quick_v1`)**: only the plugin-managed headless `analyze_symbol` path may
28
33
  execute it. It runs the four fixed evidence roles in parallel, 1-4 selected methods in
29
34
  parallel, one parallel bull/bear statement, and one short PM inside the hard 600000 ms
@@ -53,7 +58,8 @@ council and skip Stage 0.
53
58
  Use the inferred language for the Stage 0 catalog, visible progress, agent prompts, evidence
54
59
  packets, debate packets and final synthesis unless the user explicitly requests another
55
60
  language. Always pass the original user request in `prompt` and the inferred language in
56
- `language`.
61
+ `language`. System-owned catalog/report/handoff labels and failure text are localized for
62
+ `zh-CN`, `en`, `ja` and `ko`; stable IDs and JSON field names remain English.
57
63
 
58
64
  ## Stage 0 — Display, confirm and receipt-gate the master selection
59
65
 
@@ -101,6 +107,36 @@ time is a question with an obvious answer. Master selection is the one configura
101
107
  Do not ask about analysts: they default to the eight-seat fan-out. Use all eleven only if
102
108
  the user asked for breadth, and say so in the report rather than asking first.
103
109
 
110
+ ### Full v2 plugin-managed contract
111
+
112
+ Use this contract when full runs through headless `analyze_symbol`:
113
+
114
+ - Call `analyze_symbol` once with the full-mode receipt, `council_mode: "full"`,
115
+ `wait_for_completion: false`, and no task override unless the user explicitly requested
116
+ optional breadth. Poll the one durable `run_id`; never create a replacement.
117
+ - The eight mandatory evidence roles start together. Each has one bounded parse-only repair;
118
+ repair converts malformed output and does not repeat web research.
119
+ - After the evidence barrier, every selected physical v3 method executes its deterministic
120
+ policy and freezes its stance. Exactly one isolated voice worker is then launched for that
121
+ stable ID. It may explain the recorded policy result in the user's language, but cannot
122
+ change the stance, invent a typed fact or speak as the real named person. A missing voice
123
+ result remains visible and prevents a false complete bench.
124
+ - Round 1 Bull/Bear run together; after both pass, Round 2 runs together; after both pass,
125
+ Round 3 runs together with exact saved-question bindings. The PM starts after both Round-3
126
+ sides pass.
127
+ - The hard ceiling is 1800000 ms from durable queueing through terminal artifact persistence,
128
+ including queueing, retries, all workers and deterministic finalization. A caller or
129
+ environment may lower it, never raise it. At expiry persist `incomplete` and name every
130
+ timed-out/failed/skipped role. The deadline guarantees a terminal saved run, not successful
131
+ completion under provider/search/data degradation.
132
+ - The concise handoff lists every selected stable master ID, frozen stance and voice-worker
133
+ explanation/status; all eight analyst task IDs, statuses and summaries; and a system-owned
134
+ price snapshot with currency/time/source or an explicit unavailable-data gap.
135
+
136
+ `plan_visible_run` is not governed by this clock: the external host schedules and owns those
137
+ subagents, so the plugin cannot force-stop them. Do not promise the 30-minute headless bound
138
+ for visible-host execution.
139
+
104
140
  ### Quick v1 fixed contract
105
141
 
106
142
  Quick remains a council judgment and passes the same display/confirmation gate, but its
@@ -136,7 +172,7 @@ execution graph is deliberately smaller and immutable:
136
172
  This section applies to full council only. If the user explicitly chooses quick, use the
137
173
  plugin-managed Headless MCP path; never emulate quick with visible subagents.
138
174
 
139
- Use visible Codex subagents whenever the user asks to see subagents, asks for a chat-style analyst team, says child agents must be visible, or invokes `@alphacouncil-agent` for an investment decision without explicitly requesting headless/background mode.
175
+ Use visible Codex subagents whenever the user asks to see subagents, asks for a chat-style analyst team, says child agents must be visible, or invokes `@alphacouncil-agent` for an investment decision without explicitly requesting headless/background mode. If the user requires a hard 30-minute terminal bound, explain that visible host tasks cannot be force-stopped by the plugin and use plugin-managed headless full after Stage 0.
140
176
 
141
177
  Default to the full workflow. Do not downgrade to a lite/smoke/visible-only summary unless the user explicitly asks for lite, smoke test, or debug output. Do not describe the final user-facing report as "visible version", "lite", "smoke", or "debug"; those are execution details, not investment-report content.
142
178
 
@@ -172,14 +208,14 @@ Default to the full workflow. Do not downgrade to a lite/smoke/visible-only summ
172
208
  - Failed verification **down-weights the seat that made the claim** in the PM synthesis; a seat is never silently erased.
173
209
  - `cannot_confirm` and `stands` are real results. Manufacturing a `weakened` verdict to look diligent lowers a seat's weight for no reason, and weight moves the final rating.
174
210
  6. Wait for the evidence agents, merge their outputs into a shared evidence set in the main thread, then run bull, bear, and portfolio-manager agents.
175
- - Round 1: bull writes the long case; bear writes the short case.
211
+ - Round 1: bull writes the long case; bear writes the short case; launch both in parallel and wait for both.
176
212
  - Round 2: pass bull's packet to bear and bear's packet to bull for rebuttal; each side
177
213
  ends with exactly three questions for the opponent.
178
214
  - Round 3: cross-feed those six saved questions; each side preserves its own three in
179
215
  `questions` and answers the opponent's three as exact `{question, answer}` bindings in
180
216
  `questions_answered`.
181
217
  - Final: portfolio_manager reads evidence plus all debate rounds and decides whether bull, bear, or balanced won.
182
- 7. Return a concise but evidence-rich user handoff in the selected or inferred language: rating, debate winner, key earnings/financial results, forward expectations or event thresholds, important news/industry signals, valuation range, position guidance, top invalidation conditions, and saved file locations. Do not paste an overlong report into chat unless the user asks for the full body inline. The saved `final_report.md` must still be complete enough to read without opening artifacts: include each evidence analyst's summary, key data/news/filing/quant findings, the bull case, bear case, rebuttals/questions where available, portfolio-manager verdict, data gaps, and source table. Include links/paths to saved artifacts in the handoff.
218
+ 7. Return a concise but evidence-rich user handoff in the selected or inferred language: rating, debate winner, key earnings/financial results, forward expectations or event thresholds, important news/industry signals, valuation range, position guidance, top invalidation conditions, and saved file locations. It must name every selected master and every mandatory evidence analyst, with each status/summary, plus the system price snapshot or an explicit quote-data gap. Do not paste an overlong report into chat unless the user asks for the full body inline. The saved `final_report.md` must still be complete enough to read without opening artifacts: include each evidence analyst's summary, key data/news/filing/quant findings, the bull case, bear case, rebuttals/questions where available, portfolio-manager verdict, data gaps, and source table. Include links/paths to saved artifacts in the handoff.
183
219
  - If the Data Analytics `datascienceWidgets` tools are available, also create a real dashboard/report artifact from the completed evidence and decision: call `validate_artifact` first, then `render_artifact`. Do not treat `output_mode=data_analytics` as only a prose style.
184
220
  - If Documents, PDF, Spreadsheets, or Presentations are requested as output formats, use their plugin/skill workflow as a delivery layer after the investment decision is complete; do not move investment judgment into those format plugins.
185
221
  8. If the user specifically wants left-sidebar Codex chat threads, use `codex_app.list_projects` and `codex_app.create_thread` instead of MCP headless execution. Create one thread per major role and report the created thread IDs.
@@ -229,7 +265,8 @@ Use MCP only when the user explicitly accepts background/headless execution, wan
229
265
  `wait_for_completion=false` when the user wants a long/short or portfolio decision saved
230
266
  under `~/.alphacouncil-agent/runs/`. This returns a small durable accepted response with
231
267
  `run_id`, `status_json`, and `events_jsonl`; acceptance does not mean the report is done.
232
- For quick, do not pass task overrides and do not request `synthesis=false`.
268
+ For quick, do not pass task overrides and do not request `synthesis=false`. For full, the
269
+ 1800000 ms global maximum and parallel/barrier topology in the full contract above apply.
233
270
  3. Poll `read_run(run_id)` at a bounded interval until `status.status` is terminal:
234
271
  `complete`, `degraded`, `incomplete`, `needs_verification`, `needs_revision`, or `failed`.
235
272
  Surface meaningful phase changes, not every unchanged poll. Poll the same `run_id`; never
@@ -248,7 +285,10 @@ Use MCP only when the user explicitly accepts background/headless execution, wan
248
285
  its seat count or agreement into `N_eff`; that remains `null` without the separately
249
286
  preregistered, signed, resolved-outcome ledger.
250
287
  6. Headless MCP defaults to real `codex exec` workers. Pass `dry_run=true` only for explicit planning/self-test requests, not for a user-requested stock analysis.
251
- 7. Do not describe MCP `codex exec` workers as visible chat subagents. They are background workers with `status.json`, `events.jsonl`, and `all_agents.md`.
288
+ 7. Do not describe MCP `codex exec` workers as visible chat subagents. They are isolated
289
+ background processes with `status.json`, `events.jsonl`, and `all_agents.md`. Each selected
290
+ physical v3 method gets its own isolated voice worker after the deterministic stance is
291
+ frozen, but that worker is not a persistent sidebar agent and is not the named person.
252
292
  8. For full mode, any mandatory evidence failure closes the evidence barrier and terminates
253
293
  before masters, debate, and PM model calls. For quick, inspect the degraded ledger and the
254
294
  independent execution-status, evidence-coverage, and report-quality fields before handing
@@ -376,6 +416,9 @@ Debate agents return:
376
416
  - Full `full_v2` reports must also include an "Analyst Work Log" / "分析师工作记录" section summarizing every evidence agent packet, plus a "Bull/Bear Debate" / "多空辩论记录" section summarizing the long case, short case, rebuttals, exact Round-3 Q&A, unanswered questions, and who won. Do not replace these with a one-paragraph execution summary.
377
417
  - Quick `quick_v1` reports use the fixed 13-section contract stated above. Do not fail a quick report merely because it lacks full-only quant, event-banking, three-horizon, three-round-Q&A, or adversarial-verifier sections; likewise, never present a passing quick report as full-equivalent.
378
418
  - Terminal runs must preserve the standard artifacts appropriate to the executed contract, including `final_report.md`, `user_response.md`, `artifact_index.md`, `report_quality.json`, evidence-role Markdown, selected-method output, and bull/bear/PM output or explicit failure records. If `report_quality.json` is not `passed`, report `needs_revision`, not complete. A passing report-quality gate checks structure only: it does not convert a quick `degraded` execution into `complete` or prove evidence coverage.
419
+ - A full `user_response.md` lists all eight mandatory analyst statuses/summaries, every
420
+ selected stable master ID with frozen stance and isolated-worker explanation/status, and
421
+ one system-owned price snapshot with currency/time/source or an explicit unavailable gap.
379
422
  - The `management_industry_voices` agent only uses publicly verifiable commentary from executives, board members, official company channels, customers, suppliers, competitors, regulators, industry experts, and channel voices. It must separate direct quotes, paraphrases, and media interpretation, and must not imply non-public inside information.
380
423
  - Fail closed on visibility: if visible agent/thread tools are unavailable, say that visible subagents are unavailable in this runtime and use MCP only with that limitation stated.
381
424
  - Never let a subagent call `@alphacouncil-agent`, `collect_evidence`, `analyze_symbol`, or `read_run`; visible agents are leaf workers.