Skip to content

[Fable 5 Architecture Closeout] Phase 4 — CLI and extension architecture consolidation #211

Closed

Description

@suraj-ranganath

🤖 Part of #207. This phase cleans up agent-facing CLI and extension architecture so there is one command/output contract and one extension metadata source.

Summary

Remove duplicated CLI transform/pipeline dispatch, fragile JSON detection, stale per-module harness assumptions, and duplicated extension catalog/registry metadata. This improves maintainability and keeps EEGPrep’s agent-friendly CLI reliable.

Scope

Covers remaining findings from #197/#205 including:

  • cli/commands/pipeline.py duplicating transform command application logic from cli/commands/transforms.py.
  • qc --json detection special-cased through argparse.REMAINDER in cli/main.py.
  • Stale per-module CLI main() harness contracts and duplicate exception-to-payload handling.
  • extension_catalog.py manager catalog vs curation validator split.
  • Duplicated extension entry-point/version helpers and active-record predicates.
  • Bundled-plugin metadata in plugin_menu.py drifting from the extension registry.

Acceptance Criteria

  • CLI transform subcommands and pipeline steps share canonical apply functions while preserving documented command surfaces and stable JSON schemas.
  • --json detection works uniformly for CLI errors and does not require command-specific root-parser hacks.
  • Per-module CLI harnesses are removed, clearly marked test-only, or routed through the real dispatcher so docs match behavior.
  • Extension catalog runtime loading and catalog validation are separated by ownership, with entry points updated and tests covering both surfaces.
  • Bundled plugin metadata comes from the registry or one canonical projection.
  • Agent-facing CLI docs and skill/help text remain accurate.

References

  • AGENTS.md
  • .agents/skills/eegprep-feature-development/SKILL.md
  • .agents/skills/eegprep-extension-development/SKILL.md
  • Existing CLI docs and src/eegprep/resources/skills/eegprep-cli.md.

/goal Prompt

/goal Complete Fable 5 architecture closeout Phase 4 from issue #<THIS_ISSUE>: consolidate CLI transform/pipeline execution and JSON error handling, remove stale per-module CLI contracts, and split/centralize extension catalog and bundled-plugin metadata ownership. Preserve agent-friendly JSON schemas, stable error codes, public CLI behavior, and extension manager UX; add integration tests for CLI subcommands, pipeline configs, extension catalog validation, and bundled plugin discovery; run focused pytest plus ruff, format, ty, and pre-commit.

Activity

  1. added
    phase
    on Jun 12, 2026
  2. suraj-ranganath commented on Jun 12, 2026

    @suraj-ranganath
    MemberAuthor

    🤖

    Research

    No overlapping open PRs were found for #211, CLI, or extension architecture; the only matching open issue in the extension-catalog search is #211. CLI transform execution is still split: top-level transform commands use transforms.py, while pipeline steps import the same pop_* functions and maintain separate _apply_* paths, so parameters/history can drift. JSON error handling is centralized only partly through a class-level argv scan, standalone command mains still emit their own payloads, and extension metadata ownership is blurred by runtime catalog re-exporting curation validation plus duplicated plugin active/status predicates.

    Relevant code

    Proposed Fix

    Make transforms.py expose reusable canonical transform apply functions and have pipeline steps call them through normalized args, preserving public command grammar and JSON schemas. Replace global parser JSON state with command-agnostic argv detection attached to the parser/namespace so qc --json and parse errors use the same top-level path. Route stale per-module command mains through the canonical CLI dispatcher or clearly keep only test-only dispatch helpers, split catalog validation imports/entry point to extension_catalog_validation, and have plugin_menu derive active/installed state from registry records/shared helpers instead of parallel predicates. Add focused tests for CLI JSON errors, pipeline/subcommand transform equivalence, catalog kind separation, and bundled plugin discovery.

  3. suraj-ranganath commented on Jun 12, 2026

    @suraj-ranganath
    MemberAuthor

    🤖 Completed by merged phase PR #218 into feature/fable5-architecture-closeout.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    phase

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions