Skip to content

Post-#259 cleanup: correct ContextResolver paths, Views, and attribute structure across docs and tests#262

Merged
blindzero merged 3 commits intomainfrom
copilot/cleanup-contextresolver-paths
Mar 13, 2026
Merged

Post-#259 cleanup: correct ContextResolver paths, Views, and attribute structure across docs and tests#262
blindzero merged 3 commits intomainfrom
copilot/cleanup-contextresolver-paths

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 13, 2026

Stale documentation and tests still referenced the superseded flat Request.Context.Identity.* path format and promoted Profile.DisplayName (top-level) instead of the correct post-#259 scoped model where attributes are nested under Profile.Attributes.*.

Documentation

  • conditions.md: Replaced all 14 occurrences of Request.Context.Identity.* with Request.Context.Views.*. Updated all profile attribute examples from Profile.DisplayNameProfile.Attributes.DisplayName. Added resolver path guidance to the Member-Access Enumeration section.
  • provider-mock.md, provider-ad.md, provider-entraID.md: Changed Writes to: Request.Context.Identity.* to the correct scoped-path + View format. Added explicit attribute nesting callout to each.
  • templates.md: Fixed typo (Request.*g → Request.*).

Tests

  • Test-IdleCondition.Tests.ps1: Updated 12 evaluation tests to use Request.Context.Views.* paths and Profile.Attributes.* context structure in their mock objects — previously they implied the flattened model.
  • resolver-profile-attribute-condition.psd1 (new fixture): Workflow fixture exercising profile attribute conditions via the Views path (Views.Identity.Profile.Attributes.Department).
  • New-IdlePlan.ContextResolvers.Tests.ps1: Three new tests covering:
    • Views.Identity.Profile.Attributes.* condition path marks step Planned when attribute matches
    • Same condition marks step NotApplicable when attribute doesn't match
    • Profile attributes are not promoted to top-level (accessing profile.DisplayName directly must fail; only profile.Attributes.DisplayName is valid)

Key path corrections

# Before (stale — implied superseded flattening model)
Condition = @{ Like = @{ Path = 'Request.Context.Identity.Profile.DisplayName'; Pattern = '* (Contractor)' } }
Condition = @{ Contains = @{ Path = 'Request.Context.Identity.Entitlements.Id'; Value = 'CN=...' } }

# After (post-#259 scoped model)
Condition = @{ Like = @{ Path = 'Request.Context.Views.Identity.Profile.Attributes.DisplayName'; Pattern = '* (Contractor)' } }
Condition = @{ Contains = @{ Path = 'Request.Context.Views.Identity.Entitlements.Id'; Value = 'CN=...' } }
Original prompt

This section details on the original issue you should resolve

<issue_title>Post-#259 cleanup for ContextResolver paths, Views, docs, and tests</issue_title>
<issue_description>## Problem Statement

PR #259 introduced the new ContextResolver architecture based on provider/auth-scoped source-of-truth paths, deterministic Views, and the execution-time Request.Context.Current alias.

This resolved the architectural direction, but follow-up cleanup is still needed to make the repository fully consistent.

At the moment, there is still a risk that some documentation, examples, troubleshooting guidance, comments, or tests may reflect older assumptions from the superseded flattening approach that was explored in PR #258. In particular, profile attribute access must be documented and tested consistently so workflow authors do not infer unsupported paths from outdated examples.

Without this cleanup, users may:

  • use legacy or incorrect path assumptions,
  • misunderstand the difference between scoped source-of-truth data and convenience Views,
  • misdiagnose condition/template failures when inspecting resolver output.

Proposed Solution

Perform a focused post-#259 consistency pass covering documentation, examples, troubleshooting, and tests.

