-- tools/domains/README.rail — Domain Plugin Convention.
--
-- Run with: ./rail_native run tools/domains/README.rail
-- Prints the convention so future Claudes don't have to guess.
--
-- ── The convention ──────────────────────────────────────────────────────
--
-- Each domain lives at tools/domains/<name>/ and provides any subset of
-- these Rail entry points (all OPTIONAL — pick the verbs that fit):
--
--   state.rail     Print current state of the domain. Always safe to run.
--   bench.rail     Score the domain's current capability. Read-only ideally.
--   init.rail      First-time setup. Idempotent (running twice is harmless).
--   tick.rail      One cycle of work. Caller drives the cadence.
--   harvest.rail   Collect successful outputs as training data.
--
-- ── How to use ──────────────────────────────────────────────────────────
--
--   Discover domains:    ./rail_native run tools/domains/list.rail
--   Run a verb:          ./rail_native run tools/domains/<name>/<verb>.rail
--
-- ── What this is NOT ────────────────────────────────────────────────────
--
-- There is no dispatcher. There is no manifest format. There is no
-- registry file. The filesystem IS the registry. Discovery is `ls`.
-- Each .rail file is a normal Rail program runnable directly.
--
-- ── Why ─────────────────────────────────────────────────────────────────
--
-- Empire's domains/ plugin system kept Trading and Ad Intel sharing
-- infrastructure. Rail's tools/ is a flat zoo today — neural_plasma,
-- railml, uav, plasma, train, fleet, deploy, apps. They share nothing.
-- This convention is the smallest spine that lets them share without
-- introducing a Rail-level abstraction layer (which would be the
-- premature-abstraction trap).
--
-- The first transplant: tools/domains/neural_plasma/. If a second
-- domain proves the shape, generalize. Until then, don't.

main =
  let _ = print "tools/domains/ — Domain Plugin Convention"
  let _ = print ""
  let _ = print "Each domain lives at tools/domains/<name>/ and may contain:"
  let _ = print "  state.rail     print current state (always safe)"
  let _ = print "  bench.rail     score current capability (read-only)"
  let _ = print "  init.rail      first-time setup (idempotent)"
  let _ = print "  tick.rail      one cycle of work"
  let _ = print "  harvest.rail   collect successful outputs"
  let _ = print ""
  let _ = print "All entry points are OPTIONAL. The filesystem is the registry."
  let _ = print "Discover domains:  ./rail_native run tools/domains/list.rail"
  let _ = print "Run a verb:        ./rail_native run tools/domains/<name>/<verb>.rail"
  0
