SEC 10-K Financial Parsing
Domain: business_finance — Accounting & Finance

Summary: Parse a fixed 100-filing SEC 10-K corpus into normalized financial JSON outputs, preserve the raw text evidence used for extraction, answer three cross-filing analytical questions, and rerun a fixed validation subset deterministically.

Task prompt:
You are working on a Linux VM with a fixed corpus of SEC 10-K PDFs.

Visible files and tools:
- Filing corpus: `base/input/filings`
- Filing metadata: `base/input/filings/manifest.json`
- Output schema: `base/input/schema/extraction_schema.json`
- Normalization rules: `base/input/schema/normalization_rules.txt`
- Analytical questions: `base/input/questions.json`
- Deterministic validation subset: `base/input/validation`
- Python wrapper for the staged task runtime: `base/software/python_with_task_deps.sh`

Your job:
1. Parse every filing in `input/filings/`.
2. Save one normalized extraction JSON per filing to `base/output/extractions`.
3. Save one raw extraction text file per filing to `base/output/raw_extractions`.
4. Answer the analytical questions and save them to `base/output/qa_answers.json`.
5. Re-run the extraction workflow on the fixed validation subset in `input/validation/`
   and save those second-pass extraction JSONs to `base/output/run2_extractions`.

Important requirements:
- Follow the staged schema and normalization rules exactly.
- Use raw USD integers for monetary fields and 2-decimal floats for EPS.
- Do not write outside `base/output`.
- Do not modify files under `input/`.
- The validation rerun should reflect a second deterministic pass over the same
  visible validation filings.


The agent must:
Inspect the staged SEC 10-K corpus in `input/filings/` and use `input/filings/manifest.json` to understand company, ticker, and year coverage.
Produce one normalized extraction JSON per filing under `output/extractions/`, following the staged schema and normalization rules exactly.
Save one raw extraction text file per filing under `output/raw_extractions/` that preserves the text evidence actually used from each PDF.
Answer the three staged analytical questions and save them to `output/qa_answers.json`.
Re-run the extraction workflow on the fixed 5-file validation subset in `input/validation/` and save the second-pass JSON outputs under `output/run2_extractions/`.

Software: Python
uv
pdfplumber
pypdf
pydantic

Input files:
name: filings/
format: Directory of PDFs
description: Fixed 100-filing SEC 10-K corpus.
name: manifest.json
format: JSON
description: Filing metadata covering ticker, company name, CIK, year, and accession information.
name: extraction_schema.json
format: JSON Schema
description: Required normalized output schema for each filing.
name: normalization_rules.txt
format: Text
description: Formatting and unit rules for extracted financial values.
name: questions.json
format: JSON
description: Three analytical questions that must be answered from the extracted data.
name: validation/
format: Directory of PDFs
description: Fixed 5-filing subset used for the deterministic rerun contract.
name: python_with_task_deps.sh
format: Shell wrapper
description: Task-scoped Python entrypoint that installs and runs the staged runtime environment.