# 「投稿」aggregate 統合 alignment 決定(entry/post merge, publish 廃止, markdown 常時)

# 「投稿」aggregate 統合 alignment 決定

**この entry の役目**: dispatch `entry-inline-embed`(`n_01KSN2F6FWQSQAWEE3N4PQVAWC` 由来)alignment phase の最終出力。impl scope ではなく、次 dispatch 用 brief 入力 + future context の archive。元 task(entry inline embed)は **撤回済**、新方針は user 判断による entry/post 統合。

## 起点と pivot 経緯

1. 元 task: 「entry を post 内 inline embed」追加 impl(`n_01KSN2F6FWQSQAWEE3N4PQVAWC`)
2. alignment 1: 3 focal(syntax / presentation / scope)で interpretation 投稿(`n_01KSN8MP20R0MY60MGHP0BG7CW`)
3. pivot 1: user 「entry / post 別物 modeling が妥当か再考したい」 → A / B / C 比較 entry(`en_01KSN9KV69749Z3NPTE2XVPPGC`)
4. user 質問深堀 → ATProto ecosystem 調査(WhiteWind の comment は URL match、cross-lexicon reply は未確立)→ E1a(kneume URL 採用、whtwnd URL は future)で一度確定
5. URL parser 着手後 pivot 2: user 「全てを撤回。投稿という単一の単位だけにする」 → 本 entry の内容で再 alignment

## 完成像(統合後の状態を 1 段落で)

kneume の content aggregate は **「投稿」(`n_<ULID>`) 1 種類のみ**。短文も長文も同じ shape(plain text + markdown、100K grapheme cap)、reply / tag / share URL / audience は全部投稿に統一。`entries_*` aggregate と関連 MCP tool / SPA component は廃止、過去 entry は物理マイグレーションで投稿に変換(title は body 冒頭の markdown heading に吸収)。ATProto publish 機能は kneume から除去(将来再開の余地は残すが現状不要)。curation aggregate は別軸として温存。

## 確定事項一覧

### F1. Migration(物理マイグレーション)

- `entry_created` / `entry_updated` / `entry_deleted` event を `post_*` event に rewrite
- id 採番: `en_<ULID>` → 新規 `n_<ULID>`(id space 衝突回避のため renumber)
- `title` field → body 冒頭に `# <title>\n\n` として吸収
- `content` → `body`
- `audience_group_id` / `created_at` / `owner_did` carry over
- 旧テーブル `entries_raw` / `entries_current` 削除
- 旧 MCP tools `create_entry` / `update_entry` / `delete_entry` 削除

### F2. 「投稿」shape

- **F2-a** body cap = **100,000 graphemes**(現 `ENTRY_CONTENT_GRAPHEME_LIMIT` を継承)
- **F2-b** markdown rendering = **常時**(plain text は CommonMark で互換解釈、UI 分岐なし)
- **F2-c** ATProto publish = **廃止**

### F2-c の cascade(publish 廃止に伴う除去)

- MCP tools: `publish_post` / `unpublish_post` 削除
- DB columns: `posts_raw.atproto_record_uri` / `posts_raw.atproto_record_cid` 削除
- 過去 publish 済 record は **server から retract しない**(user 手動 or 廃止前 warn migration 1 回)
- SPA: post-card の「▲ published」chip / Publish menu / Unpublish menu 削除
- ATProto OAuth login は **維持**(F3-c 判断、DID 取得 + 将来 publish 再開 preparation)

### F3. UI

- **F3-a** composer = **textarea のまま、submit 後 markdown 解釈で render**(編集体験現状継承)
- **F3-b** post-card 長文 = **長さ閾値で自動折り畳み + 「全文を読む」expand**(feed flood 回避、in-place expand)
- **F3-c** ATProto OAuth login = **維持**(削除コスト > 維持コスト)

### F4. Curation

- そのまま別 aggregate として残す(`c_<ULID>`、ordered members + curator narrative)
- 投稿の中に markdown で curation 的構成も可能だが、curation aggregate は並列で利用可

## 次 dispatch への推奨

impl 規模は本 child の brief を大幅に超えるので、別 dispatch で立て直し:

1. **task slug 候補**: `unified-post-aggregate` / `post-entry-merge` / `posts-only-modeling` 等
2. **分割推奨**(1 PR では大きすぎるので段階分け):
   - **PR1**: ATProto publish 機構の除去(`publish_post` / `unpublish_post` / 関連 columns / SPA chip / menu)
   - **PR2**: posts body cap relax(100K) + markdown rendering(常時、CommonMark)+ post-card 長文折り畳み UX
   - **PR3**: entry → post 物理マイグレーション(event rewrite + 旧テーブル / MCP tool 削除 + SPA `/entries` page 廃止)
   - 各 PR 独立で動かす(PR1 / PR2 は逆順 OK、PR3 は最後)
3. **凍結事項**(新 brief で明示すべき):
   - curation aggregate は触らない(F4 維持)
   - mention / post_refs / agent_accounts の挙動は触らない
   - composer UI の textarea → MarkdownEditor 昇格は **やらない**(F3-a)
4. **migration 注意**:
   - 過去 publish 済 post の atproto_record_uri trace は event log に残す(SPA UI からは見えなくなるが、再開時に必要)
   - 既存 entry の `n_<ULID>` 再採番で、entry detail page を share した既存 URL は壊れる(pre-alpha なので許容)

## refs

- 元 task: `n_01KSN2F6FWQSQAWEE3N4PQVAWC`
- alignment thread root: `n_01KSN8MP20R0MY60MGHP0BG7CW`
- A/B/C 比較(撤回前の議論): `en_01KSN9KV69749Z3NPTE2XVPPGC`
- design.md § "Entry aggregate" — 次 dispatch で撤回 update が必要
- 関連 memory:
  - `feedback_kneume_pre_alpha_clean_over_compat.md`(clean over compat 方針、本 alignment と整合)
  - `project_kneume_curation_aggregate_direction.md`(curation 別軸維持と整合)
  - `feedback_completion_image_before_gap.md`(本 entry は完成像先述スタイル)
  - `feedback_artifact_purpose_declaration.md`(本 entry は冒頭役目宣言)

## 本 child(`entry-inline-embed`)の終了処理

- 元 task の impl は **未実施**(URL parser 着手まで → 撤回で削除)
- worktree `.claude/worktrees/entry-inline-embed/` は議論 archive 用以外の deliverable なし
- `.agent-status` = aborted(理由: user による全面撤回 + scope 大幅 pivot、impl は別 dispatch で実施推奨)
- driver は本 worktree を削除 OK、本 entry を次 dispatch の brief 入力として参照