-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Expand file tree
/
Copy pathmco-runtime.architecture.json
More file actions
313 lines (313 loc) · 8.75 KB
/
Copy pathmco-runtime.architecture.json
File metadata and controls
313 lines (313 loc) · 8.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
{
"schema_version": 1,
"diagram_type": "architecture",
"meta": {
"title": "MCO Runtime Architecture",
"subtitle": "mco-org/mco · explicit provider policy · parallel invocation · durable raw answers",
"output": "docs/cases/mco-runtime.architecture.html",
"animation": "trace",
"visual_preset": "signal-flow",
"quality_profile": "showcase",
"repository": {
"url": "https://github.com/mco-org/mco",
"revision": "9f1a1cf1afdc04d7b5406782b40dfec76d9bc798"
},
"views": [
{
"id": "dispatch-path",
"label": "Dispatch path",
"focus": ["callers", "entry", "router", "policy", "workflow", "adapters", "provider_clis"],
"note": "An explicit provider team crosses one validated execution-policy boundary before MCO starts parallel work."
},
{
"id": "answer-evidence",
"label": "Answer evidence",
"focus": ["adapters", "answer_transport", "artifacts", "consumers"],
"note": "Provider output is decoded and persisted without turning raw answers into an automatic decision."
},
{
"id": "durable-sessions",
"label": "Durable sessions",
"focus": ["router", "session_daemon", "session_state"],
"note": "Detached local workers use Unix sockets plus state.json and history.jsonl for resumable sessions."
}
]
},
"components": [
{
"id": "callers",
"type": "external",
"label": "Callers",
"sublabel": "human · coding agent",
"pos": [5, 250],
"size": [130, 60]
},
{
"id": "entry",
"type": "frontend",
"label": "Entry Surfaces",
"sublabel": "npm shim · Python CLI · MCP",
"pos": [175, 250],
"size": [160, 60],
"sources": [
{ "path": "bin/mco.js", "line": 1, "label": "npm entry" },
{ "path": "runtime/mcp_server.py", "line": 108, "end_line": 153, "label": "MCP entry" }
]
},
{
"id": "router",
"type": "backend",
"label": "Command Router",
"sublabel": "run · review · doctor · session",
"pos": [360, 250],
"size": [180, 60],
"sources": [
{ "path": "runtime/cli.py", "line": 1945, "label": "CLI main" }
]
},
{
"id": "config",
"type": "database",
"label": "Config + Selection",
"sublabel": "files · explicit provider team",
"pos": [565, 110],
"size": [175, 60],
"tag": "no silent team",
"sources": [
{ "path": "runtime/config.py", "line": 24, "label": "Review config" }
]
},
{
"id": "policy",
"type": "security",
"label": "Execution Policy",
"sublabel": "read_only · write · yolo",
"pos": [565, 250],
"size": [175, 60],
"tag": "explicit boundary",
"sources": [
{ "path": "runtime/policy.py", "line": 34, "label": "Provider policy" }
]
},
{
"id": "workflow",
"type": "backend",
"label": "Invocation Workflow",
"sublabel": "parallel · chain · debate · synthesize",
"pos": [765, 250],
"size": [220, 60],
"sources": [
{ "path": "runtime/invocation_runtime.py", "line": 696, "label": "Workflow entry" },
{ "path": "runtime/invocation_runtime.py", "line": 156, "label": "Single invocation" }
]
},
{
"id": "adapters",
"type": "messagebus",
"label": "Provider Adapters",
"sublabel": "shim / ACP · detect · run · poll · cancel",
"pos": [1010, 250],
"size": [230, 60],
"sources": [
{ "path": "runtime/adapters/__init__.py", "line": 57, "label": "Adapter registry" },
{ "path": "runtime/contracts.py", "line": 77, "label": "Provider contract" }
]
},
{
"id": "provider_clis",
"type": "external",
"label": "Provider CLIs",
"sublabel": "Claude · Codex · Pi · 7 more",
"pos": [1035, 0],
"size": [180, 60]
},
{
"id": "answer_transport",
"type": "messagebus",
"label": "Answer Transport",
"sublabel": "plain · JSON · JSONL · ACP events",
"pos": [765, 420],
"size": [190, 60],
"sources": [
{ "path": "runtime/answer_transport.py", "line": 79, "label": "Transport decoders" }
]
},
{
"id": "artifacts",
"type": "cloud",
"label": "Invocation Artifacts",
"sublabel": "answers · result.md · run.json",
"pos": [1010, 420],
"size": [170, 60],
"tag": "raw evidence",
"sources": [
{ "path": "runtime/invocation_artifacts.py", "line": 8, "label": "Artifact writer" }
]
},
{
"id": "consumers",
"type": "external",
"label": "Output Consumers",
"sublabel": "terminal · calling agent · CI",
"pos": [1005, 520],
"size": [180, 60]
},
{
"id": "session_daemon",
"type": "backend",
"label": "Session Daemon",
"sublabel": "detached worker · Unix socket",
"pos": [365, 420],
"size": [170, 60],
"sources": [
{ "path": "runtime/session/daemon.py", "line": 50, "label": "Daemon context" }
]
},
{
"id": "session_state",
"type": "database",
"label": "Session State",
"sublabel": "state.json · history.jsonl",
"pos": [565, 420],
"size": [170, 60],
"tag": ".mco/sessions",
"sources": [
{ "path": "runtime/session/state.py", "line": 25, "label": "Session state" }
]
}
],
"boundaries": [
{
"kind": "region",
"label": "mco local package / Python runtime",
"wraps": ["entry", "router", "config", "policy", "workflow", "adapters", "answer_transport", "artifacts", "session_daemon", "session_state"]
},
{
"kind": "security-group",
"label": "explicit execution-policy boundary",
"wraps": ["policy", "workflow", "adapters"]
}
],
"connections": [
{
"id": "caller-entry",
"from": "callers",
"to": "entry",
"variant": "emphasis"
},
{
"id": "entry-route",
"from": "entry",
"to": "router",
"variant": "emphasis"
},
{
"id": "route-policy",
"from": "router",
"to": "policy",
"variant": "security"
},
{
"id": "config-policy",
"from": "config",
"to": "policy",
"variant": "security",
"fromSide": "bottom",
"toSide": "top"
},
{
"id": "policy-workflow",
"from": "policy",
"to": "workflow",
"variant": "emphasis"
},
{
"id": "workflow-adapters",
"from": "workflow",
"to": "adapters",
"variant": "emphasis"
},
{
"id": "adapters-providers",
"from": "adapters",
"to": "provider_clis",
"label": "native CLI / ACP",
"variant": "emphasis",
"fromSide": "top",
"toSide": "bottom"
},
{
"id": "adapters-answer",
"from": "adapters",
"to": "answer_transport",
"label": "decode events",
"labelAt": [995, 365],
"fromSide": "bottom",
"toSide": "top"
},
{
"id": "answer-artifacts",
"from": "answer_transport",
"to": "artifacts",
"variant": "emphasis"
},
{
"id": "artifacts-consumers",
"from": "artifacts",
"to": "consumers",
"label": "raw answers",
"labelAt": [1095, 510],
"variant": "emphasis",
"fromSide": "bottom",
"toSide": "top"
},
{
"id": "router-session",
"from": "router",
"to": "session_daemon",
"label": "start · send · resume",
"labelAt": [450, 365],
"variant": "dashed",
"fromSide": "bottom",
"toSide": "top",
"route": "straight"
},
{
"id": "session-state",
"from": "session_daemon",
"to": "session_state",
"label": "persist",
"labelAt": [550, 406],
"variant": "dashed"
}
],
"cards": [
{
"dot": "cyan",
"title": "Source-backed dispatch",
"items": [
"runtime/cli.py requires an explicit provider or named agent team",
"runtime/policy.py validates models, context, permissions, and risk",
"runtime/invocation_runtime.py owns parallelism, timeouts, and cancellation"
]
},
{
"dot": "emerald",
"title": "Raw-answer contract",
"items": [
"Adapters keep each provider CLI behind one shared runtime contract",
"answer_transport.py decodes output without inventing findings or consensus",
"Artifacts persist answers and run metadata for terminal, agents, or CI"
]
},
{
"dot": "violet",
"title": "Real repository proof",
"items": [
"Repository: github.com/mco-org/mco",
"Source snapshot: main @ 9f1a1cf",
"Evidence read: README, CLI, policy, adapters, invocation runtime, sessions"
]
}
]
}