Skip to content

fix(live): preserve evidence shape and owned cleanup while reusing redaction plans - #285

Merged
pranems merged 2 commits into
masterfrom
vprane/scimserver/containers-live-evidence-performance-20261123
Nov 23, 2026
Merged

pranems merged 2 commits into
masterfrom
vprane/scimserver/containers-live-evidence-performance-20261123

Conversation

@pranems

@pranems pranems commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Reuse prepared live-evidence redaction plans while preserving JSON shape, actual HTTP responses, discovered material and exact owned-endpoint cleanup.

This is a live-harness-only rollback unit based on merged application source c52de06fc88ab046793d6fdd478671cdb98028a5, version 0.55.70. No application, package, token-lifetime, threshold or deployment change.

Linked Defect / Plan Reference

  • DELIVERY_PLAN.md defect ID: N/A; concrete qualification failures during the Docker Desktop replacement acceptance work.
  • Audit doc reference: Live evidence preparation, RCA and qualification boundaries.
  • ADR (if applicable): N/A; preserve the existing evidence-copy and fixture-ownership boundaries.

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/)

Observed RED/GREEN controls cover redundant preparation, arbitrary dictionary keys, empty/singleton/wrapped arrays, Turkish case-culture parity, actual byte-response ownership registration and the actual early/finally profile cleanup lifecycle. All previous controls remain.

The duplicate-delete regression executes the actual AST blocks: two DELETE calls before, one after. Its negative control retains the UUID for retry and the original sticky failure. Existing assertion 9z.36 now checks real success instead of unconditional true.

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 for services/controllers; pure actual-wrapper contracts now pass 255 redaction and 224 ownership assertions, plus nine existing actual nested-script Jest tests.
  • E2E Tests - end-to-end spec under api/test/e2e/ exercising the feature through HTTP. N/A for new API behavior; complete real live HTTP suites exercise both application backends, and the normal hook retains existing API HTTP coverage.
  • Live Integration Tests - new section in scripts/live-test.ps1 runnable against local + Docker + Azure. Existing live runner/wrappers and profile cleanup corrected; no manufactured extra success count or weakened assertion.
  • Feature Documentation - dedicated doc in docs/ with architecture, RFC references, Mermaid diagrams, test coverage. Existing evidence-copy guide, execution RCA, exact results and limits updated.
  • INDEX.md Update - add the new doc reference to docs/INDEX.md. N/A: no new feature document; existing indexed guide updated.
  • CHANGELOG.md Update - [Unreleased] entry with full test counts and feature summary
  • Session & Context Updates - Session_starter.md and docs/CONTEXT_INSTRUCTIONS.md
  • Version Management - bump api/package.json (and any other version refs) when behavior changed. N/A: script-only repair; product source/version and all manifests/locks unchanged.
  • Response Contract Tests - API responses contain ONLY documented fields (key allowlist assertion at unit + E2E + live). No API response changes; new evidence contracts assert exact public JWKS shape, original values and unchanged response identity.

Validation Output

Final integrated normal Fast explicit-ref push: all 29 gates PASS at d3e5cec5.
API: 220 suites/6,274 tests PASS.
Reduced HTTP: 120 passing suites/2,519 tests, four suites/45 known skips.
Redaction: 255 assertions PASS, retaining all prior 213.
Ownership: 224 assertions PASS, previously 206.
Actual nested-script Jest: one suite/nine tests PASS.
Complete owned PostgreSQL live: 1,845/1,845 PASS, zero failures.
Complete fresh InMemory live: 1,845/1,845 PASS, zero failures.
Both backends: 169 sections/2,060 flow steps, exact cleanup and listener closure.
Exact-tip PR CI: all six checks PASS.
CI API: 220 suites/6,274 tests PASS.
CI reduced HTTP: 2,519 PASS, 45 known skips.
CI web: 126 files/1,664 tests PASS.

Executed focused commands and results, from the owned checkout:

  • pwsh -NoProfile -File scripts\test\live-evidence-redaction.contract.ps1: PASS, 255 assertions.
  • pwsh -NoProfile -File scripts\test\live-endpoint-ownership.contract.ps1: PASS, 224 assertions.
  • API npm test -- --runInBand --runTestsByPath src\modules\scim\common\live-correctness-wiring.spec.ts: PASS, one suite/nine tests.
  • The complete scripts\live-test.ps1, without reduced selectors/assertions, through private native-WSL owned-fixture orchestration: PostgreSQL PASS in 450.589 seconds; fresh InMemory PASS in 421.507 seconds.
  • $env:PREPUSH_MODE='Fast'; git push --set-upstream origin HEAD:refs/heads/vprane/scimserver/containers-live-evidence-performance-20261123: PASS, all 29 normal hook gates, exit zero. Final integration push completed in 828.7 seconds. Local/upstream/remote independently match full d3e5cec5409a3c631a63d50e0cc8b5afa6ede396; worktree clean. No bypass.

Live evidence is explicitly scoped: the accepted c52 application image on independent Docker Engine in Ubuntu WSL, with the exact repaired harness source. PostgreSQL uses fresh tmpfs and all 30 migrations; no other owner's database/bridge is reused. Both fixtures are removed and original identities retained.
Both executed PowerShell source hashes still match the committed working-copy scripts; this check does not require rerunning either unchanged complete live suite.

The PostgreSQL child exited zero, but its original private outer verifier exited one after parsing an intentionally redacted timestamp. That failed receipt remains. A separate exact-target/file-write-window/hash/source-identity verifier reconciled the complete result and passed four actual wrong-target/stale/future/unchanged-file rejection controls. InMemory outer and child both exited zero. No metadata exemption or dropping short material.

The 100-field/30-material preparation probe drops repeated JSON encoding from 3,000 calls to zero. A separate bounded CPU experiment measures 546.875 ms before and 46.875 ms after the combined guards/ordered loop. These are helper measurements, not API latency claims or new timing gates.

All prior failed/partial attempts remain documented. No shipping-image, dev/Azure, application-performance, preservation-safe shared-admin or Docker Desktop removal acceptance.

Combined exact-tip PR workflow 45287233922 completed successfully on d3e5cec5409a3c631a63d50e0cc8b5afa6ede396: runtime contracts, validation and test-image build/push PASS, including container smoke and HIGH/CRITICAL-gating Trivy. Separate docs freshness and both CodeQL checks PASS. This tip normally incorporates merged PR284/master 36d07884b10497895c694dc4b5c7bad81543878d, with both documentation histories preserved. The prior a1f0039 run remains historical evidence, not new-tip admission. The PR test image is nonshipping.

The direct source review, including the integration conflict resolutions, is recorded honestly as a COMMENTED self-review. No independent approval is claimed. Verified master protection requires strict green CI, not an external approval; canonical delivery process section5.3 requires resolved findings and exact-tip green CI. Optional Copilot review quota exhaustion was not retried and no protection, hook, threshold or approval requirement was changed. Normal exact-head merge only; final merged-tip matrix, performance and shipping/dev acceptance remain open.

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. No migration changes.

Destructive Migration Override (skip if not applicable)

Not applicable: no schema/migration or existing database changes. All real qualification uses separately owned disposable resources.

  • 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 -->
    

Reviewer Hint

Diff areas worth special attention from the reviewer:

  • Prepared replacement order, duplicate variants, immediate discovery, equal-count fresh-run invalidation and original regex culture.
  • Actual dictionary keys versus payload keys; preserve real array type, not only scalar-compatible count/index values.
  • Strict UTF-8 only for the local ownership admission copy, retaining the native response identity/body.
  • Success discharges only the local finally handle; failure retains the UUID and sticky diagnostics.
  • Follow-up tooling PR fix(tooling): patch Markdown parser with verified CI lock #284 is a separate rollback unit. Its six exact-tip checks pass, but independent review is unavailable because Copilot review quota is exhausted. This harness unit must not silently absorb dependency changes or claim that separate repair has merged.
  • Direct consolidation self-review found no new high-confidence production defect. It is not independent approval.
  • Self-improvement is applied through deterministic work-count, exact-shape and actual lifecycle controls. Design disposition: applied/accepted as documented, a small measured in-process helper inside the existing cohesive file; no speculative service/strategy/dependency.
  • The optional knowledge graph is absent in this worktree, verified directly. Review uses actual sources/contracts; run /understand before expecting a graph-based impact overlay.

…daction plans

Retain exact masking, original HTTP values, failure evidence and normal token lifetimes. Permanent contracts pass 255 redaction, 224 ownership and nine nested-wiring assertions. Fresh owned PostgreSQL and InMemory live suites each pass 1845 checks; shipping and latency acceptance remain separate.

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.

Exact-tip live-harness source self-review

Reviewed source a1f003970c9be4ddf3cf328ab2a96be3d8db7f03 against base c52de06fc88ab046793d6fdd478671cdb98028a5. This records the completed direct source/contract review, not an independent approval.

  • Changes are confined to the live runner, recorded-evidence helper, their permanent contracts and directly related documentation. No application, dependency, image version, workflow, hook, deadline, capacity or HTTP expectation changes.
  • Preparation caching is per initialized run and the monotonically growing material set; initialization resets the cache. Ordered replacement preserves the established replacement order and does not store secrets in static fields.
  • Dictionary traversal uses actual dictionary keys rather than a potentially shadowing member. Empty, singleton and wrapped arrays retain their shape and avoid false cycles.
  • The authorization precheck preserves culture semantics, including the actual Turkish dotted-I negative control. Redaction still changes recorded copies, not actual requests or responses.
  • Strict UTF8 decoding applies only to the local ownership-admission copy. The native response/body and original UUID/ownership checks remain authoritative.
  • The profile endpoint handle is cleared only after successful early cleanup. Failed cleanup remains a sticky failure and retains the handle for the final retry.
  • The focused redaction255, ownership224 and nested-script9 contracts pass. The normal Fast push passes all29 gates. All six exact-tip PR checks pass, including API219/6272, reduced HTTP2519/45 known skips, web126/1664, test image/smoke and gated Trivy.
  • Actual current runner/evidence hashes still match both complete PostgreSQL/InMemory live receipts, each1845/1845 with exact cleanup. The original PostgreSQL outer-verifier failure remains preserved with separate reconciliation.
  • No new high-confidence correctness defect or unresolved review finding was identified.

