=== RESEARCH ===
{'issue': 291, 'kind': 'docs', 'defect_status': 'partially_confirmed', 'category': 'docs-med-sweep', 'target_files': ['docs/src/api_types.md', 'docs/src/api_functions.md', 'docs/src/api.md', 'docs/src/tests.md', 'docs/src/tests_unitroot.md', 'docs/src/tests_breaks.md', 'docs/src/tests_panel.md', 'docs/src/tests_diagnostics.md', 'docs/src/tests_unitroot_advanced.md'], 'summary': 'Seven MED docs fixes across the tests hub/sub-pages and the API reference: correct the api_types unit-root subtype tree, add plotting/spectral.jl to the plotting @autodocs Pages, complete the load_example dataset table, add References for tests.md inline citations, fix a malformed backtick span + a mis-placed positional arg in tests_unitroot.md, replace println-for-results with NamedTuple last-expressions, and unify citation style across the tests pages.', 'current_state': 'Items 1,2,3,5,6 are CONFIRMED still-broken; items 4,7 are CONFIRMED-broken but their prescribed target style contradicts the current docrule (see below).\nItem 1 (CONFIRMED): docs/src/api_types.md:402-410 hand-drawn tree lists only 6 subtypes under AbstractUnitRootTest (ADFResult, KPSSResult, PPResult, ZAResult, NgPerronResult, JohansenResult) plus VARStationarityResult as a sibling. Source src/teststat/types.jl declares 18 `<: AbstractUnitRootTest` structs: ADFResult(37), KPSSResult(59), PPResult(81), ZAResult(105), NgPerronResult(130), JohansenResult(160), AndrewsResult(219), BaiPerronResult(256), PANICResult(297), PesaranCIPSResult(330), MoonPerronResult(359), FactorBreakResult(386), FourierADFResult(401), FourierKPSSResult(419), DFGLSResult(438), LMUnitRootResult(460), ADF2BreakResult(477), GregoryHansenResult(495). docs/src/tests.md:234-262 already has the correct full tree (all 18). The @eval-generated replacement from T202 (#301) has NOT landed — tree is still hand-drawn.\nItem 2 (CONFIRMED): docs/src/api_functions.md:835 Pages list = [irf,fevd,hd,filters,forecast,models,nowcast,did,reg].jl and omits "plotting/spectral.jl"; that file exists (src/plotting/spectral.jl) and defines the plot_result dispatches for ACFResult(136), SpectralDensityResult(236), CrossSpectrumResult(283), TransferFunctionResult(324).\nItem 3 (CONFIRMED): docs/src/api.md:35 lists only :fred_md/:fred_qd/:pwt. Source of truth src/data/examples.jl:20-25 DATASETS dict has 6 keys incl. :ddcg(23), :mpdta(24), :wiot(25, :io — io merge is done). examples.jl:43-47 docstring gives descriptions for :ddcg (Acemoglu et al. 2019 Democracy-GDP Panel → PanelData) and :mpdta (Callaway & Sant\'Anna 2021 Minimum Wage Panel → PanelData); :wiot is IOData (examples.jl:112).\nItem 4 (CONFIRMED): docs/src/tests.md:285+ References lists only 3 textbooks (Enders 2014, Hamilton 1994, Lutkepohl 2005) yet the Taxonomy cites ~26 works inline (tests.md:75-148: Dickey & Fuller 1979, Kwiatkowski et al. 1992, Phillips & Perron 1988, Zivot & Andrews 1992, Ng & Perron 2001, Enders & Lee 2012, Narayan & Popp 2010, Johansen 1991, Gregory & Hansen 1996, Andrews 1993, Andrews-Ploberger 1994, Breitung-Eickmeier 2011, Chen-Dolado-Gonzalo 2014, Han-Inoue 2015, Pesaran 2007, Moon-Perron 2004, Granger 1969, Hansen 1982, Andrews-Lu 2001, Jarque & Bera 1980, Mardia 1970, Doornik & Hansen 2008, Henze & Zirkler 1990, Engle 1982, Wilks 1938, Rao 1948).\nItem 5 (CONFIRMED): docs/src/tests_unitroot.md:322 has malformed span `(`:trend``)` — one opening backtick, TWO closing backticks. docs/src/tests_unitroot.md:467-469 \'Options\' table (header \'Argument | Type | Default | Description\') lists `p` with Default=\'Required\'; source src/teststat/johansen.jl:88 `johansen_test(Y::AbstractMatrix{T}, p::Int; ...)` confirms p is POSITIONAL (before the semicolon), so it does not belong in a default/keyword table with the keyword `deterministic`.\nItem 6 (CONFIRMED): println-for-results at tests_panel.md:365-367,376-378,437-439,443 and tests_diagnostics.md:48-49,316,321,341,346,496,507. Return types are bare NamedTuples: arch_lm_test → (statistic,pvalue,q) src/teststat/arch_diagnostics.jl:76; ljung_box_squared → (statistic,pvalue,K) :120; pvar_mmsc → (bic,aic,hqic) src/teststat/pvar_mmsc.jl:12; pvar_lag_selection → (table,best_bic,best_aic,best_hqic,...) src/teststat/pvar_lag_selection.jl:66. NO report() method exists for any of these (grep of `function report(` finds none for arch/ljung/mmsc/lag_selection). T167 (#266) has NOT landed.\nItem 7 (CONFIRMED split, but target contradicts docrule): tests_unitroot.md:554+/tests_unitroot_advanced.md:514+ use Chicago author-date + full bracketed URL (e.g. \'Dickey, David A., and Wayne A. Fuller. 1979. \\"...\\" *JASA* 74 (366): 427--431. [https://doi.org/...](...)\'); tests_breaks.md:595+/tests_panel.md:464+/tests_diagnostics.md:566+ use APA + [DOI] labels (e.g. \'Andrews, D. W. K. (1993). ... *Econometrica*, 61(4), 821-856. [DOI](https://doi.org/...)\'). CRITICAL: the issue says \'unify to Chicago author-date per the revised docrule\', but the CURRENT docrule.md:322-323 template is APA + [DOI] (\'Author, A. B., & Author, C. D. (Year). Title. *Journal*, Volume(Issue), Pages. [DOI](https://doi.org/...)\') and docrule.md:313 inline = \'Author (Year)\'. docrule was NOT revised to Chicago; no docs/src/bibliography.md exists yet. So the prescribed direction is unverified against source-of-truth and belongs to T200 (#299).', 'proposed_change': 'Do items 1,2,3,5,6 in v0.6.7 (safe, docrule-consistent). Defer/coordinate items 4,7 with T200 (#299) because the target citation style is unresolved.\n\nITEM 1 (api_types.md:402-410): replace the 6-line unit-root subtree with the full 18-subtype tree exactly as in tests.md:237-254, i.e. under `AbstractUnitRootTest <: StatsAPI.HypothesisTest` list, in source-declaration order: ADFResult{T}, KPSSResult{T}, PPResult{T}, ZAResult{T}, NgPerronResult{T}, FourierADFResult{T}, FourierKPSSResult{T}, DFGLSResult{T}, LMUnitRootResult{T}, ADF2BreakResult{T}, GregoryHansenResult{T}, JohansenResult{T}, AndrewsResult{T}, BaiPerronResult{T}, PANICResult{T}, PesaranCIPSResult{T}, MoonPerronResult{T}, FactorBreakResult{T}. Keep VARStationarityResult{T} as a sibling (it is NOT a subtype — grep confirms it is not in the `<: AbstractUnitRootTest` list). Do NOT also add these to the ```@docs``` block at api_types.md:208-217 unless registering them (out of scope — that is T177 #276 / T202 #301). If T202 (#301) lands first, this item is fully superseded by its `@eval subtypes(AbstractUnitRootTest)` block; skip the hand-edit.\n\nITEM 2 (api_functions.md:835): append \\"plotting/spectral.jl\\" to the Pages vector so it reads Pages = [\\"plotting/irf.jl\\", \\"plotting/fevd.jl\\", \\"plotting/hd.jl\\", \\"plotting/filters.jl\\", \\"plotting/forecast.jl\\", \\"plotting/models.jl\\", \\"plotting/nowcast.jl\\", \\"plotting/did.jl\\", \\"plotting/reg.jl\\", \\"plotting/spectral.jl\\"]. (@autodocs Order=[:function] picks up the exported plot_result dispatches in that file.)\n\nITEM 3 (api.md:35): expand the single table row into rows (or a compound cell) covering all 6 datasets from src/data/examples.jl:20-25. Add :ddcg (Acemoglu et al. 2019 Democracy-GDP panel → PanelData), :mpdta (Callaway & Sant\'Anna 2021 minimum-wage panel → PanelData), and :wiot (WIOD input-output table → IOData, examples.jl:112). Keep descriptions terse (docrule Tables: sentence fragment, no trailing period). Source-of-truth for symbol list = examples.jl:20-25; for descriptions = examples.jl:43-47 and :112.\n\nITEM 5a (tests_unitroot.md:322): change `(`:trend``)` to `(`:trend`)` — remove the extra closing backtick so the inline code span is well-formed.\nITEM 5b (tests_unitroot.md:465-470 Johansen \'Options\' table): remove the positional `p` row from the default table; document `p` as a positional argument in prose above the table (it already appears positionally in the @example at :456 `johansen_test(Y_qd, 2; deterministic=:constant)`), and retitle the remaining table header \'Argument\'→\'Keyword\' leaving only the `deterministic` keyword row (docrule §Tables keyword-table shape: Keyword|Type|Default|Description).\n\nITEM 6 (fallback — DO NOT add report() methods; T167/#266 is a source/API change and is OUT OF SCOPE for a b-bump): convert each println block to a NamedTuple last-expression inside the same @example block so Documenter renders the tuple. tests_panel.md:364-367 → `mmsc = pvar_mmsc(model)` then last line `(bic = round(mmsc.bic, digits=2), aic = round(mmsc.aic, digits=2), hqic = round(mmsc.hqic, digits=2))`. tests_panel.md:375-378 → last line `(best_bic = sel.best_bic, best_aic = sel.best_aic, best_hqic = sel.best_hqic)`. Apply the same pattern to tests_panel.md:437-439 (mmsc) and :443 (sel), and to tests_diagnostics.md:47-49 (arch_lm_test → `(statistic = round(result.statistic, digits=4), pvalue = round(result.pvalue, digits=4), q = result.q)`), :316,:321 (arch_lm_test), :341,:346 (ljung_box_squared), :496 (mmsc), :507 (sel). Keep the numeric rounding so goldens stay stable. Add a one-sentence interpretation after each block if not already present (docrule Anti-Pattern 9).\n\nITEMS 4 & 7 (COORDINATE WITH T200 #299 — recommend deferring): the split is real, but \'unify to Chicago\' contradicts current docrule.md:313-331 (APA + [DOI]). Two options for the release lead: (A) DEFER both to T200 (#299), which owns \'unify citation style site-wide\' + extracts bibliography.md — cleanest, avoids double-churn; or (B) if done here, unify to the style docrule.md ACTUALLY specifies today (APA author (Year) + [DOI] label), converting tests_unitroot.md/tests_unitroot_advanced.md/tests.md entries to match tests_breaks/panel/diagnostics, and for item 4 add full APA+[DOI] References entries to tests.md for all ~26 inline cites (source the DOIs already present in the sub-pages\' References — do not fabricate). Under EITHER option, LEAVE the Gregory-Hansen DOI 10.1016/0304-4076(69)41685-7 (tests_breaks.md, in the \'Gregory, A. W., & Hansen, B. E. (1996)\' entry) INTACT — verified-genuine legacy PII DOI, do not re-flag.', 'verify': 'Content/@example pages (item 6): julia --project=docs docs/verify_examples.jl docs/src/tests_panel.md ; julia --project=docs docs/verify_examples.jl docs/src/tests_diagnostics.md ; julia --project=docs docs/verify_examples.jl docs/src/tests_unitroot.md. The api_types.md tree, api_functions.md @autodocs, and api.md table are @docs/@autodocs/prose (not @example) so verify_examples will not exercise them — confirm rendering with a full build: julia --project=docs docs/make.jl (check the plotting/spectral.jl dispatches now appear and no missing-docs/parse warnings for the tests+api pages).', 'dependencies': [], 'collisions': ['docs/src/api_types.md — #301', 'docs/src/api_types.md — #276', 'docs/src/api_functions.md — #301', 'docs/src/api_functions.md — #276', 'docs/src/api.md — #301', 'docs/src/api.md — #276', 'docs/src/tests.md — #299', 'docs/src/tests.md — #293', 'docs/src/tests.md — #290', 'docs/src/tests_unitroot.md — #299', 'docs/src/tests_unitroot.md — #293', 'docs/src/tests_breaks.md — #299', 'docs/src/tests_breaks.md — #293', 'docs/src/tests_panel.md — #299', 'docs/src/tests_panel.md — #266', 'docs/src/tests_panel.md — #292', 'docs/src/tests_panel.md — #293', 'docs/src/tests_diagnostics.md — #299', 'docs/src/tests_diagnostics.md — #266', 'docs/src/tests_diagnostics.md — #293', 'docs/src/tests_unitroot_advanced.md — #299'], 'effort': 'L', 'risk': 'med'}

=== VERIFY ===
{'issue': 291, 'verdict': 'CORRECTED', 'assessment': "I re-read every cited file:line at the current working tree and confirm all seven defects are real and still-unfixed. Items 1,2,3,5a,5b,6 are CONFIRMED broken and their proposed fixes are docrule-consistent (verified against docrule.md:95/140/189/254-257/313-331/370). Items 4,7 are CONFIRMED splits whose 'unify to Chicago' target genuinely contradicts the current docrule (APA + [DOI], no bibliography.md exists) — correctly recommended for deferral to #299. Source-of-truth checks: src/teststat/types.jl has exactly 18 `<: AbstractUnitRootTest` structs; VARStationarityResult is NOT among them (correct to keep as sibling); src/plotting/spectral.jl exists with 4 plot_result dispatches; examples.jl:19-26 has 6 dataset keys; johansen.jl:88 makes `p` positional; arch_lm_test/ljung_box_squared/pvar_mmsc/pvar_lag_selection all return bare NamedTuples with no report() method (grep exit=1). Two refinements are needed on Item 1, so the verdict is CORRECTED rather than CONFIRMED, but the defect set and scope split are sound.", 'corrections': "Item 1 only: (a) FORMAT — api_types.md:402-408 uses box-drawing tree characters (├── on each entry, └── on the LAST entry at :408). The 18-subtype list must be rendered in that box-drawing style (├── on the first 17, └── on FactorBreakResult{T}), NOT copied verbatim with tests.md:237-254's plain indentation, or the tree will be visually inconsistent with the rest of api_types.md. The subtype token-list and the intent to match tests.md's *content* are correct. (b) LABEL — the spec calls its ordering 'source-declaration order' but the order it lists (…NgPerron, FourierADF…, Johansen 12th…) is actually tests.md order, not declaration order (Johansen is declared at types.jl:160, before Andrews/BaiPerron/Fourier*). Harmless since the goal is to mirror tests.md, but the implementer should not try to re-sort into true declaration order. Keep VARStationarityResult{T} as a sibling. Items 2,3,5a,5b,6 need no changes. Endorse Option A for items 4&7: DEFER both to #299 — do not introduce Chicago style in v0.6.7 since docrule.md:313-331 specifies APA + [DOI] and no bibliography.md exists yet; the docrule was never revised to Chicago. Leave the Gregory-Hansen legacy PII DOI in tests_breaks.md intact.", 'collision_issues': [266, 276, 290, 292, 293, 299, 301], 'discriminating_power': 'n/a (docs issue, no test assertions)', 'final_effort': 'L'}