# mgf-fed — Magogi Foundation federation orchestrator

> **Conformance: L2** (target) — per-rule ledger:
> [`docs/inprogress/MGF_STANDARDS_CONFORMANCE.md`](docs/inprogress/MGF_STANDARDS_CONFORMANCE.md).

Runs the recurring cross-repo work — quality gates, local/remote release, status,
drift, provisioning — **consistently, controllably, and trackably** across the
`mgf-*` fleet, in dependency-wave order. It *composes* existing assets rather than
reinventing them:

| Concern | Reused asset |
|---|---|
| release/build **order** | `mgf-standard` registry (`MGF_LIBRARIES.json` → `release_waves`) |
| gate/test **runner** | `mgf-test-supervisor` (`mtest`) |
| **local CI** | `woodpecker-cli exec` (the real `.woodpecker` pipeline, in containers) |
| **SCM/release** flow | `tea` + `git`, with the federation guardrails baked in |

Plan & rationale: see `mgf-standard/docs/inprogress/federation-automation-and-release-plan.md`.

## Shape

mgf-fed is a **zero-runtime-dependency orchestrator core** (`mgf.fed`) plus, under
the optional **`[cli]` extra**, the merged end-user/governance command surface
extracted from `mgf-common` in Wave 3. The core runs identically whether or not
`[cli]` is installed.

```bash
pip install mgf-fed          # the zero-dep orchestrator core
pip install 'mgf-fed[cli]'   # + the governance front-door (doctor/explain/bundle/…)
```

## Native fleet verbs

```bash
mgf-fed status              # the federation matrix (version, conformance %, scaffolding)
mgf-fed status --json       # machine-readable -> ~/.mgf/MGF_FED_STATUS.json
mgf-fed gates               # run the quality gates across the fleet, wave-ordered
mgf-fed local-ci            # run the real .woodpecker pipeline locally (woodpecker-cli exec)
mgf-fed release-local       # Phase A: build + validate the wheel
mgf-fed release-remote      # Phase B: tag + publish + REST-verify, wave-ordered
mgf-fed scaffold            # render repo artifacts from the canonical templates
mgf-fed drift-check         # report template/registry drift (never silently edits)
mgf-fed registry --check    # the REL-13 federation consistency + currency gate
mgf-fed provision-ci-host   # stand up a CI host on Infomaniak (via mgf-cloud)
```

Set `MGF_ROOT` if the sibling repos aren't under `~/PycharmProjects`. Central log
shipping activates when `MGF_LOGSHIP_URL` + `MGF_LOGSHIP_INGEST_TOKEN` are set
(`[cli]` extra) — every invocation's records then reach openobserve-prod
(`app="mgf-fed"`).

## Governance front-door (`[cli]` extra)

```bash
mgf-fed version            # rich version + git SHA + Python/platform + dep versions
mgf-fed app-doctor         # install-state + wiring health (--standards for the code audit)
mgf-fed explain            # the resolved settings, with per-field provenance
mgf-fed logs               # locate / tail / follow an app's rotating-file JSON logs
mgf-fed bundle             # one redacted diagnostic tarball for a bug report
mgf-fed validate / migrate / catch-up / standards / agents / start / feedback-howto …
```
