amos f611da1e57 Batch 24: add 23 calibrated tasks written from Bos seed directions
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>
2026-11-02 17:21:50 +08:00

51 lines
1.5 KiB
Python

"""Public simulator API and command line entry point."""
import json
import sys
from decimal_units import InputError
from dispatch_schema import parse_scenario
from dispatch_ledger import Ledger
from dispatch_report import render
def simulate(payload):
scenario = parse_scenario(payload)
ledger = Ledger.start(scenario.config.initial_soc, scenario.config.fuel_kwh)
ledger.run(scenario)
return render(ledger)
def parse_json_text(text):
try:
return json.loads(text)
except (ValueError, TypeError) as error:
raise InputError('input: invalid JSON') from error
def simulate_text(text):
return simulate(parse_json_text(text))
def read_input(argv):
if len(argv) != 1:
raise InputError('usage: python3 dispatch_cli.py INPUT.json')
path = argv[0]
try:
with open(path, 'r', encoding='utf-8') as stream:
return stream.read()
except (OSError, UnicodeError) as error:
raise InputError('input: unreadable file') from error
def write_report(report, stream):
stream.write(json.dumps(report, ensure_ascii=True, sort_keys=True, separators=(',', ':')))
stream.write('\n')
def main(argv=None):
if argv is None:
argv = sys.argv[1:]
try:
report = simulate_text(read_input(argv))
except InputError as error:
sys.stderr.write(str(error) + '\n')
return 2
write_report(report, sys.stdout)
return 0
if __name__ == '__main__':
raise SystemExit(main())