=== RESEARCH ===
{'issue': 285, 'kind': 'docs', 'defect_status': 'confirmed', 'category': 'new-page', 'target_files': ['docs/src/plotting.md', 'docs/generate_plots.jl'], 'summary': 'Rewrite the 97-line plotting.md stub into a real Method/Reference page: replace the stale hard-coded "41 result types" literal with an @eval-generated dispatch table from methods(plot_result), document the per-family view/type-specific kwargs sourced from src/plotting/, add Complete Example and Common Pitfalls sections, and remove the dead @setup block.', 'current_state': 'Defect still present. docs/src/plotting.md:3 reads "The unified `plot_result()` function dispatches on 41 result types" — a hard-coded literal. The true count is 56 `function plot_result` definitions in src/plotting/*.jl (fevd.jl 3, filters.jl 6, did.jl 5, io.jl 3, hd.jl 2, nowcast.jl 2, reg.jl 4, forecast.jl 7, models.jl 16, irf.jl 4, spectral.jl 4 = 56); the issue body\'s "53" is itself already stale, proving the literal drifts. plotting.md:5-8 is a dead `@setup plotting` block (using MacroEconometricModels, Random; Random.seed!(42)) with NO consuming `@example` on the page (all code blocks are static ```julia at lines 14-22 and 26-31). plotting.md:48-58 "Common Options" documents only 3 common kwargs (title, save_path, ncols — correct per source) and mentions type-specific kwargs only as a one-line hand-wave ("documented on each section page"); zero view kwargs. Page has NO `## Complete Example` and NO `## Common Pitfalls` (confirmed: only H2s are Quick Start, PlotOutput Type, Common Options, Chart Types, Where to Find Visualizations, References). The "41" claim is duplicated in index.md:92 and index.md:152 (owned by issue #281/T182, different file). No page @refs the `plotting_page` anchor inbound, so structural edits break no cross-references.', 'proposed_change': '1. INTRO (plotting.md:3): remove the "41 result types" literal. Do not substitute "56". Either omit the count or express it via @eval, e.g. an `@eval` block that computes `length(methods(plot_result))` — but note the raw method count (56) includes the internal LPDiDResult delegator (did.jl:276) that has no own docstring, so prefer wording like "dispatches on every result type in the package" and let the generated table carry the specifics.\n2. DISPATCH TABLE (@eval, durable fix): add a section that generates one row per dispatched type at build time from `methods(plot_result)`. In an ```@eval block, iterate `methods(MacroEconometricModels.plot_result)`, extract the second positional arg type (m.sig parameters[2]) as the result type, and emit a Markdown table (Documenter.Markdown / a Markdown.Table or an interpolated string returned as `Markdown.parse(...)`). This is what makes the count un-drift-able (acceptance: no hard "41"/"53"/"56" literal). Source types live in src/plotting/*.jl; do not hand-list.\n3. VIEW / KWARG REFERENCE section — sourced from src/plotting/, cite these exact lines:\n   - HASteadyState `view=`: src/plotting/models.jl:820 (`:default`/`:distribution` → wealth distribution), :822 (`:lorenz` → Lorenz curve), :824 (`:policy` → policy functions); docstring at models.jl:800-813.\n   - NowcastResult `view=`: src/plotting/nowcast.jl:43 (`:default`), :45 (`:heatmap`), :50 (`:contributions`).\n   - NowcastNews `view=`: src/plotting/nowcast.jl:349 (`:releases` — default per nowcast.jl:346), :351 (`:groups`), :353 (`:individual`).\n   - Type-specific kwargs: `stat=:mean` — fevd.jl:68 (BayesianFEVD), hd.jl:91 (BayesianHistoricalDecomposition); `bias_corrected=true` — fevd.jl:118 (LPFEVD); `history=nothing,n_history=50` — forecast.jl:22-23 (ARIMAForecast), forecast.jl:67-68 (VolatilityForecast); `original=nothing` — filters.jl:27 (HPFilter helper), filters.jl:84 (HamiltonFilterResult), filters.jl:130 (BaxterKingResult); `shock=nothing` — irf.jl:17/25 (ImpulseResponse); `var=nothing` — forecast/fevd/hd families (e.g. forecast.jl:107, fevd.jl:16, hd.jl:16); `type=:both/:factor/:observable` + `n_obs` (default 6) — forecast.jl:243-246 (FactorForecast); `vars=nothing` — models.jl:265 (TimeSeriesData), models.jl:313 (PanelData). Do NOT guess symbols — every value above is grep-verified.\n4. COMPLETE EXAMPLE (docrule.md:36-40, placement rule docrule.md:59 — before Common Pitfalls/References): add `## Complete Example` producing >=1 plot with an embedded iframe. Per CLAUDE.md/docrule.md:137,162 `plot_result()` stays in a static ```julia block; the visual is an embedded iframe via a FENCED ```@raw html block (docrule.md:345-362 — bare @raw html is invalid). The iframe `src` must point to a file that exists under docs/src/assets/plots/ whose `save_plot` name matches. Simplest: reuse the already-generated `irf_freq.html` (produced by docs/generate_plots.jl, save() helper at docs/generate_plots.jl:18; file exists at docs/src/assets/plots/irf_freq.html) with `<iframe src="../assets/plots/irf_freq.html" width="100%" height="500" frameborder="0" style="border:1px solid #ddd;border-radius:4px;"></iframe>`. If a NEW/dedicated plot is preferred, add a matching `save("plotting_example.html", plot_result(...))` call inside main() in docs/generate_plots.jl and regenerate — the iframe src filename must exactly match the save() name (docrule §Embedding Plot Iframes). The `../assets/plots/` prefix is required (prettyurls, docrule.md:362).\n5. Wire or delete the dead @setup (plotting.md:5-8): either remove it, or convert the Complete Example\'s data-prep lines into an `@example plotting` block that consumes it (the `plot_result()`/`save_plot()` lines still stay static ```julia). Acceptance requires no dead @setup.\n6. COMMON PITFALLS (docrule.md:42-44, numbered): e.g. (a) passing an unsupported `view=` symbol errors — the dispatch branches (nowcast.jl:43-55, models.jl:820-826) fall through to error/else; (b) forgetting `save_plot` before embedding → iframe 404; (c) D3 iframe src path must be `../assets/plots/...` not `assets/plots/...` (prettyurls); (d) `plot_result()` inside `@example` (not static julia) double-renders / bloats the built page.\n7. Keep the existing References D3 citation (plotting.md:95-97 — DOI 10.1109/TVCG.2011.185, valid). Retain "Where to Find Visualizations" table (plotting.md:72-90); its @refs (ia_irf_page etc.) are valid outbound links.\nNOTE on count consistency: coordinate the wording with #281/T182 which fixes the same "41 plot dispatches" claim in index.md:92 and index.md:152 — keep both expressed so they cannot disagree (ideally both via @eval or both count-free).', 'verify': 'julia --project=docs docs/verify_examples.jl docs/src/plotting.md (must be OK — validates the @setup/@example/static-julia split). Then julia --project=docs docs/make.jl to confirm the ```@eval dispatch table renders without error and the iframe target resolves. If a new iframe target is introduced, first run julia --project=docs docs/generate_plots.jl to produce the referenced .html under docs/src/assets/plots/.', 'dependencies': [], 'collisions': ['docs/src/index.md — #281 (T182) edits index.md:92 and index.md:152 which carry the same stale "41 plot dispatches" count; coordinate so the count is expressed consistently (different file, no direct text overlap with plotting.md)', 'docs/make.jl — #295 (T196) nav restructure moves the make.jl:99 "Visualization" => "plotting.md" entry (and index.md:307 Pages list) into the new Visualization section', "docs/src/plotting.md — #294 (T195) hub/skeleton retrofit may edit this same page's structure/skeleton"], 'effort': 'L', 'risk': 'med'}

