Component Dependencies — continuum
Project: continuum
Phase: INCEPTION — Application Design
Date: 2026-05-08
Depth: Comprehensive
Note: 本ドキュメントは コンポーネント間の依存関係マトリクス + 通信パターン + データフロー図 を体系的に定義する。
1. Dependency Matrix
行: 依存元(caller)/ 列: 依存先(callee)。✓ S = Synchronous(REST or Direct Invoke)、✓ A = Async(EventBridge)、✓ W = WebSocket、✓ R = Read-only Storage Access。
| ↓ from / to → |
C-FE-01 |
C-FE-02 |
C-FE-03 |
C-FE-04 |
C-FE-05 |
C-FE-06 |
C-FE-07 |
C-FE-08 |
C-BE-01 |
C-BE-02 |
C-BE-03 |
C-BE-04 |
C-BE-05 |
C-BE-06 |
C-BE-07 |
C-BE-08 |
C-BE-09 |
C-BE-10 |
| C-FE-01 WebApp |
— |
✓ |
✓ |
✓ |
✓ |
✓ |
✓ |
✓ |
|
|
|
|
|
|
|
|
|
|
| C-FE-02 AuthUI |
|
— |
|
|
|
|
|
|
✓ S |
|
|
|
|
|
|
|
|
|
| C-FE-03 InboxView |
|
✓ |
— |
|
|
✓ R |
|
✓ W |
|
✓ S |
✓ S |
|
|
✓ S |
|
|
|
|
| C-FE-04 OutboundReviewView |
|
✓ |
|
— |
|
✓ R |
|
|
|
|
|
✓ S |
|
✓ S |
|
|
|
|
| C-FE-05 DashboardView |
|
✓ |
|
|
— |
|
|
✓ W |
|
|
|
|
|
|
|
✓ S |
|
|
| C-FE-06 MaturitySettingsView |
|
✓ |
|
|
|
— |
|
|
|
|
|
|
|
✓ S |
|
|
|
|
| C-FE-07 DemoSetPieceView |
|
|
|
|
|
|
— |
✓ W |
|
|
|
|
|
|
|
|
|
|
| C-FE-08 WebSocketClient |
|
|
|
|
|
|
|
— |
|
|
|
|
|
|
|
|
✓ S |
|
| C-BE-01 AuthHandler |
|
|
|
|
|
|
|
|
— |
|
|
|
|
✓ S |
|
|
|
|
| C-BE-02 ContactHandler |
|
|
|
|
|
|
|
|
|
— |
|
|
|
|
|
|
|
✓ S |
| C-BE-03 InboundResponseEngine |
|
|
|
|
|
|
|
|
|
✓ S |
— |
|
|
✓ S |
|
✓ A |
✓ S |
|
| C-BE-04 OutboundOrchestrator |
|
|
|
|
|
|
|
|
|
✓ S |
|
— |
✓ S |
✓ S |
✓ S |
✓ A |
✓ S |
|
| C-BE-05 SignalExtractor |
|
|
|
|
|
|
|
|
|
✓ S |
|
|
— |
|
|
|
|
|
| C-BE-06 MaturityPhaseManager |
|
|
|
|
|
|
|
|
|
|
|
|
|
— |
|
✓ A |
|
|
| C-BE-07 MACPCoordinator |
|
|
|
|
|
|
|
|
|
✓ S |
|
|
|
✓ S |
— |
✓ A |
✓ S |
|
| C-BE-08 DashboardEngine |
|
|
|
|
|
|
|
|
|
|
|
|
|
✓ R |
|
— |
✓ S |
|
| C-BE-09 WebSocketBroker |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
— |
|
| C-BE-10 MockSocialFeedSeeder |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
— |
Note (SignalExtractor): C-BE-05 SignalExtractor → C-BE-02 ContactHandler の関係を ✓ S に修正(旧 ✓ R)。SignalExtractor はコンタクトメタデータの 読み取り(ingestFeed 時)+ Availability Window の 書き込み(persistWindows)の両方を行うため、Read-only ではない。components.md L292 / component-methods.md SignalExtractor.persistWindows() と整合(2026-05-08T06:15:24Z 修正)。
主要パターンの説明
- Frontend → Frontend: WebApp Shell が他の View をレンダリング
- Frontend → Backend: HTTP REST(API Gateway)で同期呼び出し
- Frontend ↔ WebSocketClient: WebSocket 経由の双方向通信、サーバー側 WebSocketBroker と接続
- Backend → Backend (Sync): Lambda Direct Invoke または API Gateway 内部呼び出し
- Backend → Backend (Async): EventBridge へのイベント発行
- Backend → Storage (R): DynamoDB / AgentCore Memory への読み取り
2. Communication Patterns
2.1 Frontend ↔ Backend
Pattern: Synchronous REST
- すべての操作系(CRUD, 応答生成, フェーズ切替, ダッシュボード照会)
- API Gateway REST API + JWT (Cognito Authorizer)
- レイテンシ目標: < 1秒(応答生成は < 5秒)
Pattern: WebSocket
- MACP デモのリアルタイム可視化(DemoSetPieceView)
- Maturity Recommendation バナー のプッシュ通知
- MACP 完了通知 + バッジ獲得通知
- API Gateway WebSocket API + Cognito 認証
2.2 Backend Inter-Component
Pattern: Direct Lambda Invocation
- 同一トランザクション内の同期呼び出し
- 例: InboundResponseEngine → ContactHandler(プロファイル取得)
- 注意: Lambda Cold Start のリスク → 必要時のみ使用
Pattern: Internal HTTP via API Gateway
- 別 Lambda 関数間の同期呼び出し(疎結合)
- 例: InboundResponseEngine → MaturityPhaseManager(フェーズ判定)
- メリット: API スキーマ統一、認証一元化
Pattern: EventBridge
- 非同期・スケジューリング用途
- イベント例:
inbound.response.sent (S-3 → S-6)
outbound.scheduled.send (S-4 → 自身, EventBridge Scheduler)
macp.theater.send (S-5 → 自身)
macp.outcome.confirmed (S-5 → S-6 + S-3)
maturity.daily.check (EventBridge Scheduler → S-1)
maturity.phase.changed (S-1 → S-6)
2.3 Backend ↔ External AWS Services
| 利用先 |
利用元コンポーネント |
通信パターン |
| Cognito User Pool |
AuthHandler, AuthUI |
Cognito SDK |
| DynamoDB Single-Table |
全 Backend コンポーネント |
DynamoDB SDK |
| Bedrock |
InboundResponseEngine, OutboundOrchestrator, SignalExtractor, MACPCoordinator |
Bedrock Runtime API |
| AgentCore Runtime |
InboundResponseEngine, OutboundOrchestrator, MACPCoordinator |
AgentCore SDK |
| AgentCore Memory |
InboundResponseEngine, OutboundOrchestrator, MACPCoordinator |
AgentCore Memory API |
| AgentCore Identity |
MACPCoordinator |
AgentCore Identity API(テナント間 Lookup) |
| AgentCore Gateway |
MACPCoordinator |
AgentCore Gateway(cross-tenant HTTPS + mTLS) |
| EventBridge |
全 Backend コンポーネント |
PutEvents API |
| Secrets Manager |
全 Backend コンポーネント |
Secrets Manager SDK |
3. Data Flow Diagrams
3.1 Flow A: Inbound 応答生成(Lv1 慎重期)
┌────────────┐ ┌─────────────────┐ ┌──────────────────────────┐
│ InboxView │ │ API Gateway │ │ InboundResponseEngine │
│ (FE) │ │ REST │ │ (BE Lambda) │
└──────┬─────┘ └────────┬────────┘ └────────────┬─────────────┘
│ │ │
│ POST /inbound/{id}/ │ │
│ generate │ │
├────────────────────>│ │
│ ├───────────────────────────>│
│ │ │
│ │ ┌─────────────┴────────────┐
│ │ │ 1. JWT verify │
│ │ │ 2. fetch Contact │
│ │ │ 3. fetch Past Interact'ns │
│ │ │ 4. Bedrock 3-variation │
│ │ │ 5. Relational Calibration │
│ │ │ 6. Plausibility check │
│ │ └─────────────┬────────────┘
│ │ │
│ │ 3 variations response │
│ │<───────────────────────────┤
│ 3 variations │ │
│<────────────────────┤ │
│ │ │
│ user selects + sends│ │
│ POST /inbound/{id}/ │ │
│ send │ │
├────────────────────>├───────────────────────────>│
│ │ ┌─────────────┴────────────┐
│ │ │ 1. mark responded │
│ │ │ 2. persist to Memory │
│ │ │ 3. publish event: │
│ │ │ inbound.response.sent │
│ │ └─────────────┬────────────┘
│ │ │
│ │ │ EventBridge
│ │ │ ─────────────>
│ │ │ to: AnalyticsService
│ │ │ MaturityPhaseManager
3.2 Flow B: Outbound Strategic Outreach + MACP
┌─────────────────────┐
│ EventBridge Daily │
│ Scheduler (3am JST) │
└──────────┬──────────┘
│ trigger
v
┌──────────────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ OutboundOrchestrator │─────>│ SignalExtractor │─────>│ DynamoDB │
│ scheduleStrategicOutreach│ │ extract Windows │ │ (read MockFeed) │
└──────────┬───────────────┘ └──────────────────┘ └──────────────────┘
│
│ Optimal Windows
v
┌──────────────────────────┐ ┌──────────────────┐
│ generate invitation text │─────>│ Bedrock │
│ + Plausibility Eng │ │ (LLM call) │
└──────────┬───────────────┘ └──────────────────┘
│
│ candidate
v
┌──────────────────────────┐
│ MACPCoordinator │
│ attemptMACP(candidate) │
└──────────┬───────────────┘
│
┌───────┴────────┐
│ │
v v
[non-Continuum] [Continuum user]
│ │
│ v
│ ┌──────────────────────────────┐
│ │ Peer Discovery (AgentCore │
│ │ Identity) │
│ └──────────┬───────────────────┘
│ │
│ v
│ ┌──────────────────────────────┐ ┌─────────────────────┐
│ │ Inter-Agent Negotiation │─────>│ AgentCore Gateway │
│ │ (cross-tenant via Gateway) │<─────│ (Cross-tenant mTLS) │
│ └──────────┬───────────────────┘ └─────────────────────┘
│ │
│ ┌────────────┴─────────────┐
│ │ │
│ v v
│ [agreement met] [no agreement]
│ │ │
│ v │
│ ┌────────────────────────┐ │
│ │ Schedule Theatrical │ │
│ │ Messages (EventBridge) │ │
│ └────────────┬───────────┘ │
│ │ │
│ v │
│ ┌────────────────────────┐ │
│ │ AgentCore Memory │ │
│ │ (persist agreement) │ │
│ └────────────────────────┘ │
│ │
v v
[Outbound Pending Queue] [Outbound Pending Queue]
│ │
v v
[user reviews / Lv2-5 auto-sends → DynamoDB updates → AnalyticsService event]
┌──────────────────┐
│ EventBridge: │
│ macp.theater.send│
│ (T+0, T+3h, T+1d,│
│ T+2d, T+3d) │
└────────┬─────────┘
│ scheduled trigger
v
┌──────────────────────────┐
│ MACPCoordinator │
│ executeTheaterStep │
└────────┬─────────────────┘
│
v
┌──────────────────────────┐ ┌──────────────────────────┐
│ Push to A's Inbox │ │ Push to B's Inbox │
│ (DynamoDB write) │ │ (DynamoDB write) │
└────────┬─────────────────┘ └────────┬─────────────────┘
│ │
v v
┌──────────────────────────┐ ┌──────────────────────────┐
│ Publish event: │ │ Publish event: │
│ macp.message.delivered │ │ macp.message.delivered │
└────────┬─────────────────┘ └────────┬─────────────────┘
│ │
v v
┌──────────────────────────────────────────────────────────────┐
│ WebSocketBroker.broadcastDemo(event) │
└────────┬─────────────────────────────────────────────────────┘
│
v
┌──────────────────────────────────────────────────────────────┐
│ DemoSetPieceView (Both A and B clients receive realtime) │
│ - Update Split-Screen UI │
│ - Append Negotiation Log │
└──────────────────────────────────────────────────────────────┘
3.4 Flow D: Lv5 Nirvana Auto-Detection
┌──────────────────┐
│ EventBridge │
│ Daily 03:00 JST │
└────────┬─────────┘
│
v
┌──────────────────────────────────┐ ┌──────────────────┐
│ MaturityPhaseManager │─────>│ DynamoDB Query │
│ detectNirvanaCandidates │ │ phase=Lv4 │
└────────┬─────────────────────────┘ │ AND consecDays>=30│
│ │ AND lastOpen<-7d │
│ └──────────────────┘
│ candidate userIds
v
┌──────────────────────────────────┐
│ for each candidate: │
│ promoteToLv5(userId) │
│ - update phase = Lv5 │
│ - stop notifications │
│ - increment lifetimeNirvana │
└──────────────────────────────────┘
[ユーザーがアプリを起動]
│
v
┌──────────────────────────────────┐
│ Any API call (e.g., GET /me) │
│ MaturityPhaseManager.handleAppOpen│
└────────┬─────────────────────────┘
│
v
┌──────────────────────────────────┐
│ if phase == Lv5: │
│ demote to Lv4 │
│ record lifetime daysInNirvana │
│ award "Transcendence Achieved" │
└──────────────────────────────────┘
4. Critical Path Analysis
4.1 ハッピーパス: Lv1 ユーザーが応答 1 件
| Step |
Component |
Latency Target |
Critical? |
| 1. JWT 検証 |
API Gateway / AuthHandler |
< 50ms |
✓ |
| 2. fetch contact |
ContactHandler / DynamoDB |
< 100ms |
✓ |
| 3. fetch past interactions |
AgentCore Memory |
< 200ms |
✓ |
| 4. Bedrock 3-variation 生成 |
Bedrock |
< 4000ms |
✓ |
| 5. Relational Calibration |
InboundResponseEngine |
< 50ms |
|
| 6. Plausibility check |
InboundResponseEngine |
< 50ms |
|
| Total |
|
< 4500ms(< 5秒目標達成) |
|
4.2 MACP Demo: 6ステップ完了までの時間
| Step |
想定時間 |
| 1. Peer Discovery |
< 200ms |
| 2. Negotiation |
< 2000ms(Bedrock 2回呼び出し) |
| 3-7. Theatrical messages(5往復) |
デモタイムラプス: 30秒程度 |
| 8. Outcome Confirmation |
< 500ms |
| Total demo time |
約 90秒(DS-1 受入基準達成) |
5. Failure Modes & Recovery
| Failure |
影響 |
Recovery |
| Bedrock タイムアウト |
応答生成不可 |
リトライ 1回 → ユーザーにエラー表示、再生成ボタン |
| AgentCore Gateway タイムアウト |
MACP 不成立 |
通常 Outbound へ Graceful Degradation(FR-9.2) |
| DynamoDB スロットリング |
全機能低下 |
DynamoDB Auto Scaling、Lambda リトライ |
| WebSocket 接続切断 |
リアルタイム通知の欠落 |
クライアント側自動再接続 + REST polling fallback |
| Cognito 認証失敗 |
ログイン不可 |
エラー表示、ヘルプリンク提示 |
| EventBridge 配信失敗 |
非同期処理の遅延 |
DLQ(Dead Letter Queue)で 24時間保持 + アラート |
6. Coupling Analysis
6.1 高結合(Tight Coupling)— 意図的
- InboundResponseEngine ↔ AgentCore Memory: 過去履歴の Context Injection のため切り離せない
- MACPCoordinator ↔ AgentCore Gateway/Identity: Federated プロトコルそのもの
- WebSocketBroker ↔ MACPCoordinator: デモ演出のためリアルタイム連携必須
6.2 低結合(Loose Coupling)
- AnalyticsService ↔ 他サービス: イベント駆動でのみ連携、AnalyticsService がダウンしても他は動作可
- MaturityPhaseManager ↔ Inbound/Outbound: Phase 状態の判定だけを提供、双方向依存なし
- Frontend ↔ Backend: REST API 越しで完全分離
6.3 Strangler-friendliness
- 現状の設計は将来的な変更耐性を持つ:
- LLM 切替(Claude → 他モデル): InboundResponseEngine 内部の差し替え
- データストア切替(DynamoDB → 他): 各コンポーネントの Persistence 層差し替え
- MACP プロトコル拡張: MACPCoordinator のみへの局所変更