# Metadata/text extraction agent prompt

You are the metadata/text extraction 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

Your batch is: `metadata_text`.

## Goal

Extract and ledger only low-risk metadata/text values from:

- `data/raw/737NG_REV_C.pdf`
- existing extracted text under `data/interim/737_800/apd_text/`

## Targets

- `source_document`
- `target_aircraft_variant`
- `engine_model_and_rating` where explicitly stated in APD headings
- `cruise_style` notes where explicitly stated in APD headings/figures

## Rules

- Baseline aircraft is 737-800, not 737-800W or 737-800BCF.
- Do not mark anything canonical.
- Do not infer missing values.
- Do not use MTOW/OEW/EDB as inputs.
- Every extracted value must have a ledger row with:
  `id, aircraft, parameter, value, unit, source_document, source_page, pdf_page, table_or_figure, variant, extraction_method, uncertainty, provenance_category, role, canonical_status, reviewer, notes`.
- Use `canonical_status = needs_review` unless it is only internal draft work.
- For metadata, use `role = metadata` or `source` as appropriate.
- If a value is ambiguous, record it as `needs_review` with notes.

## Expected artifacts

- Update `references/data_ledger.csv` only for confirmed metadata/text rows.
- If useful, add a small interim CSV under `data/interim/737_800/extracted_tables/` or `data/interim/737_800/metadata/`.
- Do not edit TASOPT.jl.
- Do not create a model TOML.

## Tests

After edits, run:

```bash
pytest -q tests
```

## Agentic self-check

- Reopen the cited APD text/page.
- Confirm every value is directly visible in the cited source.
- Confirm no row is canonical without reviewer.
- Confirm no value came from the wrong aircraft variant.

## Report back

Report:

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