Salesforce + DocuSign CLM integration for automated Appraiser Review Letter generation
Go to file
paulh 82e10ff810 fix(ralph-loop): add session limit detection and auto-recovery
When claude -p hits the Pro subscription usage limit, the old loop had
no detection — it would find no <promise> signal, treat it as a normal
continuation, and immediately retry, burning all --max iterations.

New behaviour:
- check_output() returns status 4 when the log contains any usage/rate
  limit message (case-insensitive, multiple pattern variants)
- wait_for_session_reset() polls via a trivial probe call every
  SESSION_POLL_INTERVAL seconds (default: 600s / 10 min) until claude
  responds cleanly again
- When rate-limited, the same iteration is retried (i is not incremented)
  so no task is skipped or double-counted
- set -e is temporarily suspended around agent calls so a non-zero claude
  exit doesn't kill the bash process

Also updated the master template in docs/agent-harness/ralph-loop.sh.

Agent: human
Tests: N/A
Tests-Added: 0
TypeScript: N/A
2026-04-09 21:39:29 -04:00
artifacts/doc_inspect Add Appraiser Review Letter template and XML merge data 2026-04-05 14:22:57 -04:00
docs Update FEATURES_UPDATE and NEXT_STEPS to reflect current state 2026-04-09 21:16:58 -04:00
force-app/main/default Remove erroneous ClientCertificate from CLMs1NamedCreds 2026-04-09 21:11:25 -04:00
manifest Retrieve AcctDemo_NamedCreds into source; add to manifest 2026-04-09 21:01:23 -04:00
scripts Fix LWC async bug, null guard, stale sample script; update manifest 2026-04-09 20:50:57 -04:00
.gitignore Add retrieved/ and .codex to .gitignore; document manual credential setup 2026-04-09 20:51:03 -04:00
AGENT.md chore: scaffold agent harness for Phase 2 eSignature envelope creation 2026-04-09 21:34:11 -04:00
DECISIONS.md chore: scaffold agent harness for Phase 2 eSignature envelope creation 2026-04-09 21:34:11 -04:00
IMPLEMENTATION_PLAN.md chore: scaffold agent harness for Phase 2 eSignature envelope creation 2026-04-09 21:34:11 -04:00
PROJECT-SPEC.md chore: scaffold agent harness for Phase 2 eSignature envelope creation 2026-04-09 21:34:11 -04:00
ralph-loop.sh fix(ralph-loop): add session limit detection and auto-recovery 2026-04-09 21:39:29 -04:00
sfdx-project.json Create Appraiser Case custom record and DocGen service 2026-04-05 14:31:51 -04:00

docs/README.md

Appraiser Review Letter Generator (Salesforce + DocuSign CLM)

Overview

This repo contains a Salesforce metadata project for generating appraiser review letters from Appraiser_Case__c data in DocuSign CLM, while also providing a growing proof-of-concept surface for DocuSign eSignature API workflows.

Current status

  • The repo is standardized on the XML CLM merge path built around AppraiserCasePayloadBuilder + CLMDocGenCallout.
  • Appraiser_Case_Deficiency__c is the canonical child deficiency object used by both the UI and document generation.
  • Account-based DocuSign configuration lives in CLM_Account_Setting__mdt.
  • The current Salesforce UI includes:
    • the Generate Review Letter quick action for CLM doc gen
    • the Docusign eSignature record tab for eSignature browsing
  • CLM generation, task tracking, file attachment, and eSignature template/envelope browsing are all implemented.

Read this first

Documentation note

Older planning docs still exist, but PRODUCT_SPEC.md, CURRENT_STATUS.md, SALESFORCE_SETUP.md, and the source code are now the best reflection of the project.


Last updated: 2026-04-09