Skip to main content

An opinionated runtime and tooling layer built on top of bussdcc.

Project description

BussDCC Framework

bussdcc-framework is an opinionated runtime and tooling layer built on top of bussdcc.

It provides the components most real systems need:

  • runtime orchestration
  • event sinks and replay
  • JSONL event logging
  • a lightweight web interface
  • system identity discovery
  • deterministic replay of recorded event streams

The framework keeps the bussdcc kernel small while providing a practical foundation for building complete systems.

Architecture

Application
    ↓
bussdcc-framework
    ↓
bussdcc

bussdcc (kernel)

The core provides the minimal primitives:

  • messages
  • events
  • processes
  • services
  • runtime
  • state
  • clocks
  • event buses

bussdcc-framework

The framework adds system-level capabilities:

  • structured event logging
  • replay runtime
  • web interface
  • event sinks
  • operational services
  • application scaffolding

Features

Runtime

Extended runtime with event sinks and framework lifecycle messages.

from bussdcc_framework.runtime import Runtime

runtime = Runtime()

Features:

  • event sink pipeline
  • framework lifecycle messages
  • graceful shutdown handling
  • replay support

Event Logging (JSONL)

Built-in JSONL logging for deterministic replay and auditing.

from bussdcc_framework.io.jsonl import JsonlSink

runtime.add_sink(JsonlSink("./events"))

Logs are segmented by time:

events/
  2026-03-09/
    12-00-00.jsonl
    12-10-00.jsonl

Each line contains a structured event:

{
  "time":"2026-03-09T12:00:01.735301+00:00",
  "type":"bussdcc_framework.message.system:SystemIdentityEvent",
  "data":{ ... }
}

Event Replay

Replay previously recorded event streams.

from bussdcc_framework.runtime import ReplayRuntime
from bussdcc_framework.io.jsonl import JsonlSource

runtime = ReplayRuntime(speed=1.0)

runtime.add_source(JsonlSource("./events"))

This allows:

  • deterministic testing
  • system simulation
  • historical debugging

Web Interface

A lightweight Flask + Socket.IO interface for system control and monitoring.

from bussdcc_framework.interface.web import WebInterface

runtime.add_process(
    WebInterface(host="0.0.0.0", port=5000)
)

Custom routes can be registered:

class MyWeb(WebInterface):

    def register_routes(self, app, ctx):

        @app.route("/")
        def index():
            return "Hello World"

Inside Flask routes you can emit BussDCC messages:

from bussdcc_framework.interface.web import emit

emit(MyMessage())

Console Logging

Simple JSON event output for development.

from bussdcc_framework.io.console import ConsoleSink

runtime.add_sink(ConsoleSink())

Example output:


{"time":"2026-03-09T12:00:01.722504+00:00","type":"bussdcc_framework.message.framework:FrameworkBooted","data":{"version":"0.1.0"}}

System Identity Service

Discovers system metadata at runtime:

  • hostname
  • hardware model
  • CPU serial
from bussdcc_framework.service import SystemIdentityService

runtime.add_service(SystemIdentityService())

This emits a SystemIdentityEvent and stores it in runtime state.

Example

Minimal application:

from bussdcc_framework.runtime import Runtime
from bussdcc_framework.io.console import ConsoleSink
from bussdcc_framework.service import SystemIdentityService

runtime = Runtime()

runtime.add_sink(ConsoleSink())
runtime.add_service(SystemIdentityService())

runtime.boot()
runtime.run()

Design Goals

Deterministic systems

All behavior flows through events that can be logged and replayed.

Strong typing

All messages are typed dataclasses.

Operational visibility

Event streams are easily captured and analyzed.

Replayable execution

Recorded systems can be replayed exactly for debugging and simulation.

Small core

The bussdcc kernel stays minimal while the framework provides practical tooling.

Installation

pip install bussdcc-framework

Related Projects

  • bussdcc – event-driven systems kernel
  • bussdcc-hardware – hardware device integrations

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bussdcc_framework-0.36.0.tar.gz (184.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bussdcc_framework-0.36.0-py3-none-any.whl (189.3 kB view details)

Uploaded Python 3

File details

Details for the file bussdcc_framework-0.36.0.tar.gz.

File metadata

  • Download URL: bussdcc_framework-0.36.0.tar.gz
  • Upload date:
  • Size: 184.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for bussdcc_framework-0.36.0.tar.gz
Algorithm Hash digest
SHA256 67dc9dd5f5a76308815bd68773d5b8620778d5af18e113a32d90a65e0e5159db
MD5 31e1c345b9d633ce201bfc5d32081e7f
BLAKE2b-256 311f22792fc88302510f089340210587a600f835c5e664ecd29d53652fe56676

See more details on using hashes here.

File details

Details for the file bussdcc_framework-0.36.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bussdcc_framework-0.36.0-py3-none-any.whl
Algorithm Hash digest
SHA256 568e94827b64cda6ed0ccf5a5da11e00488e1ddd73c77d4b0e8ea393d0280ff3
MD5 de42662c7968117f9e01713eaf5f8111
BLAKE2b-256 e54058a7aff6287d4bdbf543b15b7aeab3411a67e3fe4133358ae9edf2bcb8d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page