Scope:

  1. Documentation consistency review

    • Review all ContextResolver-related docs and references.
    • Remove or correct any stale wording that implies the old flattening model.
    • Ensure the documentation consistently distinguishes:
      • source of truth:
        Request.Context.Providers.<ProviderAlias>.<AuthSessionKey>...
      • deterministic Views:
        Request.Context.Views...
      • execution-time alias:
        Request.Context.Current...
  2. Correct profile attribute consumption examples

    • Review all examples using identity profile values.
    • Ensure examples use the actually supported path shape.
    • Explicitly document that workflow authors must not assume that convenience Views are raw mirrors of one scoped resolver output.
  3. Troubleshooting improvements

    • Add a focused troubleshooting section for debugging ContextResolver output.
    • Document the recommended inspection/debugging approach, including:
      • dumping relevant context fragments with ConvertTo-Json,
      • checking scoped provider/auth paths first,
      • then checking the derived View,
      • understanding deterministic ordering / effective last-writer-wins selection for profile Views.
    • Explain why a View may differ from one specific scoped source path.
  4. Test coverage review

    • Review existing tests for stale flattening expectations.
    • Add/adjust tests that verify:
      • supported profile attribute access paths,
      • deterministic View behavior,
      • examples/fixtures match the documented model,
      • no regressions around template substitution and condition-path validation.
  5. Example workflow review

Alternatives Considered

  1. Reopen or continue PR Remove attribute flattening to align with scoped ContextResolver model (breaking change) #258

  2. Continue tracking this under bug ContextResolver Identity.Read values not working in EnsureOutOfOffice template substitution #254

  3. Do nothing

    • Rejected because stale examples or mixed guidance would continue to create author confusion and increase the risk of future regressions.

Impact

Additional Context

Step-0 guidance / acceptance focus:

  • First validate the current repository state and identify every remaining place that still suggests or tests the superseded flattening model.
  • Treat PR ContextResolvers: Provider/Auth-scoped namespace, deterministic Views, Current alias #259 as the architectural source of truth.
  • Prefer root-cause consistency fixes over local wording-only patches.
  • Update documentation, examples, inline comments, and tests together so the repository stays aligned.
  • Include explicit troubleshooting guidance for inspecting resolver output a...

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Copilot AI changed the title [WIP] [#259] Cleanup ContextResolver paths, Views, docs, and tests Post-#259 cleanup: correct ContextResolver paths, Views, and attribute structure across docs and tests Mar 13, 2026
Copilot AI requested a review from blindzero March 13, 2026 20:02
@github-actions
Copy link
Copy Markdown

Code Coverage Report

Overall Project 74.79% 🍏

There is no coverage information present for the Files changed

@blindzero blindzero marked this pull request as ready for review March 13, 2026 20:12
Copilot AI review requested due to automatic review settings March 13, 2026 20:12
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.

Reviewed commit: 84d9d84872

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns IdLE’s documentation and test suite with the post-#259 ContextResolver model: scoped source-of-truth paths under Request.Context.Providers.*, deterministic aggregated Request.Context.Views.*, and profile attributes nested under Profile.Attributes.*.

Changes:

  • Updated workflow condition documentation/examples to use Request.Context.Views.* and Profile.Attributes.* paths.
  • Updated provider reference docs to describe scoped output paths + engine-defined Views, and clarified attribute nesting.
  • Updated/added Pester tests and a new workflow fixture to exercise profile-attribute conditions via Views/scoped paths.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/fixtures/workflows/resolver-profile-attribute-condition.psd1 New workflow fixture validating profile attribute conditions via Views and scoped paths
tests/Core/Test-IdleCondition.Tests.ps1 Updates evaluator tests to use Request.Context.Views.* and nested Profile.Attributes.*
tests/Core/New-IdlePlan.ContextResolvers.Tests.ps1 Adds tests for Views-based profile attribute conditions and non-promotion of attributes
docs/use/workflows/templates.md Fixes a small typo in the template substitution description
docs/use/workflows/conditions.md Updates DSL examples and member-access enumeration guidance to use Views/scoped paths
docs/reference/providers/provider-mock.md Updates provider reference to document scoped writes + Views and attribute nesting
docs/reference/providers/provider-entraID.md Updates provider reference to document scoped writes + Views and attribute nesting
docs/reference/providers/provider-ad.md Updates provider reference to document scoped writes + Views and attribute nesting

Repository owner deleted a comment from chatgpt-codex-connector bot Mar 13, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI requested a review from blindzero March 13, 2026 20:23
@blindzero blindzero merged commit 23b978c into main Mar 13, 2026
8 checks passed
@blindzero blindzero deleted the copilot/cleanup-contextresolver-paths branch March 22, 2026 16:22
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.

Post-#259 cleanup for ContextResolver paths, Views, docs, and tests

3 participants