Self-improvement is applied through executable culture, array-shape, dictionary-shadowing, preparation and ownership/cleanup regression controls. Design disposition: accepted, cohesive existing helper/runner boundaries without a speculative abstraction. The absent optional knowledge graph was verified; no graph-derived coverage or overlay is invented.

Normal merge decision

Protected master has strict required CI contexts but no required external approval. Canonical delivery process section5.3 requires green exact-tip CI and resolved review findings, not a particular review service. The actual source review is recorded honestly as COMMENTED; no independent approval is claimed. Copilot review quota is unavailable and is not retried. No protection change, admin override or CI bypass is permitted.

After PR284 merges, this branch must first incorporate master normally, preserve both documentation changes, and pass normal gates and exact new-tip CI before its own merge. The prior tip's checks do not qualify a changed integration tip. Application performance and final shipping/dev acceptance remain open.

Preserve both documentation histories and scope prior results to their exact source. Record normal source-review merge requirements without inferring independent approval.

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.

Exact-tip live-harness source self-review

Reviewed source a1f003970c9be4ddf3cf328ab2a96be3d8db7f03 against base c52de06fc88ab046793d6fdd478671cdb98028a5. This records the completed direct source/contract review, not an independent approval.

Integration review: exact d3e5cec5409a3c631a63d50e0cc8b5afa6ede396 against merged master 36d07884b10497895c694dc4b5c7bad81543878d. The three documentation conflicts preserve both the merged root-tooling history and this harness history. The actual live runner/evidence hashes remain identical to both complete executed live receipts. Imported root dependencies and their regression controls remain unchanged. The new integration tip passed all 29 normal Fast gates and all six exact-tip PR checks in run 45287233922: API 220 suites/6,274 tests, reduced HTTP 2,519 passes/45 known skips, web 126 files/1,664 tests, nonshipping image, container smoke and HIGH/CRITICAL-gating Trivy. No unresolved source finding was introduced by integration.

  • Changes are confined to the live runner, recorded-evidence helper, their permanent contracts and directly related documentation. No application, dependency, image version, workflow, hook, deadline, capacity or HTTP expectation changes.
  • Preparation caching is per initialized run and the monotonically growing material set; initialization resets the cache. Ordered replacement preserves the established replacement order and does not store secrets in static fields.
  • Dictionary traversal uses actual dictionary keys rather than a potentially shadowing member. Empty, singleton and wrapped arrays retain their shape and avoid false cycles.
  • The authorization precheck preserves culture semantics, including the actual Turkish dotted-I negative control. Redaction still changes recorded copies, not actual requests or responses.
  • Strict UTF8 decoding applies only to the local ownership-admission copy. The native response/body and original UUID/ownership checks remain authoritative.
  • The profile endpoint handle is cleared only after successful early cleanup. Failed cleanup remains a sticky failure and retains the handle for the final retry.
  • The focused redaction255, ownership224 and nested-script9 contracts pass. The normal Fast push passes all29 gates. All six exact-tip PR checks pass, including API219/6272, reduced HTTP2519/45 known skips, web126/1664, test image/smoke and gated Trivy.
  • Actual current runner/evidence hashes still match both complete PostgreSQL/InMemory live receipts, each1845/1845 with exact cleanup. The original PostgreSQL outer-verifier failure remains preserved with separate reconciliation.
  • No new high-confidence correctness defect or unresolved review finding was identified.

Self-improvement is applied through executable culture, array-shape, dictionary-shadowing, preparation and ownership/cleanup regression controls. Design disposition: accepted, cohesive existing helper/runner boundaries without a speculative abstraction. The absent optional knowledge graph was verified; no graph-derived coverage or overlay is invented.

Normal merge decision

Protected master has strict required CI contexts but no required external approval. Canonical delivery process section5.3 requires green exact-tip CI and resolved review findings, not a particular review service. The actual source review is recorded honestly as COMMENTED; no independent approval is claimed. Copilot review quota is unavailable and is not retried. No protection change, admin override or CI bypass is permitted.

PR284 is merged. This branch incorporated master normally, preserved both documentation changes and passed normal gates and exact new-tip CI. The normal merge is eligible at exact d3e5cec, without admin override. This is a COMMENTED self-review, not independent approval. Application performance and final merged-tip shipping/dev acceptance remain open.

@pranems
pranems merged commit a7ef000 into master Nov 23, 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