DITEMPA BUKAN DIBERI — "Forged, Not Given."
It computes. It warns. It prepares evidence for judgment.
It does not move money. It does not authorize capital. It does not self-seal.
WEALTH is the capital intelligence organ of arifOS.
Runtime:
- Version: 2026.07.06
- Public MCP tools: 50 (live tools/list count; canonical ~45 unique)
- Stock analysis modes: 27 (including Kelly, Nash multi-factor, TAC-9)
- Optimizer suite: 5 engines (Markowitz, Kelly, Robust, Chance-constrained, Two-stage)
- Prompts: 7 canonical loops
- Resources: 15 (8 SOT + 7 dynamic reality)
- Transport: FastMCP 3.4.2 (streamable-HTTP, Python 3.12)
- Port: 18082 (
wealth.service) - License: AGPL-3.0 — strong copyleft, network services must disclose source
Authority:
- WEALTH computes
- WEALTH does not move money
- WEALTH does not authorize capital
- WEALTH does not self-seal
Federation Position:
Arif (F13 SOVEREIGN)
↓
AAA / Hermes / OpenClaw (A2A)
↓
arifOS KERNEL (F1-F13, :8088)
↓
WEALTH (CAPITAL, :18082) ← computes, never allocates
↓
A-FORGE (:7071) ← executes after SEAL
↓
VAULT999 ← immutable record
If README and runtime disagree → runtime registry is source of truth. Verify via
resources/read wealth://schemaandtools/list.
APEX THEORY defines the constitutional dynamics of governed intelligence through ΔΩΨ. arifOS compiles those dynamics into an AGI substrate kernel. AAA renders the substrate as visible ASI civilization state. A-FORGE gives the system governed hands. GEOX, WEALTH, and WELL anchor those hands to earth, capital, and human reality. VAULT999 preserves consequence. Arif/F13 remains the sovereign witness and final veto.
WEALTH must never: move capital, issue final investment decisions, or make allocation calls without arifOS SEAL.
Full doctrine: GENESIS/040_APEX_STACK.md
Orthogonal CANON: ariffazil/CANON.md — this repo is capital domain intelligence (compute, never allocate). Touches money surfaces only through APA leases, never free agent hands.
WEALTH is the capital intelligence organ of the arifOS federation. It models cashflow, valuation, risk, market reality, institutional power, and capital wisdom as computable primitives — never as opinions.
WEALTH tells you what the capital looks like. It does not move the money. The sovereign decides.
Five mathematical optimization engines forged from first principles. Each maps to an APEX conservation law.
| Engine | Mode | APEX Organ | What It Does |
|---|---|---|---|
| Markowitz | markowitz |
ΔR Reality | Mean-variance frontier — optimal portfolio weights |
| Kelly | kelly |
W Execution | Optimal bet sizing — half-Kelly default, C_dark detection |
| Robust | robust |
ΔG Governance | Worst-case optimization under uncertainty |
| Chance-Constrained | chance_constrained |
Ω Witness | VaR/CVaR optimization — P(loss > threshold) ≤ α |
| Two-Stage | two_stage |
∂M/∂t Memory | Stochastic recourse — invest now, adjust later |
Forge verdict (2026-07-06):
- Markowitz: Equal-weight wins for correlated assets. Kept as reference.
- Kelly: FORGED — 13x better on strong edge, adapts to edge quality.
- Robust/Chance: Concentrates risk, marginal improvement. Kept as reference.
APEX mapping: Each optimizer returns apex.organ, apex.conservation_law, apex.G_score, apex.C_dark, apex.verdict.
Every query flows through a structured loop:
- Reality Intake — what context, what facts, what unknowns?
- Domain Classification — capital, risk, market, allocation, power, handoff?
- Tool Routing — which primitives apply?
- Downside Challenge — what's the worst case? What's missing?
- Boundary Enforcement — is this reversible? Does it need 888_HOLD?
- Output (Advisory only) — never a verdict, never an authorization.
- arifOS Handoff (if required) — prepare envelope, let arifOS judge.
This loop is implemented through 7 canonical MCP prompts:
| # | Prompt | Domain |
|---|---|---|
| 1 | wealth_reality_intake_loop |
Universal entrypoint — any query |
| 2 | wealth_capital_diagnosis_loop |
Cashflow, runway, NPV, IRR |
| 3 | wealth_risk_downside_loop |
EMV, EVOI, asymmetry, downside |
| 4 | wealth_market_reality_loop |
FX, commodities, macro |
| 5 | wealth_allocation_judgment_loop |
Advisory comparison of options |
| 6 | wealth_institutional_power_loop |
Capture, Beautiful Mouse, collapse signature |
| 7 | wealth_arifos_handoff_loop |
Prepare judge envelope (irreversible, high-risk) |
| Tool | Purpose |
|---|---|
wealth_compute_npv |
Net Present Value |
wealth_compute_irr |
Internal Rate of Return |
wealth_conservation_check |
Capital conservation audit |
wealth_flow_check |
Cash flow analysis |
| Tool | Purpose |
|---|---|
wealth_compute_emv |
Expected Monetary Value |
wealth_compute_evoi |
Expected Value of Information |
wealth_monte_carlo_simulate |
Monte Carlo simulation |
wealth_asymmetry_check |
Risk asymmetry detection |
wealth_runway_check |
Financial runway calculation |
| Tool | Key Modes |
|---|---|
wealth_stock_analysis |
verify_math · position_size · kelly · nash_multi_factor · tac9 · fundamentals · pre_trade · contrast · confluence · risk_metrics · calhoun_survival · 888 · 999 |
| Tool | Purpose |
|---|---|
wealth_markowitz_frontier |
Mean-variance portfolio optimization |
wealth_kelly_sizing |
Kelly criterion position sizing |
wealth_robust_portfolio |
Robust optimization under uncertainty |
wealth_chance_constrained |
VaR/CVaR constrained optimization |
wealth_two_stage_recourse |
Two-stage stochastic programming |
| Tool | Purpose |
|---|---|
wealth_wisdom_evaluate |
6-dimension wisdom scoring |
wealth_omni_wisdom |
Unified capital intelligence |
wealth_power_audit |
Power dynamics audit |
wealth_capture_scan |
Capture signal detection |
wealth_collapse_signature_scan |
Institutional collapse detection |
wealth_beautiful_mouse_scan |
Calhoun Phase C detection |
| Tool | Purpose |
|---|---|
wealth_personal_finance |
Cashflow, net worth, EPF, zakat |
wealth_market_data |
FX, commodities, macro indicators |
wealth_survival_engine |
Cashflow, runway, burn, liquidity |
wealth_fiscal_breakeven |
Malaysia fiscal breakeven oil price |
| Tool | Purpose |
|---|---|
wealth_boundary_governance |
F1-F13 floor compliance |
wealth_judge_handoff |
Prepare arifOS judge envelope |
wealth_registry_status |
Tool registry diagnostic |
wealth_agent_path |
Intent routing |
wealth_confluence_check |
False confluence detection |
| Tool | Purpose |
|---|---|
wealth_vault_query |
Query VAULT999 ledger |
wealth_vault_write |
Write to VAULT999 (requires SEAL) |
Full registry: resources/read wealth://tools/registry
Resources provide the context that prevents incorrect computation.
WEALTH does not trust memory. WEALTH loads context from resources before computation.
| URI | Purpose |
|---|---|
wealth://schema |
Full tool/prompt/resource manifest + version |
wealth://tools/registry |
All tools with action_class + mutation flags |
wealth://prompts/index |
7 prompts with required args + outputs |
wealth://domains/index |
Federated domain maps |
wealth://runtime/policy |
Discipline contract — required resources per tool class |
wealth://canon/002-human-law |
Human law as capital geometry |
wealth://glossary |
arifOS/WEALTH canonical glossary |
wealth://federation/contract |
Authority chain, handoffs, never-list |
| URI | Purpose |
|---|---|
wealth://health |
Liveness + timestamp |
wealth://reality/context |
Current reality assumptions |
wealth://market/sources |
What counts as "real" market data |
wealth://risk/thresholds |
LOW/MEDIUM/HIGH/CRITICAL definitions |
wealth://affordance/contracts |
Tool authority, mutation, 888_HOLD map |
wealth://handoff/arifos-schema |
Required structure for judge handoff |
wealth://replay/receipt-schema |
Reproducible intelligence trace |
WEALTH transports intelligence through:
- Tools → computation
- Resources → context
- Prompts → reasoning discipline
Execution order:
- Load resources (
resources/read— schema, risk/thresholds, reality/context) - Apply prompt loop (
prompts/get) - Call tools (
tools/call— read affordance/contracts first) - Produce advisory output
- Prepare arifOS handoff (if irreversible or HIGH/CRITICAL risk)
No tool should be called without context. No output should skip the prompt loop. No verdict should be claimed without arifOS response.
| Layer | Responsibility |
|---|---|
| WEALTH | Compute capital intelligence |
| arifOS | Judge admissibility |
| Arif | Final decision (F13 SOVEREIGN) |
| A-FORGE | Execute |
| VAULT999 | Seal |
WEALTH cannot:
- move money
- issue trade instructions
- allocate capital
- override arifOS
- self-seal
If any of these is implied by a tool output, the output is malformed — escalate.
User: "What's the optimal position size for PETRONAS?"
Flow:
wealth_reality_intake_loop— establish account, risk tolerance, edge qualitywealth_stock_analysis(mode="kelly")— Kelly criterion: half-Kelly, C_dark checkwealth_stock_analysis(mode="risk_metrics")— VaR, CVaR, max drawdownwealth_market_reality_loop— current MYR/USD, oil price, Bursa context
Output:
- Kelly fraction: 13.44% of account (half-Kelly)
- Position value: RM13,437.50
- Edge per trade: 0.0215
- APEX verdict: SABAR (C_dark=0.2, G=0.8)
- Advisory only — Arif decides
If data is missing, WEALTH must say: "I don't know." If data is stale, WEALTH must say: "This is not current." If risk is unclear, WEALTH must say: "This cannot be concluded safely."
This is non-negotiable. A WEALTH output that hides ignorance is a constitutional breach.
# 1. Health
curl https://wealth.arif-fazil.com/health
# 2. Initialize MCP session
curl -X POST https://wealth.arif-fazil.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"cli","version":"1.0"}}}'
# 3. List tools
# tools/list → ~45 tools
# 4. Kelly example
curl -X POST https://wealth.arif-fazil.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"wealth_stock_analysis","arguments":{"mode":"kelly","account_balance":100000,"win_rate":0.55,"avg_win":0.08,"avg_loss":0.05,"kelly_fraction":0.5}}}'Full runtime guide: RUNBOOK.md. Constitutional mandate: GENESIS/011_WEALTH_MANDATE.md.
- No live trading. WEALTH never moves capital.
- No legal advice. WEALTH reflects capital geometry only.
- No real-time guarantees on external market data beyond what
wealth://market/sourcesdeclares as fresh. - No consciousness, no opinion. WEALTH computes. Tools return numbers + labels.
- WEALTH does not judge. Judgment belongs to arifOS (
arif_judge). Decisions belong to Arif (F13).
arifOS :8088 (Constitutional Kernel — judge, seal)
↓
WEALTH :18082 (Capital Intelligence — this repo)
↓
A-FORGE :7071 (Execution Shell — never adjudicates)
↓
VAULT999 (Append-only immutable ledger)
Five-layer runtime: wealth_core (engines + optimizers), wealth_contracts (output envelopes), wealth_mcp (tools + resources + prompts), wealth_arifos_bridge (kernel integration), wealth_compat (legacy aliases).
Key directories:
| Path | Purpose |
|---|---|
internal/monolith.py |
Canonical kernel — 19 named tools, 27 stock modes |
wealth_mcp/server.py |
MCP surface — 39 tools, preload guards, governance |
wealth_core/optimizers/ |
Pyomo optimizer suite (Markowitz, Kelly, Robust, Chance, Two-stage) |
internal/stock/ |
D4 Stock Analysis — 27-mode capital-risk governance |
internal/market_data.py |
D3 Market Data — FX, commodities, macro |
internal/personal_finance.py |
D1 Personal Finance — cashflow, net worth, EPF, zakat |
tests/ |
Test suite — optimizers, stock analysis, survival engine, governance |
Connect to WEALTH via the Model Context Protocol:
| Property | Value |
|---|---|
| Endpoint | https://wealth.arif-fazil.com/mcp |
| Transport | Streamable HTTP (JSON-RPC 2.0) |
| Tools | 50 tools (live) |
| Health | https://wealth.arif-fazil.com/health |
{
"mcpServers": {
"wealth": {
"url": "https://wealth.arif-fazil.com/mcp"
}
}
}AGPL-3.0. See LICENSE.
Forged: 2026-07-06. Runtime SOT is canonical — README defers to wealth://schema.
Prior README content archived to GENESIS/README-archive-2026-06-27.md.
DITEMPA BUKAN DIBERI