@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,529 @@
|
|
|
1
|
+
# Module Priority Sequencer Agent
|
|
2
|
+
|
|
3
|
+
> **Greek:** Taxis (Táxis) — "order/arrangement"
|
|
4
|
+
> **Sanskrit:** क्रम (Krama) — "sequence/order"
|
|
5
|
+
> **Tagline:** *"Build what matters first"*
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Agent Identity
|
|
10
|
+
|
|
11
|
+
| Field | Value |
|
|
12
|
+
|---|---|
|
|
13
|
+
| ID | `module_sequencer` |
|
|
14
|
+
| Name | Module Priority Sequencer 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:** Determine the optimal build order for module implementation by analyzing cross-module dependencies, story priorities, and complexity estimates — producing a sequenced plan that respects dependency constraints, identifies the critical path, and groups independent modules for parallel execution.
|
|
27
|
+
|
|
28
|
+
| Priority | Objective |
|
|
29
|
+
|---|---|
|
|
30
|
+
| primary | Produce a dependency-respecting build sequence where no module is scheduled before its dependencies (if billing depends on auth, auth goes first) |
|
|
31
|
+
| secondary | Identify the critical path — the longest chain of dependent modules that determines the minimum total build time |
|
|
32
|
+
| tertiary | Group independent modules into parallel execution batches to maximize throughput during implementation |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Inputs
|
|
37
|
+
|
|
38
|
+
### module_flow.json (per module)
|
|
39
|
+
- **Source:** `architect_reconcile` agent -> `agent_output/reconciliation/{module_id}/module_flow.json`
|
|
40
|
+
- **Required:** yes
|
|
41
|
+
- **Shape:**
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"module_id": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"example": "auth"
|
|
47
|
+
},
|
|
48
|
+
"cross_module_dependencies": {
|
|
49
|
+
"type": "array",
|
|
50
|
+
"description": "Dependencies this module has on other modules",
|
|
51
|
+
"items": {
|
|
52
|
+
"target_module": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"example": "billing"
|
|
55
|
+
},
|
|
56
|
+
"dependency_type": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"enum": ["service_call", "shared_entity", "navigation", "event"],
|
|
59
|
+
"example": "service_call"
|
|
60
|
+
},
|
|
61
|
+
"description": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"example": "Auth service provides getCurrentUser to billing"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"layers": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"description": "Layer details used for complexity estimation",
|
|
70
|
+
"fields": {
|
|
71
|
+
"fe": { "nodes": { "type": "array" }, "screen_count": { "type": "number" } },
|
|
72
|
+
"be": { "nodes": { "type": "array" }, "endpoint_count": { "type": "number" } },
|
|
73
|
+
"db": { "nodes": { "type": "array" }, "model_count": { "type": "number" } }
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### story_priority.json (per module)
|
|
80
|
+
- **Source:** `user_stories` agent -> `agent_output/stories/{module_id}/user_stories_{module_id}.json` (priority field per story)
|
|
81
|
+
- **Required:** yes
|
|
82
|
+
- **Shape:**
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"module_id": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"example": "auth"
|
|
88
|
+
},
|
|
89
|
+
"stories": {
|
|
90
|
+
"type": "array",
|
|
91
|
+
"items": {
|
|
92
|
+
"story_id": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"example": "US-AUTH-001"
|
|
95
|
+
},
|
|
96
|
+
"priority": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"enum": ["must", "should", "could", "wont"],
|
|
99
|
+
"example": "must"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"priority_summary": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"description": "Count of stories by priority level",
|
|
106
|
+
"fields": {
|
|
107
|
+
"must_count": { "type": "number", "example": 5 },
|
|
108
|
+
"should_count": { "type": "number", "example": 3 },
|
|
109
|
+
"could_count": { "type": "number", "example": 2 },
|
|
110
|
+
"wont_count": { "type": "number", "example": 0 }
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### traceability.json
|
|
117
|
+
- **Source:** `architect_reconcile` agent -> `agent_output/reconciliation/traceability.json`
|
|
118
|
+
- **Required:** yes
|
|
119
|
+
- **Shape:**
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"chains": {
|
|
123
|
+
"type": "array",
|
|
124
|
+
"items": {
|
|
125
|
+
"story_id": { "type": "string" },
|
|
126
|
+
"module_id": { "type": "string" },
|
|
127
|
+
"chain_status": { "type": "string", "enum": ["complete", "partial", "broken"] }
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### decisions.json
|
|
134
|
+
- **Source:** `decision_pack` agent -> `agent_output/reconciliation/decisions.json`
|
|
135
|
+
- **Required:** yes
|
|
136
|
+
- **Shape:**
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"gap_decisions": {
|
|
140
|
+
"type": "array",
|
|
141
|
+
"items": {
|
|
142
|
+
"question_id": { "type": "string" },
|
|
143
|
+
"selected_option": { "type": "string" },
|
|
144
|
+
"affects_modules": { "type": "array", "items": { "type": "string" } }
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"conflict_decisions": {
|
|
148
|
+
"type": "array",
|
|
149
|
+
"items": {
|
|
150
|
+
"question_id": { "type": "string" },
|
|
151
|
+
"selected_option": { "type": "string" },
|
|
152
|
+
"affects_modules": { "type": "array", "items": { "type": "string" } }
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Outputs
|
|
161
|
+
|
|
162
|
+
### module_priority_sequence.json
|
|
163
|
+
- **Path:** `agent_output/reconciliation/module_priority_sequence.json`
|
|
164
|
+
- **Format:** `json`
|
|
165
|
+
- **Consumers:** `impl_prep`, `pre_code_analysis`, `orchestrator`, all implementation agents
|
|
166
|
+
- **Shape:**
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"generated_at": {
|
|
170
|
+
"type": "string",
|
|
171
|
+
"format": "ISO-8601"
|
|
172
|
+
},
|
|
173
|
+
"total_modules": {
|
|
174
|
+
"type": "number",
|
|
175
|
+
"description": "Total modules in the sequence",
|
|
176
|
+
"example": 5
|
|
177
|
+
},
|
|
178
|
+
"sequence": {
|
|
179
|
+
"type": "array",
|
|
180
|
+
"description": "Ordered list of modules in build priority",
|
|
181
|
+
"items": {
|
|
182
|
+
"order": {
|
|
183
|
+
"type": "number",
|
|
184
|
+
"description": "1-based position in the build sequence",
|
|
185
|
+
"example": 1
|
|
186
|
+
},
|
|
187
|
+
"module_id": {
|
|
188
|
+
"type": "string",
|
|
189
|
+
"description": "Module identifier",
|
|
190
|
+
"example": "auth"
|
|
191
|
+
},
|
|
192
|
+
"reason": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"description": "Why this module is at this position",
|
|
195
|
+
"example": "Auth has no dependencies and is required by 3 other modules (billing, reports, dashboard). It has the highest must-story ratio."
|
|
196
|
+
},
|
|
197
|
+
"dependencies": {
|
|
198
|
+
"type": "array",
|
|
199
|
+
"description": "Module IDs this module depends on (must be built before this one)",
|
|
200
|
+
"items": { "type": "string" },
|
|
201
|
+
"example": []
|
|
202
|
+
},
|
|
203
|
+
"dependents": {
|
|
204
|
+
"type": "array",
|
|
205
|
+
"description": "Module IDs that depend on this module",
|
|
206
|
+
"items": { "type": "string" },
|
|
207
|
+
"example": ["billing", "reports", "dashboard"]
|
|
208
|
+
},
|
|
209
|
+
"estimated_complexity": {
|
|
210
|
+
"type": "string",
|
|
211
|
+
"enum": ["low", "medium", "high"],
|
|
212
|
+
"description": "Estimated implementation complexity based on screen count, endpoint count, model count, and story priority mix",
|
|
213
|
+
"example": "medium"
|
|
214
|
+
},
|
|
215
|
+
"complexity_factors": {
|
|
216
|
+
"type": "object",
|
|
217
|
+
"description": "Breakdown of what contributes to complexity estimate",
|
|
218
|
+
"fields": {
|
|
219
|
+
"screen_count": { "type": "number", "example": 4 },
|
|
220
|
+
"endpoint_count": { "type": "number", "example": 8 },
|
|
221
|
+
"model_count": { "type": "number", "example": 3 },
|
|
222
|
+
"must_story_count": { "type": "number", "example": 5 },
|
|
223
|
+
"integration_count": { "type": "number", "example": 1 },
|
|
224
|
+
"cross_module_dep_count": { "type": "number", "example": 0 }
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"is_on_critical_path": {
|
|
228
|
+
"type": "boolean",
|
|
229
|
+
"description": "Whether this module is on the critical path",
|
|
230
|
+
"example": true
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"parallel_groups": {
|
|
235
|
+
"type": "array",
|
|
236
|
+
"description": "Groups of modules that can be built simultaneously because they have no interdependencies",
|
|
237
|
+
"items": {
|
|
238
|
+
"group_id": {
|
|
239
|
+
"type": "number",
|
|
240
|
+
"description": "1-based group number",
|
|
241
|
+
"example": 1
|
|
242
|
+
},
|
|
243
|
+
"modules": {
|
|
244
|
+
"type": "array",
|
|
245
|
+
"description": "Module IDs in this parallel group",
|
|
246
|
+
"items": { "type": "string" },
|
|
247
|
+
"example": ["auth"]
|
|
248
|
+
},
|
|
249
|
+
"prerequisites_met": {
|
|
250
|
+
"type": "string",
|
|
251
|
+
"description": "What must be complete before this group can start",
|
|
252
|
+
"example": "impl_prep complete"
|
|
253
|
+
},
|
|
254
|
+
"estimated_group_complexity": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"enum": ["low", "medium", "high"],
|
|
257
|
+
"description": "Complexity of the most complex module in the group (determines group duration)",
|
|
258
|
+
"example": "medium"
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
"critical_path": {
|
|
263
|
+
"type": "array",
|
|
264
|
+
"description": "The longest dependency chain — modules that block everything else",
|
|
265
|
+
"items": {
|
|
266
|
+
"module_id": {
|
|
267
|
+
"type": "string",
|
|
268
|
+
"example": "auth"
|
|
269
|
+
},
|
|
270
|
+
"blocks": {
|
|
271
|
+
"type": "array",
|
|
272
|
+
"description": "What this module blocks on the critical path",
|
|
273
|
+
"items": { "type": "string" },
|
|
274
|
+
"example": ["billing"]
|
|
275
|
+
},
|
|
276
|
+
"estimated_complexity": {
|
|
277
|
+
"type": "string",
|
|
278
|
+
"enum": ["low", "medium", "high"],
|
|
279
|
+
"example": "medium"
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
"sequencing_rationale": {
|
|
284
|
+
"type": "string",
|
|
285
|
+
"description": "Human-readable explanation of how the sequence was determined",
|
|
286
|
+
"example": "Sequence determined by: 1) topological sort of module dependency graph, 2) must-story ratio as tiebreaker, 3) dependency fan-out (modules that unblock the most others go first). Critical path: auth -> billing -> reports."
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## Dependencies
|
|
294
|
+
|
|
295
|
+
| Depends On | Agent | Artifact | Why |
|
|
296
|
+
|---|---|---|---|
|
|
297
|
+
| input | `architect_reconcile` | `module_flow.json` (per module) | Cross-module dependencies for topological sorting |
|
|
298
|
+
| input | `user_stories` | `user_stories_{module_id}.json` (per module) | Story priorities for tiebreaking and complexity estimation |
|
|
299
|
+
| input | `architect_reconcile` | `traceability.json` | Chain completeness affects module readiness |
|
|
300
|
+
| input | `decision_pack` | `decisions.json` | User decisions may affect module dependencies or priorities |
|
|
301
|
+
|
|
302
|
+
| Blocks | Agent | Why |
|
|
303
|
+
|---|---|---|
|
|
304
|
+
| output | `impl_prep` | Implementation prep uses the sequence to set up project structure in dependency order |
|
|
305
|
+
| output | `pre_code_analysis` | Pre-code analysis uses the sequence to know which module to analyze first |
|
|
306
|
+
| output | `orchestrator` | Orchestrator uses the sequence to trigger implementation agents in order |
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## Orchestrator Communication
|
|
311
|
+
|
|
312
|
+
> Reference: `v2/architecture/agent-orchestrator-communication.md`
|
|
313
|
+
|
|
314
|
+
### Agent Identity
|
|
315
|
+
|
|
316
|
+
This agent's ID is `module_sequencer`. Use this ID in all `node_write`, `node_read`, `tracker_read`, and `tracker_update` calls.
|
|
317
|
+
|
|
318
|
+
### Tracker Access
|
|
319
|
+
|
|
320
|
+
| Direction | Compressed Keys | Purpose |
|
|
321
|
+
|---|---|---|
|
|
322
|
+
| read | `md.a` | Read active modules to know which modules to sequence |
|
|
323
|
+
| write | `ag` | Report agent status (completed/failed) |
|
|
324
|
+
|
|
325
|
+
### Output Meta
|
|
326
|
+
|
|
327
|
+
This agent may produce sequencing metadata (module order, parallel groups) stored in `agent_output_meta` for orchestrator consumption.
|
|
328
|
+
|
|
329
|
+
### Completion Signal
|
|
330
|
+
|
|
331
|
+
- **On success:** `tracker_update(agent_id: "module_sequencer", status: "completed")`
|
|
332
|
+
- **On failure:** `tracker_update(agent_id: "module_sequencer", status: "failed", add_intervention: { id: "...", agent_id: "module_sequencer", type: "error", message: "..." })`
|
|
333
|
+
|
|
334
|
+
### Scope Resolution
|
|
335
|
+
|
|
336
|
+
Global agent — runs once across all modules. Reads `md.a` from tracker via `tracker_read` to know which modules to include in sequencing.
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## Compressed Keymap
|
|
341
|
+
|
|
342
|
+
Use these compressed keys in all `node_write` calls. The registry validates against this map — unknown keys are rejected.
|
|
343
|
+
|
|
344
|
+
**module_priority_sequence.json**
|
|
345
|
+
|
|
346
|
+
| Key | Full Name | Description |
|
|
347
|
+
|---|---|---|
|
|
348
|
+
| `ga` | generated_at | Timestamp of generation |
|
|
349
|
+
| `tm` | total_modules | Total number of modules sequenced |
|
|
350
|
+
| `sq` | sequence | Ordered array of module sequence entries |
|
|
351
|
+
| `sq.or` | order | Execution order position (1-based) |
|
|
352
|
+
| `sq.m` | module_id | Module identifier |
|
|
353
|
+
| `sq.rn` | reason | Rationale for this position |
|
|
354
|
+
| `sq.dp` | dependencies | Modules this module depends on |
|
|
355
|
+
| `sq.dt` | dependents | Modules that depend on this module |
|
|
356
|
+
| `sq.ec` | estimated_complexity | Estimated complexity score |
|
|
357
|
+
| `sq.cf` | complexity_factors | Complexity factor breakdown object |
|
|
358
|
+
| `sq.cf.sc` | screen_count | Number of screens in module |
|
|
359
|
+
| `sq.cf.ep` | endpoint_count | Number of endpoints in module |
|
|
360
|
+
| `sq.cf.mc` | model_count | Number of DB models in module |
|
|
361
|
+
| `sq.cf.ms` | must_story_count | Number of must-have stories |
|
|
362
|
+
| `sq.cf.ic` | integration_count | Number of external integrations |
|
|
363
|
+
| `sq.cf.cd` | cross_module_dep_count | Number of cross-module dependencies |
|
|
364
|
+
| `sq.cp` | is_on_critical_path | Whether module is on critical path |
|
|
365
|
+
| `pg` | parallel_groups | Array of parallelizable module groups |
|
|
366
|
+
| `pg.gi` | group_id | Group identifier |
|
|
367
|
+
| `pg.ms` | modules | Modules in this parallel group |
|
|
368
|
+
| `pg.pm` | prerequisites_met | Prerequisites completed before group |
|
|
369
|
+
| `pg.gc` | estimated_group_complexity | Combined group complexity |
|
|
370
|
+
| `cp` | critical_path | Ordered critical path array |
|
|
371
|
+
| `cp.m` | module_id | Module on critical path |
|
|
372
|
+
| `cp.bl` | blocks | What this module blocks |
|
|
373
|
+
| `cp.ec` | estimated_complexity | Complexity of this critical path node |
|
|
374
|
+
| `sr` | sequencing_rationale | Overall sequencing rationale text |
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
## Tools Required
|
|
379
|
+
|
|
380
|
+
| Tool | Purpose | Exists? |
|
|
381
|
+
|---|---|---|
|
|
382
|
+
| `node_write` | Write sequencing output via registry-validated compressed keys. Agent calls `node_write(agent_id: "module_sequencer", output_key: "sequence", data: {...})`. | Pending |
|
|
383
|
+
| `node_read` | Read upstream artifacts (module_flow, story_priority, traceability, decisions). Agent calls `node_read(agent_id: "module_sequencer", input_key: "module_flow", unit_id: "{module_id}")`. | Pending |
|
|
384
|
+
| `tracker_read` | Read active modules. Agent calls `tracker_read(agent_id: "module_sequencer", fields: ["md.a"])`. | Pending |
|
|
385
|
+
| `tracker_update` | Report completion/failure. Agent calls `tracker_update(agent_id: "module_sequencer", status: "completed")`. | Pending |
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
## Guardrails
|
|
390
|
+
|
|
391
|
+
### Rules
|
|
392
|
+
|
|
393
|
+
| ID | Category | Severity | Rule |
|
|
394
|
+
|---|---|---|---|
|
|
395
|
+
| R-001 | `constraint` | `must` | Must respect cross-module dependencies. If module A depends on module B, B must appear before A in the sequence. |
|
|
396
|
+
| R-002 | `constraint` | `must` | Must identify the critical path — the longest chain of sequential dependencies that determines minimum build time. |
|
|
397
|
+
| R-003 | `constraint` | `must` | Must group independent modules into parallel_groups. Modules with no interdependencies should be grouped for simultaneous execution. |
|
|
398
|
+
| R-004 | `constraint` | `must` | Must detect circular dependencies and report them as errors. Circular deps make topological sorting impossible. |
|
|
399
|
+
| R-005 | `output_quality` | `must` | Every module in modules_registry.json must appear exactly once in the sequence. No module may be omitted or duplicated. |
|
|
400
|
+
| R-006 | `output_quality` | `must` | Each sequence entry must include reason, dependencies, dependents, and estimated_complexity. No empty fields. |
|
|
401
|
+
| R-007 | `scope_boundary` | `should` | When two modules have no dependency relationship, the one with more "must" priority stories should go first. |
|
|
402
|
+
| R-008 | `output_quality` | `should` | Modules that unblock the most dependents (highest fan-out) should be prioritized as tiebreakers. |
|
|
403
|
+
| R-009 | `interaction` | `may` | May present the sequence to the user for confirmation if the sequencing_rationale involves subjective trade-offs. |
|
|
404
|
+
| R-010 | `data_handling` | `must` | Must use decisions.json to adjust dependencies or priorities if user decisions changed module relationships. |
|
|
405
|
+
| 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. |
|
|
406
|
+
| 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. |
|
|
407
|
+
| R-013 | `constraint` | `must` | Must call `tracker_update(agent_id: "module_sequencer", status: "completed")` before exiting on success. Must call `tracker_update(agent_id: "module_sequencer", status: "failed", add_intervention: {...})` before exiting on failure. |
|
|
408
|
+
| R-014 | `constraint` | `must` | Must read active modules via `tracker_read(agent_id: "module_sequencer", fields: ["md.a"])` when resolving scope. Must not hardcode module lists. |
|
|
409
|
+
|
|
410
|
+
### Limits
|
|
411
|
+
|
|
412
|
+
| Resource | Value |
|
|
413
|
+
|---|---|
|
|
414
|
+
| max_retries | 3 |
|
|
415
|
+
| max_tokens | 8192 |
|
|
416
|
+
| max_modules | 20 |
|
|
417
|
+
| timeout_seconds | 120 |
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
## Scope Boundary
|
|
422
|
+
|
|
423
|
+
**In scope:**
|
|
424
|
+
- Topological sorting of module dependency graph
|
|
425
|
+
- Estimating module complexity from quantitative metrics
|
|
426
|
+
- Identifying the critical path
|
|
427
|
+
- Grouping independent modules for parallel execution
|
|
428
|
+
- Using story priorities as tiebreakers
|
|
429
|
+
- Incorporating user decisions that affect module relationships
|
|
430
|
+
- Producing a human-readable sequencing rationale
|
|
431
|
+
|
|
432
|
+
**Out of scope:**
|
|
433
|
+
- Implementing any modules
|
|
434
|
+
- Modifying module dependencies or contracts
|
|
435
|
+
- Making architectural decisions
|
|
436
|
+
- Estimating timelines in hours or days (complexity is relative: low/medium/high)
|
|
437
|
+
- Deciding which modules to skip or defer (all modules are included)
|
|
438
|
+
- Breaking modules into smaller units
|
|
439
|
+
|
|
440
|
+
---
|
|
441
|
+
|
|
442
|
+
## Triggers
|
|
443
|
+
|
|
444
|
+
- Orchestrator activates this agent after architect_reconcile and decision_pack complete
|
|
445
|
+
- Requires module_flow.json for all modules and decisions.json to be available
|
|
446
|
+
- In retrofit mode, produces an updated sequence reflecting only the affected modules plus their dependents
|
|
447
|
+
|
|
448
|
+
---
|
|
449
|
+
|
|
450
|
+
## Checkpoints
|
|
451
|
+
|
|
452
|
+
| ID | Description | Action |
|
|
453
|
+
|---|---|---|
|
|
454
|
+
| `CP-001` | All module flows and story priorities loaded | `log` |
|
|
455
|
+
| `CP-002` | Module dependency graph constructed | `log` |
|
|
456
|
+
| `CP-003` | Circular dependency check complete | `notify` — if circular deps found, report error |
|
|
457
|
+
| `CP-004` | Topological sort complete | `log` |
|
|
458
|
+
| `CP-005` | Complexity estimates calculated for all modules | `log` |
|
|
459
|
+
| `CP-006` | Parallel groups identified | `log` |
|
|
460
|
+
| `CP-007` | Critical path identified | `notify` — critical path determines minimum build time |
|
|
461
|
+
| `CP-008` | module_priority_sequence.json written and validated | `log` |
|
|
462
|
+
|
|
463
|
+
---
|
|
464
|
+
|
|
465
|
+
## Validation Criteria
|
|
466
|
+
|
|
467
|
+
- Every module in modules_registry.json appears exactly once in sequence[]
|
|
468
|
+
- No module appears before any of its dependencies in the sequence
|
|
469
|
+
- No circular dependencies exist (if found, agent reports error and halts)
|
|
470
|
+
- parallel_groups contain only modules with no mutual dependencies
|
|
471
|
+
- critical_path represents the longest dependency chain in the graph
|
|
472
|
+
- All sequence entries have non-empty reason, dependencies, dependents, and estimated_complexity
|
|
473
|
+
- complexity_factors values are non-negative numbers
|
|
474
|
+
- parallel_groups.prerequisites_met is defined for every group
|
|
475
|
+
- sequencing_rationale is a non-empty human-readable explanation
|
|
476
|
+
|
|
477
|
+
---
|
|
478
|
+
|
|
479
|
+
## Context Sources
|
|
480
|
+
|
|
481
|
+
- module_flow.json per module (cross-module dependency data)
|
|
482
|
+
- user_stories_{module_id}.json per module (story priorities)
|
|
483
|
+
- traceability.json (chain completeness for readiness assessment)
|
|
484
|
+
- decisions.json (user decisions affecting module relationships)
|
|
485
|
+
- modules_registry.json (master list of all modules)
|
|
486
|
+
|
|
487
|
+
---
|
|
488
|
+
|
|
489
|
+
## Operation Mode
|
|
490
|
+
|
|
491
|
+
| Field | Value |
|
|
492
|
+
|---|---|
|
|
493
|
+
| Type | `autonomous` |
|
|
494
|
+
| Fallback | `none` — if sequencing fails, orchestrator cannot determine implementation order |
|
|
495
|
+
|
|
496
|
+
---
|
|
497
|
+
|
|
498
|
+
## Tool Gaps
|
|
499
|
+
|
|
500
|
+
| Gap ID | Description | Needed By | Impact Without |
|
|
501
|
+
|---|---|---|---|
|
|
502
|
+
| `TG-001` | `node_write` MCP tool not yet built | this agent | Cannot write output with registry validation -- blocked |
|
|
503
|
+
| `TG-002` | `node_read` MCP tool not yet built | this agent | Cannot read upstream artifacts with field enforcement -- blocked |
|
|
504
|
+
| `TG-003` | `tracker_read` MCP tool not yet built | this agent | Cannot read active modules -- blocked |
|
|
505
|
+
| `TG-004` | `tracker_update` MCP tool not yet built | this agent | Cannot report completion -- blocked |
|
|
506
|
+
| `TG-005` | Dependency graph topological sorter that handles DAG validation, cycle detection, and produces a valid linear ordering | this agent | Would need to implement sorting algorithm manually; incorrect sort could cause modules to be built before their dependencies |
|
|
507
|
+
| `TG-006` | Complexity estimator that calculates relative complexity from quantitative metrics (screen count, endpoint count, model count, integration count) | this agent | Complexity estimates would be ad-hoc guesses, reducing the accuracy of parallel grouping and critical path analysis |
|
|
508
|
+
|
|
509
|
+
---
|
|
510
|
+
|
|
511
|
+
## Generation Readiness
|
|
512
|
+
|
|
513
|
+
| `generate_agent` Param | Status | Notes |
|
|
514
|
+
|---|---|---|
|
|
515
|
+
| `fileName` | ready | `module-sequencer` |
|
|
516
|
+
| `agentName` | ready | `module_sequencer` |
|
|
517
|
+
| `agentRole` | ready | "Module Build Order Optimizer with Critical Path Analysis" |
|
|
518
|
+
| `agentDescription` | ready | Full description available from Goal section |
|
|
519
|
+
| `operationMode` | ready | `autonomous`, no fallback |
|
|
520
|
+
| `goal` | ready | 3 objectives defined with priorities |
|
|
521
|
+
| `inputs` | ready | 4 inputs: module_flow.json (per module), story priorities, traceability.json, decisions.json |
|
|
522
|
+
| `guardrails` | ready | 14 rules defined across constraint, output_quality, scope_boundary, interaction, data_handling categories |
|
|
523
|
+
| `scopeBoundary` | ready | 7 in-scope items, 6 out-of-scope items |
|
|
524
|
+
| `outputFormat` | ready | JSON output with full schema for module_priority_sequence.json |
|
|
525
|
+
| `triggers` | ready | 3 triggers defined |
|
|
526
|
+
| `checkpoints` | ready | 8 checkpoints with actions |
|
|
527
|
+
| `validation` | ready | 9 validation criteria |
|
|
528
|
+
| `contextSources` | ready | 5 context sources |
|
|
529
|
+
| `metadata` | ready | phase: "8", mode: "all", granularity: "global" |
|