CASE STUDY / WIP / SAFE PUBLISHING
HOKKAI TRACE
Notionの人間承認から静的build、本番確認、Published更新までを一つの安全な公開単位へ。
Problem
承認・build後にPages deployで停止し、Production表示とNotionのPublished更新まで安全に閉じていませんでした。
Requirements
Approved記事1件だけを固定し、test・build・deploy・Production確認後に同じpage IDだけをPublishedへ更新すること。
Constraints
Notion tokenはSecretsのみ。mock fallbackで本番公開しない。失敗時にPublishedへ進めない。
Architecture
Notion API → approval gate → GitHub Actions → Astro build → Pages deploy → HTTP verification → Notion status update。
Implementation
対象page IDとslugをjob間で固定し、Production verifierと冪等なPublished更新処理を追加しました。
Failed Approach
artifactを直接deployし、deploy後にApproved全件を再取得して更新する方式では、build対象と更新対象の同一性を保証できませんでした。
Root Cause
Private repositoryのPages利用条件とworkflow設定が一致せず、deployment APIが404。さらに対象IDが処理全体で固定されていませんでした。
Fix
15a93c6で承認対象の固定、Production検証、同一pageだけのPublished更新を実装しました。
Testing
locale、source normalization、secret masking、approval gate、mock拒否、単一記事選択、Published更新の15件を実行。
Evidence
- Tests15 / 15 PASS
- Git15a93c6
- Production404 — release gate未完了
Result
安全ゲートと検証処理は実装・テスト済みですが、Pages本番は404のためWIPです。
Known Limitations
Private repositoryのPages有効化または公開先変更が必要。実記事のProduction E2EとNotion status更新は未完了です。
Lessons Learned
deploy成功だけを完了条件にせず、artifact、Production表示、更新対象IDを一つのトランザクションとして扱います。
AI Collaboration
情報源・公開承認・危険度判断はKoshi。パイプライン実装とテスト支援にAI coding toolsを使い、人間承認を省略しない設計です。
Timeline
- Source collection
- Notion review schema
- Approval pipeline
- Production failure investigation
- Safety gate fix
- WIP — Hosting decision pending