Troubleshooting

Troubleshoot engagement closure — Contact and Engagement Platform

Diagnose failed or inconsistent engagement closure by tracing lifecycle transitions, audit persistence, concurrent updates, snapshot integrity, privacy restrictions, and downstream notifications. This developer guide provides read-only SQL diagnostics, reproducible fault-injection tests, and controlled recovery procedures to restore trustworthy, auditable closure records.

ProductContact and Engagement PlatformUpdatedNovember 21, 2026Reading time26 minutes

Application: Contact and Engagement Platform
Component: Engagement Lifecycle & Closure (proposed Knowledge Base taxonomy; select registered component in WordPress)
Audience: PHP/WordPress engineers, database administrators, QA/SRE, security and privacy reviewers
Source baseline: 2.0.2; commit 3f246974276a5e582d09f8c48d21628b82626bc7
Article status: Source-reviewed troubleshooting protocol; synthetic checker passed; staging verification pending
Estimated reading time: 24–28 minutes

Diagnose failed, inconsistent, or unauditable engagement closure by reconciling lifecycle state, authorization, event persistence, optimistic concurrency, commercial snapshots, privacy disposition, and downstream notifications. This developer guide supplies read-only SQL, reproducible synthetic failure cases, targeted fault injection, and controlled recovery steps, while distinguishing implemented behavior from additional closure-policy requirements.

1. Scope, prerequisites, and safe operating boundary

This guide addresses completed and canceled engagement transitions, including cancellation before activation. It does not treat an engagement’s terminal status as proof that all contract obligations are settled, a client is satisfied, data has been deleted, or a scientific result is validated. Distinguish three investigations: state integrity (the database row and allowed transition), transaction traceability (actor, matching event, audit, notification), and closure-policy sufficiency (delivery acceptance, outstanding obligations, retention and access disposition).

Run mutation, concurrency, callback-failure, and data-erasure tests only on disposable WordPress/MySQL instances with fabricated users and records. Read-only SQL may run against authorized environments under least-privilege database credentials; do not paste private query results into public issues, bug reports, or Knowledge Base comments. Capture the plugin SHA, schema and WordPress versions, table prefix, PHP version, database engine, UTC clock, and test run ID before reproducing a failure.

2. Implemented transition contract and terminal-field mapping

Current state Valid next terminal status Source behavior
handoff_pending canceled Cancellation allowed before activation; portal message attempted after transition
ready_for_setup canceled Ready-but-not-active handoff may be canceled
active completed, canceled Completion or cancellation records actor, UTC time, and note
paused completed, canceled Paused engagement may terminate without resuming
completed, canceled None No ordinary terminal-to-terminal or reopen transition in this map

Source: SC_EI_Engagement_Schema::statuses() and SC_EI_Engagement_Repository::change_status(). A completed record uses completed_by, completed_at, completion_note and engagement_completed. A canceled record uses canceled_by, canceled_at, cancellation_reason and engagement_canceled. A status label closed is not one of the engagement terminal statuses; querying for status='closed' would silently miss valid closures.

3. Symptoms and incident classification

Symptom Likely class Priority / first action
UI reports success but no corresponding event Audit persistence / silent insert failure High: preserve row and event table evidence; reproduce in staging
Two users submit different terminal outcomes Optimistic-lock / idempotency High: compare row versions and terminal events
Cancellation visible but portal lacks notice Post-transition notification persistence Medium: inspect portal message records; avoid blind replay
Completed without accepted deliverables Policy-control gap or unresolved obligation High if contractual: escalate to owner; do not edit history
Snapshot hash invalid / wrong proposal version Payload corruption, incorrect pointer, or migration error High: freeze evidence; compare exact stored bytes
PII remains after erasure Privacy-redaction coverage gap Critical: contain access and involve privacy owner
Closure forbidden despite authenticated manager Capability, nonce, stale state, or typed phrase Medium: check exact request and authorization
Closure unexpectedly retried or duplicated Browser replay / queue or webhook handling Medium: reconcile events and notifications

Cause

Source-confirmed implementation behavior: the admin handler checks sc_intake_complete_engagements, a WordPress nonce, and a typed confirmation. The repository rejects illegal transitions and empty notes, then performs a conditional UPDATE matching id, row_version, and prior status. However, the transition helper does not evaluate the return value from record_event() or SC_EI_Audit_Log::record(); the helper that inserts into engagement_events returns void. The status-change path does not surround all three writes with a transaction. An event-insert failure could therefore leave a terminal row without its required audit evidence. This is a code-derived failure mode to reproduce, not an observation of production data loss.

Second code-derived failure mode: canceling a handoff_pending or ready_for_setup record invokes SC_EI_Portal_Repository::create_portal_message() after the state transition and does not check its returned outcome. A notification failure could result in a canceled engagement and no persisted portal notice. Recovery must distinguish missing communication from failed closure; indiscriminate retries can duplicate messages.

Policy-level gaps: the existing change_status() method requires a reason, but it does not itself enforce a full deliverable-acceptance register, contractual settlement, independent privacy disposition, legal-hold review, or downstream access revocation. These are recommended closure gates that need an explicit design, owner, and acceptance test; their absence from this function does not establish the absence of all external organizational controls.

4. Repository map and persistence boundaries

Source file / method Responsibility Diagnostic significance
class-sc-ei-engagement-admin.php::handle_change_status() Capability, nonce, confirmation, request sanitation Endpoint trust boundary; verify each property with authenticated staging actors
class-sc-ei-engagement-repository.php::change_status() Allowed states, notes, terminal fields, post-cancel messaging Business rules; does not enforce full closure checklist
::transition() Optimistic row update; engagement/general audit calls Reconcile all writes, including failure injection
class-sc-ei-audit-log.php::record() General audit insert and hook Returns insert ID without explicitly rejecting failed insert
::verify_snapshot() SHA-256 comparison over stored JSON string Detects byte changes, not contractual or scientific correctness
::redact_for_privacy() Removes selected narratives and replaces snapshot with tombstone An altered hash is expected after privacy erasure
class-sc-ei-retention-engine.php Separate privacy and retention lifecycle Closure status alone does not execute data disposal

Relevant database tables use the WordPress prefix: {prefix}sc_ei_engagements, {prefix}sc_ei_engagement_events, {prefix}sc_ei_engagement_snapshots, {prefix}sc_ei_engagement_requirements, and {prefix}sc_ei_audit_log. Resolve the prefix with $wpdb->prefix in a controlled WordPress context. Never hard-code wp_ when executing SQL against an unknown installation.

5. Establish an evidence-preserving incident fingerprint

Record structured metadata, not personal case content: environment, commit, engagement reference or approved pseudonym, previous/final statuses, row version, actor ID (restricted context), terminal time in UTC, event count, audit count, snapshot digest, component version, privacy restriction flag, relevant error code, and deterministic reproduction ID. Keep full incident evidence in restricted storage; public summaries should contain only categorical findings and non-linkable synthetic IDs.

{
  "schema": "sc-kb-closure-diagnostic/1.0",
  "environment": "synthetic",
  "incident_id": "SYN-INC-0042",
  "source_commit": "3f246974276a5e582d09f8c48d21628b82626bc7",
  "observed": {
    "terminal_status": "completed", "row_version": 9,
    "matching_engagement_events": 0,
    "matching_general_audit_events": 0,
    "snapshot_integrity": true
  },
  "hypothesis": "state committed but event write not persisted"
}

This short incident fingerprint is a documentation example, not the companion checker input contract; see Section 16 and the packaged fixtures for that complete schema. If logs contain case narratives or client identifiers, redact at collection time and avoid permanently copying them into analytics or issue trackers.

6. Read-only SQL: find corrupt terminal metadata

First confirm whether the database itself satisfies the minimum source fields. The following query emits internal IDs, states, actors and a boolean indicating whether a note exists; it deliberately does not expose the note contents. Run it with a read-only credential against authorized staging data. Replace wp_ with the installation-specific prefix.

SELECT e.id,e.engagement_number,e.status,e.row_version,
 CASE WHEN e.status='completed' THEN e.completed_at ELSE e.canceled_at END AS terminal_at,
 CASE WHEN e.status='completed' THEN e.completed_by ELSE e.canceled_by END AS terminal_actor_id,
 CASE WHEN e.status='completed'
      THEN LENGTH(TRIM(COALESCE(e.completion_note,'')))>0
      ELSE LENGTH(TRIM(COALESCE(e.cancellation_reason,'')))>0 END AS note_present
FROM wp_sc_ei_engagements e
WHERE (e.status='completed' AND
      (e.completed_by IS NULL OR e.completed_at IS NULL OR
       TRIM(COALESCE(e.completion_note,''))=''))
   OR (e.status='canceled' AND
      (e.canceled_by IS NULL OR e.canceled_at IS NULL OR
       TRIM(COALESCE(e.cancellation_reason,''))=''));

Interpretation: a returned row is a reconciliation candidate, not automatically evidence of malicious activity. Review direct database imports, migrations, manual SQL, plugin version, timezone handling, and approved privacy erasure. Preserve an approved forensic copy before applying any fix; do not backfill notes with fabricated content.

7. Audit reconciliation across two event stores

Do not rely on an activity-feed screenshot alone. The implementation writes an engagement_events row and a separate entry in audit_log. Establish event agreement over engagement ID or recorded engagement number, prior/final state, event type, actor, and time; then inspect whether the event appeared exactly once. The general audit table is inquiry-linked, not directly engagement-linked, so match its context_json.engagement_number as an additional key and report ambiguous matches explicitly.

SELECT e.id,e.status,e.row_version,COUNT(ev.id) AS matching_events
FROM wp_sc_ei_engagements e
LEFT JOIN wp_sc_ei_engagement_events ev
 ON ev.engagement_id=e.id
 AND ev.to_status=e.status
 AND ev.event_type=CASE e.status
      WHEN 'completed' THEN 'engagement_completed'
      ELSE 'engagement_canceled' END
 AND ev.actor_id=CASE e.status
      WHEN 'completed' THEN e.completed_by ELSE e.canceled_by END
WHERE e.status IN ('completed','canceled')
GROUP BY e.id,e.status,e.row_version
HAVING COUNT(ev.id)<>1;

Check the complete general-audit correlation using Query Q4 in the downloadable SQL file. An event with the correct type but wrong prior state, wrong actor, repeated event, or substantially different timestamp must be investigated. Use a documented clock-skew tolerance only for diagnostics; it must not permit a forged event to pass an integrity review. Absence from a cropped UI is not proof that the persisted record is missing.

8. Reproduce silent audit-write failure safely

  1. Start a disposable MySQL/WordPress environment with the exact pinned plugin source and synthetic manager identity. Verify all engagement-related tables use a transactional storage engine; log engine details.
  2. Create a contracted synthetic proposal and engagement; advance through the documented handoff and activation flow. Do not bypass business rules with direct SQL just to manufacture a positive test.
  3. For a negative test, inject a scoped failure into one engagement-event insert or one general-audit insert in the isolated environment. Use a database adapter stub, test double, or temporary disposable constraint; never damage production tables.
  4. Submit active → completed with the correct nonce, typed phrase and note. Independently query the terminal row, engagement_events, and audit_log.
  5. Record HTTP response, row version, both insert outcomes, and any hook side effects. If the row advances while an audit write fails, raise an engineering defect with a minimal synthetic reproduction.
Fault injection: fail the engagement_events INSERT once
Input: status=active, version=8, actor=synthetic-manager
Action: COMPLETE SC-ENG-SYNTH-001
Required acceptance after remediation:
  EITHER row remains active, version=8, no success response,
  OR row is completed, version=9, BOTH mandatory audit writes persisted.
Unacceptable: status=completed with missing engagement event
              or missing general audit record.

Recommended repair is transactional state-plus-audit persistence: make record_event() return a checked result; check SC_EI_Audit_Log::record() for a positive insert ID; rollback on either failure; write the success response only after commit. Coordinate with existing hooks and transaction nesting. External portal communications should use a durable outbox, not a best-effort side effect inside a database transaction. This is an engineering design recommendation, not a deployed implementation claim.

9. Race conditions, stale state, and idempotency

The source uses a conditional update matching id, row_version, and previous status. A second request generated from an obsolete version should receive engagement_transition_conflict. Investigate stale admin browser tabs, multi-user edits, duplicate form submissions, job retries and application-level caching. A conflict does not prove the first action failed; always read the canonical row and audit ledgers before asking a user to retry.

Request A reads: status=active, row_version=8
Request B reads: status=active, row_version=8
A: status=completed, valid confirmation, synthetic note
B: status=canceled, valid confirmation, synthetic note
Expected: ONE version=9 terminal update; B gets conflict;
          exactly one canonical terminal event;
          no duplicate message or contradictory outcome.
Repeat with request order reversed and concurrent retries.

Note that the handler validates the typed confirmation against the engagement number but the repository method itself is an internal API that trusts its caller’s authorization. New REST endpoints, CLI commands or background jobs must enforce equivalent access controls and intent checks; invoking the repository directly is not a substitute for endpoint permission enforcement.

10. Validate completion prerequisites and contractual evidence

A completed engagement with a note can still have unresolved work. The handoff checklist is for readiness and onboarding; it is not necessarily a complete contracted deliverable register. Treat the following query as a policy review signal, not a built-in invariant in change_status(). A flagged row needs human reconciliation against the controlling contract, amendments, waivers, acceptance evidence, security revocation, and remaining liabilities.

SELECT e.id,e.status,COUNT(r.id) AS unresolved_required_items
FROM wp_sc_ei_engagements e
JOIN wp_sc_ei_engagement_requirements r ON r.engagement_id=e.id
WHERE e.status='completed'
 AND r.is_required=1 AND r.status NOT IN ('complete','waived')
GROUP BY e.id,e.status;

Proposed future closure gate: a versioned closure_disposition evidence record containing scope/contract version, deliverable acceptance or waiver, exceptions, pending handoffs, accountable approver, access revocation, privacy/retention disposition reference, and independent reviewer signoff where required. Avoid adding client narratives directly to general audit context. Expose only categorical evidence codes and protected references to the event ledger.

11. Commercial snapshot hash and version mismatches

At handoff, the repository serializes a contracted proposal into payload_json and stores content_hash = SHA256(exact serialized string). verify_snapshot() checks these exact bytes. Reformatting JSON before hashing, changing Unicode escaping, or hashing a parsed/re-encoded object produces a different byte sequence; recomputation must use the stored payload verbatim.

// Verify on a trusted, restricted fixture or authorized staging row.
$payload = (string) $snapshot['payload_json'];
$recorded = (string) $snapshot['content_hash'];
if (!preg_match('/^[a-f0-9]{64}$/i', $recorded)
    || !hash_equals(strtolower($recorded), hash('sha256', $payload))) {
    throw new RuntimeException('engagement_snapshot_integrity_mismatch');
}

Inspect engagements.current_snapshot_id and the referenced snapshot’s proposal_version_id, compared with the engagement’s proposal_version_id. Do not assume that the function returning the latest snapshot_version necessarily follows the same pointer as current_snapshot_id without checking the specific workflow. Hash agreement proves byte consistency, not that the evidence is complete or legally binding.

Privacy erasure is a special case: redact_for_privacy() replaces source snapshot JSON with a synthetic tombstone such as {"personal_data_erased":true,...} and recalculates the hash. A valid tombstone with a new hash must not be misclassified as original unmodified commercial evidence. Preserve lawful commercial/legal-hold evidence in an approved restricted system according to a documented retention decision.

12. Privacy restriction, deletion, and legal-hold diagnostics

Engagement closure and personal-data erasure are separate workflows. Read the inquiry’s privacy_status, legal-hold and retention-action registers, the engagement’s remaining narrative fields, snapshot redaction marker, and any downstream copies. The privacy-redaction method clears selected narrative fields and changes snapshot/event contexts; do not infer that the operation has inspected every external Workbench export, message record, backup or processor dataset. An active preservation hold must be adjudicated before destructive processing.

-- Boolean-only post-erasure residue check; do not SELECT narratives.
SELECT e.id,e.status,i.privacy_status,
 (LENGTH(TRIM(COALESCE(e.internal_notes,'')))>0) AS internal_notes_present,
 (LENGTH(TRIM(COALESCE(e.completion_note,'')))>0) AS completion_note_present,
 (LENGTH(TRIM(COALESCE(e.cancellation_reason,'')))>0) AS cancellation_reason_present
FROM wp_sc_ei_engagements e
JOIN wp_sc_ei_inquiries i ON i.id=e.inquiry_id
WHERE i.privacy_status='erased';

Escalate any nonzero residue under an approved erasure case for an authorized privacy review. Do not manually delete event rows to make the audit ledger appear clean; preserve nonpersonal accountability evidence and examine whether the required field is within the approved erasure scope. Check retention policies, legal holds, document storage, communications, exports and third-party systems separately.

13. Portal visibility and post-commit communication failures

For cancellation before activation, the repository calls create_portal_message() after a successful terminal transition. Reproduction requires a synthetic inquiry with permitted portal access, a known preactivation engagement, and a forced portal-message persistence failure. Verify whether the terminal row committed, whether the portal message exists, and whether any duplicate message appeared after retry. Do not confuse a successful internal portal-message insertion with delivery or receipt of external email.

Recommended recovery: reconcile current canonical status and existing messages; if absent, use the authorized communication recovery workflow with a scoped deduplication key or human approval; record the recovery action, not a fabricated original event. Do not replay the entire cancellation request merely to create a missing message—terminal status makes that request invalid, and a future implementation may have additional side effects.

14. Access control, nonce, and typed-confirmation debugging

The existing admin handler requires sc_intake_complete_engagements, checks sc_ei_change_engagement_status_<id> with check_admin_referer(), and expects the exact engagement-specific phrase. Test a manager with the capability, a reviewer without it, an expired nonce, a replayed nonce, a different engagement ID, and a stale form. A WordPress nonce is not proof of authorization; test capability and object-level scope independently. For any additional API client, require equivalent policy checks and CSRF or API-auth controls appropriate to the transport.

// Source-verified handler pattern (not an independent REST API).
self::require_cap('sc_intake_complete_engagements');
check_admin_referer('sc_ei_change_engagement_status_' . $id);
// completed: COMPLETE SC-ENG-...
// canceled:  CANCEL SC-ENG-...
$result = SC_EI_Engagement_Repository::change_status(
    $id, $status, $note, get_current_user_id()
);

Never expose nonces, cookies, credentials or personally identifying engagement references in the public Knowledge Base. Use synthetic screenshots and truncated, non-linkable identifiers in diagnostics. Verify denial behavior through HTTP status and unchanged database state, not only by checking whether a button is hidden.

15. Time, version, and downstream-hand-off reconciliation

All investigation times should be converted to UTC with offset-aware timestamps; preserve original time zone and source precision in restricted evidence. The database uses datetime fields, and a multi-system incident may combine WordPress timestamps, MySQL server time, portal timestamps and worker logs. Compare time order using explicit clock-synchronization evidence rather than assuming all timestamps are perfectly synchronized.

Review Workbench and Decision Studio handoff flags and any acknowledged external exports. The engagement integration exports prepare handoff data; they do not inherently prove a downstream project was provisioned, access revoked, or artifacts archived. If a closure result is inconsistent across systems, identify the authoritative system for each state and reconstruct the event chain before correction.

16. Run the offline diagnostic checker with reproducible fixtures

The included closure_diagnostics.py is a standalone synthetic evidence validator, not a plugin API or production monitoring agent. It accepts a fully synthetic JSON packet, detects source-contract violations and separately labeled policy warnings, then emits machine-readable findings without network, WordPress, or database access. It intentionally requires environment: "synthetic" and should not be pointed at real client records.

cd engagement_closure_troubleshooting
python3 -m unittest -v tests_closure_diagnostics
python3 closure_diagnostics.py fixtures/valid_completed.json
python3 closure_diagnostics.py fixtures/valid_canceled.json
python3 closure_diagnostics.py fixtures/invalid_multiple.json \
  --output evidence/recheck_invalid_results.json
# Exit: 0 clean; 1 warnings only; 2 errors; 3 invalid input.

Tests cover illegal transitions, missing notes and actors, stale versions, missing/duplicate engagement events, missing/duplicate general audit entries, clock skew, authorization and nonce assertions, typed confirmation, snapshot integrity, malformed JSON, unfinished obligations, retention conflicts, privacy leakage, tombstone consistency, and post-commit notification failure. The test suite validates the checker against its fixtures; it does not demonstrate that the live plugin enforces additional proposed controls.

17. Triage decision tree and stable diagnostic identifiers

