Backend-independent experiment execution runtime for AI agents (split from visa-mcp v1.11)
Project description
lab-executor-mcp
Backend-independent experiment execution runtime for AI agents.
Split from visa-mcp at v2.0.
⚠ Upgrading from visa-mcp v1.x? First read
docs/v2_migration.md. 実機 backend が必要な既存利用者はpip install --upgrade visa-mcpが 互換経路 (v2.0 では visa-mcp v2.0 release を待つ必要あり)。
Line-ending / raw display note (v2.5.1 強化):
Some third-party viewers and LLM-based fetchers occasionally report repository files as "1 line" / "collapsed" when reading
raw.githubusercontent.com. This is a viewer-side artifact, not a repository defect. The repository stores all text as LF.Ground truth lives in
RELEASE_VERIFICATION.md— a tag-time generated manifest listing each critical file's exactbytes/LF/CR/BOMcounts. Any reviewer can run:git clone --branch v2.5.1 https://github.com/TECTOS-JP/lab-executor-mcp.git cd lab-executor-mcp python scripts/release_verification.py --check # expect: "OK" + exit 0 (CR=0, LF>=10, no BOM for every critical file)If your viewer disagrees with the manifest, your viewer is wrong. CI also enforces this via
tests/test_v200_split.py::test_critical_files_are_multiline_and_lf_only.
What it provides
- DSL (
ExperimentPlan,dsl_version=0.8) + validator + dry-run - Job manager / state machine / scheduler / barrier
- Observation API (
timeline/live_view/summary) - Benchmark runner (MockBackend, PyVISA 不要)
- Definition pack ecosystem (
extension init/install/check/package/...) - Instrument authoring (
instrument scaffold/promote-check/review-report) - Export / bundle (deterministic reproducibility) —
export_experiment_bundle - MCP tool surface: Stable 43 + Experimental 7 = 50 (v1.0 から不変)
MCP API の安定性ポリシー (Stable / Experimental tool の区分、deprecation 方針)
は docs/v1_stability_policy.md を参照。
Install
pip install lab-executor-mcp
PyVISA は 必須ではない。実機 backend が必要な場合は
visa-mcp を install すると自動的に lab-executor-mcp も入る。
pip install visa-mcp # PyVISA backend + lab-executor-mcp runtime
Extension path behavior (v2.4)
v2.4 introduces dual-path read for installed extension packs while
keeping the write default unchanged (legacy ~/.visa-mcp/extensions/).
Duplicate extension_id across both paths is not auto-resolved:
it is reported as a warning (or error with --strict).
| Aspect | v2.4 behavior |
|---|---|
| Read (catalog / check) | ~/.lab-executor/extensions/ and ~/.visa-mcp/extensions/ |
| Write (install) default | ~/.visa-mcp/extensions/ (unchanged) |
Duplicate extension_id |
warning by default, error with --strict |
| Auto-precedence | none — duplicates are never silently resolved |
| Policy id | duplicate_policy = report_conflict_no_implicit_precedence |
The default install target will be re-evaluated in v2.5+. v2.4 is a reporting phase — it sees both paths, but never picks one implicitly. Inspect the resolver state with:
lab-executor extension paths --json
v2.5 adds lab-executor extension migration-plan (plan only, no file
changes) and the resolve_extension_by_id() API (duplicate
extension_id raises ExtensionResolveError). See
docs/extension_path_migration.md
for the full migration guide and roadmap (v2.6 copy-plan → v2.7
controlled apply → v2.8 default switch).
How to start the server (v2.1+)
| 用途 | コマンド | PyVISA | backend |
|---|---|---|---|
| Mock / dry-run / benchmark / validation | lab-executor serve --backend mock |
不要 | MockBackend |
| 実機 (PyVISA 経由) | visa-mcp serve |
必要 | PyVisaBackend (visa-mcp 同梱) |
Quick examples
# 1) Server を compose して tool 一覧を確認する (transport 起動なし)
lab-executor serve --backend mock --dry-run
# 2) 実 transport を起動 (Claude Code / MCP client から接続)
lab-executor serve --backend mock
# 3) Extension pack を検証
lab-executor validate extension my_pack/extension.yaml --strict
lab-executor extension doctor my_pack/
# 4) Package + verify
lab-executor extension package my_pack/ --output my_pack.visa-mcp-ext.zip
lab-executor extension verify-package my_pack.visa-mcp-ext.zip
# 5) Install + lifecycle (v2.3+)
lab-executor extension install my_pack.visa-mcp-ext.zip --dry-run
lab-executor extension install my_pack.visa-mcp-ext.zip
lab-executor extension catalog # installed pack 一覧
lab-executor extension check # checksum / manifest 検査
lab-executor extension paths # install path resolver 状態
Exit code policy (v2.1.1)
| Subcommand | exit 0 | exit 1 | exit 2 |
|---|---|---|---|
serve |
server 起動 / --dry-run 成功 |
— | --backend 未指定 / 不正 |
validate {instrument,extension} |
errors == 0 | errors > 0 | usage error |
extension doctor |
status == "ok" |
warnings / errors あり | usage error |
extension package |
package 成功 | 失敗 | usage error |
extension verify-package |
checksums OK | mismatch / 不正 | usage error |
extension init |
pack 生成成功 | 失敗 | usage error |
extension install |
install 成功 / --dry-run 成功 |
verify 失敗 / 書き込み失敗 | usage error |
extension check |
OK (warning も exit 0) | error あり、または --strict で warning |
usage error |
extension catalog |
一覧出力 (空でも exit 0) | 内部 error | usage error |
extension paths |
出力成功 | — | usage error |
instrument scaffold |
YAML 生成成功 | 失敗 | usage error |
instrument review-report |
markdown 出力成功 | file 不在等の error | usage error |
diagnose tool-surface |
status == "ok" または warning + --strict 無し |
warning + --strict |
usage error |
doctor は warning だけでも exit 1 になります (CI で fail させる
強い gate として設計)。warning を許容したい場合は doctor 出力を
--json で取り、errors のみを判定してください。
Notes
lab-executor serveは--backend mockが必須 (引数なしは exit 2 でvisa-mcp serveへの案内)- 他 backend (REST / replay / plugin) は v2.2+ で検討
- runtime 内部の
JobManagerは v2.1 時点でvisa=引数名を受け取る (v1.x からの互換維持)。v2.2+ でbackend=への rename を検討予定
CLI status in v2.3
v2.3.1 までに活性化された範囲:
v2.1.0:
lab-executor --version/--helplab-executor serve --backend mock(MockBackend で MCP server 起動)lab-executor serve --backend mock --dry-runlab-executor validate instrument <path>lab-executor validate extension <path>lab-executor extension doctor <pack_dir>lab-executor extension package <pack_dir>lab-executor extension verify-package <zip>
v2.2.0:
lab-executor extension init <dir>(pack scaffold 生成)lab-executor instrument scaffold <category>lab-executor instrument promote-check <yaml>lab-executor instrument review-report <yaml>lab-executor diagnose tool-surface(Stable 43 + Experimental 7 検査)
v2.3.0:
lab-executor extension install <zip>(--dry-run/--force/--skip-verify)lab-executor extension check(--extension-id/--strict)lab-executor extension catalog(install 済 pack 一覧)lab-executor extension paths(path resolver 状態 /--json)
--skip-verify の取り扱い (重要)
extension install --skip-verify は test 用途専用。信頼できない
配布物 (第三者 zip / 外部レジストリ pull) には 絶対に使わないこと。
checksum 検証を skip するため、tampering 検出ができなくなる。
--dry-run semantics (v2.3)
extension install --dry-run は v2.3 時点で package verify のみ を
実行する。install 済 extension_id の重複検査や install path への
書き込み権限確認は行わない (v2.4+ で検討)。
v2.4+ で port 予定 / 検討中
extension uninstall(.install_meta.jsonベースの安全削除)extension list-installed(catalog のエイリアス整理)- 他 backend (REST / replay / plugin) の
--backendchoice 追加 default_extensions_dirの source of truth をextension_paths .get_extension_paths().current_defaultに統合 (現状は 2 系統存在)
実機 backend を起動する経路は引き続き visa-mcp serve (visa-mcp
v2.0+ を install)。
v2.0 split
- v1.x までは
visa-mcp1 リポジトリで提供されていた - v2.0 で backend (visa-mcp) と runtime (lab-executor-mcp) を分離
- MCP tool / DSL schema / extension pack 形式は完全互換
- 旧
from visa_mcp.extension import ...は v2.0 で DeprecationWarning 付きで動作
詳細: docs/v2_migration.md
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lab_executor_mcp-2.35.1.tar.gz.
File metadata
- Download URL: lab_executor_mcp-2.35.1.tar.gz
- Upload date:
- Size: 909.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d797d848d4cb4b0cd8e7a2220b1c1fe3e03c08b742cb329385f03cea0de1f787
|
|
| MD5 |
a6643cf159ae4587c2b2699b2c7a6a52
|
|
| BLAKE2b-256 |
ab27bf90f9e3837378a702a1507bbf90619b8cf30dec2fc0362d90239db78624
|
Provenance
The following attestation bundles were made for lab_executor_mcp-2.35.1.tar.gz:
Publisher:
publish.yml on TECTOS-JP/lab-executor-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lab_executor_mcp-2.35.1.tar.gz -
Subject digest:
d797d848d4cb4b0cd8e7a2220b1c1fe3e03c08b742cb329385f03cea0de1f787 - Sigstore transparency entry: 2196458781
- Sigstore integration time:
-
Permalink:
TECTOS-JP/lab-executor-mcp@a11e43ab348fce2678385233c336e708c64d250d -
Branch / Tag:
refs/tags/v2.35.1 - Owner: https://github.com/TECTOS-JP
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a11e43ab348fce2678385233c336e708c64d250d -
Trigger Event:
push
-
Statement type:
File details
Details for the file lab_executor_mcp-2.35.1-py3-none-any.whl.
File metadata
- Download URL: lab_executor_mcp-2.35.1-py3-none-any.whl
- Upload date:
- Size: 549.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
880e5beff9fae94ee565fe9db88e824984bb38d7f09b966cdf5b33e0f465da1e
|
|
| MD5 |
36d077e07e3b6b4f525dc389e9fc2af5
|
|
| BLAKE2b-256 |
a0b7fd8973fb30bc907c0eac0183ca738668629165520e4c027c3670a320b664
|
Provenance
The following attestation bundles were made for lab_executor_mcp-2.35.1-py3-none-any.whl:
Publisher:
publish.yml on TECTOS-JP/lab-executor-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lab_executor_mcp-2.35.1-py3-none-any.whl -
Subject digest:
880e5beff9fae94ee565fe9db88e824984bb38d7f09b966cdf5b33e0f465da1e - Sigstore transparency entry: 2196459022
- Sigstore integration time:
-
Permalink:
TECTOS-JP/lab-executor-mcp@a11e43ab348fce2678385233c336e708c64d250d -
Branch / Tag:
refs/tags/v2.35.1 - Owner: https://github.com/TECTOS-JP
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a11e43ab348fce2678385233c336e708c64d250d -
Trigger Event:
push
-
Statement type: