mustflow 2.22.17 → 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.
Files changed (70) hide show
  1. package/README.md +6 -0
  2. package/dist/cli/commands/api.js +874 -0
  3. package/dist/cli/commands/dashboard.js +51 -4
  4. package/dist/cli/commands/explain.js +3 -2
  5. package/dist/cli/commands/help.js +0 -1
  6. package/dist/cli/commands/run.js +41 -4
  7. package/dist/cli/commands/verify.js +4 -43
  8. package/dist/cli/i18n/en.js +15 -0
  9. package/dist/cli/i18n/es.js +15 -0
  10. package/dist/cli/i18n/fr.js +15 -0
  11. package/dist/cli/i18n/hi.js +15 -0
  12. package/dist/cli/i18n/ko.js +15 -0
  13. package/dist/cli/i18n/zh.js +15 -0
  14. package/dist/cli/index.js +1 -0
  15. package/dist/cli/lib/cli-output.js +1 -1
  16. package/dist/cli/lib/command-registry.js +6 -0
  17. package/dist/cli/lib/dashboard-html/client-script.js +9 -0
  18. package/dist/cli/lib/dashboard-html/styles.js +48 -1
  19. package/dist/cli/lib/doc-review-ledger.js +1 -1
  20. package/dist/cli/lib/local-index/index.js +324 -298
  21. package/dist/cli/lib/repo-map.js +19 -5
  22. package/dist/cli/lib/validation/index.js +6 -2
  23. package/dist/core/active-run-locks.js +36 -8
  24. package/dist/core/atomic-state-write.js +5 -20
  25. package/dist/core/change-verification.js +18 -2
  26. package/dist/core/contract-lint.js +3 -3
  27. package/dist/core/public-json-contracts.js +48 -0
  28. package/dist/core/repeated-failure.js +1 -1
  29. package/dist/core/run-write-drift.js +30 -17
  30. package/dist/core/safe-filesystem.js +54 -5
  31. package/dist/core/skill-route-explanation.js +2 -1
  32. package/dist/core/source-anchors.js +7 -3
  33. package/dist/core/validation-ratchet.js +61 -18
  34. package/dist/core/verification-decision-graph.js +8 -1
  35. package/dist/core/verification-plan-id.js +44 -0
  36. package/package.json +1 -1
  37. package/schemas/README.md +6 -0
  38. package/schemas/command-catalog.schema.json +158 -0
  39. package/schemas/diff-risk.schema.json +74 -0
  40. package/schemas/health.schema.json +45 -0
  41. package/schemas/latest-evidence.schema.json +95 -0
  42. package/schemas/verification-plan.schema.json +245 -0
  43. package/schemas/workspace-summary.schema.json +282 -0
  44. package/templates/default/i18n.toml +139 -1
  45. package/templates/default/locales/en/.mustflow/skills/INDEX.md +24 -1
  46. package/templates/default/locales/en/.mustflow/skills/api-contract-change/SKILL.md +212 -0
  47. package/templates/default/locales/en/.mustflow/skills/astro-code-change/SKILL.md +184 -0
  48. package/templates/default/locales/en/.mustflow/skills/auth-permission-change/SKILL.md +194 -0
  49. package/templates/default/locales/en/.mustflow/skills/config-env-change/SKILL.md +189 -0
  50. package/templates/default/locales/en/.mustflow/skills/css-code-change/SKILL.md +199 -0
  51. package/templates/default/locales/en/.mustflow/skills/dart-code-change/SKILL.md +179 -0
  52. package/templates/default/locales/en/.mustflow/skills/database-migration-change/SKILL.md +178 -0
  53. package/templates/default/locales/en/.mustflow/skills/dependency-upgrade-review/SKILL.md +151 -0
  54. package/templates/default/locales/en/.mustflow/skills/elysia-code-change/SKILL.md +115 -0
  55. package/templates/default/locales/en/.mustflow/skills/file-path-cross-platform-change/SKILL.md +147 -0
  56. package/templates/default/locales/en/.mustflow/skills/flutter-code-change/SKILL.md +116 -0
  57. package/templates/default/locales/en/.mustflow/skills/go-code-change/SKILL.md +156 -0
  58. package/templates/default/locales/en/.mustflow/skills/hono-code-change/SKILL.md +117 -0
  59. package/templates/default/locales/en/.mustflow/skills/html-code-change/SKILL.md +173 -0
  60. package/templates/default/locales/en/.mustflow/skills/javascript-code-change/SKILL.md +149 -0
  61. package/templates/default/locales/en/.mustflow/skills/python-code-change/SKILL.md +154 -0
  62. package/templates/default/locales/en/.mustflow/skills/release-publish-change/SKILL.md +172 -0
  63. package/templates/default/locales/en/.mustflow/skills/routes.toml +138 -0
  64. package/templates/default/locales/en/.mustflow/skills/rust-code-change/SKILL.md +154 -0
  65. package/templates/default/locales/en/.mustflow/skills/svelte-code-change/SKILL.md +186 -0
  66. package/templates/default/locales/en/.mustflow/skills/tailwind-code-change/SKILL.md +164 -0
  67. package/templates/default/locales/en/.mustflow/skills/tauri-code-change/SKILL.md +185 -0
  68. package/templates/default/locales/en/.mustflow/skills/typescript-code-change/SKILL.md +184 -0
  69. package/templates/default/locales/en/.mustflow/skills/unocss-code-change/SKILL.md +186 -0
  70. package/templates/default/manifest.toml +158 -1