Terminal status visible?
  NO  -> Check capability, nonce, typed phrase, legal transition,
         stale row_version, and request handler error code.
  YES -> Terminal actor/timestamp/note complete?
    NO  -> Inspect migration/manual SQL and preserve original row.
    YES -> Exactly one matching engagement event AND general audit entry?
      NO  -> Investigate silent insert failure; fault-inject in staging.
      YES -> Source proposal snapshot digest and version consistent?
        NO  -> Freeze evidence; check pointer, redaction, and migrations.
        YES -> Obligations, privacy, legal hold and notification reconciled?
          NO  -> Open owner-controlled disposition/recovery action.
          YES -> Record verified outcome with run ID and evidence links.
Diagnostic code Interpretation Action owner
engagement_transition_invalid Attempted transition not in source map Workflow owner: inspect prior state
engagement_transition_note_required Empty reason or completion note Engagement manager: provide factual note
engagement_transition_conflict Row changed since read Developer/manager: reload canonical state
ENGAGEMENT_EVENT_CARDINALITY Synthetic checker: missing or duplicate event Engineering: audit reconciliation
SNAPSHOT_HASH_MISMATCH Synthetic checker: payload digest differs Data engineering: integrity investigation
ACTIVE_HOLD_ERASURE Synthetic checker: deletion plus preservation hold Privacy officer: suspend disposal
POST_COMMIT_MESSAGE_FAILURE Synthetic checker: canceled state without portal message Communications owner: deduplicated recovery

Resolution

Do not “repair” an engagement by directly editing the final status, deleting audit rows, re-hashing modified content without authorization, or replaying a successful terminal request. Recovery must preserve the historical transition and introduce an accountable corrective action. The following table distinguishes safe immediate containment from engineering remediation.

Observed failure Immediate containment Recommended corrective action
Missing engagement/general audit write Restrict further closure mutations in affected workflow; preserve immutable logs Patch transactional persistence with checked results and regression fault injection
Competing terminal decisions Do not resubmit stale form; capture row version Make caller idempotent and reconcile canonical winner
No portal notification after preactivation cancellation Confirm cancellation and absence of message Approved single-message recovery with deduplication and audit entry
Unresolved delivery obligations Flag as review-required, not automatically complete Build versioned closure disposition gate and owner attestation
Mismatch of snapshot digest/version Stop using questionable export as authoritative evidence Verify exact bytes, pointer, provenance, restore only from approved backup
Privacy hold/restriction conflict Stop destructive operations and external disclosure Route through Privacy and Retention Center with documented decision
Unauthorized closure request Preserve benign request metadata; return deny Correct capability/object-scope enforcement without escalating user rights

18. Step-by-step recovery runbook

  1. Contain: classify severity; if privacy or audit integrity is implicated, disable only the affected publication/closure pathway under change control. Avoid indiscriminate shutdown of unrelated services.
  2. Preserve: capture versioned plugin/source fingerprint, DB schema, row-version and audit metadata, sanitized error traces, retention case number, and evidence checksums. Protect the evidence set with restricted access and expiry.
  3. Confirm: query canonical status, both audit records, snapshot pointer/digest, outstanding requirements, legal holds, and notification state. Do not use a cached dashboard as the authoritative source.
  4. Reproduce: recreate using synthetic fixtures and a disposable instance, matching relevant version/configuration. Isolate the smallest failure: authorization, transition map, SQL insert, concurrency, snapshot or side effect.
  5. Correct: ship a narrowly scoped change with a reviewed migration/rollback plan, durable audit semantics, and a negative regression test. For past records, apply a documented reconciliation event rather than inventing an original event.
  6. Revalidate: repeat negative and positive staging cases, inspect database rows and event metadata, verify no secrets/PII enter exports, and obtain independent security/privacy review as required.
  7. Close incident: record build SHA, test receipts, observed results, owner approval, known limitations and outstanding policy decisions; then update the Knowledge Base article’s Last verified version field if evidence supports it.

19. Staging regression and fault-injection matrix

The accompanying CSV defines 22 acceptance cases with required evidence, expected behavior, and execution status. No case in that matrix is represented as a staging pass. At minimum, test completion from active and paused states; cancellation from all eligible states; rejection from terminal states; blank note, invalid confirmation, missing capability, expired nonce, stale version; single failure of each audit insert; portal message insert failure; conflicting concurrent requests; snapshot corruption and privacy redaction; unresolved obligations; hold/erasure conflicts; and public-output privacy probes.

