Thanks for contributing to Bifrost.
| Path | Role |
|---|---|
net/Domains/Bifrost.WorkItems.Contracts |
Shared {Operation}Api classes with nested Command / Query / Response |
net/Domains/Bifrost.WorkItems |
Work Item bounded context — HTTP, Marten, and Wolverine handlers. Marten schema work_items |
net/Domains/Bifrost.Orchestrator.Contracts |
Worker registration and heartbeat messages the orchestrator subscribes to |
net/Domains/Bifrost.Orchestrator |
Decides where work executes — HTTP, Marten, and Wolverine. Marten schema orchestrator |
net/Domains/Bifrost.Skills.Contracts |
Skills API contracts: capabilities, criteria, evals, publishing |
net/Domains/Bifrost.Skills |
Skills bounded context — workshop domain. Marten schema skills |
net/Domains/Bifrost.Workflows.Contracts |
Workflow API contracts: create/save/get/list with nested nodes |
net/Domains/Bifrost.Workflows |
Workflow bounded context — node graph domain. Marten schema workflows (stores each workflow's git source tuple, version history, and published pointer; definitions themselves live in git) |
net/Infrastructure/Bifrost.Workflows.Git.Abstractions |
Packable IWorkflowGitProvider abstraction; implement it to plug in your own git backend (loaded as a plugin, see below) |
net/Infrastructure/Bifrost.Workflows.Git.LibGit2 |
Built-in provider (assembly libgit2) built on LibGit2Sharp with a local bare-clone cache; shipped in the image as the libgit2 plugin |
net/Domains/Bifrost.WorkerNode |
Registers itself and heartbeats. Wolverine with a local SQLite outbox, no Postgres or Marten. Sends through IBifrostBus |
web/orchestrator |
Orchestrator UI (cluster status, usage, and skills workshop) |
net/Infrastructure/Bifrost.MessageBus.Abstractions |
IBifrostBus, envelopes, RPC wire contracts, provider surface |
net/Infrastructure/Bifrost.MessageBus.Wolverine |
Wolverine transport over IBifrostBus. Hosts publish through the outbox and listen with Handle methods |
net/Infrastructure/Bifrost.MessageBus.ZeroMq |
ZeroMQ bus sidecar deployable (IMessageBusProvider) |
net/Infrastructure/Bifrost.MessageBus.RabbitMq |
RabbitMQ bus sidecar deployable (IMessageBusProvider). Compose runs this against a RabbitMQ container |
net/Tests/Bifrost.Tests |
All tests in one project (Api/, MessageBus/, Rpc/, Support/) |
net/Infrastructure/Bifrost.Rpc |
RpcHost / RpcPeer, options, hosted services |
net/Infrastructure/Bifrost.Rpc.Abstractions |
IRpcContract, IRpc<T>, RpcSession, AddRpc / AddRpcHandler |
net/Infrastructure/Bifrost.Rpc.Generators |
Source generator for contract proxies and bindings |
net/Tests/Bifrost.Rpc.TestPeer |
Peer executable the host launches in process-boundary tests |
docs/ |
Design and pattern documentation |
RPC protocol: docs/rpc.md.
Each context uses its own Marten schema (work_items, orchestrator, skills, workflows) in the shared Postgres database. The worker node does not use that database; its durable outbox is a local SQLite file. The Work Item host shares a message bus sidecar over a unix-socket volume. The orchestrator and the worker each have their own sidecar. Compose connects those sidecars to RabbitMQ, which keeps a durable queue per service until the sidecar acks. Host images never reference NetMQ or RabbitMQ.Client. The ZeroMQ sidecar remains in the repo.
Domain work is organized by aggregate root. How to structure and extend an aggregate is documented in docs/ddd-aggregate-roots.md.
- .NET 10 SDK
- Docker (for integration tests)
dotnet build bifrost-server/bifrost-server.slnx
dotnet test bifrost-server/bifrost-server.slnxIntegration tests start a Postgres container; Docker must be available. API tests drop the RPC bus host so they do not need a sidecar (see BifrostApiFactory). The host uses RPC in production. HTTP is served by Wolverine on the work-item process.
docker compose -f bifrost-server/docker-compose.yml up --buildWorkflow definitions are YAML directories in a git repository (workflow.yaml, nodes/<id>/spec.yaml, nodes/<id>/body.mjs), addressed by a repository | subpath | ref tuple that every workflow supplies explicitly (there is no default repository or ref). Every commit that touches the directory is a version; new versions are unpublished until POST /publish-workflow-version, and only the published version runs. Commits made outside Bifrost are picked up by POST /sync-workflow. Workflows created before this change keep running from the database until POST /set-workflow-source points them at a repository directory.
The workflows container never links a git provider. At startup it reads the YAML file Docker mounts at /etc/bifrost/config.yaml (optional) and loads the provider it names from /app/plugins/git/<name>/<name>.dll:
workflows:
git:
provider: MyProvider # default: libgit2 (built into the image); "none" loads nothing
settings: # free-form, handed to the plugin
endpoint: https://git.example.com
token: abc123To write a plugin: reference the Bifrost.Workflows.Git.Abstractions package, add one public class implementing IWorkflowGitProvider (optionally constructor-injecting WorkflowGitProviderContext for settings), dotnet publish it, and mount the output at /app/plugins/git/MyProvider/ so that MyProvider.dll and MyProvider.deps.json are in that folder (name the assembly MyProvider). The host finds the single provider class in that DLL and calls AddWorkflowGitProvider<T>() on it by reflection, so Bifrost does not need rebuilding. Do not ship a private copy of the abstractions assembly (it is shared with the host, as are Microsoft.Extensions.*). Startup fails with a clear message when the DLL is missing, exports zero or several providers, or cannot be constructed. See bifrost-server/config/workflows.yaml and the commented plugin volume in bifrost-server/docker-compose.yml.
To submit a work item attached to a workflow, POST /create-attached-work-item on the workflows host (port 8083). That command validates the workflow's published version is startable, creates the work item with metadata.workflowId, asks the Orchestrator to track it without worker dispatch, and advances the run. Work Items itself stays workflow-agnostic; the Orchestrator stays graph-agnostic.
Against a running stack, submit a one-off script work item (interim data.node contract — not a full workflow run):
# ./dev builds bifrost/node (standalone) then brings the compose stack up.
# Or manually:
docker build -f docker/cleanroom-base.Dockerfile -t clanker-cleanroom/base .
docker build -f docker/node.Dockerfile -t bifrost/node .
docker compose -f bifrost-server/docker-compose.yml up --build -d
./scripts/run-script-node.mjs
# or pull the body from a saved workflow:
./scripts/run-script-node.mjs --workflow-id 293c56ab-f5cc-410d-a289-e455af0de080
# or pass a handler file:
./scripts/run-script-node.mjs --body-file ./path/to/handler.mjsThe Node smoke script loads bifrost-server/.env via dotenv (from web/orchestrator’s devDependencies) and uses WORK_ITEMS_URL, ORCHESTRATOR_URL, WORKFLOWS_URL, TIMEOUT_SECS, and BIFROST_WORKSPACES_HOST_PATH from that file (shell env still wins). If the workspaces path is missing, it writes an absolute default (<repo>/.bifrost-workspaces) into .env. Recreate worker-node after the first write if compose was already up without that env:
docker compose -f bifrost-server/docker-compose.yml up -d worker-nodeIt creates a pending work item, tracks it, polls until succeed/fail, and prints outputs.json from the workspace root.
The worker image bakes Node plus /opt/bifrost/run-harness.mjs and the agent harness packages. Compose defaults BIFROST_HARNESS_MODE=passthrough so a harness node can exit 0 and write outputs.json from inputs without an API key. Set BIFROST_HARNESS_MODE=agent and BIFROST_AI_API_KEY for a real model run.
./scripts/run-harness-node.mjsPer-run workspaces under BIFROST_WORKSPACES_HOST_PATH (default <repo>/.bifrost-workspaces) retain stdout.log, stderr.log, skills, and outputs.json for review; a later sweep will clean them.
- API contracts live in
Bifrost.WorkItems.Contractsasstatic class {Operation}Apiwith nestedCommand/Query/Response. - Handlers live under
{Aggregate}/Commandsor{Aggregate}/Queriesin the work-item host — named{Operation}Handler, taking the shared Api types. Writes carry[WolverinePost]/EmptyResponse. Reads carry[WolverineQuery]. - Fail validation with
CommandValidationException(work-item host) orContractValidationException(value objects). Both map to HTTP 400. Inbound bus failures use error codevalidation. - Register new Marten projections / document identities in
MartenConfiguration.
Prefer matching an existing aggregate’s shape over inventing a parallel style. Details: docs/ddd-aggregate-roots.md.
- Keep changes focused; one concern per PR when practical.
- Include or update tests when behavior changes.
- Follow the aggregate-folder layout above for domain code.
- Do not commit secrets, connection strings with credentials, or local-only config.
- New broker bindings belong in their own deployable referencing only
Bifrost.MessageBus.Abstractions(peer ofBifrost.MessageBus.ZeroMq).