# Lumi Lab Tests

> Runs Lumi ERP tests and git/worktree work the factory way: Docker-only pytest via official wrappers, never host Python; Fusion worktree vs runtime clone; Conventional Commits; no auto-merge. Use when coding on lumi-erp, running pytest/Vitest/e2e, cherry-picking onto main, opening PRs from Fusion/MiniMax, or when a ticket mentions worktree, dev-infra, KB-xxx, or scan_matching tests.

- Skill: `omayka-tech/lumi-lab-tests` (Agent Skill)
- Install (CLI): `npx skillmds@latest add omayka-tech/lumi-lab-tests`
- Raw SKILL.md: https://api.skillmd.com/api/skills/omayka-tech/lumi-lab-tests/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: Omayka-Tech (https://skillmd.com/u/omayka-tech)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/omayka-tech/lumi-lab-tests

---


# Lumi lab + factory (do this first)

You are on the **lumi-coder VM** or in Cursor against Lumi. Read product `AGENTS.md` → `CLAUDE.md` → `docs/agents/LUMI_LAB_AND_FACTORY.md` before `docker exec` / `pytest`.

## Two clones (never mix)

| Path | Role |
|---|---|
| `/workspace/lumi-erp` + `/workspace/lumi-erp/.worktrees/<name>` | **Edit here.** Fusion ticket branch. |
| `/runtime/lumi` → host `~/lumi/lumi-erp` | **Live lab** bind-mounted into `lumi_backend_dev_infra` (usually `develop`) |
| `http://backend:8000` | Live API (docker DNS) |

- Edit **only** the Fusion worktree / `/workspace/lumi-erp`.
- **Never** `./scripts/dev-infra.sh up` from `/workspace`.
- `docker exec lumi_backend_dev_infra …` sees **runtime `develop`**, not your worktree files.

## Tests (non-negotiable)

**Forbidden:** `pytest` / `python -m pytest` / `npx playwright` / `npm run test:unit` on the VM host or Fusion image.

Worktree-only code:

```bash
cd /workspace/lumi-erp/.worktrees/<this-ticket>
/opt/lumi-coder/scripts/agent-lumi.sh test-worktree apps/purchases/tests/test_scan_matching_normalize.py -q --tb=short
```

Runtime / already-pulled develop:

```bash
./scripts/dev-infra-test.sh apps/purchases/tests/test_scan_matching_normalize.py -q --tb=short
# or: /opt/lumi-coder/scripts/agent-lumi.sh test-runtime …
```

Do **not** use `docker exec --entrypoint` (`exec` has no such flag).

## Git / PR

Base **`main`**. One ticket → one PR. Conventional Commits English. **Never merge.** Commit before pausing (Fusion may delete the worktree and drop untracked files).

## Product rules

Multi-tenant by schema. `/api/v1/` only for new APIs. Layered Django+DRF. No invented fiscal rules. Research tickets (`[research]` / `/deerflow`) are docs-only.

