fix: proposal detail page's % divergence figure was a hardcoded stub, never computed (musehub#201)
proposal_detail_page() called musehub_divergence.build_zero_diff_response( ..., include_dimensions=False) unconditionally for both the HTML render path and the JSON content-negotiation path -- a hardcoded placeholder that always returns overall_score=None, which the template then renders as 0% divergence regardless of how divergent the branches actually are.
The real computation, compute_hub_divergence, already exists and is used correctly elsewhere (proposals.py's REST diff endpoint, repos.py's divergence endpoints) -- the proposal detail page itself just never called it.
Added _compute_proposal_diff(), mirroring the exact compute-then-fallback pattern already used by the REST diff endpoint: call compute_hub_divergence(), fall back to build_zero_diff_response() only on the documented ValueError case (a branch with no commits yet), used by both the HTML and JSON-negotiated code paths that previously each had their own copy of the hardcoded stub call.
Semantic Changes
6 symbols
Files Changed
~2
1113 in snapshot
0 comments
muse hub commit comment sha256:6981b7e95adb546ef85b0392504801eb3a74c2bc962dae3960fda4ec7f1242c3 --body "your comment"
No comments yet. Be the first to start the discussion.