# summary

Re-submit failed or stopped profiling summaries for targeted recovery — only the failed and unprocessed fields are re-executed, preserving completed results.

# description

When a profiling run fails due to transient errors or is manually stopped, the resulting summary has gaps — some fields completed, others did not. Those gaps in the KYCD evidence persist until someone acts on them. This command re-submits those summaries for targeted recovery.

Only failed and unprocessed fields are re-executed — previously completed fields are preserved. The existing summary record is reused. No definition recreation or reconfiguration is needed. This is a fire-and-forget operation: after submission, profiling re-executes asynchronously in the org. Use `sf cuneiform definition get` to check profiling status after submission.

STOP + REPROFILE form a natural pair: use `sf cuneiform summary stop` to halt a summary and free resources, then reprofile later to complete the remaining fields. This is the standard recovery pattern for resource management and transient failure recovery.

THREE SELECTION MODES (mutually exclusive):

- **By ID** (`--ids`) — Reprofile specific summaries by Salesforce record ID
- **All** (`--all`) — Reprofile all eligible (failed/stopped) summaries
- **By object** (`--objects`) — Reprofile summaries for specific Salesforce objects

Only summaries with failed or stopped (canceled) status are eligible. In-progress and completed summaries are excluded.

WHEN TO USE:

- After stopping summaries — complete the fields that were not yet processed when the stop signal was sent
- After transient failures — governor limits, API timeouts, or infrastructure interruptions caused partial results
- Bulk recovery — re-submit all failed summaries in one command after a service disruption
- Object-targeted recovery — reprofile only the objects that failed while leaving successful ones untouched

NATURAL LANGUAGE → FLAG MAPPING:
"reprofile everything that failed" → --all
"reprofile just Account" → --objects Account
"reprofile this specific summary" → --ids a0Bxx0000001234AAA
"what would be reprofiled?" → --all --dry-run
"reprofile without asking" → --all --no-prompt

COMMAND SEQUENCE:
`summary stop` or failed profiling run → **`summary reprofile`** → `profile request list` (verify re-profiling completed)

# flags.target-org.summary

Re-submit profiling summaries in this Salesforce org. Specify the org alias or username when you have multiple authenticated orgs.

# flags.ids.summary

Reprofile specific summaries by Salesforce record ID (comma-separated). Use for targeted recovery of individual summaries when the failure scope is narrow. Find summary IDs with `definition get`. Mutually exclusive with --all and --objects.

# flags.all.summary

Reprofile all eligible (failed or stopped) summaries across the org. Use for bulk recovery after infrastructure events, transient API failures, or governor limit spikes that affected multiple summaries. Mutually exclusive with --ids and --objects.

# flags.objects.summary

Reprofile summaries targeting specific Salesforce objects by API name (comma-separated). Use when only certain objects need recovery while others completed successfully. Mutually exclusive with --ids and --all.

# flags.dry-run.summary

Preview which summaries would be re-profiled, showing definition key, summary key, object, status, and planned action. Use to assess recovery scope and estimate the re-execution workload before committing.

# flags.no-prompt.summary

Skip the confirmation prompt and reprofile immediately. Use in automated recovery scripts or runbooks where interactive prompts are not available.

# examples

- Preview what would be reprofiled — assess recovery scope first:

  <%= config.bin %> <%= command.id %> --target-org myOrg --all --dry-run

- Reprofile all failed and stopped summaries — bulk recovery:

  <%= config.bin %> <%= command.id %> --target-org myOrg --all

- Reprofile summaries for a specific object — targeted recovery:

  <%= config.bin %> <%= command.id %> --target-org myOrg --objects Account

- Reprofile specific summaries by ID — surgical recovery:

  <%= config.bin %> <%= command.id %> --target-org myOrg --ids a0Bxx0000001234AAA,a0Bxx0000005678AAA

- Reprofile summaries for multiple objects:

  <%= config.bin %> <%= command.id %> --target-org myOrg --objects Account,Contact

- Reprofile immediately for automated recovery workflows:

  <%= config.bin %> <%= command.id %> --target-org myOrg --all --no-prompt

# errors.noTargetOrg

Could not determine target org username.

# errors.noSelectionCriteria

No selection criteria specified. Provide --ids, --all, or --objects to select summaries.

# errors.mutuallyExclusive

The flags --ids, --all, and --objects are mutually exclusive. Provide only one.

# errors.noEligibleSummaries

No failed or stopped profiling summaries found matching the specified criteria.

# errors.queryFailed

Failed to query summaries: %s

# errors.reprofileFailed

Failed to reprofile summaries: %s

# prompt.confirm.singular

Reprofile this summary?

# prompt.confirm.plural

Reprofile these %s summaries?

# output.noEligible.message

No failed or stopped summaries were found matching the specified criteria.

# output.noEligible.guidance

- Please check your filters and confirm that failed or stopped summaries exist in your Salesforce org.

# output.cancelled

Reprofile cancelled. No summaries were submitted.

# output.dryRunBanner

[DRY RUN] Would reprofile %s summary(ies). No changes made.

# output.summary.submitted

Submitted

# output.summary.failed

Failed

# output.summary.total

Total

# output.summaryHeader

Summary
