Skip to content

Audit Compliance v3 directives and regenerate both API profiles - #3842

Closed
Ramses Sanchez-Hernandez (ramsessanchez) wants to merge 15 commits into
powershell-v3from
ramsessanchez-compliance-v3-migration
Closed

Ramses Sanchez-Hernandez (ramsessanchez) wants to merge 15 commits into
powershell-v3from
ramsessanchez-compliance-v3-migration

Conversation

@ramsessanchez

@ramsessanchez Ramses Sanchez-Hernandez (ramsessanchez) commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

N/A

Changes proposed in this pull request

The Compliance pilot referenced nested eDiscovery dataSource operations absent from both compatible specs. This reconciles the shared directive audit without inventing APIs, retains dormant suppression/structural naming semantics, and regenerates both profiles against the normally merged v3 framework. Current validation also proves the user-directed #3886 contract: PATCH returns only its own response and never performs a hidden GET.

  • Audit only src/Compliance/Compliance.md. Both shared directives have reviewed expected absence in v1.0 and beta. Keep active AutoRest directives, dormant exact PATCH/DELETE suppressions, and structural naming for the retired GET. No redundant renames or route groups are introduced.
  • Preserve complete original same-profile lineage: original v1.0 selects none; original beta selects exactly nested GET/PATCH/DELETE dataSource, all deprecated with removal date 2023-02-01. None survives in its same-profile compatible spec. Parent-item operations are distinct neighbors, not numbered variants. No expired API is restored.
  • Ignore global and all profile-local readme directives. Parameter aliases/transforms/schema classes remain deferred; none occur in this shared file. Both profiles are required, no exclusions. No authored global generator/Auth/runtime/other-owner changes. PowerShell 7/Core only; no Desktop 5.1 acceptance claim.

Current target, history, and generated outputs

