wedge(T001-T003): monorepo skeleton, uv workspaces, ruff+pytest config

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
m2 (AI Agent) 2026-07-02 02:19:47 +02:00
parent 4406bbf3e4
commit ec98e294a7
15 changed files with 104 additions and 7 deletions

View file

@ -32,10 +32,10 @@ genuinely new services: `m2-ledger` (append-only internal credits) and the `Solu
(surface) · cargstore (storefront) · Forgejo (registry) · Coolify (deploys).
## Open forks (need operator decision — CONCEPT.md §14)
1. Ledger substrate: standalone m2-ledger (rec.) vs extend m2-gpt billing vs Forgejo-as-ledger
2. Pricing v1: fixed per install (rec.) vs metered vs both
3. Storefront: cargstore Electron revival (rec.) vs web-first vs both
4. Scout host: standalone supervised watcher (rec.) vs Hermes plugin vs herdr plugin
1. Ledger substrate: standalone m2-ledger , could become a crypto ledger that is managed in extended m2-gpt billing
2. Pricing v1: fixed per install (rec.) vs metered vs both (when applicable, sometimes othe m2o take a job for a solution)
3. Storefront: cargstore Electron revival (rec.) vs web-first vs both MVP electron app that connects to coolify or other parts with credentials from m2-gpt
4. Scout host: standalone supervised watcher (rec.) vs Hermes plugin vs herdr plugin (explore solution)
5. Seed Solutions: mm-pdf · agent-scaffold · competitor-scan (proposed)
6. Platform cut % + starter grant (defaults 10% / 100 cr)

24
cli/pyproject.toml Normal file
View file

@ -0,0 +1,24 @@
[project]
name = "m2-market"
version = "0.1.0"
description = "M2 Marketplace CLI — search | show | install | wallet | publish (contracts/cli.md)"
requires-python = ">=3.12"
dependencies = [
"click>=8.1",
"httpx>=0.27",
"jsonschema>=4.23",
"pyyaml>=6",
]
[project.scripts]
m2-market = "m2_market.cli:main"
[dependency-groups]
dev = ["pytest>=8"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/m2_market"]

0
cli/tests/.gitkeep Normal file
View file

0
docs/.gitkeep Normal file
View file

21
indexer/pyproject.toml Normal file
View file

@ -0,0 +1,21 @@
[project]
name = "m2-market-indexer"
version = "0.1.0"
description = "Registry → market:catalog sync; reindex = full rebuild (contracts/catalog-index.md)"
requires-python = ">=3.12"
dependencies = [
"httpx>=0.27",
]
[project.scripts]
m2-market-indexer = "m2_market_indexer.reindex:main"
[dependency-groups]
dev = ["pytest>=8"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/m2_market_indexer"]

20
ledger/pyproject.toml Normal file
View file

@ -0,0 +1,20 @@
[project]
name = "m2-ledger"
version = "0.1.0"
description = "M2 credits ledger — append-only transactions, derived balances (contracts/ledger-api.md)"
requires-python = ">=3.12"
dependencies = [
"fastapi>=0.115",
"uvicorn>=0.30",
"httpx>=0.27",
]
[dependency-groups]
dev = ["pytest>=8", "hypothesis>=6"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/m2_ledger"]

0
ledger/tests/.gitkeep Normal file
View file

19
pyproject.toml Normal file
View file

@ -0,0 +1,19 @@
[project]
name = "m2-market-workspace"
version = "0.1.0"
description = "M2 Marketplace monorepo — schemas, ledger, CLI, indexer (spec 001-market-first-wedge)"
requires-python = ">=3.12"
[tool.uv.workspace]
members = ["ledger", "cli", "indexer"]
[tool.ruff]
line-length = 100
target-version = "py312"
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B"]
[tool.pytest.ini_options]
testpaths = ["schemas/tests", "ledger/tests", "cli/tests"]
addopts = "-q"

0
schemas/tests/.gitkeep Normal file
View file

0
scout/.gitkeep Normal file
View file

View file

View file

View file

View file

@ -16,9 +16,9 @@ at the end of Phase 5 — Store (US4) and Scout (US5) are NOT on that path.
**Purpose**: monorepo scaffolding per plan.md Project Structure
- [ ] T001 Create monorepo skeleton: `schemas/`, `ledger/`, `cli/`, `indexer/`, `solutions/`, `scout/`, `store/README.md` (pointer file) per plan.md structure
- [ ] T002 Initialize uv workspaces: `ledger/pyproject.toml` (fastapi, uvicorn, pytest), `cli/pyproject.toml` (click, httpx, pytest), `indexer/pyproject.toml` (httpx) — Python 3.12
- [ ] T003 [P] Configure ruff + pytest defaults at repo root (`pyproject.toml` tool sections shared via workspace)
- [x] T001 Create monorepo skeleton: `schemas/`, `ledger/`, `cli/`, `indexer/`, `solutions/`, `scout/`, `store/README.md` (pointer file) per plan.md structure
- [x] T002 Initialize uv workspaces: `ledger/pyproject.toml` (fastapi, uvicorn, pytest), `cli/pyproject.toml` (click, httpx, pytest), `indexer/pyproject.toml` (httpx) — Python 3.12
- [x] T003 [P] Configure ruff + pytest defaults at repo root (`pyproject.toml` tool sections shared via workspace)
---

13
store/README.md Normal file
View file

@ -0,0 +1,13 @@
# M2 Store — pointer
The M2 Store is NOT developed in this repo. It evolves from **cargstore**
(github.com/machine-machine/cargstore), branch `m2-store` — see plan.md Structure Decision
and research.md R7.
Contracts it consumes from this repo:
- `specs/001-market-first-wedge/contracts/catalog-index.md` — catalog reads
- `specs/001-market-first-wedge/contracts/cli.md` — installs shell `m2-market install --json`
- `schemas/listing.schema.json` — listing shape
Tasks: T037T040 (US4), canary-only (chris-m2o, gunnar-m2o).