From 0950265e70ff1b9c3c967801847edaad8b0e53ef Mon Sep 17 00:00:00 2001 From: Juniper Bevensee Date: Wed, 17 Jun 2026 15:31:12 +1200 Subject: [PATCH] refactor: make hermes plugin a self-contained, installable artifact MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consolidate the engine INSIDE the plugin so copying only the plugin directory imports cleanly. The engine is moved (not copied) — there is exactly one copy of citations.py/openneuro.py/parsing.py/cli.py. Naming decision: the plugin dir is renamed `hermes-plugin/` -> `matilde_plugin/` because a hyphen is not import-safe and the CLI runs as `python -m .engine.cli`. `plugin.yaml` `name: "matilde"` is unchanged, so Hermes still loads the plugin by its manifest name. The plugin loads three ways, all verified: as a normal package import, loaded by file path (Hermes-style), and when the directory is copied standalone elsewhere. Changes: - git mv hermes-plugin/ -> matilde_plugin/; git mv engine/ -> matilde_plugin/engine/ (history preserved as renames). - tools.py: drop the sys.path hack; engine imports are now relative (`from .engine.citations import ...`). Lazy at-call-time imports and the `_check_available` gate behavior are unchanged. - __init__.py: register the package in sys.modules with a search path so tools.py's relative imports resolve even when loaded by file path, then import tools as a real submodule (no more file-path exec of tools.py). - engine internals (__init__, parsing, cli) use relative imports; CLI is now `python3 -m matilde_plugin.engine.cli` (prog name still "matilde"). - tests: updated imports to matilde_plugin.engine.* and the plugin loader path to matilde_plugin/. Coverage identical. - references updated: README, CONTRIBUTING, docs/onboarding, plugin.yaml comment, sanitize.config.json + check_sanitization.py sensitive prefix. Packaging refactor only — behavior identical. Suite: 75 passed, 6 skipped (same as baseline; the 6 are live-network integration tests). Co-Authored-By: Claude Opus 4.8 (1M context) --- CONTRIBUTING.md | 8 ++-- README.md | 26 ++++++------ docs/onboarding.md | 6 +-- {hermes-plugin => matilde_plugin}/__init__.py | 41 +++++++++++++------ {engine => matilde_plugin/engine}/__init__.py | 4 +- .../engine}/citations.py | 0 {engine => matilde_plugin/engine}/cli.py | 14 +++---- .../engine}/openneuro.py | 0 {engine => matilde_plugin/engine}/parsing.py | 2 +- {hermes-plugin => matilde_plugin}/plugin.yaml | 5 ++- {hermes-plugin => matilde_plugin}/tools.py | 31 ++++++-------- sanitize.config.json | 2 +- scripts/check_sanitization.py | 2 +- tests/test_citations.py | 4 +- tests/test_citations_integration.py | 2 +- tests/test_cli.py | 4 +- tests/test_openneuro.py | 2 +- tests/test_openneuro_integration.py | 2 +- tests/test_parsing.py | 2 +- tests/test_plugin_tools.py | 4 +- 20 files changed, 89 insertions(+), 72 deletions(-) rename {hermes-plugin => matilde_plugin}/__init__.py (65%) rename {engine => matilde_plugin/engine}/__init__.py (89%) rename {engine => matilde_plugin/engine}/citations.py (100%) rename {engine => matilde_plugin/engine}/cli.py (86%) rename {engine => matilde_plugin/engine}/openneuro.py (100%) rename {engine => matilde_plugin/engine}/parsing.py (98%) rename {hermes-plugin => matilde_plugin}/plugin.yaml (78%) rename {hermes-plugin => matilde_plugin}/tools.py (93%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a015f24..9ce3775 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,10 +26,10 @@ the key in HSM or their `.env`. That is a runtime concern, not a code change. | You want to… | Where it goes | How it ships | |-----------------------|--------------------------------------------------|--------------------------------------------------| | Add an **API key** | operator's HSM env or `.env` | injected at runtime — **not a code change** | -| Add a **tool/skill** | `hermes-plugin/` or `hermes-skill/` | merged here → instances pull + restart | +| Add a **tool/skill** | `matilde_plugin/` or `hermes-skill/` | merged here → instances pull + restart | | Add a **system binary** (`{{EXAMPLE_TOOL}}`, …) | `docker/Dockerfile.{{PACKAGE_NAME}}` | image rebuild + redeploy (operator action) | -When in doubt, reach for `hermes-plugin/` over the Dockerfile. An image rebuild +When in doubt, reach for `matilde_plugin/` over the Dockerfile. An image rebuild requires a coordinated operator action across all deployed instances; a plugin pull is just `git pull` + restart. @@ -45,7 +45,7 @@ just `git pull` + restart. ## Sanitization -Every PR that touches `hermes-skill/`, `hermes-plugin/`, `docker/SOUL*`, `docs/`, or +Every PR that touches `hermes-skill/`, `matilde_plugin/`, `docker/SOUL*`, `docs/`, or top-level markdown files is scanned automatically by `scripts/check_sanitization.py`. The scanner has two layers: @@ -96,7 +96,7 @@ it gets added as a plugin (see below) — but the key value itself is never comm ### New tool/skill -Create the tool in `hermes-plugin/` following the existing plugin conventions, or add +Create the tool in `matilde_plugin/` following the existing plugin conventions, or add a skill document to `hermes-skill/`. Open a PR. Once merged, operators pull the update and restart their agent. No image rebuild required. diff --git a/README.md b/README.md index d529293..c74d108 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ polite pools. ## Try it ```python -from engine.citations import Reference, verify_reference +from matilde_plugin.engine.citations import Reference, verify_reference ref = Reference(title="Attention Is All You Need", authors=["Vaswani", "Shazeer"], year=2017, @@ -75,10 +75,10 @@ print(result.verdict, result.score) # -> e.g. "verified" 1.0 ### Command line — verify a whole bibliography ```bash -python3 -m engine.cli refs.bib # verify a BibTeX file -python3 -m engine.cli dois.txt # or a list of DOIs (one per line) -python3 -m engine.cli --doi 10.1038/171737a0 # or a single DOI -python3 -m engine.cli refs.bib --json # machine-readable +python3 -m matilde_plugin.engine.cli refs.bib # verify a BibTeX file +python3 -m matilde_plugin.engine.cli dois.txt # or a list of DOIs (one per line) +python3 -m matilde_plugin.engine.cli --doi 10.1038/171737a0 # or a single DOI +python3 -m matilde_plugin.engine.cli refs.bib --json # machine-readable ``` Output for a mixed bibliography: @@ -121,16 +121,18 @@ Matilde grows outward from citations toward a full scientific research assistant ## Architecture & layout -Matilde is built on the Hermes use-case-package template: a plugin + a skill + a soul -+ an engine, runnable standalone or managed via HSM. See the template's docs for the -privacy model, sanitization gate, and promotion flow. +Matilde is built on the Hermes use-case-package template: a plugin + a skill + a soul, +runnable standalone or managed via HSM. The engine lives **inside** the plugin +(`matilde_plugin/engine/`) so the plugin directory is a self-contained, copyable +artifact. See the template's docs for the privacy model, sanitization gate, and +promotion flow. | Path | What it is | |------|-----------| -| `engine/citations.py` | The verifiable-citations engine (the core; the part we may open-source standalone) | -| `engine/openneuro.py` | Read-only OpenNeuro/BIDS client — discovery, metadata, files (stdlib-only) | -| `engine/parsing.py` · `engine/cli.py` | BibTeX/DOI ingestion + the `matilde` verify CLI | -| `hermes-plugin/` | Hermes tool definitions exposing the engine to the agent | +| `matilde_plugin/` | Self-contained Hermes plugin — tool definitions **plus** the bundled engine | +| `matilde_plugin/engine/citations.py` | The verifiable-citations engine (the core; the part we may open-source standalone) | +| `matilde_plugin/engine/openneuro.py` | Read-only OpenNeuro/BIDS client — discovery, metadata, files (stdlib-only) | +| `matilde_plugin/engine/parsing.py` · `matilde_plugin/engine/cli.py` | BibTeX/DOI ingestion + the `matilde` verify CLI (`python3 -m matilde_plugin.engine.cli`) | | `hermes-skill/SKILL.md` | The agent's research methodology | | `docker/SOUL.Matilde.md` | The research-assistant identity | | `tests/` | Offline unit suite + live API integration tests | diff --git a/docs/onboarding.md b/docs/onboarding.md index 43ecd50..737ea86 100644 --- a/docs/onboarding.md +++ b/docs/onboarding.md @@ -25,7 +25,7 @@ bind-mounted into the container at `/opt/data` (`HERMES_HOME`). │ {{IMAGE}} │ ───▶ │ = /opt/data — a directory you own │ │ │ │ │ │ • Hermes runtime │ │ • {{PACKAGE_NAME}}/ ← git clone of │ - │ • System dependencies / │ │ THIS repo (engine/, plugin, │ + │ • System dependencies / │ │ THIS repo (plugin+engine, │ │ domain-specific binaries │ │ collectors/, skill, docs) │ │ ({{DOMAIN_BINARIES}}) │ │ │ │ │ │ • skills/ ← operator skills │ @@ -110,7 +110,7 @@ tells you if it is missing. **What's in `.env`** — your API keys for any external services this package uses. The `.env` file is git-ignored; never commit it. The list of required keys is in `docker/instance-setup.sh` and in the `requires_env` block of -`hermes-plugin/plugin.yaml`. See `.env.example` for the full set with descriptions. +`matilde_plugin/plugin.yaml`. See `.env.example` for the full set with descriptions. --- @@ -124,7 +124,7 @@ conflicting state. The data layout is identical to standalone. What changes is the orchestrator: -- **Enable the plugin** via the HSM UI or API. HSM reads `hermes-plugin/plugin.yaml` +- **Enable the plugin** via the HSM UI or API. HSM reads `matilde_plugin/plugin.yaml` and surfaces the capability toggle. - **Environment / API keys** go into the HSM env store (encrypted). They are injected at container start. The `requires_env` keys declared in `plugin.yaml` are what HSM diff --git a/hermes-plugin/__init__.py b/matilde_plugin/__init__.py similarity index 65% rename from hermes-plugin/__init__.py rename to matilde_plugin/__init__.py index 98c1773..524ea44 100644 --- a/hermes-plugin/__init__.py +++ b/matilde_plugin/__init__.py @@ -1,6 +1,6 @@ """matilde plugin — registers Matilde's verifiable-citation tools with Hermes. -Wraps the ``engine.citations`` verifier as Hermes tools. Each tool maps to a core +Wraps the bundled ``.engine.citations`` verifier as Hermes tools. Each tool maps to a core operation: verify one citation, verify a whole bibliography, or quick-check a retraction. The engine is imported at tool-invocation time (via _check_available), so the plugin registers even if imports have issues — the gate handles execution. @@ -8,25 +8,42 @@ from __future__ import annotations +import importlib import importlib.util import os import sys # --------------------------------------------------------------------------- -# Path setup — package root (engine/) is one level above this file. +# Self-contained loading. +# +# The plugin is a self-contained package: ``engine/`` lives INSIDE this dir, and +# ``tools.py`` imports it via relative imports (``from .engine.citations import …``). +# Copying ONLY this directory into another location still imports cleanly. +# +# Hermes (and the test harness) load this ``__init__.py`` directly by file path +# under the name ``matilde_plugin``. For ``tools.py``'s relative imports to +# resolve, this module must be registered in ``sys.modules`` as a package (with a +# search path) before we import ``tools``. We ensure that here, then import +# ``tools`` as a real submodule. # --------------------------------------------------------------------------- _PLUGIN_DIR = os.path.dirname(os.path.realpath(__file__)) -_PACKAGE_ROOT = os.path.normpath(os.path.join(_PLUGIN_DIR, "..")) -if _PACKAGE_ROOT not in sys.path: - sys.path.insert(0, _PACKAGE_ROOT) +_PKG = __name__ if __name__ != "__main__" else "matilde_plugin" -# --------------------------------------------------------------------------- -# Load tools.py from this directory (import-path agnostic). -# --------------------------------------------------------------------------- -_tools_path = os.path.join(_PLUGIN_DIR, "tools.py") -_spec = importlib.util.spec_from_file_location("_matilde_tools", _tools_path) -_tools_mod = importlib.util.module_from_spec(_spec) -_spec.loader.exec_module(_tools_mod) +# Register THIS module as a package in sys.modules so relative imports resolve, +# even when we were loaded by file path (spec_from_file_location does not always +# pre-register the parent package or give it a search path). +_self = sys.modules.get(_PKG) +if _self is None: + _self = sys.modules[__name__] + sys.modules[_PKG] = _self +if getattr(_self, "__path__", None) is None: + _self.__path__ = [_PLUGIN_DIR] # mark as a package +if getattr(_self, "__package__", None) in (None, ""): + _self.__package__ = _PKG + +# Import tools.py as the submodule ``.tools`` so its ``from .engine…`` +# relative imports resolve against this package. +_tools_mod = importlib.import_module(f"{_PKG}.tools") # --------------------------------------------------------------------------- # Re-export schemas, handlers, and the availability gate. diff --git a/engine/__init__.py b/matilde_plugin/engine/__init__.py similarity index 89% rename from engine/__init__.py rename to matilde_plugin/engine/__init__.py index 7bf2c29..1bf407a 100644 --- a/engine/__init__.py +++ b/matilde_plugin/engine/__init__.py @@ -2,7 +2,7 @@ The engine is the package's core: it verifies a citation along four independent axes (existence, metadata-match, retraction, URL-liveness) and produces a -composite verifiability score and verdict. See :mod:`engine.citations`. +composite verifiability score and verdict. See :mod:`matilde_plugin.engine.citations`. This is *verifiable*, not *provably correct* — axes 1-3 are near-deterministic; claim-support grounding (does the cited passage substantiate the claim?) is the @@ -10,7 +10,7 @@ """ from __future__ import annotations -from engine.citations import ( +from .citations import ( AxisResult, Reference, VerificationResult, diff --git a/engine/citations.py b/matilde_plugin/engine/citations.py similarity index 100% rename from engine/citations.py rename to matilde_plugin/engine/citations.py diff --git a/engine/cli.py b/matilde_plugin/engine/cli.py similarity index 86% rename from engine/cli.py rename to matilde_plugin/engine/cli.py index 2928906..96f407a 100644 --- a/engine/cli.py +++ b/matilde_plugin/engine/cli.py @@ -2,11 +2,11 @@ Usage:: - python3 -m engine.cli refs.bib # verify a BibTeX file - python3 -m engine.cli dois.txt # verify a list of DOIs - python3 -m engine.cli --doi 10.1038/171737a0 # verify one DOI - python3 -m engine.cli refs.bib --json # machine-readable output - python3 -m engine.cli refs.bib --email you@example.org # polite-pool contact + python3 -m matilde_plugin.engine.cli refs.bib # verify a BibTeX file + python3 -m matilde_plugin.engine.cli dois.txt # verify a list of DOIs + python3 -m matilde_plugin.engine.cli --doi 10.1038/171737a0 # verify one DOI + python3 -m matilde_plugin.engine.cli refs.bib --json # machine-readable output + python3 -m matilde_plugin.engine.cli refs.bib --email you@example.org # polite-pool contact Exit codes: 0 = all references verified / only warnings; 1 = at least one ``not_found`` or ``retracted`` reference (useful as a pre-commit / CI gate on a @@ -20,8 +20,8 @@ import sys from typing import Callable, Optional -from engine.citations import Reference, verify_reference -from engine.parsing import parse_bibtex, parse_dois +from .citations import Reference, verify_reference +from .parsing import parse_bibtex, parse_dois _VERDICT_MARK = { "verified": "OK ", diff --git a/engine/openneuro.py b/matilde_plugin/engine/openneuro.py similarity index 100% rename from engine/openneuro.py rename to matilde_plugin/engine/openneuro.py diff --git a/engine/parsing.py b/matilde_plugin/engine/parsing.py similarity index 98% rename from engine/parsing.py rename to matilde_plugin/engine/parsing.py index d84f7a1..4619c52 100644 --- a/engine/parsing.py +++ b/matilde_plugin/engine/parsing.py @@ -10,7 +10,7 @@ import re -from engine.citations import Reference, _normalize_doi +from .citations import Reference, _normalize_doi def _strip_value(raw: str) -> str: diff --git a/hermes-plugin/plugin.yaml b/matilde_plugin/plugin.yaml similarity index 78% rename from hermes-plugin/plugin.yaml rename to matilde_plugin/plugin.yaml index d4a535e..7af2f8d 100644 --- a/hermes-plugin/plugin.yaml +++ b/matilde_plugin/plugin.yaml @@ -1,8 +1,11 @@ # plugin.yaml — Hermes plugin manifest for Matilde (verifiable citations) # # Register the plugin by symlinking it into the agent's plugin dir: -# ~/.hermes-{agent-name}/plugins/matilde -> /path/to/Matilde/hermes-plugin/ +# ~/.hermes-{agent-name}/plugins/matilde -> /path/to/Matilde/matilde_plugin/ # Then restart the agent (or `hermes plugin reload` if supported). +# +# This directory is self-contained: the citation/OpenNeuro engine lives inside it +# (matilde_plugin/engine/), so copying ONLY this dir is enough to run the plugin. name: "matilde" diff --git a/hermes-plugin/tools.py b/matilde_plugin/tools.py similarity index 93% rename from hermes-plugin/tools.py rename to matilde_plugin/tools.py index 53b9a2b..2c39120 100644 --- a/hermes-plugin/tools.py +++ b/matilde_plugin/tools.py @@ -1,6 +1,6 @@ """Matilde tools for Hermes — verifiable-citation checking. -These tools expose the ``engine.citations`` verifier to the agent. A citation is +These tools expose the bundled ``.engine.citations`` verifier to the agent. A citation is checked along four axes (existence, metadata-match, retraction, URL-liveness) and scored. This is *verifiable*, not *provably correct* — the score is a confidence, not a proof. Claim-support grounding (does the cited passage back the claim?) is a @@ -17,17 +17,12 @@ from __future__ import annotations import json -import os -import sys from typing import Any -# --------------------------------------------------------------------------- -# Path setup — make the package root importable (engine/ lives one level up). -# --------------------------------------------------------------------------- -_PLUGIN_DIR = os.path.dirname(os.path.abspath(__file__)) -_PACKAGE_ROOT = os.path.normpath(os.path.join(_PLUGIN_DIR, "..")) -if _PACKAGE_ROOT not in sys.path: - sys.path.insert(0, _PACKAGE_ROOT) +# The engine lives INSIDE this plugin package (matilde_plugin/engine/), so it is +# imported via relative imports below — no sys.path manipulation needed. Imports +# are done lazily at call time so the plugin still registers (the _check_available +# gate guards execution) even if an import would fail. # --------------------------------------------------------------------------- @@ -58,7 +53,7 @@ def _check_available() -> bool: so the only real prerequisite is that the engine module loads. """ try: - import engine.citations # noqa: F401 + from .engine import citations # noqa: F401 return True except Exception: return False @@ -69,7 +64,7 @@ def _check_available() -> bool: # --------------------------------------------------------------------------- def _reference_from_args(d: dict) -> Any: - from engine.citations import Reference + from .engine.citations import Reference authors = d.get("authors") or [] if isinstance(authors, str): # accept "Vaswani; Shazeer" or "Vaswani, Shazeer" @@ -126,7 +121,7 @@ def _handle_verify_citation(args: dict, **kwargs: Any) -> str: if not (args.get("doi") or args.get("title")): return _tool_error("Provide at least a 'doi' or a 'title' to verify.") try: - from engine.citations import verify_reference + from .engine.citations import verify_reference ref = _reference_from_args(args) result = verify_reference(ref) out = result.to_dict() @@ -187,7 +182,7 @@ def _handle_verify_bibliography(args: dict, **kwargs: Any) -> str: if not isinstance(refs, list) or not refs: return _tool_error("'references' must be a non-empty list of citation objects.") try: - from engine.citations import verify_reference + from .engine.citations import verify_reference results, summary = [], {} flagged = [] for i, item in enumerate(refs): @@ -244,7 +239,7 @@ def _handle_check_retraction(args: dict, **kwargs: Any) -> str: if not doi: return _tool_error("'doi' is required.") try: - from engine.citations import check_retraction, default_fetch + from .engine.citations import check_retraction, default_fetch res = check_retraction(doi, fetch=default_fetch) return _tool_result( doi=doi, @@ -285,7 +280,7 @@ def _handle_openneuro_dataset_info(args: dict, **kwargs: Any) -> str: if not dsid: return _tool_error("'dataset_id' is required (e.g. 'ds000246').") try: - from engine.openneuro import get_dataset, OpenNeuroError + from .engine.openneuro import get_dataset, OpenNeuroError try: ds = get_dataset(dsid) except OpenNeuroError as exc: @@ -323,7 +318,7 @@ def _handle_openneuro_dataset_info(args: dict, **kwargs: Any) -> str: def _handle_openneuro_search(args: dict, **kwargs: Any) -> str: try: - from engine.openneuro import list_datasets + from .engine.openneuro import list_datasets limit = args.get("limit") or 20 try: limit = max(1, min(int(limit), 100)) @@ -363,7 +358,7 @@ def _handle_openneuro_list_files(args: dict, **kwargs: Any) -> str: if not dsid: return _tool_error("'dataset_id' is required (e.g. 'ds000246').") try: - from engine.openneuro import list_files, OpenNeuroError + from .engine.openneuro import list_files, OpenNeuroError tag = str(args.get("tag", "")).strip() or None try: files = list_files(dsid, tag=tag) diff --git a/sanitize.config.json b/sanitize.config.json index 63c9c4a..034342f 100644 --- a/sanitize.config.json +++ b/sanitize.config.json @@ -6,7 +6,7 @@ "sensitive_prefixes": [ "hermes-skill/", - "hermes-plugin/", + "matilde_plugin/", "docker/SOUL", "docs/" ], diff --git a/scripts/check_sanitization.py b/scripts/check_sanitization.py index ab33baa..aa16bd2 100644 --- a/scripts/check_sanitization.py +++ b/scripts/check_sanitization.py @@ -39,7 +39,7 @@ def load_config(root="."): # Sensible defaults so the gate still runs on a fresh template. return { "package_kind": "SHARED, public agent package", - "sensitive_prefixes": ["hermes-skill/", "hermes-plugin/", "docker/SOUL", "docs/"], + "sensitive_prefixes": ["hermes-skill/", "matilde_plugin/", "docker/SOUL", "docs/"], "semantic": {"domain_noun": "operational engagement", "flag_examples": [], "do_not_flag_examples": [], "model": "claude-opus-4-8"}, "deterministic": {"enabled": True, "allow_substrings": []}, diff --git a/tests/test_citations.py b/tests/test_citations.py index 0eb3f44..d5a23a5 100644 --- a/tests/test_citations.py +++ b/tests/test_citations.py @@ -17,7 +17,7 @@ sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))) -from engine.citations import ( # noqa: E402 +from matilde_plugin.engine.citations import ( # noqa: E402 AxisResult, Reference, VerificationResult, @@ -309,7 +309,7 @@ def test_openalex_to_record_normalizes_to_crossref_shape(): def test_retraction_via_openalex_is_retracted_flag(): retracted_oa = dict(OPENALEX_ATTENTION, is_retracted=True) rec = _openalex_to_record(retracted_oa) - from engine.citations import _retraction_signal + from matilde_plugin.engine.citations import _retraction_signal assert _retraction_signal(rec) is not None diff --git a/tests/test_citations_integration.py b/tests/test_citations_integration.py index 02c6e2c..d7ab977 100644 --- a/tests/test_citations_integration.py +++ b/tests/test_citations_integration.py @@ -17,7 +17,7 @@ sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))) -from engine.citations import ( # noqa: E402 +from matilde_plugin.engine.citations import ( # noqa: E402 Reference, check_retraction, default_fetch, diff --git a/tests/test_cli.py b/tests/test_cli.py index fdec291..04362c0 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -12,8 +12,8 @@ sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))) -from engine import cli # noqa: E402 -from engine.citations import AxisResult, Reference, VerificationResult # noqa: E402 +from matilde_plugin.engine import cli # noqa: E402 +from matilde_plugin.engine.citations import AxisResult, Reference, VerificationResult # noqa: E402 def _result(ref: Reference, verdict: str = "verified", score: float = 1.0) -> VerificationResult: diff --git a/tests/test_openneuro.py b/tests/test_openneuro.py index 379a3fb..df1b36c 100644 --- a/tests/test_openneuro.py +++ b/tests/test_openneuro.py @@ -12,7 +12,7 @@ sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))) -from engine.openneuro import ( # noqa: E402 +from matilde_plugin.engine.openneuro import ( # noqa: E402 Dataset, OpenNeuroError, download_file, diff --git a/tests/test_openneuro_integration.py b/tests/test_openneuro_integration.py index f2a3ad3..81ba29a 100644 --- a/tests/test_openneuro_integration.py +++ b/tests/test_openneuro_integration.py @@ -12,7 +12,7 @@ sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))) -from engine.openneuro import get_dataset, list_datasets, list_files # noqa: E402 +from matilde_plugin.engine.openneuro import get_dataset, list_datasets, list_files # noqa: E402 LIVE = os.environ.get("MATILDE_LIVE") == "1" pytestmark = pytest.mark.skipif(not LIVE, reason="set MATILDE_LIVE=1 to run live API tests") diff --git a/tests/test_parsing.py b/tests/test_parsing.py index cbe78ca..a1a3881 100644 --- a/tests/test_parsing.py +++ b/tests/test_parsing.py @@ -6,7 +6,7 @@ sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))) -from engine.parsing import parse_bibtex, parse_dois # noqa: E402 +from matilde_plugin.engine.parsing import parse_bibtex, parse_dois # noqa: E402 SAMPLE_BIB = r""" diff --git a/tests/test_plugin_tools.py b/tests/test_plugin_tools.py index a7e4b5b..26a6167 100644 --- a/tests/test_plugin_tools.py +++ b/tests/test_plugin_tools.py @@ -17,7 +17,7 @@ def _load_plugin(): - path = os.path.join(ROOT, "hermes-plugin", "__init__.py") + path = os.path.join(ROOT, "matilde_plugin", "__init__.py") spec = importlib.util.spec_from_file_location("matilde_plugin", path) mod = importlib.util.module_from_spec(spec) spec.loader.exec_module(mod) @@ -79,7 +79,7 @@ def test_check_retraction_requires_doi(): def test_openneuro_dataset_info_envelope_includes_message_and_fields(monkeypatch): plugin = _load_plugin() - import engine.openneuro as on + import matilde_plugin.engine.openneuro as on def fake_get_dataset(dsid, gql=None): return on.Dataset(id=dsid, name="Demo MEG", modalities=["meg"],