Skip to content

Phase 5: Governance, security, catalog validation, compatibility policy, and extension test harness #117

Closed

Description

@suraj-ranganath

Summary

Define and automate the trust/governance side of the extension ecosystem. This is the phase that prevents EEGPrep from recreating the risks of custom zip uploads and manual issue-based submission.

Key Work

  • Define official curation policy: what maintainers review, what automated checks enforce, and what “curated” does and does not guarantee.
  • Define catalog submission format and CI validation for a future eegprep-extension-index repository.
  • Add a local catalog validator script/tool that can validate metadata entries without needing the external catalog repo to exist yet.
  • Add extension compatibility policy: extension API versioning, EEGPrep version requirements, dependency declarations, and deprecation rules.
  • Add a reusable extension test harness so extension authors can assert their spec loads, menus register, actions work, help resources exist, and console/history behavior is valid.
  • Add safeguards for untrusted code messaging: extensions are Python packages and execute code when imported or activated.
  • Define naming recommendations, e.g. eegprep-ext-*, without relying on names for discovery.
  • Add tests for malicious/invalid-looking metadata, dependency mismatches, and catalog conflicts.

Edge Cases To Cover

  • Catalog entry points to a package that no longer exists.
  • Package exists but does not expose eegprep.extensions entry point.
  • Package exposes an entry point but fails to import.
  • Metadata claims one version but installed package is another.
  • Extension depends on unsupported Python/EEGPrep version.
  • Extension has missing license/maintainer/docs metadata.
  • Extension wants to be private/internal and not curated.

Acceptance Criteria

  • Catalog metadata can be validated in CI without hosting code artifacts.
  • Extension authors have a test harness that catches common integration mistakes before submission.
  • EEGPrep surfaces trust and compatibility status clearly.
  • Maintainers have a clear review policy for catalog PRs.
  • Tests cover catalog validator behavior and extension compatibility/failure states.

/goal Prompt

/goal Define and implement EEGPrep extension governance and safety infrastructure: catalog metadata validation, compatibility policy, extension test harness, curation docs, trust messaging, and failure-state tests. Avoid custom zip hosting, keep private extensions supported, and make catalog review automatable and maintainable.

Activity

  1. added
    phase
    on Jun 2, 2026
  2. claude commented on Jun 2, 2026

    @claude
    Contributor

    🤖 Plan:

    Research

    Phase 5 cannot land independently: catalog validation, compatibility policy, the extension test harness, and trust messaging all bind to the ExtensionSpec/registry contract defined in Phase 1 (#113) and the curated catalog schema defined in Phase 3 (#115). Today the only relevant artifact is a hardcoded bundled inventory; nothing in the repo references an eegprep.extensions entry-point group or external package model.

    Relevant code

    Proposed Approach (design, not a PR)

    Scope is well above the <100-line/single-module bar in the fix-issue rules, so per the instructions I am not opening a PR. The issue is also blocked: there is no ExtensionSpec, no registry, no entry-point discovery group, and no catalog schema in the tree, so any validator/harness/policy work here would be writing against an imagined API.

    Recommended sequencing before Phase 5 work starts:

    1. Land Phase 1 (Phase 1: Extension SDK, registry, discovery, and compatibility contract #113) first. That fixes the contract: ExtensionSpec fields, eegprep.extensions entry-point group, status enum (bundled/installed/curated/disabled/incompatible/invalid-spec/failed-import/missing-dependency/unknown), API-version + EEGPrep-version compatibility check, and lazy-loading behavior. Phase 5 validation is meaningless without these.
    2. Land at least the catalog metadata schema from Phase 3 (Phase 3: Extension Manager UX, curated catalog metadata, and safe install guidance #115). Phase 5's CI validator and the "catalog entry points to a package that no longer exists" / "metadata claims one version but installed is another" edge cases all assume a concrete schema.

    When unblocked, Phase 5 splits cleanly into five PR-sized chunks rather than one mega-PR. Suggested cuts, each independently reviewable and each well under the spec/oversize threshold from .agents/skills/pull-request/SKILL.md:

    A. Catalog schema + local validator — src/eegprep/extensions/catalog.py (or functions/adminfunc/extension_catalog.py to stay EEGLAB-shaped) with a JSON Schema / dataclass model and a validate_catalog(path) entrypoint. Console-callable so a future eegprep-extension-index repo can wire it into its own CI without EEGPrep needing to exist there. Tests cover: missing package, package without eegprep.extensions entry point, entry point that imports to wrong type, version mismatch with installed, duplicate catalog ids, conflicting display names, missing license/maintainer/docs URL, unsupported Python/EEGPrep version requirement, private/internal flag.

    B. Compatibility policy module — small extension_compat.py exposing check_compatibility(spec, eegprep_version, api_version) returning a status + reason. Define the API-version + deprecation rules in a single docstring/policy block so Phase 3's manager UI and Phase 4's authoring docs both cite one source. Drives the incompatible / missing-dependency statuses introduced in Phase 1.

    C. Extension test harness — reusable pytest helpers under src/eegprep/extensions/testing.py (importable by third-party extension authors) plus a pytest plugin entry point. Assertions for: spec loads via entry point, menu items register without GUI side effects, actions return (EEG, com) and update LASTCOM/ALLCOM, declared help resources resolve, console alias round-trips, package data accessible via importlib.resources. No mocks; exercise a tiny in-repo fixture extension package under tests/fixtures/sample_extension/ rather than mocking entry points.

    D. Curation policy + trust messaging — docs/source/user_guide/extension_curation.rst covering what curation does and does not guarantee, the review checklist for catalog PRs, the recommended eegprep-ext-* name convention (without making names load-bearing), and the "installing Python packages executes third-party code" trust copy that Phase 3's manager will surface. No runtime code beyond surfacing a CURATION_POLICY_URL constant the manager can render.

    E. Catalog CI scaffold — a thin tools/validate_extension_catalog.py plus a documented GitHub Actions workflow YAML snippet for the future eegprep-extension-index repo. Stays under tools/ since it is not part of installed package runtime, per AGENTS.md repo-map rules.

    Open questions for a human to resolve before implementation:

    • Module home: src/eegprep/extensions/... (new top-level package, clear public API) vs. src/eegprep/functions/adminfunc/extension_*.py (EEGLAB-shaped). Phase 1's choice should bind Phase 5; if Phase 1 has not committed yet, this is the moment to decide.
    • Where does the persisted enable/disable + curation-acknowledgement state live? Session-owned (lives with EEGPrepSession) vs. a small explicit user-config file. AGENTS.md forbids hidden globals; Phase 1 hints at "minimal user preferences in an explicit config location."
    • API-version policy: SemVer with a deprecation window vs. integer epoch. Affects how harshly extensions get marked incompatible.
    • Should the test harness be installable as eegprep[extension-testing] extra, or shipped inside the template package from Phase 4 (Phase 4: Researcher authoring toolkit, template package, examples, and scaffolding #116)? Affects whether harness code is in the runtime wheel.
    • Catalog: single flat JSON vs. per-extension files in a directory. Affects validator complexity and merge-conflict behavior on the future eegprep-extension-index repo.

    No PR opened. Awaiting Phase 1 (#113) and Phase 3 (#115), plus answers to the open questions, before implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

phase

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions