QuaiWhale logo
QuaiWhale
Intelligence

Investigation Engine

Claims due canonical investigations, refreshes decisions, and records material status events.

Unavailable
Runtime key
canonical_refresh
Railway process
worker
Required production process
Last heartbeat
Not available
UTC
Last successful cycle
Not available
UTC
Runtime status
Not reported
Next scheduled run
Not available
No next_run_at exposed
Last cycle duration
Not available
No completed cycle timestamp
Process started
Not available
No process start exposed
Exact data chain

Input to product surface

required process
Step 1Input
Due investigation queue

Claims bounded due investigations with leases through the transactional canonical queue path.

Step 2Coordination
Identity-loop gate

Defers the refresh cycle while a recent canonical identity cycle is actively running.

Step 3Evaluation
Refresh canonical decisions

Re-evaluates claimed rows, separates material decision changes from technical-only updates, and builds audit events.

Step 4Persistence
Persist decisions and job audit

Updates canonical investigations, inserts status events, releases leases, and records the job-run summary.

Step 5Product
Serve investigation workspaces

Keeps Investigations, My Queue, health diagnostics, and identity workflows current.

Required dependencies

The chain cannot produce its canonical output without these dependencies.

Supabase service role

Required for queue claims, leases, canonical rows, events, and job audits.

Transactional queue RPCs

Atomic claim, persistence, and release operations for bounded refresh batches.

Secondary and fallback paths

Recovery, enrichment, transport, or coordination paths that do not replace the canonical source of truth.

canonical_identity loop state

Coordinates writes by deferring refresh while identity evaluation is running.

Material-change event writer

Adds audit events only when user-relevant canonical fields change.

Storage contract

Tables read or written by this worker chain.

Swipe horizontally to inspect all columns

TablePurpose
investigationsCanonical decision, status, priority, outcome, evidence, and scheduling state.
investigation_status_eventsMaterial status and decision audit trail.
investigation_job_runsPer-cycle health, duration, backlog, and error summary.

Product outputs

User-facing workspaces directly powered by this chain.

Runtime checkpoint

Transactional queue claim and release summary

No checkpoint reported

The worker has not yet persisted a public checkpoint for this process instance.

Cycle metadata

No runtime metadata

This chain does not currently expose additional public cycle details.

Implementation map

Primary repository files implementing this worker chain and its product read path.

worker/canonical-refresh-loop.js
scripts/refresh-canonical-investigations-queue-transactional.mjs
worker/canonical-claim-client.mjs
worker/canonical-release-batch-client.mjs