Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,17 @@ jobs:
- name: Build
run: dotnet build FluxFlow.sln --configuration Release --no-restore

- name: Test
run: dotnet test FluxFlow.sln --configuration Release --no-build --logger "trx;LogFileName=test-results.trx"
- name: Test unit suite
shell: pwsh
run: ./eng/test.ps1 -Suite Unit -Configuration Release -NoBuild

- name: Acceptance tests
shell: pwsh
run: ./eng/test.ps1 -Suite Acceptance -Configuration Release -NoBuild

- name: Container integration tests
shell: pwsh
run: ./eng/test.ps1 -Suite Integration -Configuration Release -NoBuild

- name: Validate package consumer behavior
shell: pwsh
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,25 @@ jobs:
- name: Build
run: dotnet build FluxFlow.sln --configuration Release --no-restore -p:ContinuousIntegrationBuild=true

- name: Test
run: dotnet test FluxFlow.sln --configuration Release --no-build
- name: Test unit suite
shell: pwsh
run: ./eng/test.ps1 -Suite Unit -Configuration Release -NoBuild

- name: Acceptance tests
shell: pwsh
run: ./eng/test.ps1 -Suite Acceptance -Configuration Release -NoBuild

- name: Container integration tests
shell: pwsh
run: ./eng/test.ps1 -Suite Integration -Configuration Release -NoBuild

- name: Validate durable input provider
shell: pwsh
run: ./tests/FluxFlow.Engine.DurableInput.TSql.IntegrationTests/run-integration.ps1 -AcceptLicense
run: ./tests/Integration/Containers/Databases/TSql/DurableInput/FluxFlow.Engine.DurableInput.TSql.IntegrationTests/run-integration.ps1 -AcceptLicense

- name: Validate durable output provider
shell: pwsh
run: ./tests/FluxFlow.Engine.DurableOutput.TSql.IntegrationTests/run-integration.ps1 -AcceptLicense
run: ./tests/Integration/Containers/Databases/TSql/DurableOutput/FluxFlow.Engine.DurableOutput.TSql.IntegrationTests/run-integration.ps1 -AcceptLicense

- name: Validate binary compatibility and pack
shell: pwsh
Expand Down
529 changes: 529 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />
<PackageVersion Include="JsonSchema.Net" Version="9.2.1" />
<PackageVersion Include="Jsonata.Net.Native" Version="3.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.9" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.9" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="10.0.0" />
Expand All @@ -31,6 +32,7 @@
<PackageVersion Include="Shouldly" Version="4.2.1" />
<PackageVersion Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.12" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="9.0.4" />
<PackageVersion Include="Testcontainers" Version="4.14.0" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="Z.Blazor.Diagrams" Version="3.0.4.1" />
Expand Down
2,858 changes: 1,629 additions & 1,229 deletions FluxFlow.sln

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\FluxFlow.Engine\FluxFlow.Engine.csproj" />
<ProjectReference Include="..\..\src\FluxFlow.Composition\FluxFlow.Composition.csproj" />
<ProjectReference Include="..\..\src\FluxFlow.Nodes\FluxFlow.Nodes.csproj" />
<ProjectReference Include="..\..\src\Engine\Runtime\FluxFlow.Engine\FluxFlow.Engine.csproj" />
<ProjectReference Include="..\..\src\Core\Application\FluxFlow.Composition\FluxFlow.Composition.csproj" />
<ProjectReference Include="..\..\src\Core\Foundation\FluxFlow.Nodes\FluxFlow.Nodes.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion docs/01-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ var sent = await application.Ports.SendAsync(
"Main.Map.Input",
FlowMessage.Create(input));

