---
name: project-session-2026-05-27-paper157-publish-and-maintenance
description: "2026-05-26/27 session — Chang STEP984 sorry close, 5/26 invention (SEED 1622), doc hygiene, Zulip finalize, Paper 157 fully published (DOI+11 platforms+Harvard); reusable publish-pipeline gotchas"
metadata: 
  node_type: memory
  type: project
  originSessionId: 4d9333d7-e932-4180-904a-8c123eea02b6
---

2026-05-26→27 long Rei-AIOS session. Full arc + reusable operational knowledge. Paper 157 specifics live in [[project-paper157-stage12-mathlib-octonion-corrigendum-2026-05-24]].

## Session arc (all git-committed; pointers, not duplication)
1. **Session-start protocol** (CLAUDE.md mandate): ran Research Radar 2026-05-26 → top finding **Chang v6** `arXiv:2603.11066` (Paradigm Exhaustion, 233pp, LLM-collab not Lean). Audit found Rei already formalized Chang's *sibling* paper `2603.25753` at **STEP 984** (`Step984ChangMapBalance.lean`).
2. **Closed the STEP 984 `compCollatz_preserves_odd` sorry** (Mathlib `ordCompl`/`not_dvd_ordCompl`; sorry 1→0, 2 axioms kept as honest Chang-provenance markers). commit `96a68307`.
3. **Activity Log regenerated** 1159→1168 / SEED 1607→1619.
4. **2026-05-26 invention review**: 藤本さん approved ①②④ / rejected ③⑤ (③ within-batch dup Occam target, ⑤ Pattern-1 Fourier `e^(ikr)` recycle of 5/20). honest downgrades 0.58/0.58/0.52. **SEED 1619→1622** (verified, no dup ids). commit `8e5248a1`.
5. **harness-sync** healthy (NOT stale — I misread the append-log head; correction). 0 new upstream.
6. **"what else is pending" audit** → fixed: **SITE_COVERAGE_MAP.md** stale 1138→1168 + **CLAUDE.md** Phase-C row (silicon actually done STEP 1028-1039) — commit `e2ea2f4d`. **Zulip post draft finalized** (`docs/mathlib/zulip-post-draft-NumberTheory-Collatz.md`; posting is 藤本さん external action) — commit `60cde836`.
7. **Paper 157** Stage 3-5 + criterion 7 audit + criterion 8 review + **full publish** — see the Paper 157 memory.

## ★ Reusable publish-pipeline gotchas (hard-won, NOT obvious from code)
- **Zenodo fresh deposit**: POST empty `{}` → PUT metadata → PUT to `links.bucket` → POST `/actions/publish` (202). DOI is **immutable**. Safe pattern: create **draft-only** (stop before publish) → fetch+verify metadata → publish the **existing** deposit by id (don't re-run create = orphan draft). The `publish-paper-157-zenodo.ts` has a hard guard `PAPER157_PUBLISH=YES_GATE_PASSED` + `PAPER157_DEPOSIT_ID` branch.
- **Verify the DESC before immutable publish** — I caught a stale "v0.0.3" in the DESC after the version was v0.0.5; deleted the draft (`DELETE /api/deposit/depositions/{id}` → 204) and recreated. Token via shell var, never echoed.
- **canonical_url** for SNS scripts is read from `data/publications/publish-log-paper{N}.json` `zenodo_doi` (suffix-less filename — `-zenodo` suffix is NOT read). Write that file after the DOI.
- **Harvard Dataverse** = add file to the existing OUKC dataset **`doi:10.7910/DVN/KC56RY`** (`/api/datasets/:persistentId/add`, status 200/201 leaves it DRAFT) → then run `publish-harvard-draft-to-version.ts` to release the version. Opt-in only (`feedback_harvard_dataverse_opt_in.md`) — explicit user request = opt-in.
- **5 broadcast scripts** (devto/hatena/hackmd/notion/livedoor) are **META-keyed by paper number** — add a `157:`-style entry (shapes: devto/hackmd `{titleEn,tags,slug}`, hatena/livedoor `{titleJa,categories[]}`, notion `{titleEn,emoji}`). devto/hatena/hackmd support `DRY_RUN=1`.
- **scrapbox takes the file BASENAME, not the number** (`...-DRAFT`, no `.md`). mastodon/nostr take the number.
- ★ **Notion**: `richText()` set `link.url` verbatim → relative md-links (`other-paper.md`, `#anchor`) caused **400 "Invalid URL for link"** and failed the body append (page created, body empty). **Fixed in code**: only link absolute `http(s)/mailto/doi` URLs, else plain text. To re-do: archive the partial page (`PATCH /v1/pages/{id}` `{archived:true}`, Notion-Version `2022-06-28`) then re-run.

## Git discipline (confirmed this session)
- **`git add -A` 禁止** in rei-aios (churn ~742 files: data/* + dist-renderer/* auto-regenerated by learning loop + cron). Only `git add <specific files>`. The cron's "Auto: site rebuild + stats refresh" sweeps churn + pushes (my commits rode along; local==origin always within minutes).
- **dist-renderer/oukc/*.html deletions are a BENIGN dev:build-chain state** — `npx tsx scripts/build-oukc-static-pages.ts` (5 s) regenerates all 12 oukc + 3 tools pages (D→M). Confirmed this session. NOT the STEP 1055 incident. Don't commit the regen (cron's job).
- pre-commit hook verifies staged `.lean` files with `lake env lean`.
