Troubleshooting

Troubleshoot proposal preparation — Contact and Engagement Platform

Diagnose proposal preparation failures by tracing inquiry access, content versions, authorized publication, sender approval receipts, and Statement of Work governance. This developer troubleshooting guide provides read-only WordPress reconciliation, reproducible synthetic tests, and controlled recovery procedures that protect confidential proposals and approval history.

ProductContact and Engagement PlatformComponentProposal Preparation, Versioning & Approval GovernanceUpdatedNovember 21, 2026Reading time22 minutes

Application: Contact and Engagement Platform
Component: Proposal preparation, versioning, sender approval and Statement of Work governance
Article type: Developer troubleshooting / diagnostic procedure
Status: Source reviewed; offline diagnostics tested; staging and production acceptance pending
Estimated reading time: 20–23 minutes

Diagnose proposal preparation failures by reconciling inquiry permissions, content versions, controlled publication, sender decisions and immutable-hash approval receipts. Restore consistent state without silently publishing drafts, changing approved agreements, or disclosing private engagement records.

Goal

Determine why a proposal cannot be created, versioned, published, accepted or converted, and establish a defensible recovery path. Primary acceptance criterion: every sender-visible proposal points to the intended version; every governed decision has appropriate attribution and version-bound evidence; unauthorized actors cannot read or publish private proposals. A successful save or interface notification alone does not satisfy this criterion.

Requirements

  • Authorized staff member with scoped inquiry permissions; for publication, the specific sc_intake_publish_proposals capability.
  • Source-matched plugin schema and deployment version, approved staging with synthetic inquiries, and a privacy-approved diagnostic window.
  • Read-only access to aggregate tables or the approved WP-CLI diagnostic. Run write and fault-injection tests only in a resettable staging environment.
  • Recorded incident identifier, UTC timestamps, affected proposal number, expected state, observed state, and nonsecret error codes; do not copy names, email addresses, portal tokens or contract content into public issues.

Repository review establishes SC_EI_VERSION=2.0.2, SC_EI_WORKFLOW_SCHEMA_VERSION=1.3.0, and SC_EI_PROPOSAL_SCHEMA_VERSION=1.0.1. These are source identifiers, not evidence of installed release parity.

Symptoms

Observed symptom First inspection Common error or evidence
Proposal cannot be created Inquiry availability, sender-portal access, required title/summary/scope/deliverables workflow_inquiry_unavailable, workflow_portal_required, workflow_proposal_content_required
New revision not retained Pending version, unique version number, row_version workflow_proposal_conflict, workflow_proposal_version_failed
Publish blocked Current state, pending pointer, version hash, SOW lock workflow_proposal_not_draft, workflow_proposal_version_missing, proposal_publish_sender_approved_sow_locked
Portal acceptance rejected Active published version, expiry, session, confirmation and attestations workflow_proposal_unavailable, workflow_proposal_confirmation_failed, proposal_approval_version_stale
Acceptance shown but receipt missing Approval row, receipt hash, response compensation and hardening log workflow_proposal_approval_receipt_failed, proposal_sender_response_receipt_failed
Published revision conflicts with SOW SOW status and proposal_version_id Locked sender-approved SOW or failed reconciliation
Unexpected private disclosure Portal access, projection allowlist, export capability, caching Privacy/security incident; restrict access first

Cause

Do not attribute all failures to invalid consent or caching. The reviewed implementation separates inquiry availability, sender-portal access, staff capability, proposal status, current/pending version pointers, approval receipt, and Statement of Work (SOW) governance. Each can fail independently. A mismatch may also arise between committed database state and later notification, audit or cross-object handoff. Confirm the first failed boundary before changing data.

5. Actual source-reviewed objects

