Skip to content

fix: disclose gallery PlanOnly synchronization job writes - #288

Merged
pranems merged 1 commit into
masterfrom
vprane/scimserver/containers-gallery-plan-contract-20261124
Nov 24, 2026
Merged

pranems merged 1 commit into
masterfrom
vprane/scimserver/containers-gallery-plan-contract-20261124

Conversation

@pranems

@pranems pranems commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

Disclose that gallery -PlanOnly creates an owned temporary synchronization
job, warn before the existing POST, and align CLI help, result wording and
skill guidance with the actual side-effect and cleanup boundary.

Exact reviewed tip: 818f922700aeb0f1d85de54e8eafcfc053282529.
Base: dbe17d379d57daf6ea6ae33184574fa722d7984f.
This is one CLI/operator classification rollback unit, not a SCIM application
feature. No authentication, provisioning, cleanup, flag, app version,
dependency lock or web behavior changed.

Linked Defect / Plan Reference

  • DELIVERY_PLAN.md defect ID: N/A; bounded gallery plan classification correction.
  • Audit doc reference: docs/ENTRA_GALLERY_SCIM_E2E_EXECUTION_RCA.md, GM-I28 and GM-I29; docs/strategy/ENGINEERING_LESSONS_AND_PATTERNS.md, safe-mode names.
  • ADR (if applicable): N/A; existing control flow retained.

TDD Process

  • RED test written first; observed it fail for the expected reason
  • GREEN: minimal implementation that turns the test green
  • Refactor (if any) keeps the test green
  • Permanent regression guard added (where applicable - see existing patterns in api/src/security/)

The preserved original 92 offline gallery contracts plus four new
actual-source controls total 96 passing assertions. Three real RED failures
preceded the minimal correction. The actual AST branch and job creator run
under safe Graph mocks, proving the POST arguments, ownership registration,
schema ordering and warning-before-mutation order.

Feature / Bug-Fix Commit Checklist (standing rule)

Every behavioral change must include all that apply. Tick or strike through with N/A + reason.

  • Unit Tests - service-level and controller-level coverage of the new behavior. N/A to application services/controllers; actual CLI-source contracts cover this warning and guidance.
  • E2E Tests - end-to-end spec under api/test/e2e/ exercising the feature through HTTP. N/A to changed behavior; no application HTTP contract changed. Existing API suite runs in the normal hook.
  • Live Integration Tests - new section in scripts/live-test.ps1 runnable against local + Docker + Azure. N/A; no live behavior changed, and real cloud/Graph runs are explicitly outside this consolidation.
  • Feature Documentation - dedicated doc in docs/ with architecture, RFC references, Mermaid diagrams, test coverage. Existing feature RCA, skill and central pattern updated; no new diagram or feature design required.
  • INDEX.md Update - add the new doc reference to docs/INDEX.md. N/A; no new feature document.
  • CHANGELOG.md Update - [Unreleased] entry with full test counts and feature summary. N/A; no application release/version change; scoped correction and focused counts are in the existing RCA/session context.
  • Session & Context Updates - Session_starter.md and docs/CONTEXT_INSTRUCTIONS.md. Session starter updated; general application context unchanged, with its existing freshness gate passing.
  • Version Management - bump api/package.json (and any other version refs) when behavior changed. N/A; operator warning/guidance only, no application version or lock changes.
  • Response Contract Tests - API responses contain ONLY documented fields (key allowlist assertion at unit + E2E + live). N/A; no API response changed.

Validation Output

Focused gallery contracts: 96 pass, including all 92 original assertions
RED evidence: 3 expected assertion failures before the correction
Normal PREPUSH_MODE=Validate explicit-ref push: PASS, 32/32 gates, git exit 0
Hook duration: 1356.7 seconds
API unit: 6274 pass, 220 suites
API E2E: 2519 pass, 120 suites; 45 tests / 4 suites skipped by unchanged suite definitions
Web vitest: 1664 pass, 126 files
API ESLint: 0 errors, 507 warnings
API build / web tsc / web production build: PASS
Mermaid: 831 blocks rendered in both themes with strict security
Earlier customization contracts: PASS
Earlier patterns-pie gate: PASS, 41 documented patterns
Earlier doc freshness: PASS, 29 docs
PowerShell parsing/help/whitespace: PASS in original focused evidence
Edited literal JSON blocks: 0
Changed Mermaid diagrams: 0
Actual Graph/cloud/auth/container/bridge/gallery run: NOT RUN

