What Is the Mirror Test in AI and How to Pass It: The Complete AI Berkshire Guide
The mirror test in AI is a hard-stop validation rule within the AI Berkshire investment framework that requires every company evaluation to be summarized in exactly five sentences covering business model, competitive moat, management quality, valuation discount, and downside risk—missing any dimension results in automatic rejection.
The mirror test in AI serves as the final gatekeeper in the xbtlin/ai-berkshire investment workflow, forcing decision discipline through a rigid five-sentence structure. This validation layer, implemented in the investment-checklist skill, automatically rejects any investment thesis that cannot articulate its core arguments within five specific dimensions. Understanding this filter is essential for anyone using the framework to evaluate companies programmatically.
What Is the Mirror Test in AI?
The mirror test in AI is a deterministic filter designed to eliminate analysis paralysis and investment bias. According to the source code in skills/investment-checklist.md (lines 75-84), the test mandates that every candidate company must pass a five-sentence validation before proceeding to final investment approval.
The Five-Sentence Structure
The test requires exactly five statements covering distinct investment dimensions:
- Business Model: A one-sentence description of how the company generates revenue and sustains operations.
- Competitive Moat: The primary competitive advantage and whether it is widening or narrowing over time.
- Management Trust: An assessment of leadership credibility, capital allocation discipline, and shareholder alignment.
- Valuation Gap: The current price expressed as a discount factor to calculated intrinsic value (e.g., 0.8 for 80%).
- Downside Risk: The specific risk factors that would cause loss and whether they are economically tolerable.
How the Mirror Test Is Implemented in AI Berkshire
The mirror test is hard-coded into the investment workflow through specific file implementations that enforce strict compliance.
Investment-Checklist Skill Enforcement
In skills/investment-checklist.md, the workflow implements the mirror test as the fourth and final step after six initial checklist gates. Lines 75-86 define the template that requires the five-sentence block, with the explicit rule: "5句话说不完整 = 不买,没有例外" (If the five sentences are incomplete, do not buy—no exceptions). This step isolates the validation so that downstream skills receive a binary pass/fail result without re-evaluating the full analysis.
README Framework Definition
The README.md (lines 83-84) establishes the mirror test as a high-level constraint, defining it as a binary decision gate that downstream skills like /investment-research rely on. This ensures consistency across the entire AI Berkshire pipeline.
How to Pass the Mirror Test
To pass the mirror test in AI Berkshire, your analysis must produce a text block following this exact template structure:
我以 <price> 元 买入 <company>,因为:
1. 这门生意的本质是 <business-summary>,我理解它;
2. 它的护城河是 <moat-description>,而且在 <变宽/变窄>;
3. 管理层 <trust-assessment>,值得/不值得信赖;
4. 当前价格相当于内在价值的 <discount-factor> 折,有/无足够安全边际;
5. 即使我错了,下行风险可控/不可控,因为 <risk-explanation>。
Required Data Points
Each placeholder must be populated with specific, validated data:
- Price: Exact purchase price in the relevant currency.
- Business Summary: Concise description of revenue generation mechanics and unit economics.
- Moat Description: Specific competitive advantage (e.g., network effects, cost advantages) with directional trend.
- Trust Assessment: Binary judgment on management reliability and integrity.
- Discount Factor: Decimal representation of the margin of safety (e.g., 0.8 represents a 20% discount to intrinsic value).
- Risk Explanation: Concrete factors that limit permanent capital loss.
If any clause is omitted or incomplete, the system sets mirror_test_pass to false and returns "未通过" (failed).
Code Implementation Examples
Running the Checklist Command
Invoke the mirror test through the investment-checklist skill:
/investment-checklist 腾讯, 阿里巴巴, 美团
This triggers the six-gate pipeline defined in skills/investment-checklist.md, ending with a mirror test evaluation for each ticker. The output includes a results table indicating pass/fail status for each company.
Python Mirror Test Generation
For programmatic generation, structure your output using this Python pattern:
def mirror_test(company, price, business, moat, moat_widening, mgmt, discount, risk):
"""Return a formatted Mirror Test statement."""
trend = "变宽" if moat_widening else "变窄"
return f"""我以 {price} 元 买入 {company},因为:
1. 这门生意的本质是 {business},我理解它;
2. 它的护城河是 {moat},而且在 {trend};
3. 管理层 {mgmt},值得信赖;
4. 当前价格相当于内在价值的 {discount:.1f} 折,有足够安全边际;
5. 即使我错了,下行风险可控,因为 {risk}。"""
# Example usage
print(mirror_test(
company="腾讯",
price="380",
business="社交网络 + 数字内容平台",
moat="12 亿用户的社交关系链",
moat_widening=True,
mgmt="Pony Ma 低调务实、资本配置优秀",
discount=0.8,
risk="净现金 > 2000 亿、游戏业务现金流强劲"
))
Validating Results Programmatically
Check the JSON output from the checklist skill to verify pass/fail status:
cat /tmp/checklist_results.json | jq '.companies[] | select(.mirror_test_pass == false)'
A mirror_test_pass value of false indicates the candidate failed to satisfy the five-sentence requirement defined in the framework.
Why the Mirror Test Matters
The mirror test in AI Berkshire serves three critical functions:
-
Decision Discipline: By forcing a compact, testable thesis, the system prevents the overconfidence that emerges from exhaustive but unfocused analysis. The constraint eliminates "analysis paralysis" by demanding clarity.
-
Bias Guardrails: The five-sentence structure ensures each investment dimension receives explicit consideration. Missing any dimension—such as downside risk or moat trend—triggers automatic rejection, preventing incomplete evaluations from advancing.
-
Reproducibility: The deterministic five-sentence block, processed through
tools/financial_rigor.pyvaluation utilities, ensures identical input data always produces identical validation results, creating an auditable decision trail.
Summary
- The mirror test in AI is a five-sentence validation filter in the xbtlin/ai-berkshire framework that acts as a hard-stop gate for investment decisions.
- Implemented in
skills/investment-checklist.md(lines 75-86), the test requires specific statements covering business model, moat, management, valuation, and risk. - Missing any of the five required sentences results in automatic rejection with the status "未通过".
- The test ensures decision discipline and bias protection by forcing explicit consideration of all five investment dimensions.
- Validation occurs through the
mirror_test_passboolean field in the checklist output JSON.
Frequently Asked Questions
What happens if I write six sentences instead of five?
The mirror test requires exactly five sentences following the specified template in skills/investment-checklist.md. Adding extra sentences, omitting required clauses, or leaving placeholders empty causes the system to flag the evaluation as failing, returning "未通过" regardless of the analysis quality or positive attributes of the company.
Can I modify the mirror test template in the source code?
While the template is defined in lines 75-84 of skills/investment-checklist.md, modifying the five-sentence structure would violate the framework's core validation logic. The scripts/sync-codex-skills.py file synchronizes this logic across environments, ensuring consistency between Claude Code and Codex implementations and preventing drift from the original specification.
How does the mirror test interact with the six-gate checklist?
The mirror test operates as the fourth step within the investment-checklist skill, executing after the initial six gates (understandable business, sustainable moat, etc.) are completed. It serves as the final consolidation step that distills the full analysis into the mandatory five-sentence format, creating a binary outcome that downstream skills consume.
Is the mirror test available outside the Chinese language framework?
While the template uses Chinese language structure, the underlying validation logic in tools/financial_rigor.py is language-agnostic. The framework expects the five specific dimensions to be addressed, but the mirror_test_pass boolean evaluation depends on structural compliance—specifically the presence of all five required clauses—rather than language detection.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →