beam4pm

beam4pm is a BEAM-first process-mining substrate whose application source is manufactured entirely by ggen from an RDF ontology and a vendored ggen-marketplace pack. There is no generated/ directory: manufactured code lives in the same src/, lib/, test/, gleam/, schema/, and docs/reference/ directories hand-authored code would use — provenance is signalled per-file by a GENERATED by ggen ... Do not edit. header, never by directory placement. beam4pm_pro is the planned future commercial layer on top of this substrate; its core reconciliation modules already exist as real code with matching test suites (beam4pm_billing/BeamPM.Billing, MP6 usage/billing reconciliation; beam4pm_entitlement/BeamPM.Entitlement, MP3 entitlement reconciliation) — the remaining gap is marketplace/pricing/RevOps tooling, not these core modules (PRO_CAPABILITY_SEEDS: PARTIAL_ALIVE), and no separately installable/licensed beam4pm_pro product boundary, distribution channel, or control plane exists yet (PRO_PRODUCT_BOUNDARY: UNSUPPORTED, PRO_DISTRIBUTION_AND_UPGRADE: UNSUPPORTED, PRO_CONTROL_PLANE: UNSUPPORTED). See docs/jira/v26.8.29/ for the full doctrine, vision, and RevOps package, and docs/v26.8.30/README.md for the current gap-closure status and acceptance criteria.

Source-authority doctrine

Direct edits to application source are refused by default, for humans and LLMs alike. The only legitimate manufacturing inputs are ontology.ttl, ggen.toml, rebar.config, mix.exs, src/beam4pm.app.src, and the templates inside the vendored ggen-marketplace pack (vendor/ggen-marketplace/packs/beam4pm-process-model-pack). Any file whose first line reads GENERATED by ggen ... Do not edit. is ggen output and must never be hand-edited, regardless of which directory it lives in — if it's wrong, fix the ontology or the pack's templates and regenerate. See docs/jira/v26.8.29/03-architecture-and-ggen-manufacturing.md for the full policy, including the narrow, receipted privileged-exception path for direct intervention.

Current status

A wide, still-growing slice, manufactured via the beam4pm-process-model-pack (vendor/ggen-marketplace/packs/beam4pm-process-model-pack) from the bpm:RecordType individuals currently admitted in ontology.ttl (981 as of 2026-09-27; the pre-WS2 slice was 290, and the merge-day 2026-09-27 merge added 30 bpm:aloop_*_rt ALOOP episode-loop record types).

Build and test

git clone --recurse-submodules <this-repo-url>
cd beam4pm
source scripts/env/rust4pm_reactor_env.sh   # points RF2/RF3 tests at the built native oracle binaries
rebar3 eunit   # EUnit tests over the generated Erlang types, manifest, and behavior (3100 at the 424d04c6 verified run; grows with the admitted graph)
mix test       # ExUnit tests over the generated Elixir types, manifest, and behavior (1108 at the 424d04c6 verified run; grows with the admitted graph)

--recurse-submodules is required: three git submodules manufacture or back this repo — vendor/ggen-marketplace (the pack that manufactures every record type), native/ferroplan (the PDDL planner engine), and vendor/rust4pm-powl (the reference process_mining crate the POWL 2.0 wire types are checked against for field-shape parity). Skipping the source scripts/env/rust4pm_reactor_env.sh step leaves RF2_ORACLE_BIN/ RF3_ORACLE_BIN unset, which fails 11 of the ExUnit tests loudly with a System.EnvError naming the exact fix — never a silent skip.

A Rust/cargo toolchain is required, even though the primary manufacturing pipeline (ggen/Tera) does not otherwise need Rust: compiling the ggen_igniter hex dependency builds its oxigraph query engine as a Rustler NIF, and the RF1/RF2/RF3 Chicago tests spawn real Rust subprocess oracles (native/rf1-dfg-oracle, native/rf2-conformance-oracle, native/rf3-ocel-oracle) — see scripts/igniter_sync.sh and playground/playground.sh's own step 1/10 toolchain preflight, which checks for cargo (alongside ggen, erlc, rebar3, elixir, mix, gleam) and fails closed with BLOCKED: required tool 'cargo' not on PATH before attempting the igniter sync, rather than failing deep into the build.

Regenerating

ggen sync run

(ggen.lock is committed at this pin — tracked again by the merge-day 2026-09-27 merge, dba2e267 — so a plain ggen sync run uses it; removing it is only warranted after raising the vendor pin.) This re-runs the ggen pipeline against ontology.ttl and the vendored pack, regenerating every manufactured file (see scripts/gate_m2_check.sh for the authoritative marker-driven definition and current count) from scratch.

Full doctrine and vision

See docs/jira/v26.8.29/README.md for the complete v26.8.29 package: architecture and manufacturing doctrine, product requirements, pricing/packaging, GTM, security/airgap, release gates, and the beam4pm_pro commercial vision.