@@ -2,6 +2,8 @@ import { spawnSync } from 'node:child_process';
2
2
  import { existsSync, readFileSync } from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { createCommandEnv } from './command-env.js';
5
+ const GIT_DIFF_TIMEOUT_MS = 10_000;
6
+ const GIT_DIFF_MAX_BUFFER_BYTES = 16 * 1024 * 1024;
5
7
  const TEST_CHANGE_KINDS = new Set(['test', 'test_fixture']);
6
8
  const SKIP_OR_ONLY_MARKER = /\b(?:describe|it|test)\s*\.\s*(?:skip|only)\s*\(/u;
7
9
  const TODO_OR_PENDING_MARKER = /\b(?:describe|it|test)\s*\.\s*(?:todo|pending)\s*\(/u;
@@ -49,30 +51,66 @@ function fileTextIfReadable(projectRoot, relativePath) {
49
51
  return null;
50
52
  }
51
53
  }
52
- function gitDiffLines(projectRoot, relativePath) {
53
- const result = spawnSync('git', ['diff', '--no-ext-diff', '--unified=0', '--', relativePath], {
54
- cwd: projectRoot,
55
- encoding: 'utf8',
56
- env: createCommandEnv(projectRoot, { policy: 'minimal', allowlist: [] }),
57
- windowsHide: true,
58
- });
59
- if (result.status !== 0 || typeof result.stdout !== 'string' || result.stdout.length === 0) {
60
- return { added: [], removed: [] };
61
- }
62
- const added = [];
63
- const removed = [];
64
- for (const line of result.stdout.split(/\r?\n/u)) {
65
- if (line.startsWith('+++') || line.startsWith('---')) {
54
+ function normalizeGitDiffPath(value) {
55
+ return value
56
+ .replace(/^"(.*)"$/u, '$1')
57
+ .replace(/^(?:a|b)\//u, '')
58
+ .replaceAll('\\', '/');
59
+ }
60
+ function parseGitDiffLines(stdout) {
61
+ const byPath = new Map();
62
+ let oldPath = null;
63
+ let currentPath = null;
64
+ for (const line of stdout.split(/\r?\n/u)) {
65
+ if (line.startsWith('--- ')) {
66
+ const rawPath = line.slice(4).trim();
67
+ oldPath = rawPath === '/dev/null' ? null : normalizeGitDiffPath(rawPath);
68
+ continue;
69
+ }
70
+ if (line.startsWith('+++ ')) {
71
+ const rawPath = line.slice(4).trim();
72
+ currentPath = rawPath === '/dev/null' ? oldPath : normalizeGitDiffPath(rawPath);
73
+ if (currentPath && !byPath.has(currentPath)) {
74
+ byPath.set(currentPath, { added: [], removed: [] });
75
+ }
76
+ continue;
77
+ }
78
+ if (!currentPath || line.startsWith('@@')) {
79
+ continue;
80
+ }
81
+ const diff = byPath.get(currentPath);
82
+ if (!diff) {
66
83
  continue;
67
84
  }
68
85
  if (line.startsWith('+')) {
69
- added.push(line.slice(1));
86
+ diff.added.push(line.slice(1));
70
87
  }
71
88
  else if (line.startsWith('-')) {
72
- removed.push(line.slice(1));
89
+ diff.removed.push(line.slice(1));
73
90
  }
74
91
  }
75
- return { added, removed };
92
+ return new Map([...byPath.entries()].map(([filePath, diff]) => [
93
+ filePath,
94
+ { added: diff.added, removed: diff.removed },
95
+ ]));
96
+ }
97
+ function gitDiffLinesByPath(projectRoot, relativePaths) {
98
+ const uniquePaths = [...new Set(relativePaths)].filter((relativePath) => resolveInsideRoot(projectRoot, relativePath) !== null);
99
+ if (uniquePaths.length === 0) {
100
+ return new Map();
101
+ }
102
+ const result = spawnSync('git', ['diff', '--no-ext-diff', '--unified=0', '--', ...uniquePaths], {
103
+ cwd: projectRoot,
104
+ encoding: 'utf8',
105
+ env: createCommandEnv(projectRoot, { policy: 'minimal', allowlist: [] }),
106
+ maxBuffer: GIT_DIFF_MAX_BUFFER_BYTES,
107
+ timeout: GIT_DIFF_TIMEOUT_MS,
108
+ windowsHide: true,
109
+ });
110
+ if (result.status !== 0 || typeof result.stdout !== 'string' || result.stdout.length === 0) {
111
+ return new Map();
112
+ }
113
+ return parseGitDiffLines(result.stdout);
76
114
  }
77
115
  function countMatching(lines, pattern) {
78
116
  return lines.filter((line) => pattern.test(line)).length;
@@ -105,6 +143,9 @@ export function countValidationRatchetVerdictEffects(risks) {
105
143
  export function createValidationRatchetRisks(report, projectRoot) {
106
144
  const risks = [];
107
145
  const seenRisks = new Set();
146
+ const changedDiffs = report.source === 'changed'
147
+ ? gitDiffLinesByPath(projectRoot, report.classifications.map((classification) => classification.path))
148
+ : new Map();
108
149
  function addRisk(code, severity, pathText, detail) {
109
150
  const key = `${pathText}\0${code}`;
110
151
  if (seenRisks.has(key)) {
@@ -115,7 +156,9 @@ export function createValidationRatchetRisks(report, projectRoot) {
115
156
  }
116
157
  for (const classification of report.classifications) {
117
158
  const resolvedPath = resolveInsideRoot(projectRoot, classification.path);
118
- const diff = report.source === 'changed' ? gitDiffLines(projectRoot, classification.path) : { added: [], removed: [] };
159
+ const diff = report.source === 'changed'
160
+ ? changedDiffs.get(classification.path) ?? { added: [], removed: [] }
161
+ : { added: [], removed: [] };
119
162
  const addedText = diff.added.join('\n');
120
163
  if (isTestClassification(classification)) {
121
164
  if (report.source === 'changed' && (resolvedPath === null || !existsSync(resolvedPath))) {
@@ -1,7 +1,14 @@
1
+ import { createHash } from 'node:crypto';
1
2
  import { isRecord, readString, readStringArray, } from './config-loading.js';
2
3
  export const VERIFICATION_DECISION_GRAPH_SCHEMA_VERSION = '1';
3
4
  function stableIdPart(value) {
4
- return value.trim().replace(/[^A-Za-z0-9_.-]+/gu, '_') || 'none';
5
+ const trimmed = value.trim();
6
+ if (trimmed.length === 0) {
7
+ return 'none';
8
+ }
9
+ const readable = trimmed.replace(/[^A-Za-z0-9_.-]+/gu, '_') || 'value';
10
+ const digest = createHash('sha256').update(trimmed).digest('hex').slice(0, 10);
11
+ return `${readable}_${digest}`;
5
12
  }
6
13
  function readBoolean(table, key) {
7
14
  const value = table[key];
@@ -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.17",
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
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mustflow.github.io/schemas/health.schema.json",
4
+ "title": "mustflow health API report",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "command",
10
+ "mustflow_root",
11
+ "status",
12
+ "installed",
13
+ "check_ok",
14
+ "command_contract_ok",
15
+ "runnable_count",
16
+ "git_status",
17
+ "changed_file_count",
18
+ "latest_run_exists",
19
+ "blockers",
20
+ "warnings",
21
+ "recommended_next_commands"
22
+ ],
23
+ "properties": {
24
+ "schema_version": { "const": "1" },
25
+ "command": { "const": "api health" },
26
+ "mustflow_root": { "type": "string" },
27
+ "status": { "enum": ["ok", "degraded", "blocked"] },
28
+ "installed": { "type": "boolean" },
29
+ "check_ok": { "type": "boolean" },
30
+ "command_contract_ok": { "type": "boolean" },
31
+ "runnable_count": { "type": "integer", "minimum": 0 },
32
+ "git_status": { "enum": ["available", "unavailable"] },
33
+ "changed_file_count": { "type": ["integer", "null"], "minimum": 0 },
34
+ "latest_run_exists": { "type": "boolean" },
35
+ "blockers": { "$ref": "#/$defs/stringArray" },
36
+ "warnings": { "$ref": "#/$defs/stringArray" },
37
+ "recommended_next_commands": { "$ref": "#/$defs/stringArray" }
38
+ },
39
+ "$defs": {
40
+ "stringArray": {
41
+ "type": "array",
42
+ "items": { "type": "string" }
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,95 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://mustflow.github.io/schemas/latest-evidence.schema.json",
4
+ "title": "mustflow latest evidence API report",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "command",
10
+ "mustflow_root",
11
+ "latest",
12
+ "manifest",
13
+ "policy",
14
+ "issues"
15
+ ],
16
+ "properties": {
17
+ "schema_version": { "const": "1" },
18
+ "command": { "const": "api latest-evidence" },
19
+ "mustflow_root": { "type": "string" },
20
+ "latest": { "$ref": "#/$defs/latest" },
21
+ "manifest": { "$ref": "#/$defs/manifest" },
22
+ "policy": { "$ref": "#/$defs/policy" },
23
+ "issues": { "$ref": "#/$defs/stringArray" }
24
+ },
25
+ "$defs": {
26
+ "stringArray": {
27
+ "type": "array",
28
+ "items": { "type": "string" }
29
+ },
30
+ "latest": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "required": [
34
+ "exists",
35
+ "path",
36
+ "kind",
37
+ "status",
38
+ "intent",
39
+ "reason",
40
+ "verification_plan_id",
41
+ "completion_verdict_status",
42
+ "manifest_path",
43
+ "receipt_path",
44
+ "run_dir",
45
+ "exit_code",
46
+ "timed_out",
47
+ "duration_ms",
48
+ "summary"
49
+ ],
50
+ "properties": {
51
+ "exists": { "type": "boolean" },
52
+ "path": { "const": ".mustflow/state/runs/latest.json" },
53
+ "kind": { "enum": ["run_receipt", "verify_run_summary", "unknown", null] },
54
+ "status": { "type": ["string", "null"] },
55
+ "intent": { "type": ["string", "null"] },
56
+ "reason": { "type": ["string", "null"] },
57
+ "verification_plan_id": { "type": ["string", "null"] },
58
+ "completion_verdict_status": { "type": ["string", "null"] },
59
+ "manifest_path": { "type": ["string", "null"] },
60
+ "receipt_path": { "type": ["string", "null"] },
61
+ "run_dir": { "type": ["string", "null"] },
62
+ "exit_code": { "type": ["integer", "null"] },
63
+ "timed_out": { "type": ["boolean", "null"] },
64
+ "duration_ms": { "type": ["integer", "null"], "minimum": 0 },
65
+ "summary": {
66
+ "anyOf": [
67
+ { "type": "null" },
68
+ { "type": "object" }
69
+ ]
70
+ }
71
+ }
72
+ },
73
+ "manifest": {
74
+ "type": "object",
75
+ "additionalProperties": false,
76
+ "required": ["status", "path", "receipt_count", "error"],
77
+ "properties": {
78
+ "status": { "enum": ["available", "missing", "unavailable", "not_applicable"] },
79
+ "path": { "type": ["string", "null"] },
80
+ "receipt_count": { "type": ["integer", "null"], "minimum": 0 },
81
+ "error": { "type": ["string", "null"] }
82
+ }
83
+ },
84
+ "policy": {
85
+ "type": "object",
86
+ "additionalProperties": false,
87
+ "required": ["raw_output_included", "hidden_reasoning_included", "max_bytes"],
88
+ "properties": {
89
+ "raw_output_included": { "const": false },
90
+ "hidden_reasoning_included": { "const": false },
91
+ "max_bytes": { "type": "integer", "minimum": 1 }
92
+ }
93
+ }
94
+ }
95
+ }