# PAPER-100 — fleet re-baseline rollout (tracker + resume runbook)

> **Status:** ✅ **COMPLETE** — all 4 phases shipped; mgf-standard **0.1.50** released with the 258-index
> (2026-06-12). **Owners:** federation maintainer + Claude Code.
> **Crash-safe:** every artifact referenced here is committed + pushed to Codeberg; nothing depends on
> local `/tmp` or a running process. **If the IDE / laptop crashed mid-rollout, go straight to §4.**

## 1. What & why

PAPER-100 (`FEEDBACK.md`) found the *Index of MUSTs* omitted ~40 binding MUST-level rules (5 families
+ REL-10..13), so `doctor --standards` (CFM-03) was gating ledger completeness against an **incomplete
denominator (218 instead of 258)**. This rollout fixes it end-to-end:

| Phase | What | Status | PR(s) |
|---|---|---|---|
| 1 | Complete the Index of MUSTs (218 → **258**, 16 → **21** families) in `docs/standards/README.md` | ✅ done | #62 |
| 2 | Anti-drift gate `scripts/gen_rules_index.py --check` + `docs/standards/rules.json` | ✅ done | #63 |
| 3 | Re-baseline every repo's §Z ledger (+40 rows each) to 258 | ✅ done | per-repo (all 21) |
| 4 | Release `mgf-standard` (ships the 258-index) → every doctor enforces 258 | ✅ done | #65–#67 |

