# Step 2: figure-asset-writer ## Read First - /AGENTS.md - /PLAN.md - /PROGRESS.md - /docs/HARNESS.md - /docs/IMPLEMENTATION_PLAN.md - /docs/ARCHITECTURE.md - /docs/CONVERSION_POLICY.md - /phases/1-core-runtime-contracts/step2.md - /phases/5-markdown-rendering-assets/step0.md ## Task Implement deterministic image/figure asset writing and Markdown image reference generation. Use hash-based deduplication when asset bytes are available and preserve figure captions and reference anchors. ## Sprint Contract - Done means: figure assets can be written to temp output bundles with deterministic names and Markdown references. - Hard thresholds: duplicate images share stored assets where configured; Korean path output is tested; missing assets produce validation failures, not broken silent links. - Files owned: `src/pdftomd/assets.py`, renderer integration/tests, `PROGRESS.md`, phase index. - Dependencies: Output bundle contract and renderer. ## Acceptance Criteria ```powershell python scripts\validate_workspace.py .\venv\python.exe -m pytest tests ``` ## Verification 1. Run the acceptance commands. 2. Confirm tests write only to temporary directories. 3. Update `PROGRESS.md` and this phase index. ## Do Not - Do not write into real `output/` during tests. - Do not rename source PDFs. - Do not drop figure captions.