Commands and results:

  • pwsh -NoProfile -File scripts\test\entra-gallery-scim-e2e.contract.ps1: PASS, 96 assertions, preserved focused evidence.
  • pwsh -NoProfile -File scripts\test\copilot-customizations.contract.ps1 -GitTree Head: PASS in original evidence; also owned by the normal hook.
  • node scripts/check-patterns-pie.mjs: PASS, 41 patterns in original evidence; also owned by the hook.
  • pwsh -NoProfile -File scripts\audit-doc-freshness.ps1: PASS, 29 docs in original evidence; hook owns its applicable invocation.
  • $env:PREPUSH_MODE='Validate'; $env:DATABASE_URL='postgresql://localhost:1/scim_consolidation_inert'; git push --set-upstream origin HEAD:refs/heads/vprane/scimserver/containers-gallery-plan-contract-20261124: PASS, 32/32 unchanged gates, native git exit 0.
  • Hook-owned npm test in api: PASS, 6274 tests / 220 suites.
  • Hook-owned npm run test:e2e -- --maxWorkers=2 --testPathIgnorePatterns 'endpoint-scoped-logs.e2e-spec.ts' --testPathIgnorePatterns 'log-config.e2e-spec.ts' in api: PASS, 2519 tests / 120 suites; 45 tests and four suites skipped by unchanged definitions, no selector relaxed.
  • Hook-owned npm test in web: PASS, 1664 tests / 126 files.
  • Hook-owned npx prisma generate and npx ts-node --transpile-only src/scripts/lint-migrations.ts: PASS; no database connection or migration replay.

Bootstrap failures are retained, not waived: attempt 01 failed because local
tsc was missing (gate exit 1, git exit 1). After permitted owned root/API/web
npm ci restores with the approved proxy, all three locks were byte-identical.
Attempt 02 failed because the Prisma client was not generated (133 cascading
TypeScript diagnostics, gate exit 2, git exit 1). Existing
npm run prisma:generate passed with an inert loopback datasource, without
database connection or migration. Attempt 03 passed 29 gates but failed
hook-owned generation because the process-local datasource did not carry
into the next shell (gate exit 1, git exit 1). Attempt 04 set that inert value
in the push process and passed all 32 gates without source changes.

The hook touched one snapshot's line endings only. Before restoring that
owned modification, Git-normalized working bytes and the HEAD blob both
matched ba99a782f3e5cbde38d184d517d8fb0ca8a5e2f2. No visual baseline
regeneration or content change was made. Final tracked worktree is clean,
and upstream plus remote destination both equal the exact reviewed full tip.

Local receipts: test-results/gallery-plan-contract/contract-red.txt,
contract-green.txt, push-validate-01.txt, push-validate-02.txt,
push-validate-03.txt, push-validate-04.txt, and consolidation-ledger.md.
These ignored local receipts are not claimed to be uploaded PR artifacts.

Recorded exact-tip owner COMMENTED source/self-review:
review 6043757896,
submitted 2026-11-24T17:00:44Z by pranems. It is not independent approval.

One natural CI snapshot after that review observed three PR-triggered runs,
all at 818f922700aeb0f1d85de54e8eafcfc053282529:

Workflow run State at snapshot Check states at snapshot
Build Test Image 45443690452 in_progress runtime-contracts and validate: in_progress
CodeQL 45443690633 in_progress Analyze (javascript-typescript): in_progress
Docs freshness 45443690728 in_progress freshness: in_progress

No returned check is yet a completed pass. The required build-and-push
check was not yet present in the returned population. PR state is OPEN,
mergeStateStatus BLOCKED. This snapshot is not a CI-complete claim.
No further polling, workflow dispatch, quota retry or merge is performed.
The local structured receipt is
test-results/gallery-plan-contract/ci-snapshot.json.

