Skip to content

feat(console): migrate console to Cloudscape Design System - #11

Merged
susumutomita merged 5 commits into
mainfrom
claude/resolve-open-issues-2y6bqy
Jul 17, 2026
Merged

feat(console): migrate console to Cloudscape Design System#11
susumutomita merged 5 commits into
mainfrom
claude/resolve-open-issues-2y6bqy

Conversation

@susumutomita

@susumutomita susumutomita commented Jul 16, 2026

Copy link
Copy Markdown
Owner

feat(console): migrate console to Cloudscape Design System

Closes #9
Fixes #12

設計正本: docs/design/2026-07-15-console-cloudscape.md(選択肢 B: 全面移行 + view テストの client-side 化)。

このPR merge 後に何が動くようになるか

統合コンソール(apps/console)が Cloudscape Design System で描画され、TenkaCloud 本体の participant-portal 等と視覚的に一貫した状態(loading / error / ready・resource graph・operation form・event timeline・diagnostics)で操作できる。

なぜ今これが要るか

console は手書き CSS 857 行の bespoke UI で、本体の Cloudscape ベース SPA と並べるとデザイントークン・状態表現が揃わず、simulator 問題が make local から既定 OFF にゲートされている品質観点の 1 つだった。behavior(model / client / loader / launch-token)は成熟しているため、表示層だけを差し替えるのが最小リスクで品質バーを満たす。

変更前 → 変更後のフロー

flowchart LR
    subgraph Before
        A1[view.tsx bespoke JSX] --> A2[styles.css 857 行]
        A3[view テスト] --> A4[renderToStaticMarkup 文字列 assertion]
    end
    subgraph After
        B1[view.tsx Cloudscape 722 行] --> B2[styles.css 17 行 + global-styles/dark mode]
        B3[view.test.tsx 10 ケース] --> B4["@testing-library/react client render (happy-dom preload)"]
        B5[behavior テスト] --> B6[実 HTTP Bun.serve + 実 SQLite — 無変更]
    end
Loading

物理影響

ビルド成果物 (make build)

パッケージ 変更
apps/console view 層の全面差し替え + CSS 削減。bun run build 成功(chunk サイズ警告のみ、Cloudscape 由来で非ブロッキング)。behavior API は不変
その他 workspace 変更なし(root bunfig の [test].preload はネットワーク・ストリームを Bun native へ戻すため、他 workspace の実 HTTP / 実 SQLite テスト経路は不変 — 全 suite パリティ確認済み)

依存パッケージの変更

パッケージ 種別 バージョン 理由
@cloudscape-design/components 追加 (deps) 3.0.1324 view 層の component ライブラリ(公開 7 日未満の 3.0.1329 は CI の Safe Chain minimum package age で遮断されるため、隔離期間を満たす最新版に pin)
@cloudscape-design/global-styles 追加 (deps) 1.0.62 global CSS + dark mode
@testing-library/react 追加 (devDeps) 16.3.2 view テストの client render
@testing-library/dom 追加 (devDeps) 10.4.1 上記の peer
@happy-dom/global-registrator 追加 (devDeps) 20.10.6 preload で DOM 環境を登録

transitive の collection-hooks / theming-runtime / ws も公開 7 日以上のバージョン(1.0.99 / 1.0.118 / 8.21.0)へ再解決済み。いずれも lifecycle script なし(bun install --ignore-scripts + trustedDependencies = [] のまま)。

ファイルごとの変更意図

  • apps/console/src/view.tsx — 設計書の component 対応表どおり Cloudscape で再構築(AppLayout+TopNavigation / ContentLayout / KeyValuePairs / Cards / Table / Form / Alert / StatusIndicator)。未知 status → pending フォールバックを statusIndicatorType として export しテスト可能に
  • apps/console/src/styles.css — 857 → 17 行。残すのは body リセットと AppLayout headerSelector と対になる sticky header のみ
  • apps/console/src/main.tsx — global-styles 読み込みと applyMode(Mode.Dark)(旧 bespoke ダークテーマとの視覚的連続性)
  • apps/console/test/view.test.tsx — 新規。view 系 10 ケースを client render + role / accessible name query で 1:1 移送(spike ケースを先頭に保持)
  • apps/console/test/dom-setup.ts — 新規。happy-dom 登録後に fetch / Request / Response / streams / WebSocket を Bun native へ復元し No Mock の実通信経路を維持
  • apps/console/test/console.test.tsxrenderToStaticMarkup の view assertion のみ削除(view.test.tsx へ移送)。behavior fixture / assertion は無変更
  • apps/console/bunfig.toml[test].preload 追加。coveragePathIgnorePatterns../../tools/** を追加(既存の他 workspace 除外リストと同型。apps/server 経由で workload-runner が console のカバレッジレポートに漏れる既存問題の修正)
  • bunfig.toml(root) — root 実行の bun test にも同じ preload を適用。加えて [install].minimumReleaseAge = 604800 を設定し、CI の Safe Chain(公開 168h 未満の tarball を遮断)と同じ隔離期間を Bun の解決自体に適用(初回 CI がこのゲートで落ちた根本対策)
  • docs/adr/0014-bun-minimum-release-age.md — 新規。minimumReleaseAge 導入の判断記録(設定強化は ADR で残すというリポジトリ規則に従う)
  • tools/workload-runner/test/runner.test.ts — stopped-data-plane probe テストの起動 2 秒レース(Issue 12、本 PR の CI を単発で赤にした flake)を除去。data plane の kill をコンテナ内の固定 sleep 2 から、start() 成功後の docker exec killall へ移し、テスト意図(起動成功 → data plane 停止 → typed failure)だけを検証する
  • apps/console/package.json — 上記依存の追加
  • Plan.md — 「console Cloudscape 統一」エントリ追加(目的 / 制約 / タスク / 検証手順 / 進捗ログ / 振り返り、設計書の未確定 2 項目の判断を記録)
  • bun.lock — 依存追加 + 隔離期間を満たすバージョンへの再解決

Regression 分析

# 壊れうる既存挙動 影響範囲 確認状態 確認方法 / 対処
1 behavior テストの実通信経路(No Mock) 全 workspace の実 HTTP / SQLite テスト ✅ 確認済み dom-setup が Bun native の fetch/streams/WebSocket を復元。全 suite 実行で失敗集合がベースラインと同一(下記 5)
2 launch token 秘匿(tc_sim_v1 を DOM に出さない) console エラー表示 ✅ 確認済み view.test.tsx が実 ConsoleLaunchTokenErrorinnerHTML に token が無いことを pin
3 useActionState の pending / idempotency key 既定値 operation form ✅ 確認済み release-gate 付き実 operation で Executing… + disabled + console-<uuid> regex を pin
4 a11y シグナル(aria-busy / role=alert) loading / error 表示 ✅ 確認済み Cloudscape Alert 自体に live-region role が無いため明示 wrapper を追加しテストで pin
5 既存テストスイート全体 全 workspace ✅ 確認済み bun test の失敗は 16 件(Docker workload-runner 15 + Docker 依存 catalog 1)で、変更を stash した baseline と同一集合であることを実測比較(このサンドボックスに Docker daemon が無いため。CI runner は Docker あり)
6 カバレッジ 100% ゲート apps/console ✅ 確認済み bun run test:coverage = Funcs/Lines 100%(view.tsx / dom-setup.ts 含む)
7 依存更新フロー(Dependabot 等) 全 workspace の install ✅ 確認済み minimumReleaseAge により公開 7 日未満のバージョンは bun install が失敗する(CI の Safe Chain と同じ判定が手元で先に出るだけで、従来も CI では遮断されていた)。トレードオフは ADR-0014 に記録
8 stopped-data-plane probe テストの検証意図 tools/workload-runner ✅ 確認済み(CI 実行で最終確認) kill を start() 成功後の docker exec へ移しただけで、検証内容(container 生存 + data plane 死亡 → probe が WorkloadFailed)は不変。Docker はこのサンドボックスに無いため CI が最終検証

Rollback 手順

  1. git revert <merge-sha> → 新 PR で main に戻す
  2. bun install で lockfile を戻す(依存はビルド成果物にのみ影響、データ・サイドエフェクトなし)
  3. 既に発生したデータ / サイドエフェクトの fate: なし(表示層のみの変更)

テスト戦略

  • 既存テストでカバーされる観点 — client / loader / model / launch-token の behavior(実 HTTP + 実 SQLite、無変更)。runConsoleOperationAction の成功 / 失敗分岐
  • このPRで追加したテスト — view.test.tsx(10 ケース): Cloudscape client render spike / loading aria-busy / error role=alert + retry / token 秘匿 / 実 world の projection・output・event 表示 / empty 状態 / MissingProvider 診断 / status フォールバック / pending→success の form フロー / ConsoleOperationResult 3 状態
  • 未カバー (受容する理由) — Docker 依存の workload-runner / catalog テストはこのサンドボックスで実行不能(CI で実行される。runner.test.ts のレース除去も CI が最終検証)

Verification

Merge 前 (DRAFT 解除条件)

  • make test 相当 — console 19/19 pass、全 suite の失敗集合はベースラインと同一(Docker 16 件のみ)
  • make typecheck — 全 workspace 緑
  • make lint — biome info のみ(pre-existing)、staged harness 0 findings
  • make format_check — 緑
  • make build — 緑(chunk サイズ警告のみ)
  • Regression 分析の未確認がゼロ
  • merge で動くようになる機能を 1 文で書けている

Merge 後 (deploy / 反映後 signal)

  • CI(Docker あり)で全 suite 緑を確認
  • nr dev で console を起動し、dark mode の Cloudscape shell / resource graph / operation form を目視確認

公開品質チェック

  • UI 変更: accessibility(aria-busy / role=alert / role=status / accessible label)・loading / error / empty state をテストで確認した
  • 該当なしの場合、理由を下に記載した

該当なしの理由: 公開ページ / API / Auth / Infra の変更なし(表示層と test 基盤のみ)。check:pre-release は UI 目視項目を含むため Merge 後 Verification に回した。

Known follow-ups

  • なし(.claude/state/follow-ups.jsonl は空。CI を塞いでいた Issue 12 の flaky test は、リポジトリ規則「CI が詰まる原因になっている場合のみ同 PR で許可」に従い本 PR で修正)

🤖 Generated with Claude Code

https://claude.ai/code/session_01DTv61FrTiLRFbsgrMeBT3U

claude added 2 commits July 16, 2026 07:30
Rebuild apps/console's view layer on Cloudscape (AppLayout +
TopNavigation shell, ContentLayout hero, KeyValuePairs metrics,
Container + Cards resource graph, Table timelines/diagnostics,
Form + FormField operation form, Alert / StatusIndicator states)
per docs/design/2026-07-15-console-cloudscape.md option B, so the
console visually matches the TenkaCloud Cloudscape SPAs. bespoke
styles.css shrinks 857 -> 17 lines. View tests move from
renderToStaticMarkup string assertions to @testing-library/react
client rendering on happy-dom, registered via bunfig [test].preload
with Bun-native fetch/streams/WebSocket restored so behavior tests
keep real HTTP + real SQLite. Behavior invariants stay pinned:
aria-busy loading, role=alert errors, launch-token secrecy,
useActionState pending, unknown status -> pending fallback,
MissingProvider diagnostics.

Implements #9

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DTv61FrTiLRFbsgrMeBT3U
Companion to the previous commit (stash pop left these unstaged):
the Cloudscape rebuild of view.tsx, the styles.css reduction to the
console-specific minimum, global-styles + dark mode in main.tsx,
Cloudscape/testing-library dependencies, the bunfig [test].preload
registration (root + app) with the tools/** coverage-scope exclusion,
the renderToStaticMarkup assertion removal from console.test.tsx,
and the Plan.md entry.

Implements #9

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DTv61FrTiLRFbsgrMeBT3U
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@susumutomita, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bdd6bda9-a70c-46dd-b791-564ff9c15dfb

📥 Commits

Reviewing files that changed from the base of the PR and between 6e60415 and d8a128d.

📒 Files selected for processing (4)
  • apps/console/src/main.tsx
  • apps/console/src/view.tsx
  • apps/console/test/view.test.tsx
  • tools/workload-runner/test/runner.test.ts
📝 Walkthrough

Walkthrough

The console presentation layer was migrated to Cloudscape components, with dark-mode initialization and minimal CSS. A Bun DOM preload and comprehensive view tests were added, while obsolete markup assertions were removed. Bun dependency resolution now enforces a seven-day minimum release age documented by ADR.

Changes

Console Cloudscape migration

Layer / File(s) Summary
Cloudscape foundation and startup
apps/console/package.json, package.json, apps/console/src/main.tsx, apps/console/src/styles.css
Cloudscape dependencies and supporting runtime packages were added, dark mode is initialized, and the former custom stylesheet was reduced to body and sticky-header rules.
Cloudscape view implementation
apps/console/src/view.tsx, Plan.md
Console states, resource cards, event and diagnostic tables, outputs, operation forms, and application layout now use Cloudscape components while preserving existing data and action flows.
DOM setup and view validation
apps/console/test/dom-setup.ts, apps/console/bunfig.toml, apps/console/test/view.test.tsx, apps/console/test/console.test.tsx
The Bun preload configures happy-dom and Bun-native APIs, new integration-style view tests cover console states and operations, and obsolete static-markup assertions were removed.

Bun release-age policy

Layer / File(s) Summary
Dependency release-age policy
bunfig.toml, docs/adr/0014-bun-minimum-release-age.md
Bun dependency resolution now applies a 604800-second minimum release age, with the behavior and exception policy documented in ADR 0014.

Estimated code review effort: 4 (Complex) | ~45 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Core Cloudscape migration is present, but the required design document under docs/design is not shown in the reviewed changes. Add the design document under docs/design and ensure it covers alternatives, rationale, and edge cases before merge.
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The added test harness, ADR, and dependency changes support the console migration; no clearly unrelated changes stand out.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: migrating the console UI to Cloudscape Design System.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/resolve-open-issues-2y6bqy

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

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

CI's Safe Chain gate blocks package downloads younger than 168h, but
bun install had no matching constraint, so the lockfile pinned
too-new Cloudscape / ws versions locally and only failed in CI.
Set bunfig [install].minimumReleaseAge = 604800 so Bun resolves the
same 7-day quarantine as .npmrc and Safe Chain, pin
@cloudscape-design/components to 3.0.1324, and re-resolve
collection-hooks / theming-runtime / ws to aged versions.
Decision recorded in docs/adr/0014-bun-minimum-release-age.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DTv61FrTiLRFbsgrMeBT3U
@susumutomita
susumutomita marked this pull request as ready for review July 17, 2026 02:17
The stopped-data-plane probe test self-killed httpd 2 seconds after
container start, so runner.start()'s health wait raced container and
proxy spin-up on busy CI runners and failed with "workload proxy did
not become reachable" before the probe assertion ran. Keep the data
plane alive through startup and issue the killall via docker exec
only after start() succeeds, which pins the intended behavior
(healthy start -> data plane dies -> probe yields typed failure)
without the timing dependency.

Fixes #12

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DTv61FrTiLRFbsgrMeBT3U

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/console/src/main.tsx`:
- Line 10: Update the startup call to applyMode in main.tsx so it derives the
initial mode from the user’s system preference or the persisted theme selector
instead of always using Mode.Dark. Preserve light-mode selection and fall back
to the existing default only when no preference is available.

In `@apps/console/src/view.tsx`:
- Line 691: Update the TopNavigation utilities configuration in view.tsx to
render SIMULATOR_PROTOCOL_VERSION as plain text rather than a button. Remove the
hardcoded “Protocol 2026-07-11” button entry and use the existing protocol
version symbol as the displayed metadata.

In `@apps/console/test/view.test.tsx`:
- Line 184: Update the describe suite titles in “Cloudscape client rendering
spike” and the additionally referenced suite to Japanese BDD descriptions that
clearly express the tested behavior, while leaving the test implementation
unchanged.

In `@bunfig.toml`:
- Around line 30-36: Remove the console-specific preload from the root
bunfig.toml test configuration so root bun test runs do not load
apps/console/test/dom-setup.ts for every workspace. Add a console-only test
entrypoint or configuration that applies the dom-setup preload when running
console tests, while leaving apps/console/test/dom-setup.ts behavior unchanged
unless required to support that scoped configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cbcb159a-5141-4414-af61-b0b359a83a41

📥 Commits

Reviewing files that changed from the base of the PR and between 3187ada and 6e60415.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • Plan.md
  • apps/console/bunfig.toml
  • apps/console/package.json
  • apps/console/src/main.tsx
  • apps/console/src/styles.css
  • apps/console/src/view.tsx
  • apps/console/test/console.test.tsx
  • apps/console/test/dom-setup.ts
  • apps/console/test/view.test.tsx
  • bunfig.toml
  • docs/adr/0014-bun-minimum-release-age.md
  • package.json

Comment thread apps/console/src/main.tsx Outdated
Comment thread apps/console/src/view.tsx Outdated
Comment thread apps/console/test/view.test.tsx Outdated
Comment thread bunfig.toml
Comment on lines 30 to +36
[test]
# console の view テスト (Cloudscape + @testing-library/react) が使う DOM 環境。
# react-dom は load 時に DOM の有無で event system の経路を固定する CommonJS
# のため、preload で全 module より先に happy-dom を登録する必要がある。
# setup はネットワーク・ストリーム実装を Bun native へ戻すので、実 HTTP と
# 実 SQLite を使う他 workspace の behavior テストの経路は変わらない。
preload = ["./apps/console/test/dom-setup.ts"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n -C3 '^\[test\]|preload\s*=|GlobalRegistrator|bunNative' \
  bunfig.toml apps/console/bunfig.toml apps/console/test/dom-setup.ts

Repository: susumutomita/TenkaCloudSimulator

Length of output: 5178


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- root bunfig.toml ---'
sed -n '1,120p' bunfig.toml

echo
echo '--- apps/console/bunfig.toml ---'
sed -n '1,120p' apps/console/bunfig.toml

echo
echo '--- package / task files mentioning bun test ---'
rg -n --glob 'package.json' --glob 'bunfig.toml' --glob '*.toml' --glob '*.json' '"bun test"|bun test|preload|coverageThreshold|coverageSkipTestFiles' .

echo
echo '--- files at repo root ---'
git ls-files | sed -n '1,120p'

Repository: susumutomita/TenkaCloudSimulator

Length of output: 9462


🌐 Web query:

Bun bunfig.toml test config lookup merge nearest bunfig inheritance preload workspace

💡 Result:

Bun uses bunfig.toml to manage runtime, test, and install configurations [1][2]. The lookup, inheritance, and merging behaviors are detailed below: Lookup and Ancestor Discovery Bun performs an ancestor-directory search to find bunfig.toml [3][4][5]. When running commands like bun test, install, or build, Bun walks up the directory tree from the current working directory to locate the nearest bunfig.toml [3][5]. This ensures that configurations defined in a monorepo root are respected even when executing commands from within subdirectories [3][6]. Relative paths defined inside a bunfig.toml (such as preload scripts, test.root, or coverage output directories) are resolved relative to the directory containing that bunfig.toml file, not the current working directory [3][4]. Global vs. Local Inheritance and Merging Bun supports a hierarchy of configuration files that are merged shallowly, where local files override global or system-wide settings [1][7][8]. The order of precedence, from lowest to highest, is [7]: 1. System config: Loaded from a path specified by the BUN_SYSTEM_CONFIG environment variable, or default locations like /etc/bunfig.toml [7]. 2. Global/User config: Located in home directories (e.g., ~/.bunfig.toml) or XDG-compliant paths such as $XDG_CONFIG_HOME/bun/bunfig.toml (with $HOME/.config/bun/bunfig.toml as the default) [7][9][8]. 3. Local/Project config: The bunfig.toml located in the project root or discovered via ancestor walk [1][7]. Note: For bun run, auto-discovery of global configuration files is generally disabled; only the project-local bunfig.toml is loaded [1][8]. Test Configuration and Preload - Test Settings: You can configure test behavior (e.g., root, preload, pathIgnorePatterns, coverage) under the [test] section in bunfig.toml [2][10]. - Preload Merging: When multiple configuration files are loaded, preload scripts are merged rather than replaced, ensuring that multiple levels of configuration can contribute to the final set of preloaded scripts [3]. - CLI Overrides: Command-line arguments always take precedence and override corresponding settings in bunfig.toml [1][2]. For example, using --coverage or --path-ignore-patterns on the CLI will ignore the values defined in your configuration file [2]. Top Results: [1][3][7][9][2][5]

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
for path in [Path('package.json'), Path('apps/console/package.json'), Path('bunfig.toml'), Path('apps/console/bunfig.toml')]:
    if path.exists():
        print(f'--- {path} ---')
        text = path.read_text()
        for i, line in enumerate(text.splitlines(), 1):
            if 'test' in line or 'preload' in line or 'bun test' in line or 'workspaces' in line:
                print(f'{i}: {line}')
        print()
PY

Repository: susumutomita/TenkaCloudSimulator

Length of output: 901


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- root package.json test scripts ---'
python3 - <<'PY'
import json
from pathlib import Path
p = Path('package.json')
data = json.loads(p.read_text())
for k in ['scripts', 'workspaces']:
    if k in data:
        print(f'[{k}]')
        if isinstance(data[k], dict):
            for kk, vv in data[k].items():
                if 'test' in kk or 'bun' in str(vv):
                    print(f'{kk}: {vv}')
        else:
            print(data[k])
        print()
PY

echo '--- ci workflow snippets with bun test / workspace test entrypoints ---'
rg -n -C2 'bun test|npm test|pnpm test|make test|test:coverage|workspaces|apps/console|apps/api|apps/server|providers/|conformance/|contracts/' .github/workflows Makefile package.json

echo
echo '--- root test-related files ---'
fd -a 'bunfig.toml|package.json|Makefile|README.md' .

Repository: susumutomita/TenkaCloudSimulator

Length of output: 3963


Keep this preload out of the root test config. bun test from the repo root uses bunfig.toml, so apps/console/test/dom-setup.ts is applied to every workspace test run here. Move the console DOM setup behind a console-only test entrypoint/config.

📍 Affects 2 files
  • bunfig.toml#L30-L36 (this comment)
  • apps/console/test/dom-setup.ts#L27-L75
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bunfig.toml` around lines 30 - 36, Remove the console-specific preload from
the root bunfig.toml test configuration so root bun test runs do not load
apps/console/test/dom-setup.ts for every workspace. Add a console-only test
entrypoint or configuration that applies the dom-setup preload when running
console tests, while leaving apps/console/test/dom-setup.ts behavior unchanged
unless required to support that scoped configuration.

Source: Coding guidelines

Follow the OS color scheme at startup (dark fallback keeps the old
bespoke look), render the protocol version as plain text sourced from
SIMULATOR_PROTOCOL_VERSION instead of a dead TopNavigation button, and
retitle the two English describe suites to Japanese BDD behavior
descriptions per the test-authoring rule.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DTv61FrTiLRFbsgrMeBT3U

Copy link
Copy Markdown
Owner Author

CodeRabbit の指摘 4 件の対応状況(d8a128d):

  1. main.tsx の dark 固定 — 修正。prefers-color-scheme に追従し、判定できない環境のみ dark へフォールバック(旧 bespoke テーマとの連続性)。
  2. TopNavigation の "Protocol 2026-07-11" ボタン — 修正。アクションのないボタンをやめ、SIMULATOR_PROTOCOL_VERSION 由来のプレーンテキスト表示にした(ハードコード日付も解消)。
  3. describe タイトルの英語残り — 修正。2 スイートを日本語の振る舞い記述へ変更。
  4. root bunfig の preload を console 専用へスコープ — 本 PR では見送り、フォローアップ F-75KPH0 として記録。理由: root からの bun test は root カバレッジゲートのために console テストを含む必要があり、スコープ分離はカバレッジ実行経路の再構成(シャーディング相当)を伴う heavy lift。安全性は実測済み — dom-setup が Bun native の fetch / streams / WebSocket を復元するため、全 workspace の失敗集合はベースラインと同一(CI では preload 有効のまま Docker 系 15 件を含め green)。将来の DOM 分岐ライブラリ対策として別 PR で対応する。

Generated by Claude Code

@susumutomita
susumutomita merged commit 0d53d7e into main Jul 17, 2026
4 checks passed
@susumutomita
susumutomita deleted the claude/resolve-open-issues-2y6bqy branch July 17, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants