@launchsecure/launch-kit 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/dist/client/assets/index-C8GAsRGO.css +32 -0
- package/dist/client/assets/index-CcHIoRl6.js +286 -0
- package/dist/client/index.html +22 -0
- package/dist/server/cli.js +8853 -0
- package/dist/server/fb-wizard.js +136 -0
- package/dist/server/graph-mcp-entry.js +1542 -0
- package/dist/server/public/app.js +1312 -0
- package/dist/server/public/icons.js +36 -0
- package/dist/server/public/index.html +159 -0
- package/dist/server/public/plan-detector.js +186 -0
- package/dist/server/public/session-manager.js +1129 -0
- package/dist/server/public/splits.js +569 -0
- package/dist/server/public/style.css +1620 -0
- package/package.json +73 -0
- package/prompts/analysis.md +992 -0
- package/prompts/architect-reconcile.md +931 -0
- package/prompts/architecture-sync.md +902 -0
- package/prompts/be-contract.md +709 -0
- package/prompts/be-impl.md +565 -0
- package/prompts/be-policy.md +551 -0
- package/prompts/be-test.md +591 -0
- package/prompts/bug-diagnosis.md +653 -0
- package/prompts/bug-intake.md +563 -0
- package/prompts/change-request-intake.md +593 -0
- package/prompts/db-contract.md +644 -0
- package/prompts/db-impl.md +522 -0
- package/prompts/db-interaction.md +569 -0
- package/prompts/db-test.md +630 -0
- package/prompts/decision-pack.md +654 -0
- package/prompts/fe-contract.md +992 -0
- package/prompts/fe-flow.md +537 -0
- package/prompts/fe-impl.md +597 -0
- package/prompts/fe-reconcile.md +506 -0
- package/prompts/fe-review.md +550 -0
- package/prompts/fe-test.md +705 -0
- package/prompts/fix-planner.md +1219 -0
- package/prompts/global-db-patterns.md +588 -0
- package/prompts/global-env-config.md +460 -0
- package/prompts/global-integrations.md +504 -0
- package/prompts/global-middleware.md +442 -0
- package/prompts/global-navigation.md +502 -0
- package/prompts/global-security.md +603 -0
- package/prompts/global-services.md +427 -0
- package/prompts/greenfield-classifier.md +590 -0
- package/prompts/llm-council.md +597 -0
- package/prompts/module-sequencer.md +529 -0
- package/prompts/normalize.md +611 -0
- package/prompts/optimization.md +633 -0
- package/prompts/prd-generation.md +544 -0
- package/prompts/prd-reconcile.md +584 -0
- package/prompts/prd-review.md +504 -0
- package/prompts/pre-code-analysis.md +565 -0
- package/prompts/pre-code-global-analysis.md +169 -0
- package/prompts/production-bootstrap.md +577 -0
- package/prompts/research.md +702 -0
- package/prompts/retrofit-analysis.md +845 -0
- package/prompts/spike.md +850 -0
- package/prompts/theming.md +835 -0
- package/prompts/triage.md +599 -0
- package/prompts/unified-reconcile.md +628 -0
- package/prompts/unified-review.md +592 -0
- package/prompts/user-stories.md +486 -0
- package/prompts/wireframe.md +576 -0
|
@@ -0,0 +1,931 @@
|
|
|
1
|
+
# Architect Reconcile Agent
|
|
2
|
+
|
|
3
|
+
> **Greek:** Architektōn (Architéktōn) — "master builder"
|
|
4
|
+
> **Sanskrit:** वास्तुकार (Vāstukāra) — "architect"
|
|
5
|
+
> **Tagline:** *"The blueprint is the promise"*
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Agent Identity
|
|
10
|
+
|
|
11
|
+
| Field | Value |
|
|
12
|
+
|---|---|
|
|
13
|
+
| ID | `architect_reconcile` |
|
|
14
|
+
| Name | Architect Reconcile Agent |
|
|
15
|
+
| Phase | 8 — Reconciliation & Decisions |
|
|
16
|
+
| Type | `pipeline` |
|
|
17
|
+
| Granularity | `global` |
|
|
18
|
+
| Interaction | `autonomous` |
|
|
19
|
+
| Mode | `all` |
|
|
20
|
+
| Domain | `dev` |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Goal & Objectives
|
|
25
|
+
|
|
26
|
+
**Goal:** Merge all per-module flows and all global outputs into unified module-level and system-level flow documents, then validate the complete traceability chain from user story through screen, endpoint, database model, and implementation — ensuring nothing is lost between phases.
|
|
27
|
+
|
|
28
|
+
| Priority | Objective |
|
|
29
|
+
|---|---|
|
|
30
|
+
| primary | Produce a merged module_flow.json per module and a global_flow.json that unify FE, BE, and DB flows with global architecture decisions into a single coherent blueprint |
|
|
31
|
+
| secondary | Validate the complete traceability chain (story -> screen -> endpoint -> DB -> impl) and flag every broken link as a gap for the Decision Pack agent |
|
|
32
|
+
| tertiary | Resolve all cross-module references and dependencies so that downstream agents (impl_prep, implementation) have an unambiguous dependency graph |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Inputs
|
|
37
|
+
|
|
38
|
+
### fe_flow.json (per module)
|
|
39
|
+
- **Source:** `fe_flow` agent -> `agent_output/architecture/{module_id}/fe_flow.json`
|
|
40
|
+
- **Required:** no (conditional — only present if FE layer exists; if absent, module_flow.json omits frontend_flow section)
|
|
41
|
+
- **Shape:**
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"module_id": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "Module identifier",
|
|
47
|
+
"example": "auth"
|
|
48
|
+
},
|
|
49
|
+
"generated_at": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"format": "ISO-8601"
|
|
52
|
+
},
|
|
53
|
+
"nodes": {
|
|
54
|
+
"type": "array",
|
|
55
|
+
"description": "FE flow nodes representing screens, modals, and synthetic states",
|
|
56
|
+
"items": {
|
|
57
|
+
"node_id": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"example": "FN-AUTH-001"
|
|
60
|
+
},
|
|
61
|
+
"type": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"enum": ["screen", "modal", "redirect", "error", "loading", "terminal"],
|
|
64
|
+
"example": "screen"
|
|
65
|
+
},
|
|
66
|
+
"screen_ref": {
|
|
67
|
+
"type": "string | null",
|
|
68
|
+
"description": "screen_id from fe_details (null for synthetic nodes)",
|
|
69
|
+
"example": "SCR-AUTH-001"
|
|
70
|
+
},
|
|
71
|
+
"route": {
|
|
72
|
+
"type": "string | null",
|
|
73
|
+
"example": "/login"
|
|
74
|
+
},
|
|
75
|
+
"label": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"example": "Login Screen"
|
|
78
|
+
},
|
|
79
|
+
"is_entry_point": { "type": "boolean" },
|
|
80
|
+
"requires_auth": { "type": "boolean" },
|
|
81
|
+
"required_roles": {
|
|
82
|
+
"type": "array",
|
|
83
|
+
"items": { "type": "string" }
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"edges": {
|
|
88
|
+
"type": "array",
|
|
89
|
+
"description": "Transitions between FE flow nodes",
|
|
90
|
+
"items": {
|
|
91
|
+
"edge_id": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"example": "FE-AUTH-E001"
|
|
94
|
+
},
|
|
95
|
+
"from": { "type": "string", "description": "source node_id" },
|
|
96
|
+
"to": { "type": "string", "description": "target node_id" },
|
|
97
|
+
"trigger": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"enum": ["click", "submit", "navigate", "auto", "error", "timeout", "redirect"]
|
|
100
|
+
},
|
|
101
|
+
"action": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"enum": ["navigate", "open_modal", "close_modal", "submit_form", "fetch_data", "redirect", "show_error"]
|
|
104
|
+
},
|
|
105
|
+
"data_flow": {
|
|
106
|
+
"carries": { "type": "array", "items": { "type": "string" } },
|
|
107
|
+
"via": { "type": "string", "enum": ["route_params", "query_params", "state", "context", "props", "none"] }
|
|
108
|
+
},
|
|
109
|
+
"condition": { "type": "string | null" }
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"entry_points": {
|
|
113
|
+
"type": "array",
|
|
114
|
+
"items": {
|
|
115
|
+
"node_id": { "type": "string" },
|
|
116
|
+
"route": { "type": "string" },
|
|
117
|
+
"is_default": { "type": "boolean" },
|
|
118
|
+
"auth_required": { "type": "boolean" }
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"guards": {
|
|
122
|
+
"type": "array",
|
|
123
|
+
"items": {
|
|
124
|
+
"guard_id": { "type": "string" },
|
|
125
|
+
"type": { "type": "string", "enum": ["auth", "role", "condition", "feature_flag"] },
|
|
126
|
+
"applies_to": { "type": "array", "items": { "type": "string" } },
|
|
127
|
+
"config": { "type": "object" }
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"data_fetching": {
|
|
131
|
+
"type": "array",
|
|
132
|
+
"description": "Per-screen data fetching configuration (on_mount and on_action)",
|
|
133
|
+
"items": { "type": "object" }
|
|
134
|
+
},
|
|
135
|
+
"error_states": {
|
|
136
|
+
"type": "array",
|
|
137
|
+
"description": "Error state nodes with recovery edges",
|
|
138
|
+
"items": { "type": "object" }
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### be_policy_flow.json (per module)
|
|
144
|
+
- **Source:** `be_policy` agent -> `agent_output/architecture/{module_id}/be_policy_flow.json`
|
|
145
|
+
- **Required:** no (conditional — only present if BE layer exists; if absent, module_flow.json omits backend_policy section)
|
|
146
|
+
- **Shape:**
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"module_id": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"example": "auth"
|
|
152
|
+
},
|
|
153
|
+
"generated_at": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"format": "ISO-8601"
|
|
156
|
+
},
|
|
157
|
+
"endpoints": {
|
|
158
|
+
"type": "array",
|
|
159
|
+
"description": "Endpoint processing chains with middleware, handlers, and error handling",
|
|
160
|
+
"items": {
|
|
161
|
+
"path": {
|
|
162
|
+
"type": "string",
|
|
163
|
+
"example": "/api/auth/login"
|
|
164
|
+
},
|
|
165
|
+
"method": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"example": "POST"
|
|
168
|
+
},
|
|
169
|
+
"operation_id": {
|
|
170
|
+
"type": "string",
|
|
171
|
+
"description": "OpenAPI operationId"
|
|
172
|
+
},
|
|
173
|
+
"middleware_chain": {
|
|
174
|
+
"type": "array",
|
|
175
|
+
"description": "Ordered middleware instances for this endpoint",
|
|
176
|
+
"items": {
|
|
177
|
+
"middleware_id": { "type": "string", "example": "MW-AUTH-001" },
|
|
178
|
+
"type": { "type": "string", "enum": ["auth", "validation", "rate_limit", "logging", "transform", "cache", "cors", "sanitization"] },
|
|
179
|
+
"name": { "type": "string", "example": "JWT Authentication" },
|
|
180
|
+
"order": { "type": "number", "description": "execution order (1-based)" },
|
|
181
|
+
"config": { "type": "object", "description": "middleware-specific configuration" },
|
|
182
|
+
"skip_conditions": { "type": "array", "items": { "type": "string | null" } }
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"handler": {
|
|
186
|
+
"service_function": { "type": "string", "example": "UserService.createUser" },
|
|
187
|
+
"params": {
|
|
188
|
+
"type": "array",
|
|
189
|
+
"items": {
|
|
190
|
+
"name": { "type": "string" },
|
|
191
|
+
"source": { "type": "string", "enum": ["body", "params", "query", "headers", "auth_context"] },
|
|
192
|
+
"field": { "type": "string" }
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"returns": {
|
|
196
|
+
"type": { "type": "string" },
|
|
197
|
+
"schema_ref": { "type": "string" }
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"response_transform": {
|
|
201
|
+
"enabled": { "type": "boolean" },
|
|
202
|
+
"operations": { "type": "array", "items": { "type": "object" } }
|
|
203
|
+
},
|
|
204
|
+
"error_handlers": {
|
|
205
|
+
"type": "array",
|
|
206
|
+
"items": {
|
|
207
|
+
"status": { "type": "number" },
|
|
208
|
+
"handler": { "type": "string" },
|
|
209
|
+
"response_shape": { "type": "object" }
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"story_refs": {
|
|
213
|
+
"type": "array",
|
|
214
|
+
"items": { "type": "string" },
|
|
215
|
+
"example": ["US-AUTH-001"]
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### db_flow.json (per module)
|
|
223
|
+
- **Source:** `db_interaction` agent -> `agent_output/architecture/{module_id}/db_flow.json`
|
|
224
|
+
- **Required:** no (conditional — only present if DB layer exists; if absent, module_flow.json omits database_flow section)
|
|
225
|
+
- **Shape:**
|
|
226
|
+
```json
|
|
227
|
+
{
|
|
228
|
+
"module_id": {
|
|
229
|
+
"type": "string",
|
|
230
|
+
"example": "auth"
|
|
231
|
+
},
|
|
232
|
+
"generated_at": {
|
|
233
|
+
"type": "string",
|
|
234
|
+
"format": "ISO-8601"
|
|
235
|
+
},
|
|
236
|
+
"operations": {
|
|
237
|
+
"type": "array",
|
|
238
|
+
"description": "Per-endpoint database operation mappings",
|
|
239
|
+
"items": {
|
|
240
|
+
"endpoint_path": {
|
|
241
|
+
"type": "string",
|
|
242
|
+
"example": "/api/users"
|
|
243
|
+
},
|
|
244
|
+
"endpoint_method": {
|
|
245
|
+
"type": "string",
|
|
246
|
+
"example": "POST"
|
|
247
|
+
},
|
|
248
|
+
"operation_id": {
|
|
249
|
+
"type": "string",
|
|
250
|
+
"description": "OpenAPI operationId"
|
|
251
|
+
},
|
|
252
|
+
"service_function": {
|
|
253
|
+
"type": "string",
|
|
254
|
+
"description": "service function from be_policy_flow",
|
|
255
|
+
"example": "UserService.createUser"
|
|
256
|
+
},
|
|
257
|
+
"db_operations": {
|
|
258
|
+
"type": "array",
|
|
259
|
+
"description": "Prisma operations for this endpoint",
|
|
260
|
+
"items": {
|
|
261
|
+
"operation_id": { "type": "string", "example": "DBO-AUTH-001" },
|
|
262
|
+
"model": { "type": "string", "example": "User" },
|
|
263
|
+
"action": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"enum": ["create", "findUnique", "findMany", "update", "delete", "upsert", "aggregate", "count", "createMany", "updateMany", "deleteMany"],
|
|
266
|
+
"example": "findUnique"
|
|
267
|
+
},
|
|
268
|
+
"fields": { "type": "object", "description": "select, data, and omit field mappings" },
|
|
269
|
+
"where_clause": { "type": "object | null", "description": "filter conditions with field, operator, value_source" },
|
|
270
|
+
"include_relations": { "type": "array", "items": { "type": "object" } },
|
|
271
|
+
"order_by": { "type": "object | null" },
|
|
272
|
+
"transaction_group": { "type": "string | null" }
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
"read_patterns": {
|
|
276
|
+
"type": "array",
|
|
277
|
+
"description": "Read pattern metadata (single, list, paginated, search, aggregate)",
|
|
278
|
+
"items": { "type": "object" }
|
|
279
|
+
},
|
|
280
|
+
"performance_flags": {
|
|
281
|
+
"type": "array",
|
|
282
|
+
"description": "Detected performance concerns (n_plus_1, missing_index, etc.)",
|
|
283
|
+
"items": { "type": "object" }
|
|
284
|
+
},
|
|
285
|
+
"story_refs": {
|
|
286
|
+
"type": "array",
|
|
287
|
+
"items": { "type": "string" },
|
|
288
|
+
"example": ["US-AUTH-001"]
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
"transactions": {
|
|
293
|
+
"type": "array",
|
|
294
|
+
"description": "Multi-operation transactions with rollback strategies",
|
|
295
|
+
"items": { "type": "object" }
|
|
296
|
+
},
|
|
297
|
+
"index_recommendations": {
|
|
298
|
+
"type": "array",
|
|
299
|
+
"description": "Suggested database indexes with rationale",
|
|
300
|
+
"items": { "type": "object" }
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### normalized.json (per module)
|
|
306
|
+
- **Source:** `normalize` agent -> `agent_output/normalized/{module_id}/normalized.json`
|
|
307
|
+
- **Required:** yes
|
|
308
|
+
- **Shape:**
|
|
309
|
+
```json
|
|
310
|
+
{
|
|
311
|
+
"module_id": {
|
|
312
|
+
"type": "string",
|
|
313
|
+
"example": "auth"
|
|
314
|
+
},
|
|
315
|
+
"entities": {
|
|
316
|
+
"type": "array",
|
|
317
|
+
"description": "Normalized data entities with cross-contract reconciliation",
|
|
318
|
+
"items": {
|
|
319
|
+
"entity_name": { "type": "string", "example": "User" },
|
|
320
|
+
"fe_refs": { "type": "array", "items": { "type": "string" } },
|
|
321
|
+
"be_refs": { "type": "array", "items": { "type": "string" } },
|
|
322
|
+
"db_refs": { "type": "array", "items": { "type": "string" } }
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### Global Outputs (present ones from Phase 7)
|
|
329
|
+
- **Source:** Phase 7 global agents -> `agent_output/global/{artifact_name}.json`
|
|
330
|
+
- **Required:** no (conditional — only present global outputs are merged; some global agents may be skipped based on project complexity/layers. Reconcile merges whatever global outputs exist.)
|
|
331
|
+
- **Shape:** (summary — each references its own full schema)
|
|
332
|
+
```json
|
|
333
|
+
{
|
|
334
|
+
"global_services_registry": {
|
|
335
|
+
"type": "object",
|
|
336
|
+
"description": "Shared services across modules (from global_services agent)"
|
|
337
|
+
},
|
|
338
|
+
"global_middleware_registry": {
|
|
339
|
+
"type": "object",
|
|
340
|
+
"description": "Middleware definitions and assignments (from global_middleware agent)"
|
|
341
|
+
},
|
|
342
|
+
"global_navigation": {
|
|
343
|
+
"type": "object",
|
|
344
|
+
"description": "Cross-module navigation graph (from global_navigation agent)"
|
|
345
|
+
},
|
|
346
|
+
"global_db_patterns": {
|
|
347
|
+
"type": "object",
|
|
348
|
+
"description": "Database naming, indexing, audit conventions (from global_db_patterns agent)"
|
|
349
|
+
},
|
|
350
|
+
"global_security_policies": {
|
|
351
|
+
"type": "object",
|
|
352
|
+
"description": "Security rules and auth requirements (from global_security agent)"
|
|
353
|
+
},
|
|
354
|
+
"global_integrations": {
|
|
355
|
+
"type": "object",
|
|
356
|
+
"description": "External integration configs (from global_integrations agent)"
|
|
357
|
+
},
|
|
358
|
+
"environment_config_schema": {
|
|
359
|
+
"type": "object",
|
|
360
|
+
"description": "Environment variable definitions (from global_env_config agent)"
|
|
361
|
+
},
|
|
362
|
+
"production_bootstrap": {
|
|
363
|
+
"type": "object",
|
|
364
|
+
"description": "Seed data, default roles, initial config (from production_bootstrap agent)"
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
## Outputs
|
|
372
|
+
|
|
373
|
+
### module_flow.json (one per module)
|
|
374
|
+
- **Path:** `agent_output/reconciliation/{module_id}/module_flow.json`
|
|
375
|
+
- **Format:** `json`
|
|
376
|
+
- **Consumers:** `decision_pack`, `prd_generation`, `module_sequencer`, `pre_code_analysis`, `impl_prep`
|
|
377
|
+
- **Shape:**
|
|
378
|
+
```json
|
|
379
|
+
{
|
|
380
|
+
"module_id": {
|
|
381
|
+
"type": "string",
|
|
382
|
+
"description": "Module this merged flow belongs to",
|
|
383
|
+
"example": "auth"
|
|
384
|
+
},
|
|
385
|
+
"merged_at": {
|
|
386
|
+
"type": "string",
|
|
387
|
+
"format": "ISO-8601",
|
|
388
|
+
"description": "Timestamp of merge operation"
|
|
389
|
+
},
|
|
390
|
+
"layers": {
|
|
391
|
+
"type": "object",
|
|
392
|
+
"description": "Merged flows organized by layer",
|
|
393
|
+
"fields": {
|
|
394
|
+
"fe": {
|
|
395
|
+
"type": "object",
|
|
396
|
+
"description": "Frontend flow (from fe_flow.json)",
|
|
397
|
+
"fields": {
|
|
398
|
+
"nodes": { "type": "array", "description": "FE flow nodes" },
|
|
399
|
+
"screen_count": { "type": "number" },
|
|
400
|
+
"story_refs": { "type": "array", "items": { "type": "string" } }
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
"be": {
|
|
404
|
+
"type": "object",
|
|
405
|
+
"description": "Backend policy flow (from be_policy_flow.json)",
|
|
406
|
+
"fields": {
|
|
407
|
+
"nodes": { "type": "array", "description": "BE policy nodes" },
|
|
408
|
+
"endpoint_count": { "type": "number" },
|
|
409
|
+
"story_refs": { "type": "array", "items": { "type": "string" } }
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
"db": {
|
|
413
|
+
"type": "object",
|
|
414
|
+
"description": "Database interaction flow (from db_flow.json)",
|
|
415
|
+
"fields": {
|
|
416
|
+
"nodes": { "type": "array", "description": "DB flow nodes" },
|
|
417
|
+
"model_count": { "type": "number" },
|
|
418
|
+
"story_refs": { "type": "array", "items": { "type": "string" } }
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
"cross_layer_links": {
|
|
424
|
+
"type": "array",
|
|
425
|
+
"description": "Links connecting FE -> BE -> DB nodes within this module",
|
|
426
|
+
"items": {
|
|
427
|
+
"fe_node": { "type": "string", "example": "FE-AUTH-001" },
|
|
428
|
+
"be_node": { "type": "string", "example": "BE-AUTH-001" },
|
|
429
|
+
"db_node": { "type": "string", "example": "DB-AUTH-001" },
|
|
430
|
+
"story_ref": { "type": "string", "example": "US-AUTH-001" },
|
|
431
|
+
"chain_status": {
|
|
432
|
+
"type": "string",
|
|
433
|
+
"enum": ["complete", "partial", "broken"],
|
|
434
|
+
"description": "Whether the full FE->BE->DB chain is intact"
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
"cross_module_dependencies": {
|
|
439
|
+
"type": "array",
|
|
440
|
+
"description": "References to entities/services in other modules",
|
|
441
|
+
"items": {
|
|
442
|
+
"target_module": { "type": "string", "example": "billing" },
|
|
443
|
+
"dependency_type": {
|
|
444
|
+
"type": "string",
|
|
445
|
+
"enum": ["service_call", "shared_entity", "navigation", "event"],
|
|
446
|
+
"example": "service_call"
|
|
447
|
+
},
|
|
448
|
+
"description": { "type": "string", "example": "Auth service provides getCurrentUser to billing" }
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
"global_refs": {
|
|
452
|
+
"type": "object",
|
|
453
|
+
"description": "References to global registries used by this module",
|
|
454
|
+
"fields": {
|
|
455
|
+
"services_used": { "type": "array", "items": { "type": "string" } },
|
|
456
|
+
"middleware_applied": { "type": "array", "items": { "type": "string" } },
|
|
457
|
+
"security_policies_applied": { "type": "array", "items": { "type": "string" } },
|
|
458
|
+
"db_patterns_applied": { "type": "array", "items": { "type": "string" } }
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
### global_flow.json
|
|
465
|
+
- **Path:** `agent_output/reconciliation/global_flow.json`
|
|
466
|
+
- **Format:** `json`
|
|
467
|
+
- **Consumers:** `decision_pack`, `prd_generation`, `module_sequencer`, `impl_prep`
|
|
468
|
+
- **Shape:**
|
|
469
|
+
```json
|
|
470
|
+
{
|
|
471
|
+
"generated_at": {
|
|
472
|
+
"type": "string",
|
|
473
|
+
"format": "ISO-8601"
|
|
474
|
+
},
|
|
475
|
+
"total_modules": {
|
|
476
|
+
"type": "number",
|
|
477
|
+
"description": "Total modules in system"
|
|
478
|
+
},
|
|
479
|
+
"modules": {
|
|
480
|
+
"type": "array",
|
|
481
|
+
"description": "Summary of each module's flow",
|
|
482
|
+
"items": {
|
|
483
|
+
"module_id": { "type": "string" },
|
|
484
|
+
"screen_count": { "type": "number" },
|
|
485
|
+
"endpoint_count": { "type": "number" },
|
|
486
|
+
"model_count": { "type": "number" },
|
|
487
|
+
"story_count": { "type": "number" },
|
|
488
|
+
"chain_completeness": {
|
|
489
|
+
"type": "number",
|
|
490
|
+
"description": "Percentage of complete traceability chains (0-100)",
|
|
491
|
+
"example": 95.5
|
|
492
|
+
},
|
|
493
|
+
"cross_module_deps": { "type": "array", "items": { "type": "string" } }
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
"system_dependency_graph": {
|
|
497
|
+
"type": "object",
|
|
498
|
+
"description": "Directed graph of module-to-module dependencies",
|
|
499
|
+
"fields": {
|
|
500
|
+
"nodes": {
|
|
501
|
+
"type": "array",
|
|
502
|
+
"items": { "module_id": { "type": "string" } }
|
|
503
|
+
},
|
|
504
|
+
"edges": {
|
|
505
|
+
"type": "array",
|
|
506
|
+
"items": {
|
|
507
|
+
"from": { "type": "string" },
|
|
508
|
+
"to": { "type": "string" },
|
|
509
|
+
"type": { "type": "string" },
|
|
510
|
+
"weight": { "type": "number", "description": "Number of dependencies" }
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
"global_architecture_summary": {
|
|
516
|
+
"type": "object",
|
|
517
|
+
"description": "Consolidated view of all global decisions",
|
|
518
|
+
"fields": {
|
|
519
|
+
"shared_services": { "type": "array", "items": { "type": "string" } },
|
|
520
|
+
"middleware_stack": { "type": "array", "items": { "type": "string" } },
|
|
521
|
+
"security_model": { "type": "string" },
|
|
522
|
+
"db_conventions": { "type": "object" },
|
|
523
|
+
"integration_points": { "type": "array", "items": { "type": "string" } },
|
|
524
|
+
"environment_vars_count": { "type": "number" }
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
### traceability.json
|
|
531
|
+
- **Path:** `agent_output/reconciliation/traceability.json`
|
|
532
|
+
- **Format:** `json`
|
|
533
|
+
- **Consumers:** `decision_pack`, `prd_generation`, `module_sequencer`
|
|
534
|
+
- **Shape:**
|
|
535
|
+
```json
|
|
536
|
+
{
|
|
537
|
+
"generated_at": {
|
|
538
|
+
"type": "string",
|
|
539
|
+
"format": "ISO-8601"
|
|
540
|
+
},
|
|
541
|
+
"chains": {
|
|
542
|
+
"type": "array",
|
|
543
|
+
"description": "One entry per user story, tracing through all layers",
|
|
544
|
+
"items": {
|
|
545
|
+
"story_id": {
|
|
546
|
+
"type": "string",
|
|
547
|
+
"example": "US-AUTH-001"
|
|
548
|
+
},
|
|
549
|
+
"module_id": {
|
|
550
|
+
"type": "string",
|
|
551
|
+
"example": "auth"
|
|
552
|
+
},
|
|
553
|
+
"screens": {
|
|
554
|
+
"type": "array",
|
|
555
|
+
"description": "Screens serving this story",
|
|
556
|
+
"items": { "type": "string" },
|
|
557
|
+
"example": ["SCR-AUTH-001"]
|
|
558
|
+
},
|
|
559
|
+
"endpoints": {
|
|
560
|
+
"type": "array",
|
|
561
|
+
"description": "API endpoints implementing this story",
|
|
562
|
+
"items": { "type": "string" },
|
|
563
|
+
"example": ["POST /api/auth/login"]
|
|
564
|
+
},
|
|
565
|
+
"db_models": {
|
|
566
|
+
"type": "array",
|
|
567
|
+
"description": "Database models touched by this story",
|
|
568
|
+
"items": { "type": "string" },
|
|
569
|
+
"example": ["User", "Session"]
|
|
570
|
+
},
|
|
571
|
+
"fe_flow_nodes": {
|
|
572
|
+
"type": "array",
|
|
573
|
+
"items": { "type": "string" },
|
|
574
|
+
"example": ["FE-AUTH-001"]
|
|
575
|
+
},
|
|
576
|
+
"be_flow_nodes": {
|
|
577
|
+
"type": "array",
|
|
578
|
+
"items": { "type": "string" },
|
|
579
|
+
"example": ["BE-AUTH-001"]
|
|
580
|
+
},
|
|
581
|
+
"db_flow_nodes": {
|
|
582
|
+
"type": "array",
|
|
583
|
+
"items": { "type": "string" },
|
|
584
|
+
"example": ["DB-AUTH-001"]
|
|
585
|
+
},
|
|
586
|
+
"chain_status": {
|
|
587
|
+
"type": "string",
|
|
588
|
+
"enum": ["complete", "partial", "broken"],
|
|
589
|
+
"description": "complete = all layers present, partial = some layers missing, broken = critical gap"
|
|
590
|
+
},
|
|
591
|
+
"gaps": {
|
|
592
|
+
"type": "array",
|
|
593
|
+
"description": "Missing links in the chain",
|
|
594
|
+
"items": {
|
|
595
|
+
"gap_type": {
|
|
596
|
+
"type": "string",
|
|
597
|
+
"enum": ["missing_screen", "missing_endpoint", "missing_db_model", "missing_flow_node", "orphan_endpoint", "orphan_screen"],
|
|
598
|
+
"example": "missing_endpoint"
|
|
599
|
+
},
|
|
600
|
+
"description": {
|
|
601
|
+
"type": "string",
|
|
602
|
+
"example": "Story US-AUTH-001 has screen SCR-AUTH-001 but no corresponding endpoint for password reset flow"
|
|
603
|
+
},
|
|
604
|
+
"severity": {
|
|
605
|
+
"type": "string",
|
|
606
|
+
"enum": ["critical", "warning", "info"],
|
|
607
|
+
"example": "critical"
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
},
|
|
613
|
+
"summary": {
|
|
614
|
+
"type": "object",
|
|
615
|
+
"description": "Aggregate traceability metrics",
|
|
616
|
+
"fields": {
|
|
617
|
+
"total_stories": { "type": "number" },
|
|
618
|
+
"complete_chains": { "type": "number" },
|
|
619
|
+
"partial_chains": { "type": "number" },
|
|
620
|
+
"broken_chains": { "type": "number" },
|
|
621
|
+
"total_gaps": { "type": "number" },
|
|
622
|
+
"critical_gaps": { "type": "number" },
|
|
623
|
+
"completeness_percentage": { "type": "number", "example": 92.3 }
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
---
|
|
630
|
+
|
|
631
|
+
## Dependencies
|
|
632
|
+
|
|
633
|
+
| Depends On | Agent | Artifact | Why |
|
|
634
|
+
|---|---|---|---|
|
|
635
|
+
| input | `fe_flow` | `fe_flow.json` (per module) | Frontend flow data to merge into module flow |
|
|
636
|
+
| input | `be_policy` | `be_policy_flow.json` (per module) | Backend policy flow to merge into module flow |
|
|
637
|
+
| input | `db_interaction` | `db_flow.json` (per module) | Database flow to merge into module flow |
|
|
638
|
+
| input | `normalize` | `normalized.json` (per module) | Normalized cross-contract entity data for reference resolution |
|
|
639
|
+
| input | `global_services` | `global_services_registry.json` | Shared services to reference in merged flows |
|
|
640
|
+
| input | `global_middleware` | `global_middleware_registry.json` | Middleware assignments to wire into flows |
|
|
641
|
+
| input | `global_navigation` | `global_navigation.json` | Cross-module navigation to validate |
|
|
642
|
+
| input | `global_db_patterns` | `global_db_patterns.json` | DB conventions for validation |
|
|
643
|
+
| input | `global_security` | `global_security_policies.json` | Security policies to validate against flows |
|
|
644
|
+
| input | `global_integrations` | `global_integrations.json` | External integration references |
|
|
645
|
+
| input | `global_env_config` | `environment_config_schema.json` | Environment variable definitions |
|
|
646
|
+
| input | `production_bootstrap` | `production_bootstrap.json` | Seed data and initial config |
|
|
647
|
+
|
|
648
|
+
| Blocks | Agent | Why |
|
|
649
|
+
|---|---|---|
|
|
650
|
+
| output | `decision_pack` | Decision Pack needs traceability gaps to generate questions |
|
|
651
|
+
| output | `prd_generation` | PRD agent needs merged flows and traceability for comprehensive document |
|
|
652
|
+
| output | `module_sequencer` | Sequencer needs cross-module dependency graph to determine build order |
|
|
653
|
+
|
|
654
|
+
---
|
|
655
|
+
|
|
656
|
+
## Orchestrator Communication
|
|
657
|
+
|
|
658
|
+
> Reference: `v2/architecture/agent-orchestrator-communication.md`
|
|
659
|
+
|
|
660
|
+
### Agent Identity
|
|
661
|
+
|
|
662
|
+
This agent's ID is `architect_reconcile`. Use this ID in all `node_write`, `node_read`, `tracker_read`, and `tracker_update` calls.
|
|
663
|
+
|
|
664
|
+
### Tracker Access
|
|
665
|
+
|
|
666
|
+
| Direction | Compressed Keys | Purpose |
|
|
667
|
+
|---|---|---|
|
|
668
|
+
| read | `md.a` | Read active modules to know which modules to reconcile |
|
|
669
|
+
| write | `ag` | Report agent status (completed/failed) |
|
|
670
|
+
|
|
671
|
+
### Output Meta
|
|
672
|
+
|
|
673
|
+
This agent does not produce routing/coordination metadata. `output_meta: null`.
|
|
674
|
+
|
|
675
|
+
### Completion Signal
|
|
676
|
+
|
|
677
|
+
- **On success:** `tracker_update(agent_id: "architect_reconcile", status: "completed")`
|
|
678
|
+
- **On failure:** `tracker_update(agent_id: "architect_reconcile", status: "failed", add_intervention: { id: "...", agent_id: "architect_reconcile", type: "error", message: "..." })`
|
|
679
|
+
|
|
680
|
+
### Scope Resolution
|
|
681
|
+
|
|
682
|
+
Global agent — runs once across all modules. Reads `md.a` from tracker via `tracker_read` to know which modules to process for flow merging and traceability validation.
|
|
683
|
+
|
|
684
|
+
---
|
|
685
|
+
|
|
686
|
+
## Compressed Keymap
|
|
687
|
+
|
|
688
|
+
Use these compressed keys in all `node_write` calls. The registry validates against this map — unknown keys are rejected.
|
|
689
|
+
|
|
690
|
+
**module_flow.json (per module)**
|
|
691
|
+
|
|
692
|
+
| Key | Full Name | Description |
|
|
693
|
+
|---|---|---|
|
|
694
|
+
| `m` | module_id | Module identifier |
|
|
695
|
+
| `ma` | merged_at | Timestamp of flow merge |
|
|
696
|
+
| `ly` | layers | Layer breakdown object |
|
|
697
|
+
| `ly.fe` | fe | Frontend layer flow |
|
|
698
|
+
| `ly.fe.nd` | nodes | Frontend flow nodes |
|
|
699
|
+
| `ly.fe.sc` | screen_count | Number of screens |
|
|
700
|
+
| `ly.fe.sr` | story_refs | Story references for FE |
|
|
701
|
+
| `ly.be` | be | Backend layer flow |
|
|
702
|
+
| `ly.be.nd` | nodes | Backend flow nodes |
|
|
703
|
+
| `ly.be.ep` | endpoint_count | Number of endpoints |
|
|
704
|
+
| `ly.be.sr` | story_refs | Story references for BE |
|
|
705
|
+
| `ly.db` | db | Database layer flow |
|
|
706
|
+
| `ly.db.nd` | nodes | Database flow nodes |
|
|
707
|
+
| `ly.db.mc` | model_count | Number of models |
|
|
708
|
+
| `ly.db.sr` | story_refs | Story references for DB |
|
|
709
|
+
| `cl` | cross_layer_links | Array of cross-layer link objects |
|
|
710
|
+
| `cl.fn` | fe_node | Frontend node in link |
|
|
711
|
+
| `cl.bn` | be_node | Backend node in link |
|
|
712
|
+
| `cl.dn` | db_node | Database node in link |
|
|
713
|
+
| `cl.sr` | story_ref | Story reference for link |
|
|
714
|
+
| `cl.cs` | chain_status | Link chain completeness status |
|
|
715
|
+
| `cd` | cross_module_dependencies | Array of cross-module dependency objects |
|
|
716
|
+
| `cd.tm` | target_module | Target module of dependency |
|
|
717
|
+
| `cd.dt` | dependency_type | Type of dependency |
|
|
718
|
+
| `cd.ds` | description | Dependency description |
|
|
719
|
+
| `gr` | global_refs | Global references object |
|
|
720
|
+
| `gr.su` | services_used | Shared services used |
|
|
721
|
+
| `gr.mw` | middleware_applied | Middleware applied |
|
|
722
|
+
| `gr.sp` | security_policies_applied | Security policies applied |
|
|
723
|
+
| `gr.dp` | db_patterns_applied | Database patterns applied |
|
|
724
|
+
|
|
725
|
+
**global_flow.json**
|
|
726
|
+
|
|
727
|
+
| Key | Full Name | Description |
|
|
728
|
+
|---|---|---|
|
|
729
|
+
| `ga` | generated_at | Timestamp of generation |
|
|
730
|
+
| `tm` | total_modules | Total modules processed |
|
|
731
|
+
| `ms` | modules | Array of module summary objects |
|
|
732
|
+
| `ms.m` | module_id | Module identifier |
|
|
733
|
+
| `ms.sc` | screen_count | Screens in module |
|
|
734
|
+
| `ms.ep` | endpoint_count | Endpoints in module |
|
|
735
|
+
| `ms.mc` | model_count | Models in module |
|
|
736
|
+
| `ms.st` | story_count | Stories in module |
|
|
737
|
+
| `ms.cc` | chain_completeness | Chain completeness ratio |
|
|
738
|
+
| `ms.cd` | cross_module_deps | Cross-module dependency count |
|
|
739
|
+
| `dg` | system_dependency_graph | System dependency graph object |
|
|
740
|
+
| `dg.nd` | nodes | Graph nodes |
|
|
741
|
+
| `dg.ed` | edges | Graph edges |
|
|
742
|
+
| `gs` | global_architecture_summary | Global architecture summary object |
|
|
743
|
+
| `gs.ss` | shared_services | Shared services list |
|
|
744
|
+
| `gs.mw` | middleware_stack | Middleware stack |
|
|
745
|
+
| `gs.sm` | security_model | Security model description |
|
|
746
|
+
| `gs.dc` | db_conventions | Database conventions |
|
|
747
|
+
| `gs.ip` | integration_points | Integration points |
|
|
748
|
+
| `gs.ev` | environment_vars_count | Environment variable count |
|
|
749
|
+
|
|
750
|
+
**traceability.json**
|
|
751
|
+
|
|
752
|
+
| Key | Full Name | Description |
|
|
753
|
+
|---|---|---|
|
|
754
|
+
| `ga` | generated_at | Timestamp of generation |
|
|
755
|
+
| `ch` | chains | Array of traceability chain objects |
|
|
756
|
+
| `ch.si` | story_id | Story identifier |
|
|
757
|
+
| `ch.m` | module_id | Module the story belongs to |
|
|
758
|
+
| `ch.sr` | screens | Screens implementing the story |
|
|
759
|
+
| `ch.ep` | endpoints | Endpoints implementing the story |
|
|
760
|
+
| `ch.dm` | db_models | DB models for the story |
|
|
761
|
+
| `ch.fn` | fe_flow_nodes | Frontend flow nodes |
|
|
762
|
+
| `ch.bn` | be_flow_nodes | Backend flow nodes |
|
|
763
|
+
| `ch.dn` | db_flow_nodes | Database flow nodes |
|
|
764
|
+
| `ch.cs` | chain_status | Chain completeness status |
|
|
765
|
+
| `ch.gp` | gaps | Array of gap objects |
|
|
766
|
+
| `ch.gp.gt` | gap_type | Type of gap |
|
|
767
|
+
| `ch.gp.ds` | description | Gap description |
|
|
768
|
+
| `ch.gp.sv` | severity | Gap severity |
|
|
769
|
+
| `sm` | summary | Traceability summary object |
|
|
770
|
+
| `sm.ts` | total_stories | Total stories traced |
|
|
771
|
+
| `sm.cc` | complete_chains | Fully complete chains |
|
|
772
|
+
| `sm.pc` | partial_chains | Partially complete chains |
|
|
773
|
+
| `sm.bc` | broken_chains | Broken chains |
|
|
774
|
+
| `sm.tg` | total_gaps | Total gaps found |
|
|
775
|
+
| `sm.cg` | critical_gaps | Critical gaps count |
|
|
776
|
+
| `sm.cp` | completeness_percentage | Overall completeness percentage |
|
|
777
|
+
|
|
778
|
+
---
|
|
779
|
+
|
|
780
|
+
## Tools Required
|
|
781
|
+
|
|
782
|
+
| Tool | Purpose | Exists? |
|
|
783
|
+
|---|---|---|
|
|
784
|
+
| `node_write` | Write reconciliation output via registry-validated compressed keys. Agent calls `node_write(agent_id: "architect_reconcile", output_key: "module_flow", data: {...}, unit_id: "{module_id}")`. | Pending |
|
|
785
|
+
| `node_read` | Read upstream artifacts (per-module flows, normalized, global outputs). Agent calls `node_read(agent_id: "architect_reconcile", input_key: "fe_flow", unit_id: "{module_id}")`. | Pending |
|
|
786
|
+
| `tracker_read` | Read active modules. Agent calls `tracker_read(agent_id: "architect_reconcile", fields: ["md.a"])`. | Pending |
|
|
787
|
+
| `tracker_update` | Report completion/failure. Agent calls `tracker_update(agent_id: "architect_reconcile", status: "completed")`. | Pending |
|
|
788
|
+
|
|
789
|
+
---
|
|
790
|
+
|
|
791
|
+
## Guardrails
|
|
792
|
+
|
|
793
|
+
### Rules
|
|
794
|
+
|
|
795
|
+
| ID | Category | Severity | Rule |
|
|
796
|
+
|---|---|---|---|
|
|
797
|
+
| R-001 | `constraint` | `must` | Must produce a complete traceability chain for every user story. No story may lack a chain entry in traceability.json. |
|
|
798
|
+
| R-002 | `constraint` | `must` | Must resolve all cross-module references. If module A references module B's entity, that reference must be validated as existing. |
|
|
799
|
+
| R-003 | `output_quality` | `must` | Must flag every broken chain with a gap entry including gap_type, description, and severity. No silent failures. |
|
|
800
|
+
| R-004 | `constraint` | `must` | Every module_flow.json must contain all three layers (fe, be, db). If a layer has no nodes, it must be present but empty with an explanation. |
|
|
801
|
+
| R-005 | `scope_boundary` | `must` | Must not modify any input artifacts. This agent is read-only on inputs and write-only on outputs. |
|
|
802
|
+
| R-006 | `data_handling` | `must` | Must preserve all story_ref back-references from input flows. No story reference may be dropped during merge. |
|
|
803
|
+
| R-007 | `output_quality` | `should` | global_flow.json should include a system dependency graph that enables topological sorting for build order. |
|
|
804
|
+
| R-008 | `constraint` | `must` | Must handle partial layer sets: if only BE+DB flows exist (no FE), merge only those. module_flow.json includes a `layers_present` field. Traceability checks only validate chains for present layers. Never fail because an absent layer's flow is missing. |
|
|
805
|
+
| R-008 | `constraint` | `should` | Cross-layer links should connect FE -> BE -> DB nodes where the same story drives all three layers. |
|
|
806
|
+
| R-009 | `output_quality` | `should` | Traceability summary should compute completeness_percentage accurately as (complete_chains / total_stories * 100). |
|
|
807
|
+
| R-010 | `not_allowed` | `must` | Must not invent or fabricate flow nodes that do not exist in the input artifacts. Merge only; do not generate. |
|
|
808
|
+
| R-011 | `constraint` | `must` | Must use compressed keys as defined in the Compressed Keymap section for all `node_write` / `node_read` calls. Never use expanded/full key names. |
|
|
809
|
+
| R-012 | `constraint` | `must` | Must use `node_write` to write output and `node_read` to read upstream artifacts. Must not use raw file writes, generic file_writer, or any other method. |
|
|
810
|
+
| R-013 | `constraint` | `must` | Must call `tracker_update(agent_id: "architect_reconcile", status: "completed")` before exiting on success. Must call `tracker_update(agent_id: "architect_reconcile", status: "failed", add_intervention: {...})` before exiting on failure. |
|
|
811
|
+
| R-014 | `constraint` | `must` | Must read active modules via `tracker_read(agent_id: "architect_reconcile", fields: ["md.a"])` when resolving scope. Must not hardcode module lists. |
|
|
812
|
+
|
|
813
|
+
### Limits
|
|
814
|
+
|
|
815
|
+
| Resource | Value |
|
|
816
|
+
|---|---|
|
|
817
|
+
| max_retries | 3 |
|
|
818
|
+
| max_tokens | 32768 |
|
|
819
|
+
| max_modules | 20 |
|
|
820
|
+
| timeout_seconds | 600 |
|
|
821
|
+
|
|
822
|
+
---
|
|
823
|
+
|
|
824
|
+
## Scope Boundary
|
|
825
|
+
|
|
826
|
+
**In scope:**
|
|
827
|
+
- Merging per-module FE, BE, and DB flows into unified module_flow.json files
|
|
828
|
+
- Building a system-wide global_flow.json with module dependency graph
|
|
829
|
+
- Validating the complete traceability chain from story to implementation
|
|
830
|
+
- Detecting and reporting all gaps, broken chains, and unresolved references
|
|
831
|
+
- Resolving cross-module dependencies (shared entities, service calls, navigation links)
|
|
832
|
+
- Referencing global outputs (services, middleware, security, etc.) in merged flows
|
|
833
|
+
|
|
834
|
+
**Out of scope:**
|
|
835
|
+
- Fixing gaps or broken chains (that is the Decision Pack agent's job to surface and the user's job to decide)
|
|
836
|
+
- Modifying any input artifacts
|
|
837
|
+
- Making architectural decisions
|
|
838
|
+
- Generating code or implementation artifacts
|
|
839
|
+
- Defining new stories, screens, or endpoints
|
|
840
|
+
- Running any implementation or testing
|
|
841
|
+
|
|
842
|
+
---
|
|
843
|
+
|
|
844
|
+
## Triggers
|
|
845
|
+
|
|
846
|
+
- Orchestrator activates this agent when all PRESENT per-module flows and all PRESENT global outputs are complete (absent layers/globals are not waited for)
|
|
847
|
+
- Requires the Phase 7 global barrier to have passed (all global agents done)
|
|
848
|
+
- In retrofit mode, activated only for modules flagged by the triage agent (but still produces global outputs)
|
|
849
|
+
|
|
850
|
+
---
|
|
851
|
+
|
|
852
|
+
## Checkpoints
|
|
853
|
+
|
|
854
|
+
| ID | Description | Action |
|
|
855
|
+
|---|---|---|
|
|
856
|
+
| `CP-001` | All per-module flow artifacts loaded and validated | `log` |
|
|
857
|
+
| `CP-002` | All global output artifacts loaded | `log` |
|
|
858
|
+
| `CP-003` | Per-module flow merge complete for all modules | `notify` — summary of merge results |
|
|
859
|
+
| `CP-004` | Cross-module dependency resolution complete | `log` |
|
|
860
|
+
| `CP-005` | Traceability chain validation complete | `notify` — alert if broken chains found |
|
|
861
|
+
| `CP-006` | global_flow.json and traceability.json written | `log` |
|
|
862
|
+
| `CP-007` | All output artifacts validated against schemas | `log` |
|
|
863
|
+
|
|
864
|
+
---
|
|
865
|
+
|
|
866
|
+
## Validation Criteria
|
|
867
|
+
|
|
868
|
+
- Every module in modules_registry.json has a corresponding module_flow.json
|
|
869
|
+
- Every module_flow.json contains all three layers (fe, be, db)
|
|
870
|
+
- Every user story appears in traceability.json with a chain entry
|
|
871
|
+
- All cross-module references resolve to existing modules and entities
|
|
872
|
+
- traceability.json summary counts are mathematically consistent (complete + partial + broken = total)
|
|
873
|
+
- global_flow.json system_dependency_graph has no orphan nodes
|
|
874
|
+
- No story_ref from input flows is missing in the merged output
|
|
875
|
+
- All gap entries have valid gap_type, description, and severity values
|
|
876
|
+
- Output files conform to their defined JSON schemas
|
|
877
|
+
|
|
878
|
+
---
|
|
879
|
+
|
|
880
|
+
## Context Sources
|
|
881
|
+
|
|
882
|
+
- All per-module flow artifacts (fe_flow.json, be_policy_flow.json, db_flow.json per module)
|
|
883
|
+
- All per-module normalized.json files
|
|
884
|
+
- All 8 global output artifacts from Phase 7
|
|
885
|
+
- modules_registry.json from Phase 1 (for module list)
|
|
886
|
+
- user_stories_{module_id}.json from Phase 3 (for story list reference)
|
|
887
|
+
|
|
888
|
+
---
|
|
889
|
+
|
|
890
|
+
## Operation Mode
|
|
891
|
+
|
|
892
|
+
| Field | Value |
|
|
893
|
+
|---|---|
|
|
894
|
+
| Type | `autonomous` |
|
|
895
|
+
| Fallback | `none` — if reconciliation fails, the pipeline cannot proceed to decisions or implementation prep |
|
|
896
|
+
|
|
897
|
+
---
|
|
898
|
+
|
|
899
|
+
## Tool Gaps
|
|
900
|
+
|
|
901
|
+
| Gap ID | Description | Needed By | Impact Without |
|
|
902
|
+
|---|---|---|---|
|
|
903
|
+
| `TG-001` | `node_write` MCP tool not yet built | this agent | Cannot write output with registry validation -- blocked |
|
|
904
|
+
| `TG-002` | `node_read` MCP tool not yet built | this agent | Cannot read upstream artifacts with field enforcement -- blocked |
|
|
905
|
+
| `TG-003` | `tracker_read` MCP tool not yet built | this agent | Cannot read active modules -- blocked |
|
|
906
|
+
| `TG-004` | `tracker_update` MCP tool not yet built | this agent | Cannot report completion -- blocked |
|
|
907
|
+
| `TG-005` | Flow merger tool that can unify FE, BE, and DB flow graphs into a single coherent module flow with cross-layer links | this agent | Manual merging is error-prone and would miss connections between layers |
|
|
908
|
+
| `TG-006` | Traceability chain validator that walks the full story -> screen -> endpoint -> DB -> impl chain and detects breaks | this agent | Broken chains would only be caught during implementation, causing expensive rework |
|
|
909
|
+
| `TG-007` | Cross-module dependency resolver that validates inter-module references (shared entities, service calls, navigation) | this agent | Unresolved cross-module references would cause integration failures during implementation |
|
|
910
|
+
|
|
911
|
+
---
|
|
912
|
+
|
|
913
|
+
## Generation Readiness
|
|
914
|
+
|
|
915
|
+
| `generate_agent` Param | Status | Notes |
|
|
916
|
+
|---|---|---|
|
|
917
|
+
| `fileName` | ready | `architect-reconcile` |
|
|
918
|
+
| `agentName` | ready | `architect_reconcile` |
|
|
919
|
+
| `agentRole` | ready | "System Flow Merger and Traceability Validator" |
|
|
920
|
+
| `agentDescription` | ready | Full description available from Goal section |
|
|
921
|
+
| `operationMode` | ready | `autonomous`, no fallback |
|
|
922
|
+
| `goal` | ready | 3 objectives defined with priorities |
|
|
923
|
+
| `inputs` | ready | Per-module flows (3 per module), normalized (per module), 8 global outputs |
|
|
924
|
+
| `guardrails` | ready | 14 rules defined across constraint, scope_boundary, output_quality, data_handling, not_allowed categories |
|
|
925
|
+
| `scopeBoundary` | ready | 6 in-scope items, 6 out-of-scope items |
|
|
926
|
+
| `outputFormat` | ready | JSON output with full schemas for module_flow.json, global_flow.json, traceability.json |
|
|
927
|
+
| `triggers` | ready | 3 triggers defined |
|
|
928
|
+
| `checkpoints` | ready | 7 checkpoints with actions |
|
|
929
|
+
| `validation` | ready | 9 validation criteria |
|
|
930
|
+
| `contextSources` | ready | 5 context source categories |
|
|
931
|
+
| `metadata` | ready | phase: "8", mode: "both", granularity: "global" |
|