Skip to content

refactor(data): read the live edge through a port - #143

Merged
mrcsin merged 1 commit into
masterfrom
live-source-port
Oct 20, 2026
Merged

mrcsin merged 1 commit into
masterfrom
live-source-port

Conversation

@mrcsin

@mrcsin mrcsin commented Oct 20, 2026

Copy link
Copy Markdown
Member

Problem

The OPC UA live edge (#116) needs a second implementation of the live stream. The stream sat on
IDataProvider.Subscribe beside the history, extent, days and catalogue reads, so a second source would
have had to implement the whole archive surface.

What changed

  • ILiveSource in SemiPlot.Core/Data: one cold Subscribe(IReadOnlyList<int>) of samples and breaks.
    Its contract in data-integration.md#realtime: the stream never completes and never faults, a null
    Value is a break, timestamps are UTC, an id the source does not serve emits nothing.
  • PostgresLiveSource holds the archive poll, the port's first implementation. RealtimePoll,
    ArchiveStatements and the poll cadence are unchanged.
  • IDataProvider loses Subscribe. TrendCoordinator and TrendWindow.Build take both interfaces; the
    coordinator keeps its Catch for a source that breaks the contract.
  • Docs: data-integration.md, overview.md, charting.md, postgres-topology.md,
    trend-interaction.md, testing-strategy.md, docs/architecture/README.md, AGENTS.md.

Nothing the operator sees changes. The poll's log lines now carry the PostgresLiveSource source context.

How it was verified

  • dotnet build SemiPlot.slnx: 0 errors. dotnet format --verify-no-changes and dotnet terse over the
    24 touched .cs files: exit 0.
  • SemiPlot.Tests.Unit: 2303/2303. SemiPlot.Tests.Integration: 200/200.
  • Guard probe: deleting IDataProvider.Subscribe at the base gives CS1061 at TrendCoordinator.cs:98;
    TheWindowFollowsTheContainersLiveSource catches a cast in place of the container's ILiveSource.
  • Not run: the manual AppHost smoke check. The automated suites stand in for it in this unattended
    roadmap run.
Per-task commits before collapse
b764760 docs(plans): record the exec run and verify steps
5e8e59b refactor(bridge): trim restated comments
78d2117 docs(architecture): address review findings
2e29c5b fix(data): address review findings
c95354e docs(architecture): address review findings
9fac0ac fix(bridge): address review findings
8731098 docs(architecture): document the live-source port
a63a8e2 test(data): record the acceptance run
4940ea1 refactor(data): drop the provider's live edge
d8926c6 feat(chart): read the live edge through ILiveSource
0d20cfe test(data): subscribe the poll tests through ILiveSource
8d3cb89 feat(data): declare the live-source port

The OPC UA live edge needs a second implementation of the live stream,
and the stream sat on IDataProvider beside the history reads.

The live edge now reads through ILiveSource in SemiPlot.Core/Data, one
cold Subscribe(IReadOnlyList<int>) of samples and breaks. Its contract,
in data-integration.md#realtime, states that the stream never completes
and never faults; TrendCoordinator keeps its Catch for a source that
breaks it. The archive poll moves into PostgresLiveSource, its first
implementation, with RealtimePoll, the statements and the cadence
unchanged. IDataProvider loses Subscribe; TrendCoordinator and
TrendWindow.Build take both interfaces from the container.

Nothing the operator sees changes. The poll's log lines now carry the
PostgresLiveSource source context.
@mrcsin
mrcsin marked this pull request as ready for review October 20, 2026 13:20
@mrcsin
mrcsin merged commit 67d4085 into master Oct 20, 2026
2 checks passed
@mrcsin
mrcsin deleted the live-source-port branch October 20, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant