alphacouncil-agent 0.5.5 → 0.8.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.
@@ -0,0 +1,104 @@
1
+ # Roadmap
2
+
3
+ Where this plugin is going, and the reasoning that decides it. Dated entries, newest first.
4
+ Anything here is a statement of intent, not a shipped feature. Shipped work lives in
5
+ `CHANGELOG.md`.
6
+
7
+ ## The problem that shapes everything after 0.6.0
8
+
9
+ A user asked why the master bench never appears in the report. Answering it surfaced a
10
+ larger defect, and the larger defect is the one worth stating plainly:
11
+
12
+ > Twenty-one masters are twenty-one prompt voices, not twenty-one independent sources.
13
+ > They share a base model, a batch of evidence, a training corpus, a context bias, and
14
+ > therefore a set of factual errors. "Twenty-one votes" is not twenty-one samples. It can
15
+ > be one error repeated in twenty-one investing accents.
16
+
17
+ This is correct, and the published literature is harsher than the summary above.
18
+
19
+ - Contemporary LLM errors are **>60% correlated**, so naive ensembling has a non-zero
20
+ error floor. ([Minority Sentinel](https://arxiv.org/html/2606.29270v1))
21
+ - Majority voting inherits its legitimacy from the **Condorcet Jury Theorem**, which
22
+ requires *independent* errors. Shared pretraining violates the premise outright.
23
+ - When agents are handed **identical information**, deliberation does not raise collective
24
+ accuracy — they already agreed, and exchanging messages only hardens the shared prior.
25
+ ([Diverse Evidence, Better Forecasts](https://arxiv.org/html/2607.01661v1))
26
+ - With identical inputs, debate forms a **martingale**: expected correctness does not
27
+ improve across rounds. Closed deliberation is a Markov chain whose mutual information
28
+ with the truth can only decrease.
29
+ - The failure mode has a name — **the Deliberative Illusion**: factual attrition plus
30
+ stance homogenisation. ([arXiv 2606.03032](https://arxiv.org/pdf/2606.03032))
31
+ - In roughly **one divergent case in four the minority is right**, so a majority rule
32
+ actively destroys the most valuable signal in the room.
33
+
34
+ The plugin has been shipping the exact artifact this literature warns about: a tally.
35
+
36
+ ### What that means for how a run is reported
37
+
38
+ A concurring bench is the *weakest* thing the council produces, not the strongest. The
39
+ dissenting seat is the informative one. Any report that prints `6 avoid / 2 neutral /
40
+ 2 long` and lets the reader do arithmetic on it is selling correlated noise as consensus.
41
+
42
+ ## 0.7.0 — the bench becomes visible (prerequisite, not a feature)
43
+
44
+ `markdown.mjs` contains zero references to `master`. Master opinions are recorded, gated
45
+ for completeness, weighted in synthesis — and then rendered nowhere. A run can select ten
46
+ lenses, pay for ten, pass every gate, and emit a report in which they are invisible.
47
+
48
+ Folded into 0.8.0 rather than shipped alone: you cannot evaluate whether a persona rewrite
49
+ worked while its output is unreadable.
50
+
51
+ - Render master opinions to `master_<id>.md`, `all_agents.md`, and `artifact_index.md`.
52
+ - Add a `master_bench` report section, required only when a bench was actually selected.
53
+ - Make the analyst work log generate from packets instead of trusting the manager to retype
54
+ them, and make the gate check for substance rather than for the task name as a substring.
55
+ - Stop returning the entire run state from every `record_*` call. Late in a long run a
56
+ single response reached ~240k characters, which is a context-exhaustion bug on any host
57
+ that keeps tool results in the transcript.
58
+
59
+ ## 0.8.0 — masters become methods, not accents
60
+
61
+ The fix is architectural, and the reference implementation for it already exists in the
62
+ open: in [`virattt/ai-hedge-fund`](https://github.com/virattt/ai-hedge-fund) the Buffett
63
+ agent is not a prompt. It is a scoring function — ROE > 15%, debt/equity < 0.5, operating
64
+ margin > 15%, owner earnings with maintenance capex at 85% of total capex, a two-stage DCF
65
+ capped at 8%/4% with a 2.5% terminal and a 0.85 margin-of-safety multiplier. The model is
66
+ called **after** `total_score` and `max_possible_score` already exist, and it writes prose
67
+ about a verdict it did not choose.
68
+
69
+ That is the whole idea: **differentiation lives in code, not in the prompt.** Two masters
70
+ differ because they compute different functions over different inputs — not because one of
71
+ them was told to sound like Omaha.
72
+
73
+ Four layers per master, with the model confined to the last one:
74
+
75
+ 1. **Eligibility gate** — can this method evaluate this security at all? Deterministic.
76
+ Buffett facing a 20-F filer with 0/7 computable rules returns `out_of_scope` and never
77
+ reaches an LLM.
78
+ 2. **Scoring function** — named metrics, numeric thresholds, weights, provenance for every
79
+ threshold. Deterministic.
80
+ 3. **Evidence slice** — different masters read *different* evidence. This is the lever the
81
+ information-asymmetry paper identifies, and it is the only one that produces disagreement
82
+ from something other than tone.
83
+ 4. **Narrative** — the model explains a stance it cannot overturn.
84
+
85
+ Reporting changes with it: the tally disappears, correlation is disclosed as a property of
86
+ the run, and the minority report is promoted rather than buried.
87
+
88
+ A new `council_diagnostics` tool measures whether any of this worked — self-consistency of
89
+ one master across runs against pairwise agreement between masters. **If different masters
90
+ agree with each other about as often as one master agrees with itself, the bench added no
91
+ information, and the report must say so.** A feature that can prove itself decorative is
92
+ worth more than one that cannot.
93
+
94
+ Full plan: `docs/plans/0.8.0-master-models.md`.
95
+
96
+ ## Known limits that no version fixes
97
+
98
+ - **Shared base model.** Per-master vendor routing narrows the correlation; it does not
99
+ make the seats independent, and it costs keys most users will not have.
100
+ - **Thresholds are still human choices.** Determinism moves the uncertainty from the model
101
+ into the constants. The mitigation is provenance, not confidence.
102
+ - **Some masters have thin public methodology.** There is far more verifiable Buffett than
103
+ verifiable Duan Yongping. Those rule sets will be smaller and labelled as such. Padding
104
+ them to look uniform would reintroduce exactly the invention this release exists to remove.
@@ -0,0 +1,209 @@
1
+ {
2
+ "schema_version": 2,
3
+ "persona_id": "master_buffett",
4
+ "display_name": {
5
+ "en": "Buffett Method Model",
6
+ "zh": "巴菲特方法模型"
7
+ },
8
+ "kind": "operator_lens",
9
+
10
+ "admission": {
11
+ "propositions": 6,
12
+ "primary_sources": 4,
13
+ "decision_cases": 0,
14
+ "failure_cases": 1,
15
+ "vetoes": 2,
16
+ "counterfactuals": 0
17
+ },
18
+
19
+ "sources": [
20
+ {
21
+ "id": "buffett:S01",
22
+ "grade": "A",
23
+ "title": "Berkshire Hathaway 1987 Chairman's Letter",
24
+ "url": "https://www.berkshirehathaway.com/letters/1987.html",
25
+ "date": "1988-02-29",
26
+ "excerpt": "returns on equity ... without the aid of leverage"
27
+ },
28
+ {
29
+ "id": "buffett:S02",
30
+ "grade": "A",
31
+ "title": "Berkshire Hathaway 1986 Chairman's Letter, Appendix: owner earnings",
32
+ "url": "https://www.berkshirehathaway.com/letters/1986.html",
33
+ "date": "1987-02-27",
34
+ "excerpt": "reported earnings plus depreciation and amortization less capitalized expenditures required to maintain long-term competitive position"
35
+ },
36
+ {
37
+ "id": "buffett:S03",
38
+ "grade": "A",
39
+ "title": "Berkshire Hathaway 1996 Chairman's Letter, circle of competence",
40
+ "url": "https://www.berkshirehathaway.com/letters/1996.html",
41
+ "date": "1997-02-28",
42
+ "excerpt": "you don't have to be an expert on every company ... define your circle of competence"
43
+ },
44
+ {
45
+ "id": "buffett:S04",
46
+ "grade": "A",
47
+ "title": "Berkshire Hathaway 1989 Chairman's Letter, mistakes of the first twenty-five years",
48
+ "url": "https://www.berkshirehathaway.com/letters/1989.html",
49
+ "date": "1990-03-02",
50
+ "excerpt": "the most important lesson ... a good business at a fair price over a fair business at a good price"
51
+ }
52
+ ],
53
+
54
+ "doctrine": [
55
+ {
56
+ "rule_id": "buffett.circle_of_competence.01",
57
+ "claim": "Stop valuing a business whose model cannot be explained in a paragraph",
58
+ "scope": ["public_equity", "operating_business"],
59
+ "trigger": "business_model_explanation_failed",
60
+ "action": "out_of_scope",
61
+ "source_ids": ["buffett:S03"],
62
+ "confidence": "high",
63
+ "counterexamples": [],
64
+ "version": 1
65
+ },
66
+ {
67
+ "rule_id": "buffett.record_required.01",
68
+ "claim": "A long-run return-on-equity record is the entry requirement, not an optional extra; without the series there is no judgment to make",
69
+ "scope": ["public_equity"],
70
+ "trigger": "long_run_roe_series_unavailable",
71
+ "action": "out_of_scope",
72
+ "source_ids": ["buffett:S01"],
73
+ "confidence": "high",
74
+ "counterexamples": ["a recent spin-off with no standalone history may still be analysable from the parent's segment disclosure"],
75
+ "version": 1
76
+ },
77
+ {
78
+ "rule_id": "buffett.owner_earnings.01",
79
+ "claim": "Value the business on owner earnings, not reported earnings: reported earnings plus depreciation and amortization, less the capital expenditure required to hold competitive position",
80
+ "scope": ["public_equity"],
81
+ "trigger": "valuation_requested",
82
+ "action": "require_evidence",
83
+ "source_ids": ["buffett:S02"],
84
+ "confidence": "high",
85
+ "counterexamples": [],
86
+ "version": 1
87
+ },
88
+ {
89
+ "rule_id": "buffett.leverage.01",
90
+ "claim": "A high return on equity achieved with heavy leverage is not evidence of business quality",
91
+ "scope": ["public_equity"],
92
+ "trigger": "roe_high_with_high_debt",
93
+ "action": "veto",
94
+ "source_ids": ["buffett:S01"],
95
+ "confidence": "high",
96
+ "counterexamples": ["regulated utilities and banks carry structural leverage and are judged on other terms"],
97
+ "version": 1
98
+ },
99
+ {
100
+ "rule_id": "buffett.quality_over_price.01",
101
+ "claim": "Prefer a good business at a fair price to a fair business at a good price",
102
+ "scope": ["public_equity"],
103
+ "trigger": "cheapness_is_the_only_argument",
104
+ "action": "downweight",
105
+ "source_ids": ["buffett:S04"],
106
+ "confidence": "high",
107
+ "counterexamples": [],
108
+ "version": 1
109
+ },
110
+ {
111
+ "rule_id": "buffett.cash_conversion.01",
112
+ "claim": "Earnings that do not arrive as cash over a full cycle are a claim about accounting, not about a business",
113
+ "scope": ["public_equity"],
114
+ "trigger": "ocf_below_net_income_over_cycle",
115
+ "action": "downweight",
116
+ "source_ids": ["buffett:S02"],
117
+ "confidence": "medium",
118
+ "counterexamples": ["a fast-growing business funding working capital can run below for several years"],
119
+ "version": 1
120
+ }
121
+ ],
122
+
123
+ "research_policy": {
124
+ "priorities": ["moat_durability", "capital_allocation_record", "owner_earnings", "pricing_power"],
125
+ "must_recompute": ["owner_earnings", "roe_ex_leverage"],
126
+ "must_seek_disconfirming": ["accounting concern", "goodwill impairment", "serial restructuring", "management incentive misalignment"],
127
+ "evidence_slice": ["earnings_deep_dive", "insider_sec", "ib_event_analysis", "news_industry_management"]
128
+ },
129
+
130
+ "decision_policy": {
131
+ "eligibility": {
132
+ "requires": [
133
+ "screen.rules_computed >= 4",
134
+ "filer.structured_financials"
135
+ ],
136
+ "on_fail": "out_of_scope"
137
+ },
138
+ "scoring": {
139
+ "max_score": 12,
140
+ "rules": [
141
+ {
142
+ "id": "roe_10y",
143
+ "metric": "screen.metrics.roe_10y",
144
+ "op": ">=",
145
+ "value": 0.15,
146
+ "points": 3,
147
+ "provenance": "1987 letter (buffett:S01): sustained above-average return on equity without the aid of leverage"
148
+ },
149
+ {
150
+ "id": "debt_to_equity",
151
+ "metric": "screen.metrics.debt_to_equity",
152
+ "op": "<=",
153
+ "value": 0.5,
154
+ "points": 2,
155
+ "provenance": "1987 letter (buffett:S01): the ROE test is only meaningful unlevered, so leverage is capped rather than scored"
156
+ },
157
+ {
158
+ "id": "gross_margin_long_run",
159
+ "metric": "screen.metrics.gross_margin",
160
+ "op": ">=",
161
+ "value": 0.4,
162
+ "points": 2,
163
+ "provenance": "pricing power proxy; durable margin is the observable form of the moat in buffett:S04"
164
+ },
165
+ {
166
+ "id": "ocf_over_ni",
167
+ "metric": "screen.metrics.ocf_over_ni",
168
+ "op": ">=",
169
+ "value": 1,
170
+ "points": 3,
171
+ "provenance": "owner-earnings definition (buffett:S02): earnings only count once they arrive as cash"
172
+ },
173
+ {
174
+ "id": "dilution_5y",
175
+ "metric": "screen.metrics.dilution_5y",
176
+ "op": "<=",
177
+ "value": 0.05,
178
+ "points": 2,
179
+ "provenance": "capital allocation record; share count growth is the cost of every acquisition and grant"
180
+ }
181
+ ]
182
+ },
183
+ "stance_bands": [
184
+ { "min_ratio": 0.75, "stance": "constructive" },
185
+ { "min_ratio": 0.4, "stance": "cautious" },
186
+ { "min_ratio": 0, "stance": "opposed" }
187
+ ],
188
+ "vetoes": [
189
+ {
190
+ "id": "leveraged_roe",
191
+ "condition": "screen.metrics.debt_to_equity >= 2",
192
+ "source_ids": ["buffett:S01"]
193
+ },
194
+ {
195
+ "id": "cash_never_arrives",
196
+ "condition": "screen.metrics.ocf_over_ni <= 0.5",
197
+ "source_ids": ["buffett:S02"]
198
+ }
199
+ ]
200
+ },
201
+
202
+ "memory_policy": {
203
+ "horizon_days": 365,
204
+ "belief_decay_days": 540,
205
+ "leak_rule": "public_at <= as_of AND memory_created_at <= as_of"
206
+ },
207
+
208
+ "tools": ["screen_ticker", "get_news"]
209
+ }
@@ -0,0 +1,201 @@
1
+ {
2
+ "schema_version": 2,
3
+ "persona_id": "master_duan_yongping",
4
+ "display_name": {
5
+ "en": "Duan Yongping Method Model",
6
+ "zh": "段永平方法模型"
7
+ },
8
+ "kind": "operator_lens",
9
+
10
+ "admission": {
11
+ "propositions": 6,
12
+ "primary_sources": 3,
13
+ "decision_cases": 0,
14
+ "failure_cases": 2,
15
+ "vetoes": 2,
16
+ "counterfactuals": 0
17
+ },
18
+
19
+ "sources": [
20
+ {
21
+ "id": "duan:S01",
22
+ "grade": "A",
23
+ "title": "段永平雪球账号「大道无形我有型」问答合集(本人署名发布)",
24
+ "url": "https://xueqiu.com/u/1247347556",
25
+ "date": "2010-2026",
26
+ "excerpt": "本分;不懂不做;做对的事情,把事情做对"
27
+ },
28
+ {
29
+ "id": "duan:S02",
30
+ "grade": "A",
31
+ "title": "段永平网易博客(本人署名,早期方法论文章)",
32
+ "url": "https://blog.163.com/duan_yp/",
33
+ "date": "2006-2012",
34
+ "excerpt": "商业模式、企业文化、合理价格"
35
+ },
36
+ {
37
+ "id": "duan:S03",
38
+ "grade": "B",
39
+ "title": "段永平浙江大学交流实录(可核验完整问答记录)",
40
+ "url": "https://www.zju.edu.cn/",
41
+ "date": "2018-2021",
42
+ "excerpt": "敢为天下后,后中争先;停止做不对的事情"
43
+ }
44
+ ],
45
+
46
+ "doctrine": [
47
+ {
48
+ "rule_id": "duan.bu_dong_bu_zuo.01",
49
+ "claim": "不懂不做:无法说清这门生意如何长期赚钱时,不进入,且不因为便宜而破例",
50
+ "scope": ["public_equity", "operating_business"],
51
+ "trigger": "business_model_not_explainable",
52
+ "action": "out_of_scope",
53
+ "source_ids": ["duan:S01"],
54
+ "confidence": "high",
55
+ "counterexamples": [],
56
+ "version": 1
57
+ },
58
+ {
59
+ "rule_id": "duan.business_model_first.01",
60
+ "claim": "商业模式优先于财务指标:先判断生意本身是否好,再谈价格",
61
+ "scope": ["public_equity"],
62
+ "trigger": "valuation_requested",
63
+ "action": "require_evidence",
64
+ "source_ids": ["duan:S02"],
65
+ "confidence": "high",
66
+ "counterexamples": [],
67
+ "version": 1
68
+ },
69
+ {
70
+ "rule_id": "duan.culture.01",
71
+ "claim": "企业文化(本分)是长期结果的决定项;管理层言行不一时,财务数字不足以补偿",
72
+ "scope": ["public_equity"],
73
+ "trigger": "management_behaviour_inconsistent",
74
+ "action": "veto",
75
+ "source_ids": ["duan:S01", "duan:S02"],
76
+ "confidence": "high",
77
+ "counterexamples": [],
78
+ "version": 1
79
+ },
80
+ {
81
+ "rule_id": "duan.stop_doing_list.01",
82
+ "claim": "停止做不对的事情,比多做正确的事情更重要;默认不行动",
83
+ "scope": ["public_equity", "portfolio"],
84
+ "trigger": "no_clear_edge",
85
+ "action": "downweight",
86
+ "source_ids": ["duan:S03"],
87
+ "confidence": "high",
88
+ "counterexamples": ["已充分理解且价格明显低于价值时不适用"],
89
+ "version": 1
90
+ },
91
+ {
92
+ "rule_id": "duan.opportunity_cost.01",
93
+ "claim": "任何买入都要与当前最好的已持有标的比较;比不过就不买",
94
+ "scope": ["portfolio"],
95
+ "trigger": "candidate_vs_incumbent",
96
+ "action": "downweight",
97
+ "source_ids": ["duan:S01"],
98
+ "confidence": "high",
99
+ "counterexamples": [],
100
+ "version": 1
101
+ },
102
+ {
103
+ "rule_id": "duan.user_value.01",
104
+ "claim": "用户价值是收入的来源;产品与用户证据先于报表证据",
105
+ "scope": ["public_equity"],
106
+ "trigger": "revenue_quality_assessment",
107
+ "action": "require_evidence",
108
+ "source_ids": ["duan:S02"],
109
+ "confidence": "medium",
110
+ "counterexamples": ["纯授权型业务的用户证据链较弱,需改用合约证据"],
111
+ "version": 1
112
+ }
113
+ ],
114
+
115
+ "research_policy": {
116
+ "priorities": ["business_model_clarity", "corporate_culture", "user_value", "opportunity_cost"],
117
+ "must_recompute": ["opportunity_cost_vs_incumbent"],
118
+ "must_seek_disconfirming": ["management promise versus action", "culture events", "user complaints", "channel stuffing"],
119
+ "evidence_slice": ["news_industry_management", "earnings_deep_dive", "insider_sec"]
120
+ },
121
+
122
+ "decision_policy": {
123
+ "eligibility": {
124
+ "requires": [
125
+ "business_model.explainable",
126
+ "culture.evidence_available"
127
+ ],
128
+ "on_fail": "out_of_scope"
129
+ },
130
+ "scoring": {
131
+ "max_score": 12,
132
+ "rules": [
133
+ {
134
+ "id": "business_model_simplicity",
135
+ "metric": "business_model.simplicity_score",
136
+ "op": ">=",
137
+ "value": 0.6,
138
+ "points": 3,
139
+ "provenance": "duan:S02 商业模式优先;说不清就不做,简单是可判断性的前提"
140
+ },
141
+ {
142
+ "id": "culture_benfen",
143
+ "metric": "culture.benfen_score",
144
+ "op": ">=",
145
+ "value": 0.6,
146
+ "points": 3,
147
+ "provenance": "duan:S01 本分;文化是长期结果的决定项"
148
+ },
149
+ {
150
+ "id": "user_value",
151
+ "metric": "product.user_value_score",
152
+ "op": ">=",
153
+ "value": 0.6,
154
+ "points": 2,
155
+ "provenance": "duan:S02 用户价值是收入的来源"
156
+ },
157
+ {
158
+ "id": "beats_incumbent",
159
+ "metric": "portfolio.beats_best_incumbent",
160
+ "op": "==",
161
+ "value": true,
162
+ "points": 2,
163
+ "provenance": "duan:S01 机会成本;比不过手上最好的就不买"
164
+ },
165
+ {
166
+ "id": "net_cash",
167
+ "metric": "screen.metrics.net_cash_positive",
168
+ "op": "==",
169
+ "value": true,
170
+ "points": 2,
171
+ "provenance": "duan:S02 合理价格与安全性;净现金降低对时机的依赖"
172
+ }
173
+ ]
174
+ },
175
+ "stance_bands": [
176
+ { "min_ratio": 0.75, "stance": "constructive" },
177
+ { "min_ratio": 0.45, "stance": "cautious" },
178
+ { "min_ratio": 0, "stance": "opposed" }
179
+ ],
180
+ "vetoes": [
181
+ {
182
+ "id": "integrity_breach",
183
+ "condition": "culture.integrity_flag",
184
+ "source_ids": ["duan:S01", "duan:S02"]
185
+ },
186
+ {
187
+ "id": "model_not_explainable",
188
+ "condition": "!business_model.explainable",
189
+ "source_ids": ["duan:S01"]
190
+ }
191
+ ]
192
+ },
193
+
194
+ "memory_policy": {
195
+ "horizon_days": 730,
196
+ "belief_decay_days": 1095,
197
+ "leak_rule": "public_at <= as_of AND memory_created_at <= as_of"
198
+ },
199
+
200
+ "tools": ["get_news", "screen_ticker"]
201
+ }