skill: add demo simulation triggers to four bundled skills#165
Merged
Conversation
The demo-simulation package proves the Ori runtime decision stack by evaluating simulated Lagos building sensor readings through ori.integration. The four bundled energy skills were missing the triggers needed to cover all seven demo scenarios, so the demo had to ship its own temporary skill YAML. This commit adds those triggers to the correct first-party skills so the demo can run against the real bundled stack with skills_root=None: energy-anomaly-detector: - Fix dangerous_overcurrent condition: add sensor_type guard so voltage and other non-current readings cannot false-fire the Tier D path - Add voltage_overvoltage (Tier D) for grid overvoltage events (>260V) - Add grid_phcn_restored (Tier B) for grid restoration detection; phcn_restore_active flag defaults to 0 and is injected by hooks when load is on generator, preventing false fires on deployments without live context battery-lifecycle-observer: - Add battery_emergency_cutoff (Tier D) for critical SOC (<5%); covers sensor_type='battery' (simulation), Growatt, Victron, and hook-derived is_soc_sensor so the same trigger works across all supported inverters hvac-refrigerant-monitor: - Add compressor_overload (Tier C, requires_approval) for overcurrent against a commissioning-measured baseline; compressor_fault_active flag defaults to 0 and is set by hooks after the technician records the baseline draw solar-performance-monitor: - Add solar_output_degraded (Tier A) using performance_ratio forwarded from reading metadata; expected_output_watts defaults to 0.0 to suppress night-time firing without a live StateStore
Five tests hardcoded trigger counts and condition strings that no longer
match after the demo simulation triggers were added in the previous commit.
- test_battery_lifecycle_skill: 3 → 4 triggers; tiers now {"A", "D"}
- test_energy_anomaly_skill: 4 → 6 triggers; tiers now {"A", "D", "B"}
- test_hvac_skill: 3 → 4 triggers
- test_solar_performance_skill: 3 → 4 triggers; tier set stays {"A"}
- test_integration_rule_evaluation: update proof_rule_condition string to
match the sensor_type guard added to dangerous_overcurrent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The demo-simulation package (
ori-energyrepo) proves the Ori runtime decision stack by evaluating simulated Lagos building sensor readings throughori.integration. The four bundled energy skills were missing triggers needed to cover all seven demo scenarios, so the demo was shipping a temporaryori-energy-demoskill YAML. This PR adds those triggers to the correct first-party skills so the demo can run against the real bundled stack withskills_root=None— removing the demo-specific skill entirely.Scenario → skill mapping after this PR:
energy-anomaly-detectordangerous_overcurrent(fixed)energy-anomaly-detectorvoltage_overvoltage(new)energy-anomaly-detectorgrid_phcn_restored(new)battery-lifecycle-observerbattery_emergency_cutoff(new)solar-performance-monitorsolar_output_degraded(new)hvac-refrigerant-monitorcompressor_overload(new)energy-anomaly-detectordangerous_overcurrent(fixed)Type of change
skill— new or updated bundled skillChecklist
Required for all PRs
pytest tests/ -vpasses with 0 failuresruff check --fix ori/ tests/ skills/is clean.pyfile has the Apache-2.0 license headerdocs/CAPABILITY_MATRIX.mdis updated in this PR[skip-cap-matrix]in PR body with rationaleIf you used AI assistance
If this adds or modifies a bundled skill (
/skills/)action_tieris declared on every triggerbypass_llm: trueis only paired withaction_tier: Drequires_approval: true(compressor_overload)hooks.pychanges — skill YAML onlysubprocesscallsRelated issue
No issue opened — these triggers are the direct complement to the
ori-energydemo simulation refactor (feat/demo-api-sim-structure-cleanup) and contain no novel capability decisions. All trigger semantics were validated against the simulator before this PR.Testing notes
Triggers were validated against the
demo-simulationphysics engine. Each trigger condition was tested by copying the updated YAMLs into the local venv and running the full 131-test suite. Key guard rationale:phcn_restore_active: 0default — prevents grid_phcn_restored from firing on deployments without live hook context (hooks inject 1 when load is confirmed on generator)compressor_fault_active: 0default — prevents compressor_overload from firing until a technician commissions the baseline_current at the sitebattery_emergency_cutoffTier Dbypass_llm: true— matches the same safety invariant asdangerous_overcurrent; no LLM delay is acceptable at <5% SOC with load drawing down