Skip to content

#2993: PROD-blocking dad-discard reconcile HANA test - #3141

Merged
Thomas Jung (jung-thomas) merged 2 commits into
DEVfrom
worktree-spike-2993-cascade
Nov 16, 2026
Merged

Thomas Jung (jung-thomas) merged 2 commits into
DEVfrom
worktree-spike-2993-cascade

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Follow-up to #3136 (merged — the compiler pin + flag flip, already deployed+verified on DEV: preflight verified (46/46)).

Adds the PROD-blocking gate test that #3136's body listed as pending:

  • test/hybrid/admin-drafts-dad-reconcile.hybrid.test.js — proves, against real HANA, that under deleteStrategy: dad a Mission draftEdit→discard (a) still fires the after('DISCARD') rollup reconcile (user MISSION TaskRecord heals IN_PROGRESS→COMPLETED) and (b) leaves zero orphaned ADMINSERVICE_COMPLETIONPATHITEMS_DRAFTS rows (real ON DELETE CASCADE).

Both assertions verified non-vacuous in review (stale seed + pre-discard sanity count). Shared-HANA safe: randomised dad5- prefix, FK-ordered afterAll cleanup (runs on assert failure), HANA-kind hard guard, PROD-write gate.

Must be run before PROD promotion:

npm run test:hybrid -- test/hybrid/admin-drafts-dad-reconcile.hybrid.test.js

(worktree sandbox blocks cds bind; run from the primary checkout.)

No handler changes — test-only. If the run shows reconcile does NOT fire under dad, the fix is an after('DELETE','DRAFT.DraftAdministrativeData') fallback (noted in the test).

…HANA

Adds test/hybrid/admin-drafts-dad-reconcile.hybrid.test.js — a hybrid
(real-HANA) vitest test that proves two invariants under deleteStrategy:dad:

(a) after('DISCARD','Missions.drafts') reconcile fires — seeds a User whose
    MISSION TaskRecord is stale IN_PROGRESS, draftEdits + DISCARDs a Mission,
    then vi.waitFor asserts the record heals to COMPLETED (8s, 100ms interval).

(b) Zero orphaned CompletionPathItems draft rows — raw db.run() query on
    ADMINSERVICE_COMPLETIONPATHITEMS_DRAFTS by discarded DraftUUID → COUNT=0,
    proving the ON DELETE CASCADE constraints are live on HANA.

Gated by isSafeForWrites() (blocks PROD). Unique dad5-<hex> prefix + exact-ID
cleanup in afterAll. Run: npm run test:hybrid -- test/hybrid/admin-drafts-dad-reconcile.hybrid.test.js

No handler changes (test-only). HANA execution pending (worktree session
isolation blocks cds bind --exec; cf target is on DEV eu10-005/dev).
Replace .slice(0,36).padEnd(36,'0') gymnastics with deterministic
well-formed UUIDs: dad5000N-2993-0005-<hex4>-<hex8>0000 (8-4-4-4-12).
Last segment = 8-char RUN_HEX + '0000' = exactly 12 hex chars.
All five seed IDs validated as RFC-4122 format; no other changes.
@jung-thomas
Thomas Jung (jung-thomas) merged commit f6d3909 into DEV Nov 16, 2026
3 of 4 checks passed
@jung-thomas
Thomas Jung (jung-thomas) deleted the worktree-spike-2993-cascade branch November 16, 2026 05:25
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