Standing Rules Acknowledgment

  • No em-dash (Unicode U+2014) anywhere in the diff. Verified via Select-String -Pattern ([char]0x2014).
  • No git commit --amend on history that has been pushed.
  • No new credentials, tokens, or secrets committed to source. Forbidden patterns regression spec at api/src/security/forbidden-source-patterns.spec.ts will catch known anti-patterns.
  • Migrations are additive-only (expand-contract for column changes). Migration linter at api/src/scripts/lint-migrations.ts enforces this. N/A; no migration changed.

Destructive Migration Override (skip if not applicable)

  • This PR contains a NEW destructive Prisma migration (DROP TABLE/COLUMN, ALTER COLUMN ... TYPE, RENAME, INSERT ... SELECT FROM)
  • I have set ALLOW_DESTRUCTIVE_MIGRATION=1 in the CI environment for this PR
  • Justification (required if box above is ticked):
    <!-- Why this destructive change is necessary, what the rollback path is, and which release window it ships in -->
    N/A: no migration or override.
    

Reviewer Hint

Diff areas worth special attention from the reviewer:

  • scripts/entra-gallery-scim-e2e.ps1: the warning must precede the existing
    plan-only POST. Default finally cleanup deletes/verifies the owned job;
    KeepArtifacts retains it and records cleanup failure.
  • scripts/test/entra-gallery-scim-e2e.contract.ps1: bounded mocks execute
    actual source, rather than a copied implementation.
  • .github/skills/entra-gallery-scim-e2e/SKILL.md: no-write preparation must
    not prescribe this executable, including PlanOnly.
  • Source/self-review is recorded as owner COMMENTED, not independent approval.
    Additional Copilot review is not retried after the previous quota denial.
  • Test improvement: applied by the four actual-source controls.
    Design disposition: accepted; cohesive existing control flow, no
    speculative abstraction.
  • Original migration remains incomplete: approved mirror/import permissions,
    immutable merged-master image, authoritative matrix and deployment approval
    are unresolved. This PR is not shipping or migration proof.
  • DO NOT MERGE as part of this bounded consolidation. No dispatch, auto-merge,
    admin override or deployment is requested.

Preserve the schema-probe and cleanup behavior while warning before directory mutation and distinguishing the flag from read-only intake. Retain all original contracts and record the confirmed safety-classification escape.

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

@pranems pranems left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Recorded owner source/self-review of exact tip
818f922700aeb0f1d85de54e8eafcfc053282529, against merged base
dbe17d379d57daf6ea6ae33184574fa722d7984f.

Reviewed all six changed files. No blocking source finding.

  • New-SynchronizationJob (scripts/entra-gallery-scim-e2e.ps1:208)
    still POSTs the isvonboarding template and registers the returned job ID.
  • The actual if ($PlanOnly) branch (:1362) now warns at :1363
    before invoking that creator. No directory, auth, provisioning or cleanup
    operation has been added or removed.
  • The existing top-level finally (:1391) still invokes
    Remove-OwnedArtifacts; failure accounting and environment restoration
    remain intact. Help and skill correctly distinguish no-write preparation
    from this non-provisioning but directory-mutating schema probe.
  • Actual-source contract assertions (scripts/test/entra-gallery-scim-e2e.contract.ps1:200
    and :204) verify the real mocked POST/ownership/schema sequence and
    warning order. All 92 original contracts remain, with four added controls
    and three observed RED failures before 96 GREEN.
  • Session/RCA/pattern documentation retains original migration and
    authoritative merged-runtime qualification blockers.

This is an owner COMMENTED review, not independent reviewer approval.
Branch protection has no configured required independent approval count.
The additional quota-denied Copilot review route from PR #287 was not retried
and is not claimed complete.

Test improvement: applied in the four permanent actual-source controls;
no additional consolidation gap requiring source changes was found.
Design disposition: accepted; one cohesive warning/guidance correction,
with no new coupling, strategy cascade or speculative abstraction.

Exact-tip CI status is recorded separately. Pending CI is not a pass.
No merge, dispatch, deployment or completed-migration claim is authorized.

@pranems
pranems merged commit f8c2ce1 into master Nov 24, 2026
6 checks passed
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