gabriel / musehub public
feat patch proposals task/proposal-models-v2 #15 / 19
AI Agent gabriel · 40 days ago · May 8, 2026 · Diff

feat(proposals): phase 4 — simulation engine

Three simulation types cached in musehub_proposal_simulations:

conflict_scan — dry-runs the merge strategy and returns per-domain conflict breakdown (conflict_count, conflicting_files, conflicts_by_domain, files_added/modified/removed)

risk_projection — projects post-merge dimensional risk using a weighted blend of change_ratio (40%) + conflict_ratio (40%) + existing dimensional_risk (20%); returns risk_band and risk_delta

dependency_order — topological sort of the live dependency DAG; groups nodes into parallel execution phases; surfaces cycles

New symbols: genesis.py: compute_simulation_id(proposal_id, simulation_type, from_branch_commit_id) models/musehub.py: SimulationType enum, SimulationResponse, SimulationListResponse proposal_simulation.py: pure engine — simulate_conflict_scan, simulate_risk_projection, simulate_dependency_order (no DB I/O) musehub_proposals.py: run_simulation, get_simulation, list_simulations service functions; upsert semantics on re-run; is_stale=True when from_branch advances proposals.py routes: POST/GET /simulations/{type}, GET /simulations (list)

38 tests all passing.

sha256:18d2953fc912010676a67b6797f26ef794a268a0479a9ab0c9d5fdfa8769f02d sha
sha256:ad452948b675b580c813acf914c591b9ab2b84c01dfc5c253fed044ce7e4c2fb snapshot

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:18d2953fc912010676a67b6797f26ef794a268a0479a9ab0c9d5fdfa8769f02d --body "your comment"