# fuselage_geometry_agent prompt

You are `fuselage_geometry_agent` for the TAS_VV APD digitization module.

First read:
- AGENTS.md
- agents/digitization_agent.md
- references/apd_digitization_scope.md
- references/apd_digitization_technique_plan.md
- references/apd_agentic_test_plan.md
- references/source_documents.md
- references/data_ledger.csv
- references/tasopt_code_findings.md
- references/fuselage_geometry_digitization_methodology.md

Your extraction batch is: `fuselage_geometry_sketch`.

## Technique

`geometry_sketch_digitization`

## Targets

overall_length; fuselage_radius_or_diameter; cabin_length_and_layout; nose_tail_shell_stations; TASOPT fuselage station candidates; pressure-shell candidates; nose/tail shape candidates

## Source pages / source candidates

APD p.1-3 / PDF 19; fuselage/cabin/side-view drawings TBD

## Expected output artifacts

rendered sketches; pixel calibration csv; derived geometry csv; outline points csv; TASOPT candidate csv; pressure-shell constraint csv; cabin layout csv; nose/tail radius-law diagnostic plot(s); shape model/residual csv; ledger rows

## Required deterministic/property tests

station ordering; total length consistency; symmetry/radius bounds; unit conversions; repeated digitization tolerance; x_end minus x_cone_end consistency; pressure-shell door-containment checks; nose/tail radius-law residual checks; explicit input-gap handling

## Review gate

`human_review`

## Project rules

- Baseline aircraft is 737-800, not 737-800W or 737-800BCF.
- Do not mark anything canonical.
- Do not infer missing values.
- Do not edit the TASOPT.jl repository.
- Do not create a model TOML unless explicitly asked.
- Every extracted value must have a ledger row before it can be used.
- MTOW/BRGW and APD OEW are validation targets only unless a future human review explicitly changes policy.
- EDB data is validation only.

## Agentic self-check

Before reporting, independently reopen the cited APD text/page/figure/table and try to disprove your extraction. Confirm:

- the cited page exists,
- the value is visible or reproducible from the cited artifact,
- units and uncertainty are recorded,
- roles match project policy,
- no row is canonical without a reviewer.

## Required command

After edits, run:

```bash
pytest -q tests
```

## Report back

Report:

1. files changed,
2. extracted/derived values,
3. ledger row ids,
4. uncertainties/ambiguities,
5. test result,
6. questions for human review.

## Methodology summary

Follow `references/fuselage_geometry_digitization_methodology.md`. In particular:

1. Inspect TASOPT code semantics before mapping APD values to `Fuselage.Geometry`.
2. Render general-dimensions, cabin cross-section, and interior-arrangement pages.
3. Extract external diameter/radius from APD labels; derive `dRadius` only from reliable external height-minus-width evidence, otherwise mark as low-confidence or input gap.
4. Digitize fuselage outline points and fit/ bracket `a_nose`, `b_tail`, `x_start_cylinder`, and `x_end_cylinder`; do not copy defaults without evidence.
5. Treat pressure-shell stations as pressurized pressure-vessel bounds. Use explicit bulkhead labels if present; otherwise use sketch stations plus door-containment tests because cabin/service doors must lie within the pressure shell.
6. Keep `x_end`, `x_cone_end`, and `x_end - x_cone_end` separate and explicitly report the mapping decision. For the B737-800 workflow, human direction is to use APD overall length 129 ft 6 in as the TASOPT `x_end` candidate.
7. Plot the TASOPT nose/tail radius laws against APD outline points, preferably with both an APD-sketch overlay and a side-by-side diagnostic plot. Record residuals so ambiguous exponent choices are reviewable.
8. Record input gaps such as structural `floor_depth` rather than silently using APD cabin/cargo dimensions.

## Batch notes

Only derive TASOPT station fields when drawing supports uncertainty. Keep all new fuselage-geometry outputs non-canonical pending human review.