Object Important fields Diagnostic use
proposals id, inquiry_id, access_id, status, current_version_id, pending_version_id, row_version, published_at, published_by, contract_reference Canonical parent and concurrency state
proposal_versions proposal_id, version_number, content_hash, created_by, created_at Version identity, authorship and content provenance
proposal_approvals proposal_version_id, sow_id, action, actor_type, actor_id, confirmation_hash, immutable_hash Version-bound sender decision evidence
statements_of_work proposal_id, proposal_version_id, status, sender_visible Agreement lock and supersession boundary
workflow_events object_type, object_id, event_type, actor_type, actor_id, created_at Event reconstruction, not a substitute for persistence proof

The actual WordPress table prefix is installation-specific. Use SC_EI_Database::table() in trusted code rather than assuming wp_.

6. Review the intended lifecycle

The workflow repository creates a draft with a pending version; publishing moves that version into current_version_id. A later edit creates a new pending_version_id without replacing the sender-visible version until authorized publication.

draft + pending_version_id
   | authorized publish + integrity/lock check
   v
published + current_version_id (pending cleared)
   | sender confirms receipt      -> published
   | sender requests changes      -> changes_requested
   | sender accepts              -> accepted_pending_contract
   | sender declines             -> declined
   | staff separately records agreement evidence -> contracted

Expiration, withdrawal, supersession and engagement conversion are separate paths. Sender acceptance is not an executed contract, and the system must not automatically generate a payment or signed agreement from a portal response.

7. Check inquiry and sender-portal prerequisites

  1. Locate the canonical inquiry and its privacy status. A missing or erased inquiry blocks proposal creation.
  2. Verify a linked sender-portal access record exists and has an allowed active or invited state for the reviewed path.
  3. Verify staff has sc_intake_create_proposals for creation or editing; publication additionally requires sc_intake_publish_proposals.
  4. Check that the request supplies nonempty title, executive summary, scope and deliverables, without importing restricted source material.
  5. Confirm the intended inquiry and access belong together; do not assume a general multi-tenant API exists merely because an incident form mentions “tenant.”

Never bypass these checks by editing the proposal table directly.

8. Resolve missing or conflicting versions

create_proposal_version() assigns the next version_number, inserts the version with a SHA-256 content_hash over canonical application content and retries a bounded number of times. add_proposal_version() then changes the pending pointer under a row_version compare-and-swap guard. If the parent update fails, code attempts to remove the newly inserted orphan.

  1. Compare the current and pending pointers and inspect whether each belongs to this proposal.
  2. Check the unique (proposal_id, version_number) constraint and the writer’s observed row version.
  3. On conflict, reload current state, reapply the intended authorized changes, and generate a new version through the application workflow.
  4. If an orphan remains after a failed compensation, preserve it for investigation; do not silently delete version history.

The existence of a 64-character hash alone is not evidence of content integrity. Recompute it using the source’s serialization and compare, preferably with PHP runtime parity tests.

9. Diagnose publication guard failures

publish_proposal() requires a draft, published or changes-requested proposal with a complete pending version, a same-proposal version row and a nonempty content hash. It invokes validate_proposal_publication() before changing status. A sender-approved SOW tied to the previous proposal version blocks unsafe replacement.

Do not change a SOW to “draft” or edit its version pointer to make the guard pass. Use governed change control or create an authorized new proposal. Where a prior SOW is not sender-approved, publication may safely supersede it through reconciliation.

10. Diagnose failed publication compensation

Publication updates the parent under optimistic concurrency, then reconciles the related SOW. On reconciliation error, rollback_proposal_publication() attempts to restore prior status and version pointers. A hardening event such as proposal_publication_sow_reconciliation_failed records the failure path. However, compensation itself can fail, and later notifications or audit inserts must be reconciled separately.

Incident rule: a database status of published is not sufficient proof that the intended SOW, portal projection and communication state are consistent. Disable further publication for the affected record while investigating unresolved divergence.

11. Diagnose sender confirmation and authority

The secure sender workflow accepts confirm_receipt, request_changes, accept, and decline. Responses require the relevant proposal number confirmation string; accepting uses ACCEPT <PROPOSAL-NUMBER>. The source also supports configured authority and boundary acknowledgments in the workflow, while the approval-receipt layer requires both on acceptance and SOW approval.

Distinguish “no permission to respond,” “expired or superseded version,” “confirmation mismatch,” and “receipt write failure.” Re-requesting acceptance without checking for an existing matching receipt may create conflicting evidence. A correctly repeated response may be idempotent; a conflicting replay must be rejected.

12. Reconcile missing or inconsistent approval receipts

record_sender_action() binds an action to the current published proposal version, sender portal session, confirmation digest, attestations and canonical receipt hash. respond_to_proposal() calls it synchronously; if the receipt write returns an error, the workflow attempts to roll back the proposal response and records proposal_sender_response_receipt_failed.

Inspect proposal_approvals for the exact proposal, version and action. Use the platform’s integrity verification, or the independent sample checker for a synthetic packet. A hash stored in the same writable database is tamper-evident under its trust assumptions, not inherently tamperproof. Independent integrity assurance additionally requires controlled writes, protected logs and appropriate backups.

13. Check Statement of Work (SOW) locks

  1. Read the SOW’s proposal_id, proposal_version_id, status and sender-visibility flag.
  2. For sender_approved, verify the version matches the approved/current proposal version and an appropriate sow_approved receipt exists.
  3. Check for an unauthorized or accidental replacement attempt; proposal_publish_sender_approved_sow_locked should prevent that operation.
  4. For superseded SOWs, confirm the sender projection no longer exposes the obsolete agreement as active.
  5. Preserve historical records and route changes through a governed change request rather than modifying prior approval evidence.

14. Reconstruct the incident sequence

Establish time-ordered evidence, preferably UTC, from the proposal row, version row, action receipt, SOW, workflow events, and hardening audit. Do not infer order solely from a user interface timestamp. Correlate a request identifier internally; suppress identifiers before public disclosure.

Sequence Evidence to retain privately Question
Draft creation Proposal ID, actor, pending version Was the correct inquiry used?
Revision Version number/hash, previous row version Was concurrent state overwritten?
Publication Current pointer, publication actor/time, SOW guard Which version was exposed?
Sender action Portal session, action, version-bound digest Was the decision authenticated and attributed?
Compensation Error code, before/after statuses, audit event Did rollback fully restore the prior boundary?

15. Read-only WordPress reconciliation

Use the separate read_only_wordpress_reconciliation.php only from a trusted WP-CLI shell, with the script stored outside the public webroot. It reads a bounded 30-day creation cohort (at most 300 proposals), reads only limited identifiers and state fields internally, and emits aggregate anomaly counts. It does not produce a list of affected people or proposals. Running it is not required to publish the article.

WP_PATH="/path/to/verified/wordpress-root"
php -l /secure/operator/read_only_wordpress_reconciliation.php
wp --path="$WP_PATH" eval-file \
  /secure/operator/read_only_wordpress_reconciliation.php

Inspect the script before execution and record its checksum. The result is a sampling aid: older proposals are excluded, the cohort may be truncated, and hash recomputation, portal testing and notification delivery still require separate checks. Do not paste aggregate counts from very small sensitive cohorts into public tickets without privacy review.

16. Minimal safe SQL for authorized review

The following example is a template for a privileged, read-only database session, not a public query route. Substitute the confirmed site prefix and an incident-scoped numeric ID. Avoid SELECT * and do not export proposal body text.

-- Example only; replace wp_ with the verified WordPress table prefix.
SELECT p.id, p.status, p.row_version,
       p.current_version_id, p.pending_version_id,
       v.version_number, v.content_hash
FROM wp_sc_ei_proposals AS p
LEFT JOIN wp_sc_ei_proposal_versions AS v
  ON v.id = p.current_version_id AND v.proposal_id = p.id
