Skip to content

chore: storage YAML fix + default port 3321/3322 + 自動生成ファイル untrack (PR-D)#20

Merged
shomatan merged 6 commits into
mainfrom
chore/storage-port-fixes
Apr 29, 2026
Merged

chore: storage YAML fix + default port 3321/3322 + 自動生成ファイル untrack (PR-D)#20
shomatan merged 6 commits into
mainfrom
chore/storage-port-fixes

Conversation

@shomatan
Copy link
Copy Markdown
Contributor

Summary

PR #18 を 4 PR に割り直したうちの 副作用 bug fix 部分。MCP 機能本体とは独立して merge 可能。

3 つの独立した修正:

  1. YAML 永続化の chat ファイル破損 fix (Atlassian MCP の dogfood で踏んだバグ)
  2. default port を frontend=3321 / ai-engine=3322 に変更 (3000/4000/4001/5050 衝突回避)
  3. next-env.d.ts と docs/superpowers/ を gitignore + untrack (CodeRabbit 指摘 + review noise 削減)

変更内容

`112dd18` fix(storage): YAML flow→block 強制

空配列 `messages: []` を初回書き込みすると yaml lib は flow style `[]` で出力する。次回書き込みで既存 seq の flow=true が残ったまま新しい map (複数行 string 含む) を追加すると、フロー集約の中にブロック scalar が混在して再パース不能な YAML が生成されていた (Atlassian MCP の複数行応答で顕在化)。

  • `forceBlockStyle` ヘルパで Map/Seq の flow フラグを再帰オフ
  • `listChats` を 1 ファイル単位 try/catch にして 1 件破損で全リスト 500 にならないように
  • regression test 追加

`ee1694e` chore: default port frontend=3321 / ai-engine=3322

3000 (Next.js デフォルト) は claude.ai のローカル OAuth callback / 他の React dev と衝突。4000/4001/5050 も別プロジェクトと衝突実例あり。

  • frontend: `package.json` の dev/start に `-p 3321` 固定
  • ai-engine: `loadConfig` の default を 3322 に変更
  • README / .env.example / docs / examples / playwright を一斉更新

`19f32ca` chore: 自動生成ファイル / 中間 planning doc を gitignore

  • `packages/frontend/next-env.d.ts`: Next.js 自動生成、dev/build で内容変動。.gitignore + untrack。
  • `docs/superpowers/`: 中間 planning doc。実装と不整合化しやすいので作業メモとしてローカルに残す。

テスト

```
pnpm typecheck # 4/4 PASS
pnpm test # core 86 / storage 89 / ai-engine 199 / frontend 256 PASS
```

PR-A (純 MCP 統合) と並列に merge 可能。base は main。

空配列 (`messages: []`) を初回書き込みすると yaml lib は flow style `[]` で
出力する。次回書き込み時に既存 seq の flow=true が残ったまま新しい map を
追加すると、フロー集約の中に複数行 string の block scalar が混在して
再パース不能な YAML が生成されていた (Atlassian MCP 連携で複数行応答が
来始めて顕在化)。

- packages/storage/src/yaml.ts: forceBlockStyle ヘルパで Map/Seq の flow
  フラグを再帰的にオフ。mergeSeqById と doc.set の両経路で適用。
- packages/storage/src/chat-store.ts: listChats を 1 ファイルずつ try/catch
  にし、破損 1 件で全 chat 一覧が 500 で死ぬのを回避 (warn は残す)。
- yaml.test.ts: 空 seq → 複数行 string 追加が再パース可能であることを
  regression として固定。
3000 (Next.js デフォルト) は claude.ai のローカル OAuth callback / 他の
React dev と衝突する。4000/4001/5050 も別プロジェクトと衝突実例あり。
3321/3322 はセットで覚えやすく現状空き。

- frontend: package.json の dev/start に \`-p 3321\` 固定、ws.ts と
  playwright.config / README / docs を 3321 に統一
- ai-engine: loadConfig の default を 3322 に変更、config.test.ts 追従
- README / .env.example / docs / examples の URL を一斉更新
- packages/frontend/next-env.d.ts: Next.js が dev/build 時に自動生成する
  ファイル。内容が環境ごとに変動 (dev は \`./.next/dev/types/...\` 参照、
  build は \`./.next/types/...\` 参照) するため tracking してても spurious
  diff を生むだけ。.gitignore に追加して untrack。
- docs/superpowers/: 中間 planning doc。実装と不整合化しやすく review
  noise になるため untrack。これらは作業メモとしてローカルに残るが、
  リポジトリには持ち込まない。
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

Warning

Rate limit exceeded

@shomatan has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 52 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1582eab6-7359-4746-8fde-1d281f8daf64

📥 Commits

Reviewing files that changed from the base of the PR and between 7ab4a01 and 466d88d.

📒 Files selected for processing (15)
  • .env.example
  • .gitignore
  • README.md
  • docs/03-architecture.md
  • docs/04-roadmap.md
  • examples/sample-project/README.md
  • packages/ai-engine/src/config.test.ts
  • packages/ai-engine/src/config.ts
  • packages/frontend/README.md
  • packages/frontend/package.json
  • packages/frontend/playwright.config.ts
  • packages/frontend/src/lib/ws.ts
  • packages/storage/src/chat-store.ts
  • packages/storage/src/yaml.test.ts
  • packages/storage/src/yaml.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/storage-port-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 7 minutes and 52 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

EACCES / EMFILE 等の IO 例外まで warn + null に吸収していたため、
FS 障害が発生しても気付けない問題を修正。YamlValidationError
以外は再スローして 500 に倒す。

codex セカンドオピニオン (PR #20) Major 1 指摘対応。
\`-p 3321\` ハードコードで Docker / Render 等のホスト環境で
固定ポートバインドになっていた。\`\${PORT:-3321}\` で env から
上書き可能にしつつデフォルトは維持。

codex セカンドオピニオン (PR #20) Major 2 指摘対応。
clean clone 直後に next dev/build を経ずに pnpm typecheck を
走らせると TS6053 で失敗する (tsconfig include で参照される
next-env.d.ts が存在しないため)。

Next.js 公式は next-env.d.ts を track することを推奨。内容変動
による spurious diff は commit しない運用で吸収する。

codex セカンドオピニオン (PR #20) Major 3 指摘対応。
@shomatan shomatan self-assigned this Apr 29, 2026
@shomatan
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@shomatan
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@shomatan shomatan merged commit cda2218 into main Apr 29, 2026
2 checks passed
@shomatan shomatan deleted the chore/storage-port-fixes branch April 29, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant