Troubleshooting
Troubleshoot event and workflow provenance — Sustainable Catalyst Platform Core
Event and workflow provenance failures can compromise research traceability when transitions are duplicated, dependencies are unresolved, or retries produce inconsistent results. This guide covers diagnosing those failures, preserving causal relationships, and recovering without altering accepted research records.
Application: Sustainable Catalyst Platform Core
Area: Workflow Orchestration & Event Governance
Article type: Troubleshooting / technical operations
Estimated reading time: 17–20 minutes
Status: Source-reviewed troubleshooting guidance; deployed acceptance pending.
Source baseline: Platform Core pinned commit
1. Goal
Diagnose lost, duplicated, misordered, stale, or misattributed workflow events without changing an accepted research result. The core acceptance condition is one authoritative event or result per logical operation, even if the transport, worker, or webhook retries. A retry or dead-letter replay may legitimately produce a new attempt or diagnostic event; it must not silently create a second authoritative research outcome.
Resolve failures by following the exact workflow run, project, service, source revision, actor, accepted state, and downstream handoff. Treat event transport, evidence validity, authorization, and publication approval as separate questions.
2. Requirements
- Explicit operator authorization for the relevant organization, project, source data, and staging environment; do not test private research via a public endpoint.
- A known Platform Core release/commit, API route, supported schema, and nonsecret request or correlation ID.
- Read access to workflow state, transition history, worker/dead-letter records, and authorized downstream verification receipts. Collect secrets only through approved secret management; never put credentials in exported evidence.
- An immutable or retained pre-recovery snapshot of the accepted research state, its revision and content hash, plus the current state and time window.
- For replay testing, a disposable workflow and synthetic inputs. Do not replay a real production dead letter solely to investigate duplication.
3. Procedure
Identify the owning event system first. Then use the subsystem-specific procedures below to inspect authoritative state, compare attempts, and preserve evidence.
Platform Core exposes distinct implementations. Their identifiers and guarantees are not interchangeable:
| Subsystem | Source-backed object and route | Critical diagnostic boundary |
|---|---|---|
| Signature workflow runs | /v1/workflow-runs/{run_id} and /v1/workflow-runs/{run_id}/steps/{step_key}/transition |
Step status, transition hash, ledger entry, webhook event; earlier required steps can block progress |
| Research workflow registry | /v1/research/workflows/{workflow_id}/bundle, /timeline, /lineage; declared transition /transitions/{transition_key}/apply |
Declared/applied transitions, workflow events, stages, revisions, snapshots and product handoffs |
| Reliability queue | /v1/reliability/queue, /dead-letters, /dead-letters/{id}/replay, /stream |
Work item ID, lease, retry count, ingestion run, dead-letter lineage and SSE cursor |
| Cross-runtime workflow contract | /api/v1/cross-runtime-workflows/validate-run and /validate-package |
Typed dependency DAG, runtime/handoff fingerprints, unique package event IDs; does not execute jobs |
These paths are established by inspected router code; their presence in source does not confirm production enablement. The /api/v1/cross-runtime-workflows prefix belongs to a contract-validation router and should not be mistaken for the unified authenticated public API’s generic behavior.
4. Procedure — classify the symptom before changing anything
| Symptom | Likely failure boundary | First safe check |
|---|---|---|
| Two apparent completions for one step | Retry, duplicate transition, webhook redelivery, or two distinct authoritative rows | Compare logical operation, run ID, attempt, content hash, and persisted transition IDs |
| Step stays blocked | Unfinished prior required steps or unverified cross-runtime dependency | Inspect blocking_steps on HTTP 409; verify handoff fingerprint |
| Work complete but stream event absent | State commit and event emission happened separately | Check authoritative work row before assuming a failed operation |
| Repeated events after SSE reconnect | Cursor resumption / at-least-once delivery | Inspect stream numeric ID and Last-Event-ID, not just timestamps |
| Different final output after retry | Input or method drift, unsafe replay, changed dependency | Compare request payload digest, method/runtime references and accepted output digest |
| Event visible across project boundaries | Resource authorization or disclosure filtering | Stop distribution and run negative owner/tenant tests on authorized staging |
| Saved revision does not match live state | Read-after-write, stale cache, partial recovery, schema drift | Re-read accepted snapshot from independent session, compare revision and hash |
5. Procedure — preserve the accepted state and incident timeline
- Record the affected workflow ID, project, authorized organization, event/transition ID, workflow stage, target service, operator role, and trace/request ID.
- Capture the accepted revision, content hash, last verified handoff, and baseline public/private designation. Store a protected snapshot or approved backup before edits or replays.
- Export only minimal metadata: UTC observation time, event kind, logical operation ID (where available), attempt/work item ID, parent/dependency IDs, actor category, outcome, hash, and error status. If Core does not provide a field, mark it not recorded; do not fabricate it.
- Set the workflow/connector to a safe paused or blocked state using a documented owner-approved control if active operations might duplicate results. Preserve evidence without deleting the original failed record.
- Separate observed event time, persistence time, delivery time, and scientific observation time; none can be substituted for another.
6. Procedure — inspect workflow transitions and status constraints
The signature-workflow implementation records transition hashes and appends ledger and webhook activity. It rejects an invalid step-status progression with HTTP 422. A step blocked by earlier required steps returns HTTP 409, including blocking_steps. Compare the current run and step state before retrying a transition.
# Read-only: run only against an approved isolated staging endpoint.
# These are actual source paths; staging enablement must be verified.
export SC_STAGING_BASE_URL='https://YOUR-APPROVED-STAGING-HOST'
export SC_WORKFLOW_ID='SYNTHETIC_WORKFLOW_ID'
curl --fail-with-body --silent --show-error \
"$SC_STAGING_BASE_URL/v1/workflow-runs/$SC_WORKFLOW_ID" \
-o workflow-run.json
# Inspect locally; never paste private results into a public ticket.
python3 -m json.tool workflow-run.json >/dev/null
Security note: In the inspected source, a number of internal read routes use a general require_read setting rather than end-user membership checks. Restrict the test host to the authorized environment; an endpoint being reachable does not prove per-project access isolation.
7. Procedure — distinguish declared research transitions from applied transitions
The research-workflow registry stores declarative transitions and applies one only when the request states declared_complete=true. Its implementation rejects transitions marked rejected or cancelled. The inspected function does not visibly check for applied before applying again; it creates a transition_applied event and commits the update. This is a source-level duplicate-application risk to test in staging, not proof of production duplicates.
After an ambiguous timeout, retrieve the transition and timeline rather than automatically POSTing again. Compare its current status, applied timestamp, event key, current stage, snapshot revision and expected output. If already applied, reconcile the response with the original operation instead of executing it again. A transition key or event_key alone is not an established cross-service idempotency guarantee.
8. Procedure — distinguish worker attempts, dead letters and authoritative outcomes
The reliability queue persists ConnectorWorkItem state and emits separate stream events. Workers claim pending items with a lease; expired leases can return to pending. Failure schedules another attempt or records a dead letter. replay_dead_letter() creates a new work item and updates the original dead-letter replay metadata. Never count every replay, work item, stream event, and ingestion record as separate scientific results.
# Nonmutating staging diagnostics:
curl --fail-with-body --silent --show-error \
"$SC_STAGING_BASE_URL/v1/reliability/queue?limit=100" \
-o queue.json
curl --fail-with-body --silent --show-error \
"$SC_STAGING_BASE_URL/v1/reliability/dead-letters?limit=100" \
-o dead-letters.json
# Replaying via POST is intentionally omitted from this diagnostic runbook.
A queued event, retry scheduled event and completed work item represent different facts. If an emission fails after a successful work-item commit, a stream gap does not necessarily mean the work item was lost. Confirm the durable row and any corresponding ingestion record independently.
9. Procedure — check event stream resumption without inferring causality
The reliability service exposes internal GET /v1/reliability/stream and a scoped public GET /api/v1/reliability/stream, with after_id, event_type, Last-Event-ID, and once=true. The public stream requires the data:read scope and selects only records marked public.
# Approved isolated staging only, using a test public credential.
# The key is loaded from the environment and never written to the output.
curl --silent --show-error --no-buffer \
-H "Authorization: Bearer $SC_STAGING_PUBLIC_API_KEY" \
-H 'Last-Event-ID: 0' \
"$SC_STAGING_BASE_URL/api/v1/reliability/stream?once=true" \
-o stream-snapshot.txt
An SSE integer cursor is a delivery position, not a causal parent ID. Reconnects may legitimately repeat events; consumers should deduplicate using a stable event identifier and reconcile against the authoritative object. Never mark research complete solely because an SSE notification arrived.
10. Procedure — reconstruct causal dependencies and handoffs
Build a directed graph of declared input/dependency relationships. For each step, record the upstream output reference, input revision, method/environment version, target runtime, handoff ID, verification receipt, and accepted resulting artifact. A verified R-to-Julia handoff is not interchangeable with a generic same-format file transfer.
The sc.core.cross-runtime-research-workflow.v1 contract validates an acyclic workflow, known dependency endpoints and verified handoffs, and uses fingerprints for steps and transfers. It does not schedule jobs, execute them, or prove scientific correctness. Validate a sanitized copy of the actual supported schema before attributing a missing result to a scheduler or runtime.
expected evidence relationship (illustrative, NOT a Core API request):
step:A --produces--> artifact:1
artifact:1 --verified-by--> handoff:H
handoff:H --satisfies-dependency--> step:B
step:B --produces--> result:R
If handoff:H lacks verification, step:B must not be treated
as ready for an authoritative downstream result.
11. Procedure — verify read-back, revisions and immutable snapshots
Research workflow revisions record prior/revised state and a hash. The snapshots path creates content-hashed snapshots with a previous_snapshot_hash link. Inspect the requested revision and last accepted state, and independently fetch a fresh bundle/timeline. A hash can detect changed bytes relative to the committed reference; it does not establish valid scientific reasoning, source rights, or a verified actor identity.
Compare: workflow ID, project, revision, content hash, stage statuses, transition IDs, event IDs, input/output relationships, and privacy/publication flags. Preserve the older snapshot when investigating drift; never overwrite it to force a comparison to pass.
12. Procedure — classify transport, authorization and data-integrity errors
| Observed result | Interpretation | Safe response |
|---|---|---|
| 401 / 403 | Missing/invalid credential or insufficient permitted scope, depending on route | Verify identity and route-specific policy; do not replace a user’s identity with a service key |
| 404 | Unknown resource or nonpublic resource; do not infer existence | Verify identifier privately, with explicit operator scope |
| 409 | For signature workflows, earlier required steps may remain incomplete | Inspect blocking_steps and actual state before any transition |
| 422 | Invalid status transition, schema or payload | Compare source schema and required conditions; do not bypass validation |
| 5xx or transport timeout | Unknown operation outcome; response loss does not imply rollback | Read authoritative state; only retry after idempotency is established |
| Unexpected webhook/SSE repeat | Redelivery, replay or actual duplicate | Join event IDs, attempts, work rows and result hashes before diagnosis |
13. Procedure — run the offline evidence checker
The downloadable companion bundle includes check_provenance_incident.py, synthetic-incident-good.json, and a Python unittest suite. The fixture is deliberately not a Platform Core payload or endpoint schema; it teaches an evidence-consistency protocol without any network or database writes.
python3 check_provenance_incident.py synthetic-incident-good.json
python3 -m unittest -v test_check_provenance_incident.py
# Expected first command (abridged):
# "status": "synthetic-check-passed"
# "findings": []
# "deployed_service_tested": false
The checker verifies one authoritative event per logical operation, retry linkage and unchanged request hashes, causal parent order, scope consistency, read-after-write revision/digest agreement, private-event disclosure, and unverified handoff release. It does not authenticate actors, validate the deployed workflow engine, or assess the scientific content of an artifact.
14. Procedure — collect a minimal, nonsecret incident receipt
{
"incident_id": "SYNTHETIC-INCIDENT-001",
"source_commit": "59b8444365525a58fd4f6a7e29a20d712769e1a2",
"workflow_ref": "synthetic-workflow-001",
"operation_ref": "op-analysis",
"attempt_refs": ["try-001", "try-002"],
"authoritative_event_refs": ["ev-001"],
"expected_revision": 4,
"observed_revision": 4,
"denied_access_test": "not-run",
"staging_replay_test": "not-run",
"production_state_changed": false
}
Use an approved internal evidence store rather than a public issue for real receipts. Record which claims are confirmed by logs, repository source, integration tests, and independent read-back. A request ID is a correlation mechanism; it is not an authorization token or a proof of causation.
15. Procedure — execute staging acceptance cases in a safe order
- Seed a disposable workflow with two dependent stages and synthetic input/output artifacts; record accepted state and the baseline number of authoritative events.
- Apply a valid transition once and re-read from another authenticated session. Capture transition/ledger/webhook IDs and final hashes.
- Reissue the same logical transition through the approved test harness. Confirm it is rejected or reconciled without creating a second authoritative result. If it duplicates, stop the rollout and report the exact fixture.
- Submit an earlier-incomplete-step transition and verify the expected HTTP 409 plus unchanged state.
- Simulate response loss after commit. Query the state before any retry, then test idempotency with identical and altered payload digests.
- Under disposable inputs, allow work to reach dead-letter state, replay through an authorized test account, and check that historical dead-letter/work-item lineage remains intact without a second authoritative result.
- Resume an SSE stream from a known cursor; verify public filtering and deduplication without assuming delivery order equals causal order.
- Test a failed/unverified handoff, stale read-back, foreign-project access, private event in public output, and rollback to the accepted snapshot.
The package includes a separate staging acceptance matrix; its scenarios remain not run. Do not run mutation or replay scenarios on production research.
16. Symptoms
Common reports include: repeated workflow completion notifications; one step marked complete while its parent remains pending; a queue item listed as complete without a matching public event; a returned HTTP 5xx followed by a duplicated transition; a replayed dead letter apparently creating an extra finding; a missing or changed result hash after reload; cross-service handoff references that cannot be resolved; or unexpected private metadata in a public workflow bundle.
17. Cause
Root causes may be transport redelivery, absent durable operation keys, concurrent workers, ambiguous writes, unverified cross-runtime handoffs, stale cached state, invalid revision assumptions, authorization gaps, or confusion between event history and authoritative scientific output. The inspected research-workflow transition implementation’s lack of an explicit already-applied guard is a particularly relevant candidate for staging review. A second risk is conflating a newly queued dead-letter replay item with a newly accepted research result.
18. Troubleshooting
| Check | Pass condition | Failure action |
|---|---|---|
| Event and operation identity | Distinct event IDs; stable logical operation ID across retries | Quarantine duplicate authoritative outcomes and preserve both receipts |
| Causal parent relationships | All dependencies resolve and are acyclic | Block downstream approval and resolve missing verified handoff |
| Retry payload | Same logical operation uses same input digest, or is explicitly a new version | Stop blind retries; require revisioned change authorization |
| Fresh-session read-back | Accepted revision, hash and authoritative event set match | Investigate persistence, partial commit and stale caches |
| Authorization and publication | Cross-scope access denied; unapproved events absent from public results | Disable unsafe exposure and route to security owner |
| Ledger and audit trail | Transition and audit evidence trace to retained source rows | Preserve logs, investigate gaps; never manufacture a missing entry |
19. Resolution
For confirmed duplicate authority: stop the affected replay/consumer path and publication pipeline; designate the last accepted result using documented human authorization, retain both event attempts, and reconcile downstream references. Do not silently delete history. Correct the idempotency boundary in the owning service, preferably using a durable unique operation key plus a transactional result receipt and explicit conflict handling.
For missing causality: preserve the incomplete state, obtain the exact predecessor artifact and handoff verification, and rerun only the blocked dependent step in an isolated environment if scientifically authorized. For unclear outcomes: read the durable state, compare hashes and attempt history, and decide whether to reconcile or issue a uniquely versioned new operation. For security/publication leaks: contain exposure, rotate affected credentials if warranted, preserve sanitized evidence, and follow the approved incident process.
Rollback must reference the accepted snapshot and a tested restoration procedure. A compensating event is not the same as erasing a historical transition, and reversing an operational effect does not by itself withdraw already-published scientific claims.
20. Verification
Close the incident only when a fresh authorized session returns the accepted workflow state, the causal graph contains no unresolved required dependency, the same logical operation has at most one authoritative result, retries return/reconcile that result without altering it, public outputs contain only authorized approved records, and all relevant rollback/restore evidence has been retained.
Require negative cases: duplicate transition, changed retry payload, missing parent, invalid handoff, expired or missing authorization, cross-tenant resource, stale revision, stream redelivery, and dead-letter replay. Every failed operation must leave the accepted authoritative result unchanged. Production verification additionally requires a pinned deployed image/commit, authenticated environment, operator approval, actual run IDs, CI and staging receipts, and a rollback rehearsal.
21. Scientific and governance boundaries
Transport delivery, hash integrity, provenance completeness, scientific correctness, editorial approval, and publication permission are independent. A signed or hashed event can be faithfully recorded but scientifically mistaken. A public workflow state does not imply that every linked source or derivative may be redistributed. Preserve source licenses, observation dates, research methods, uncertainties, reviewer decisions, and correction/withdrawal history in the responsible systems.
Do not infer that the Core cross-runtime contract executes research jobs; its documented responsibility is typed orchestration metadata, dependency and handoff validation, and portable verification records. Actual runtime execution and retry policy belong to the approved host/product.
22. Technical references
- Signature-workflow transitions, ledger and webhook emission.
- Signature-workflow API router.
- Research-workflow registry, events, revisions and snapshots.
- Research-workflow routes, public bundle and lineage.
- Reliability queue, dead-letter replay and event stream persistence.
- Reliability API and SSE routes.
- Cross-runtime workflow schema and verification.
- Streaming, reliability and replay boundaries.
- Cross-runtime responsibilities, readiness and handoff model.
- Existing repository workflow tests (inspected; not executed here).
23. Knowledge Base verification and release metadata
Verified in this preparation: pinned repository source paths; actual API shapes identified above; offline synthetic checker and its unit tests. Not verified: deployed image/commit, CI run in the product repository, authenticated staging call results, concurrent-write behavior, tenant-level permission enforcement, production replay safety, or scientific validation. Next acceptance owner: Platform Core release/security and responsible research-workflow maintainers. Publication boundary: This Knowledge Base article may be published with its verification notice; it does not authorize enabling automated replays or approving scientific outputs.