Normal target: 6475f3f5beb4908d39ea356db32bf1e0fd3273cb (#3886), integrated through normal merge 6153c090224944a3bd112375aadbf54bd5500203. Current pushed PR head: 0406c92ef294a3987a6524a1912b9641252fc76e.

Prior publication e88678e7ea and all original source/profile commits remain ancestors. New source/audit regression: 7df094f5cc; separate combined full-generation commits: v1.0 ae06280f51, beta 0406c92ef2. No rebase, squash, amendment, cherry-pick, or force-push. Clients, projects, and locks were genuinely regenerated and are byte-identical; each profile's cmdlet delta removes automatic PATCH readback and reflects the current GET emitter. Normal manifests require Authentication 2.41.2 without dependency preloads; each bin carries only its three owned client/runtime/module DLLs. No bin/obj, binaries, packages, or session artifacts are committed.

Current acceptance results

Gate v1.0 beta
Full queued Kiota/cmdlet Release build Exit 0, OK, 2 exports, 379.5 seconds Exit 0, OK, 2 exports, 141.2 seconds
Supplemental nonincremental compiled refresh Exit 0 Exit 0
Fresh normal-manifest/actual Auth factory, Global and USGov Both pass, 11 offline HTTP requests and 1 declined prompt per process Both pass, same counts; actual /beta on correct cloud host
Actual post-import datastore checks 26 reflected MockDataStore checks per process 26 reflected MockDataStore checks per process
Raw name parity 2/2, exit 0 0/2, exit 1, unchanged Mg/MgBeta prefix limitation

Actual targeted TRX: 168 total/executed/passed, 0 failed/not-executed (Compliance/configurator/naming/required-query/PATCH operation tests). Ordinary strict inventory: 2 Mapped, zero unresolved/invalid/unreviewed candidates. Both final full pipelines ran sequentially v1.0 then beta after final authored changes. No SkipKiota, GenerateOnly, NoCollisionData, or legacy fallback was used.

Four fresh compiled probes verify 44 total authenticated offline requests, four genuine declined confirmation prompts, zero live Graph/OAuth calls, exact Get-MgCompliance GET and Update-MgCompliance PATCH /compliance exports, no retired/grouped routes, and normal single Auth/Kiota identities/load contexts. The actual GraphHttpClientFactory token pipeline retains its global /v1.0/ BaseAddress while generated beta/USGov requests use the correct service root; it is not replaced by a bare marker client.

Positive PATCH acceptance is new, not an old failure relabeled: PATCH204 sends exactly one PATCH, returns no object, and succeeds while sibling GET rejects 403. PATCH200 sends exactly one PATCH and returns the actual typed Compliance response. Both forward headers and empty typed JSON without inventing expanded public body fields. A caller-explicit GET independently selects its query/headers/result or 403 error. No PassThru/ReadBack/Refetch switch or GET-only PATCH inputs are added. Root Compliance has no surviving required query operations. Existing GET select/expand/header binding, invalid binding before HTTP, WhatIf/declined Confirm zero HTTP, cache/root isolation, request-context/reconnect/disconnect, and metadata/3-DLL ownership checks pass.

Runtime isolation correction and preserved historical evidence

The confirmation runspace imports normally before initial Connect/transport. The existing Set-MgTestDataStore helper is then reapplied after the final import. Every transport/lifecycle/logout checkpoint reflects the actual shared GraphSession.DataStore.GetType().FullName and requires Microsoft.Graph.Authentication.Test.Mocks.MockDataStore. Each proof records 26 actual checks, stages, fixture source/hash, and assembly/manifest hashes. No production/Auth changes, global settings, dependency preloads, or load-context shims were used.

The new memory-guarded proof root is post3886-6475-memory-final; old unguarded runtime artifacts remain untouched and are not claimed as newly guarded. The original successful full-build/TRX/source/generation artifacts in post3886-6475-final remain valid, with absolute references and hashes in the new canonical handoff.json. No source, FULL, or TRX rerun was performed for this probe-only correction. Earlier 844672 implicit-GET header failures remain historical: the user-superseded readback contract is no longer a current failure gate.

Remaining baseline limits

  • Raw beta parity is still 0/2 solely because the shared generator emits Mg while the oracle uses MgBeta. No normalization or naming workaround claims a pass.
  • The optional shared synthetic inventory test still fails line 67 because it copies this expected-absence ledger into a fixture that requires historical beta PATCH/DELETE mappings. Its raw exit 1/log are retained separately; ordinary strict inventory and the 168 targeted tests pass. No unrelated shared fixture fix or waiver is introduced.
  • Offline response tests prove generated behavior, not live-tenant API validity. No Fix Kiota PostPath typed navigation without renaming operation types #3881 overlay or [v3 wrappers] Support arbitrary optional query parameters #3897 optional-query change is included.

Exact commands and retained results

$buildEvidence = 'C:\Users\ramsess\.copilot\session-state\7680302b-9e91-44f8-be6c-2ddd60000716\files\post3886-6475-final'
$runtimeEvidence = 'C:\Users\ramsess\.copilot\session-state\7680302b-9e91-44f8-be6c-2ddd60000716\files\post3886-6475-memory-final'
$env:PATH = 'C:\Users\ramsess\.copilot\session-state\871a5292-dc5b-423e-8083-5165b0006603\files\tools\kiota;' + $env:PATH
$env:KIOTA_Generation__MaxDegreeOfParallelism = '1'
$env:PSModulePath = 'C:\Users\ramsess\.copilot\session-state\4aa86cf9-d43c-4d2b-a4a3-aeaed01b8f29\files\authentication-v2-sync\final-source\modules;C:\Users\ramsess\OneDrive - Microsoft\Documents\PowerShell\Modules;C:\Program Files\PowerShell\Modules;C:\Program Files\PowerShell\7\Modules'

dotnet build .\tools\WrapperGenerator.Tests\WrapperGenerator.Tests.csproj --no-incremental --verbosity minimal
# Passed, exit 0.
dotnet test .\tools\WrapperGenerator.Tests\WrapperGenerator.Tests.csproj --no-build --filter 'FullyQualifiedName~ComplianceDirectiveMigrationTests|FullyQualifiedName~CmdletConfiguratorTests|FullyQualifiedName~NamingTests|FullyQualifiedName~RequiredQueryTests|FullyQualifiedName~PatchOperationTests' --logger 'trx;LogFileName=targeted.trx' --results-directory $buildEvidence --verbosity normal
# Passed, exit 0: 168 executed/passed; 0 failed/skipped.
pwsh -NoProfile -NonInteractive -File .\tools\Get-WrapperDirectiveMigrationInventory.ps1 -Module Compliance -AsJson -FailOnUnresolved -OutputPath "$buildEvidence\strict-inventory.json"
# Passed, exit 0: 2 Mapped.
pwsh -NoProfile -NonInteractive -File .\tools\Test-WrapperDirectiveMigrationInventory.ps1
# Optional baseline failure, exit 1 at line 67; raw log preserved.

pwsh -NoProfile -NonInteractive -File 'C:\Users\ramsess\.copilot\session-state\871a5292-dc5b-423e-8083-5165b0006603\files\Invoke-QueuedModuleBuild.ps1' -RepoRoot (Get-Location).Path -Module Compliance -ApiVersion v1.0 -Configuration Release
# Passed: exit 0, OK, 2 exports, 379.5 seconds.
dotnet build .\src\Compliance\wrapper\v1.0\Microsoft.Graph.Wrapper.Compliance.csproj -c Release --no-incremental --nologo --verbosity minimal
# Passed, exit 0.
pwsh -NoProfile -NonInteractive -File 'C:\Users\ramsess\.copilot\session-state\871a5292-dc5b-423e-8083-5165b0006603\files\Invoke-QueuedModuleBuild.ps1' -RepoRoot (Get-Location).Path -Module Compliance -ApiVersion beta -Configuration Release
# Passed after v1.0: exit 0, OK, 2 exports, 141.2 seconds.
dotnet build .\src\Compliance\wrapper\beta\Microsoft.Graph.Wrapper.Compliance.csproj -c Release --no-incremental --nologo --verbosity minimal
# Passed, exit 0.

pwsh -NoProfile -NonInteractive -File "$runtimeEvidence\Invoke-CompiledProofs.ps1" -RepoRoot (Get-Location).Path -Profile v1.0
pwsh -NoProfile -NonInteractive -File "$runtimeEvidence\Invoke-CompiledProofs.ps1" -RepoRoot (Get-Location).Path -Profile beta
# Both passed, exit 0; each runs fresh Global/USGov Test-ComplianceFinalTransport.ps1
# and records exact child commands/exits. Four processes: 44 requests, 4 declined
# prompts, 104 actual post-import MockDataStore checks, no live Graph calls.

pwsh -NoProfile -NonInteractive -File .\tools\Compare-WrapperCmdletNames.ps1 -GeneratedPath '.\src\Compliance\wrapper\v1.0\Cmdlets' -OutLedger "$runtimeEvidence\raw-parity-v1.0.json"
# Passed: 2/2, exit 0.
pwsh -NoProfile -NonInteractive -File .\tools\Compare-WrapperCmdletNames.ps1 -GeneratedPath '.\src\Compliance\wrapper\beta\Cmdlets' -OutLedger "$runtimeEvidence\raw-parity-beta.json"
# Baseline prefix mismatch: 0/2, exit 1.

Kiota 1.36.1+fd3bf87790149b87f40f7eae1a5feb9016625943, .NET 10.0.403, PowerShell 7.6.9. Verified adapted normal Authentication 2.41.2 all 64 file SHA256s and physical nupkg SHA256 2FC09BFE6B70D313BC56DF8ADCCFB1976FB4E90A1898BF8A916B4B8B792898EB; no stock gallery/old 2.38 package.

Current compatible-spec blobs: v1.0 31064dc0edea9597e66f0e9e30aaa271a8990eba, beta 219ed1b31d134f57bcbde55e7e02361ed599fb29. Original-source blobs: v1.0 c684bccc4da19c2469703cd42473ac1ea380b648, beta d9ead892c982b360e557ed3e11613675de368717. Canonical $runtimeEvidence\handoff.json retains scalar counters, full Git scope, current head/history, absolute valid build/TRX/strict paths, memory-guarded HTTP/assembly captures, exact commands/exits, and SHA256 artifacts; older target/candidate reports remain separate.

Other links

Record retired eDiscovery operation coverage as expected absence in both profiles while retaining dormant exact suppressions and structural naming semantics. Add real-spec and neighboring-route regressions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Run the full Release pipeline with Kiota 1.36.1 against the current compatible specification. Remove stale privacy/eDiscovery sources absent from that specification; compiled output exports the two current root cmdlets. Generated projects remain byte-identical.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Create the previously absent beta client, cmdlets, generated projects and lock files with the full Kiota 1.36.1 Release pipeline. Build/import exports two current root operations. Existing shared generator Mg prefix differs from the beta oracle; no module-specific workaround applied.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Refresh aligned operation IDs and original/compatible spec hashes after #3849. Prove complete same-profile original selections have no compatible survivors, and exercise naming, suppression and full-spec emission with explicit runtime profiles and derived data on/off.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Queued full Kiota and cmdlet Release pipeline passed on 08e409a: OK, two cmdlets, 81 seconds. Fresh original Authentication 2.38.1 import, exact compiled GET/PATCH routes, WhatIf and raw 2/2 parity passed. Only the Kiota specification hash changed; generated client/cmdlet source and projects are byte-identical.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Queued full Kiota and cmdlet Release pipeline passed on 08e409a: OK, two cmdlets, 136.5 seconds. Fresh original Authentication 2.38.1 import, exact compiled GET/PATCH routes and mutation WhatIf passed. Refresh the current beta model closure and specification hash; cmdlets/projects remain unchanged. Raw beta parity retains the known Mg versus MgBeta prefix mismatch (0/2).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Refresh the current normally merged source audit and assert explicit v1.0/beta GetRequestAdapter calls in both generated root operations. Preserve retired directive coverage and unchanged source selections.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Queued full Kiota/cmdlet Release build succeeds with Authentication 2.41.2 and explicit v1.0 service root. Regenerate module project pruning and cmdlet calls; client and locks are identical. Normal manifest imports carry only three owned DLLs. Real authenticated offline GET/query/PATCH-204-refetch/typed-result and mutation safety gates pass. Preserve raw bound generic refetch-header failure for unmerged #3886.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Queued full Kiota/cmdlet Release build succeeds with Authentication 2.41.2 and explicit beta service root. Regenerate module project pruning and cmdlet calls; client and locks are identical. Normal manifests import only three owned DLLs. Real authenticated offline GET/query/PATCH/refetch results retain beta and cloud roots despite factory v1 BaseAddress. Keep documented raw beta prefix and unmerged #3886 bound refetch-Headers failures.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Refresh final normally merged audit and prove generated PATCH retains native inputs/output metadata, explicit service profile, and no implicit GetAsync. Preserve empty compatible selection and dormant shared directive semantics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full queued Kiota/cmdlet Release build and nonincremental refresh pass on final 6475 target. Fresh Global/USGov real authenticated probes each pass 11 requests: PATCH204 no output/one PATCH/no GET with GET403, PATCH200 actual typed result/one PATCH, caller-explicit GET, headers/query/safety and session lifecycle. Remove automatic readback; client/projects/locks remain byte-identical.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full queued Kiota/cmdlet Release build and supplemental nonincremental refresh succeed on final6475 target with two exported cmdlets. Regenerate current root GET/PATCH including removal of automatic readback; client/projects/locks remain byte-identical. Preserve beta service-root context and original source directive audit.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@ramsessanchez

Copy link
Copy Markdown
Contributor Author

Compliance Module will be removed for V3

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.

1 participant