changedOutput schema / (root)
Previous value: -nullNew value: +{
+ "$defs": {
+ "HoldingSummary": {
+ "additionalProperties": false,
+ "description": "One-line reference to a holding by ticker + its P&L. Used to\nreference biggest_winner / biggest_loser without inlining the\nfull Position (which would drift from list_portfolio's output).\n\nBUG-41 (2026-08-24): added `pnl_dollars` alongside `pnl_pct` so\nLLM narrators can quote BOTH numbers verbatim without recomputing\n(LLM Scope Boundary). Winner/loser ranking is now by absolute\ndollar impact, not percentage — a $87 loss on a $3 position that\nstarted at $91 is a meaningful portfolio event; a +36% gain on\na $5 position is not.",
+ "properties": {
+ "pnl_dollars": {
+ "title": "Pnl Dollars",
+ "type": "number"
+ },
+ "pnl_pct": {
+ "title": "Pnl Pct",
+ "type": "number"
+ },
+ "ticker": {
+ "title": "Ticker",
+ "type": "string"
+ }
+ },
+ "required": [
+ "ticker",
+ "pnl_pct",
+ "pnl_dollars"
+ ],
+ "title": "HoldingSummary",
+ "type": "object"
+ }
+ },
+ "additionalProperties": false,
+ "description": "Return type for `analyze_portfolio()`. LLM-narrated PhD-style\nanalysis over the caller's merged holdings.\n\nLLM Scope Boundary compliance (CLAUDE.md): every numeric field\n(diversification_score, sector_breakdown, pnl_pct) is computed\nin Python BEFORE the LLM sees it. The `summary` narrative is the\nONLY LLM-produced text — and its prompt uses `_format_named_fields`\nwith a TRUST_RULE that the LLM must reference field names\nverbatim, never recompute.\n\nPost-BUG-24: `is_empty=True` with `upgrade_hint` for anon /\nempty-tenant callers. Never fake analysis.",
+ "properties": {
+ "biggest_loser": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/HoldingSummary"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null
+ },
+ "biggest_winner": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/HoldingSummary"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null
+ },
+ "concentration_reason": {
+ "default": "",
+ "title": "Concentration Reason",
+ "type": "string"
+ },
+ "concentration_risk": {
+ "default": "unknown",
+ "enum": [
+ "low",
+ "medium",
+ "high",
+ "unknown"
+ ],
+ "title": "Concentration Risk",
+ "type": "string"
+ },
+ "demo_mode": {
+ "default": false,
+ "title": "Demo Mode",
+ "type": "boolean"
+ },
+ "diversification_score": {
+ "default": 0,
+ "title": "Diversification Score",
+ "type": "number"
+ },
+ "frameworks": {
+ "items": {
+ "type": "string"
+ },
+ "title": "Frameworks",
+ "type": "array"
+ },
+ "is_empty": {
+ "title": "Is Empty",
+ "type": "boolean"
+ },
+ "sector_breakdown": {
+ "additionalProperties": {
+ "type": "number"
+ },
+ "title": "Sector Breakdown",
+ "type": "object"
+ },
+ "sector_breakdown_note": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "title": "Sector Breakdown Note"
+ },
+ "summary": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "title": "Summary"
+ },
+ "top_holding": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "title": "Top Holding"
+ },
+ "upgrade_hint": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": null,
+ "title": "Upgrade Hint"
+ }
+ },
+ "required": [
+ "is_empty"
+ ],
+ "title": "PortfolioAnalysis",
+ "type": "object"
+}