# Changelog

All notable changes to `mgf-fed` are documented here. Format: [Keep a Changelog](https://keepachangelog.com/);
versioning: [SemVer](https://semver.org/).

## [0.8.0] - 2026-06-29

### Added
- **Scaffold green-on-push-1** — a freshly-scaffolded repo passes CI on its first
  push instead of needing four manual fixes (surfaced shipping the mgf-fed-web /
  mgf-test-web / mgf-fedres web tools). The renderer/scaffold half (templates land in
  mgf-standard):
  - `lint-imports` (DP-01) now renders in the generated `.woodpecker.yml` **only when
    the repo declares an import-linter contract** — a `.importlinter` file OR
    `[tool.importlinter]`. A new `has_importlinter` render param gates the
    `# <<INSERT:lint-imports>>` marker; a repo without a contract omits the line
    instead of fast-failing the lint step on "Could not read any configuration".
  - `vuln-scan` applies a fleet-default `--ignore-vuln CVE-2025-71176` (the dev/CI-only
    pytest <9.0.3 local /tmp DoS, never in any shipped wheel) on every pipeline,
    deduped with any per-repo `[tool.mgf-fed].vuln_ignore`.
  - `mgf-fed scaffold` ships the AG-18 `.githooks/prepare-commit-msg` hook (via policy
    `[exact]`) and the writer `chmod`s `.githooks/*` to 0o755 so the committed hook is
    executable on a fresh clone.

## [0.7.2] - 2026-06-26

### Changed
- **Adopt mgf-common 0.49** (pin `>=0.49,<0.50`) and retire the last three
  closed-box `_DEFERRED` private reaches (AP-14 / DP-13): `_identity._set_identity`
  + `_identity._APP_NAME` -> public `set_identity()` / `app_name()`+`current_context()`;
  `_lifecycle._GLOBAL_CONTEXT` -> `reset_context()`; `_doctor_snapshot.RUNTIME_SNAPSHOT_ENV_VAR`
  -> the public re-export. `tests/test_closed_box.py::_DEFERRED` is now empty —
  mgf.fed reaches mgf.common only through its public API.

## [0.7.1] - 2026-06-26

### Changed
- **Adopt mgf-common 0.48** — widen the `[cli]` pin to `>=0.48,<0.49` (the
  cornerstone's L3 release: the `retry` primitive + a public `io.atomic_write`).
  Part of the fleet cohort pin-walk for the 0.48 minor.
- **AP-14 (closed-box) — route `atomic_write` through the public API.** All 12
  `from mgf.common._io import atomic_write` reaches (in `cli/_catch_up.py` and
  `cli/_migrate.py`) now use the public `mgf.common.io.atomic_write` that
  mgf-common 0.48 promoted. The closed-box guard
  (`tests/test_closed_box.py`) drops its lone `_io` blessing accordingly —
  tightening the contract so no private `mgf.common._*` reach is blessed; the
  three remaining `_DEFERRED` leaks (`_identity`/`_lifecycle`/`_doctor_snapshot`)
  still await their own public mgf.common APIs.

## [0.7.0] - 2026-06-24

### Added
- **Central log shipping (Logging L2, item e).** `mgf-fed` now bootstraps log
  shipping at the top of `main()`: when `MGF_LOGSHIP_URL` and
  `MGF_LOGSHIP_INGEST_TOKEN` are set, it attaches `mgf-logship`'s `LogShipper`
  to the root logger (`app="mgf-fed"`), so every invocation's logs reach the
  federation log host (openobserve-prod) over the NDJSON `/ingest` path. When
  shipping is enabled it also runs `mgf.common.bootstrap()` so records carry
  app/trace context (resolves the `current_context() before bootstrap` warning).
  Fully opt-in and guarded — unset env, or `mgf-logship` not installed, is a
  silent no-op, so the zero-dep orchestration core is unchanged. New private
  `mgf.fed._logging` module; `mgf-logship>=0.1.6` added to the `[cli]` extra.
  Verified end-to-end against the live collector (record + `app_version` land in
  OpenObserve).

## [0.6.0] - 2026-06-19

### Added
- **`mgf-fed start` — the single federation front-door.** One command, one
  consistent agent message for every onboarding case. It is a print-only
  dispatcher over the four existing prompts (it never duplicates their bodies,
  resolved from `mgf-standard`): auto-detects when the repo is already a
  registry member (`[project].name` in `mgf.standard.libraries()`) and prints
  the **sync** prompt; otherwise prints a scenario menu listing every mode with
  a detection hint (empty vs has-code, consumer vs not). `--mode
  {new|onboard|sync|adopt}` forces a mode, `--list` always prints the menu,
  `--path` points detection at a directory other than the cwd. Print-only by
  contract — it emits a prompt or a menu and never touches the filesystem.

### Fixed
- `mgf.fed.__version__` was stuck at `0.4.0` while the distribution shipped
  `0.5.0`; both now track the package version.

## [0.5.0] - 2026-06-16

### Added
- **The end-user / governance CLI, moved from `mgf-common`** (federation reorg
  Wave 3). `pip install 'mgf-fed[cli]'` adds `mgf-fed <verb>` for the former
  `mgf-common` subcommands: `version` / `bundle` / `explain` / `validate` /
  `migrate` / `bench` / `logs` / `standards` / `federation` / `design` /
  `init-project` / `catch-up` / `sync-prompt` / `new-project-prompt` /
  `adopt-prompt` / `onboard-prompt` / `agents` / `federation-sync` / `test`,
  plus **`app-doctor`** (was `mgf-common doctor`) and **`feedback-howto`** (was
  `mgf-common feedback`) — renamed so they don't shadow mgf-fed's native fleet
  `doctor` (self-check) and `feedback` (FB-05 relay). The commands live in the
  new `mgf.fed.cli` package and self-register into mgf-common's subcommand
  registry; `__main__` merges them into the native fleet parser.
- `[cli]` extra (`mgf-common>=0.47`, `mgf-standard`, `mgf-test-supervisor`).
  The zero-dep orchestration core (status / release / drift / …) still runs
  without it — every cli handler is imported lazily and the parser degrades
  gracefully when the extra is absent.

### Changed
- `[standards]` extra is now a thin alias for `[cli]` (back-compat).
- The `[cli]` extra requires `mgf-common>=0.47,<0.48` (the pure-library release
  that shed this CLI).

## [0.4.0] - 2026-06-14

### Added
- **Woodpecker pipeline generator** — `.woodpecker.yml` is generated per-repo from
  `mgf-standard/templates/woodpecker/` (`_woodpecker.render_woodpecker`); `scaffold` writes it,
  `drift-check` enforces generation-currency with a `[exempt].woodpecker` name-list fallback for
  bespoke repos. The CI-unification engine.

## [Unreleased]

## [0.9.0] - 2026-06-29

### Added
- **`fedres check` freshness gate in the woodpecker template (D-GEN).** The
  renderer now splices a standalone `fedres-check` step into a repo's
  `.woodpecker.yml` when (and only when) the repo carries
  `fed-resources/source/project.toml` (new `has_fed_resources` gate, mirroring
  `lint-imports`). The step installs `mgf-fedres` + `mgf-common[standards]` and runs
  `fedres check` — regenerate→byte-identical, nonzero on drift. The Class-P
  projectors read the registry from the mgf.standard package data, so the gate runs
  in a single-repo CI checkout (no sibling mgf-standard needed).

## [0.3.0] - 2026-06-13

### Added
- `mgf-fed feedback` — relay cross-repo feedback outboxes into target inboxes (FB-05). `--check`
  (default) scans every member's `pending-feedback/*.md` and exits non-zero on any un-relayed paper
  (the no-silent-rot gate); `--relay [--target R] [--dry-run]` assigns the target's next `PAPER-NN`,
  renders the FB-02 inbox entry into the target `FEEDBACK.md`, moves the source paper to
  `pending-feedback/relayed/`, and prints the reviewed PR commands. Idempotent; implements the
  mgf-standard `feedback-relay.md` recipe.

## [0.2.0] - 2026-06-11

### Added
- `mgf-fed doctor` — self-diagnostic (OP-02); rich `--version` (OP-01); top-level error handler (EH-04).
- Full ten-doc baseline (AGENTS/SECURITY/CONTRIBUTING/STARTHERE/FEEDBACK/FEDERATION + docs/claude/CLAUDE.md + PUBLIC_API.md) + docs buckets.
- Quality infra: coverage gate (>=80%), import-linter contract (WF-02), 13-marker test taxonomy + smoke layer, pytest-timeout, mgf-test-supervisor adoption ([supervisor] extra), [project.urls].

### Changed
- §Z conformance audit: mgf-fed now 122 ✅ / 0 ⏳ / 96 N/A — 100% of applicable MUSTs (was 80%).

## [0.1.0] - 2026-06-10

### Added
- Initial release — the federation orchestrator skeleton (Phase 0).
- `mgf-fed status` — read-only federation tracking matrix (per-repo version, conformance %,
  CI / import-linter / PUBLIC_API / ledger / `[standards]` presence) → `~/.mgf/MGF_FED_STATUS.json`.
- `mgf-fed drift-check` — verify each repo against the canonical scaffolding policy
  (`mgf-standard/templates/policy.toml`): present-files, byte-exact shared files, required
  `.woodpecker` steps, and pyproject gate-policy (incl. the ruff format-stability pin).
- `mgf-fed local-index` — inspect the local package index (`~/.mgf/local-index/`); the
  `local → Codeberg → PyPI` resolution mechanism for the upcoming local-release flow.
- Roadmap subcommands stubbed (`gates`, `local-ci`, `release-local`, `release-remote`,
  `scaffold`, `registry`) so `--help` documents the plan.
