Batch 24 (20261102-C-bos-seed-24) screened all 3078 Bos seed queries. Only 23 themes were in scope (pure user-space reliability, at most one task per theme); the rest were single operations or explanations, installs and networking, system administration, ROS2, board-only or GUI requests. Two finished drafts were withdrawn as too close to existing tasks. Seeds supply direction only: all sources, contracts and tests are new, and no task shares more than 14 characters with its seed text. Each task passed the local gate and the trace6 Docker gate (5 runs per sample class). Claude rebuilt the catalog from the calibration receipts: 23/23 USABLE. 16 of 23 are C/C++. Only the task directories are taken; the batch worktree's lowered disk floor in rollout/core.py stays out of main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
75 lines
2.7 KiB
Python
75 lines
2.7 KiB
Python
"""Render the allocation path as a stable ordered decision log."""
|
|
from decimal_units import ZERO, format_energy
|
|
|
|
STAGES = ('solar_load', 'solar_charge', 'battery_load', 'grid_load',
|
|
'generator_load', 'solar_spill', 'unmet_load')
|
|
|
|
def event(stage, value, reason):
|
|
return {'stage': stage,
|
|
'energy': format_energy(value),
|
|
'status': 'used' if value > ZERO else 'idle',
|
|
'reason': reason}
|
|
|
|
def solar_load_reason(record):
|
|
if record.inputs.solar == ZERO:
|
|
return 'no_solar'
|
|
if record.inputs.demand == ZERO:
|
|
return 'no_load'
|
|
return 'solar_first'
|
|
|
|
def charge_reason(record):
|
|
if record.actions.pv_to_battery > ZERO:
|
|
return 'surplus_stored'
|
|
if record.inputs.solar <= record.inputs.demand:
|
|
return 'no_surplus'
|
|
if record.inputs.soc >= record.inputs.capacity:
|
|
return 'storage_full'
|
|
return 'charge_limited'
|
|
|
|
def discharge_reason(record):
|
|
if record.actions.battery_to_load > ZERO:
|
|
return 'deficit_served'
|
|
if record.inputs.demand <= record.actions.pv_to_load:
|
|
return 'no_deficit'
|
|
if record.inputs.soc <= record.inputs.reserve:
|
|
return 'reserve_held'
|
|
return 'discharge_limited'
|
|
|
|
def grid_reason(record):
|
|
if record.actions.grid_to_load > ZERO:
|
|
return 'deficit_served'
|
|
if record.inputs.demand <= record.actions.pv_to_load + record.actions.battery_to_load:
|
|
return 'no_deficit'
|
|
return 'grid_unavailable'
|
|
|
|
def generator_reason(record):
|
|
if record.actions.generator_to_load > ZERO:
|
|
return 'backup_served'
|
|
supplied = (record.actions.pv_to_load + record.actions.battery_to_load +
|
|
record.actions.grid_to_load)
|
|
if record.inputs.demand <= supplied:
|
|
return 'no_deficit'
|
|
if record.inputs.fuel == ZERO:
|
|
return 'fuel_empty'
|
|
return 'generator_unavailable'
|
|
|
|
def spill_reason(record):
|
|
if record.actions.pv_spill > ZERO:
|
|
return 'storage_limited'
|
|
return 'no_spill'
|
|
|
|
def unmet_reason(record):
|
|
if record.actions.unmet > ZERO:
|
|
return 'sources_exhausted'
|
|
return 'fully_served'
|
|
|
|
def decision_events(record):
|
|
actions = record.actions
|
|
return [event('solar_load', actions.pv_to_load, solar_load_reason(record)),
|
|
event('solar_charge', actions.pv_to_battery, charge_reason(record)),
|
|
event('battery_load', actions.battery_to_load, discharge_reason(record)),
|
|
event('grid_load', actions.grid_to_load, grid_reason(record)),
|
|
event('generator_load', actions.generator_to_load, generator_reason(record)),
|
|
event('solar_spill', actions.pv_spill, spill_reason(record)),
|
|
event('unmet_load', actions.unmet, unmet_reason(record))]
|