Skip to content

[D070] [FEAT] [ORACLE] Publish probe-derived signals on-chain (extend publisher beyond outcome_log) #785

Description

@ezedike-evan

Context

ROADMAP.md Horizon 1: "Write probe-derived data to the testnet contract on a schedule."

The publisher cron is live (.github/workflows/reputation-cron.yml "Publisher tick" step → POST /api/publisher/tickrunBatch under lock, verified against the deployed testnet contract). But packages/publisher/src/batch.ts reads exclusively from outcome_log (execution outcomes). The probe-derived signals the roadmap names — uptime, quote latency (p50/p95), quote drift — are computed by lib/reputation/probe.ts and stored in probe_samples, but never reach the contract. The cron currently publishes the wrong data class for this roadmap bullet.

Requirements

  1. Extend the publisher batch to aggregate per-anchor probe-derived signals (uptime ratio, latency p50/p95, drift flag counts) over a configurable window from the probe_samples store.
  2. Include these signals in the on-chain payload alongside execution outcomes; version the payload shape so the consumer crate can distinguish.
  3. Handle the empty-data case gracefully (probes not yet running — see [D007] [FEAT] [OPS] Scheduler/cron to run all anchor probes continuously lumenwatch/stellar-intel#7 for probe scheduling): publish execution outcomes only, log that probe signals were skipped.
  4. Tests: batch aggregation from fixture probe samples; payload shape; empty-probe-data path.

Dependencies

Estimated file changes

packages/publisher/src/batch.ts, lib/reputation/store.ts (query helper if missing), packages/publisher tests.

Refs: ROADMAP.md line 37 (H1 bullet d). Part of the D0xx Horizon 1 workstream (new: D070).

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedCannot progress — waiting on another issue, anchor, or external party.difficulty/hardMulti-day. Cross-module or requires design work first.epic/reputationAnchor scoring, probe bot, Soroban oracle.featureNew capability. Expands what the product can do.module/oraclecontracts/reputation — Soroban reputation oracle.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions