This repository welcomes contributions from both humans and automated agents.
Use this document as the default operating manual for any agent (AI assistant, code generator, refactoring bot, CI helper) working in the repo.
If this file conflicts with any other repo document, follow the more specific rule (e.g., STYLEGUIDE.md for code style).
IdentityLifecycleEngine (IdLE) is a generic, headless, configuration-driven identity lifecycle orchestration engine (Joiner / Mover / Leaver) built for PowerShell 7+.
Core principles:
- Portable, modular, testable, highly configurable
- Plan → Execute separation (deterministic planning, repeatable execution)
- Workflow configuration is data-only (no script blocks / no dynamic expressions)
- Engine stays host-agnostic (no UI / no service-host coupling)
Authoritative docs:
README.md(high-level)docs/index.md(documentation entry point)docs/about/security.md(trust boundaries)docs/reference/capabilities.md(Capability rules)docs/extend/providers.md(Provider contracts)docs/extend/steps.md(Step metadata/capabilities usage)
- If something is unclear, ask targeted questions.
- Prefer a sensible default proposal, but explicitly label it as a default.
- Keep PRs focused: one issue / one theme.
- Avoid drive-by refactors unless the issue is specifically about refactoring.
- Minimal changes, no unrelated refactors.
- Prefer explicit validation and deterministic behavior.
- Avoid “magic” behavior, hidden fallbacks, or implicit global state.
Follow STYLEGUIDE.md for the full rule set. In short:
- PowerShell Core 7+
- Use approved PowerShell verbs (Verb-Noun)
- 4 spaces indentation, UTF-8, LF
- Public cmdlets require comment-based help (
.SYNOPSIS,.DESCRIPTION,.PARAMETER,.EXAMPLE,.OUTPUTS) - Inline comments should explain why, not what
- Keep a clean separation between Public and Private functions.
- Treat exported commands as stable contracts.
- Workflow definitions (PSD1) must be data-only:
- No
ScriptBlock - No dynamic PowerShell expressions
- No
- Validate early and fail with actionable errors.
The engine (IdLE.Core) must not depend on:
- UI frameworks
- interactive prompts
- service hosts / web servers
- Steps: convergence logic, idempotent intent, no authentication
- Providers: system adapters, handle authentication and external calls
- Steps should only write to declared
State.*outputs. - Authentication model (no prompting):
- Providers must not prompt interactively or implement ad-hoc login flows.
- Hosts MUST provide an
AuthSessionBroker, and steps/providers MUST acquire auth sessions viaContext.AcquireAuthSession(...)rather than receiving raw credentials directly. - Do not pass secrets or credential objects via provider options or workflow configuration; provider options must remain data-only (no ScriptBlocks, no executable objects).
- New work MUST use the IdLE. capability namespace (e.g., IdLE.Identity.Read, IdLE.Identity.Attribute.Ensure, IdLE.Entitlement.Grant).
- Do not introduce new un-namespaced capabilities (e.g., Identity.Read) in new modules.
- If legacy capability names exist, treat them as deprecated aliases and document migration behavior explicitly in the relevant issue/PR.
Use the single event contract:
Context.EventSink.WriteEvent(Type, Message, StepName, Data)- This is the runtime contract used by steps/providers through the execution context.
- External event sinks (host implementations) must follow the guidance in
docs/extend/events.md(object-based event payload), but the engine-facing API remainsContext.EventSink.WriteEvent(...).
Do not introduce alternative eventing APIs unless explicitly planned and documented.
Follow docs/develop/testing.md and CONTRIBUTING.md.
- Use Pester for tests.
- Unit tests must not call live systems.
- Provider implementations require provider contract tests.
- Providers should be tested against the existing provider contract test suites and must avoid live system dependencies in CI.
- If a provider wraps external cmdlets/APIs, introduce an internal adapter layer so unit tests can mock behavior without calling the real system.
PR rule: New behavior should include tests. Bug fixes must include a regression test.
- Keep docs short and linkable.
- Update docs when changing contracts, configuration schema, public cmdlets, step behavior, or provider contracts.
The cmdlet and step references under docs/reference/ are generated.
Do not edit generated files by hand—regenerate via the repository tools as documented in CONTRIBUTING.md.
Follow docs/about/security.md.
- Treat workflow definitions and lifecycle requests as untrusted inputs
- Reject executable objects in untrusted inputs (e.g., ScriptBlocks)
- Treat step registry, providers, and external event sinks as trusted extension points, but validate their shapes
- Authentication material (credentials/tokens) is considered secret input and must not be logged or emitted in events; redact at output boundaries as documented in
docs/about/security.md
Before proposing or finalizing a PR, ensure:
- Changes are scoped to a single issue/theme
- All tests pass (
Invoke-Pester -Path ./tests) - Public APIs have comment-based help
- Docs updated where needed (
README.md,docs/,examples/) - Generated docs regenerated if required (
docs/reference/*) - No concept or extensibility rules violated (
docs/about/concepts.md,docs/extend/extensibility.md) - No security boundary regressions (
docs/about/security.md) - Security vulnerabilities addressed (see
SECURITY.mdfor reporting)
If any guidance in this document conflicts with other repository documents:
- The more specific document takes precedence
- If the conflict is unclear, open an issue to resolve it
Document precedence (from most to least specific):
- Domain-specific docs (
docs/extend/*,docs/develop/*,docs/about/*) - Policy docs at repo root (
STYLEGUIDE.md,CONTRIBUTING.md,SECURITY.md) - This document (
AGENTS.md)
- General, cross-cutting agent rules →
AGENTS.md(repo root) - Code style details →
STYLEGUIDE.md - Contributor workflow and DoD →
CONTRIBUTING.md - Concept decisions →
docs/about/concepts.md - Extensibility decisions →
docs/extend/extensibility.md - Security boundaries →
docs/about/security.md - Testing guidance →
docs/develop/testing.md - Capability rules →
docs/reference/capabilities.md - Event patterns →
docs/extend/events.md - Provider contracts →
docs/extend/providers.md - Step metadata →
docs/extend/steps.md
Prefer:
- clarity over cleverness
- explicit validation over implicit behavior
- small PRs over large rewrites
- documentation + tests as part of the same change