trusty-mpm 1.7.7

trusty-mpm: unified multi-agent orchestration platform (core, daemon, CLI, TUI, Telegram)
Documentation
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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/bobmatnyc/trusty-tools/schemas/instruction-package-v2.json",
  "title": "trusty-mpm instruction package",
  "description": "A PM instruction package: a section taxonomy carrying the customization-tier axis, plus an ORDERED block stream that composes to the PM system prompt. Ordering is array order — never map iteration order — so composition is byte-deterministic (SPEC-PMINSTR-01 / DOC-59 §4a, epic #4183, schema ticket #4184).",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "package_id",
    "sections",
    "blocks"
  ],
  "properties": {
    "schema_version": {
      "description": "Schema major version. A package whose version this build does not implement is rejected outright — never partially interpreted; the version is checked BEFORE any field, so a newer package reports a version error rather than blaming one of its own valid keys. EVOLUTION POLICY: every object here sets `additionalProperties: false`, so unknown keys are errors, not ignored. Any field addition that can change composed bytes MUST bump this version. Adding a field while leaving the version unchanged is the one case strictness cannot protect against — an older build would compose a prompt missing the new field's effect and report success. HISTORY: v1 (#4184) shipped `text` and `generated` bodies; v2 (#4318) adds the `file` body kind so an authored JSON manifest can reference bundled markdown instead of inlining 23 KB of prose on one line.",
      "const": 2
    },
    "package_id": {
      "description": "Stable identifier for this package (e.g. `trusty-mpm/pm`). Identity only; it never affects composed bytes.",
      "type": "string",
      "minLength": 1
    },
    "description": {
      "type": "string"
    },
    "trailing_newline": {
      "description": "Append exactly one '\\n' after the last emitted block. `false` reproduces today's `resolve_pm_prompt` output; `true` reproduces a file-shaped artifact.",
      "type": "boolean",
      "default": false
    },
    "sections": {
      "description": "The section taxonomy. Declaration order MUST be the canonical order (identity, core, autonomous-execution, memory, search, workflow, agent-delegation, enforcement, non-overridable-rules, framework-guaranteed-conventions) and every canonical section MUST be declared exactly once. Declaration order does not affect composed bytes — `blocks` alone determines output order.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/section"
      },
      "minItems": 10,
      "maxItems": 10
    },
    "blocks": {
      "description": "The ordered composition stream. Emitted strictly in array order. A section may own several non-contiguous blocks, which is what lets a section be lifted out of the middle of a legacy asset without moving a single byte.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/block"
      },
      "minItems": 1
    }
  },
  "$defs": {
    "section-id": {
      "description": "The closed section taxonomy, in canonical declaration order. `core` is the only section a named-section override cannot replace (tier `fixed`); every other section is tier `project` and is replaceable (#4286). #8533 split the former `core` headings into their own sections; `core` is now the safety core.",
      "type": "string",
      "enum": [
        "identity",
        "core",
        "pm-allowlist",
        "delegation-mechanics",
        "agent-routing",
        "subagent-re-engagement",
        "phases",
        "qa-gate",
        "git-file-tracking",
        "tickets-prs-releases",
        "messages-reports-sessions",
        "autonomous-execution",
        "memory",
        "search",
        "workflow",
        "agent-delegation",
        "enforcement",
        "non-overridable-rules",
        "framework-guaranteed-conventions"
      ]
    },
    "customization-tier": {
      "description": "Who may override this section, by increasing permissiveness. `fixed`: nobody — reserved for `core`, the single protected section (#4286). `project`: a project-tier override only — deliberately NOT a user-tier one, so a personal machine config can never silently leak into a shared project. `user`: both project- and user-tier, project winning on collision (most-specific-wins).",
      "type": "string",
      "enum": [
        "fixed",
        "project",
        "user"
      ]
    },
    "generator": {
      "description": "A named composition-time input the host must supply. Generated content is never authored in the package — it is computed per project/session and passed in.",
      "type": "string",
      "enum": [
        "agent-roster",
        "stack-profile",
        "project-addendum"
      ]
    },
    "join": {
      "description": "The literal bytes inserted BEFORE this block when it is not the first emitted block. `rule` = \"\\n\\n---\\n\\n\", `blank` = \"\\n\\n\", `none` = \"\", `{\"literal\": \"...\"}` = verbatim. Explicit joins are what make a faithful, byte-identical lift possible: blocks split out of one legacy document rejoin with `blank`, while distinct legacy assets rejoin with `rule`.",
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "rule",
            "blank",
            "none"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "literal"
          ],
          "properties": {
            "literal": {
              "type": "string"
            }
          }
        }
      ]
    },
    "body": {
      "description": "Where a block's markdown comes from. `text` is authored inline in the package; `file` names a markdown source bundled with the build; `generated` is supplied at composition time by the named generator.",
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "kind",
            "text"
          ],
          "properties": {
            "kind": {
              "const": "text"
            },
            "text": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "kind",
            "path"
          ],
          "description": "Schema v2 (#4318). The path is resolved against the build's compile-time `include_str!` table (`instruction_pipeline::SECTION_SOURCES`), NOT against the filesystem at composition time — so the delivered prompt never depends on what happens to be on disk, and a renamed section is a compile error rather than a silent content drop. A path the build does not bundle is a hard validation error. Prose therefore keeps living in reviewable markdown while this document carries only the manifest; `text` remains available for a rule authored in the manifest itself.",
          "properties": {
            "kind": {
              "const": "file"
            },
            "path": {
              "description": "Path relative to `assets/instructions/`, e.g. `sections/core.md`.",
              "type": "string",
              "minLength": 1
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "kind",
            "generator"
          ],
          "properties": {
            "kind": {
              "const": "generated"
            },
            "generator": {
              "$ref": "#/$defs/generator"
            }
          }
        }
      ]
    },
    "section": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "title",
        "customization_tier"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/section-id"
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "customization_tier": {
          "$ref": "#/$defs/customization-tier"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "block": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "section",
        "body"
      ],
      "properties": {
        "section": {
          "$ref": "#/$defs/section-id"
        },
        "body": {
          "$ref": "#/$defs/body"
        },
        "join_before": {
          "$ref": "#/$defs/join",
          "default": "rule"
        },
        "optional": {
          "description": "Only a `generated` block may be optional. An optional block is dropped when its generator supplies no content; a non-optional block whose content is missing or empty is a hard composition error, never a silent drop (issue #4196 — the computed 42-agent roster was discarded at the final composition step and the prompt shipped naming 8).",
          "type": "boolean",
          "default": false
        },
        "pinned": {
          "description": "#8533: an authored block that survives a named-section override of its section — the carrier for a framework feature (agent selection, memory, code search) inside a replaceable section. Only a `text` or `file` block may be pinned.",
          "type": "boolean",
          "default": false
        }
      }
    }
  },
  "examples": [
    {
      "schema_version": 2,
      "package_id": "trusty-mpm/example",
      "description": "Minimal structurally-valid package, exercising all three body kinds. The shipped instance is `pm-instruction-package.json`; this example exists so the schema's own shape stays executable and testable.",
      "trailing_newline": false,
      "sections": [
        {
          "id": "identity",
          "title": "Identity",
          "customization_tier": "project",
          "description": "Absorbed BASE_PM `## Identity`."
        },
        {
          "id": "core",
          "title": "Core PM Instructions",
          "customization_tier": "fixed"
        },
        {
          "id": "pm-allowlist",
          "title": "pm-allowlist",
          "customization_tier": "project"
        },
        {
          "id": "delegation-mechanics",
          "title": "delegation-mechanics",
          "customization_tier": "project"
        },
        {
          "id": "agent-routing",
          "title": "agent-routing",
          "customization_tier": "project"
        },
        {
          "id": "subagent-re-engagement",
          "title": "subagent-re-engagement",
          "customization_tier": "project"
        },
        {
          "id": "phases",
          "title": "phases",
          "customization_tier": "project"
        },
        {
          "id": "qa-gate",
          "title": "qa-gate",
          "customization_tier": "project"
        },
        {
          "id": "git-file-tracking",
          "title": "git-file-tracking",
          "customization_tier": "project"
        },
        {
          "id": "tickets-prs-releases",
          "title": "tickets-prs-releases",
          "customization_tier": "project"
        },
        {
          "id": "messages-reports-sessions",
          "title": "messages-reports-sessions",
          "customization_tier": "project"
        },
        {
          "id": "autonomous-execution",
          "title": "Autonomous Execution",
          "customization_tier": "project",
          "description": "When the PM runs without stopping, and when it may stop and ask (#8361)."
        },
        {
          "id": "memory",
          "title": "Memory",
          "customization_tier": "project"
        },
        {
          "id": "search",
          "title": "Search",
          "customization_tier": "project"
        },
        {
          "id": "workflow",
          "title": "Workflow",
          "customization_tier": "project"
        },
        {
          "id": "agent-delegation",
          "title": "Agent Delegation",
          "customization_tier": "project",
          "description": "Dynamic: built from the deployed-agent roster at composition time."
        },
        {
          "id": "enforcement",
          "title": "Delegation Enforcement",
          "customization_tier": "project",
          "description": "Prohibitions + Circuit Breakers (#4573)."
        },
        {
          "id": "non-overridable-rules",
          "title": "Non-Overridable Rules",
          "customization_tier": "project",
          "description": "Absorbed BASE_PM `## Non-Overridable Rules`, `## Customizing PM Behavior`, `## Trusty Tool Priority (Non-Overridable)`."
        },
        {
          "id": "framework-guaranteed-conventions",
          "title": "Framework-Guaranteed Conventions",
          "customization_tier": "project",
          "description": "Absorbed BASE_PM `## Framework-Guaranteed Conventions (Non-Overridable)`."
        }
      ],
      "blocks": [
        {
          "section": "core",
          "body": {
            "kind": "text",
            "text": "# PM Agent -- Trusty MPM"
          }
        },
        {
          "section": "pm-allowlist",
          "join_before": "blank",
          "body": {
            "kind": "text",
            "text": "## pm-allowlist"
          }
        },
        {
          "section": "delegation-mechanics",
          "join_before": "blank",
          "body": {
            "kind": "text",
            "text": "## delegation-mechanics"
          }
        },
        {
          "section": "agent-routing",
          "join_before": "blank",
          "body": {
            "kind": "text",
            "text": "## agent-routing"
          }
        },
        {
          "section": "subagent-re-engagement",
          "join_before": "blank",
          "body": {
            "kind": "text",
            "text": "## subagent-re-engagement"
          }
        },
        {
          "section": "phases",
          "join_before": "blank",
          "body": {
            "kind": "text",
            "text": "## phases"
          }
        },
        {
          "section": "qa-gate",
          "join_before": "blank",
          "body": {
            "kind": "text",
            "text": "## qa-gate"
          }
        },
        {
          "section": "git-file-tracking",
          "join_before": "blank",
          "body": {
            "kind": "text",
            "text": "## git-file-tracking"
          }
        },
        {
          "section": "tickets-prs-releases",
          "join_before": "blank",
          "body": {
            "kind": "text",
            "text": "## tickets-prs-releases"
          }
        },
        {
          "section": "messages-reports-sessions",
          "join_before": "blank",
          "body": {
            "kind": "text",
            "text": "## messages-reports-sessions"
          }
        },
        {
          "section": "autonomous-execution",
          "join_before": "blank",
          "body": {
            "kind": "text",
            "text": "## Autonomous Execution"
          }
        },
        {
          "section": "memory",
          "join_before": "blank",
          "body": {
            "kind": "text",
            "text": "## Context-First Protocol"
          },
          "pinned": true
        },
        {
          "section": "memory",
          "join_before": "blank",
          "body": {
            "kind": "text",
            "text": "Memory elaboration."
          }
        },
        {
          "section": "core",
          "join_before": "blank",
          "body": {
            "kind": "text",
            "text": "## Agent Routing"
          }
        },
        {
          "section": "search",
          "body": {
            "kind": "text",
            "text": "## Code/Architecture Search"
          }
        },
        {
          "section": "core",
          "body": {
            "kind": "generated",
            "generator": "stack-profile"
          },
          "optional": true
        },
        {
          "section": "workflow",
          "body": {
            "kind": "text",
            "text": "# PM Workflow Configuration"
          }
        },
        {
          "section": "agent-delegation",
          "body": {
            "kind": "generated",
            "generator": "agent-roster"
          }
        },
        {
          "section": "core",
          "body": {
            "kind": "generated",
            "generator": "project-addendum"
          },
          "optional": true
        },
        {
          "section": "identity",
          "body": {
            "kind": "file",
            "path": "sections/identity.md"
          }
        },
        {
          "section": "enforcement",
          "join_before": "blank",
          "body": {
            "kind": "text",
            "text": "## Prohibitions"
          }
        },
        {
          "section": "non-overridable-rules",
          "join_before": "blank",
          "body": {
            "kind": "text",
            "text": "## Non-Overridable Rules"
          }
        },
        {
          "section": "framework-guaranteed-conventions",
          "join_before": "blank",
          "body": {
            "kind": "text",
            "text": "## Framework-Guaranteed Conventions"
          }
        }
      ]
    }
  ]
}