8.0 KiB
Sprint 1 Contract: Project Scaffold And Fast Test Loop
Status: Completed Last updated: 2026-05-07
Objective
Create the minimal Python project scaffold and fast local test loop for the PDF-to-Markdown converter.
Sprint 1 must establish:
- A
uv-managed Python 3.12 project. - A source package importable as
pdf2md. - A reserved
pdf2mdCLI entry point that does not implement conversion yet. - A fast test command that runs without MinerU, model downloads, GPU access, sample PDFs, or network access.
Sprint 1 is scaffolding only. It must not implement PDF conversion, MinerU execution, Markdown normalization, metadata generation, or report generation.
Current Precondition
Sprint 0 found that uv was not available on PATH in the current local environment.
Sprint 1 resolved this by installing uv per-user at C:\Users\user\.local\bin.
Before Sprint 1 can be accepted, one of these must happen:
uvis installed anduv --versionsucceeds.- The user explicitly approves including
uvbootstrap documentation or setup handling as part of Sprint 1, and the contract result records thatuv synccould not be run locally.
Do not silently replace uv with another package manager.
Touched Surfaces
Allowed:
pyproject.tomluv.lock.gitignoresrc/pdf2md/__init__.pysrc/pdf2md/cli.pyonly for a minimal placeholder CLI if needed for entry point verificationtests/README.mdonly for minimal setup/test instructions if neededPLAN.mdonly for current-goal coordination updates required by the shared agent workflowPROGRESS.mddocs/V1IMPLEMENTATIONPLAN.mdonly if sequencing or constraints need adjustmentdocs/Sprints/SPRINT1CONTRACT.md
Not allowed:
src/pdf2md/conversion.pysrc/pdf2md/mineru_adapter.pysrc/pdf2md/paths.pysrc/pdf2md/ir.pysrc/pdf2md/markdown.pysrc/pdf2md/metadata.pysrc/pdf2md/quality.pysrc/pdf2md/report.pysrc/pdf2md/doctor.pyscripts/- Any real MinerU invocation
- Any model download or install script
- Any committed file under
samples/
Expected Outputs
Sprint 1 should produce:
-
Project package scaffold
pyproject.tomlwith project metadata.- Python requirement constrained to Python 3.12.
- Build configuration suitable for a
src/layout. uv.lockgenerated byuv sync..gitignoreentries for local virtual environments, pytest cache, and Python bytecode.- Minimal test dependency configuration.
- CLI entry point name reserved as
pdf2md.
-
Minimal source package
src/pdf2md/__init__.py.- A stable package import surface.
- Optional minimal
src/pdf2md/cli.pyplaceholder that exits clearly and does not imply conversion is implemented.
-
Fast test loop
- A minimal test suite that verifies the package imports.
- If a CLI placeholder is added, a smoke test that verifies the CLI entry point is wired without invoking conversion.
- Tests must not require MinerU, CUDA, GPU, model files,
samples/, or network.
-
Developer workflow
uv syncshould work whenuvis installed.uv run pytestshould work whenuvis installed.- If
uvis still missing locally, record the failure explicitly inPROGRESS.mdand do not mark Sprint 1 complete.
-
Handoff
PROGRESS.mdrecords changed files, commands run, tests passed or blocked, known failures, residual risks, and next action.
Non-Goals
- Do not implement PDF discovery.
- Do not implement conversion orchestration.
- Do not implement the MinerU adapter.
- Do not run MinerU.
- Do not install MinerU 3.1.0.
- Do not download MinerU models.
- Do not implement Markdown normalization.
- Do not implement metadata JSON or
.report.mdoutput. - Do not implement
pdf2md doctor; a CLI placeholder may mention future commands, but it must not create a doctor module. - Do not add runtime engine selection.
- Do not add alternate conversion engines.
- Do not add cloud, remote API, router, HTTP client backend, or remote OpenAI-compatible backend support.
Work Packages
WP1.1: Scaffold Metadata
Owner:
feature-generator-agent
Actions:
- Create the minimal
pyproject.toml. - Use Python 3.12 constraints.
- Configure a
src/package layout. - Configure pytest as the fast local test runner.
- Reserve the
pdf2mdconsole script.
Output:
- A minimal, maintainable scaffold without speculative dependencies.
WP1.2: Package Import Surface
Owner:
feature-generator-agent
Actions:
- Create
src/pdf2md/__init__.py. - Expose only a minimal version/import surface.
- Avoid public API promises beyond what Sprint 1 verifies.
Output:
import pdf2mdsucceeds.
WP1.3: CLI Placeholder
Owner:
feature-generator-agent
Actions:
- If needed for console script verification, create
src/pdf2md/cli.py. - The placeholder may expose a help message or a clear "not implemented yet" command.
- It must not create conversion flags beyond the reserved command shape unless tests need them.
Output:
pdf2mdentry point is wired without implying conversion works.
WP1.4: Fast Tests
Owner:
feature-generator-agentevaluation-agent
Actions:
- Add minimal tests for package import and optional CLI placeholder behavior.
- Ensure tests are local, fast, and independent of MinerU/model/GPU/network state.
Output:
uv run pytestpasses whenuvis available.
WP1.5: Independent Evaluation
Owner:
evaluation-agent
Actions:
- Review the completed scaffold against this contract.
- Verify no converter implementation was added.
- Verify
samples/remains untracked and unstaged. - Verify no runtime remote path or alternate engine was introduced.
Output:
- PASS/FAIL notes with any missing acceptance criteria.
Verification Checks
Required:
git status --shortbefore staging confirmssamples/remains untracked.uv --versionis run and result is recorded.uv syncpasses ifuvis available.uv run pytestpasses ifuvis available.- If
uvis unavailable, Sprint 1 is marked blocked rather than complete. - Import test passes through the configured test command.
- No real MinerU dependency is required for default tests.
- No model downloads occur.
- No network calls are required.
- No candidate engine comparison is reintroduced.
- No conversion behavior is implemented.
git diff --checkpasses.
Recommended:
- Keep
pyproject.tomldependency list minimal. - Avoid adding README content beyond setup/test instructions needed for the scaffold.
- Use
requirements-guard-agentto check document consistency if the scaffold reveals a sequencing issue.
Hard Failure Criteria
Sprint 1 fails and must stop for a user decision if any of these are true:
uvremains unavailable and the user has not approved bootstrap handling.- The project cannot be installed as a Python 3.12 package.
- The package cannot be imported as
pdf2md. - Default tests require MinerU, model downloads, GPU access, sample PDFs, or network access.
- The scaffold introduces conversion logic outside Sprint 1 scope.
- The scaffold introduces alternate engines or runtime engine selection.
- The scaffold introduces
--api-url, remote APIs, router mode, HTTP client backends, or remote OpenAI-compatible backends. samples/is staged or committed.
Acceptance Criteria
Sprint 1 is complete when:
pyproject.tomlexists and defines a minimal Python 3.12uvproject.src/pdf2md/__init__.pyexists andimport pdf2mdworks through the project environment.uv syncpasses.uv run pytestpasses.- The
pdf2mdCLI entry point is reserved and does not imply conversion is implemented. - No converter implementation code beyond the allowed placeholder exists.
- No default test depends on MinerU, GPU, model files, network, or
samples/. PROGRESS.mdrecords checks performed and residual risks.- Independent evaluation is complete.
- The completed change is committed.
Handoff Fields
Use these fields when Sprint 1 completes:
- Files changed:
- Commands run:
- Tests passed:
- Tests blocked:
- Known failures:
- Residual risks:
- User decisions needed:
- Go/no-go recommendation for Sprint 2:
- Next action: