← Back to Pull requests

ndg-html: link custom scripts where they are copied #298

Merged
KiaraGrouwstra merged 3 files (53 lines) on Oct 04, 2026 10:37 UTC
View on GitHub
KiaraGrouwstra KiaraGrouwstra commented on Oct 04, 2026 09:28 UTC
Author

copy_script_files copies each script in script_paths to assets/<file name>. But generate_custom_scripts linked the configured source path, with the root prefix in front. A script from outside the output directory, such as /nix/store/<hash>-scripts/custom.js, then got a link that does not resolve, so the script did not load.

This change links {root_prefix}assets/<file name>, the same name that copy_script_files uses.

  • Adds crates/ndg-html/tests/custom_scripts.rs. It fails before the change and passes after.

  • Adds an entry under "Fixed" in CHANGELOG.md.
  • We found this when we added Mermaid diagrams to a site built with ndg: we give a small loader script through script_paths.

    Assisted-by: Claude:claude-opus-5-5

    https://claude.ai/code/session_01RJvbghuj5GtCBiCjmBepNJ

    Diff: 53 lines (+51 / -2) across 3 files Reviewer: NotAShelf Review duration: 68m
    All Vouch review confidence checks passed
    Residual risk 0.11 = Change Risk (0.35) × (1 − Review Confidence (0.68)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.35 · 53 lines diff across 3 files
    0.35
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.35 · 1 substantive comment(s)
    0.35
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    67%
    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.239
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    2 items
    NotAShelf NotAShelf approved these changes on Oct 04, 2026 10:37 UTC
    Approved Reviewer

    LGTM, thank you :)

    Reviewers
    Assignees
    KiaraGrouwstra KiaraGrouwstra
    Labels
    risk: low confidence: 67.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: 34.8% (LOW) · Higher = larger blast radius
    34.8%
    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: 67.5% · Lower = rushed or shallow review
    67.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: 11.3% · Safe to merge
    11.3%
    Repository