feat(rules): a scenario adds nodes to the shared network #104
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 227 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.325
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #104"
general
weight: 0.35
hakuturu583
Closes #103 (part of #35). This lands before #92's downstream migration.
Problem
A scenario's own Bayesian-network nodes, such as the gap a cut-in is staged at, belong in a rule file that lives with the scenario. Rule files could only be merged over one another (
Rules.merged,Backend.use_rules), and a merge replaces silently. A scenario that reused a shared name would change the network every other scenario follows.Changes
Rules.extended(added)adds added's nodes to these rules and replaces nothing. It refuses:- a quantity both define;
- an input both describe otherwise (
default, orconcept/unit);- taxonomies of different content.
An added node may read the shared quantities and inputs.
Backend.add_rules(rules | path | None)holds a scenario's nodes and checks them when they are added.-
active_rulesis the shared rules (a run'suse_rulesover them) extended by those nodes, joined once and cached.-
use_ruleschecks that the scenario's nodes still add to the new shared rules.Tests
test_a_scenario_adds_nodes_to_the_shared_networkcovers:- a node reading the shared grip, and a root;
- the joined order and upstream;
- sampling at quantiles;
- refusing a redefined quantity and an input described otherwise.
test_a_backend_holds_a_scenarios_nodescovers:- adding from a file;
- the cache;
- a run's rules over the shared ones keeping the scenario's nodes;
- refusing a scenario that redefines a shared node (the earlier nodes are kept);
-
Nonedropping the nodes.---
_Generated by Claude Code_