Skip to content

core: register step pack handlers via StepMetadataCatalog - #339

Merged
blindzero merged 2 commits into
mainfrom
feature/292-step-handler-registration-via-catalog
Oct 31, 2026
Merged

blindzero merged 2 commits into
mainfrom
feature/292-step-handler-registration-via-catalog

Conversation

@blindzero

Copy link
Copy Markdown
Owner

Summary

Step packs now declare their step handlers with a Handler key in StepMetadataCatalog.psd1. The engine discovers step packs through a manifest marker and registers the handlers itself, so custom step modules no longer need Providers.StepRegistry.

Motivation

Custom step modules had no clean way to register their handlers (#292). Every caller had to repeat the StepRegistry mapping and with it an implementation detail. Built-in handlers were maintained twice: as a hardcoded list in Get-IdleStepRegistry and in the catalogs.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring / internal improvement

Changes

  • Discovery via manifest marker: PrivateData.IdLE = @{ Kind = 'StepPack'; StepCatalog = 'StepMetadataCatalog.psd1' }. The engine reads the catalog itself, and the path must be inside the module folder. Name-based discovery (IdLE.Steps.* + Get-IdleStepMetadataCatalog) remains as a deprecated fallback until Identifier namespaces: reserve IdLE. for first-party, require {Owner}.IdLE.* for extensions #322.
  • Handler key (optional, string):
    • An unqualified name is bound to the declaring module (Module\Function).
    • A handler from another module is rejected.
  • Conflict rules:
    • A step type may come from only one step pack. This was already a hard error.
    • Providers.StepRegistry still takes precedence over catalog handlers.
    • Handler in Providers.StepMetadata is rejected; host steps keep using StepRegistry.
  • First-party packs migrated: Common, DirectorySync and Mailbox carry the marker and declare Handler. The hardcoded list in Get-IdleStepRegistry is removed.
  • Step reference generator: It used to parse the hardcoded list via regex and now reads the catalog Handler entries. Generated output is unchanged.
  • Docs:
    • New "Step packs" section in docs/extend/steps.md.
    • Branch naming prefixes unified in CONTRIBUTING.md; CLAUDE.md now points there.

Testing

  • Unit tests
  • Contract tests
  • Manual testing

New file tests/Core/StepPackHandlerRegistration.Tests.ps1 (9 tests). It creates a third-party step pack (Contoso.IdLE.Steps.Hr) on disk that is discovered only through the marker. Covered:

  • the plan runs without StepRegistry
  • the handler is bound to the declaring module
  • StepRegistry overrides the catalog handler
  • handlers from other modules, non-string handlers, a StepCatalog outside the module and a missing file are rejected
  • Handler in host StepMetadata is rejected
  • all 16 built-in handlers resolve

Full local suite: 895 passed, 2 failed. Both failures come from localized error messages under a German locale and pass under en-US. PSScriptAnalyzer: 0 errors. The 17 warnings are identical to main, all in files not touched here.

How to test & review

  • pwsh -NoProfile -File ./tools/Invoke-IdlePesterTests.ps1
  • pwsh -NoProfile -File ./tools/Generate-IdleStepReference.ps1 should leave docs/reference/ unchanged.

Checklist

  • Code follows STYLEGUIDE.md
  • Tests added or updated
  • Documentation updated
  • No UI/auth logic added to IdLE.Core
  • No breaking changes without discussion

Related Issues

Prepares #322 (namespaces, removal of name-based discovery) and #324.

Closes #292

🤖 Generated with Claude Code

Step packs declare their step handlers with the new `Handler` key in
StepMetadataCatalog.psd1 and are discovered via the manifest marker
PrivateData.IdLE = @{ Kind = 'StepPack'; StepCatalog = '...' }.
Custom step modules no longer need Providers.StepRegistry.

- Handler names are bound to the declaring module; handlers from other
  modules, non-string handlers, and StepCatalog paths outside the module
  folder are rejected.
- Providers.StepMetadata must not declare Handler (use StepRegistry).
- Providers.StepRegistry still takes precedence over catalog handlers.
- First-party step packs migrated; the hardcoded built-in list in
  Get-IdleStepRegistry is removed.
- Name-based discovery (IdLE.Steps.* + Get-IdleStepMetadataCatalog)
  remains as deprecated fallback until #322.
- Step reference generator reads handlers from the catalogs.
- CONTRIBUTING/CLAUDE.md: unify branch naming prefixes.

Closes #292

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T19:22:03.811323Z 7a70491 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

Code Coverage Report

Overall Project 74.05% 🍏

There is no coverage information present for the Files changed

@blindzero
blindzero merged commit e13a338 into main Oct 31, 2026
10 checks passed
@claude

claude Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Verdict: PASS

Handler registration via StepMetadataCatalog keeps the data-only and trust-boundary rules: the catalog path is confined to the module folder, handlers are bound to the declaring module, and Handler in host StepMetadata is rejected.

Findings: none (CRITICAL/MAJOR/MINOR). I did not run the tests.

🤖 Generated with Claude Code

@blindzero
blindzero deleted the feature/292-step-handler-registration-via-catalog branch October 31, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom step modules cannot self-register their handler without using Providers.StepRegistry workaround

1 participant