Files
git.stella-ops.org/src/__Libraries/StellaOps.Signals.Contracts/Abstractions/ISignalConsumer.cs
StellaOps Bot 8768c27f30
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
Signals DSSE Sign & Evidence Locker / sign-signals-artifacts (push) Has been cancelled
Signals DSSE Sign & Evidence Locker / verify-signatures (push) Has been cancelled
Add signal contracts for reachability, exploitability, trust, and unknown symbols
- Introduced `ReachabilityState`, `RuntimeHit`, `ExploitabilitySignal`, `ReachabilitySignal`, `SignalEnvelope`, `SignalType`, `TrustSignal`, and `UnknownSymbolSignal` records to define various signal types and their properties.
- Implemented JSON serialization attributes for proper data interchange.
- Created project files for the new signal contracts library and corresponding test projects.
- Added deterministic test fixtures for micro-interaction testing.
- Included cryptographic keys for secure operations with cosign.
2025-12-05 00:27:00 +02:00

39 lines
1.5 KiB
C#

namespace StellaOps.Signals.Contracts;
/// <summary>
/// Interface for consuming signals from the signal bus.
/// Implemented by services that process signals.
/// </summary>
public interface ISignalConsumer
{
/// <summary>
/// Consumes signals from the signal bus as an async enumerable.
/// </summary>
/// <param name="filterType">Optional signal type to filter by.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>Async enumerable of signal envelopes.</returns>
IAsyncEnumerable<SignalEnvelope> ConsumeAsync(
SignalType? filterType = null,
CancellationToken cancellationToken = default);
/// <summary>
/// Gets the latest signal for a given key.
/// </summary>
/// <param name="signalKey">The signal key to look up.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The signal envelope if found, null otherwise.</returns>
ValueTask<SignalEnvelope?> GetLatestAsync(
string signalKey,
CancellationToken cancellationToken = default);
/// <summary>
/// Gets all signals for a given PURL.
/// </summary>
/// <param name="purl">The package URL to look up.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>Collection of signal envelopes for the PURL.</returns>
ValueTask<IReadOnlyList<SignalEnvelope>> GetByPurlAsync(
string purl,
CancellationToken cancellationToken = default);
}