mustflow 2.22.46 → 2.22.47

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.
@@ -6,6 +6,7 @@ import { readUtf8FileInsideWithoutSymlinks, writeJsonFileInsideWithoutSymlinks }
6
6
  import { createVerifyCompletionVerdict, } from '../../core/completion-verdict.js';
7
7
  import { createExternalEvidenceRisks, } from '../../core/external-evidence.js';
8
8
  import { createRepeatedFailureRisks, createVerificationFailureFingerprint, updateRepeatedFailureState, } from '../../core/repeated-failure.js';
9
+ import { createVerificationPlanId } from '../../core/verification-plan-id.js';
9
10
  import { countReproEvidenceVerdictEffects, createReproEvidenceRisks, } from '../../core/repro-evidence.js';
10
11
  import { createVerifyEvidenceModel } from '../../core/verification-evidence.js';
11
12
  import { createScopeDiffRisks } from '../../core/scope-risk.js';
@@ -24,6 +25,9 @@ import { readLocalCommandEffectGraphs, readLocalPathSurfaces, readLocalSourceAnc
24
25
  import { resolveMustflowRoot } from '../lib/project-root.js';
25
26
  export { planErrorMessageKey, readInputFromClassificationReport } from './verify/input.js';
26
27
  const VERIFY_SCHEMA_VERSION = '1';
28
+ function hashTextSha256(content) {
29
+ return `sha256:${createHash('sha256').update(content).digest('hex')}`;
30
+ }
27
31
  function createBufferedOutput() {
28
32
  const stdout = [];
29
33
  const stderr = [];
@@ -569,49 +573,6 @@ function readPreviousVerifyLatestSummary(projectRoot) {
569
573
  return null;
570
574
  }
571
575
  }
572
- function hashTextSha256(content) {
573
- return `sha256:${createHash('sha256').update(content).digest('hex')}`;
574
- }
575
- function stableJson(value) {
576
- if (Array.isArray(value)) {
577
- return `[${value.map((entry) => stableJson(entry)).join(',')}]`;
578
- }
579
- if (value && typeof value === 'object') {
580
- const record = value;
581
- return `{${Object.keys(record)
582
- .sort((left, right) => left.localeCompare(right))
583
- .map((key) => `${JSON.stringify(key)}:${stableJson(record[key])}`)
584
- .join(',')}}`;
585
- }
586
- return JSON.stringify(value) ?? 'null';
587
- }
588
- function getCandidateIntentNames(report) {
589
- return [...new Set(report.candidates.map((candidate) => candidate.intent).filter((intent) => Boolean(intent)))]
590
- .sort((left, right) => left.localeCompare(right));
591
- }
592
- function createVerificationPlanId(report, contract) {
593
- const relatedIntents = Object.fromEntries(getCandidateIntentNames(report).map((intent) => [intent, contract.intents[intent] ?? null]));
594
- const fingerprintSource = {
595
- schema_version: '1',
596
- algorithm: 'mustflow.verify_plan_id.v1',
597
- report: {
598
- source: report.source,
599
- files: report.files,
600
- classification_summary: report.classification_summary,
601
- requirements: report.requirements,
602
- candidates: report.candidates,
603
- gaps: report.gaps,
604
- schedule: report.schedule,
605
- test_selection: report.test_selection,
606
- },
607
- command_contract: {
608
- defaults: contract.defaults,
609
- resources: contract.resources,
610
- intents: relatedIntents,
611
- },
612
- };
613
- return hashTextSha256(stableJson(fingerprintSource));
614
- }
615
576
  function toParallelismReport(settings) {
616
577
  return {
617
578
  requested: settings.requested,
@@ -24,6 +24,7 @@ export const enMessages = {
24
24
  "value.missing": "missing",
25
25
  "value.passed": "passed",
26
26
  "value.failed": "failed",
27
+ "command.api.summary": "Print stable machine-readable API reports for agents",
27
28
  "command.adapters.summary": "Inspect host adapter compatibility without generating adapter files",
28
29
  "command.init.summary": "Copy the default mustflow agent workflow",
29
30
  "command.check.summary": "Validate mustflow files",
@@ -86,6 +87,18 @@ export const enMessages = {
86
87
  "context.help.option.cacheProfile": "Print a prompt-cache profile: stable, task, volatile, or all",
87
88
  "context.help.exit.ok": "Context was inspected and printed",
88
89
  "context.title": "mustflow context",
90
+ "api.help.summary": "Print stable machine-readable API reports for the current mustflow root.",
91
+ "api.help.action.workspaceSummary": "Print a read-only workspace briefing for coding agents",
92
+ "api.help.action.commandCatalog": "Print command intent availability without exposing raw command execution strings",
93
+ "api.help.action.verificationPlan": "Print a read-only verification plan for changed files",
94
+ "api.help.action.latestEvidence": "Print bounded latest run or verify evidence for agents",
95
+ "api.help.action.diffRisk": "Print a compact changed-file risk and verification summary",
96
+ "api.help.action.health": "Print a compact workspace health summary",
97
+ "api.help.exit.ok": "The API report was inspected and printed",
98
+ "api.error.missingAction": "Specify an api action: workspace-summary, command-catalog, verification-plan, latest-evidence, diff-risk, or health",
99
+ "api.error.unknownAction": "Unknown api action: {action}",
100
+ "api.error.actionRequiresJson": "{action} requires --json",
101
+ "api.error.actionRequiresChanged": "{action} currently requires --changed",
89
102
  "label.installed": "Installed",
90
103
  "label.mustflowRoot": "mustflow root",
91
104
  "label.commandContract": "Command specification",
@@ -24,6 +24,7 @@ export const esMessages = {
24
24
  "value.missing": "faltante",
25
25
  "value.passed": "superado",
26
26
  "value.failed": "fallido",
27
+ "command.api.summary": "Imprime informes API estables legibles por máquinas para agentes",
27
28
  "command.adapters.summary": "Inspecciona compatibilidad de adaptadores sin generar archivos",
28
29
  "command.init.summary": "Copia el flujo de trabajo de agente mustflow predeterminado",
29
30
  "command.check.summary": "Valida los archivos mustflow",
@@ -86,6 +87,18 @@ export const esMessages = {
86
87
  "context.help.option.cacheProfile": "Imprime un perfil de caché de prompt: stable, task, volatile o all",
87
88
  "context.help.exit.ok": "El contexto se inspeccionó e imprimió",
88
89
  "context.title": "contexto mustflow",
90
+ "api.help.summary": "Imprime informes API estables legibles por máquinas para la raíz mustflow actual.",
91
+ "api.help.action.workspaceSummary": "Imprime un briefing de workspace de solo lectura para agentes de código",
92
+ "api.help.action.commandCatalog": "Imprime disponibilidad de intents de comandos sin exponer cadenas de ejecución sin procesar",
93
+ "api.help.action.verificationPlan": "Imprime un verification plan de solo lectura para archivos cambiados",
94
+ "api.help.action.latestEvidence": "Imprime evidencia bounded del último run o verify para agentes",
95
+ "api.help.action.diffRisk": "Imprime un resumen compacto de riesgo y verificación para archivos cambiados",
96
+ "api.help.action.health": "Imprime un resumen compacto de salud del workspace",
97
+ "api.help.exit.ok": "El informe API se inspeccionó e imprimió",
98
+ "api.error.missingAction": "Especifica una acción api: workspace-summary, command-catalog, verification-plan, latest-evidence, diff-risk o health",
99
+ "api.error.unknownAction": "Acción api desconocida: {action}",
100
+ "api.error.actionRequiresJson": "{action} requiere --json",
101
+ "api.error.actionRequiresChanged": "{action} actualmente requiere --changed",
89
102
  "label.installed": "Instalado",
90
103
  "label.mustflowRoot": "raíz mustflow",
91
104
  "label.commandContract": "Especificación de comandos",
@@ -24,6 +24,7 @@ export const frMessages = {
24
24
  "value.missing": "manquant",
25
25
  "value.passed": "réussi",
26
26
  "value.failed": "échoué",
27
+ "command.api.summary": "Imprime des rapports API stables lisibles par machine pour les agents",
27
28
  "command.adapters.summary": "Inspecte la compatibilité des adaptateurs sans générer de fichiers",
28
29
  "command.init.summary": "Copie le flux de travail d'agent mustflow par défaut",
29
30
  "command.check.summary": "Valide les fichiers mustflow",
@@ -86,6 +87,18 @@ export const frMessages = {
86
87
  "context.help.option.cacheProfile": "Imprime un profil de cache de prompt : stable, task, volatile ou all",
87
88
  "context.help.exit.ok": "Le contexte a été inspecté et imprimé",
88
89
  "context.title": "contexte mustflow",
90
+ "api.help.summary": "Imprime des rapports API stables lisibles par machine pour la racine mustflow actuelle.",
91
+ "api.help.action.workspaceSummary": "Imprime un briefing de workspace en lecture seule pour les agents de code",
92
+ "api.help.action.commandCatalog": "Affiche la disponibilité des intents de commande sans exposer les chaînes d'exécution brutes",
93
+ "api.help.action.verificationPlan": "Affiche un verification plan en lecture seule pour les fichiers modifiés",
94
+ "api.help.action.latestEvidence": "Affiche les dernières preuves bounded de run ou verify pour les agents",
95
+ "api.help.action.diffRisk": "Affiche un résumé compact du risque et de la vérification des fichiers modifiés",
96
+ "api.help.action.health": "Affiche un résumé compact de santé du workspace",
97
+ "api.help.exit.ok": "Le rapport API a été inspecté et imprimé",
98
+ "api.error.missingAction": "Indiquez une action api : workspace-summary, command-catalog, verification-plan, latest-evidence, diff-risk ou health",
99
+ "api.error.unknownAction": "Action api inconnue : {action}",
100
+ "api.error.actionRequiresJson": "{action} exige --json",
101
+ "api.error.actionRequiresChanged": "{action} exige actuellement --changed",
89
102
  "label.installed": "Installé",
90
103
  "label.mustflowRoot": "racine mustflow",
91
104
  "label.commandContract": "Spécification des commandes",
@@ -24,6 +24,7 @@ export const hiMessages = {
24
24
  "value.missing": "गुम",
25
25
  "value.passed": "पास",
26
26
  "value.failed": "फेल",
27
+ "command.api.summary": "एजेंटों के लिए स्थिर machine-readable API रिपोर्ट प्रिंट करें",
27
28
  "command.adapters.summary": "एडाप्टर फ़ाइलें बनाए बिना होस्ट संगतता जाँचें",
28
29
  "command.init.summary": "डिफ़ॉल्ट mustflow एजेंट वर्कफ़्लो कॉपी करें",
29
30
  "command.check.summary": "mustflow फ़ाइलों की जाँच करें",
@@ -86,6 +87,18 @@ export const hiMessages = {
86
87
  "context.help.option.cacheProfile": "prompt cache profile प्रिंट करें: stable, task, volatile, या all",
87
88
  "context.help.exit.ok": "संदर्भ जाँचा और प्रिंट किया गया",
88
89
  "context.title": "mustflow संदर्भ",
90
+ "api.help.summary": "वर्तमान mustflow रूट के लिए स्थिर machine-readable API रिपोर्ट प्रिंट करें।",
91
+ "api.help.action.workspaceSummary": "कोडिंग एजेंटों के लिए read-only workspace briefing प्रिंट करें",
92
+ "api.help.action.commandCatalog": "raw command execution strings दिखाए बिना command intent availability प्रिंट करें",
93
+ "api.help.action.verificationPlan": "बदली गई फ़ाइलों के लिए read-only verification plan प्रिंट करें",
94
+ "api.help.action.latestEvidence": "agents के लिए bounded latest run या verify evidence प्रिंट करें",
95
+ "api.help.action.diffRisk": "बदली गई files के लिए compact risk और verification summary प्रिंट करें",
96
+ "api.help.action.health": "workspace health की compact summary प्रिंट करें",
97
+ "api.help.exit.ok": "API रिपोर्ट जाँची और प्रिंट की गई",
98
+ "api.error.missingAction": "api action बताएँ: workspace-summary, command-catalog, verification-plan, latest-evidence, diff-risk, या health",
99
+ "api.error.unknownAction": "अज्ञात api action: {action}",
100
+ "api.error.actionRequiresJson": "{action} के लिए --json चाहिए",
101
+ "api.error.actionRequiresChanged": "{action} को अभी --changed चाहिए",
89
102
  "label.installed": "इंस्टॉल किया गया",
90
103
  "label.mustflowRoot": "mustflow रूट",
91
104
  "label.commandContract": "कमांड विनिर्देश",
@@ -24,6 +24,7 @@ export const koMessages = {
24
24
  "value.missing": "없음",
25
25
  "value.passed": "통과",
26
26
  "value.failed": "실패",
27
+ "command.api.summary": "에이전트용 안정적 JSON API 보고서를 출력합니다",
27
28
  "command.adapters.summary": "어댑터 파일을 만들지 않고 호스트 호환성을 확인합니다",
28
29
  "command.init.summary": "기본 mustflow 에이전트 워크플로우를 복사합니다",
29
30
  "command.check.summary": "mustflow 파일을 검사합니다",
@@ -86,6 +87,18 @@ export const koMessages = {
86
87
  "context.help.option.cacheProfile": "프롬프트 캐시 프로필을 출력합니다: stable, task, volatile, all",
87
88
  "context.help.exit.ok": "맥락을 확인하고 출력했습니다",
88
89
  "context.title": "mustflow 맥락",
90
+ "api.help.summary": "현재 mustflow 루트의 안정적 JSON API 보고서를 출력합니다.",
91
+ "api.help.action.workspaceSummary": "코딩 에이전트용 읽기 전용 workspace briefing을 출력합니다",
92
+ "api.help.action.commandCatalog": "원본 실행 문자열을 노출하지 않고 command intent 실행 가능성을 출력합니다",
93
+ "api.help.action.verificationPlan": "변경 파일에 대한 읽기 전용 verification plan을 출력합니다",
94
+ "api.help.action.latestEvidence": "에이전트용 bounded 최신 run 또는 verify evidence를 출력합니다",
95
+ "api.help.action.diffRisk": "변경 파일 risk와 verification 요약을 작게 출력합니다",
96
+ "api.help.action.health": "workspace health 요약을 작게 출력합니다",
97
+ "api.help.exit.ok": "API 보고서를 확인하고 출력했습니다",
98
+ "api.error.missingAction": "api 작업을 지정하세요: workspace-summary, command-catalog, verification-plan, latest-evidence, diff-risk 또는 health",
99
+ "api.error.unknownAction": "알 수 없는 api 작업: {action}",
100
+ "api.error.actionRequiresJson": "{action}에는 --json이 필요합니다",
101
+ "api.error.actionRequiresChanged": "{action}은 현재 --changed가 필요합니다",
89
102
  "label.installed": "설치됨",
90
103
  "label.mustflowRoot": "mustflow 루트",
91
104
  "label.commandContract": "명령 계약",
@@ -24,6 +24,7 @@ export const zhMessages = {
24
24
  "value.missing": "缺失",
25
25
  "value.passed": "通过",
26
26
  "value.failed": "失败",
27
+ "command.api.summary": "为代理输出稳定的机器可读 API 报告",
27
28
  "command.adapters.summary": "不生成适配器文件,检查宿主兼容性",
28
29
  "command.init.summary": "复制默认的 mustflow 代理工作流",
29
30
  "command.check.summary": "验证 mustflow 文件",
@@ -86,6 +87,18 @@ export const zhMessages = {
86
87
  "context.help.option.cacheProfile": "输出提示缓存配置文件:stable、task、volatile 或 all",
87
88
  "context.help.exit.ok": "已检查并输出上下文",
88
89
  "context.title": "mustflow 上下文",
90
+ "api.help.summary": "为当前 mustflow 根目录输出稳定的机器可读 API 报告。",
91
+ "api.help.action.workspaceSummary": "为代码代理输出只读 workspace 简报",
92
+ "api.help.action.commandCatalog": "输出命令 intent 可用性,但不暴露原始执行字符串",
93
+ "api.help.action.verificationPlan": "为已变更文件输出只读 verification plan",
94
+ "api.help.action.latestEvidence": "为代理输出 bounded 最新 run 或 verify evidence",
95
+ "api.help.action.diffRisk": "为已变更文件输出紧凑 risk 和 verification 摘要",
96
+ "api.help.action.health": "输出紧凑 workspace health 摘要",
97
+ "api.help.exit.ok": "已检查并输出 API 报告",
98
+ "api.error.missingAction": "请指定 api 操作:workspace-summary、command-catalog、verification-plan、latest-evidence、diff-risk 或 health",
99
+ "api.error.unknownAction": "未知 api 操作:{action}",
100
+ "api.error.actionRequiresJson": "{action} 需要 --json",
101
+ "api.error.actionRequiresChanged": "{action} 当前需要 --changed",
89
102
  "label.installed": "已安装",
90
103
  "label.mustflowRoot": "mustflow 根目录",
91
104
  "label.commandContract": "命令规范",
package/dist/cli/index.js CHANGED
@@ -23,6 +23,7 @@ function getTopLevelHelp(lang) {
23
23
  ],
24
24
  examples: [
25
25
  'mf --lang ko help',
26
+ 'mf api workspace-summary --json',
26
27
  'mf adapters status --json',
27
28
  'mf init --dry-run',
28
29
  'mf doctor --json',
@@ -1,4 +1,10 @@
1
1
  export const COMMAND_DEFINITIONS = [
2
+ {
3
+ id: 'api',
4
+ usage: 'mf api',
5
+ summaryKey: 'command.api.summary',
6
+ loadRunner: async () => (await import('../commands/api.js')).runApi,
7
+ },
2
8
  {
3
9
  id: 'adapters',
4
10
  usage: 'mf adapters',
@@ -23,6 +23,54 @@ const PUBLIC_JSON_SCHEMA_CONTRACTS = [
23
23
  documented: true,
24
24
  installedCommand: ['mf', 'context', '--json'],
25
25
  },
26
+ {
27
+ id: 'workspace-summary',
28
+ schemaFile: 'workspace-summary.schema.json',
29
+ producer: 'mf api workspace-summary --json',
30
+ packaged: true,
31
+ documented: true,
32
+ installedCommand: ['mf', 'api', 'workspace-summary', '--json'],
33
+ },
34
+ {
35
+ id: 'command-catalog',
36
+ schemaFile: 'command-catalog.schema.json',
37
+ producer: 'mf api command-catalog --json',
38
+ packaged: true,
39
+ documented: true,
40
+ installedCommand: ['mf', 'api', 'command-catalog', '--json'],
41
+ },
42
+ {
43
+ id: 'verification-plan',
44
+ schemaFile: 'verification-plan.schema.json',
45
+ producer: 'mf api verification-plan --changed --json',
46
+ packaged: true,
47
+ documented: true,
48
+ installedCommand: ['mf', 'api', 'verification-plan', '--changed', '--json'],
49
+ },
50
+ {
51
+ id: 'latest-evidence',
52
+ schemaFile: 'latest-evidence.schema.json',
53
+ producer: 'mf api latest-evidence --json',
54
+ packaged: true,
55
+ documented: true,
56
+ installedCommand: ['mf', 'api', 'latest-evidence', '--json'],
57
+ },
58
+ {
59
+ id: 'diff-risk',
60
+ schemaFile: 'diff-risk.schema.json',
61
+ producer: 'mf api diff-risk --changed --json',
62
+ packaged: true,
63
+ documented: true,
64
+ installedCommand: ['mf', 'api', 'diff-risk', '--changed', '--json'],
65
+ },
66
+ {
67
+ id: 'health',
68
+ schemaFile: 'health.schema.json',
69
+ producer: 'mf api health --json',
70
+ packaged: true,
71
+ documented: true,
72
+ installedCommand: ['mf', 'api', 'health', '--json'],
73
+ },
26
74
  {
27
75
  id: 'run-receipt',
28
76
  schemaFile: 'run-receipt.schema.json',
@@ -0,0 +1,44 @@
1
+ import { createHash } from 'node:crypto';
2
+ function hashTextSha256(content) {
3
+ return `sha256:${createHash('sha256').update(content).digest('hex')}`;
4
+ }
5
+ function stableJson(value) {
6
+ if (Array.isArray(value)) {
7
+ return `[${value.map((entry) => stableJson(entry)).join(',')}]`;
8
+ }
9
+ if (value && typeof value === 'object') {
10
+ const record = value;
11
+ return `{${Object.keys(record)
12
+ .sort((left, right) => left.localeCompare(right))
13
+ .map((key) => `${JSON.stringify(key)}:${stableJson(record[key])}`)
14
+ .join(',')}}`;
15
+ }
16
+ return JSON.stringify(value) ?? 'null';
17
+ }
18
+ function getCandidateIntentNames(report) {
19
+ return [...new Set(report.candidates.map((candidate) => candidate.intent).filter((intent) => Boolean(intent)))]
20
+ .sort((left, right) => left.localeCompare(right));
21
+ }
22
+ export function createVerificationPlanId(report, contract) {
23
+ const relatedIntents = Object.fromEntries(getCandidateIntentNames(report).map((intent) => [intent, contract.intents[intent] ?? null]));
24
+ const fingerprintSource = {
25
+ schema_version: '1',
26
+ algorithm: 'mustflow.verify_plan_id.v1',
27
+ report: {
28
+ source: report.source,
29
+ files: report.files,
30
+ classification_summary: report.classification_summary,
31
+ requirements: report.requirements,
32
+ candidates: report.candidates,
33
+ gaps: report.gaps,
34
+ schedule: report.schedule,
35
+ test_selection: report.test_selection,
36
+ },
37
+ command_contract: {
38
+ defaults: contract.defaults,
39
+ resources: contract.resources,
40
+ intents: relatedIntents,
41
+ },
42
+ };
43
+ return hashTextSha256(stableJson(fingerprintSource));
44
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mustflow",
3
- "version": "2.22.46",
3
+ "version": "2.22.47",
4
4
  "description": "Agent workflow documents and CLI for mustflow repository roots.",
5
5
  "type": "module",
6
6
  "license": "MIT-0",
package/schemas/README.md CHANGED
@@ -8,6 +8,12 @@ Current schemas:
8
8
  - `doctor-report.schema.json`: output of `mf doctor --json`
9
9
  - `adapter-compatibility-report.schema.json`: output of `mf adapters status --json`
10
10
  - `context-report.schema.json`: output of `mf context --json`
11
+ - `workspace-summary.schema.json`: output of `mf api workspace-summary --json`
12
+ - `command-catalog.schema.json`: output of `mf api command-catalog --json`
13
+ - `verification-plan.schema.json`: output of `mf api verification-plan --changed --json`
14
+ - `latest-evidence.schema.json`: output of `mf api latest-evidence --json`
15
+ - `diff-risk.schema.json`: output of `mf api diff-risk --changed --json`
16
+ - `health.schema.json`: output of `mf api health --json`
11
17
  - `run-receipt.schema.json`: output of `mf run <intent> --json` and `.mustflow/state/runs/latest.json`,
12
18
  including bounded declared-write drift metadata, a safe latest-run performance summary, and optional
13
19
  structured phase timings and selection summaries
@@ -0,0 +1,158 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mustflow.github.io/schemas/command-catalog.schema.json",
4
+ "title": "mustflow command catalog API report",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "command",
10
+ "mustflow_root",
11
+ "command_contract",
12
+ "execution_policy",
13
+ "intents",
14
+ "issues"
15
+ ],
16
+ "properties": {
17
+ "schema_version": { "const": "1" },
18
+ "command": { "const": "api command-catalog" },
19
+ "mustflow_root": { "type": "string" },
20
+ "command_contract": { "$ref": "#/$defs/commandContract" },
21
+ "execution_policy": { "$ref": "#/$defs/executionPolicy" },
22
+ "intents": {
23
+ "type": "array",
24
+ "items": { "$ref": "#/$defs/intent" }
25
+ },
26
+ "issues": {
27
+ "type": "array",
28
+ "items": { "type": "string" }
29
+ }
30
+ },
31
+ "$defs": {
32
+ "commandContract": {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": ["path", "exists", "parse_error", "total_intents", "runnable_count", "blocked_count"],
36
+ "properties": {
37
+ "path": { "const": ".mustflow/config/commands.toml" },
38
+ "exists": { "type": "boolean" },
39
+ "parse_error": { "type": ["string", "null"] },
40
+ "total_intents": { "type": "integer", "minimum": 0 },
41
+ "runnable_count": { "type": "integer", "minimum": 0 },
42
+ "blocked_count": { "type": "integer", "minimum": 0 }
43
+ }
44
+ },
45
+ "executionPolicy": {
46
+ "type": "object",
47
+ "additionalProperties": false,
48
+ "required": [
49
+ "command_authority",
50
+ "run_entrypoint",
51
+ "preview_entrypoint",
52
+ "direct_commands_allowed",
53
+ "requires_configured_oneshot_agent_allowed"
54
+ ],
55
+ "properties": {
56
+ "command_authority": { "const": ".mustflow/config/commands.toml" },
57
+ "run_entrypoint": { "const": "mf run <intent>" },
58
+ "preview_entrypoint": { "const": "mf run <intent> --dry-run --json" },
59
+ "direct_commands_allowed": { "const": false },
60
+ "requires_configured_oneshot_agent_allowed": { "const": true }
61
+ }
62
+ },
63
+ "intent": {
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "required": [
67
+ "name",
68
+ "description",
69
+ "kind",
70
+ "status",
71
+ "lifecycle",
72
+ "run_policy",
73
+ "runnable",
74
+ "reason_code",
75
+ "detail",
76
+ "run_command",
77
+ "preview_command",
78
+ "mode",
79
+ "cwd",
80
+ "timeout_seconds",
81
+ "kill_after_seconds",
82
+ "max_output_bytes",
83
+ "success_exit_codes",
84
+ "required_after",
85
+ "writes",
86
+ "effect_count",
87
+ "network",
88
+ "destructive",
89
+ "accepts_test_targets",
90
+ "env_policy",
91
+ "env_allowlist",
92
+ "precondition_count",
93
+ "active_lock_conflict_count",
94
+ "stale_active_lock_count",
95
+ "agent_action",
96
+ "manual_start_hint",
97
+ "health_check_url",
98
+ "stop_instruction",
99
+ "related_oneshot_checks"
100
+ ],
101
+ "properties": {
102
+ "name": { "type": "string" },
103
+ "description": { "type": ["string", "null"] },
104
+ "kind": { "type": ["string", "null"] },
105
+ "status": { "type": ["string", "null"] },
106
+ "lifecycle": { "type": ["string", "null"] },
107
+ "run_policy": { "type": ["string", "null"] },
108
+ "runnable": { "type": "boolean" },
109
+ "reason_code": { "type": ["string", "null"] },
110
+ "detail": { "type": ["string", "null"] },
111
+ "run_command": { "type": ["string", "null"] },
112
+ "preview_command": { "type": ["string", "null"] },
113
+ "mode": { "enum": ["argv", "shell", null] },
114
+ "cwd": { "type": ["string", "null"] },
115
+ "timeout_seconds": { "type": ["integer", "null"], "minimum": 1 },
116
+ "kill_after_seconds": { "type": ["integer", "null"], "minimum": 1 },
117
+ "max_output_bytes": { "type": ["integer", "null"], "minimum": 1 },
118
+ "success_exit_codes": {
119
+ "anyOf": [
120
+ { "type": "null" },
121
+ {
122
+ "type": "array",
123
+ "items": { "type": "integer", "minimum": 0 }
124
+ }
125
+ ]
126
+ },
127
+ "required_after": {
128
+ "type": "array",
129
+ "items": { "type": "string" }
130
+ },
131
+ "writes": {
132
+ "type": "array",
133
+ "items": { "type": "string" }
134
+ },
135
+ "effect_count": { "type": "integer", "minimum": 0 },
136
+ "network": { "type": ["boolean", "null"] },
137
+ "destructive": { "type": ["boolean", "null"] },
138
+ "accepts_test_targets": { "type": "boolean" },
139
+ "env_policy": { "type": ["string", "null"] },
140
+ "env_allowlist": {
141
+ "type": "array",
142
+ "items": { "type": "string" }
143
+ },
144
+ "precondition_count": { "type": "integer", "minimum": 0 },
145
+ "active_lock_conflict_count": { "type": "integer", "minimum": 0 },
146
+ "stale_active_lock_count": { "type": "integer", "minimum": 0 },
147
+ "agent_action": { "type": ["string", "null"] },
148
+ "manual_start_hint": { "type": ["string", "null"] },
149
+ "health_check_url": { "type": ["string", "null"] },
150
+ "stop_instruction": { "type": ["string", "null"] },
151
+ "related_oneshot_checks": {
152
+ "type": "array",
153
+ "items": { "type": "string" }
154
+ }
155
+ }
156
+ }
157
+ }
158
+ }
@@ -0,0 +1,74 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mustflow.github.io/schemas/diff-risk.schema.json",
4
+ "title": "mustflow diff risk API report",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "command",
10
+ "mustflow_root",
11
+ "source",
12
+ "status",
13
+ "risk_level",
14
+ "changed_file_count",
15
+ "changed_files",
16
+ "public_surface_count",
17
+ "validation_reasons",
18
+ "update_policies",
19
+ "drift_checks",
20
+ "required_verification",
21
+ "gap_count",
22
+ "gaps",
23
+ "recommended_commands",
24
+ "issues"
25
+ ],
26
+ "properties": {
27
+ "schema_version": { "const": "1" },
28
+ "command": { "const": "api diff-risk" },
29
+ "mustflow_root": { "type": "string" },
30
+ "source": { "$ref": "#/$defs/source" },
31
+ "status": { "enum": ["available", "unavailable"] },
32
+ "risk_level": { "enum": ["none", "low", "medium", "high", "unknown"] },
33
+ "changed_file_count": { "type": "integer", "minimum": 0 },
34
+ "changed_files": { "$ref": "#/$defs/stringArray" },
35
+ "public_surface_count": { "type": "integer", "minimum": 0 },
36
+ "validation_reasons": { "$ref": "#/$defs/stringArray" },
37
+ "update_policies": { "$ref": "#/$defs/stringArray" },
38
+ "drift_checks": { "$ref": "#/$defs/stringArray" },
39
+ "required_verification": { "$ref": "#/$defs/stringArray" },
40
+ "gap_count": { "type": "integer", "minimum": 0 },
41
+ "gaps": {
42
+ "type": "array",
43
+ "items": { "$ref": "#/$defs/gap" }
44
+ },
45
+ "recommended_commands": { "$ref": "#/$defs/stringArray" },
46
+ "issues": { "$ref": "#/$defs/stringArray" }
47
+ },
48
+ "$defs": {
49
+ "source": {
50
+ "type": "object",
51
+ "additionalProperties": false,
52
+ "required": ["kind", "command"],
53
+ "properties": {
54
+ "kind": { "const": "changed" },
55
+ "command": { "const": "mf verify --changed --plan-only --json" }
56
+ }
57
+ },
58
+ "stringArray": {
59
+ "type": "array",
60
+ "items": { "type": "string" }
61
+ },
62
+ "gap": {
63
+ "type": "object",
64
+ "additionalProperties": false,
65
+ "required": ["reason", "files", "surfaces", "detail"],
66
+ "properties": {
67
+ "reason": { "type": "string" },
68
+ "files": { "$ref": "#/$defs/stringArray" },
69
+ "surfaces": { "$ref": "#/$defs/stringArray" },
70
+ "detail": { "type": "string" }
71
+ }
72
+ }
73
+ }
74
+ }