WP-0001-T001: service scaffold (Python, FastAPI, uv, ruff, mypy, pytest)

Lands the smallest credible foundation per ADR-0005:

- pyproject.toml: hatchling build, runtime deps (FastAPI, uvicorn, SQLAlchemy 2.0,
  asyncpg, aiosqlite, alembic, blake3, cbor2, typer, structlog, pydantic,
  pydantic-settings); dev deps (pytest, pytest-asyncio, httpx, hypothesis, ruff,
  mypy); ruff + mypy --strict + pytest configured.
- uv.lock committed.
- Makefile thin shims: install / dev / test / lint / format / type / migrate / clean.
- src/artifactstore/ package skeleton with placeholder __init__.py per concern:
  identity, manifest, events, retention, audit, storage, dataplane, registry,
  api/http (minimal FastAPI app, GET / scaffold banner), cli (typer app with
  version subcommand), config (pydantic-settings).
- tests/{unit,integration}/conftest.py present; unit smoke tests assert package
  imports, HTTP root route, CLI version round-trip, settings defaults.
- .env.example documents ARTIFACTSTORE_DATABASE_URL,
  ARTIFACTSTORE_STORAGE_LOCAL_ROOT, ARTIFACTSTORE_LOG_LEVEL.
- README updated with install / dev / test instructions.
- .gitignore: claude local state, local runtime data (var/, sqlite db).

make lint && make type && make test pass on a clean checkout (4 tests, 20
source files type-clean under mypy --strict).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-16 01:30:22 +02:00
parent b1eba9b41e
commit a6b6746f91
27 changed files with 1662 additions and 20 deletions

View File

@@ -5,9 +5,8 @@ evidence packages, reports, logs, snapshots, exports, and release
artifacts.
The registry owns artifact identity, metadata, provenance, retention
policy, and retrieval records. Bytes are delegated to configured
storage backends (local filesystem in v1, S3-compatible / Ceph RGW
next).
policy, and retrieval records. Bytes are delegated to configured storage
backends (local filesystem in v1, S3-compatible / Ceph RGW next).
The shape is library-first (`artifactstore` Python package); the HTTP
server and the CLI are thin consumers. Content is addressed by digest;
@@ -16,26 +15,40 @@ are rebuildable.
## Status
Concept / service-baseline planning. No runnable scaffold yet —
`workplans/ARTIFACT-STORE-WP-0001-service-baseline.md` is the next step.
Scaffold landed. The core kernels and local FS backend follow in the
remaining tasks of [WP-0001](workplans/ARTIFACT-STORE-WP-0001-service-baseline.md).
## Start here
## Develop
Requires Python ≥ 3.12 and [`uv`](https://docs.astral.sh/uv/) on the path.
```sh
make install # uv sync --all-extras
cp .env.example .env
make dev # uvicorn artifactstore.api.http:app --reload
make test # pytest
make lint # ruff check + ruff format --check
make type # mypy --strict
make migrate # alembic upgrade head (configured in WP-0001-T002)
```
The dev server listens on `127.0.0.1:8000`. The scaffold root route
returns `{"service": "artifact-store", "status": "scaffold"}`; the real
`/health` endpoint lands in `WP-0001-T014`.
## Documentation
- [INTENT.md](INTENT.md) — purpose, product thesis, scope, boundary.
- [SCOPE.md](SCOPE.md) — lightweight orientation.
- [docs/ARCHITECTURE-BLUEPRINT.md](docs/ARCHITECTURE-BLUEPRINT.md) — the
v2 architecture: modules, data model, API shape.
- [docs/ARCHITECTURE-BLUEPRINT.md](docs/ARCHITECTURE-BLUEPRINT.md) — v2
architecture: modules, data model, API shape.
- [docs/PLATFORM-AMBITION.md](docs/PLATFORM-AMBITION.md) — longer-horizon
thesis, ffmpeg / VLC reference points, the schema commitments v1
preserves.
- [docs/ROADMAP.md](docs/ROADMAP.md) — workplan sequencing across
phases.
- [docs/adr/](docs/adr/) — architecture decision records (ADR-0001 …
ADR-0006).
thesis and v1 schema commitments.
- [docs/ROADMAP.md](docs/ROADMAP.md) — workplan sequencing across phases.
- [docs/adr/](docs/adr/) — architecture decision records.
- [docs/ASSEMBLY-EXPERIMENT.md](docs/ASSEMBLY-EXPERIMENT.md) — opt-in
research line on hand-tuned assembly for hot kernels.
- [docs/REVIEW-2026-05-15-intent-and-blueprint.md](docs/REVIEW-2026-05-15-intent-and-blueprint.md)
— the SWOT review that triggered this cleanup.
research line on hand-tuned asm for hot kernels.
## Active workplans
@@ -47,5 +60,5 @@ Concept / service-baseline planning. No runnable scaffold yet —
## Agent operating notes
See [AGENTS.md](AGENTS.md) for the StateHub-integrated session
protocol, workplan conventions, and progress-logging contract.
See [AGENTS.md](AGENTS.md) for the StateHub-integrated session protocol,
workplan conventions, and progress-logging contract.