← Back to Pull requests

Housing Q5: "Has buying a home become harder everywhere?" (Spain vs Germany, 1980–2025) #81

Open
unknown opened this pull request with 643 lines diff across 8 files
View on GitHub
unknown unknown commented on Nov 30, 2026 13:49 UTC
Author

Summary


Replaces Housing Q5 (hs-ratio, "Did your parents really have it easier buying a home?") with "Has buying a home become harder everywhere?" (hs-affordability). It's a single choice, and the answer is "less affordable in Spain but more affordable in Germany". The chapter stays at 8 questions and 8 points, and no other question changed.

Figures, checked against the original Banco de España Annual Report 2025 (2026):

  • Table 2.3 (OECD price-to-income indicator, 1980 = 100; house price index ÷ household net disposable income per person): Spain 188.6 (+88.6%), euro area 110.0 (+10.0%) and Germany 60.7 (−39.3%).

  • Chart 2.11: the 2021–25 surplus or shortfall of new homes against new households is −3.7% of households in Spain and +0.5% in Germany. The report measures the two countries differently: Spain counts completions, while Germany counts permits from two years earlier. The screen says so.

  • BdE housing indicators (si_1_5.xlsx), fourth quarter of each year:

  • - homes started: 760,179 in 2006, 35,721 in 2013 and 137,330 in 2025;
    - price in years of gross household income: 4.2 in 1990, 9.3 in 2007 and 7.9 in 2025;
    - first-year mortgage payment as a share of income: 70%, 54% and 35%.

    Reveal (AffordabilityVisual): three tabs that reuse the existing v-toggle:

  • Since 1980: a diverging bar chart.

  • Why Spain?: the boom, credit, collapse and demand context, then homes started per year and the 2021–25 comparison, with its caveat. It also says these recent factors don't explain the whole 45-year divergence.

  • Buying vs repaying: price, deposit and payment for 1990, 2007 and 2025. It says that lower rates don't mean easier access to a mortgage.
  • Flag: this uses homes started, not completions. Banco de España publishes no consistent annual completions series; its report gives only 2025 completions (92,000), and the ministry's statistics site returned 503. The note under the chart says this.

    Saved progress: HOUSING_RETIRED_IDS = { 'hs-ratio': 'hs-affordability' } is merged into QUESTION_ALIASES, so old links open the housing chapter. Old hs-ratio picks are never scored for the new question. A finished run resumes at Q5, and an e2e test covers this.

    Tests: 77 unit tests pass. All 420 Playwright tests pass on desktop, mobile and motion. Lint has only the existing motion.ts warning.

    !Desktop: since 1980
    !Mobile: since 1980
    !Mobile: why Spain
    !Mobile: buying vs repaying

    Link to Devin session: https://app.devin.ai/sessions/790a575a78584a0da19d0742e8b6f2ee
    Open in Devin Desktop: https://app.devin.ai/desktop/session/790a575a78584a0da19d0742e8b6f2ee?variant=devin
    Requested by: @mishpedraza
    <!-- devin-review-badge-begin -->

    ---

    🟢 Devin fixed the finding · Follow Devin's work

    <a href="https://app.devin.ai/review/mishpedraza/data-detective/pull/81" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a><!-- devin-review-badge-end -->

    Diff: 643 lines (+482 / -161) across 8 files Reviewer: devin-ai-integration[bot] Review duration: 9m
    All Vouch review confidence checks passed
    Residual risk 0.36 = Change Risk (0.52) × (1 − Review Confidence (0.32)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 643 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 57% · Reviewer familiarity: 35%
    31%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.387
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #81"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 31.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 51.9% (MEDIUM) · Higher = larger blast radius
    51.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 31.5% · Lower = rushed or shallow review
    31.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 35.6% · Moderate risk
    35.6%