Skip to content

Add plan export as JSON contract#39

Merged
blindzero merged 15 commits into
mainfrom
issues/9-Plan-export-as-JSON---machine-readable-plan-artifact
Jan 1, 2026
Merged

Add plan export as JSON contract#39
blindzero merged 15 commits into
mainfrom
issues/9-Plan-export-as-JSON---machine-readable-plan-artifact

Conversation

@blindzero
Copy link
Copy Markdown
Owner

@blindzero blindzero commented Dec 31, 2025

This PR introduces a canonical, deterministic JSON export for IdLE lifecycle plans.
The exported artifact is a stable contract intended for approvals, auditing, CI checks, and host integrations.

Scope

  • Implements a plan export that is explicitly not an internal object dump
  • Freezes the exported shape via a formal specification
  • Adds contract tests to prevent accidental breaking changes

What’s included

New functionality

  • Export-IdlePlanObject (IdLE.Core): Core implementation that maps an internal LifecyclePlan to the canonical export DTO.
  • Export-IdlePlan (IdLE meta module): User-facing wrapper for exporting plans as JSON (string or file).

Contract specification

  • docs/specs/plan-export.md
    • Normative JSON schema definition
    • Explicit versioning via schemaVersion
    • Clear separation between contract data and engine internals

Tests

  • Golden / snapshot test to lock the JSON contract
  • Fixture-based expected output under tests/fixtures/plan-export/expected/
  • File-output test using TestDrive: (no repo pollution)
  • Uses the existing _testHelpers.ps1 consistently

Design decisions (intentional)

  • Deterministic output
    • No timestamps in the exported plan
    • No engine.version field (avoids noise on version bumps)
    • Empty strings normalized to null
  • Clear responsibility split
    • Core: contract mapping (Export-IdlePlanObject)
    • Meta module: UX wrapper (Export-IdlePlan)
  • Contract-first
    • Compatibility is tracked via schemaVersion
    • Internal plan shape can evolve without breaking exports

Example

$plan | Export-IdlePlan
$plan | Export-IdlePlan -Path ./artifacts/plan.json

Issues

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ 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".

Comment thread src/IdLE.Core/Private/ConvertTo-IdlePlanExportObject.ps1
@blindzero blindzero merged commit d27c0f8 into main Jan 1, 2026
4 checks passed
@blindzero blindzero deleted the issues/9-Plan-export-as-JSON---machine-readable-plan-artifact branch January 1, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plan export as JSON - machine-readable plan artifact

1 participant