Title: FDS Single-Compartment Detector Reconstruction
Domain: transport_safety — Fire Science & Public Safety

Summary: Complete a Linux Python CLI that reconstructs a synthetic single-compartment FDS/Smokeview detector-response case from visible fire-safety engineering inputs.

Task prompt:
You are acting as a senior fire protection engineer reconstructing a synthetic single-compartment detector-response incident on a Linux VM.

## Visible Starter Project
- Starter project directory: `base/input/project`
- Task prompt: `base/input/TASK_PROMPT.md`
- Visible scenario input: `base/input/project/input/visible`
- Starter CLI: `base/input/project/reconstruct_fire_case.py`

## Your Task
Complete the reconstruction CLI so it can run with this exact contract:

```bash
python reconstruct_fire_case.py --input-dir <scenario_input_dir> --output-dir <output_dir>
```

Use the visible project files and the documented reconstruction contract. Your implementation must generalize to scenario directories with the same schema; do not hard-code the visible case ID or output values.

## Required Final Submission
Write your completed submission package to:

`base/output`

At minimum, `base/output/reconstruct_fire_case.py` must exist. The evaluator will run that script against scenario input directories and check the generated FDS/Smokeview artifacts.

## Required CLI Outputs
For each scenario, your CLI must write these files into the CLI `--output-dir`:
- `completed_case.fds`
- `device_manifest.json`
- `hrr_reconstruction.csv`
- `detector_activation.csv`
- `tenability_summary.csv`
- `grid_sensitivity.csv`
- `engineering_memo.md`

## Important Rules
- Do not modify files under `base/input`.
- Use `base/output` only for your final submitted files.
- FDS/Smokeview are available at `base/software/fds` and `base/software/smokeview` for optional professional validation, but the submitted CLI must run offline with Python standard-library code.

## Canonical FDS Deck Serialization

- Create the fire-source vent with `ID='FIRE_VENT'` and `SURF_ID='FIRE_SURF'`.
- Copy scenario vent and obstruction IDs and `xb` strings from `room_geometry.json` without reformatting the supplied `xb` text.
- Write every detector `XYZ` coordinate with exactly two decimal places, comma-separated with no spaces.
- Write `MESH IJK` as comma-separated integers with no spaces. Write room `XB` as `0,<room_x>,0,<room_y>,0,<room_z>`, using literal `0` lower bounds and the JSON numeric spelling of each room dimension.
- Write `TIME T_END` with one decimal place.
- Include `HRR_RAMP` records at all nine times documented by the reconstruction contract and write the peak fraction as `F=1.00000`.


The agent must:
Inspect the visible starter project and task prompt under input/project.
Infer the HRR ramp from the supplied field_sensor_traces.csv rather than hard-coding case IDs or output values.
Complete reconstruct_fire_case.py so it works for any same-schema scenario directory.
Place the completed reconstruct_fire_case.py at the root of the runtime output directory.

Software: Python 3.10
FDS 6.10.1
Smokeview 6.10.1

Input files:
name: Starter project
format: Python project directory
path: input/project/
description: Visible starter CLI, visible scenario inputs, prompt, and reconstruction contract.