Source reference: docs/architecture/native-implementations.md at 41af2124

The repository has C# and Rust implementations of crossfire, fleetd and fleet. C# targets .NET 11 and produces managed and NativeAOT distributions from the same source. Rust distributions are built with Cargo. Shared tests run against explicitly selected distributions.

Source layout#

services/
  crossfire/
    packages/                         shared TypeScript contracts and tooling
    csharp/{apps/Crossfire.Server,packages,tests,build,scripts,Dockerfile}
    rust/{apps/server,packages,tests,scripts,Dockerfile}
    apps/web/
    database/management/sqlite/
    knexfile.management.mjs
    tests/contracts/
    scripts/
    docs/
  fleetd/
    packages/                         shared TypeScript contracts and tooling
    csharp/{apps/Fleetd.Daemon,packages,tests}
    rust/{apps/daemon,packages}
    tests/contracts/
  fleet/
    packages/                         shared TypeScript contracts and tooling
    csharp/{apps/Fleet.Cli,packages}
    rust/{apps/cli,packages}
    tests/contracts/
scripts/

The web application, database migrations and contract tests are shared. Language-specific code is inside each product’s implementation directory.

ConcernShared contractImplementation difference
APISame routes, input validation, errors and response fieldsASP.NET / Hyper
DomainFunctional operations, explicit ports, expected failure valuesC# static modules and records / Rust modules and values
DataSame SQLite file and normalized schemaEF / Diesel
MigrationsOne service-owned Knex imageNo runtime or EF migrations
UIOne React project and built assetsNone
Native sessionsfleetd-owned Codex/Pi adaptersNative process and transport libraries
Execution compositionfleetd execution adapter, not daemon-domain codeLanguage-local adapter projects
DistributionStandalone products and shared tool bytesmanaged or NativeAOT trees / native Cargo trees
Server deploymentOne Docker package format, shared migration image and image-owned readinessBackend-specific runtime image, never language-specific site activation
VerificationOne external scenario bankSeparate internal unit/compiler tests

The selected implementation never invokes another backend as a fallback. The shared JavaScript agent tool and Pi extension are declared runtime assets; the common Knex image is an explicit migration dependency.

Server deployment#

All three server targets use the same standard Docker Compose kit and common one-shot Knex image. Compose owns lifecycle and project isolation; runtime startup depends on successful migration. Upgrades stop crossfire writers, remove the completed migrate job and start the selected release with the same project and private state. Backups are optional and operator-managed.

The trusted package tool validates/imports exact archive/image/source identities and release labels before stopping writers. Backend selection is explicit and independent of native configuration/serve executables. There is no custom C#/Rust Docker lifetime operator, orphan-takeover protocol or mandatory backup gate. Current images target Linux amd64. Native agent process/history ownership remains a separate fleetd concern.

HTTP boundaries#

Public mutation limits distinguish the actual client from a configured trusted ingress. Only an immediate peer listed in trustedProxyAddresses may supply one overwritten X-Forwarded-For IP. Untrusted headers cannot select a bucket.

Pagination uses canonical positive decimal strings. Both public and private APIs reject signs, leading zeros, exponents, fractions, whitespace, duplicate fields and out-of-range values. Empty collections have one logical page.

Database#

Management SQLite uses application ID 1129465426, current schema 1 and the sole initial Knex migration. Current metadata describes 57 application tables. Knex’s own bookkeeping tables are separate. File state and Conduit’s externally owned RocksDB are not management SQL databases.

There is no historical schema converter or alternate runtime reader. Applications validate the current database and completed Knex initialization. No import/export is needed when changing between verified implementations.

.NET dependencies#

The SDK is pinned to 11.0.100-rc.3.26522.148; EF/SQLite packages are pinned to 11.0.0-rc.3.26522.148. Managed initial deployment is permitted. There is no automatic managed fallback inside a NativeAOT executable.

Managed and NativeAOT publication precompile the same fixed EF models and queries. Managed publication does not compile query expressions on the request path or maintain a second query implementation/cache. Managed products disable tiered compilation, producing optimized JIT code at first compilation rather than waiting for traffic-driven promotion. This adds first-call compilation work; the performance bank measures installed defaults, not test-only tuning.

NativeAOT builds emit trimming and dynamic-code diagnostics from EF and BCL reflection paths. Supported fixed queries use generated model and query metadata. Tests execute the AOT binaries with dynamic code and reflection-based JSON disabled. The pooled SQLite EF options constructor also emits IL2026/IL3050 at compilation. Warnings remain visible under the existing linker policy. Managed and NativeAOT acceptance exercise independent leases, reset, rollback, connection release and privacy revalidation. Passing fixed queries does not certify arbitrary EF models.

FamilyRelevant dependency surface
IL2026Trimming annotations on EF/query entrypoints
IL3050, IL3051Dynamic generic/expression paths
IL2046, IL2092, IL2093Interface and implementation annotation mismatches
IL2055–IL2111 familiesGeneric reflection and metadata requirements
IL3002Spatialite assembly-file discovery; no product Spatialite capability

Passing owned queries does not certify arbitrary EF queries, plugin models, dynamic extensions or a future dependency version. Query/model/pin changes require new native verification. Build-time compiler changes belong to the compiler owner, with its upstream notices retained; they are not runtime query fallbacks.

Evidence#

Verification records identify the tested Linux x64 host and Codex, Pi and Conduit versions. Inert-provider tests exercise integration, not paid-model quality. macOS, Windows, sustained load and arbitrary tool-process containment are not covered by those results.