Conversation
…d Request.Context - Add Limit-IdleSnapshotField helper and per-field 64 KB size limits in ConvertTo-IdlePlanExportObject; oversized identityKeys/intent/context fields are replaced with a deterministic [TRUNCATED - N bytes] marker - Add tests/Core/RequestSnapshot.Tests.ps1: 10 tests covering Intent/Context inclusion, ScriptBlock redaction at export boundary, and size limit behaviour - Update docs/reference/specs/plan-export.md: fix desiredState → intent/context, add input sub-fields table, add Safety rules section (secrets, ScriptBlocks, size)" 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: b095ed3a3c
ℹ️ 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 implements a deterministic RequestSnapshot export contract for plan artifacts, ensuring they are auditable and safe to store/share. It adds Intent and Context inclusion, secret redaction, ScriptBlock prevention, and 64 KB per-field size limits to the plan export pipeline.
Changes:
- Added per-field size enforcement (64 KB UTF-8 limit) with deterministic truncation markers for
identityKeys,intent, andcontextin request.input - Created comprehensive test suite (10 tests) covering Intent/Context inclusion, ScriptBlock redaction at export boundary, and size limit behavior
- Updated plan export specification documentation with input sub-fields table and detailed safety rules
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/IdLE.Core/Private/ConvertTo-IdlePlanExportObject.ps1 |
Added Limit-IdleSnapshotField helper function and applied per-field size limits after redaction for identityKeys, intent, and context |
tests/Core/RequestSnapshot.Tests.ps1 |
New test file with 10 tests covering Intent/Context export, ScriptBlock redaction, and size limit enforcement |
docs/reference/specs/plan-export.md |
Updated to document input sub-fields (identityKeys, intent, context) and added comprehensive safety rules section covering redaction, type prevention, and size limits |
The per-field 64 KB truncation was only applied when request.input was an IDictionary. When Copy-IdleRedactedObject returns a PSCustomObject (e.g. caller provided Request.Input as a PSCustomObject / deserialized JSON), the size check was silently skipped and fields could be exported unbounded. Fix: check PSObject.Properties when input is not an IDictionary. Add regression test covering the PSCustomObject path. Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Code Coverage Report
|
ConvertTo-IdlePlanExportObject.ps1(64 KB per field; deterministic truncation marker[TRUNCATED - N bytes])request.input(not only IDictionary) — addresses review feedbacktests/Core/RequestSnapshot.Tests.ps1with 11 explicit tests for Intent, Context, ScriptBlock redaction at export boundary, and size limits (including PSCustomObject path)docs/reference/specs/plan-export.md: fixdesiredState→intent/context; addinput sub-fieldstable; add Safety rules section (secrets, ScriptBlocks, size limits)Original prompt
💡 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.