var output = await application.Ports.ReceiveAsync<JsonElement>(
var output = await application.Ports.ReceiveAsync<FlowValue>(
"Main.Map.Output",
TimeSpan.FromSeconds(10));
```
Expand Down
7 changes: 4 additions & 3 deletions docs/03-node-authoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Extra outputs are completed, faulted, and disposed with the node.

## Events And Errors

Use `FlowEvent` for workflow activity that a host may store, filter, or show as
Use `FlowEvent` as a code-first builder for workflow activity that a host may store, filter, or show as
history:

```csharp
Expand Down Expand Up @@ -201,8 +201,9 @@ The `Has...` prefix is intentional: the selected node member already exists;
the call describes the component contract and maps its external port name to
that existing member rather than creating another Dataflow port.
Factories and selectors are not executed during registration. `HasEvents`
selects an `ISourceBlock<FlowEvent>` and exposes the bridged public
`FlowMessage<ComponentEvent>` output under the chosen name. There is no
selects an `ISourceBlock<FlowMessage>` whose non-null value follows the canonical
event schema. Calling `EmitEvent(FlowEvent)` serializes directly into that stream;
it does not create a hidden component or Dataflow node. There is no
implicit or globally reserved `Events` port.

Signal targets use the same single-declaration model and retain signal
Expand Down
5 changes: 3 additions & 2 deletions docs/04-package-authoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ private static OrderReviewNode CreateOrderReview(
The selected node type drives message-type inference. The one public port call
produces immutable descriptor metadata and the runtime binding; no reflection,
scanning, attributes, or property-name convention is involved. Event sources
remain `FlowEvent` streams internally and are bridged to the public
`ComponentEvent` output named by `HasEvents`. Omitting `HasEvents` means the
use canonical `FlowMessage`/`FlowValue` transport. `FlowEvent` remains an
optional emitter-side builder, and `HasEvents` exposes the same stream without
inserting a hidden node. Omitting `HasEvents` means the
component has no event output, and a normal output may use the name `Events`.

For the uncommon case where a package must construct the complete runtime
Expand Down
9 changes: 9 additions & 0 deletions docs/05-hosting-and-observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,22 @@ client, reconnect, credential, and transport ownership.
Each canonical component exposes a traced `Workflow.Component.Events` output.
Engine also exposes:

- `application.Ports.Activity` for one canonical, filterable stream containing
component events, lifecycle events, and diagnostics.
- `System.Events.Output` and `application.Ports.SystemEvents` for reliable,
ordered application and revision transitions.
- `System.Diagnostics.Output` and `application.Ports.Diagnostics` for bounded,
best-effort operational diagnostics.
- `application.Ports.Rejections`, `Status`, and `Completion` for direct runtime
observation.

`Activity` carries non-generic `FlowMessage` envelopes with non-null `FlowValue`
payloads. Stable `flow.event.*` headers support fast routing; the payload contains
`type`, `kind`, `level`, `dimensions`, `measurements`, `details`, and legacy
`attributes`. The aggregate is observational and never backpressures workflow
execution. Reliable system-event delivery and best-effort diagnostics retain
their existing independent policies.

Accepted system events are delivered in order with bounded backpressure.
Diagnostic overflow rejects immediately; accepted diagnostics remain ordered.
Observer or listener failure is isolated from workflow processing.
Expand Down
33 changes: 29 additions & 4 deletions docs/07-validation-and-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,37 @@ Caller cancellation remains cancellation. A source-load failure leaves the host
`Degraded` when no revision is active. A rejected update keeps the prior active
revision running.

## Sample Input Preflight

Runtime descriptors expose the destination materializer's declared input shape.
For a selected descriptor and sample value:

```csharp
var result = descriptor.ValidateInputShape("Input", sample);
if (result is null)
{
// No shape was declared; this sample has not been checked.
}
else if (!result.IsValid)
{
Console.WriteLine(result.Error);
}
```

This check runs without component activation and reports top-level kind or
required-property mismatches. Success is structural only. Runtime materialization
and domain validation still belong to the destination component. Unknown output
shapes do not make a canonical graph link invalid. See
[Flow Data Contracts](20-flow-data-contracts.md#discoverable-input-shapes).

## Runtime Channels

Canonical components follow one model:

| Channel | Contract | Use |
|---------|----------|-----|
| `Output` | `FlowMessage<T>` | A typed value or `FlowError` that workflow logic may handle. |
| `Events` | `FlowMessage<ComponentEvent>` | Lifecycle, diagnostics, observations, warnings, and metrics. |
| `Events` | `FlowMessage` with a non-null canonical `FlowValue` | Lifecycle, diagnostics, observations, warnings, and metrics. |
| `Completion` | `Task` | Unrecoverable implementation, infrastructure, or lifecycle failure. |

There is no new universal `Errors` port. A validation rejection, HTTP failure,
Expand Down Expand Up @@ -52,9 +75,11 @@ correlated where source information exists, and carried in the normal traced
message envelope. They can feed logging, metrics, mapping, conditional links,
another workflow, or direct observation.

`System.Events.Output` is separate. It carries Engine application and revision
events; component events are not duplicated into it. `System.Diagnostics.Output`
remains the Engine best-effort diagnostic stream.
`System.Events.Output` is the reliable canonical stream for Engine application and
revision transitions. `System.Diagnostics.Output` is the best-effort canonical
diagnostic stream. `application.Ports.Activity` mirrors both and
aggregates component event outputs into one canonical, dynamically filterable
stream without coupling workflow execution to observers.

## Completion

Expand Down
21 changes: 11 additions & 10 deletions docs/10-expression-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ in it. Engine-specific adaptation belongs in the engine implementation.

## Schema-less JSON

`JsonMapperNode` is the explicit `JsonElement` specialization used by the
configuration-driven `data.map` registration. It accepts and emits detached
JSON values. Use it only when JSON semantics are part of the workflow contract.
`JsonMapperNode` is the internal `JsonElement` specialization used by the
configuration-driven `data.map` registration. Its runtime-authored ports expose
`FlowValue`; binding adapters materialize detached JSON for the node and wrap
its result back into `FlowValue`.

Known application types should stay typed. If a workflow intentionally needs a
dynamic CLR shape, make that conversion explicit in a mapper and emit the
Expand All @@ -126,18 +127,18 @@ payloads, not FluxFlow foundation types.

## Composition Registration

`FluxFlow.Components.Mapping.Composition` registers the schema-less JSON
component descriptor and its explicit Designer declaration:
`FluxFlow.Components.Mapping.Composition` registers the schema-less mapper and
its explicit Designer declaration:

```csharp
services.AddFluxFlowComponents().AddMapping();
```

The host provides a keyed `IFlowExpressionEngine`; `IMappingContextFactory` and
`TimeProvider` are optional host-owned resources. Metadata exposes one
`JsonElement` Input, one `JsonElement` Output, and Events. `InputType` and
`OutputType` remain diagnostic/configuration hints and do not introduce runtime
reflection or automatic conversion.
`FlowValue` Input, one `FlowValue` Output, and Events. `InputType` and
`OutputType` remain diagnostic/configuration hints; the mapper performs the
configured value transformation.

## Expression Adapter Rules

Expand All @@ -146,5 +147,5 @@ reflection or automatic conversion.
- Let JSON-oriented engines project or consume `JsonElement` explicitly.
- An engine may create an internal read-only dynamic view for evaluation, but
that view must not become a public component or persistence contract.
- Do not add assembly scanning, reflection registration, implicit link
conversion, or a universal dynamic object.
- Do not add assembly scanning, reflection registration, or a registry that
attempts to convert every component contract into every other contract.
19 changes: 19 additions & 0 deletions docs/11-package-versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,25 @@ published. Same-version readiness checks remain valid. A bounded local check
can provide `-BaselineVersion` to compare against another deliberate version;
the manifest property is still required and validated.

## Intentional breaking releases

A compatibility failure is evidence of a contract change, not a requirement to
retain a parallel legacy API. A reviewed breaking release can retire the old
contract when the replacement is simpler and preserves the required behavior.

- Give each affected post-1.0 package a new major version, including prerelease
candidates. Rebuild dependent packages that consume changed signatures.
- Keep the published comparison baseline; never set it to null to bypass a break.
- Record only individually reviewed breaks in the package-local
`CompatibilitySuppressions.xml`. Keep package validation enabled, including
validation between target frameworks. Do not use global diagnostic suppression.
- Document each replacement and migration step. A passing comparison with these
exceptions means the remaining differences are accepted, not that old binaries
are compatible. Future baselines require a fresh review of the exception list.

The [canonical event migration](48-canonical-event-migration.md) records the
current intentional change and its consumer responsibilities.

## Release Checklist

Before publishing:
Expand Down
7 changes: 4 additions & 3 deletions docs/12-component-composition.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,14 @@ and can be mapped, conditioned, recorded, retried, or sent to another workflow.
Removed error-port declarations are rejected; canonical registrations do not
expose them.

Every canonical registration reserves `Events` as an output carrying
`FlowMessage<ComponentEvent>`. The address
Every canonical event registration exposes its chosen event output as a
non-generic `FlowMessage` carrying the canonical event `FlowValue`. The address
`OrderProcessing.ValidateOrder.Events` participates in links and direct runtime
observation like any other output. Its message envelope remains the authority
for trace, correlation, message, and causation identity.

Component events are not copied into `System.Events.Output`. The latter is the
Component events are not copied into the reliable `System.Events.Output` lifecycle
stream. They are aggregated into `application.Ports.Activity`. The former is the
Engine-owned application/revision event stream, so observing both does not
produce duplicate component events.

Expand Down
19 changes: 11 additions & 8 deletions docs/14-public-api-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,10 @@ remain normal value-or-error messages.

## Component Contracts

The following table lists the maintained runtime surface. Every output type is
inside `FlowMessage<T>` and may instead carry `FlowError`.
The following table lists the maintained direct node surface. Every output type
is inside `FlowMessage<T>` and may instead carry `FlowError`. Runtime-authored
composition descriptors expose `FlowValue` for ordinary data ports and adapt
to these module-owned types at the component boundary.

| Family | Primary nodes | Value contracts |
|--------|---------------|-----------------|
Expand Down Expand Up @@ -277,12 +279,13 @@ after contract initialization cannot change projection or expectation behavior.

## Mapping, JSON, and Expressions

Typed components keep CLR values typed. Configuration-driven mapping,
assertion, routing, state, and validation registrations use explicit
`JsonElement` specializations where their document contract is schema-less.
Expression engines adapt those values according to their own language. A mapper
may intentionally emit a CLR record, dictionary, or `ExpandoObject`, but no
dynamic object is required by the runtime.
Direct code-first nodes keep CLR values typed. Runtime-authored normal-data
ports use `FlowValue`, while signal and diagnostic-event ports retain their
dedicated contracts. Each component family owns the materializer from
`FlowValue` to its internal request type; there is no global domain mapper.
Expression engines adapt detached JSON according to their own language.
`FluxFlow.Expressions.Jsonata` provides the JSONata expression adapter without
changing the runtime's `FlowValue` boundary or introducing a shared domain mapper.

## Content and Transport Boundaries

Expand Down
11 changes: 5 additions & 6 deletions docs/15-engine-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,11 @@ baseline process; it does not change canonical application JSON, component
addresses, normal-data delivery, or Engine's exact descriptor/instance
validation.

The typed builder uses `HasInput`, `HasSignalInput`, `HasOutput`, and
`HasEvents`. These names are declarative: the node already owns the selected
Dataflow member, while the component declaration maps an external port name to
it. The short-lived typed `Add...` names were removed rather than retained as
aliases; this is another intentional authoring-only break with no runtime or
JSON behavior change.
The builder uses `HasInput` and `HasOutput` for direct typed contracts,
`HasFlowValueInput` and `HasFlowValueOutput` for runtime-authored normal data,
and `HasSignalInput` and `HasEvents` for their dedicated channels. A
`HasFlowValueInput` declaration requires a component-owned materializer for the
node's internal request type; output adaptation is representation-only.

Event outputs are explicit through `HasEvents(name, selector)`. Engine no
longer injects or reserves `Events`; built-in packages explicitly retain that
Expand Down
20 changes: 12 additions & 8 deletions docs/19-vnext-runtime-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,18 @@ relation, not a data-processing cycle.

## Typed Message Processing

Each port declares its actual `FlowMessage<T>` type. A message contains either
T or `FlowError`; there is no nested result wrapper and no universal error port.
Trace identity remains stable through a lineage while each emitted message gets
a new message identity and immediate causation.

Known commands, results, and events remain CLR records. Explicit JSON nodes use
detached `JsonElement`. Exact transport bodies use `FlowContent`. Dynamic CLR
objects are mapper outputs only when a workflow explicitly requests them.
Direct code-first ports declare their actual `FlowMessage<T>` type.
Runtime-authored ordinary data ports declare `FlowMessage<FlowValue>` so links
remain stable when workflow values originate outside the CLR type system. A
message contains either its value or `FlowError`; there is no universal error
port. Representation adapters preserve message identity, while semantic node
processing creates normal causation.

Each component family materializes `FlowValue` into the narrow request type it
owns. This keeps HTTP, MQTT, storage, state, and other domain knowledge out of a
global converter. Signals and diagnostic events retain dedicated CLR contracts.
Exact transport bodies remain `FlowContent` values nested in the relevant
module contract.

Dataflow inputs provide bounded buffering and semantic processing profiles map
user-facing mode/order/buffer choices to technical block settings. Outputs
Expand Down
Loading