Skip to content

feat: isolated beat testing, headless pipeline, and mock telemetry harness - #233

Open
IanEff wants to merge 6 commits into
mainfrom
feat/isolated-beat-testing
Open

feat: isolated beat testing, headless pipeline, and mock telemetry harness#233
IanEff wants to merge 6 commits into
mainfrom
feat/isolated-beat-testing

Conversation

@IanEff

@IanEff IanEff commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Summary

Enables developers on resource-constrained laptops (or doing fast unit verification) to test and run thump's binaries in isolation without running a Kubernetes cluster, Docker/OrbStack VM, or the 12GB+ dev substrate.

What's included:

  1. Golden Scenario Fixtures (test/fixtures/):
    • Canonical signal.Detection, proposal.Set, and decision.Governed payloads for cart-failure.
    • Prometheus and Loki response JSON payloads.
    • Comprehensive unmarshaling and schema invariant tests.
  2. Isolated Beat Execution (internal/step):
    • Pure function entry points: step.RunRattle, step.RunClank, step.RunHiss, and step.RunThump.
    • Evaluates static JSON/YAML files and returns canonical domain objects without background daemons.
  3. Headless Simulation Pipeline (internal/pipeline):
    • pipeline.Run chains detection -> proposal -> decision -> dry-run outcome in-memory in ~50ms.
  4. Lightweight Telemetry & Broker Stubs (internal/mock):
    • mock.TelemetryServer: In-process HTTP server answering Prometheus PromQL and Loki query APIs.
    • mock.EmbeddedBroker: In-process NATS + JetStream server on ephemeral or configured ports.
  5. Calipers Subcommands (cmd/calipers, internal/calipers):
    • calipers step <rattle|clank|hiss|thump>
    • calipers pipeline --detection <path>
    • calipers mock [--prom-port 9090] [--nats]
  6. Taskfile Shortcuts & Docs (Taskfile.yaml, docs/dev-environment.md):
    • task beat:rattle, task beat:clank, task beat:hiss, task beat:thump
    • task dev:pipeline
    • task dev:mock
    • Complete documentation in docs/dev-environment.md.

Verification

  • Full local CI passed: task ci (format check, vet, lint, vulncheck, kubeconform CRD/chart linting, promtool SLO tests, config validation, race tests, integration tests, and binary build).
  • Verified unit and race tests across all new packages: internal/step, internal/pipeline, internal/mock, internal/calipers, and test/fixtures.
  • Confirmed single-beat step execution and mock server on localhost.

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