Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
507 lines (477 loc) · 25.1 KB
/
Copy pathpyproject.toml
File metadata and controls
507 lines (477 loc) · 25.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "visionset"
dynamic = ["version"]
description = "Open-source, local-first tool for creating, curating, and versioning computer-vision training datasets — with a Physical AI roadmap."
readme = "README.md"
requires-python = ">=3.11"
license = "Apache-2.0"
# Shipped beside the licence because the wheel redistributes a compiled browser bundle:
# whatever that bundle contains travels with the wheel, and one of those dependencies is
# MPL-2.0. See THIRD-PARTY-NOTICES.md.
license-files = ["LICENSE", "THIRD-PARTY-NOTICES.md"]
authors = [{ name = "Robomous" }]
keywords = ["computer-vision", "datasets", "annotation", "labeling", "physical-ai"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Topic :: Scientific/Engineering :: Image Recognition",
]
dependencies = [
"pydantic>=2.7",
"fastapi>=0.141.1",
"uvicorn>=0.52.0",
"typer>=0.12",
"mcp>=2.0.0",
"sqlalchemy>=2.0",
# Image decoding for the media processor (#16). A third-party library, not a framework,
# so it is allowed inside kernel/adapters/ and needs no import-linter change. The 11.0
# floor is the first release with Python 3.13 wheels, which the classifiers promise.
"pillow>=11.0",
# HEIC/HEIF decoding, registered as a Pillow plugin inside kernel/adapters/ —
# the same third-party-library allowance pillow has. Core rather than an
# extra: phone photos are a first-contact input, and an ingest that refuses
# them until a second install is a broken first run.
"pillow-heif>=1.5.0",
# Settings for the embedded job executor (#328). The first pydantic-settings
# use in this repository; `server/settings.py` argues why the executor is what
# finally earned one, and why the four existing bare `os.environ` reads stay
# where they are. Installed already as a transitive dependency of nothing —
# this one is genuinely new — but it is pydantic's own companion package and
# pydantic 2 is already a hard runtime dependency.
"pydantic-settings>=2.4",
# Multipart parsing for the upload routes (#28). FastAPI requires it for
# `UploadFile` and raises at import time without it. It is already installed
# here as a transitive dependency of `mcp` — which is exactly why it is
# declared: an upload surface resting on somebody else's dependency tree
# breaks the day that tree changes.
"python-multipart>=0.0.9",
# Version specifiers, for the check that decides whether an installed provider
# plugin was built for this VisionSet. A plugin states its compatibility as an
# ordinary dependency pin, so reading it means parsing a requirement and
# testing a specifier — including against a pre-release, which is what this
# project's own version is and what a hand-rolled comparison gets wrong first.
# Installed here already as a transitive dependency, which is exactly why it is
# declared: a compatibility gate resting on somebody else's dependency tree
# breaks the day that tree changes.
"packaging>=24.0",
# The runtime for `local`-type inference connections (#418, #1519), installed by default.
# A positive allowlist: each requirement names the platforms it was measured on and a
# machine outside the list installs the product without it, refusing a local connection
# with the same message a missing runtime always gave. A negative marker would instead
# hand an untested platform an install that fails.
#
# Linux x86_64 and aarch64, macOS arm64, Windows AMD64, CPython: PyPI ships torch wheels
# for exactly those, for Python 3.11 through 3.15. Intel macOS is deliberately absent.
# PyTorch stopped building for it after 2.2.2, which carries known advisories in the
# model-loading path, so it gets the base install and the missing-runtime refusal.
# On Linux the wheels bundle CUDA, and on Windows PyPI's torch is CPU-only; picking CUDA
# there takes the PyTorch index, which a plain `pip install` does not select. `uv.lock` is
# where the versions are decided; these are floors. torch 2.10 is the first release that
# fixes CVE-2026-24747 (heap corruption in the `weights_only` unpickler), which also
# covers CVE-2025-32434 (fixed in 2.6): transformers falls back to `torch.load` for a
# repository that ships only `.bin` weights, and the model id is user-supplied. 2.14.x
# is excluded for GHSA-v32g-mr63-3j83 (the same unpickler reads arbitrary text files;
# fixed in 2.15). The runtime layer refuses anything older than the floor. Torchvision
# pins torch exactly below 0.29 (0.25 needs torch 2.10.0), so the pair moves together.
#
# transformers 5.17 clears CVE-2026-4372 and CVE-2026-5241 (RCE through a model config,
# fixed 5.3 and 5.5), CVE-2026-9856 (arbitrary file write, 5.10) and CVE-2026-80047
# (first release carrying the fix, 5.17). `huggingface-hub` 1.5 is what transformers 5.x
# itself requires.
#
# 5.0 is where `sam3` and `sam3_tracker` arrive, measured against the wheels: 4.57.6
# ships neither module and 5.0.0 ships both, exporting `Sam3TrackerProcessor` and
# `Sam3TrackerModel`, which `sam_provider` names. `torchvision` is here because SAM 2's
# image processor imports it; no code in this repository does.
"torch>=2.10,!=2.14.*; implementation_name == 'cpython' and ((sys_platform == 'linux' and (platform_machine == 'x86_64' or platform_machine == 'aarch64')) or (sys_platform == 'darwin' and platform_machine == 'arm64') or (sys_platform == 'win32' and platform_machine == 'AMD64'))",
"torchvision>=0.25; implementation_name == 'cpython' and ((sys_platform == 'linux' and (platform_machine == 'x86_64' or platform_machine == 'aarch64')) or (sys_platform == 'darwin' and platform_machine == 'arm64') or (sys_platform == 'win32' and platform_machine == 'AMD64'))",
"transformers>=5.17; implementation_name == 'cpython' and ((sys_platform == 'linux' and (platform_machine == 'x86_64' or platform_machine == 'aarch64')) or (sys_platform == 'darwin' and platform_machine == 'arm64') or (sys_platform == 'win32' and platform_machine == 'AMD64'))",
"accelerate>=1.1; implementation_name == 'cpython' and ((sys_platform == 'linux' and (platform_machine == 'x86_64' or platform_machine == 'aarch64')) or (sys_platform == 'darwin' and platform_machine == 'arm64') or (sys_platform == 'win32' and platform_machine == 'AMD64'))",
"huggingface-hub>=1.5; implementation_name == 'cpython' and ((sys_platform == 'linux' and (platform_machine == 'x86_64' or platform_machine == 'aarch64')) or (sys_platform == 'darwin' and platform_machine == 'arm64') or (sys_platform == 'win32' and platform_machine == 'AMD64'))",
]
# The runtime for `local`-type inference connections (#418, #1519) is part of the
# distribution: `pip install visionset` and `uv tool install visionset` bring it. It is
# declared in `dependencies` above with PEP 508 markers, not as an extra, because an extra is
# opt-in and this is not.
#
# `local-inference` survives as an alias that adds nothing, so `pip install
# "visionset[local-inference]"` — the command older releases, docs and refusal messages
# printed — keeps working. Nothing requires it and nothing reads it back.
[project.optional-dependencies]
local-inference = []
# Optional experiment tracking (#1174): `pip install "visionset[mlflow]"`. The skinny
# client carries `MlflowClient` and the REST store, which is everything
# `visionset/tracking` calls, at about a tenth of the full distribution's install;
# the full `mlflow` package provides the same import and works in its place.
mlflow = [
"mlflow-skinny>=3.18.0",
]
[project.urls]
Homepage = "https://github.com/Robomous/VisionSet"
Issues = "https://github.com/Robomous/VisionSet/issues"
[project.scripts]
visionset = "visionset.cli.main:app"
# Importer/exporter plugin discovery. Third-party distributions (e.g. a
# `visionset-format-x` package) register their plugins in this same group.
[project.entry-points."visionset.formats"]
ultralytics = "visionset.formats.ultralytics:UltralyticsExporter"
ultralytics-import = "visionset.formats.ultralytics:UltralyticsImporter"
yolov5-yaml = "visionset.formats.yolov5_yaml:Yolov5YamlExporter"
yolov5-yaml-import = "visionset.formats.yolov5_yaml:Yolov5YamlImporter"
darknet = "visionset.formats.darknet:DarknetExporter"
darknet-import = "visionset.formats.darknet:DarknetImporter"
yolo-obb = "visionset.formats.yolo_obb:YoloObbExporter"
yolo-obb-import = "visionset.formats.yolo_obb:YoloObbImporter"
dota = "visionset.formats.dota:DotaExporter"
dota-import = "visionset.formats.dota:DotaImporter"
coco = "visionset.formats.coco:CocoExporter"
coco-import = "visionset.formats.coco:CocoImporter"
voc = "visionset.formats.voc:VocExporter"
voc-import = "visionset.formats.voc:VocImporter"
# The one format whose content is tags. One row per (image, tag), so a
# multi-tagged image is written once and listed once per tag.
classification = "visionset.formats.classification:ClassificationExporter"
classification-import = "visionset.formats.classification:ClassificationImporter"
# The lane family (#223). Five plugins over v1's six exporter functions: CULane's
# annotation file and its segmentation mask are two artifacts of one format.
tusimple = "visionset.formats.lanes:TuSimpleExporter"
curvelanes = "visionset.formats.lanes:CurveLanesExporter"
bdd100k-lane = "visionset.formats.lanes:Bdd100kLaneExporter"
culane = "visionset.formats.lanes:CuLaneExporter"
openlane-2d = "visionset.formats.lanes:OpenLane2dExporter"
openlane-2d-import = "visionset.formats.lanes:OpenLane2dImporter"
# Scans and their 3D boxes, read into the lidar frame and written with a canonical calibration.
kitti = "visionset.formats.kitti:KittiExporter"
kitti-import = "visionset.formats.kitti:KittiImporter"
# MOTChallenge sequences: frames as image-sequence sources, ground-truth ids as tracks.
mot = "visionset.formats.mot:MotExporter"
mot-import = "visionset.formats.mot:MotImporter"
# CVAT XML 1.1, two dialects: shapes per picture, and tracks over one task's frames.
cvat-images = "visionset.formats.cvat:CvatImagesExporter"
cvat-images-import = "visionset.formats.cvat:CvatImagesImporter"
cvat-video = "visionset.formats.cvat:CvatVideoExporter"
cvat-video-import = "visionset.formats.cvat:CvatVideoImporter"
# LIDAR_TOP keyframes and their global boxes (#1056), read into the sensor frame.
nuscenes-import = "visionset.formats.nuscenes:NuScenesImporter"
# Semantic segmentation: class-index PNG masks read as a descriptor file states them.
segmentation-png = "visionset.formats.segmentation_png:SegmentationPngExporter"
segmentation-png-import = "visionset.formats.segmentation_png:SegmentationPngImporter"
# LabelMe JSON: one document per picture, rectangles and polygons in pixels.
labelme = "visionset.formats.labelme:LabelmeExporter"
labelme-import = "visionset.formats.labelme:LabelmeImporter"
# COCO panoptic: RGB segment PNGs and their segments_info, independent of coco instances.
coco-panoptic = "visionset.formats.coco_panoptic:CocoPanopticExporter"
coco-panoptic-import = "visionset.formats.coco_panoptic:CocoPanopticImporter"
# Class directories: <split>/<class>/<image>, one label per picture, independent of classification.
classification-dir = "visionset.formats.classification_dir:ClassificationDirExporter"
classification-dir-import = "visionset.formats.classification_dir:ClassificationDirImporter"
# Create ML object detection: one JSON array per folder, centre-based boxes in pixels.
createml = "visionset.formats.createml:CreatemlExporter"
createml-import = "visionset.formats.createml:CreatemlImporter"
# Open Images boxes: one normalized-corner CSV per split and a class descriptions file.
open-images = "visionset.formats.open_images:OpenImagesExporter"
open-images-import = "visionset.formats.open_images:OpenImagesImporter"
# TensorFlow Object Detection: tf.train.Example boxes per split in TFRecords and a label map.
tfrecord = "visionset.formats.tfrecord:TfrecordExporter"
tfrecord-import = "visionset.formats.tfrecord:TfrecordImporter"
# Inference driver discovery. A third-party distribution registers its own
# provider in this same group, and pins the VisionSet it was built for in its
# ordinary `dependencies` — discovery reads that pin and skips a mismatch.
# The pixel side of a pre-processing recipe, one driver per step kind. Discovered
# the way exporters are, so a distribution can register a driver for a kind the
# built-ins do not apply.
[project.entry-points."visionset.preprocessing"]
pillow-resize = "visionset.preprocessing.pillow:PillowResizeDriver"
pillow-augment = "visionset.preprocessing.pillow:PillowAugmentDriver"
[project.entry-points."visionset.providers"]
sam = "visionset.inference.sam_provider:SamProvider"
grounding-dino = "visionset.inference.transformers_provider:GroundingDinoProvider"
rf-detr = "visionset.inference.rfdetr_provider:RfDetrProvider"
siglip = "visionset.inference.siglip_provider:SiglipProvider"
owl = "visionset.inference.owl_provider:OwlProvider"
stub = "visionset.inference.stub_provider:StubProvider"
http = "visionset.inference.http_provider:HttpProvider"
# A plain `uv sync` installs the inference runtime too, because it is a dependency of the
# distribution. A change that never loads a model can skip it with `uv sync --locked`
# plus `--no-install-package` for what `.github/actions/sync-without-runtime` lists.
[dependency-groups]
dev = [
"pytest>=8.2",
"httpx>=0.27",
# The MCP tests drive the real protocol through an in-memory client session,
# which is async; `anyio.run` is the bridge that keeps every test a plain
# sync function and the suite free of a pytest asyncio plugin. Installed
# already as a transitive dependency of `mcp`, `httpx` and `starlette` —
# which is exactly why it is declared, the `python-multipart` reason.
"anyio>=4.5",
"ruff>=0.16.1",
"mypy>=1.10",
"import-linter>=2.0",
"pytest-xdist>=3.8.0",
]
# The tool the YOLO exporter exists to feed, used by one smoke test (#62) and
# deliberately NOT in `dev`: it brings its own torch pin and a trainer's worth of
# packages beyond the runtime every sync already carries. CI installs this group in its own job and sets
# VISIONSET_REQUIRE_ULTRALYTICS=1, which turns the local skip into an error —
# the same require-not-skip rule CI uses for every optional runtime.
yolo = [
"ultralytics>=8.3",
]
# The reference reader for the COCO exporter (#63). Its own group beside `yolo`
# for the same reason, and installed in the same CI job.
coco = [
"pycocotools>=2.0",
]
# scripts/browser_models/ exports EfficientSAM-Ti to the ONNX graphs the browser worker
# loads. Its own group beside `yolo` and `coco`, deliberately NOT in `dev`: it
# needs a newer torch than the Intel-macOS runtime profile can have, and an ONNX toolchain
# nobody else uses. `onnxscript` is not optional —
# torch's `torch.onnx.export` imports it unconditionally, and an environment without it
# installs everything else and then fails at the first export call.
browser-models = [
"numpy>=2.4.6",
"onnx>=1.22.0",
# Exact, and the only exact pin in this file. Every other constraint here is a
# floor because `uv.lock` is the artifact a reviewer reads; this one is a floor
# *and* a ceiling because the version is not an implementation detail of the
# export -- it is half of a parity claim. `onnxruntime-web` in
# frontend/browser-inference/package.json is pinned to 1.29.0, and the chain this
# phase exists to prove runs PyTorch -> Python ORT -> ORT Web. Letting the Python
# side float to a different release would mean the reference the browser is
# measured against was produced by a different implementation of the same graph,
# so a genuine browser regression and an ORT-version difference would arrive
# looking identical. Move the two together or not at all.
"onnxruntime==1.29.0",
"onnxscript>=0.7.2",
"torch>=2.14.0",
]
mot = [
"motmetrics>=1.4",
"scipy>=1.17.1,<1.18",
]
# --- Version: single source of truth is the repo-root VERSION file ---
[tool.hatch.version]
source = "regex"
path = "VERSION"
pattern = "^(?P<version>[^\\s]+)"
# The compiled UI bundle in _static/ is git-ignored but must ship in the wheel:
# `artifacts` overrides gitignore-based exclusion during builds.
[tool.hatch.build]
artifacts = ["src/visionset/_static/**"]
[tool.hatch.build.targets.wheel]
packages = ["src/visionset"]
# The agent-plugin bundle is distributed from the repository, never with the Python package.
[tool.hatch.build.targets.sdist]
exclude = ["/agent-plugins"]
# --- Ruff ---
[tool.ruff]
line-length = 100
src = [
"src",
"tests",
"scripts",
"agent-plugins/tools",
"agent-plugins/tests",
"agent-plugins/packages/visionset/runtime",
"agent-plugins/packages/visionset/reporting",
]
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "SIM"]
# --- Mypy: strict on the kernel, normal elsewhere ---
[tool.mypy]
python_version = "3.11"
warn_unused_configs = true
warn_redundant_casts = true
[[tool.mypy.overrides]]
# pillow-heif publishes no py.typed marker, so the one symbol imported from it
# (register_heif_opener) arrives untyped.
module = "pillow_heif.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "visionset.kernel.*"
disallow_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_any_generics = true
disallow_subclassing_any = true
warn_return_any = true
warn_unused_ignores = true
no_implicit_reexport = true
strict_equality = true
# --- Pytest ---
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-q"
# Puts the repo root on sys.path so `tests.fixtures.media` resolves as a namespace package.
# The alternative — `tests/__init__.py` — would change how every existing test module is
# named, for no gain.
pythonpath = ["."]
# --- Import Linter: the kernel boundary is machine-enforced ---
[tool.importlinter]
root_package = "visionset"
include_external_packages = true
[[tool.importlinter.contracts]]
name = "Kernel purity: no delivery mechanisms or frameworks inside the kernel"
type = "forbidden"
source_modules = ["visionset.kernel"]
forbidden_modules = [
"visionset.server",
"visionset.cli",
"visionset.mcp",
"visionset.formats",
# The JSON shapes the surfaces publish. Not a delivery mechanism, but the same
# direction: it is written in terms of domain models, so the kernel importing
# it would close a loop and make a publication decision reachable from the
# place that decides what exists.
"visionset.wire",
# The background handlers and the dispatcher. Same direction again, and this
# one is load-bearing rather than tidy: a handler resolves a format plugin, so
# `visionset.jobs` imports `visionset.formats` — and a kernel that could reach
# a handler could reach a plugin through it, which is the wall contract 1
# exists to hold. It is also what keeps `SqliteJobQueue` unable to resolve a
# job type, which is why `UnknownJobType` is raised outside the kernel.
"visionset.jobs",
# The composition root that turns a connection row into a running model
# (#418). Same direction as the three above, and load-bearing for the same
# kind of reason: it is where torch and transformers are reached, so a kernel
# that could import it could import them — and `ModelProvider` would stop
# being a port describing a protocol and start being a description of one
# implementation. The kernel knows the configuration and the protocol; what
# runs is on the other side of this line.
"visionset.inference",
# The pre-processing driver registry and the Pillow drivers behind the
# `PreprocessingDriver` port. Same direction as `visionset.formats`: the kernel
# takes driver instances, and discovery stays on the other side of the line.
"visionset.preprocessing",
# Optional experiment tracking (#1174). Same direction: it is where the MLflow
# client is reached, and the kernel records nothing about a run's telemetry.
"visionset.tracking",
# The server-side video decoder adapters behind the `VideoDecoder` port. Same
# direction: the kernel takes a decoder instance, and which program runs is on
# the other side of this line.
"visionset.video",
"fastapi",
"typer",
"mcp",
"uvicorn",
# The optional tracking client, named directly: `visionset.tracking` reaches it
# only from inside a function, and the kernel never reaches it at all.
"mlflow",
]
[[tool.importlinter.contracts]]
name = "Delivery clients are siblings: server, cli and mcp never import each other"
type = "independence"
modules = ["visionset.server", "visionset.cli", "visionset.mcp"]
# A handler runs in a worker process that `spawn` started with nothing loaded, and
# it imports whatever it names. If it named `visionset.server`, the child would
# re-execute that module's `app = create_app()` and build a second application —
# with its own workspace handle and its own dispatcher — inside a worker. The
# other two are forbidden for the ordinary reason: a handler is below the
# surfaces, so nothing it does may depend on which one asked.
[[tool.importlinter.contracts]]
name = "Job handlers are below the surfaces: visionset.jobs imports no delivery package"
type = "forbidden"
source_modules = ["visionset.jobs"]
forbidden_modules = [
"visionset.server",
"visionset.cli",
"visionset.mcp",
"fastapi",
"typer",
"mcp",
"uvicorn",
]
# The composition root for inference, one package below the three surfaces and
# beside `formats`, `wire` and `jobs`. Forbidden from `visionset.jobs` as well as
# from the delivery packages, and that one is not tidiness: the download handler
# imports *this*, so the reverse would close a cycle — and would put the optional
# runtime back on the path a worker takes at spawn, which is exactly what
# deferring every heavy import into a function exists to prevent.
[[tool.importlinter.contracts]]
name = "Inference adapters are below the surfaces: visionset.inference imports no delivery package"
type = "forbidden"
source_modules = ["visionset.inference"]
forbidden_modules = [
"visionset.server",
"visionset.cli",
"visionset.mcp",
"visionset.jobs",
"fastapi",
"typer",
"mcp",
"uvicorn",
]
# The three packages that sit beside the kernel and below every surface: the JSON
# shapes, the format plugins and the pre-processing drivers. Each is imported by
# more than one surface, so a delivery import here would make one surface
# reachable from another through it — the independence contract's wall, climbed
# from underneath. Pillow is deliberately not listed: formats and preprocessing
# exist to touch pixels.
[[tool.importlinter.contracts]]
name = "Shared libraries are below the surfaces: wire, formats, preprocessing and video import no delivery package"
type = "forbidden"
source_modules = ["visionset.wire", "visionset.formats", "visionset.preprocessing", "visionset.video"]
forbidden_modules = [
"visionset.server",
"visionset.cli",
"visionset.mcp",
"fastapi",
"starlette",
"typer",
"click",
"mcp",
"uvicorn",
]
# Optional experiment tracking (#1174), below the surfaces and below `jobs`, which
# instruments a run through it: the reverse would close a cycle and put the job
# registry on the import path of every tracker. What crosses into a worker is the
# settings object, never a client, so nothing here needs to know who spawned it.
[[tool.importlinter.contracts]]
name = "Tracking is below the surfaces: visionset.tracking imports no delivery package, jobs, inference or plugin"
type = "forbidden"
source_modules = ["visionset.tracking"]
forbidden_modules = [
"visionset.server",
"visionset.cli",
"visionset.mcp",
"visionset.jobs",
"visionset.inference",
"visionset.formats",
"visionset.preprocessing",
"visionset.wire",
# It records what a run reports; it never opens a workspace to find out.
"visionset.kernel.services",
"visionset.kernel.adapters",
"fastapi",
"starlette",
"typer",
"click",
"mcp",
"uvicorn",
]
# Persistence is the kernel adapters' business. Direct imports only: these
# packages reach the kernel, and the kernel's own adapters import sqlalchemy.
[[tool.importlinter.contracts]]
name = "Shared libraries never touch the database driver: wire, formats, preprocessing, tracking and video import no sqlalchemy"
type = "forbidden"
source_modules = ["visionset.wire", "visionset.formats", "visionset.preprocessing", "visionset.tracking", "visionset.video"]
forbidden_modules = ["sqlalchemy"]
allow_indirect_imports = true
# A format plugin reads or writes files and returns a value; it never reaches a
# workspace. See docs/content/architecture/decisions/an-import-is-a-labeled-batch.md.
[[tool.importlinter.contracts]]
name = "Format plugins never reach a workspace: formats import no kernel service or adapter"
type = "forbidden"
source_modules = ["visionset.formats"]
forbidden_modules = ["visionset.kernel.services", "visionset.kernel.adapters"]
allow_indirect_imports = true