Standardize step metadata catalog ownership to step packs#103
Standardize step metadata catalog ownership to step packs#103
Conversation
- Update Resolve-IdleStepMetadataCatalog to discover loaded IdLE.Steps.* modules - Implement deterministic merge with duplicate detection - Change host metadata to supplement-only (no overrides) - Add Get-IdleStepMetadataCatalog to IdLE.Steps.DirectorySync - Move TriggerDirectorySync metadata from Common to DirectorySync - Update error messages for clearer distinction Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
- Add tests for discovery, merge, duplicates, and supplements - Update existing tests to reflect breaking change (no overrides) - Create test fixture for DirectorySync workflow - All tests passing Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
- Update provider-capabilities.md to reflect new ownership model - Document discovery, merge, and supplement-only behavior - Document breaking change (no RequiresCapabilities in workflows) - Add error documentation (MissingStepTypeMetadata, DuplicateStepTypeMetadata) Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
- Update wording to reflect step pack metadata ownership - Remove outdated reference to steps declaring RequiresCapabilities - All tests passing (240/240), ScriptAnalyzer clean Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b6cf8eb3e
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR standardizes step metadata catalog ownership to step packs, eliminating ambiguity about where step capabilities are defined. Step metadata (RequiredCapabilities) is now owned and exported by step packs via Get-IdleStepMetadataCatalog, with Core discovering loaded IdLE.Steps.* modules and merging their catalogs deterministically. Host metadata becomes supplement-only for custom step types.
Changes:
- Core discovers and merges step pack metadata catalogs with duplicate detection
- Host metadata (
Providers.StepMetadata) restricted to supplement-only (no overrides) - Error separation:
MissingStepTypeMetadatavsDuplicateStepTypeMetadata - DirectorySync step pack now owns
TriggerDirectorySyncmetadata (moved from Common) - Breaking change: workflows must not define
RequiredCapabilities
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/fixtures/workflows/joiner-with-dirsync.psd1 | New test fixture for DirectorySync step without capability declarations |
| tests/Resolve-IdleStepMetadataCatalog.Tests.ps1 | Comprehensive test suite for catalog discovery, merge, duplicate detection, and host supplement validation |
| tests/New-IdlePlan.Capabilities.Tests.ps1 | Updated to reflect breaking change - host override now rejected instead of allowed |
| src/IdLE.Steps.DirectorySync/Public/Get-IdleStepMetadataCatalog.ps1 | New function exporting TriggerDirectorySync metadata |
| src/IdLE.Steps.DirectorySync/IdLE.Steps.DirectorySync.psm1 | Added Get-IdleStepMetadataCatalog to module exports |
| src/IdLE.Steps.DirectorySync/IdLE.Steps.DirectorySync.psd1 | Added Get-IdleStepMetadataCatalog to FunctionsToExport |
| src/IdLE.Steps.Common/Public/Get-IdleStepMetadataCatalog.ps1 | Removed TriggerDirectorySync metadata (ownership transferred to DirectorySync pack) |
| src/IdLE.Core/Public/New-IdlePlanObject.ps1 | Updated error message for missing metadata with clear remediation guidance |
| src/IdLE.Core/Private/Resolve-IdleStepMetadataCatalog.ps1 | Implements step pack discovery, deterministic merge, duplicate detection, and supplement-only host metadata |
| docs/reference/providers/provider-ad.md | Updated to reflect metadata ownership by step packs |
| docs/advanced/provider-capabilities.md | Comprehensive documentation of new ownership model, discovery process, and error handling |
- Remove duplicate Test-IdleMetadataForScriptBlocks definitions - Create shared Assert-IdleStepMetadataNoScriptBlock wrapper - Reuse existing Assert-IdleNoScriptBlock function - Maintains same error messages with metadata-specific context - All 240 tests passing, ScriptAnalyzer clean Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
- Remove Before/After examples from documentation (new behavior only) - Add -All parameter to Get-Module for nested module discovery - Add explanatory comment to test fixture about DirectorySync focus - All tests passing, ScriptAnalyzer clean Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
- Removed paragraph about not declaring RequiredCapabilities in workflows - Removed example workflow step showing current format - Documentation now focuses purely on how the system works without referencing old behavior - All tests passing Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Summary
Step metadata (RequiredCapabilities) is now owned and exported by step packs via
Get-IdleStepMetadataCatalog. Core discovers loadedIdLE.Steps.*modules (including nested modules), merges their catalogs deterministically, and enforces ownership boundaries. Host metadata becomes supplement-only.Motivation
Metadata ownership was unclear: workflows could define capabilities, host could override, and step packs had partial control. This caused ambiguity for implementers and workflow authors. Standardizing on step pack ownership eliminates configuration drift and makes capability requirements explicit and discoverable.
Type of Change
Changes
Core discovery and merge
Resolve-IdleStepMetadataCatalogdiscovers loadedIdLE.Steps.*modules exportingGet-IdleStepMetadataCatalogGet-Module -AllDuplicateStepTypeMetadataon collision (step pack vs step pack, host vs step pack)Assert-IdleNoScriptBlockfunctionHost metadata: supplement-only
Providers.StepMetadatamay only add metadata for step types not present in step pack catalogsDuplicateStepTypeMetadataError separation
MissingStepTypeMetadata: workflow references unknown step type (remediation: import step pack OR provide host metadata)DuplicateStepTypeMetadata: ownership conflict (step pack vs step pack, or host override attempt)Step pack updates
IdLE.Steps.DirectorySync: addedGet-IdleStepMetadataCatalogexportingIdLE.Step.TriggerDirectorySyncmetadataIdLE.Steps.Common: removedIdLE.Step.TriggerDirectorySync(ownership transferred)Get-IdleStepMetadataCatalogfunction; Core calls each module's function individually to avoid conflictsCode quality improvements
Test-IdleMetadataForScriptBlocksfunction definitionsAssert-IdleStepMetadataNoScriptBlockwrapper that reuses existingAssert-IdleNoScriptBlockDocumentation updates
Breaking change
RequiredCapabilitiesorRequiresCapabilitieson stepsExample: step pack catalog
Example: workflow step
Testing
New test suite
Resolve-IdleStepMetadataCatalog.Tests.ps1covers:Updated
New-IdlePlan.Capabilities.Tests.ps1to reflect breaking change (host override → rejection).Test fixture
joiner-with-dirsync.psd1documented to clarify it focuses on DirectorySync metadata resolution.Test results: 240/240 passing, ScriptAnalyzer clean.
How to test & review
IdLE.Steps.DirectorySyncand verifyGet-IdleStepMetadataCatalogexportsTriggerDirectorySyncmetadataIdLE.Step.DisableIdentity→ expectDuplicateStepTypeMetadataMissingStepTypeMetadatawith remediation textTriggerDirectorySyncderive capabilities correctly (no workflow changes needed)Checklist
Original prompt
This section details on the original issue you should resolve
<issue_title>Step metadata catalogs owned by step packs</issue_title>
<issue_description>## Problem Statement
IdLE needs step metadata (e.g.,
RequiredCapabilities) to plan and execute workflows. Today, step metadata resolution is partially hard-coded and workflow authors may still encounter guidance to specify capabilities in workflow definitions. This creates:This issue standardizes ownership and discovery so that step packs (
IdLE.Steps.*) own step metadata andIdLE.Corediscovers and merges their catalogs deterministically.Proposed Solution
High-level behavior
IdLE.Steps.*) own step metadata for their step types.Get-IdleStepMetadataCatalog.IdLE.Corediscovers loaded step packs and merges their catalogs deterministically.Providers.StepMetadata) remains supported, but supplement-only (only for new/host-defined step types; no overrides).Breaking change (pre-1.0)
Workflows/step definitions must not define
RequiredCapabilities(orRequiresCapabilities).Capabilities come from step metadata catalogs (step pack ownership).
Contract:
Get-IdleStepMetadataCatalogEach step pack MAY export
Get-IdleStepMetadataCatalog:HashtableStepType(string)Hashtablewith at least:RequiredCapabilities: string or string[] (Core normalizes to string[])Notes:
StepTypeis the key. The value does not need aStepTypeproperty.Discovery rule (Core)
Core resolves step metadata catalogs only from loaded modules that:
IdLE.Steps.*, andGet-IdleStepMetadataCatalogDeterminism:
Merge rules
Step pack catalogs
StepTypeappears in more than one step pack catalog:DuplicateStepTypeMetadataStepTypeand the conflicting module names.Host supplement (
Providers.StepMetadata) — supplement-onlyProviders.StepMetadataremains supported, but must not override step-pack-owned metadata:StepTypes that do not exist in the merged step pack catalog.StepTypethat already exists from a step pack:DuplicateStepTypeMetadata(source: Host vs StepPack)Outcome:
Error behavior (must be clearly separated)
1) Duplicate step type metadata
DuplicateStepTypeMetadataStepType2) Missing step type metadata
MissingStepTypeMetadataStepTypethat is absent from the final catalog.StepTypeGet-IdleStepMetadataCatalogfor that step type, ORProviders.StepMetadata(only for host-defined/custom step types)Required code changes
IdLE.CoreUpdate
Resolve-IdleStepMetadataCatalogto:IdLE.Steps.*) exportingGet-IdleStepMetadataCatalogProviders.StepMetadataas supplement-only (no override)DuplicateStepTypeMetadataon any duplicates (pack↔pack, host↔pack)Update plan building validation to throw
MissingStepTypeMetadata(and ensure it is not conflated with duplicates).Step packs
IdLE.Steps.CommonIdLE.Steps.DirectorySyncGet-IdleStepMetadataCatalogand move ownership of:IdLE.Step.TriggerDirectorySyncIdLE.Step.TriggerDirectorySyncmetadata entry fromIdLE.Steps.Common.Docs & examples updates (in scope)
RequiresCapabilities/RequiredCapabilitiesin workflow definitions...💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.