For each test, capture input fixture fingerprint, the exact build and schema, expected HTTP or WP_Error result, status/row version before and after, both audit-write outcomes, portal-message count, and test-run-specific correlation ID. Where a test is not implemented in the platform, label it proposed gate rather than failed native behavior.

20. Monitoring, denominators, and scientific interpretation

Use descriptive observability metrics with explicit cohort windows: audit_traceability = matching_terminal_events / eligible_terminal_engagements; closure_metadata_completeness = complete_terminal_metadata / eligible_terminal_engagements; policy_disposition_completeness = reviewed_closure_dossiers / eligible_closures; and notification_gap = preactivation_cancellations_without_expected_message / preactivation_cancellations. The last two require a formally approved local policy and reliable message-eligibility definition.

Count completion and cancellation separately; do not use “engagements created this month” as the denominator for “engagements closed this month” without explaining the cohort mismatch. For sampled audits, disclose inclusion/exclusion rules, missing data, time window, and reviewer disagreement. A fully reproducible SQL metric still may be biased or operationally misleading. A status flag does not establish causal program impact, contractual satisfaction or scientifically measured service quality.

21. Evidence acceptance criteria and deployment gate

Gate Minimum pass condition Evidence class
Terminal invariants Allowed transition, actor, timestamp, note and version increment correct DB + replay
Authorization Negative roles/nonces/objects rejected; row unchanged HTTP + DB
Audit durability Mandatory state and audit writes commit together or fail together Fault injection + transaction log
Concurrency Exactly one winning terminal transition and one canonical event Parallel-run receipt
Snapshot consistency Exact stored bytes match SHA-256; version/pointer review complete Hash + SQL
Privacy No restricted narratives in public output; erasure/hold conflict handled Privacy reviewer
Notifications No duplicate notices; missing post-commit messages reconciled Portal evidence
Obligations (proposed) Documented acceptance, waiver or cancellation disposition Independent owner attestation
Operational readiness Staging cases complete, recovery/rollback tested, security review signed Release acceptance receipt

22. Limitations, escalation, and version-specific caveats

This article assesses the source baseline pinned above. It does not assert that a particular deployment runs the same commit or configuration; database snapshots, external communication plugins, and WordPress role assignments can materially change behavior. The read-only queries assume the referenced schema exists under the correct table prefix and the database supports the SQL features shown. The synthetic checker asserts that certain fields are present; only integration tests can verify that authentic request authorization or audit persistence occurred.

Escalate immediately to the service owner and security/privacy reviewer for evidence of terminal state without mandatory audit, unauthorized closure, identifiable information in a public report, deliberate event tampering, or erasure while a valid hold is active. Preserve relevant forensic evidence under restricted access and do not distribute private case data in publicly indexed support material. A public documentation page should contain the method and synthetic examples, not actual restricted incidents.

23. Technical references and implementation baseline

  1. Engagement repository, pinned commit, status changes, audit writes, snapshot and privacy methods.
  2. Engagement admin handler, capability, nonce and confirmation contract.
  3. Engagement schema, status and requirement enumerations.
  4. Audit log implementation, general ledger insertion.
  5. Engagement handoff documentation, readiness and commercial boundary.
  6. Privacy and Retention Center, hold, execution and tombstone model.
  7. WordPress: check_admin_referer(), request-intent check.
  8. WordPress: current_user_can(), authorization checks.
  9. WordPress: wpdb::prepare(), SQL parameters and identifiers.
  10. OWASP Logging Cheat Sheet, auditable application events, integrity and privacy boundaries.
  11. OWASP Authorization Cheat Sheet, effective permission boundaries.
  12. NIST SP 800-92, log management principles.
  13. European Commission: GDPR principles, minimization and retention principles where applicable.

Related Knowledge Base article: Validate Scientifically Engagement Closure — Contact and Engagement Platform. Link it through the article editor only after confirming its canonical URL. Verification boundary: the offline checker is developer tooling for synthetic packets; it does not write to WordPress or certify the production platform.

Scroll to Top