=== VERIFY ===
{'issue': 285, 'verdict': 'CORRECTED', 'assessment': 'Defect is REAL and every load-bearing citation checks out against the current working tree. plotting.md:3 reads "dispatches on 41 result types" (stale literal). True count is 56 function plot_result defs, ALL in src/plotting/ (grep across all of src/ = 56, zero outside src/plotting/), so methods(plot_result)=56; the issue body\'s "53" is itself stale, confirming drift. Dead @setup at plotting.md:5-8 has no consuming @example (blocks at 14-22/26-31 are static julia). Common Options (48-58) shows only 3 kwargs; no Complete Example / Common Pitfalls; References D3 DOI 10.1109/TVCG.2011.185 valid. I re-read every kwarg/view source line and all are exact: HASteadyState views models.jl:820/822/824 (docstring 799-814), nowcast.jl:43/45/50 and 346/349/351/353, stat=:mean fevd.jl:68 and hd.jl:91, bias_corrected=true fevd.jl:118, history/n_history=50 forecast.jl:22-23 and 67-68, original=nothing filters.jl:27(helper)/84/130, shock irf.jl:17(docstring)/25(kwarg), var=nothing fevd.jl:16/hd.jl:16/forecast.jl:107(docstrings), type=:both/n_obs default 6 forecast.jl:243-246, vars=nothing models.jl:265/313, LPDiDResult delegator did.jl:276 has NO own docstring. docrule.md 36-40/42-44/59/137/162/345-362 all confirmed, including the fenced @raw html iframe idiom and the required ../assets/plots/ prettyurls prefix. irf_freq.html exists on disk (61 KB); generate_plots.jl save() helper at :18 and irf_freq.html at :113 confirmed. Fix is docrule-compliant and complete in scope. The ONE problem: item 2\'s recipe "extract the second positional arg type (m.sig parameters[2])" is wrong for THIS package because essentially all 56 methods are parametric (where T), so m.sig is a UnionAll with no .parameters field; m.sig.parameters[2] throws at build time and the @eval table fails to render, violating the explicit acceptance criterion that make.jl renders the @eval table without error. Must be corrected or the durable fix (the reason this is HIGH) breaks the build.', 'corrections': 'Item 2 (the @eval dispatch table): do NOT index m.sig.parameters[2] directly. Nearly every plot_result method is defined `where T`, so m.sig is a UnionAll and .parameters throws. Unwrap first: sig = Base.unwrap_unionall(m.sig); arg = sig.parameters[2]; then reduce arg to its base type name (arg isa UnionAll ? Base.unwrap_unionall(arg) : arg).name.name for the table row, and skip parameters[1] which is typeof(plot_result). Ensure MacroEconometricModels is loaded in the @eval context; the spec\'s fully-qualified MacroEconometricModels.plot_result is correct and make.jl already does using MacroEconometricModels. Smaller refinements: (a) item 1 prose "dispatches on every result type in the package" is imprecise since not every package type is plottable, prefer "every supported/plottable result type" and let the generated table carry specifics; (b) the @eval table will include the internal LPDiDResult delegator (did.jl:276, no docstring), which is acceptable, but if adding a docstring column guard against methods whose type has no docstring rather than erroring. Everything else (view/kwarg citations, iframe reuse of irf_freq.html, static-julia + fenced @raw html split, Complete-Example-before-Pitfalls/References placement, keep References D3 citation, keep the Where-to-Find table) is correct as written.', 'collision_issues': [294, 281], 'discriminating_power': 'n/a (docs issue, no test assertions)', 'final_effort': 'L'}