(Related, already shipped: PAPER-100..106 hygiene fixes #59; PAPER-107 shared-code discipline #60/#61.)

> **✅ DONE (2026-06-12).** All 21 §Z ledgers merged at 258; mgf-standard 0.1.50 published (REST 200) — a
> fresh `pip install mgf-standard==0.1.50` ships `read_standard("README")` = **258 rows**; registry REL-13
> GREEN + CURRENT. The fleet's doctors enforce 258 as each repo's `mgf-common[standards]` lock refreshes to
> 0.1.50 (within the existing pin — routine, no forced bump). §4 below is retained for reference / future re-baselines.

## 2. THE invariant — do not violate

**Every repo's §Z ledger MUST be merged at 258 on `main` BEFORE `mgf-standard` is released at 258.**
The doctor reads the Index *dynamically* (`mgf-common/src/mgf/common/cli/_doctor_standards.py`
`_corpus_must_ids` → `mgf.standard.read_standard("README")`), so a repo whose `mgf-common[standards]` /
`mgf-standard` pin upgrades to the 258-corpus **while its ledger is still 218 → `doctor --standards`
goes RED**. Re-baselining a ledger is *forward-compatible* (the doctor's current 218 ⊆ a 258 ledger),
so **merging ledgers early is always safe**; only the Phase-4 release flips the denominator. There is
**no `mgf-common` code change** — the doctor parses the Index dynamically.

## 3. How to check the live state (run this anytime)

```sh
cd "${MGF_ROOT:-$HOME/PycharmProjects}"
for r in mgf-*; do
  led="$r/docs/inprogress/MGF_STANDARDS_CONFORMANCE.md"; [ -f "$led" ] || continue
  ids=$(grep -oE '\| [A-Z]{2,5}-[0-9]+ \|' "$led" | sort -u | wc -l)
  br=$(git -C "$r" branch --show-current)
  unmerged=$(git -C "$r" ls-remote --heads origin docs/paper-100-rebaseline 2>/dev/null | wc -l)
  echo "$r: $ids ids on $br  $([ "$unmerged" = 1 ] && echo '(rebaseline branch still on origin — UNMERGED)')"
done
```
A repo is **done** when it shows `258 ids on main` and no rebaseline branch on origin. It is **pending**
when its branch `docs/paper-100-rebaseline` (ledger committed + pushed) is still on origin.

## 4. Resume procedure

### Step A — finish Phase 3 (merge the pending ledgers)
Each pending repo has its re-baselined ledger committed + pushed on branch **`docs/paper-100-rebaseline`**.
Merge each via PR (direct-push to `main` is denied — PR flow only):
```sh
r=<repo>; cd "${MGF_ROOT:-$HOME/PycharmProjects}/$r"
tea pr create --login codeberg --repo "magogi-admin/$r" --base main --head docs/paper-100-rebaseline \
  --title "docs($r): PAPER-100 §Z re-baseline to 258" \
  -d "Re-baseline §Z to the 258-MUST set (seed helper, shape-assessed). DOC-15 forward-compatible."
tea pr merge --login codeberg --repo "magogi-admin/$r" --style merge <PR#>
git checkout main && git pull --ff-only origin main
git push origin --delete docs/paper-100-rebaseline && git branch -D docs/paper-100-rebaseline
```
> **Rate limit (the reason this is multi-window):** Codeberg throttles PR-creates to **~11 / 30 min**
> and throttles **similar titles** harder. Use **distinct titles per repo** and pace across windows.

**If a repo's branch is missing** (never seeded, or a brand-new federation member):
```sh
python "${MGF_ROOT:-$HOME/PycharmProjects}/mgf-standard/scripts/seed_ledger_rebaseline.py" <repo>
# review the FLAGGED rows it prints (Qt → GUI-01; perf-without-baselines → PF), then commit on
# branch docs/paper-100-rebaseline and PR it as above.
```

### Step B — Phase 4: release `mgf-standard` (ONLY after §3 shows ALL repos at 258 on main)
The corpus is already at 258 on `mgf-standard` main. Ship it so `mgf.standard` carries the new Index:
```sh
cd "${MGF_ROOT:-$HOME/PycharmProjects}/mgf-standard"
# 1. bump version: pyproject.toml + src/mgf/standard/__init__.py (__version__) + CHANGELOG.md  → PR + merge
# 2. publish (build-once → local-validate → promote to Codeberg):
export MGF_CODEBERG_TOKEN=$(grep -oE '[0-9a-fA-F]{40}' my_stuff/tokens/codeberg_package_token.txt | head -1)
mgf-fed release-local  mgf-standard     # build → validate → local index
mgf-fed release-remote mgf-standard     # annotated tag → uv publish → REST-verify
mgf-fed registry --check                # REL-13 GREEN + CURRENT
```

### Step C — verify Phase 4 complete
After a repo bumps its `mgf-common[standards]` / `mgf-standard` pin to the new version:
```sh
cd "${MGF_ROOT:-$HOME/PycharmProjects}/<repo>" && mgf-common doctor --standards   # DOC-15 now checks 258
```
Conformance %s recompute on the 258 denominator — mostly unchanged (the +40 rows are ✅/N/A by shape);
PF / observability-owning repos may show new ⏳. `mgf-fed status` shows the whole fleet.

## 5. Snapshot (as of 2026-06-11 — use §3 for the live state)

- **Done (258 on main):** mgf-fed (#9, stays 100%), mgf-apiprobe (#13, 98%), mgf-common, mgf-auth,
  mgf-livepush, mgf-logship, mgf-test-supervisor.
- **Pending (branch pushed, awaiting merge):** mgf-django, mgf-hrb, mgf-http, mgf-sqlalchemy,
  mgf-tele-core, mgf-vm-core, mgf-alembic, mgf-fastapi, mgf-tele-teltonika, mgf-vm-firecracker,
  mgf-vm-forensics, mgf-vm-interchange, mgf-vm-libvirt, mgf-vm-sdk. *(A background loop was working
  through these; if it died, resume per §4 Step A.)*
- **mgf-standard corpus:** at 258 on main, **not yet released** (Phase 4).

## 6. Key facts & artifacts

- **The 40 new MUSTs:** TM (6) · PF (7) · OB (10) · NM (3) · GUI (10) · REL-10..13 (4).
- **Verdict pattern** (worked templates: mgf-fed thin-CLI stays 100%, mgf-apiprobe library 98%):
  GUI **N/A** fleet-wide (no GUI apps among the members; GUI-01 ✅ = no Qt import) · OB **N/A** for
  libraries (they *consume* `mgf.common.observability`; OB rules bind the owner) · NM + REL-10/11/13 **✅**
  for every member · REL-12 N/A · TM **✅** where the repo uses UTC datetime (mirrors its DP-12 ✅), else
  N/A · PF **⏳** only where perf tests exist without `tests/perf/baselines.json`, else N/A.
- **Anti-drift gate:** `scripts/gen_rules_index.py --check`; `SHOULD_ALLOWLIST` = NM-04/05, OB-06, PF-06,
  PR-02/06, TM-05/06 (the 8 anchored-but-deliberately-unindexed SHOULDs).
- **Seed helper:** `scripts/seed_ledger_rebaseline.py <repo…>` (idempotent; shape-detected).
- Agent-memory pointer: `~/.claude/.../memory/plasma-feedback.md`.
