Repository Public
1# Repository and infrastructure audit — 2026-12-0423Everything below was observed on that date by commands run from the operator laptop; nothing is4assumed. Commands are given so the audit can be repeated.56## 1. KVCE (KA Visual Connector Engine) — the prior art78The reference document describes KVCE as "5 433 lines, Playwright, Chromium/WebKit, OCR Apple9Vision, MLX multimodal, segmentation, fusion, SQLite coordinator". The real code was read on the10`kvce` branch of both repositories (`git clone --depth 1 -b kvce gitsrv:srv/git/<repo>.git`,11read-only, in a scratch directory; neither repository nor any deployed service was modified).1213| | `lou-ka.git` | `immo-ka.git` |14|---|---|---|15| Commit read | `27326e5` | `73e648c` |16| Files matching `kvce` | 62 | 61 |17| Lines in those files (code, tests, docs, deploy) | 9 383 | 9 238 |18| `kvce/` package itself (Python + JS + Swift) | ≈ 4 900 | ≈ 4 900 |1920Findings:2122- **Two copies that have diverged.** The design says the package is "copied identically" in both23 repositories with a manifest check; `diff -rq lou-ka/kvce immo-ka/kvce` reports every one of the24 23 source files as different (headers and later fixes). There is no shared package.25- **Stack**: Python 3, Playwright ≥ 1.56 (Chromium, WebKit possible), a 152-line Swift tool26 (`VNRecognizeTextRequest` + `VNClassifyImageRequest`, one process per call), `mlx_vlm` with27 `mlx-community/Qwen2.5-VL-3B-Instruct-4bit` (one process per question), a SQLite job queue held by28 a single coordinator process over HTTP with a shared token.29- **Domain-specific**: profiles, field ranges, extraction heuristics (`extract.py`, 874 lines),30 photo pipeline and bridges are written for rental and real-estate listings. They are not general.31- **Licence and ownership**: all files carry the SP Boucher header, licence ISC, owner32 Simon-Pierre Boucher. No third-party code was found in `kvce/`.33- **Tests**: 13 test modules under `tests/kvce_tests/` (policy, queue, extraction, photos, bridge…).34- **Policy model worth keeping**: refusal/CAPTCHA/login wall = suspension with doubling, never a35 bypass; no account on third-party sites; TLS errors are not ignored; the bot names itself; values36 are never invented; a vision answer must be found again by OCR before it is accepted.37- **State**: in production for one source only (apartments.com on Lou-Ka, manual bridge); the rest38 is built and measured but not activated.3940### Reuse decision4142| KVCE element | Decision for SPIDER | Why |43|---|---|---|44| Access rules (refusal detection markers, suspension doubling, UA naming) | **Re-implemented** from the same rules (`spider/refusal.py`, `spider/browser/refusal.py`, `orchestrator._suspend`) | Rules are right; code is tied to KVCE state files |45| Swift Vision tool | **Rewritten** as `services/ocr-worker` (serve mode, banding, orientation, alternatives, quads) | One process per image does not scale; no batch protocol |46| MLX runner | **Rewritten** as a warm process with a queue (`spider/vision/`) | KVCE reloads the model for every question |47| "Vision answer must be attested by OCR" | **Kept** as the deterministic guard of `vision/client.py` | Central anti-hallucination / anti-injection rule |48| Confidence table (JSON-LD 0.95, DOM 0.90, OCR 0.55×, vision 0.50) | **Kept as heuristic priors**, explicitly not probabilities; calibration tooling added | Mandate §12 |49| `snapshot.js`, `browser.py` scroll/settle | **Inspiration only**; new stability criteria, tiling, state graph | KVCE relies on `networkidle` and fixed sleeps |50| SQLite queue + coordinator | **Not reused**; PostgreSQL leases with fencing tokens | Multi-worker, multi-tenant, restart-safe |51| Listing extraction, profiles, photos, bridges | **Not reused** | Domain-specific |5253Compatibility strategy: SPIDER does not import, vendor or modify KVCE. Lou-Ka and Immo-Ka keep54their KVCE unchanged. A later migration path is to make the KVCE "bridge" call SPIDER's API55(`examples/integrations/groupe_ka.py` shows the call); that is a change in those repositories and56needs the owner's decision.5758## 2. Infrastructure actually available (`mld scan`, `mld status`, 2026-12-04)5960- 29 LAN Macs (Apple Silicon, 8–96 GB), 14 rented Macs (Macly, MacStadium), 7 OVH Linux servers.61 **No node is assumed free**: `mld status` lists 72 deployed apps.62- Nodes without any PM2 app at audit time: M4BP48, M4BP36, M4M36, m4mc, m4ma, m4mb, m2m16, M3BA24,63 M3BA16, m2m8a, m2m8b (LAN); all Macly/MacStadium minis. BHS128, R9128 and R764 are documented as64 empty; BHS64 is the public gateway and mail server; BHS64b, BHS128b and BHS192 are production for65 other projects and must not be used.66- Runtimes on candidate nodes: Homebrew, git, uv everywhere; Node/pm2 and PostgreSQL 17 only on some67 (see `mld scan`). Apple Vision needs macOS; MLX needs Apple Silicon with enough free memory.68- **Outbound address**: every LAN Mac leaves through one residential address. Per-host politeness is69 therefore enforced centrally (one request in flight per host for the whole fleet). Rented Macs and70 OVH servers have other addresses; SPIDER does not use them to get around a source's restrictions71 (ADR-0005).72- **Ports**: 8900–8909 are unused in the `mld` registry (highest allocated: 9320, 9210, 8880…);73 8900 is taken as SPIDER's gateway port, to be confirmed by `mld` at deployment.74- **DNS**: `spider.spboucher.ai` already resolves to `51.161.112.61` (BHS64, the tunnel gateway) —75 a wildcard, no record was created or changed. No Caddy route exists for it yet.76- **Git**: `https://git.spboucher.ai/spider` did not exist (HTTP 404) and was created public by77 `sp-git init` on 2026-12-04.78- **Shared storage**: OVH Enterprise File Storage 2 TB mounted on `/opt/efs` (Macs) and `/mnt/efs`79 (servers), NFSv3 **without locks**. Suitable for the content-addressed blob store (immutable files,80 atomic rename); not suitable for PostgreSQL data.8182## 3. Toolchain on the build machine8384Python 3.13 (uv), Playwright 1.65 (Chromium, WebKit), Swift 6.4, PostgreSQL 17.9, Node 26, Go 1.26,85Docker 29. NATS, DuckDB and OpenSearch are not installed anywhere in the fleet.86