No description
  • Erlang 89.6%
  • Python 5.6%
  • Shell 2.9%
  • Dockerfile 1.9%
Find a file
2026-11-24 01:12:25 +01:00
.github ci: call the C4 gate that reads the front page 2026-10-23 21:08:42 +02:00
apps No crew member or lab box names in a public tree 2026-11-23 21:24:39 +01:00
architecture c4_model: the components diagram names the libraries this release carries 2026-10-30 15:11:07 +01:00
assets c4_model: the components diagram names the libraries this release carries 2026-10-30 15:11:07 +01:00
config The Erlang cookie stays on the box; distribution and epmd on loopback (PR 1 squashed) 2026-11-23 21:21:07 +01:00
deploy No crew member or lab box names in a public tree 2026-11-23 21:24:39 +01:00
scripts The Erlang cookie stays on the box; distribution and epmd on loopback (PR 1 squashed) 2026-11-23 21:21:07 +01:00
.gitignore P0 shadow: the guardian service — senses, proposes, records, applies nothing 2026-10-04 20:29:08 +02:00
.tool-versions P0 shadow: the guardian service — senses, proposes, records, applies nothing 2026-10-04 20:29:08 +02:00
CHANGELOG.md 0.4.0: mcl_om 1.6 and macula 18, and the alert subscription names its sources 2026-10-30 15:07:00 +01:00
Containerfile The Erlang cookie stays on the box; distribution and epmd on loopback (PR 1 squashed) 2026-11-23 21:21:07 +01:00
LICENSE Initial commit 2026-10-04 17:47:45 +02:00
README.md README: drop the GitHub Sponsors badge 2026-11-23 22:20:38 +00:00
rebar.config 0.4.0: mcl_om 1.6 and macula 18, and the alert subscription names its sources 2026-10-30 15:07:00 +01:00
SECURITY.md SECURITY.md: response times, attachment and identity rules, drills (macula-io/macula#174) 2026-10-31 02:59:37 +01:00

CI License ghcr.io BEAM Buy Me a Coffee

Macula

--- An intelligent security guard service

Plans live in GitHub issues labelled plan: the guardian architecture (#19), the autonomous guardian's fitness, environment and learner (#20), and the trainer console (#21). The control surface it actuates (get_limits / set_limits, the denials_observed facts) is built in mcl-om and documented there, in docs/design/GUARDIAN_CONTROL_SURFACE.md.

P0 shadow (current)

The service observes, proposes and records — it applies nothing. No guardian tier, no set_limits anywhere in its namespace; the worst a compromised P0 guardian can do is write a bad proposal into its own log, or a run set into its own run directory.

  • Sense: subscribes to denials_observed (the alert facts guarded services publish once per window with activity, mcl-om#13).
  • Propose: the placeholder rule behind mcl_sec_guard_proposer (configurable via {mcl_sec_guard, proposer}); the TWEANN-backed proposer (faber_tweann, evolved in apps/mcl_sec_trainer) replaces it once the loop is proven.
  • Record: one ~0p line per proposal in the append-only log ({mcl_sec_guard, proposal_log}).

The trainer (apps/mcl_sec_trainer)

A second OTP application, not a service: the pure simulator world, the eight-scenario suite, the episode runner and the versioned fitness vector — held to the real mcl_om guard by a conformance test. Off by default ({mcl_sec_trainer, enabled, false}: it boots an empty supervisor and starts nothing) and in the release since #16, so the console's run button works on the box. The learner, faber's only user, stays out in its own app: faber never ships, and the image build refuses it. The incumbent placeholder rule is scored as the baseline every genome must beat.

The console

The LAN admin UI (the port MCL_SEC_GUARD_ADMIN_PORT names, every interface, no auth: the dev-fleet posture), an audit window in both directions: it renders the log and the run sets, and its run button writes a run set. It decides nothing.

  • / — the proposal log
  • /proposals.ndjson — the log raw
  • /trainer — the scoreboard: run-set artifacts ({mcl_sec_guard, trainer_runs}, default trainer_runs/) rendered as one row per scenario, plus the candidate-vs-incumbent diff and the fitness vector
  • /trainer.ndjson — the raw feed, one JSON line per episode
  • /trainer/episode?scenario=... — one episode's drill-down
  • POST /api/trainer/run — the Run evals button (phase B, #13): the baseline suite, or one genome the body carries ({"genome": [339 floats]}), written as a run set and answered with a 303 to /trainer; a 400 names a malformed body, a 409 means a run is already in flight

Run sets are written by mcl_sec_trainer_reporter (see #21).

Building

The OTP is pinned in .tool-versions (installed with asdf in this house); commands run from the repo directory use the pinned VM via the asdf shims:

rebar3 compile
rebar3 eunit
rebar3 lint

Architecture

The C4 model is in architecture/README.md, with its diagrams drawn by architecture/c4_diagrams.py into assets/. Change the script, run it (python3 architecture/c4_diagrams.py), and look at the result before committing.

mcl-sec-guard system context