WHERE p.id = 101;

A matching query does not establish that the writer had authorization, that the portal applied the sender allowlist, or that external documents and notifications were delivered correctly.

17. Reproducible synthetic incident packet

The supplied Python checker consumes a purpose-built synthetic diagnostic packet, not the plugin’s REST API, database export or JSON schema. It checks version pointers, receipt linkage, approval digests, SOW state, and separately supplied access-test results. Never give it real sender messages or tokens; prepare synthetic fixtures or an authorized minimization layer first.

python3 -m unittest -v test_proposal_incident_checker
python3 proposal_incident_checker.py fixtures/valid_proposal_packet.json
python3 proposal_incident_checker.py fixtures/invalid_proposal_packet.json \
    --out invalid_report.json
# Expected: exit 0 for clean input, exit 2 when findings exist.

The invalid fixture deliberately creates multiple independent problems. Not every finding necessarily represents a separate incident. A diagnostic test passing does not prove the WordPress plugin enforced the equivalent control.

18. Approval digest reproduction

The reviewed SC_EI_Proposal_Governance_Schema::canonical_hash() sorts the top-level payload keys and hashes an unescaped Unicode/slash JSON representation. The independent Python checker reproduces that model for the included ASCII fixtures. It does not establish complete cross-language equivalence for arbitrary Unicode, numeric types, plugins modifying fields or legacy version formats; verify those in the PHP runtime.

import hashlib, json
payload = {"action":"proposal_accepted", "proposal_id":101}
serialized = json.dumps(payload, sort_keys=True,
                        separators=(",", ":"), ensure_ascii=False)
print(hashlib.sha256(serialized.encode("utf-8")).hexdigest())

Do not recompute a new digest and overwrite a failed receipt as a “repair.” Preserve the original evidence, establish provenance, and follow the authorized governance process.

19. Privacy and access checks

Test anonymous access, a sender from an unrelated inquiry, staff without sc_intake_publish_proposals, and authorized sender portal views. Inspect only approved sender-visible fields. Sensitive values include internal notes, legal or financial terms not approved for that audience, receipt hashes, authentication tokens and other contacts’ information.

Source review supports scoped WordPress capabilities and private portal session controls. It does not independently prove the deployed site has no cache, webhook, search index or export misconfiguration. Verify response headers, indexes, export destinations and plugin cache behavior on staging. If private information escaped, treat it as a privacy/security incident; do not attach the material to a public issue.

20. Replay and concurrency negative tests

Using resettable synthetic staging data, run two writers against the same row_version and verify only the intended revision wins. Repeat a sender action with identical receipt fields and confirmation to test safe idempotency; then alter the version, note or actor to require a replay conflict. Inject a database write failure immediately before approval receipt persistence and confirm the response is either cleanly rolled back or visibly escalated with a failure code.

Observe three layers separately: application return/error, durable proposal/receipt rows, and eventual event/audit output. A single successful HTTP response is not adequate evidence of all three.

21. SOW reconciliation and publication-failure injection

On staging only, publish a revision while a SOW is (a) not yet sender-approved and (b) sender-approved. Case (a) should reconcile the old SOW according to its status and preservation rules; case (b) must reject publication without replacing approved scope. Simulate reconciliation failure and verify the prior proposal status/version pointers are restored, or the failure is treated as an unresolved incident requiring operator review.

22. Quantitative diagnostics and uncertainty

Define a cohort of authorized, synthetic submission attempts. Report successes, actual failures, and unresolved outcomes separately for creation, revision, publication, approval and SOW reconciliation. Calculate an observed failure proportion as failures / (successes + failures) only when unresolved outcomes are explicitly reported beside the denominator. Do not silently count unknown results as successes.

from math import sqrt
def wilson(successes, trials, z=1.96):
    if trials == 0: return None
    p = successes / trials
    d = 1 + z*z/trials
    c = (p + z*z/(2*trials)) / d
    h = z*sqrt(p*(1-p)/trials + z*z/(4*trials*trials))/d
    return (round(max(0,c-h),4), round(min(1,c+h),4))
print(wilson(30,30))  # approximately (0.8865, 1.0)

Even 30 successful trials yield a two-sided 95% Wilson lower bound of about 0.8865 on the underlying success proportion under independent identical trials. That bound is not evidence of universal privacy or correctness. Stratify by actor role, version state, publication guard, SOW status and fault type; explain selection bias and environmental differences.

Troubleshooting

  1. Reproduce safely: create a synthetic inquiry and authorized portal access; record expected state and current source version.
  2. Classify failure: input/permission, version/concurrency, publication/SOW, sender response/receipt, or visibility/export.
  3. Locate first failed contract: compare identifiers, current/pending pointers, row_version, and exact error code.
  4. Preserve evidence: save minimized event sequence, checksum of synthetic packet, source commit, and staging run ID.
  5. Validate privacy: separately test unauthorized identities and content projections without revealing actual private records.
  6. Repeat the negative control: ensure the dangerous state still fails closed after the proposed fix.

Resolution

Choose the narrowest authorized recovery. For validation errors, correct inputs and resubmit as a new governed attempt. For optimistic concurrency conflicts, reload and create a fresh version rather than overwrite row counters. For missing receipt evidence, stop treating the proposal as finally accepted until the transaction is reconciled; never invent backdated approvals. For SOW locks, use approved change control or an independent new proposal. For portal leakage, disable the affected delivery path, secure the evidence, assess exposure and notify the designated privacy/security owner.

Any code correction should be delivered through a reviewed pull request with a rollback plan, regression tests, and bounded staging evidence. Do not run direct SQL UPDATE, DELETE or production fault injections to “fix” a public-facing symptom.

Verification

Acceptance check Required observation
Version pointer Published proposal references exact expected proposal/version; pending state is correct
Authority Unauthorized staff cannot publish and unrelated portal sender cannot see the proposal
Receipt Sender decision receipt matches action, actor, current version and digest; failure does not silently succeed
SOW Sender-approved SOW remains bound to approved proposal version; unsafe revision rejected
Recovery Failed publication/response restores previous state or records an explicit unresolved incident
Privacy No private content in anonymous endpoints, search, logs or unintended exports
Evidence Test ID, expected/actual outcome, source SHA, run time, reviewer and reproduction stored in restricted evidence

Only call a deployed control verified once its matching environment and permissions have been tested. A test marked NOT RUN remains unverified regardless of source-review confidence.

26. Negative and positive test matrix

Test ID Expected positive case Required negative case
PP-01 Draft binds inquiry and portal Erased inquiry / invalid portal access rejected
PP-02 Distinct numbered versions Concurrent stale write rejected
PP-03 Authorized pending version published Missing pointer/hash/permission rejected
PP-04 Authenticated sender receipt Missing session/attestation and conflicting replay rejected
PP-05 Sender-approved SOW protected Unsafe replacement blocked
PP-06 Failure compensated Receipt/SOW write injection cannot silently report complete success
PP-07 Approved sender projection Anonymous, cross-inquiry, search/export leak rejected

27. Reporting boundary

Separate four claims: source-reviewed design, offline diagnostic behavior, staging execution, and production verification. State which release and exact commit were observed, cohort size, excluded outcomes, operating context, uncertainty and reviewer decisions. The synthetic checker is independently written and is not a plugin API or proof of deployed authorization. Published documentation must not include identifiable sender cases or private contract terms.

28. Technical references

Evidence provenance: repository Content-Catalyst-LLC/sustainable-catalyst-engagement-intake, reviewed commit 3f246974276a5e582d09f8c48d21628b82626bc7, source plugin 2.0.2. The developer package supplies independent synthetic fixtures and a read-only helper; its staging matrix is not an execution record.

Scroll to Top