harbor run -t openthoughts/tasktrove-exp-rle-github-issue-v3-5k-github-issue-3979harbor download openthoughts/tasktrove-exp-rle-github-issue-v3-5k-github-issue-3979Title: Implement dit.distribution_from_bayesnet(graph, rv_names=None, sample_space=None)
Description: Add a robust, self-contained function distribution_from_bayesnet in the dit module that constructs a joint Distribution from a Bayes net described by a NetworkX DiGraph. The graph describes random variables and their conditional dependencies via edges, and each node carries a dist attribute that encodes how that node behaves (root marginals or conditionals). The function must support multiple formats for node distributions, validate inputs, handle named or unnamed variables, and produce a dit.Distribution whose outcomes are joint assignments (as strings like "000" for three binary variables) with a matching PMF and sample_space.
Requirements (what the function must implement and enforce):
Input handling and validation
Distribution formats supported on nodes (node dist attribute)
Joint distribution construction
Error handling aligned with tests
Acceptance criteria (what would indicate tests pass)
Notes for implementer:
Steps to reproduce / Implementation plan (to guide work and testing):
Note: The implementation can be pragmatic and brute-force in approach, focusing on correctness and compatibility with the dit.Distribution API and the test expectations.